Added iterators to ImmutableSet.
[oota-llvm.git] / include / llvm / Linker.h
index 5a19ec6065b157eca8fb72e830f9874104e47f41..8c53b343924a38166d118b7b80c3cc23fe94f1c8 100644 (file)
@@ -28,7 +28,7 @@ class Module;
 /// In this case the Linker still retains ownership of the Module. If the
 /// releaseModule() method is used, the ownership of the Module is transferred
 /// to the caller and the Linker object is only suitable for destruction.
-/// The Linker can link Modules from memory, bytecode files, or bytecode
+/// The Linker can link Modules from memory, bitcode files, or bitcode
 /// archives.  It retains a set of search paths in which to find any libraries
 /// presented to it. By default, the linker will generate error and warning
 /// messages to std::cerr but this capability can be turned off with the
@@ -162,10 +162,10 @@ class Linker {
       ItemList& NativeItems  ///< Output list of native files/libs
     );
 
-    /// This function links the bytecode \p Files into the composite module.
+    /// This function links the bitcode \p Files into the composite module.
     /// Note that this does not do any linking of unresolved symbols. The \p
     /// Files are all completely linked into \p HeadModule regardless of
-    /// unresolved symbols. This function just loads each bytecode file and
+    /// unresolved symbols. This function just loads each bitcode file and
     /// calls LinkInModule on them.
     /// @returns true if an error occurs, false otherwise
     /// @see getLastError
@@ -174,15 +174,16 @@ class Linker {
       const std::vector<sys::Path> & Files ///< Files to link in
     );
 
-    /// This function links a single bytecode file, \p File, into the composite
+    /// This function links a single bitcode file, \p File, into the composite
     /// module. Note that this does not attempt to resolve symbols. This method
-    /// just loads the bytecode file and calls LinkInModule on it. If an error
+    /// just loads the bitcode file and calls LinkInModule on it. If an error
     /// occurs, the Linker's error string is set.
     /// @returns true if an error occurs, false otherwise
     /// @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,
@@ -203,7 +204,7 @@ class Linker {
     /// found in one library, based on the unresolved symbols in the composite
     /// module.The \p Library should be the base name of a library, as if given
     /// with the -l option of a linker tool. The Linker's LibPaths are searched
-    /// for the \P Library and if found, it will be linked in with via the
+    /// for the \p Library and if found, it will be linked in with via the
     /// LinkInArchive method. If an error occurs, the Linker's error string is
     /// set.
     /// @see LinkInArchive
@@ -212,10 +213,10 @@ class Linker {
     /// @brief Link one library into the module
     bool LinkInLibrary (
       const std::string& Library, ///< The library to link in
-      bool& is_file               ///< Indicates if lib is really a bc file
+      bool& is_native             ///< Indicates if lib a native library
     );
 
-    /// This function links one bytecode archive, \p Filename, into the module.
+    /// This function links one bitcode archive, \p Filename, into the module.
     /// The archive is searched to resolve outstanding symbols. Any modules in
     /// the archive that resolve outstanding symbols will be linked in. The
     /// library is searched repeatedly until no more modules that resolve
@@ -228,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
@@ -241,7 +243,9 @@ class Linker {
     bool LinkInModule(
       Module* Src,              ///< Module linked into \p Dest
       std::string* ErrorMsg = 0 /// Error/diagnostic string
-    ) { return LinkModules(Composite, Src, ErrorMsg ); }
+    ) { 
+      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
@@ -267,7 +271,7 @@ class Linker {
   /// @name Implementation
   /// @{
   private:
-    /// Read in and parse the bytecode file named by FN and return the
+    /// Read in and parse the bitcode file named by FN and return the
     /// Module it contains (wrapped in an auto_ptr), or 0 if an error occurs.
     std::auto_ptr<Module> LoadObject(const sys::Path& FN);