Drop 'const'
[oota-llvm.git] / include / llvm / Linker.h
index d1854cc6296591692bbcb45e99c46d90c8fdf279..66a848336709fe54b1718f35310e278b69528fcf 100644 (file)
@@ -16,6 +16,7 @@
 
 #include "llvm/System/Path.h"
 #include <vector>
+#include <memory>
 
 namespace llvm {
 
@@ -52,7 +53,7 @@ class Linker {
     enum ControlFlags {
       Verbose       = 1, ///< Print to std::cerr what steps the linker is taking
       QuietWarnings = 2, ///< Don't print errors and warnings to std::cerr.
-      QuietErrors   = 4, ///< Indicate that this link is for a native executable
+      QuietErrors   = 4  ///< Indicate that this link is for a native executable
     };
 
   /// @}
@@ -157,7 +158,8 @@ class Linker {
     /// @see getLastError
     /// @throws nothing
     bool LinkInItems (
-      const ItemList& Items // Set of libraries/files to link in
+      const ItemList& Items, ///< Set of libraries/files to link in
+      ItemList& NativeItems  ///< Output list of native files/libs
     );
 
     /// This function links the bytecode \p Files into the composite module.
@@ -180,7 +182,8 @@ class Linker {
     /// @see getLastError
     /// @brief Link in a single file.
     bool LinkInFile(
-      const sys::Path& File ///< File to link in.
+      const sys::Path& File, ///< File to link in.
+      bool &is_native        ///< Indicates if the file is native object file
     );
 
     /// This function provides a way to selectively link in a set of modules,
@@ -209,7 +212,8 @@ class Linker {
     /// @returns true if an error occurs, false otherwise
     /// @brief Link one library into the module
     bool LinkInLibrary (
-      const std::string& Library ///< The library to link in
+      const std::string& Library, ///< The library to link in
+      bool& is_native             ///< Indicates if lib a native library
     );
 
     /// This function links one bytecode archive, \p Filename, into the module.
@@ -225,7 +229,8 @@ class Linker {
     /// @returns true if an error occurs, otherwise false.
     /// @brief Link in one archive.
     bool LinkInArchive(
-      const sys::Path& Filename ///< Filename of the archive to link
+      const sys::Path& Filename, ///< Filename of the archive to link
+      bool& is_native            ///<  Indicates if archive is a native archive
     );
 
     /// This method links the \p Src module into the Linker's Composite module
@@ -236,8 +241,11 @@ class Linker {
     /// @returns True if an error occurs, false otherwise.
     /// @brief Link in a module.
     bool LinkInModule(
-      Module* Src     ///< Module linked into \p Dest
-    ) { return LinkModules(Composite, Src, &Error); }
+      Module* Src,              ///< Module linked into \p Dest
+      std::string* ErrorMsg = 0 /// Error/diagnostic string
+    ) { 
+      return LinkModules(Composite, Src, ErrorMsg ); 
+    }
 
     /// This is the heart of the linker. This method will take unconditional
     /// control of the \p Src module and link it into the \p Dest module. The