[llvm] r270596 - [profile] Fix runtime hook linkage bug for COFF

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Wed May 25 09:38:35 PDT 2016

On Wed, May 25, 2016 at 9:32 AM, Xinliang David Li <davidxl at google.com> wrote:
> On Wed, May 25, 2016 at 9:29 AM, Reid Kleckner <rnk at google.com> wrote:
>> +  if (Triple(M->getTargetTriple()).isOSBinFormatCOFF())
>> +    User->setComdat(M->getOrInsertComdat(User->getName()));
>> I think this should really be 'if (!Triple(...).isOSBinFormatMachO())
>> ...->setComdat...', i.e. we should always set the comdat if the
>> platform supports it.
> Is there a more generic query for that ?

Not yet, but we should probably just hoist this method from clang up
to the triple:
  bool CodeGenModule::supportsCOMDAT() const {
    return !getTriple().isOSBinFormatMachO();

More information about the llvm-commits mailing list