diff options
| author | Benjamin Kramer <benny.kra@googlemail.com> | 2011-09-21 01:13:16 +0000 |
|---|---|---|
| committer | Benjamin Kramer <benny.kra@googlemail.com> | 2011-09-21 01:13:16 +0000 |
| commit | aec423d526ec4515757ad9700f079a354e167410 (patch) | |
| tree | 0bcfa5d69cbe55f02210dadf0ce5bacd8aa8da2e /llvm | |
| parent | a3234732a060090a6d608337247c21491422f2e5 (diff) | |
| download | bcm5719-llvm-aec423d526ec4515757ad9700f079a354e167410.tar.gz bcm5719-llvm-aec423d526ec4515757ad9700f079a354e167410.zip | |
DebugInfo: Add equality operators and default constructor to DILineInfo.
llvm-svn: 140223
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/include/llvm/DebugInfo/DIContext.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/include/llvm/DebugInfo/DIContext.h b/llvm/include/llvm/DebugInfo/DIContext.h index b0d3e015ec1..64f80c50650 100644 --- a/llvm/include/llvm/DebugInfo/DIContext.h +++ b/llvm/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 { |

