[PATCH] D34063: [ThinLTO][llvm-lto2] Dump YAML for module summaries

Mehdi AMINI via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 9 13:37:33 PDT 2017


mehdi_amini added inline comments.


================
Comment at: include/llvm/IR/ModuleSummaryIndex.h:536
 
+  // Maps Oid GUID to the stringified value name (for dissassembly)
+  std::map<GlobalValue::GUID, std::string> OidToValueName;
----------------
Never seen "Oid" used here before.

Also `s/dissassembly/disassembly` and `s/stringified//`


================
Comment at: include/llvm/IR/ModuleSummaryIndex.h:537
+  // Maps Oid GUID to the stringified value name (for dissassembly)
+  std::map<GlobalValue::GUID, std::string> OidToValueName;
+
----------------
Do we want this on all the time? Is this a fundamental property of the Index?
It isn't clear to me if it isn't just a debugging tool that map to the IR when available right now?


================
Comment at: include/llvm/IR/ModuleSummaryIndex.h:650
 
+  std::string findOidToValueName(const GlobalValue::GUID G) const {
+    auto s = OidToValueName.find(G);
----------------
Return a const ref, and don't name it `find...` but `get...OrEmpty` if you want this API contract.



https://reviews.llvm.org/D34063





More information about the llvm-commits mailing list