Displaying 20 results from an estimated 600 matches similar to: "[LLVMdev] Accessing a function's arguments"
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
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
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 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) {
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
2018 May 11
2
About Error: Interpreter has not been linked in
Hello,
When I try to create execution engine I do get "*Interpreter has not been
linked in.*" error and EngineBuilder returns NULL.
Here is the line I use to create execution engine:
auto executionEngine =
llvm::EngineBuilder(std::move(m_module)).setErrorStr(&error).create();
Here are all headers I have included:
#include "llvm/ADT/STLExtras.h"
#include
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?
2018 May 11
0
About Error: Interpreter has not been linked in
Ok. I figured out. Following methods needs to be called. That fixed the
issue.
llvm::InitializeNativeTarget();
LLVMInitializeNativeAsmPrinter();
LLVMInitializeNativeAsmParser();
LLVMLinkInMCJIT();
Aaron
On Thu, May 10, 2018 at 8:33 PM, Aaron <acraft at gmail.com> wrote:
> Hello,
>
> When I try to create execution engine I do get "*Interpreter has not been
> linked
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 May 11
1
About Error: Interpreter has not been linked in
I believe the correct way is actually include the Interpreter’s header and the rest is handled automatically. Should be similar for MCJIT
Zhang
> On 11 May 2018, at 05:21, Aaron via llvm-dev <llvm-dev at lists.llvm.org> wrote:
>
> Ok. I figured out. Following methods needs to be called. That fixed the issue.
>
> llvm::InitializeNativeTarget();
>
2005 Oct 16
2
[LLVMdev] Help on LLVM Instrumentation
Hi ,
I am using LLVM for my Post Graduate course project on Optimization. I am trying to do some insrtumentation to the bytecode.I 've been going through your Instrumentation code for the past few days in /llvm/lib/Transforms/Instrumentation folder and finally found two ways of instrumentation :
1) injecting LLVM bytecode instructions
2) calling an external C function.
I am trying both and
2012 Aug 01
2
[LLVMdev] [RFC] New command line parsing/generating framework for clang and lld.
LLVM Command Line Library
I'm proposing a heavy weight command line parsing and generating library for
LLVM to replace Clang's parser and provide one for lld and any future tools
that may need it.
The scope of this library is slightly larger than what Clang has now, but not
much.
It is centered around the concept of a Tool. A Tool has a set of Options which
can be parsed to Arguments or
2009 Jan 02
1
[LLVMdev] Function Type and Argument List
Hi all,
I am having some problem using the Function class. For my application,
FunctionType is not known at the time I initialize the function. So, I just
initialize the Function as return type
void with no arguments. As I work on my function, I get to know the
arguments and I insert the arguments in ArgumentList data structure of the
function. The FunctionType is defined as const and I can't
2002 Oct 30
2
[LLVMdev] running out of space in /usr/dcs/projects
% df -k /usr/dcs/projects
Filesystem kbytes used avail capacity Mounted on
csil-server1:/usr/dcs/csil-projects
17332442 16991416 167702 100% /usr/dcs/projects
% date
Wed Oct 30 21:21:25 CST 2002
if anybody has good ideas on how to reduce disk usage, better speak up
now....
2002 Oct 08
1
[LLVMdev] producing error messages
This may be a a long shot but I'll ask anyway. Does LLVM have any
way of mapping an Instruction or Value back to the original position
(file, line number) in the source code? I'm writing a pass that among
other things may detect some semantic errors in the way the user uses
a particular API. I would like to report these errors to the user and
identify the location of the error in the
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