summaryrefslogtreecommitdiffstats
path: root/llvm/tools/sancov/sancov.cc
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/sancov/sancov.cc')
-rw-r--r--llvm/tools/sancov/sancov.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/tools/sancov/sancov.cc b/llvm/tools/sancov/sancov.cc
index 7a3d7f171c5..9b54575028a 100644
--- a/llvm/tools/sancov/sancov.cc
+++ b/llvm/tools/sancov/sancov.cc
@@ -178,7 +178,7 @@ class CoverageData {
return;
symbolize::LLVMSymbolizer::Options SymbolizerOptions;
SymbolizerOptions.Demangle = ClDemangle;
- symbolize::LLVMSymbolizer Symbolizer;
+ symbolize::LLVMSymbolizer Symbolizer(SymbolizerOptions);
struct FileLoc {
std::string FileName;
@@ -226,8 +226,11 @@ class CoverageData {
if (!ProcessedFunctions.insert(FunctionName).second)
continue;
- out << FileName.substr(FilePrefix.size()) << ":" << Line << " "
- << FunctionName << "\n";
+ // Don't strip prefix if we only have a single file.
+ if (FileName.size() > FilePrefix.size())
+ FileName = FileName.substr(FilePrefix.size());
+
+ out << FileName << ":" << Line << " " << FunctionName << "\n";
}
}
}
OpenPOWER on IntegriCloud