Make sure metarenamer won't rename special stuff (intrinsics and explicitly renamed stuff).

Otherwise this might hide the problems.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173265 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Anton Korobeynikov 2013-01-23 15:03:08 +00:00
parent 48a615fee7
commit 03f7e727f4

View File

@ -72,13 +72,23 @@ namespace {
// Rename all aliases // Rename all aliases
for (Module::alias_iterator AI = M.alias_begin(), AE = M.alias_end(); for (Module::alias_iterator AI = M.alias_begin(), AE = M.alias_end();
AI != AE; ++AI) AI != AE; ++AI) {
AI->setName("alias"); StringRef Name = AI->getName();
if (Name.startswith("llvm.") || (!Name.empty() && Name[0] == 1))
continue;
AI->setName("alias");
}
// Rename all global variables // Rename all global variables
for (Module::global_iterator GI = M.global_begin(), GE = M.global_end(); for (Module::global_iterator GI = M.global_begin(), GE = M.global_end();
GI != GE; ++GI) GI != GE; ++GI) {
StringRef Name = GI->getName();
if (Name.startswith("llvm.") || (!Name.empty() && Name[0] == 1))
continue;
GI->setName("global"); GI->setName("global");
}
// Rename all struct types // Rename all struct types
TypeFinder StructTypes; TypeFinder StructTypes;
@ -95,6 +105,10 @@ namespace {
// Rename all functions // Rename all functions
for (Module::iterator FI = M.begin(), FE = M.end(); for (Module::iterator FI = M.begin(), FE = M.end();
FI != FE; ++FI) { FI != FE; ++FI) {
StringRef Name = FI->getName();
if (Name.startswith("llvm.") || (!Name.empty() && Name[0] == 1))
continue;
FI->setName(metaNames[prng.rand() % array_lengthof(metaNames)]); FI->setName(metaNames[prng.rand() % array_lengthof(metaNames)]);
runOnFunction(*FI); runOnFunction(*FI);
} }