[llvm] [clang] [lld] [SHT_LLVM_BB_ADDR_MAP] Allow basic-block-sections and labels be used together by decoupling the handling of the two features. (PR #74128)

Mircea Trofin via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 25 15:21:49 PST 2024


================
@@ -858,62 +899,64 @@ struct BBAddrMap {
     bool hasIndirectBranch() const { return MD.HasIndirectBranch; }
   };
 
-  BBAddrMap(uint64_t Addr, std::vector<BBEntry> BBEntries)
-      : Addr(Addr), BBEntries(std::move(BBEntries)) {}
+  // Struct representing the BBAddrMap information for a contiguous range of
+  // basic blocks (a function or a basic block section).
+  struct BBRangeEntry {
+    uint64_t BaseAddress;           // Base address of the range.
----------------
mtrofin wrote:

(paranoia) could you initialize BaseAddress at decl? easier to maintain and avoid uninitialized error issues (sure, they can also be compiler-detected, but 3 extra characters don't hurt either)

same for the fields above

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


More information about the llvm-commits mailing list