[llvm] [ThinLTO][NFC] Add Debug Prints of Module Names when Generating Module Maps (PR #67820)

via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 29 08:51:42 PDT 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lto

<details>
<summary>Changes</summary>

When computing the module maps, `ThinLTOCodeGenerator` asserts if it sees a duplicating module name. This PR adds debug print, so that the list of modules already added can be printed. With this information, one can identify which module is causing the duplication. 

---
Full diff: https://github.com/llvm/llvm-project/pull/67820.diff


1 Files Affected:

- (modified) llvm/lib/LTO/ThinLTOCodeGenerator.cpp (+1) 


``````````diff
diff --git a/llvm/lib/LTO/ThinLTOCodeGenerator.cpp b/llvm/lib/LTO/ThinLTOCodeGenerator.cpp
index acff1e2cf3b33b0..443439b71e7566c 100644
--- a/llvm/lib/LTO/ThinLTOCodeGenerator.cpp
+++ b/llvm/lib/LTO/ThinLTOCodeGenerator.cpp
@@ -151,6 +151,7 @@ static StringMap<lto::InputFile *>
 generateModuleMap(std::vector<std::unique_ptr<lto::InputFile>> &Modules) {
   StringMap<lto::InputFile *> ModuleMap;
   for (auto &M : Modules) {
+    LLVM_DEBUG(dbgs() << "Adding module " << M->getName() << " to ModuleMap\n");
     assert(!ModuleMap.contains(M->getName()) &&
            "Expect unique Buffer Identifier");
     ModuleMap[M->getName()] = M.get();

``````````

</details>


https://github.com/llvm/llvm-project/pull/67820


More information about the llvm-commits mailing list