diff options
-rw-r--r-- | include/llvm/DebugInfo/DIContext.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/llvm/DebugInfo/DIContext.h b/include/llvm/DebugInfo/DIContext.h index b0d3e01..64f80c5 100644 --- a/include/llvm/DebugInfo/DIContext.h +++ b/include/llvm/DebugInfo/DIContext.h @@ -17,6 +17,7 @@ #include "llvm/ADT/StringRef.h" #include "llvm/Support/DataTypes.h" +#include <cstring> namespace llvm { @@ -28,12 +29,21 @@ class DILineInfo { uint32_t Line; uint32_t Column; public: + DILineInfo() : FileName("<invalid>"), Line(0), Column(0) {} DILineInfo(const char *fileName, uint32_t line, uint32_t column) : FileName(fileName), Line(line), Column(column) {} const char *getFileName() const { return FileName; } uint32_t getLine() const { return Line; } uint32_t getColumn() const { return Column; } + + bool operator==(const DILineInfo &RHS) const { + return Line == RHS.Line && Column == RHS.Column && + std::strcmp(FileName, RHS.FileName) == 0; + } + bool operator!=(const DILineInfo &RHS) const { + return !(*this == RHS); + } }; class DIContext { |