<div dir="ltr">Adding "inline" keywords will make the functions COMDAT and will fix the duplicates problem. I verified with -DLLVM_ENABLE_MODULES=On.<div><br></div><div>Once we make the class a template, we don't need the "inline" keywords. I also verified this with my template patch.</div><div><br></div><div>I will do a few more tests and will commit a modified patch with "inline" keywords.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Feb 17, 2021 at 11:57 AM Vedant Kumar via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">vsk added a comment.<br>
<br>
This particular bot is using -DLLVM_ENABLE_MODULES=On. I'm not sure how to explain why the issue doesn't pop up on other bots. My current theory is that the LLVM_ProfileData module re-exports the new header because of:<br>
<br>
  module LLVM_ProfileData {<br>
    requires cplusplus<br>
<br>
    umbrella "ProfileData"<br>
    module * { export * } //< This?<br>
<br>
    textual header "ProfileData/InstrProfData.inc"<br>
  }<br>
<br>
If SampleProfileLoaderBaseImpl is indeed imported from Transforms/Utils, then the re-export from the ProfileData module might cause the duplicate definition link failure, even though there's only one #include for the header.<br>
<br>
I'd wager that the simplest fix would be to pull the header definitions from SampleProfileLoaderBaseImpl into a .cpp. If/when those definitions become templated they can move back into the header. Alternatively perhaps the modulemap file can be changed to not re-export SampleProfileLoaderBaseImpl, but I don't know how to make that change or how invasive it'd be.<br>
<br>
<br>
Repository:<br>
  rG LLVM Github Monorepo<br>
<br>
CHANGES SINCE LAST ACTION<br>
  <a href="https://reviews.llvm.org/D96455/new/" rel="noreferrer" target="_blank">https://reviews.llvm.org/D96455/new/</a><br>
<br>
<a href="https://reviews.llvm.org/D96455" rel="noreferrer" target="_blank">https://reviews.llvm.org/D96455</a><br>
<br>
</blockquote></div>