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

Rafael EspĂ­ndola rafael.espindola at gmail.com
Mon Mar 10 08:40:03 PDT 2014


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!

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.

John (or Fariborz), can you check if the attached patch is doing the
correct thing for obj-c?

Thanks,
Rafael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: t.patch
Type: text/x-patch
Size: 1851 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140310/73167e31/attachment.bin>


More information about the cfe-dev mailing list