[PATCH] D14843: [ThinLTO/LTO] Don't link in unneeded metadata
Mehdi AMINI via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 1 12:45:01 PST 2015
joker.eph added inline comments.
================
Comment at: lib/Linker/LinkModules.cpp:482
@@ +481,3 @@
+ /// or via an inlined body in an imported function.
+ SmallPtrSet<const Metadata *, 16> *UnneededSubprograms;
+
----------------
Replace with a real member instead of a pointer.
================
Comment at: lib/Linker/LinkModules.cpp:1069
@@ +1068,3 @@
+ if (!UnneededSubprograms)
+ return true;
+ MDNode *Node = dyn_cast<MDNode>(MD);
----------------
And test for emptiness instead of null.
================
Comment at: lib/Linker/LinkModules.cpp:1793
@@ +1792,3 @@
+ return;
+ UnneededSubprograms = new SmallPtrSet<const Metadata *, 16>();
+ for (unsigned I = 0, E = CompileUnits->getNumOperands(); I != E; ++I) {
----------------
Remove :)
================
Comment at: lib/Linker/LinkModules.cpp:1826
@@ +1825,3 @@
+// Squash null subprograms from compile unit subprogram lists.
+void ModuleLinker::stripNullSubprograms() {
+ NamedMDNode *CompileUnits = DstM->getNamedMetadata("llvm.dbg.cu");
----------------
Is there a test for this? I'm not sure I saw a `CHECK-NOT: null` line or something equivalent?
================
Comment at: lib/Linker/LinkModules.cpp:1828
@@ +1827,3 @@
+ NamedMDNode *CompileUnits = DstM->getNamedMetadata("llvm.dbg.cu");
+ if (CompileUnits) {
+ for (unsigned I = 0, E = CompileUnits->getNumOperands(); I != E; ++I) {
----------------
early exit
http://reviews.llvm.org/D14843
More information about the llvm-commits
mailing list