diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2015-12-18 19:57:26 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2015-12-18 19:57:26 +0000 |
commit | 18c63b0f1859d9996b4d3b8c69c22f5f6b46498b (patch) | |
tree | bec9efd8dbfff541d87707e1a3ba4ed0eb02751f /llvm/lib/Bitcode/Reader/BitcodeReader.cpp | |
parent | 081a24e3a7cf26c5190699ea8567786c9cb01797 (diff) | |
download | bcm5719-llvm-18c63b0f1859d9996b4d3b8c69c22f5f6b46498b.tar.gz bcm5719-llvm-18c63b0f1859d9996b4d3b8c69c22f5f6b46498b.zip |
Drop support for dematerializing.
It was only used on lib/Linker and the use was "dead" since it was used on a
function the IRMover had just moved.
llvm-svn: 256019
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r-- | llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp index ff08f55d43f..d7fce0580c2 100644 --- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp @@ -227,9 +227,6 @@ class BitcodeReader : public GVMaterializer { /// (e.g.) blockaddress forward references. bool WillMaterializeAllForwardRefs = false; - /// Functions that have block addresses taken. This is usually empty. - SmallPtrSet<const Function *, 4> BlockAddressesTaken; - /// True if any Metadata block has been materialized. bool IsMetadataMaterialized = false; @@ -256,11 +253,9 @@ public: void releaseBuffer(); - bool isDematerializable(const GlobalValue *GV) const override; std::error_code materialize(GlobalValue *GV) override; std::error_code materializeModule(Module *M) override; std::vector<StructType *> getIdentifiedStructTypes() const override; - void dematerialize(GlobalValue *GV) override; /// \brief Main interface to parsing a bitcode buffer. /// \returns true if an error occurred. @@ -2951,9 +2946,6 @@ std::error_code BitcodeReader::parseConstants() { if (!Fn) return error("Invalid record"); - // Don't let Fn get dematerialized. - BlockAddressesTaken.insert(Fn); - // If the function is already parsed we can insert the block address right // away. BasicBlock *BB; @@ -5291,32 +5283,6 @@ std::error_code BitcodeReader::materialize(GlobalValue *GV) { return materializeForwardReferencedFunctions(); } -bool BitcodeReader::isDematerializable(const GlobalValue *GV) const { - const Function *F = dyn_cast<Function>(GV); - if (!F || F->isDeclaration()) - return false; - - // Dematerializing F would leave dangling references that wouldn't be - // reconnected on re-materialization. - if (BlockAddressesTaken.count(F)) - return false; - - return DeferredFunctionInfo.count(const_cast<Function*>(F)); -} - -void BitcodeReader::dematerialize(GlobalValue *GV) { - Function *F = dyn_cast<Function>(GV); - // If this function isn't dematerializable, this is a noop. - if (!F || !isDematerializable(F)) - return; - - assert(DeferredFunctionInfo.count(F) && "No info to read function later?"); - - // Just forget the function body, we can remat it later. - F->dropAllReferences(); - F->setIsMaterializable(true); -} - std::error_code BitcodeReader::materializeModule(Module *M) { assert(M == TheModule && "Can only Materialize the Module this BitcodeReader is attached to."); |