search for: callingf

Displaying 3 results from an estimated 3 matches for "callingf".

Did you mean: calling
2011 Sep 16
2
[LLVMdev] How to duplicate a function?
...F.arg_begin(), E = F.arg_end(), NI = NF->arg_begin(); I != E; ++I, ++NI) { I->replaceAllUsesWith(NI); } #if 1 // Replace all callers while ( !F.use_empty() ) { CallSite CS(F.use_back()); Instruction *Call = CS.getInstruction(); // Function *CallingF = Call->getParent()->getParent(); // Get the global struct in our caller. //Value* CallerGlobals = ModifyFunctionRecursive(CallingF).first; Value* CallerGlobals = NULL; // <- This should be modified later. // Copy the existing arguments std::vector...
2011 Sep 16
0
[LLVMdev] How to duplicate a function?
...F.arg_begin(), E = F.arg_end(), NI = NF->arg_begin(); I != E; ++I, ++NI) { I->replaceAllUsesWith(NI); } #if 1 // Replace all callers while ( !F.use_empty() ) { CallSite CS(F.use_back()); Instruction *Call = CS.getInstruction(); // Function *CallingF = Call->getParent()->getParent(); // Get the global struct in our caller. //Value* CallerGlobals = ModifyFunctionRecursive(CallingF).first; Value* CallerGlobals = NULL; // <- This should be modified later. // Copy the existing arguments std::vector...
2008 Sep 13
3
[LLVMdev] Duplicate Function with duplicated Arguments
I'm now writing a pass and I wanna ask a question about how to duplicate the function and add duplicated arguments in llvm, for example: func(int a, char *b) -> func(int a, char *b, int a1, char *b1) I'm now stuck at using "getOrInsertFunction" and how to handle "getArgumentList", please share your opinion, thanks a lot! James