search for: getargumentlist

Displaying 20 results from an estimated 22 matches for "getargumentlist".

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 th...
2014 Dec 13
2
[LLVMdev] Correct way to access Function ArgumentList?
...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 Function object? From what I saw on the docs it seems like this ought to work... Thanks, Jared -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachme...
2016 Mar 01
2
Insert CallInst within a function passing same parameters of the calling function.
...+ “_newfunction"); F.getParent()->getFunctionList().push_back(new_function); Function::ArgumentListType::iterator it = F.getArgumentList().begin(); Function::ArgumentListType::iterator end = F.getArgumentList().end(); std::vector<Value*> args; while (it != end) {...
2017 Mar 24
2
Problem about API difference between LLVM3.5 and LLVM3.9
...' denotes the duplicate of original function's return type; 'arg_types' denotes the duplicated argument type. And I have analysed the cause of error "Argument value does not match function argument type!" and I can determine that the error APIs are mutateType()(3rd line)or getArgumentList().insertAfter()(10th line) between LLVM3.5 and LLVM3.9. Anyone came across the same problem or knew the error API above? Thanks a lot! 1 unsigned address_space = func->getType()->getAddressSpace(); 2 FunctionType *new_type = FunctionType::get(new_return_type, arg_types, type...
2014 Mar 03
3
[LLVMdev] [cfe-dev] C++11 reverse iterators (was C++11 is here)
...behind .arguments() vs .getArguments()? I don't have a strong opinion either way, but there should be rationale. > > In the best case 'get' doesn't really add any meaning, and in the worst case it is actively misleading It's getting the range though, just like Function::getArgumentList() returns the argument list. > For example, you might iterate over operands, and assign through the iterator to mutate them. > > Really, these operate as range-views over some sequence. It seems particularly easy to teach foo_begin(), foo_end() -> foos() as well. That's a very ob...
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<* arg_iti->getType()*>(para); <--------------------------* para->setName("tes...
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 Fri, Mar 10, 2017 at 4:25 PM, Tim Northo...
2002 Oct 11
2
[LLVMdev] Accessing a function's arguments
...enerate 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* for the parameter? DEBUG(pWrapper->dump();); DEBUG(pWrapper->getFunctionType()->dump()); DEBUG(cerr << "number of arguments: " << pWrapper->getArgumentList().size() << endl;); T...
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 = > ConstantInt::get(IntegerType::get(getGlobalContext(),32), 0); > *Value *val2 = cast<* arg_iti->getType()*>(para); > <--------------------------* > para->setNam...
2008 Sep 13
0
[LLVMdev] Duplicate Function with duplicated Arguments
...nd 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! I have some code which does something similar. I'll send you an example when I'm office again next monday. Gr. Matthijs -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-s...
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
2014 Mar 04
2
[LLVMdev] [cfe-dev] C++11 reverse iterators (was C++11 is here)
...e.com> wrote: > > On Mon, Mar 3, 2014 at 9:48 AM, Chris Lattner <sabre at nondot.org> wrote: >> In the best case 'get' doesn't really add any meaning, and in the worst case it is actively misleading > > It's getting the range though, just like Function::getArgumentList() returns the argument list. > > I really disagree (and I disagree with getArgumentList for the same reason). > > getFoo should return something with value semantics (even if its a const reference to delay the copy). setFoo should directly mutate something. > > What we're r...
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
2013 Nov 05
1
[LLVMdev] Thread-safe cloning
...ocess isn't thread-safe. The problem is that in Function, there is lazy initialization code for arguments: void CheckLazyArguments() const { if (hasLazyArguments()) BuildLazyArguments(); } void BuildLazyArguments() const; I've worked around this by calling Function::getArgumentList() outside the threaded code to harden it before the threaded copies. Are there other lazy data structures that need to be solidified before threading? Should I be playing it safe and put a thread lock around the entire copy procedure? In case you are interested, here is the algorithm I'm...
2017 Mar 10
2
get function parameters (not arguments)
Hi Everyone, Does anyone know to get function parameters? For example, I want to get e and f in the call to function foo in the following code: foo(inr a , int b){ .... } main() { int e,f; e=10; f=22; *foo(e,f);* } I use the following code: for (auto& A : (cast<CallInst>(BI))->arg_operands ()) errs() << A.dump(); but I get a and b instead. Thank you
2002 Oct 11
0
[LLVMdev] Accessing a function's arguments
...> > 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* for the parameter? My incorrect assumption was that the ArgumentList would get built when the Function is instantiated -- by simply walking over the parameter type vector of the FunctionType. Instead you have to manually fil...
2017 Mar 10
2
get function parameters (not arguments)
...m Northover <t.p.northover at gmail.com> wrote: > On 10 March 2017 at 15:41, Mohammad Norouzi <mnmomn at gmail.com> wrote: > > 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)? > > The code...
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