mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-10-26 18:20:39 +00:00
Revert r162855 in favor of changing clang to emit the absolute coverage file path.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162883 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -91,7 +91,7 @@ namespace {
|
|||||||
void insertCounterWriteout(ArrayRef<std::pair<GlobalVariable*, MDNode*> >);
|
void insertCounterWriteout(ArrayRef<std::pair<GlobalVariable*, MDNode*> >);
|
||||||
void insertIndirectCounterIncrement();
|
void insertIndirectCounterIncrement();
|
||||||
|
|
||||||
std::string mangleName(DICompileUnit CU, const char *NewStem);
|
std::string mangleName(DICompileUnit CU, std::string NewStem);
|
||||||
|
|
||||||
bool EmitNotes;
|
bool EmitNotes;
|
||||||
bool EmitData;
|
bool EmitData;
|
||||||
@@ -328,10 +328,7 @@ namespace {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string GCOVProfiler::mangleName(DICompileUnit CU, const char *NewStem) {
|
std::string GCOVProfiler::mangleName(DICompileUnit CU, std::string NewStem) {
|
||||||
SmallString<128> Filename = CU.getFilename();
|
|
||||||
bool AsString = false;
|
|
||||||
|
|
||||||
if (NamedMDNode *GCov = M->getNamedMetadata("llvm.gcov")) {
|
if (NamedMDNode *GCov = M->getNamedMetadata("llvm.gcov")) {
|
||||||
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);
|
||||||
@@ -340,25 +337,16 @@ std::string GCOVProfiler::mangleName(DICompileUnit CU, const char *NewStem) {
|
|||||||
MDNode *CompileUnit = dyn_cast<MDNode>(N->getOperand(1));
|
MDNode *CompileUnit = dyn_cast<MDNode>(N->getOperand(1));
|
||||||
if (!GCovFile || !CompileUnit) continue;
|
if (!GCovFile || !CompileUnit) continue;
|
||||||
if (CompileUnit == CU) {
|
if (CompileUnit == CU) {
|
||||||
Filename = GCovFile->getString();
|
SmallString<128> Filename = GCovFile->getString();
|
||||||
AsString = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (sys::path::is_relative(Filename.c_str())) {
|
|
||||||
SmallString<128> FullPath = CU.getDirectory();
|
|
||||||
sys::path::append(FullPath, Filename.begin(), Filename.end());
|
|
||||||
Filename = FullPath;
|
|
||||||
}
|
|
||||||
|
|
||||||
sys::path::replace_extension(Filename, NewStem);
|
sys::path::replace_extension(Filename, NewStem);
|
||||||
|
|
||||||
if (!AsString)
|
|
||||||
return sys::path::filename(Filename.str());
|
|
||||||
|
|
||||||
return Filename.str();
|
return Filename.str();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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