@@ -448,13 +448,6 @@ func (a Attribute) IsString() bool {
448
448
449
449
// Create and destroy modules.
450
450
// See llvm::Module::Module.
451
- func NewModule (name string ) (m Module ) {
452
- cname := C .CString (name )
453
- defer C .free (unsafe .Pointer (cname ))
454
- m .C = C .LLVMModuleCreateWithName (cname )
455
- return
456
- }
457
-
458
451
func (c Context ) NewModule (name string ) (m Module ) {
459
452
cname := C .CString (name )
460
453
defer C .free (unsafe .Pointer (cname ))
@@ -563,17 +556,6 @@ func (c Context) IntType(numbits int) (t Type) {
563
556
return
564
557
}
565
558
566
- func Int1Type () (t Type ) { t .C = C .LLVMInt1Type (); return }
567
- func Int8Type () (t Type ) { t .C = C .LLVMInt8Type (); return }
568
- func Int16Type () (t Type ) { t .C = C .LLVMInt16Type (); return }
569
- func Int32Type () (t Type ) { t .C = C .LLVMInt32Type (); return }
570
- func Int64Type () (t Type ) { t .C = C .LLVMInt64Type (); return }
571
-
572
- func IntType (numbits int ) (t Type ) {
573
- t .C = C .LLVMIntType (C .unsigned (numbits ))
574
- return
575
- }
576
-
577
559
func (t Type ) IntTypeWidth () int {
578
560
return int (C .LLVMGetIntTypeWidth (t .C ))
579
561
}
@@ -585,12 +567,6 @@ func (c Context) X86FP80Type() (t Type) { t.C = C.LLVMX86FP80TypeInContext(c.C)
585
567
func (c Context ) FP128Type () (t Type ) { t .C = C .LLVMFP128TypeInContext (c .C ); return }
586
568
func (c Context ) PPCFP128Type () (t Type ) { t .C = C .LLVMPPCFP128TypeInContext (c .C ); return }
587
569
588
- func FloatType () (t Type ) { t .C = C .LLVMFloatType (); return }
589
- func DoubleType () (t Type ) { t .C = C .LLVMDoubleType (); return }
590
- func X86FP80Type () (t Type ) { t .C = C .LLVMX86FP80Type (); return }
591
- func FP128Type () (t Type ) { t .C = C .LLVMFP128Type (); return }
592
- func PPCFP128Type () (t Type ) { t .C = C .LLVMPPCFP128Type (); return }
593
-
594
570
// Operations on function types
595
571
func FunctionType (returnType Type , paramTypes []Type , isVarArg bool ) (t Type ) {
596
572
var pt * C.LLVMTypeRef
@@ -706,9 +682,6 @@ func (c Context) VoidType() (t Type) { t.C = C.LLVMVoidTypeInContext(c.C); retu
706
682
func (c Context ) LabelType () (t Type ) { t .C = C .LLVMLabelTypeInContext (c .C ); return }
707
683
func (c Context ) TokenType () (t Type ) { t .C = C .LLVMTokenTypeInContext (c .C ); return }
708
684
709
- func VoidType () (t Type ) { t .C = C .LLVMVoidType (); return }
710
- func LabelType () (t Type ) { t .C = C .LLVMLabelType (); return }
711
-
712
685
//-------------------------------------------------------------------------
713
686
// llvm.Value
714
687
//-------------------------------------------------------------------------
@@ -1363,7 +1336,6 @@ func (v Value) AllocatedType() (t Type) { t.C = C.LLVMGetAllocatedType(v.C); ret
1363
1336
// exclusive means of building instructions using the C interface.
1364
1337
1365
1338
func (c Context ) NewBuilder () (b Builder ) { b .C = C .LLVMCreateBuilderInContext (c .C ); return }
1366
- func NewBuilder () (b Builder ) { b .C = C .LLVMCreateBuilder (); return }
1367
1339
func (b Builder ) SetInsertPoint (block BasicBlock , instr Value ) {
1368
1340
C .LLVMPositionBuilder (b .C , block .C , instr .C )
1369
1341
}
@@ -1402,7 +1374,7 @@ func (b Builder) GetCurrentDebugLocation() (loc DebugLoc) {
1402
1374
func (b Builder ) SetInstDebugLocation (v Value ) { C .LLVMSetInstDebugLocation (b .C , v .C ) }
1403
1375
func (b Builder ) InsertDeclare (module Module , storage Value , md Value ) Value {
1404
1376
f := module .NamedFunction ("llvm.dbg.declare" )
1405
- ftyp := FunctionType (VoidType (), []Type {storage .Type (), md .Type ()}, false )
1377
+ ftyp := FunctionType (module . Context (). VoidType (), []Type {storage .Type (), md .Type ()}, false )
1406
1378
if f .IsNil () {
1407
1379
f = AddFunction (module , "llvm.dbg.declare" , ftyp )
1408
1380
}
0 commit comments