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

Snehasish Kumar via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 26 14:43:13 PDT 2024


================
@@ -560,6 +602,28 @@ Error InstrProfSymtab::addFuncWithName(Function &F, StringRef PGOFuncName) {
   return Error::success();
 }
 
+uint64_t InstrProfSymtab::getVTableHashFromAddress(uint64_t Address) {
+  finalizeSymtab();
----------------
snehasish wrote:

Summarizing offline discussion - if we chose to refactor it makes more sense to add appropriate factory methods of cases `addElement` are called. This seems to be the intent of the original implementation with a few different `create` methods. Then we can make `addElement` private. This will enforce what we want through a better API rather than runtime checks. 

For this patch, we can add a comment and look into the refactor later.

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


More information about the cfe-commits mailing list