Start MCAsmStreamer implementation.
[oota-llvm.git] / include / llvm / ModuleProvider.h
index a5f001ee8cccc0cc261663f4bae4b1838f390467..8a0a20c0ef6681ae286c33039b73b4159ed7634d 100644 (file)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file was developed by the LLVM research group and is distributed under
-// the University of Illinois Open Source License. See LICENSE.TXT for details.
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 //
@@ -43,6 +43,13 @@ public:
   ///
   virtual bool materializeFunction(Function *F, std::string *ErrInfo = 0) = 0;
 
+  /// dematerializeFunction - If the given function is read in, and if the
+  /// module provider supports it, release the memory for the function, and set
+  /// it up to be materialized lazily.  If the provider doesn't support this
+  /// capability, this method is a noop.
+  ///
+  virtual void dematerializeFunction(Function *) {}
+  
   /// materializeModule - make sure the entire Module has been completely read.
   /// On error, return null and fill in the error string if specified.
   ///
@@ -67,13 +74,13 @@ public:
 /// if we just have a Module.  Note that the ModuleProvider takes ownership of
 /// the Module specified.
 struct ExistingModuleProvider : public ModuleProvider {
-  ExistingModuleProvider(Module *M) {
+  explicit ExistingModuleProvider(Module *M) {
     TheModule = M;
   }
-  bool materializeFunction(Function *F, std::string *ErrInfo = 0) {
+  bool materializeFunction(Function *, std::string * = 0) {
     return false;
   }
-  Module* materializeModule(std::string *ErrInfo = 0) { return TheModule; }
+  Module* materializeModule(std::string * = 0) { return TheModule; }
 };
 
 } // End llvm namespace