similar to: Insert CallInst within a function passing same parameters of the calling function.

Displaying 20 results from an estimated 800 matches similar to: "Insert CallInst within a function passing same parameters of the calling function."

2014 Dec 13
2
[LLVMdev] Correct way to access Function ArgumentList?
Hey All, I’m working with Mac OS X 10.10, and everything seems generally fine but when I started working on a FunctionPass I get the following: error: call to deleted constructor of 'Function::ArgumentListType' (aka 'iplist<llvm::Argument>') Function::ArgumentListType argList = f.getArgumentList(); Any pointers as to the correct way access the Arguments of a
2016 Feb 10
5
Question about an error we're now starting to get on LLVM 3.8.0rc2since
+llvm-dev > On 2016-Feb-09, at 12:54, Harris, Kevin <Kevin.Harris at unisys.com> wrote: > > Duncan, > Kevin Harris here, from Unisys. In our application, generating LLVM IR, we have several instances of code that looks like this: > > . . . > Value* pDS; > . . . > auto argIt = pFunc->arg_begin(); >
2011 Oct 06
2
[LLVMdev] How to create arguments CallInst
virtual std::vector<Value *> getESetArgumentosFunc(Function *F){ std::vector<Value *> varg_list; varg_list.clear(); for(Function::arg_iterator arg_iti = F->getArgumentList().begin(), arg_ite = F->getArgumentList().end(); arg_iti != arg_ite; ++arg_iti){ Value *para = ConstantInt::get(IntegerType::get(getGlobalContext(),32), 0); *Value *val2 = cast<*
2011 Oct 06
0
[LLVMdev] How to create arguments CallInst
On 10/6/11 12:40 PM, Rafael Baldiati Parizi wrote: > virtual std::vector<Value *> getESetArgumentosFunc(Function *F){ > std::vector<Value *> varg_list; > varg_list.clear(); > for(Function::arg_iterator arg_iti = F->getArgumentList().begin(), > arg_ite = F->getArgumentList().end(); arg_iti != arg_ite; ++arg_iti){ > Value *para = >
2011 Oct 06
0
[LLVMdev] How to create arguments CallInst
On 10/6/11 11:48 AM, Rafael Baldiati Parizi wrote: > Hello, > I need create a CallInst to this function > > define i32 @function(i32 %n, i8 %m){ ... } > > I now how get argument's type but I do not know how to create > arguments that meet these types. > For example, if the argument is long, accurate pass CallInst an > integer argument, however, if a Char, Char must
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
2011 Oct 06
2
[LLVMdev] How to create arguments CallInst
Hello, I need create a CallInst to this function define i32 @function(i32 %n, i8 %m){ ... } I now how get argument's type but I do not know how to create arguments that meet these types. For example, if the argument is long, accurate pass CallInst an integer argument, however, if a Char, Char must pass an argument. How to get the type of the argument of the function definition and create the
2005 Mar 08
1
[LLVMdev] Making Constants from GenericValues
I'm trying to turn some GenericValues into Constants in the interpreter using code like this, in a switch statement: case Type::IntTyID: SI = ConstantSInt::get(FB->getType(), ArgVals[i].IntVal); params.push_back(UI); UI->dump(); //for testing break; FB is a Function::ArgumentListType::iterator ArgVals is a std::vector<GenericValue> the switch
2013 Nov 05
1
[LLVMdev] Thread-safe cloning
Sorry to resurrect an old thread, but I finally got around to testing this approach (round tripping through bitcode in memory) and it works beautifully - and isn't that much slower than cloning. I have noticed however that the copy process isn't thread-safe. The problem is that in Function, there is lazy initialization code for arguments: void CheckLazyArguments() const { if
2014 Mar 03
3
[LLVMdev] [cfe-dev] C++11 reverse iterators (was C++11 is here)
On Mar 3, 2014, at 12:04 AM, Chandler Carruth <chandlerc at google.com> wrote: >> I was actually going to check in this, but I can post it for review if folks are worried. >> >> My plan was to provide an implementation of std::iterator_range<T> and then provide 'F.arguments()' which returns it. > > Nice. What's the logic behind .arguments() vs
2017 Mar 24
2
Problem about API difference between LLVM3.5 and LLVM3.9
Hi all, Recently I have implemented a transformation pass based on LLVM3.5 and its function is to duplicate the function's argument list in a bytecode file and replace all use of original function with modified function. In LLVM3.5, the pass can work properly. However, when I tried to transplant the pass to LLVM3.9, the error "Argument value does not match function argument type!"
2013 Jun 18
0
[LLVMdev] Thread-safe cloning
You could probably round trip it through bitcode in memory. I think all of the IR cloning functionality assumes that only one context is being used. Even if the serialization isn't efficient as a clone could be, it should give you very high confidence that everything Just Works. :) On Tue, Jun 18, 2013 at 1:16 PM, Andrew Clinton <andrew at sidefx.com> wrote: > I have a
2013 Jun 18
2
[LLVMdev] Thread-safe cloning
I have a Module/LLVMContext that I'd like to clone and manipulate in different threads (each thread may perform different translation / optimization, so they need unique copies). Currently this process has to be locked, since each clone of the Module still refers to the same LLVMContext. Is there a way to clone both the Module and LLVMContext so that the copies can be manipulated
2017 Mar 10
2
get function parameters (not arguments)
Sorry i'm using the following code: F = (cast<CallInst>(BI))->getCalledFunction(); for (auto& A : F->getArgumentList()) { errs() << "------- " << A.getName() << " " << "11" << "\n"; } But how can I get the parameters (as e and f in the example)? Thank you and best, Mo On
2007 Apr 17
1
[LLVMdev] Instantiating the new Instructions from CallInst Class
Hello All, I'm developing timing analysis tool using LLVM. After several analysis phases, I want to instantiate several instructions in the basic block. Instructions that I try to instantiate are like below; call void (int)* %waitABC(int 10) %tmp = call int (int, int*)* %doABC(int %i, int* %total) I think I should use 'CallInst' class in 'Instructions.h' file. How I could
2003 May 09
1
[LLVMdev] Function::getArgumentList() question
Hi folks -- The comments in Function.h for Function::getArgumentList() state that the argument list is empty for external functions. This entails (I think) that it is not possible to determine the contents of the argument list of functions for which LLVM has only seen a forward declaration, for a given compilation unit. Is this correct? If this is the case, is there any way around this?
2020 Nov 19
2
Understanding CallInst::Create
Hello; I am working on porting a tool written for LLVM3.5 to LLVM10. There used to be a call instruction with the signature static CallInst * Create (Value *F, Value *Actual, const Twine &NameStr="", Instruction *InsertBefore=0) Can anyone please explain what it supposed to do? What was F and Actual? Thank you so much. -- Dr. Arnamoy Bhattacharyya R&D Compiler Engineer
2002 Oct 11
2
[LLVMdev] Accessing a function's arguments
I am trying to generate a simple wrapper function: Function* pWrapper = m_module.getOrInsertFunction(name, FunctionType::get(Type::VoidTy, vector<const Type*>(1, PointerType::get(Type::IntTy)), false)); How do I actually get the Value* for the one argument to this function? The pWrapper->getArgumentList().size() is 0. Shouldn't the argument list contain the Value*
2008 Sep 13
0
[LLVMdev] Duplicate Function with duplicated Arguments
Hi James, > 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
2018 Mar 24
0
Change function call name in a CallInst only in certain functions
You are probably calling setName() on the called Function, which in-turned renamed the called Function instead of replacing the called function. Depending on your use-case, if you are certain that you only need to modify CallInsts, then you could simply call CallInst::setCalledFunction , otherwise it’s probably wiser to use CallSite as a wrapper for both CallInst and InvokeInst. Do note, however,