StringRef-ize some things

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191178 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Blaikie
2013-09-22 17:01:50 +00:00
parent 0d293e45b6
commit eaad5cdc2a
2 changed files with 8 additions and 13 deletions

View File

@@ -38,11 +38,10 @@ public:
DILineInfo() DILineInfo()
: FileName("<invalid>"), FunctionName("<invalid>"), : FileName("<invalid>"), FunctionName("<invalid>"),
Line(0), Column(0) {} Line(0), Column(0) {}
DILineInfo(const SmallString<16> &fileName, DILineInfo(StringRef fileName, StringRef functionName, uint32_t line,
const SmallString<16> &functionName, uint32_t column)
uint32_t line, uint32_t column) : FileName(fileName), FunctionName(functionName), Line(line),
: FileName(fileName), FunctionName(functionName), Column(column) {}
Line(line), Column(column) {}
const char *getFileName() { return FileName.c_str(); } const char *getFileName() { return FileName.c_str(); }
const char *getFunctionName() { return FunctionName.c_str(); } const char *getFunctionName() { return FunctionName.c_str(); }

View File

@@ -438,14 +438,11 @@ DILineInfoTable DWARFContext::getLineInfoForAddressRange(uint64_t Address,
} }
} }
StringRef FuncNameRef = StringRef(FunctionName);
// If the Specifier says we don't need FileLineInfo, just // If the Specifier says we don't need FileLineInfo, just
// return the top-most function at the starting address. // return the top-most function at the starting address.
if (!Specifier.needs(DILineInfoSpecifier::FileLineInfo)) { if (!Specifier.needs(DILineInfoSpecifier::FileLineInfo)) {
Lines.push_back(std::make_pair(Address, Lines.push_back(
DILineInfo(StringRef("<invalid>"), std::make_pair(Address, DILineInfo("<invalid>", FunctionName, 0, 0)));
FuncNameRef, 0, 0)));
return Lines; return Lines;
} }
@@ -466,9 +463,8 @@ DILineInfoTable DWARFContext::getLineInfoForAddressRange(uint64_t Address,
std::string FileName = "<invalid>"; std::string FileName = "<invalid>";
getFileNameForCompileUnit(CU, LineTable, Row.File, getFileNameForCompileUnit(CU, LineTable, Row.File,
NeedsAbsoluteFilePath, FileName); NeedsAbsoluteFilePath, FileName);
Lines.push_back(std::make_pair(Row.Address, Lines.push_back(std::make_pair(
DILineInfo(StringRef(FileName), Row.Address, DILineInfo(FileName, FunctionName, Row.Line, Row.Column)));
FuncNameRef, Row.Line, Row.Column)));
} }
return Lines; return Lines;