[LLVMdev] The mysterious case of the missing GlobalVariables.

Jeffrey Yasskin jyasskin at google.com
Sat Jul 18 08:34:05 PDT 2009


If the globals don't have 'external' linkage, the optimizers will
happily eliminate them. If they are marked external, attaching the .bc
file, reduced if possible, will give people a better chance of helping
you.

On Sat, Jul 18, 2009 at 8:20 AM, Richard Pennington<rich at pennware.com> wrote:
> Hi,
>
> I've recently been updating my stuff with LLVM TOT with the context
> changes, etc. I'm up to date as of yesterday.
>
> In my environment I do most of the translation in memory:
> 1. Parse the source file(s).
> 2. lower to LLVM module(s)
> 3. bc optimize module(s)
> 4. bc link module(s)
> 5. generate a .s file and assemble it
> 6. link .o's and libraries.
>
> This was working very well until a couple of days ago.
> Now, if I do this the assembly file doesn't have the global variable
> definitions, even though the references are there.
>
> Strangely enough, if I stop after bc linking and look at the bc, the
> definitions are there and I can use llc to generate a correct .s file.
>
> Also strangely, If I feed the linked bc file back into the driver and go
> through the optimize/bclink/generate steps, the globals disappear again.
>
> I'm sure I'm missing something stupid. Any ideas?
>
> -Rich
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>




More information about the llvm-dev mailing list