[llvm-commits] [llvm] r53236 - /llvm/trunk/tools/bugpoint/ExtractFunction.cpp
Owen Anderson
resistor at mac.com
Tue Jul 8 09:39:16 PDT 2008
Author: resistor
Date: Tue Jul 8 11:38:42 2008
New Revision: 53236
URL: http://llvm.org/viewvc/llvm-project?rev=53236&view=rev
Log:
Global variables beginning with \01 have special meaning on Darwin, so we need to remove
the name prefix when we change them from internal to external. This allows bugpointing
of codegen miscompilations to work more reliably on Darwin.
Modified:
llvm/trunk/tools/bugpoint/ExtractFunction.cpp
Modified: llvm/trunk/tools/bugpoint/ExtractFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/ExtractFunction.cpp?rev=53236&r1=53235&r2=53236&view=diff
==============================================================================
--- llvm/trunk/tools/bugpoint/ExtractFunction.cpp (original)
+++ llvm/trunk/tools/bugpoint/ExtractFunction.cpp Tue Jul 8 11:38:42 2008
@@ -262,8 +262,11 @@
for (Module::iterator I = M->begin(), E = M->end(); I != E; ++I)
I->setLinkage(GlobalValue::ExternalLinkage);
for (Module::global_iterator I = M->global_begin(), E = M->global_end();
- I != E; ++I)
+ I != E; ++I) {
+ if (I->hasName() && *I->getNameStart() == '\01')
+ I->setName(I->getNameStart()+1, I->getNameLen()-1);
I->setLinkage(GlobalValue::ExternalLinkage);
+ }
Module *New = CloneModule(M);
More information about the llvm-commits
mailing list