[PATCH] D96455: [SampleFDO][NFC] Refactor SampleProfile.cpp

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 17 11:57:20 PST 2021


vsk added a comment.

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:

  module LLVM_ProfileData {
    requires cplusplus
  
    umbrella "ProfileData"
    module * { export * } //< This?
  
    textual header "ProfileData/InstrProfData.inc"
  }

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.

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.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D96455/new/

https://reviews.llvm.org/D96455



More information about the llvm-commits mailing list