[LLVMdev] Inserting Instructions (pass)
Michael Graumann
MichaelGraumann at gmx.net
Fri Jul 31 10:24:08 PDT 2009
Hi,
I' am trying to insert an InlineAsm Instruction in my pass, which
FunctionType do I need for Inlineasm?
If I understand it right, I need a call instruction to insert the new
produced InlineAsm?
Thanks for help,
Michael
for (BasicBlock::iterator bi = i->begin(), be = i->end(); bi != be; ++bi){
std::vector<const Type*> asm_arguments;
FunctionType *asm_type = FunctionType::get(Type::VoidTy,
asm_arguments, false);
InlineAsm* au = new InlineAsm(asm_type ???,
"isync","~{dirflag},~{fpsr},~{flags}",true);
//CallInst* ae = new CallInst(au ??);
//Works fine
AllocaInst* ai = new AllocaInst(Type::Int16Ty);
Instruction *pi = bi;
pi->getParent()->getInstList().insert(pi, ai);
}
Test.ll
call void asm sideeffect "isync", "~{dirflag},~{fpsr},~{flags}"() nounwind
llvm::FunctionType
public:
/// FunctionType::get - This static method is the primary way of
constructing
/// a FunctionType.
///
static FunctionType *get(
const Type *Result, ///< The result type, isync is Void
const std::vector<const Type*> &Params, ///< The types of the parameters
???
bool isVarArg ///< Whether this is a variable argument length function,
isync false?
);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090731/8db7a6e8/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 6952 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090731/8db7a6e8/attachment.bin>
More information about the llvm-dev
mailing list