diff options
author | Owen Anderson <resistor@mac.com> | 2008-07-08 16:38:42 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2008-07-08 16:38:42 +0000 |
commit | 7220b814ed6f432d1d31d444b65e0c3b120942df (patch) | |
tree | 9bdb361f5662958be2679463596e4aa5c366df5d /tools/bugpoint | |
parent | 28124ac6066795e69046371936f73faa09f15aba (diff) | |
download | llvm-7220b814ed6f432d1d31d444b65e0c3b120942df.tar.gz llvm-7220b814ed6f432d1d31d444b65e0c3b120942df.tar.bz2 llvm-7220b814ed6f432d1d31d444b65e0c3b120942df.tar.xz |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53236 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/bugpoint')
-rw-r--r-- | tools/bugpoint/ExtractFunction.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/bugpoint/ExtractFunction.cpp b/tools/bugpoint/ExtractFunction.cpp index ca8a279153..776922aa5d 100644 --- a/tools/bugpoint/ExtractFunction.cpp +++ b/tools/bugpoint/ExtractFunction.cpp @@ -262,8 +262,11 @@ Module *llvm::SplitFunctionsOutOfModule(Module *M, 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); |