summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-11-11 00:37:22 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-11-11 00:37:22 +0000
commit8d693a3429b48e0e967bdf9e32acb5881c4b1d62 (patch)
treef2c85d74fa164f8bc6e22f4655498cb45a8a9f38 /clang/lib/CodeGen/CodeGenModule.cpp
parent732c99c4ae6e309ea441f73f757c6990b7223f8e (diff)
downloadbcm5719-llvm-8d693a3429b48e0e967bdf9e32acb5881c4b1d62.tar.gz
bcm5719-llvm-8d693a3429b48e0e967bdf9e32acb5881c4b1d62.zip
Revert "Keep the old function order in CodeGenModule::applyReplacements."
This reverts commit r194357. Debugging a cast failure during bootstrap. llvm-svn: 194358
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp16
1 files changed, 2 insertions, 14 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index ee700807437..74f3bbb0459 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -181,20 +181,8 @@ void CodeGenModule::applyReplacements() {
llvm::GlobalValue *Entry = GetGlobalValue(MangledName);
if (!Entry)
continue;
- llvm::Function *OldF = cast<llvm::Function>(Entry);
- llvm::Function *NewF = dyn_cast<llvm::Function>(Replacement);
- if (!NewF) {
- llvm::ConstantExpr *CE = cast<llvm::ConstantExpr>(Replacement);
- assert(CE->getOpcode() == llvm::Instruction::BitCast ||
- CE->getOpcode() == llvm::Instruction::GetElementPtr);
- NewF = cast<llvm::Function>(CE->getOperand(0));
- }
-
- // Replace old with new, but keep the old order.
- OldF->replaceAllUsesWith(Replacement);
- NewF->removeFromParent();
- OldF->getParent()->getFunctionList().insertAfter(OldF, NewF);
- OldF->eraseFromParent();
+ Entry->replaceAllUsesWith(Replacement);
+ Entry->eraseFromParent();
}
}
OpenPOWER on IntegriCloud