summaryrefslogtreecommitdiff
path: root/include/llvm/DebugInfo/DIContext.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/DebugInfo/DIContext.h')
-rw-r--r--include/llvm/DebugInfo/DIContext.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/llvm/DebugInfo/DIContext.h b/include/llvm/DebugInfo/DIContext.h
index b0d3e015ec..64f80c5065 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 {