Add InlineAsm

This commit is contained in:
Siu Kwan Lam 2012-10-31 16:41:10 -05:00
commit 507ff73061
4 changed files with 71 additions and 1 deletions

View file

@ -74,6 +74,7 @@
#include "llvm/Transforms/Utils/Cloning.h"
#include "llvm/Linker.h"
#include "llvm/Support/SourceMgr.h"
#include <llvm/InlineAsm.h>
// LLVM-C includes
@ -135,6 +136,22 @@ const CodeGenOpt::Level OptLevelMap[] = {
};
} // end anony namespace
LLVMValueRef LLVMGetFunctionFromInlineAsm(LLVMTypeRef funcType,
const char inlineAsm[],
const char constrains[],
bool hasSideEffect,
bool isAlignStack,
int asmDialect)
{
using namespace llvm;
FunctionType *fnty = unwrap<FunctionType>(funcType);
// asmDialect does not exist for LLVM 3.1
InlineAsm *inlineasmobj = InlineAsm::get(fnty, inlineAsm, constrains,
hasSideEffect, isAlignStack);
return wrap(inlineasmobj);
}
LLVMModuleRef LLVMCloneModule(LLVMModuleRef mod)
{
using namespace llvm;