Dmitry N. Mikushin
2012-Nov-10 01:11 UTC
[LLVMdev] Forward references of globals in .ll files
Does not work and same error even on old r157485 build. - D. 2012/11/10 Eli Friedman <eli.friedman at gmail.com>:> On Fri, Nov 9, 2012 at 5:01 PM, Justin Holewinski > <justin.holewinski at gmail.com> wrote: >> I'm experiencing a weird issue during .ll file parsing, and I'm not sure if >> it's a bug in the .ll parser, or if I'm just not understanding the IR. >> >> Take the following IR: >> >> @a = addrspace(1) global i8 0 >> @a2 = global i8 addrspace(1)* @a >> >> This parses fine. But if I rearrange the statements to: >> >> @a2 = global i8 addrspace(1)* @a >> @a = addrspace(1) global i8 0 >> >> then I get an ugly assertion failure: >> >> Assertion failed: (InitVal->getType() == getType()->getElementType() && >> "Initializer type must match GlobalVariable type"), function setInitializer, >> file /Users/jholewinski/projects/llvm/src/llvm/lib/VMCore/Globals.cpp, line >> 168. >> >> Looking at the debugger, I see that InitVal (the initializer for @a2) has >> type i8*, which looks incorrect as it drops the addrspace from the >> definition of @a. >> >> Before I go too far into this, should this IR work? It looks like the >> parser is failing to properly process the forward declaration of @a, but I >> just want to be sure. > > Looks like it should work. > > -Eli > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
On Fri, Nov 9, 2012 at 5:11 PM, Dmitry N. Mikushin <maemarcus at gmail.com> wrote:> Does not work and same error even on old r157485 build.Yes, and that's a bug. -Eli
Justin Holewinski
2012-Nov-10 14:39 UTC
[LLVMdev] Forward references of globals in .ll files
If no one else is looking at this, I'll take a stab at it next week sometime. On Fri, Nov 9, 2012 at 5:40 PM, Eli Friedman <eli.friedman at gmail.com> wrote:> On Fri, Nov 9, 2012 at 5:11 PM, Dmitry N. Mikushin <maemarcus at gmail.com> > wrote: > > Does not work and same error even on old r157485 build. > > Yes, and that's a bug. > > -Eli >-- Thanks, Justin Holewinski -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121110/8d6b0a5a/attachment.html>
Maybe Matching Threads
- [LLVMdev] Forward references of globals in .ll files
- [LLVMdev] Forward references of globals in .ll files
- [LLVMdev] Forward references of globals in .ll files
- [LLVMdev] [NVPTX] Backend failure in LegalizeDAG due to unimplemented expand in target lowering
- [LLVMdev] [NVPTX] Backend failure in LegalizeDAG due to unimplemented expand in target lowering