[clang] [compiler-rt] [llvm] [InstrFDO][TypeProf] Implement binary instrumentation and profile read/write (PR #66825)

Mingming Liu via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 5 22:09:32 PST 2024


================
@@ -459,6 +472,16 @@ Error InstrProfSymtab::create(Module &M, bool InLTO) {
     if (Error E = addFuncWithName(F, getPGOFuncName(F, InLTO)))
       return E;
   }
+
+  SmallVector<MDNode *, 2> Types;
+  for (GlobalVariable &G : M.globals()) {
+    if (!G.hasName())
+      continue;
+    Types.clear();
+    G.getMetadata(LLVMContext::MD_type, Types);
+    if (!Types.empty())
----------------
minglotus-6 wrote:

yes, and this is more consistent with vtable detection in InstrProfiling.cpp. Done. 

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


More information about the cfe-commits mailing list