Drop materializeAllPermanently.
authorRafael Espindola <rafael.espindola@gmail.com>
Fri, 18 Dec 2015 20:13:39 +0000 (20:13 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Fri, 18 Dec 2015 20:13:39 +0000 (20:13 +0000)
This inlines materializeAll into the only caller
(materializeAllPermanently) and renames materializeAllPermanently to
just materializeAll.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256024 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/IR/Module.h
lib/Bitcode/Reader/BitcodeReader.cpp
lib/ExecutionEngine/Interpreter/Interpreter.cpp
lib/IR/Module.cpp
tools/lli/lli.cpp
tools/llvm-dis/llvm-dis.cpp

index a46ba80bbf2f46d0a9f0963b006f8756d2365688..bf1447e48af15e692384bf9ef376dfed6611e14e 100644 (file)
@@ -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();
 
index d7fce0580c2ecd40ea790bd611b5fe8a298b8a1b..be12dbed0ce0e2447fad7c5996684e6528d01bbc 100644 (file)
@@ -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.
index 8cb9d45bb6806759390f0015fd6ee9d340508503..bc7da2e4f6afba5edce666ea1f373d7af416c74f 100644 (file)
@@ -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
index d17449108690617adc3ecb3f42fabef1c6640e4b..ee7ec5e22e8d6c800e7f9c914054e3cf79883f07 100644 (file)
@@ -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();
 }
index 949b444cc28169dde13962e91eafa34ac58b8c59..9f714060c17a5b36aec8fad810d04d789626d69a 100644 (file)
@@ -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);
index 4b7d94d5b2610b8f3f82a952c92ad226a03fe866..9fdfcd4256c9a8cb6832b7153503638969be936d 100644 (file)
@@ -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;