diff options
author | Chris Lattner <sabre@nondot.org> | 2007-02-07 19:31:33 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-02-07 19:31:33 +0000 |
commit | 3cfc1d22b2ed48834fefadc629c5841972763dfd (patch) | |
tree | e3d2749f1ac908903226bec42f9979e31449fcd2 /lib | |
parent | 566dd149aef94f889f85272c9e8c898c51d6f198 (diff) | |
download | external_llvm-3cfc1d22b2ed48834fefadc629c5841972763dfd.zip external_llvm-3cfc1d22b2ed48834fefadc629c5841972763dfd.tar.gz external_llvm-3cfc1d22b2ed48834fefadc629c5841972763dfd.tar.bz2 |
Fix Transforms/DeadArgElim/2007-02-07-FuncRename.ll, fallout from PR411.
This happened because deadargelim now causes VMCore to auto-rename every
function that it hacks arguments out of. Because it hacks arguments out of
functions in a non-deterministic order, this caused the resultant numbering
to be nondet. The fix is to just be careful to not rename functions!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34005 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Transforms/IPO/DeadArgumentElimination.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Transforms/IPO/DeadArgumentElimination.cpp b/lib/Transforms/IPO/DeadArgumentElimination.cpp index 149043d..b39b250 100644 --- a/lib/Transforms/IPO/DeadArgumentElimination.cpp +++ b/lib/Transforms/IPO/DeadArgumentElimination.cpp @@ -150,7 +150,8 @@ bool DAE::DeleteDeadVarargs(Function &Fn) { unsigned NumArgs = Params.size(); // Create the new function body and insert it into the module... - Function *NF = new Function(NFTy, Fn.getLinkage(), Fn.getName()); + std::string Name = Fn.getName(); Fn.setName(""); + Function *NF = new Function(NFTy, Fn.getLinkage(), Name); NF->setCallingConv(Fn.getCallingConv()); Fn.getParent()->getFunctionList().insert(&Fn, NF); @@ -508,7 +509,8 @@ void DAE::RemoveDeadArgumentsFromFunction(Function *F) { FunctionType *NFTy = FunctionType::get(RetTy, Params, FTy->isVarArg()); // Create the new function body and insert it into the module... - Function *NF = new Function(NFTy, F->getLinkage(), F->getName()); + std::string Name = F->getName(); F->setName(""); + Function *NF = new Function(NFTy, F->getLinkage(), Name); NF->setCallingConv(F->getCallingConv()); F->getParent()->getFunctionList().insert(F, NF); |