Skip to content

Commit

Permalink
go fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
aykevl committed Jun 26, 2022
1 parent 5f1fae7 commit e3c479f
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 29 deletions.
61 changes: 41 additions & 20 deletions ir.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ const (
LargestComdatSelectionKind ComdatSelectionKind = C.LLVMLargestComdatSelectionKind
// LLVM < 13: NoDuplicatesComdatSelectionKind ComdatSelectionKind = C.LLVMNoDuplicatesComdatSelectionKind
// LLVM >= 13: NoDeduplicateComdatSelectionKind ComdatSelectionKind = C.LLVMNoDeduplicateComdatSelectionKind
SameSizeComdatSelectionKind ComdatSelectionKind = C.LLVMSameSizeComdatSelectionKind
SameSizeComdatSelectionKind ComdatSelectionKind = C.LLVMSameSizeComdatSelectionKind
)

//-------------------------------------------------------------------------
Expand Down Expand Up @@ -957,20 +957,26 @@ func ConstInBoundsGEP(v Value, indices []Value) (rv Value) {
rv.C = C.LLVMConstInBoundsGEP(v.C, ptr, nvals)
return
}
func ConstTrunc(v Value, t Type) (rv Value) { rv.C = C.LLVMConstTrunc(v.C, t.C); return }
func ConstSExt(v Value, t Type) (rv Value) { rv.C = C.LLVMConstSExt(v.C, t.C); return }
func ConstZExt(v Value, t Type) (rv Value) { rv.C = C.LLVMConstZExt(v.C, t.C); return }
func ConstFPTrunc(v Value, t Type) (rv Value) { rv.C = C.LLVMConstFPTrunc(v.C, t.C); return }
func ConstFPExt(v Value, t Type) (rv Value) { rv.C = C.LLVMConstFPExt(v.C, t.C); return }
func ConstUIToFP(v Value, t Type) (rv Value) { rv.C = C.LLVMConstUIToFP(v.C, t.C); return }
func ConstSIToFP(v Value, t Type) (rv Value) { rv.C = C.LLVMConstSIToFP(v.C, t.C); return }
func ConstFPToUI(v Value, t Type) (rv Value) { rv.C = C.LLVMConstFPToUI(v.C, t.C); return }
func ConstFPToSI(v Value, t Type) (rv Value) { rv.C = C.LLVMConstFPToSI(v.C, t.C); return }
func ConstPtrToInt(v Value, t Type) (rv Value) { rv.C = C.LLVMConstPtrToInt(v.C, t.C); return }
func ConstIntToPtr(v Value, t Type) (rv Value) { rv.C = C.LLVMConstIntToPtr(v.C, t.C); return }
func ConstBitCast(v Value, t Type) (rv Value) { rv.C = C.LLVMConstBitCast(v.C, t.C); return }
func ConstZExtOrBitCast(v Value, t Type) (rv Value) { rv.C = C.LLVMConstZExtOrBitCast(v.C, t.C); return }
func ConstSExtOrBitCast(v Value, t Type) (rv Value) { rv.C = C.LLVMConstSExtOrBitCast(v.C, t.C); return }
func ConstTrunc(v Value, t Type) (rv Value) { rv.C = C.LLVMConstTrunc(v.C, t.C); return }
func ConstSExt(v Value, t Type) (rv Value) { rv.C = C.LLVMConstSExt(v.C, t.C); return }
func ConstZExt(v Value, t Type) (rv Value) { rv.C = C.LLVMConstZExt(v.C, t.C); return }
func ConstFPTrunc(v Value, t Type) (rv Value) { rv.C = C.LLVMConstFPTrunc(v.C, t.C); return }
func ConstFPExt(v Value, t Type) (rv Value) { rv.C = C.LLVMConstFPExt(v.C, t.C); return }
func ConstUIToFP(v Value, t Type) (rv Value) { rv.C = C.LLVMConstUIToFP(v.C, t.C); return }
func ConstSIToFP(v Value, t Type) (rv Value) { rv.C = C.LLVMConstSIToFP(v.C, t.C); return }
func ConstFPToUI(v Value, t Type) (rv Value) { rv.C = C.LLVMConstFPToUI(v.C, t.C); return }
func ConstFPToSI(v Value, t Type) (rv Value) { rv.C = C.LLVMConstFPToSI(v.C, t.C); return }
func ConstPtrToInt(v Value, t Type) (rv Value) { rv.C = C.LLVMConstPtrToInt(v.C, t.C); return }
func ConstIntToPtr(v Value, t Type) (rv Value) { rv.C = C.LLVMConstIntToPtr(v.C, t.C); return }
func ConstBitCast(v Value, t Type) (rv Value) { rv.C = C.LLVMConstBitCast(v.C, t.C); return }
func ConstZExtOrBitCast(v Value, t Type) (rv Value) {
rv.C = C.LLVMConstZExtOrBitCast(v.C, t.C)
return
}
func ConstSExtOrBitCast(v Value, t Type) (rv Value) {
rv.C = C.LLVMConstSExtOrBitCast(v.C, t.C)
return
}
func ConstTruncOrBitCast(v Value, t Type) (rv Value) {
rv.C = C.LLVMConstTruncOrBitCast(v.C, t.C)
return
Expand Down Expand Up @@ -1227,11 +1233,26 @@ func (v Value) BasicBlocks() []BasicBlock {
C.LLVMGetBasicBlocks(v.C, llvmBasicBlockRefPtr(&out[0]))
return out
}
func (v Value) FirstBasicBlock() (bb BasicBlock) { bb.C = C.LLVMGetFirstBasicBlock(v.C); return }
func (v Value) LastBasicBlock() (bb BasicBlock) { bb.C = C.LLVMGetLastBasicBlock(v.C); return }
func NextBasicBlock(bb BasicBlock) (rbb BasicBlock) { rbb.C = C.LLVMGetNextBasicBlock(bb.C); return }
func PrevBasicBlock(bb BasicBlock) (rbb BasicBlock) { rbb.C = C.LLVMGetPreviousBasicBlock(bb.C); return }
func (v Value) EntryBasicBlock() (bb BasicBlock) { bb.C = C.LLVMGetEntryBasicBlock(v.C); return }
func (v Value) FirstBasicBlock() (bb BasicBlock) {
bb.C = C.LLVMGetFirstBasicBlock(v.C)
return
}
func (v Value) LastBasicBlock() (bb BasicBlock) {
bb.C = C.LLVMGetLastBasicBlock(v.C)
return
}
func NextBasicBlock(bb BasicBlock) (rbb BasicBlock) {
rbb.C = C.LLVMGetNextBasicBlock(bb.C)
return
}
func PrevBasicBlock(bb BasicBlock) (rbb BasicBlock) {
rbb.C = C.LLVMGetPreviousBasicBlock(bb.C)
return
}
func (v Value) EntryBasicBlock() (bb BasicBlock) {
bb.C = C.LLVMGetEntryBasicBlock(v.C)
return
}
func (c Context) AddBasicBlock(f Value, name string) (bb BasicBlock) {
cname := C.CString(name)
defer C.free(unsafe.Pointer(cname))
Expand Down
1 change: 1 addition & 0 deletions llvm_dep.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
//
//===----------------------------------------------------------------------===//

//go:build !byollvm
// +build !byollvm

package llvm
Expand Down
18 changes: 9 additions & 9 deletions transforms_ipo.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ func boolToUnsigned(b bool) C.unsigned {
return 0
}

func (pm PassManager) AddArgumentPromotionPass() { C.LLVMAddArgumentPromotionPass(pm.C) }
func (pm PassManager) AddConstantMergePass() { C.LLVMAddConstantMergePass(pm.C) }
func (pm PassManager) AddDeadArgEliminationPass() { C.LLVMAddDeadArgEliminationPass(pm.C) }
func (pm PassManager) AddFunctionAttrsPass() { C.LLVMAddFunctionAttrsPass(pm.C) }
func (pm PassManager) AddFunctionInliningPass() { C.LLVMAddFunctionInliningPass(pm.C) }
func (pm PassManager) AddGlobalDCEPass() { C.LLVMAddGlobalDCEPass(pm.C) }
func (pm PassManager) AddGlobalOptimizerPass() { C.LLVMAddGlobalOptimizerPass(pm.C) }
func (pm PassManager) AddPruneEHPass() { C.LLVMAddPruneEHPass(pm.C) }
func (pm PassManager) AddIPSCCPPass() { C.LLVMAddIPSCCPPass(pm.C) }
func (pm PassManager) AddArgumentPromotionPass() { C.LLVMAddArgumentPromotionPass(pm.C) }
func (pm PassManager) AddConstantMergePass() { C.LLVMAddConstantMergePass(pm.C) }
func (pm PassManager) AddDeadArgEliminationPass() { C.LLVMAddDeadArgEliminationPass(pm.C) }
func (pm PassManager) AddFunctionAttrsPass() { C.LLVMAddFunctionAttrsPass(pm.C) }
func (pm PassManager) AddFunctionInliningPass() { C.LLVMAddFunctionInliningPass(pm.C) }
func (pm PassManager) AddGlobalDCEPass() { C.LLVMAddGlobalDCEPass(pm.C) }
func (pm PassManager) AddGlobalOptimizerPass() { C.LLVMAddGlobalOptimizerPass(pm.C) }
func (pm PassManager) AddPruneEHPass() { C.LLVMAddPruneEHPass(pm.C) }
func (pm PassManager) AddIPSCCPPass() { C.LLVMAddIPSCCPPass(pm.C) }
func (pm PassManager) AddInternalizePass(allButMain bool) {
C.LLVMAddInternalizePass(pm.C, boolToUnsigned(allButMain))
}
Expand Down

0 comments on commit e3c479f

Please sign in to comment.