similar to: get function parameters (not arguments)

Displaying 20 results from an estimated 5000 matches similar to: "get function parameters (not arguments)"

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 Mar 10
2
get function parameters (not arguments)
I tried the original posted code again: for (auto& A : cast<CallInst>(BI)->arg_operands()) errs() << "--- " << A->getName() << "\n"; but it prints empty (only ---)! Thank you and best, Mo On Fri, Mar 10, 2017 at 4:44 PM, Tim Northover <t.p.northover at gmail.com> wrote: > On 10 March 2017 at 15:41, Mohammad Norouzi <mnmomn at
2017 Mar 10
2
get function parameters (not arguments)
what about the memory address of e and f? can i get them? Thank you and best, Mo On Fri, Mar 10, 2017 at 5:02 PM, Tim Northover <t.p.northover at gmail.com> wrote: > On 10 March 2017 at 15:49, Mohammad Norouzi <mnmomn at gmail.com> wrote: > > for (auto& A : cast<CallInst>(BI)->arg_operands()) > > errs() << "--- " << A->getName()
2016 Feb 08
3
distinguish program and temporary variables
I'm writing a pass that eliminates some variables. To show the effect of the pass i need to show that I deleted the variables that originally appear in the user code, not temporary variables added by llvm. On Mon, Feb 8, 2016 at 5:59 PM, Mehdi Amini <mehdi.amini at apple.com> wrote: > > > On Feb 8, 2016, at 6:39 AM, Mohammad Norouzi via llvm-dev < > llvm-dev at
2016 Feb 08
4
distinguish program and temporary variables
Hi, I need to check if a variable belongs to the program originally. Consider the following code line: y = x + 4 and its corresponding llvm ir (roughly): %16 = load i32 %x %add = add i32 %16, i32 4 store i32 %add, %y I need to distinguish between %16, %add and %x, %y. Any help is appreciated. Best, Mohammad -------------- next part -------------- An HTML attachment was scrubbed... URL:
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) {
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<*
2016 Mar 23
4
relation between address spaces and physical memory locations
Hi, Do address spaces in llvm corespond to different memory locations? For example, Shared and Global refer to RAM while Local refers to registers? I guess that this may be true in GPU programming. So, I would like to know about CPUs. Thanks. Best, Mohammad -------------- next part -------------- An HTML attachment was scrubbed... URL:
2019 Nov 26
2
[Clang] memory allocation
Thanks David for your reply! However, OK is called inside nqueens. So, the same stack space cannot be used/reused for both of them. Best, Mohammad On Wed, Nov 20, 2019 at 11:43 PM David Blaikie <dblaikie at gmail.com> wrote: > You printed &j and &solutions - did you mean to print 'solutions' instead > of '&solutions' Because 'solutions' and
2016 Mar 03
2
get debug info after optimization
Hi, Is it possible to get debug information after optimization? for example, source code line numbers of instructions in an ir that is optimized by O2? Best, Mohammad -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160303/af4f46a7/attachment.html>
2016 Feb 04
3
result of load Instruction
Hi all, How can i find the instruction that uses the result of a load instruction. For example: %16 = load i32, i32* %ptr %add = add i32 4, %16 In this case, i would like to get the add instruction. Best, Mo -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160204/bdef6f63/attachment.html>
2019 Nov 20
2
[Clang] memory allocation
Hi, Could anyone please help me understand why Clang reallocates the same memory address for different variables while their lifetime intersect? Here is an example code: #include <stdlib.h> #include <stdio.h> #include <memory.h> #include <alloca.h> /* Checking information */ static int solutions[] = { 1, 0, 0, 2, 10, /* 5 */
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
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
2016 Feb 08
2
distinguish program and temporary variables
> Hi, > > I need to check if a variable belongs to the program originally. Consider > the following code line: > > y = x + 4 > > and its corresponding llvm ir (roughly): > > %16 = load i32 %x > %add = add i32 %16, i32 4 > store i32 %add, %y > > I need to distinguish between %16, %add and %x, %y. > > > You might be able to use the Debug information
2016 Mar 23
0
relation between address spaces and physical memory locations
On 23 Mar 2016, at 11:35, Mohammad Norouzi <mnmomn at gmail.com> wrote: > > Thanks for the reply. > > On Wed, Mar 23, 2016 at 10:43 AM, James Molloy <james at jamesmolloy.co.uk> wrote: > Hi, > > Address spaces in LLVM are an abstract concept and LLVM attaches no internal meaning to address spaces, apart from: > > - Location 0 in address space 0 is
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
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