summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2014-04-18 21:36:39 +0000
committerAlexey Samsonov <samsonov@google.com>2014-04-18 21:36:39 +0000
commit08ef0202ce1b2324cccafba3d640cc8a9b859dd0 (patch)
tree0139a3b5dfc177e1c5949e2fa285603c89c00a89 /include
parent037da24c10511f857cf2790905d9378184c3a355 (diff)
downloadllvm-08ef0202ce1b2324cccafba3d640cc8a9b859dd0.tar.gz
llvm-08ef0202ce1b2324cccafba3d640cc8a9b859dd0.tar.bz2
llvm-08ef0202ce1b2324cccafba3d640cc8a9b859dd0.tar.xz
[DWARF parser] Turn DILineInfo into a struct.
Immutable DILineInfo doesn't bring any benefits and complicates code. Also, use std::string instead of SmallString<16> for file and function names - their length can vary significantly. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206654 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/DebugInfo/DIContext.h27
1 files changed, 8 insertions, 19 deletions
diff --git a/include/llvm/DebugInfo/DIContext.h b/include/llvm/DebugInfo/DIContext.h
index 69a4f8d1f6..e99c029af3 100644
--- a/include/llvm/DebugInfo/DIContext.h
+++ b/include/llvm/DebugInfo/DIContext.h
@@ -16,42 +16,31 @@
#define LLVM_DEBUGINFO_DICONTEXT_H
#include "llvm/ADT/DenseMap.h"
-#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/SmallVector.h"
-#include "llvm/ADT/StringRef.h"
#include "llvm/Object/ObjectFile.h"
#include "llvm/Object/RelocVisitor.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/DataTypes.h"
+#include <string>
+
namespace llvm {
class raw_ostream;
/// DILineInfo - a format-neutral container for source line information.
-class DILineInfo {
- SmallString<16> FileName;
- SmallString<16> FunctionName;
+struct DILineInfo {
+ std::string FileName;
+ std::string FunctionName;
uint32_t Line;
uint32_t Column;
-public:
+
DILineInfo()
- : FileName("<invalid>"), FunctionName("<invalid>"),
- Line(0), Column(0) {}
- DILineInfo(StringRef fileName, StringRef functionName, uint32_t line,
- uint32_t column)
- : FileName(fileName), FunctionName(functionName), Line(line),
- Column(column) {}
-
- const char *getFileName() { return FileName.c_str(); }
- const char *getFunctionName() { return FunctionName.c_str(); }
- uint32_t getLine() const { return Line; }
- uint32_t getColumn() const { return Column; }
+ : FileName("<invalid>"), FunctionName("<invalid>"), Line(0), Column(0) {}
bool operator==(const DILineInfo &RHS) const {
return Line == RHS.Line && Column == RHS.Column &&
- FileName.equals(RHS.FileName) &&
- FunctionName.equals(RHS.FunctionName);
+ FileName == RHS.FileName && FunctionName == RHS.FunctionName;
}
bool operator!=(const DILineInfo &RHS) const {
return !(*this == RHS);