search for: fooval

Displaying 3 results from an estimated 3 matches for "fooval".

Did you mean: foosval
2010 Jan 09
0
[LLVMdev] Variable declarations vs. definitions
On Jan 9, 2010, at 12:57 PM, Dustin Laurence wrote: > I have yet another question that I believe also stems from deep > ignorance of the linkage types. How do you declare a global variable > without defining it? The equivalent of "extern int G;" is: @G = external global i32 -Chris
2010 Jan 10
2
[LLVMdev] Variable declarations vs. definitions
On 01/09/2010 01:12 PM, Chris Lattner wrote: > The equivalent of "extern int G;" is: > > @G = external global i32 Hmm. Is it really? This @foo = external global i32 @foo = global i32 5 define i32 @main(i32 %argc, i8 **%argv) { %fooVal = load i32* @foo ret i32 %fooVal } produces a "redefinition of global '@foo'" error. But this extern int x; int x = 5; int *y = &x; compiles to @x = global i32 5 ; <i32*> [#uses=1] @y = global i32* @x ; <i32**> [#uses=0] The difference is crucial, b...
2010 Jan 09
7
[LLVMdev] Variable declarations vs. definitions
I have yet another question that I believe also stems from deep ignorance of the linkage types. How do you declare a global variable without defining it? The IR ref. clearly indicates that you can do this, but it looks like one of the many "too obvious to mention" things that I struggle with. It's easy with functions, of course: "declare @foo" in the header and