forked from OSchip/llvm-project
[NFC] Refactor the tuple of symbol information with structure for llvm-objdump
SUMMARY: address the comment of https://reviews.llvm.org/D74240#inline-676127 https://reviews.llvm.org/D74240#inline-675875 Reviewers: daltenty, jason liu, xiangling liao Subscribers: wuzish, nemanjai, hiraditya Differential Revision: https://reviews.llvm.org/D74240
This commit is contained in:
parent
2040831d05
commit
9c1a88c964
|
@ -22,15 +22,19 @@ struct SymbolInfoTy {
|
|||
StringRef Name;
|
||||
uint8_t Type;
|
||||
|
||||
SymbolInfoTy(uint64_t Addr, StringRef Name, uint8_t Type):
|
||||
Addr(Addr),Name(Name),Type(Type) {};
|
||||
SymbolInfoTy(uint64_t Addr, StringRef Name, uint8_t Type)
|
||||
: Addr(Addr), Name(Name), Type(Type){};
|
||||
|
||||
friend bool operator<(const SymbolInfoTy &P1, const SymbolInfoTy &P2) {
|
||||
return std::tie(P1.Addr, P1.Name, P1.Type) <
|
||||
std::tie(P2.Addr, P2.Name, P2.Type);
|
||||
}
|
||||
};
|
||||
|
||||
using SectionSymbolsTy = std::vector<SymbolInfoTy>;
|
||||
|
||||
|
||||
template <typename T> class ArrayRef;
|
||||
class StringRef;
|
||||
class MCContext;
|
||||
class MCInst;
|
||||
class MCSubtargetInfo;
|
||||
|
|
|
@ -341,16 +341,6 @@ static StringSet<> DisasmFuncsSet;
|
|||
StringSet<> FoundSectionSet;
|
||||
static StringRef ToolName;
|
||||
|
||||
static bool operator<(const SymbolInfoTy& P1 ,const SymbolInfoTy& P2) {
|
||||
if (P1.Addr < P2.Addr)
|
||||
return true;
|
||||
|
||||
if (P1.Addr == P2.Addr)
|
||||
return P1.Name < P2.Name;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
namespace {
|
||||
struct FilterResult {
|
||||
// True if the section should not be skipped.
|
||||
|
|
Loading…
Reference in New Issue