aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2016-06-23 16:13:23 +0000
committerHans Wennborg <hans@hanshq.net>2016-06-23 16:13:23 +0000
commita63b50afb89c976a18355e8ebc5b89349e90d3d5 (patch)
tree1c30c4439a2f4f8c15c97fb4bac6a7e61fc959c6 /llvm/lib/Bitcode/Reader/BitcodeReader.cpp
parent4fec7b713153e70f33bb8854516e996ed4a1adcd (diff)
downloadllvm-a63b50afb89c976a18355e8ebc5b89349e90d3d5.zip
llvm-a63b50afb89c976a18355e8ebc5b89349e90d3d5.tar.gz
llvm-a63b50afb89c976a18355e8ebc5b89349e90d3d5.tar.bz2
Revert r273568 "Remangle intrinsics names when types are renamed"
It broke 2008-07-15-Bswap.ll and 2009-09-01-PostRAProlog.ll llvm-svn: 273574
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r--llvm/lib/Bitcode/Reader/BitcodeReader.cpp25
1 files changed, 2 insertions, 23 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index cdb6a1f..a9c5098 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -15,7 +15,6 @@
#include "llvm/Bitcode/LLVMBitCodes.h"
#include "llvm/Bitcode/ReaderWriter.h"
#include "llvm/IR/AutoUpgrade.h"
-#include "llvm/IR/CallSite.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DebugInfo.h"
#include "llvm/IR/DebugInfoMetadata.h"
@@ -231,10 +230,8 @@ class BitcodeReader : public GVMaterializer {
// When intrinsic functions are encountered which require upgrading they are
// stored here with their replacement function.
- typedef DenseMap<Function*, Function*> UpdatedIntrinsicMap;
- UpdatedIntrinsicMap UpgradedIntrinsics;
- // Intrinsics which were remangled because of types rename
- UpdatedIntrinsicMap RemangledIntrinsics;
+ typedef DenseMap<Function*, Function*> UpgradedIntrinsicMap;
+ UpgradedIntrinsicMap UpgradedIntrinsics;
// Map the bitcode's custom MDKind ID to the Module's MDKind ID.
DenseMap<unsigned, unsigned> MDKindMap;
@@ -3428,11 +3425,6 @@ std::error_code BitcodeReader::globalCleanup() {
Function *NewFn;
if (UpgradeIntrinsicFunction(&F, NewFn))
UpgradedIntrinsics[&F] = NewFn;
- else if (auto Remangled = Intrinsic::remangleIntrinsicFunction(&F))
- // Some types could be renamed during loading if several modules are
- // loaded in the same LLVMContext (LTO scenario). In this case we should
- // remangle intrinsics names as well.
- RemangledIntrinsics[&F] = Remangled.getValue();
}
// Look for global variables which need to be renamed.
@@ -5609,13 +5601,6 @@ std::error_code BitcodeReader::materialize(GlobalValue *GV) {
}
}
- // Update calls to the remangled intrinsics
- for (auto &I : RemangledIntrinsics)
- for (auto UI = I.first->materialized_user_begin(), UE = I.first->user_end();
- UI != UE;)
- // Don't expect any other users than call sites
- CallSite(*UI++).setCalledFunction(I.second);
-
// Finish fn->subprogram upgrade for materialized functions.
if (DISubprogram *SP = FunctionsWithSPs.lookup(F))
F->setSubprogram(SP);
@@ -5669,12 +5654,6 @@ std::error_code BitcodeReader::materializeModule() {
I.first->eraseFromParent();
}
UpgradedIntrinsics.clear();
- // Do the same for remangled intrinsics
- for (auto &I : RemangledIntrinsics) {
- I.first->replaceAllUsesWith(I.second);
- I.first->eraseFromParent();
- }
- RemangledIntrinsics.clear();
UpgradeDebugInfo(*TheModule);