llvm.org GIT mirror llvm / eaad5cd
StringRef-ize some things git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191178 91177308-0d34-0410-b5e6-96231b3b80d8 David Blaikie 7 years ago
2 changed file(s) with 8 addition(s) and 13 deletion(s). Raw diff Collapse all Expand all
3737 DILineInfo()
3838 : FileName(""), FunctionName(""),
3939 Line(0), Column(0) {}
40 DILineInfo(const SmallString<16> &fileName,
41 const SmallString<16> &functionName,
42 uint32_t line, uint32_t column)
43 : FileName(fileName), FunctionName(functionName),
44 Line(line), Column(column) {}
40 DILineInfo(StringRef fileName, StringRef functionName, uint32_t line,
41 uint32_t column)
42 : FileName(fileName), FunctionName(functionName), Line(line),
43 Column(column) {}
4544
4645 const char *getFileName() { return FileName.c_str(); }
4746 const char *getFunctionName() { return FunctionName.c_str(); }
437437 }
438438 }
439439
440 StringRef FuncNameRef = StringRef(FunctionName);
441
442440 // If the Specifier says we don't need FileLineInfo, just
443441 // return the top-most function at the starting address.
444442 if (!Specifier.needs(DILineInfoSpecifier::FileLineInfo)) {
445 Lines.push_back(std::make_pair(Address,
446 DILineInfo(StringRef(""),
447 FuncNameRef, 0, 0)));
443 Lines.push_back(
444 std::make_pair(Address, DILineInfo("", FunctionName, 0, 0)));
448445 return Lines;
449446 }
450447
465462 std::string FileName = "";
466463 getFileNameForCompileUnit(CU, LineTable, Row.File,
467464 NeedsAbsoluteFilePath, FileName);
468 Lines.push_back(std::make_pair(Row.Address,
469 DILineInfo(StringRef(FileName),
470 FuncNameRef, Row.Line, Row.Column)));
465 Lines.push_back(std::make_pair(
466 Row.Address, DILineInfo(FileName, FunctionName, Row.Line, Row.Column)));
471467 }
472468
473469 return Lines;