diff options
Diffstat (limited to 'include/llvm/DebugInfo/DIContext.h')
-rw-r--r-- | include/llvm/DebugInfo/DIContext.h | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/include/llvm/DebugInfo/DIContext.h b/include/llvm/DebugInfo/DIContext.h index 6377acb634..cfdeb46889 100644 --- a/include/llvm/DebugInfo/DIContext.h +++ b/include/llvm/DebugInfo/DIContext.h @@ -15,9 +15,9 @@ #ifndef LLVM_DEBUGINFO_DICONTEXT_H #define LLVM_DEBUGINFO_DICONTEXT_H +#include "llvm/ADT/SmallString.h" #include "llvm/ADT/StringRef.h" #include "llvm/Support/DataTypes.h" -#include <cstring> namespace llvm { @@ -25,28 +25,29 @@ class raw_ostream; /// DILineInfo - a format-neutral container for source line information. class DILineInfo { - const char *FileName; - const char *FunctionName; + SmallString<16> FileName; + SmallString<16> FunctionName; uint32_t Line; uint32_t Column; public: DILineInfo() : FileName("<invalid>"), FunctionName("<invalid>"), Line(0), Column(0) {} - DILineInfo(const char *fileName, const char *functionName, + DILineInfo(const SmallString<16> &fileName, + const SmallString<16> &functionName, uint32_t line, uint32_t column) : FileName(fileName), FunctionName(functionName), Line(line), Column(column) {} - const char *getFileName() const { return FileName; } - const char *getFunctionName() const { return FunctionName; } + 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; } bool operator==(const DILineInfo &RHS) const { return Line == RHS.Line && Column == RHS.Column && - std::strcmp(FileName, RHS.FileName) == 0 && - std::strcmp(FunctionName, RHS.FunctionName) == 0; + FileName.equals(RHS.FileName) && + FunctionName.equals(RHS.FunctionName); } bool operator!=(const DILineInfo &RHS) const { return !(*this == RHS); @@ -60,7 +61,8 @@ class DILineInfoSpecifier { public: enum Specification { FileLineInfo = 1 << 0, - FunctionName = 1 << 1 + AbsoluteFilePath = 1 << 1, + FunctionName = 1 << 2 }; // Use file/line info by default. DILineInfoSpecifier(uint32_t flags = FileLineInfo) : Flags(flags) {} |