X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FLinker.h;h=b402a6090e2cf387743036c01f7c41689ecda8f7;hb=73c8415d90ad5a702538d8bc308411e7b2299f32;hp=43db5961d4db60b7635eba7cabf669a07d2d8fce;hpb=48b2f3e4850cd27d54224cd42da8a160d6b95984;p=oota-llvm.git diff --git a/include/llvm/Linker.h b/include/llvm/Linker.h index 43db5961d4d..b402a6090e2 100644 --- a/include/llvm/Linker.h +++ b/include/llvm/Linker.h @@ -14,14 +14,15 @@ #ifndef LLVM_LINKER_H #define LLVM_LINKER_H -#include "llvm/System/Path.h" #include #include +#include "llvm/ADT/StringRef.h" namespace llvm { + namespace sys { class Path; } class Module; -struct LLVMContext; +class LLVMContext; /// This class provides the core functionality of linking in LLVM. It retains a /// Module object which is the composite of the modules and libraries linked @@ -64,17 +65,16 @@ class Linker { /// Construct the Linker with an empty module which will be given the /// name \p progname. \p progname will also be used for error messages. /// @brief Construct with empty module - Linker( - const StringRef& progname, ///< name of tool running linker - const StringRef& modulename, ///< name of linker's end-result module - LLVMContext& C, ///< Context for global info - unsigned Flags = 0 ///< ControlFlags (one or more |'d together) + Linker(StringRef progname, ///< name of tool running linker + StringRef modulename, ///< name of linker's end-result module + LLVMContext &C, ///< Context for global info + unsigned Flags = 0 ///< ControlFlags (one or more |'d together) ); /// Construct the Linker with a previously defined module, \p aModule. Use /// \p progname for the name of the program in error messages. /// @brief Construct with existing module - Linker(const StringRef& progname, Module* aModule, unsigned Flags = 0); + Linker(StringRef progname, Module* aModule, unsigned Flags = 0); /// Destruct the Linker. /// @brief Destructor @@ -158,7 +158,6 @@ class Linker { /// @returns true if an error occurred, false otherwise /// @see LinkItemKind /// @see getLastError - /// @throws nothing bool LinkInItems ( const ItemList& Items, ///< Set of libraries/files to link in ItemList& NativeItems ///< Output list of native files/libs @@ -214,8 +213,8 @@ class Linker { /// @returns true if an error occurs, false otherwise /// @brief Link one library into the module bool LinkInLibrary ( - const StringRef &Library, ///< The library to link in - bool& is_native ///< Indicates if lib a native library + StringRef Library, ///< The library to link in + bool& is_native ///< Indicates if lib a native library ); /// This function links one bitcode archive, \p Filename, into the module. @@ -223,7 +222,7 @@ class Linker { /// the archive that resolve outstanding symbols will be linked in. The /// library is searched repeatedly until no more modules that resolve /// symbols can be found. If an error occurs, the error string is set. - /// To speed up this function, ensure the the archive has been processed + /// To speed up this function, ensure the archive has been processed /// llvm-ranlib or the S option was given to llvm-ar when the archive was /// created. These tools add a symbol table to the archive which makes the /// search for undefined symbols much faster. @@ -267,7 +266,7 @@ class Linker { /// will be empty (i.e. sys::Path::isEmpty() will return true). /// @returns A sys::Path to the found library /// @brief Find a library from its short name. - sys::Path FindLib(const StringRef &Filename); + sys::Path FindLib(StringRef Filename); /// @} /// @name Implementation @@ -277,9 +276,9 @@ class Linker { /// Module it contains (wrapped in an auto_ptr), or 0 if an error occurs. std::auto_ptr LoadObject(const sys::Path& FN); - bool warning(const StringRef &message); - bool error(const StringRef &message); - void verbose(const StringRef &message); + bool warning(StringRef message); + bool error(StringRef message); + void verbose(StringRef message); /// @} /// @name Data