[PATCH] CodeGen: Emit constant array temporaries into read-only globals.

David Majnemer david.majnemer at gmail.com
Tue Mar 3 11:26:58 PST 2015


On Tue, Mar 3, 2015 at 11:07 AM, Rafael EspĂ­ndola <
rafael.espindola at gmail.com> wrote:

> >> What is the issue with private on COFF? For ELF at least private is
> >> the correct choice for this.
> >
> >
> > We explicitly forbid making private linkage entities COMDAT here:
> >
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/TargetLoweringObjectFileImpl.cpp?revision=230707&view=markup#l859
>
> In this case the ComdatGV would be the function, which is not private, no?
>

I was referring to the case where the function has internal linkage (and we
have EmitUniquedSection enabled for data sections).  The global would be
private and it wouldn't be possible to  stick it in a COMDAT.


>
> Medium term, we should probably change CodeGen to handle private for
> COFF in all cases. Is the issue that COFF requires a "normal" symbol
> to be the symbol identifying the comdat? If so, CodeGen should just
> output of the symbol even if it is private when it is the "id" of a
> comdat.
>

Yes, we don't have a symbol table entry at all and things explode.


>
> This is similar to the change that was done for MachO in
> http://llvm.org/bugs/show_bug.cgi?id=18743.


> Cheers,
> Rafael
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150303/8f966612/attachment.html>


More information about the cfe-commits mailing list