================
@@ -479,15 +479,37 @@ Error InstrProfSymtab::create(Module &M, bool InLTO) {
       continue;
     Types.clear();
     G.getMetadata(LLVMContext::MD_type, Types);
-    if (!Types.empty()) {
-      MD5VTableMap.emplace_back(G.getGUID(), &G);
-    }
+    if (Types.empty())
+      continue;
+    if (Error E = addVTableWithName(
+              G, getIRPGOObjectName(G, InLTO, /* PGONameMetadata */ nullptr)))
+        return E;
   }
   Sorted = false;
   finalizeSymtab();
   return Error::success();
 }
 
+Error InstrProfSymtab::addVTableWithName(GlobalVariable &VTable,
+                                         StringRef VTablePGOName) {
+                                          
+  auto mapName = [&](StringRef Name) -> Error {
+    if (Error E = addVTableName(Name))
----------------
minglotus-6 wrote:

And in the latest 
[commit](https://github.com/llvm/llvm-project/pull/81051/commits/003319d8d1f791dbe0c34bf82f0043f71b330d68)
 I decided to call `addSymbolName` and added some comments around. It's a 
change in the diffbase to make `addFuncName` a 
[wrapper](https://github.com/llvm/llvm-project/pull/66825/files#diff-da37bd91946b34b8d50ced64d8e9f79455b61e8d29b304d0ae9fe3148bc63333R552)
 around 
[`addSymbolName`](https://github.com/llvm/llvm-project/pull/66825/files#diff-da37bd91946b34b8d50ced64d8e9f79455b61e8d29b304d0ae9fe3148bc63333R534).

Meanwhile as the functions from the diffbase (mainly `InstrProf.h/cpp`) starts 
to be used in subsequent patches, I'll start to get the first instrumentation 
patch (https://github.com/llvm/llvm-project/pull/66825) into main branch. 


https://github.com/llvm/llvm-project/pull/81051
_______________________________________________
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to