mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-25 00:24:26 +00:00
When the path wasn't emitted by the frontend, discard any path on the source
filename. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130897 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -331,15 +331,20 @@ std::string GCOVProfiler::mangleName(DICompileUnit CU, std::string NewStem) {
|
|||||||
for (int i = 0, e = GCov->getNumOperands(); i != e; ++i) {
|
for (int i = 0, e = GCov->getNumOperands(); i != e; ++i) {
|
||||||
MDNode *N = GCov->getOperand(i);
|
MDNode *N = GCov->getOperand(i);
|
||||||
if (N->getNumOperands() != 2) continue;
|
if (N->getNumOperands() != 2) continue;
|
||||||
MDString *Path = dyn_cast<MDString>(N->getOperand(0));
|
MDString *GCovFile = dyn_cast<MDString>(N->getOperand(0));
|
||||||
MDNode *CompileUnit = dyn_cast<MDNode>(N->getOperand(1));
|
MDNode *CompileUnit = dyn_cast<MDNode>(N->getOperand(1));
|
||||||
if (!Path || !CompileUnit) continue;
|
if (!GCovFile || !CompileUnit) continue;
|
||||||
if (CompileUnit == CU)
|
if (CompileUnit == CU) {
|
||||||
return (Path->getString() + "/" +
|
SmallString<128> Filename = GCovFile->getString();
|
||||||
replaceStem(CU.getFilename(), NewStem)).str();
|
sys::path::replace_extension(Filename, NewStem);
|
||||||
|
return Filename.str();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return replaceStem(CU.getFilename(), NewStem);
|
}
|
||||||
|
|
||||||
|
SmallString<128> Filename = CU.getFilename();
|
||||||
|
sys::path::replace_extension(Filename, NewStem);
|
||||||
|
return sys::path::filename(Filename.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GCOVProfiler::runOnModule(Module &M) {
|
bool GCOVProfiler::runOnModule(Module &M) {
|
||||||
|
Reference in New Issue
Block a user