similar to: [LLVMdev] Correct way to access Function ArgumentList?

Displaying 20 results from an estimated 1000 matches similar to: "[LLVMdev] Correct way to access Function ArgumentList?"

2016 Mar 01
2
Insert CallInst within a function passing same parameters of the calling function.
Hi, supposing I have a function “foo” like the following: int foo(int a, int b) { ... ... } I want to insert int the LLVM IR a call instructions to a function “bar” that requires the same parameters of foo. So my function foo will become: int foo(int a, int b) { bar(a,b); … ... } I am using the following code: bool ThreadSanitizer::runOnFunction(Function &F) {
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(); >
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*
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!"
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<*
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
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 = >
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
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
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?
2011 Sep 04
1
[LLVMdev] correct types for ArgumentList?
I'm trying to create and insert a anonymous function that will make a assignment on a GlobalVariable, based on a existing StoreInst. Once I find this StoreInst(which provides me with 2 Value* objects for me to use) I need to pass it to my anonymous function so it can carry out the assignment. I can not get the correct types, at runtime I get a bad signature error. So basically the function is
2012 Jan 12
3
[LLVMdev] 'opt' Aborted "While deleting: void %"
Hey everyone, So I have an LLVM pass that appears to run completely and work fine, and then it aborts at the very end. When exiting the final runOnFunction call, I get the following error / stack dump. I cannot figure out why this is happening for the life of me - does anyone have any ideas? I'm not trying to do any crazy deallocation or anything, it just seems like a normal pass to me.
2002 Oct 11
0
[LLVMdev] Accessing a function's arguments
Just a followup for the archives ... > 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
2012 Jan 12
0
[LLVMdev] 'opt' Aborted "While deleting: void %"
Hi Griffin, did your pass create a data structure that holds values somehow, and forgot to delete it? Also, try running under valgrind in case this is due to a memory error of some kind. Ciao, Duncan. > So I have an LLVM pass that appears to run completely and work fine, and > then it aborts at the very end. When exiting the final runOnFunction call, > I get the following error /
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
2011 Feb 28
3
[LLVMdev] Extending FunctionType
2011/2/28 John Criswell <criswell at illinois.edu>: > On 2/28/11 6:31 AM, Gabriel Rodríguez wrote: > > Hi all, > > I am trying to extend a FunctionType to include new parameters. In > particular, I want to > ensure that the main function has been declared with both argsc and argsv. > However > there seems to be no easy way to accomplish this: >
2004 Jul 11
2
[LLVMdev] Adding type qualifies or property
Hi Has anybody tell me how to create some new type qualifies in LVM? A type qualify, like "const" in C, is useful for program analysis. I hope that I can set/get the type qualify of any value in a program analysed. Or, if I could add a property to the value class and set/get the property, it is same to add some new type qualifies. So, I simply insert a "int" private
2012 Jan 13
1
[LLVMdev] 'opt' Aborted "While deleting: void %"
Using Valgrind hasn't shown me anything terribly unusual. And I'm confused because its not even trying to delete a real instruction; deleting a void type with no name? That doesn't make any sense... Any other hints? I've seen a few posts in the past about this relating to some internal LLVM bugs... -Griffin On Thu, 12 Jan 2012 21:26:41 +0100, Duncan Sands <baldrick at
2012 Jan 25
2
[LLVMdev] PLEASE help with Alias Analysis initialization assertion at the end of my pass
Hello all, I really, really, really need your help. This is my third email now, please don't ignore me! I understand this must be a trivial thing, but I've ground to a halt, and REALLY need some guidance. Please see below for the context of my problem. I'm not trying to be a waste of time, but I'm desperate here. I have a getAnalysisUsage method which does the following
2012 Jan 25
1
[LLVMdev] PLEASE help with Alias Analysis initialization assertion at the end of my pass
Yes, it is a pass. Here is a very general overview of the file structure as far as the AA is concerned. LLVM is not my strong-suit, I do hardware simulators, not compilers. using namespace llvm; char RelRecovery::ID = 0; static RegisterPass<RelRecovery> X("relRecovery", "Reliability transformation for lightweight recovery"); void