summaryrefslogtreecommitdiff
path: root/include/llvm/DebugInfo
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2012-07-19 07:03:58 +0000
committerAlexey Samsonov <samsonov@google.com>2012-07-19 07:03:58 +0000
commit71d94f805514f28730bf39143ee227648d521d09 (patch)
tree2c1f82b94b4c75f9736128b9734872d03a9ec0fc /include/llvm/DebugInfo
parent72ea0c9ffaa1700730c8ce36e9b73aef4b914988 (diff)
downloadllvm-71d94f805514f28730bf39143ee227648d521d09.tar.gz
llvm-71d94f805514f28730bf39143ee227648d521d09.tar.bz2
llvm-71d94f805514f28730bf39143ee227648d521d09.tar.xz
DebugInfo library: add support for fetching absolute paths to source files
(instead of basenames) from DWARF. Use this behavior in llvm-dwarfdump tool. Reviewed by Benjamin Kramer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160496 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/DebugInfo')
-rw-r--r--include/llvm/DebugInfo/DIContext.h20
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) {}