diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2015-12-18 20:13:39 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2015-12-18 20:13:39 +0000 |
commit | c4a03483f4c53c71fb6763f7abb3204ee3053b69 (patch) | |
tree | ea6d8350c4f9c2a25e6180ee9aa8387b643d9510 | |
parent | e5dafd176555e9ea564889247737fec4d622fb9e (diff) | |
download | llvm-c4a03483f4c53c71fb6763f7abb3204ee3053b69.zip llvm-c4a03483f4c53c71fb6763f7abb3204ee3053b69.tar.gz llvm-c4a03483f4c53c71fb6763f7abb3204ee3053b69.tar.bz2 |
Drop materializeAllPermanently.
This inlines materializeAll into the only caller
(materializeAllPermanently) and renames materializeAllPermanently to
just materializeAll.
llvm-svn: 256024
-rw-r--r-- | llvm/include/llvm/IR/Module.h | 7 | ||||
-rw-r--r-- | llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/IR/Module.cpp | 9 | ||||
-rw-r--r-- | llvm/tools/lli/lli.cpp | 2 | ||||
-rw-r--r-- | llvm/tools/llvm-dis/llvm-dis.cpp | 2 |
6 files changed, 8 insertions, 16 deletions
diff --git a/llvm/include/llvm/IR/Module.h b/llvm/include/llvm/IR/Module.h index a46ba80..bf1447e 100644 --- a/llvm/include/llvm/IR/Module.h +++ b/llvm/include/llvm/IR/Module.h @@ -431,7 +431,7 @@ public: /// Sets the GVMaterializer to GVM. This module must not yet have a /// Materializer. To reset the materializer for a module that already has one, - /// call MaterializeAllPermanently first. Destroying this module will destroy + /// call materializeAll first. Destroying this module will destroy /// its materializer without materializing any more GlobalValues. Without /// destroying the Module, there is no way to detach or destroy a materializer /// without materializing all the GVs it controls, to avoid leaving orphan @@ -445,13 +445,10 @@ public: /// problem. If successful, this returns false. std::error_code materialize(GlobalValue *GV); - /// Make sure all GlobalValues in this Module are fully read. - std::error_code materializeAll(); - /// Make sure all GlobalValues in this Module are fully read and clear the /// Materializer. If the module is corrupt, this DOES NOT clear the old /// Materializer. - std::error_code materializeAllPermanently(); + std::error_code materializeAll(); std::error_code materializeMetadata(); diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp index d7fce05..be12dbe 100644 --- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp @@ -5847,7 +5847,7 @@ getBitcodeModuleImpl(std::unique_ptr<DataStreamer> Streamer, StringRef Name, if (MaterializeAll) { // Read in the entire module, and destroy the BitcodeReader. - if (std::error_code EC = M->materializeAllPermanently()) + if (std::error_code EC = M->materializeAll()) return cleanupOnError(EC); } else { // Resolve forward references from blockaddresses. diff --git a/llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp b/llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp index 8cb9d45..bc7da2e 100644 --- a/llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp +++ b/llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp @@ -35,7 +35,7 @@ extern "C" void LLVMLinkInInterpreter() { } ExecutionEngine *Interpreter::create(std::unique_ptr<Module> M, std::string *ErrStr) { // Tell this Module to materialize everything and release the GVMaterializer. - if (std::error_code EC = M->materializeAllPermanently()) { + if (std::error_code EC = M->materializeAll()) { if (ErrStr) *ErrStr = EC.message(); // We got an error, just return 0 diff --git a/llvm/lib/IR/Module.cpp b/llvm/lib/IR/Module.cpp index d1744910..ee7ec5e 100644 --- a/llvm/lib/IR/Module.cpp +++ b/llvm/lib/IR/Module.cpp @@ -379,7 +379,7 @@ const DataLayout &Module::getDataLayout() const { return DL; } // void Module::setMaterializer(GVMaterializer *GVM) { assert(!Materializer && - "Module already has a GVMaterializer. Call MaterializeAllPermanently" + "Module already has a GVMaterializer. Call materializeAll" " to clear it out before setting another one."); Materializer.reset(GVM); } @@ -394,13 +394,8 @@ std::error_code Module::materialize(GlobalValue *GV) { std::error_code Module::materializeAll() { if (!Materializer) return std::error_code(); - return Materializer->materializeModule(this); -} - -std::error_code Module::materializeAllPermanently() { - if (std::error_code EC = materializeAll()) + if (std::error_code EC = Materializer->materializeModule(this)) return EC; - Materializer.reset(); return std::error_code(); } diff --git a/llvm/tools/lli/lli.cpp b/llvm/tools/lli/lli.cpp index 949b444..9f71406 100644 --- a/llvm/tools/lli/lli.cpp +++ b/llvm/tools/lli/lli.cpp @@ -421,7 +421,7 @@ int main(int argc, char **argv, char * const *envp) { // If not jitting lazily, load the whole bitcode file eagerly too. if (NoLazyCompilation) { - if (std::error_code EC = Mod->materializeAllPermanently()) { + if (std::error_code EC = Mod->materializeAll()) { errs() << argv[0] << ": bitcode didn't read correctly.\n"; errs() << "Reason: " << EC.message() << "\n"; exit(1); diff --git a/llvm/tools/llvm-dis/llvm-dis.cpp b/llvm/tools/llvm-dis/llvm-dis.cpp index 4b7d94d..9fdfcd4 100644 --- a/llvm/tools/llvm-dis/llvm-dis.cpp +++ b/llvm/tools/llvm-dis/llvm-dis.cpp @@ -159,7 +159,7 @@ int main(int argc, char **argv) { ErrorOr<std::unique_ptr<Module>> MOrErr = getStreamedBitcodeModule(DisplayFilename, std::move(Streamer), Context); M = std::move(*MOrErr); - M->materializeAllPermanently(); + M->materializeAll(); } else { errs() << argv[0] << ": " << ErrorMessage << '\n'; return 1; |