Skip to content

Commit 23b8a19

Browse files
committed
[DwarfDebug] Add forward declarations of "<" operators [NFC]
The operators are defined in DwarfDebug.cpp but are referenced in the struct definitions of FrameIndexExpr and EntryValueInfo in DwarfDebug.h, and since they weren't declared before, gcc warned with [694/5646] Building CXX object lib/CodeGen/AsmPrinter/CMakeFiles/LLVMAsmPrinter.dir/DwarfDebug.cpp.o ../lib/CodeGen/AsmPrinter/DwarfDebug.cpp:273:6: warning: 'bool llvm::operator<(const llvm::FrameIndexExpr&, const llvm::FrameIndexExpr&)' has not been declared within 'llvm' 273 | bool llvm::operator<(const FrameIndexExpr &LHS, const FrameIndexExpr &RHS) { | ^~~~ In file included from ../lib/CodeGen/AsmPrinter/DwarfDebug.cpp:13: ../lib/CodeGen/AsmPrinter/DwarfDebug.h:112:15: note: only here as a 'friend' 112 | friend bool operator<(const FrameIndexExpr &LHS, const FrameIndexExpr &RHS); | ^~~~~~~~ ../lib/CodeGen/AsmPrinter/DwarfDebug.cpp:278:6: warning: 'bool llvm::operator<(const llvm::EntryValueInfo&, const llvm::EntryValueInfo&)' has not been declared within 'llvm' 278 | bool llvm::operator<(const EntryValueInfo &LHS, const EntryValueInfo &RHS) { | ^~~~ In file included from ../lib/CodeGen/AsmPrinter/DwarfDebug.cpp:13: ../lib/CodeGen/AsmPrinter/DwarfDebug.h:121:15: note: only here as a 'friend' 121 | friend bool operator<(const EntryValueInfo &LHS, const EntryValueInfo &RHS); | ^~~~~~~~
1 parent 535665e commit 23b8a19

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,11 @@ class DbgEntity {
103103

104104
class DbgVariable;
105105

106+
bool operator<(const struct FrameIndexExpr &LHS,
107+
const struct FrameIndexExpr &RHS);
108+
bool operator<(const struct EntryValueInfo &LHS,
109+
const struct EntryValueInfo &RHS);
110+
106111
/// Proxy for one MMI entry.
107112
struct FrameIndexExpr {
108113
int FI;

0 commit comments

Comments
 (0)