llvm.org GIT mirror llvm / a2e8972
[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 whitequark 9 months ago
1 changed file(s) with 20 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
7373 IntPredicate C.LLVMIntPredicate
7474 FloatPredicate C.LLVMRealPredicate
7575 LandingPadClause C.LLVMLandingPadClauseTy
76 InlineAsmDialect C.LLVMInlineAsmDialect
7677 )
7778
7879 func (c Context) IsNil() bool { return c.C == nil }
311312 const (
312313 LandingPadCatch LandingPadClause = C.LLVMLandingPadCatch
313314 LandingPadFilter LandingPadClause = C.LLVMLandingPadFilter
315 )
316
317 //-------------------------------------------------------------------------
318 // llvm.InlineAsmDialect
319 //-------------------------------------------------------------------------
320
321 const (
322 InlineAsmDialectATT InlineAsmDialect = C.LLVMInlineAsmDialectATT
323 InlineAsmDialectIntel InlineAsmDialect = C.LLVMInlineAsmDialectIntel
314324 )
315325
316326 //-------------------------------------------------------------------------
12361246 return
12371247 }
12381248
1249 // Operations on inline assembly
1250 func InlineAsm(t Type, asmString, constraints string, hasSideEffects, isAlignStack bool, dialect InlineAsmDialect) (rv Value) {
1251 casm := C.CString(asmString)
1252 defer C.free(unsafe.Pointer(casm))
1253 cconstraints := C.CString(constraints)
1254 defer C.free(unsafe.Pointer(cconstraints))
1255 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))
1256 return
1257 }
1258
12391259 //-------------------------------------------------------------------------
12401260 // llvm.Builder
12411261 //-------------------------------------------------------------------------