[cfe-dev] clang::CodeGen::CodeGenModule::GetOrCreateLLVMGlobal

Vassil Vassilev vasil.georgiev.vasilev at cern.ch
Mon Mar 10 08:44:10 PDT 2014


On 03/10/2014 04:40 PM, Rafael EspĂ­ndola wrote:
> bccing cfe-dev, moving the cfe-commits
>
> On 10 March 2014 09:58, Vassil Vassilev <vasil.georgiev.vasilev at cern.ch> wrote:
>> Hi,
>>    I noticed that CodeGenModule.cpp (around line number 1514):
>>
>>      if (UnnamedAddr)
>>        Entry->setUnnamedAddr(true);
>>
>> is executed only in the 'Get'-branch. I.e if the global doesn't exist this
>> flag is not taken into account. Is that an inconsistency or a desired
>> behavior?
> That is a bug, thanks!
Thanks, and thanks for the instantaneous fix!
>
> For
>
> struct Foo {
>    ~Foo();
> };
> Foo x;
>
> We will output "@__dso_handle = external global i8", but an
> unnamed_addr gets added if a second "Foo y" is added.
This was exactly the behavior I saw. Second request of the __dso_handle 
was fixing/hiding the problem.
Vassil
>
> John (or Fariborz), can you check if the attached patch is doing the
> correct thing for obj-c?
>
> Thanks,
> Rafael




More information about the cfe-commits mailing list