mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-03 17:32:59 +00:00
[bindings/go] Add Go bindings for inline assembly
Reviewers: harlanhaskins, whitequark, pcc Reviewed By: pcc Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D46437 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343339 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
1bece59b9d
commit
a2e8972f37
@ -74,6 +74,7 @@ type (
|
||||
IntPredicate C.LLVMIntPredicate
|
||||
FloatPredicate C.LLVMRealPredicate
|
||||
LandingPadClause C.LLVMLandingPadClauseTy
|
||||
InlineAsmDialect C.LLVMInlineAsmDialect
|
||||
)
|
||||
|
||||
func (c Context) IsNil() bool { return c.C == nil }
|
||||
@ -314,6 +315,15 @@ const (
|
||||
LandingPadFilter LandingPadClause = C.LLVMLandingPadFilter
|
||||
)
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// llvm.InlineAsmDialect
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
const (
|
||||
InlineAsmDialectATT InlineAsmDialect = C.LLVMInlineAsmDialectATT
|
||||
InlineAsmDialectIntel InlineAsmDialect = C.LLVMInlineAsmDialectIntel
|
||||
)
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// llvm.Context
|
||||
//-------------------------------------------------------------------------
|
||||
@ -1237,6 +1247,16 @@ func (v Value) IncomingBlock(i int) (bb BasicBlock) {
|
||||
return
|
||||
}
|
||||
|
||||
// Operations on inline assembly
|
||||
func InlineAsm(t Type, asmString, constraints string, hasSideEffects, isAlignStack bool, dialect InlineAsmDialect) (rv Value) {
|
||||
casm := C.CString(asmString)
|
||||
defer C.free(unsafe.Pointer(casm))
|
||||
cconstraints := C.CString(constraints)
|
||||
defer C.free(unsafe.Pointer(cconstraints))
|
||||
rv.C = C.LLVMGetInlineAsm(t.C, casm, C.size_t(len(asmString)), cconstraints, C.size_t(len(constraints)), boolToLLVMBool(hasSideEffects), boolToLLVMBool(isAlignStack), C.LLVMInlineAsmDialect(dialect))
|
||||
return
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// llvm.Builder
|
||||
//-------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user