From: Rahman Lavaee Date: Mon, 17 Apr 2023 21:15:23 +0000 (+0000) Subject: Allow using getters for metadata fields of BBAddrMap::BBEntry. X-Git-Tag: upstream/17.0.6~11296 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=52f934f3697ce0605dd7195454b58c83233e9c75;p=platform%2Fupstream%2Fllvm.git 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 --- diff --git a/llvm/include/llvm/Object/ELFTypes.h b/llvm/include/llvm/Object/ELFTypes.h index 45e57869..62c251e 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 BBEntries; // Basic block entries for this function. diff --git a/llvm/tools/llvm-readobj/ELFDumper.cpp b/llvm/tools/llvm-readobj/ELFDumper.cpp index e2d5c62..43d9a0f 100644 --- a/llvm/tools/llvm-readobj/ELFDumper.cpp +++ b/llvm/tools/llvm-readobj/ELFDumper.cpp @@ -7446,10 +7446,10 @@ template void LLVMELFDumper::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()); } } }