Displaying 20 results from an estimated 4000 matches similar to: "[LLVMdev] Function::getArgumentList() question"
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) {
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
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
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 May 29
2
[LLVMdev] CloneFunctionInto() Error
Dear All,
I need your help urgently
I have to copy the CFG of each function using CloneFunction or
CloneFunctionInto.
After I made the copy function. Print the basic blocks then get this error :
While deleting: i32 %
Use still stuck around after Def is destroyed: %mul2_ = mul nsw i32 %6, 3
Use still stuck around after Def is destroyed: store i32 3, i32* %x_,
align 4
opt: Value.cpp:75: virtual
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
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 Feb 28
2
[LLVMdev] Extending FunctionType
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: llvm::Function::getFunctionType() returns a
a reference to a const object, while modifying only the argument list yields an error during verification
since the
2017 Jun 08
4
DICompileUnit duplication in LLVM 4.0.0?
All,
I'm seeing duplication of DICompileUnits in a pass that worked in 3.8. I
assume I'm doing something wrong. Would someone be willing to point me in
the right direction?
The below minimized pass reproduces my issue in 4.0 with the following
error:
DICompileUnit not listed in llvm.dbg.cu
!1707 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1,
producer: "clang
2013 May 29
0
[LLVMdev] CloneFunctionInto() Error
Does cloning copies the function with its address or it constructs a new
address to the new function? Is this real copying for the CFG or just
opaque one to do some work?
If it's not real copying, please I need a method that can help me in
copying the function in another with new pointer to another address.
Please I need answer urgent
Thanks
On 29 May 2013 10:14, Rasha Omar <rasha.sala7
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
2017 Jun 08
2
DICompileUnit duplication in LLVM 4.0.0?
Thank you. What I need to do to address this? Open an issue on bugs.llvm.org?
I'm not sure what the fix needs to be in the cloner.
On Thu, Jun 8, 2017 at 4:19 PM, Peter Collingbourne <peter at pcc.me.uk> wrote:
> There have in the past been bugs in the cloner involving duplicate
> DICompileUnits (see e.g. https://reviews.llvm.org/D29240), this one may
> need a similar fix.
2011 Feb 28
0
[LLVMdev] Extending FunctionType
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:
> llvm::Function::getFunctionType() returns a
> a reference to a const object,
2013 Feb 25
2
[LLVMdev] Queries regarding function's arguments data type
Hi all,
I am working on my Master's project in security and I am trying to iterate
over the argument list of the function. Basically I need to do following
things :
1. Check data type of each argument of the argument list of the function.
2. Based on its data type like character array or integer array, pointer,
int, char, take different action.
3. I have added following code to check its
2009 Apr 07
0
[LLVMdev] Patch: MSIL backend global pointers initialization
Artur,
> OK, I just need the same signature for both of those instructions.
Both are callinsts of same function, isn't that enough? Since it's a
variadic function there is also a bitcast to proper type. So, looking
for type of callee (not result, but function type!) you'll obtain the
real "signature" of callee and if you'll strip all pointer cast you'll
obtain the
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
2009 Apr 07
3
[LLVMdev] Patch: MSIL backend global pointers initialization
Hello Anton
> %1 = tail call i32 (i8*, ...)* @printf(i8* noalias getelementptr ([16 x
> > i8]* @.str, i32 0, i32 0), i32 %0) nounwind
> > %10 = call i32 (i8*, ...)* @printf(i8* noalias getelementptr ([11 x i8]*
> > @.str2, i32 0, i32 0), i32 5) nounwind
> >
> > Instruction::isSameOperationAs() returns false for those two. Is it a
> > bug or I misunderstood
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:
>