similar to: [LLVMdev] Function pointers bitcasted to varargs

Displaying 20 results from an estimated 20000 matches similar to: "[LLVMdev] Function pointers bitcasted to varargs"

2010 Apr 21
0
[LLVMdev] Function pointers bitcasted to varargs
Do you compile this as C? In C, unlike in C++, empty parenthesis do not mean "no arguments", they mean "no prototype", which is typically treated the same way as varargs in calling conventions. To declare function with no arguments do typedef void (*FP)(void); Eugene On Wed, Apr 21, 2010 at 10:22 PM, Arushi Aggarwal <arushi987 at gmail.com> wrote: > Hi all, > >
2010 Mar 09
3
[LLVMdev] Alignment for Alloca Inst in llvm 2.6
Hi, 1. Does the alignment of the pointer returned by an AllocaInst depend on the instructions before it in the basic block? The 1st snippet below aligns 'a' correctly, while the 2nd one doesnt. (the method handle_args, only prints out the values of arguments, and returns argv unchanged). define i32 @main(i32 %argc, i8** %argv) nounwind { entry: %argc_addr = alloca i32
2011 Aug 19
2
[LLVMdev] How to halt a program
Guys, I would like to instrument the bytecode that LLVM produces with assertions. I have written the instrumentation code manually, but I do not know how to halt the program in case the assertion is false. I took a look into the bytecode that LLVM produces for a program like: #include <stdlib.h> int main() { exit(1); } And it is like this: define i32 @main() nounwind { entry:
2011 Jun 29
2
[LLVMdev] hello world error
Hi All, I am using llvm-2.9 to cross compile to alpha. I know that alpha is in experimental stage, but i can not get even the "Hello World" program to run on it. Here is what happens, the bitcode file for the hello world program is as follow: ; ModuleID = 'hello.bc' target datalayout =
2011 Aug 19
0
[LLVMdev] How to halt a program
Victor Campos wrote: > Guys, > > I would like to instrument the bytecode that LLVM produces with > assertions. I have written the instrumentation code manually, but I do > not know how to halt the program in case the assertion is false. I took > a look into the bytecode that LLVM produces for a program like: > > #include <stdlib.h> > int main() { >
2012 Oct 07
2
[LLVMdev] Inserting a function call using LLVM
Hi, I am new to LLVM and interested in using LLVM to work on a research project for my Master's degree. My idea is following - 1. I have a simple C program basic.c - #include <stdio.h> int main() { printf("Hello World"); return 0; } 2. I will generate IR byte code for this basic.c using - llvm-gcc -emit-llvm -S basic.c This will give me basic.s which has IR byte code
2009 Nov 16
2
[LLVMdev] lli -force-interpreter complains about external function
Hi: When I try to execute lli -force-interpreter=true hello.bc, it gave the following error: LLVM ERROR: Tried to execute an unknown external function: i32 (i8*)* puts I think the error is because C library is not being linked with the byte code, but I was not able to find any helpful instruction in lli's document. Can you please teach me how to do it? Thanks Xu The hello.bc is
2011 Jun 29
0
[LLVMdev] hello world error
Hi, I found that machine dead code elimination, does not respect the calling convention of alpha and eliminates r16, which was set correctly during code generation. I verified it with -print-after-all. Does anybody have a patch for this? On Wed, Jun 29, 2011 at 11:12 AM, Ankit Sethia <asethia at eecs.umich.edu>wrote: > Hi All, > > I am using llvm-2.9 to cross compile to alpha. I
2011 Apr 05
3
[LLVMdev] Incompatible types at call site
Hi, For a call like this, %tmp6 = call i32 (...)* bitcast (i32 (i8*, i8, i8**)* @ssplit to i32 (...)*)(i8* %tmp599, i32 46, i8** %domainv3) nounwind ; <i32> does the 2nd argument get zero extended or sign extended? Thanks, Arushi -------------- next part -------------- An HTML attachment was scrubbed... URL:
2010 May 13
4
[LLVMdev] How to get the variable mapping between the source and llvm bytecode
Hi, I want to know the variable mapping between the source and llvm bytecode. It seems that current llvm debugging information cannot provide this mapping directly. Here is my examples (llvm 2.7). In this exmaple, I want to know the mapping: tmp<--->%4. But current llvm's debugging information can only provide that the instruction "%4 = add nsw i32 %3, 2" is at line 3 in
2012 Feb 06
2
[LLVMdev] misc questions on opt and bitcode
Hi Eric, Here's the C code (example.c): include <stdio.h> int main() { printf("testing\n"); } Here's the LLVM IR (from llvm-gcc): ModuleID = 'example.c' target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64" target triple =
2010 Dec 13
1
[LLVMdev] How can I determine safely if a CallSite is "live" in a DSGraphs context
Hi, I believe shouldHaveNodeForValue() should return false for ConstantPointerNullValue. Fixed in r121707. Arushi On Mon, Dec 13, 2010 at 12:10 PM, Kevin Streit <kevin.streit at googlemail.com>wrote: > I'm using BUDataStructures... But I tried LocalDatastructures and it didn't > work either... > On Dec 13, 2010 6:52 PM, "Arushi Aggarwal" <arushi987 at
2012 Oct 08
0
[LLVMdev] Inserting a function call using LLVM
Hi Teja, > I am new to LLVM and interested in using LLVM to work on a research project for > my Master's degree. > My idea is following - > > 1. I have a simple C program basic.c - > #include <stdio.h> > int main() { > printf("Hello World"); > return 0; > } > > 2. I will generate IR byte code for this basic.c using - > llvm-gcc
2011 Apr 05
2
[LLVMdev] Incompatible types at call site
On Tue, Apr 5, 2011 at 1:44 PM, Duncan Sands <baldrick at free.fr> wrote: > Hi Arushi, > > > %tmp63 = call %struct.TypHeader* (...)* bitcast (%struct.TypHeader* >> (%struct.TypHeader*, i64, i64)* @Cyclotomic to %struct.TypHeader* >> (...)*)(%struct.TypHeader* %tmp62, i64 %tmp24, i32 1) nounwind, !dbg !907 >> ; >> <%struct.TypHeader*> [#uses=1]
2010 May 13
0
[LLVMdev] How to get the variable mapping between the source andllvm bytecode
Hi, I want to get the mapping between C source's variables and bytecode variables. It seems that llvm doesn't provide this mapping, so I think a walk-around method is to get the instruction's mapping. I have to use llvm-gcc, not clang. Any advice? Thanks. Best, Kecheng 2010-05-13 From: Eli Friedman Date: 2010-05-13 15:38:36 To: Kecheng Cc: llvmdev Subject: Re: [LLVMdev] How
2011 Oct 05
2
[LLVMdev] LLVM IR is a compiler IR
All, I should have chimed in earlier, but have been working on two more side-channel variants of this conversation. At the beginning the PNaCl team was strongly pushing for trying to keep platform ABI compatibility on all platforms while taking one portable bitcode stream as input. During the discussions we've had over the past few weeks it became obvious that that is simply not tractable,
2011 Jan 05
0
[LLVMdev] force inlineing a function using opt
If I understand correctly, you're saying that the C source definition of the prologue function is declared as static. If you compile that function to LLVM IR, it will get interal linkage and will not be visible to functions in other compilation units; instead, it will get renamed if there is a function defined with the same name. As such, it will never get inlined as the instrumented code
2011 Jan 04
3
[LLVMdev] force inlineing a function using opt
Hi, I am instrumenting the stores in a program by inserting a function call (store_prologue) before every store instruction in the IR file. I set the prologue function's attribute to "AlwaysInline" using addFnAttr(). In the program the prologue function is defined as static inline. I am using opt to generate an optimized (inline the calls to the store prologue) using the
2012 Feb 06
0
[LLVMdev] misc questions on opt and bitcode
On Feb 5, 2012, at 11:32 AM, Arpan Sen wrote: > For the very simple example below, I get Unknown instruction error from lli and llvm-dis, while llc does not print anything. Not sure what is that I am missing here. My llvm-gcc version is i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00) > 1-39-155-188:pastebin Babai$ llvm-gcc example.c
2010 Oct 19
0
[LLVMdev] Structure memory layout
On 19 October 2010 07:57, Jin Gu Kang <jaykang10 at imrc.kist.re.kr> wrote: > Frist, I have been implementing common type for struct type on bitcode > at compilation time using llvm-gcc and then changing common type to target > specific types at code generation time using llc (reconstruct StructLayout). Hi Jin, Apart from bitfields and unions, the struct type is pretty much target