File tree Expand file tree Collapse file tree 3 files changed +22
-0
lines changed Expand file tree Collapse file tree 3 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -409,6 +409,10 @@ declare namespace llvm {
409409
410410 static getInt32PtrTy ( context : LLVMContext , AS ?: number ) : PointerType ;
411411
412+ static getDoublePtrTy ( context : LLVMContext , AS ?: number ) : PointerType ;
413+
414+ static getFloatPtrTy ( context : LLVMContext , AS ?: number ) : PointerType ;
415+
412416 static getHalfTy ( context : LLVMContext ) : Type ;
413417
414418 protected constructor ( ) ;
Original file line number Diff line number Diff line change @@ -260,6 +260,8 @@ Nan::Persistent<v8::FunctionTemplate> &TypeWrapper::typeTemplate()
260260 Nan::SetMethod (typeTemplate, " getInt1PtrTy" , &getPointerType<&llvm::Type::getInt1PtrTy>);
261261 Nan::SetMethod (typeTemplate, " getInt8PtrTy" , &getPointerType<&llvm::Type::getInt8PtrTy>);
262262 Nan::SetMethod (typeTemplate, " getInt32PtrTy" , &getPointerType<&llvm::Type::getInt32PtrTy>);
263+ Nan::SetMethod (typeTemplate, " getFloatPtrTy" , &getPointerType<&llvm::Type::getFloatPtrTy>);
264+ Nan::SetMethod (typeTemplate, " getDoublePtrTy" , &getPointerType<&llvm::Type::getDoublePtrTy>);
263265
264266 Nan::SetPrototypeMethod (typeTemplate, " equals" , &equals);
265267 Nan::SetPrototypeMethod (typeTemplate, " isVoidTy" , &isOfType<&llvm::Type::isVoidTy>);
Original file line number Diff line number Diff line change @@ -128,6 +128,22 @@ describe("ir/type", () => {
128128 expect ( ty . isVoidTy ( ) ) . toBe ( false ) ;
129129 } ) ;
130130
131+ test ( "getDoublePtrTy returns a type for which isPointerTy is true" , ( ) => {
132+ const ty = llvm . Type . getDoublePtrTy ( context ) ;
133+
134+ expect ( ty ) . toBeInstanceOf ( llvm . Type ) ;
135+ expect ( ty . isPointerTy ( ) ) . toBe ( true ) ;
136+ expect ( ty . isVoidTy ( ) ) . toBe ( false ) ;
137+ } ) ;
138+
139+ test ( "getFloatPtrTy returns a type for which isPointerTy is true" , ( ) => {
140+ const ty = llvm . Type . getFloatPtrTy ( context ) ;
141+
142+ expect ( ty ) . toBeInstanceOf ( llvm . Type ) ;
143+ expect ( ty . isPointerTy ( ) ) . toBe ( true ) ;
144+ expect ( ty . isVoidTy ( ) ) . toBe ( false ) ;
145+ } ) ;
146+
131147 test ( "equals returns true if the two types are equal" , ( ) => {
132148 expect ( llvm . Type . getInt32Ty ( context ) . equals ( llvm . Type . getInt32Ty ( context ) ) ) . toBe ( true ) ;
133149 } ) ;
You can’t perform that action at this time.
0 commit comments