Allow using getters for metadata fields of BBAddrMap::BBEntry.
authorRahman Lavaee <rahmanl@google.com>
Mon, 17 Apr 2023 21:15:23 +0000 (21:15 +0000)
committerRahman Lavaee <rahmanl@google.com>
Mon, 17 Apr 2023 21:16:25 +0000 (21:16 +0000)
This is a prequel for D148360.

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D148361

llvm/include/llvm/Object/ELFTypes.h
llvm/tools/llvm-readobj/ELFDumper.cpp

index 45e5786..62c251e 100644 (file)
@@ -820,6 +820,11 @@ struct BBAddrMap {
              HasReturn == Other.HasReturn && HasTailCall == Other.HasTailCall &&
              IsEHPad == Other.IsEHPad && CanFallThrough == Other.CanFallThrough;
     }
+
+    bool hasReturn() const { return HasReturn; }
+    bool hasTailCall() const { return HasTailCall; }
+    bool isEHPad() const { return IsEHPad; }
+    bool canFallThrough() const { return CanFallThrough; }
   };
   std::vector<BBEntry> BBEntries; // Basic block entries for this function.
 
index e2d5c62..43d9a0f 100644 (file)
@@ -7446,10 +7446,10 @@ template <class ELFT> void LLVMELFDumper<ELFT>::printBBAddrMaps() {
         W.printNumber("ID", BBE.ID);
         W.printHex("Offset", BBE.Offset);
         W.printHex("Size", BBE.Size);
-        W.printBoolean("HasReturn", BBE.HasReturn);
-        W.printBoolean("HasTailCall", BBE.HasTailCall);
-        W.printBoolean("IsEHPad", BBE.IsEHPad);
-        W.printBoolean("CanFallThrough", BBE.CanFallThrough);
+        W.printBoolean("HasReturn", BBE.hasReturn());
+        W.printBoolean("HasTailCall", BBE.hasTailCall());
+        W.printBoolean("IsEHPad", BBE.isEHPad());
+        W.printBoolean("CanFallThrough", BBE.canFallThrough());
       }
     }
   }