Displaying 20 results from an estimated 5000 matches similar to: "[LLVMdev] inserting exit function into IR"
2011 Mar 31
0
[LLVMdev] inserting exit function into IR
Hi George,
Could you be a more specific about what you are trying to do, how you are
trying to do it, and what is failing. A couple of relevant snippets of code
would do wonders in helping you.
Thanks,
Joshua
On Wed, Mar 30, 2011 at 3:59 PM, George Baah <georgebaah at gmail.com> wrote:
> Hi Everyone,
> I am trying to insert an exit function into my IR.
> However, I thought
2011 Mar 31
3
[LLVMdev] inserting exit function into IR
Hi Joshua,
I have a function foo and I want to insert exit(0) at the end of foo.
The problem is M.getFunction returns null, which is understandable. I am not
sure what to do. Below is the code snippet.
void foo(int argc, char* argv[]) {
printf("hello world\n");
exit(0); //***I want to insert this exit
}
My llvm code snippet is
vector<const Type *> params =
2011 Mar 31
0
[LLVMdev] inserting exit function into IR
On Thu, Mar 31, 2011 at 9:31 PM, George Baah <georgebaah at gmail.com> wrote:
> Hi Joshua,
> I have a function foo and I want to insert exit(0) at the end of foo.
> The problem is M.getFunction returns null, which is understandable. I am not
> sure what to do. Below is the code snippet.
> void foo(int argc, char* argv[]) {
> printf("hello world\n");
>
2011 Mar 31
2
[LLVMdev] inserting exit function into IR
I did M.getOrInsertFunction and called the exit function with .
IRBuilder<> builder = IRBuilder<>(...);
Value *one = ConstantInt::get(Type::getInt32Ty(M.getContext()),1);
builder.CreateCall(exitF,one,"tmp4");
"Instruction has a name, but provides a void value!
%tmp4 = call void @exit(i32 1)
Broken module found, compilation aborted! "
On Thu, Mar 31,
2011 Apr 05
3
[LLVMdev] inserting a print statement into IR
Hi Everyone,
I am trying to construct the print statement : printf("value:%d\n",
value);
This is my llvm code. It is seg faulting at
builder.CreateGlobalStringPtr(str,"").
Thanks.
George
vector<const Type *> params;
params.push_back(Type::getInt8PtrTy(M.getContext()));
FunctionType *fType =
FunctionType::get(Type::getInt32Ty(M.getContext()), params, true);
Constant
2011 Mar 31
1
[LLVMdev] inserting exit function into IR
Thank you very much guys, I really appreciate your help.
George
On Thu, Mar 31, 2011 at 3:58 PM, Frits van Bommel <fvbommel at gmail.com>wrote:
> On Thu, Mar 31, 2011 at 9:57 PM, George Baah <georgebaah at gmail.com> wrote:
> > I did M.getOrInsertFunction and called the exit function with .
> >
> > IRBuilder<> builder = IRBuilder<>(...);
> >
2011 Apr 05
0
[LLVMdev] inserting a print statement into IR
On 4/4/2011 6:26 PM, George Baah wrote:
> Hi Everyone,
> I am trying to construct the print statement : printf("value:%d\n",
> value);
> This is my llvm code. It is seg faulting at
> builder.CreateGlobalStringPtr(str,"").
This might be easier to debug with a stack trace. Use a debugger to see
the call stack when the segfault occurs. Also try to isolate
2011 Mar 31
0
[LLVMdev] inserting exit function into IR
On Thu, Mar 31, 2011 at 9:57 PM, George Baah <georgebaah at gmail.com> wrote:
> I did M.getOrInsertFunction and called the exit function with .
>
> IRBuilder<> builder = IRBuilder<>(...);
>
> Value *one = ConstantInt::get(Type::getInt32Ty(M.getContext()),1);
>
> builder.CreateCall(exitF,one,"tmp4");
>
> "Instruction has a name, but
2011 Apr 01
3
[LLVMdev] insert printf into IR
Hi All,
I am trying to insert printf ("%d", v), where v is an integer param, into
the IR.
I am doing something wrong because I keep getting segfaults.
Below is my code. Thanks.
vector<const Type *> params;
params.push_back(Type::getInt8PtrTy(M.getContext()));
params.push_back(Type::getInt32Ty(M.getContext()));
FunctionType *fType =
2011 Apr 05
2
[LLVMdev] inserting a print statement into IR
This is the seg fault I am getting.
dyld: lazy symbol binding failed: Symbol not found:
__ZN4llvm13IRBuilderBase18CreateGlobalStringEPKcRKNS_5TwineE
Referenced from:
/Users/georgebaah/llvm_dir/llvm-2.8/Debug+Asserts/lib/LLVMArrayBoundsCheck.dylib
Expected in: flat namespace
dyld: Symbol not found:
__ZN4llvm13IRBuilderBase18CreateGlobalStringEPKcRKNS_5TwineE
Referenced from:
2012 Oct 04
2
[LLVMdev] question
That's because instructions have a location associated with them, not
a compile unit.
-eric
On Thu, Oct 4, 2012 at 12:46 PM, George Baah <georgebaah at gmail.com> wrote:
> I used DILocation instead of DICompileUnit and it works. Hmmm, interesting.
>
> George
>
> On Thu, Oct 4, 2012 at 1:33 AM, George Baah <georgebaah at gmail.com> wrote:
>>
>> Here is
2012 Oct 05
0
[LLVMdev] question
Hmmm, but it has a getDirectory function.
-G
On Thu, Oct 4, 2012 at 3:50 PM, Eric Christopher <echristo at gmail.com> wrote:
> That's because instructions have a location associated with them, not
> a compile unit.
>
> -eric
>
> On Thu, Oct 4, 2012 at 12:46 PM, George Baah <georgebaah at gmail.com> wrote:
> > I used DILocation instead of DICompileUnit and
2012 Oct 04
2
[LLVMdev] question
Here is the code. I am running on llvm 3.1 on Lion (Mac 10.7.4)
*string getFileDirectory*(*const* Instruction &I){
MDNode *MD = I.getMetadata("dbg");
DICompileUnit compileUnit(MD);
return compileUnit.getDirectory().str();
}
George
On Wed, Oct 3, 2012 at 12:40 PM, Eric Christopher <echristo at gmail.com>wrote:
> Without knowing the code that you've written
2012 Oct 05
1
[LLVMdev] question
You should probably think of the DIFooBar constructors like reinterpret-casts, not
"go find the thing I actually want" functions. If you hand DICompileUnit() a node
that is not a compile-unit metadata node, it's not going to tell you that you goofed.
If you _did_ have a CU metadata node, then DICompileUnit's getDirectory() would
work just fine. But you don't.
--paulr
2012 Oct 04
0
[LLVMdev] question
I used DILocation instead of DICompileUnit and it works. Hmmm, interesting.
George
On Thu, Oct 4, 2012 at 1:33 AM, George Baah <georgebaah at gmail.com> wrote:
> Here is the code. I am running on llvm 3.1 on Lion (Mac 10.7.4)
>
> *string getFileDirectory*(*const* Instruction &I){
>
> MDNode *MD = I.getMetadata("dbg");
>
> DICompileUnit
2012 Oct 03
2
[LLVMdev] question
Yeah, It looks like I am doing exactly what's in Dwarf*.cpp files, yet I am
getting blanks.
George
On Tue, Oct 2, 2012 at 2:10 PM, Eric Christopher <echristo at gmail.com> wrote:
> On Tue, Oct 2, 2012 at 11:00 AM, George Baah <georgebaah at gmail.com> wrote:
> > Hi Guys,
> > How does one get the directory of the compilation unit in llvm?
> > I am using
2013 May 06
2
[LLVMdev] convert switch stmts to If statements
I mean an llvm Pass that transforms switch statements into if statements.
For example, if I have code with switch statements then running the pass
will convert all switches to ifs in the bytecode.
George
On Mon, May 6, 2013 at 4:20 PM, Hal Finkel <hfinkel at anl.gov> wrote:
> ----- Original Message -----
> > From: "George Baah" <georgebaah at gmail.com>
> >
2012 Jul 26
3
[LLVMdev] java frontend
Hi Folks,
Is a java frontend still being developed for llvm?
George
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120726/95b28fc7/attachment.html>
2014 Oct 27
2
[LLVMdev] How to call a pointer that points to a C function
I have a pointer to a function that I need to invoke without going
through llvm::Module::getOrInsertFunction. This example does not work:
static int add(int x, int y);
llvm::Value *one, *two;
llvm::Constant* addfn
= llvm::ConstantInt::get(JB->getIntPtrTy(DataLayout), (intptr_t)add);
llvm::Type* args[] = { Int32Ty, Int32Ty };
llvm::FunctionType* ftype = llvm::FunctionType::get(Int32Ty,
2012 Aug 20
5
[LLVMdev] DomTreeNode
Hi Guys,
I am using the Postdom pass and I would like to get the root of the tree.
However,
everytime I try to get the root, I get a segfault. I don't know why the
environment can't
find DominatorTreeBase.
Below is the code that generates the Segfault. In my .h file I include
Dominators.h
PDT.getRootNode(); //PDT is a reference to a PostDominatorTree
dyld: lazy symbol binding