search for: callerglobals

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

2011 Sep 16
2
[LLVMdev] How to duplicate a function?
...With(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<Value*> Args; Args.reserve(CS.arg_size()); CallSite::arg_iterator AI = CS.arg_begin(), AE = CS.ar...
2011 Sep 16
0
[LLVMdev] How to duplicate a function?
...With(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<Value*> Args; Args.reserve(CS.arg_size()); CallSite::arg_iterator AI = CS.arg_begin(), AE = CS.ar...
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