[llvm] 52f934f - Allow using getters for metadata fields of BBAddrMap::BBEntry.

Rahman Lavaee via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 17 14:16:32 PDT 2023


Author: Rahman Lavaee
Date: 2023-04-17T21:16:25Z
New Revision: 52f934f3697ce0605dd7195454b58c83233e9c75

URL: https://github.com/llvm/llvm-project/commit/52f934f3697ce0605dd7195454b58c83233e9c75
DIFF: https://github.com/llvm/llvm-project/commit/52f934f3697ce0605dd7195454b58c83233e9c75.diff

LOG: Allow using getters for metadata fields of BBAddrMap::BBEntry.

This is a prequel for D148360.

Reviewed By: jhenderson

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

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Object/ELFTypes.h b/llvm/include/llvm/Object/ELFTypes.h
index 45e57869baceb..62c251e59b459 100644
--- a/llvm/include/llvm/Object/ELFTypes.h
+++ b/llvm/include/llvm/Object/ELFTypes.h
@@ -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.
 

diff  --git a/llvm/tools/llvm-readobj/ELFDumper.cpp b/llvm/tools/llvm-readobj/ELFDumper.cpp
index e2d5c62bbe30d..43d9a0f576aca 100644
--- a/llvm/tools/llvm-readobj/ELFDumper.cpp
+++ b/llvm/tools/llvm-readobj/ELFDumper.cpp
@@ -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());
       }
     }
   }


        


More information about the llvm-commits mailing list