Emit DWARF info for all code section in an assembly file
[oota-llvm.git] / include / llvm / ExecutionEngine / RTDyldMemoryManager.h
index 38a7606cdea78533bb3b6b48f33a1c7dbd1bddb9..b1d6810f374bdf4ff2343b53f4bb23533adaf71c 100644 (file)
@@ -52,6 +52,20 @@ public:
     uintptr_t Size, unsigned Alignment, unsigned SectionID,
     StringRef SectionName, bool IsReadOnly) = 0;
 
+  /// Inform the memory manager about the total amount of memory required to
+  /// allocate all sections to be loaded:
+  /// \p CodeSize - the total size of all code sections
+  /// \p DataSizeRO - the total size of all read-only data sections
+  /// \p DataSizeRW - the total size of all read-write data sections
+  /// 
+  /// Note that by default the callback is disabled. To enable it
+  /// redefine the method needsToReserveAllocationSpace to return true.
+  virtual void reserveAllocationSpace(
+    uintptr_t CodeSize, uintptr_t DataSizeRO, uintptr_t DataSizeRW) { }
+  
+  /// Override to return true to enable the reserveAllocationSpace callback.
+  virtual bool needsToReserveAllocationSpace() { return false; }
+
   /// Register the EH frames with the runtime so that c++ exceptions work.
   ///
   /// \p Addr parameter provides the local address of the EH frame section
@@ -100,7 +114,7 @@ public:
   /// operations needed to reliably use the memory are also performed.
   ///
   /// Returns true if an error occurred, false otherwise.
-  virtual bool finalizeMemory(std::string *ErrMsg = 0) = 0;
+  virtual bool finalizeMemory(std::string *ErrMsg = nullptr) = 0;
 };
 
 // Create wrappers for C Binding types (see CBindingWrapping.h).