aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/DebugInfo
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2011-09-21 01:13:16 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2011-09-21 01:13:16 +0000
commitab6acef5317656212d80c289ea5b07c9deb30da0 (patch)
tree91693f7a543ca340dd1b93d05ce85edb32269b96 /include/llvm/DebugInfo
parent73ec95296e231215f021fe591f068a10283dc882 (diff)
downloadexternal_llvm-ab6acef5317656212d80c289ea5b07c9deb30da0.zip
external_llvm-ab6acef5317656212d80c289ea5b07c9deb30da0.tar.gz
external_llvm-ab6acef5317656212d80c289ea5b07c9deb30da0.tar.bz2
DebugInfo: Add equality operators and default constructor to DILineInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140223 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/DebugInfo')
-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 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 {