diff options
| author | Reid Spencer <rspencer@reidspencer.com> | 2005-12-13 20:00:37 +0000 |
|---|---|---|
| committer | Reid Spencer <rspencer@reidspencer.com> | 2005-12-13 20:00:37 +0000 |
| commit | 6796b48e51252cccce7489f0e1c7df888e4f1ff6 (patch) | |
| tree | 35c146b56a22eaf2622f8641de48f9fef7c91d47 | |
| parent | 175613adf67be8b1a4cfff09ab56aeeca826b590 (diff) | |
| download | bcm5719-llvm-6796b48e51252cccce7489f0e1c7df888e4f1ff6.tar.gz bcm5719-llvm-6796b48e51252cccce7489f0e1c7df888e4f1ff6.zip | |
Adjust the constructor to the Linker class to take an argument that names
the module being constructed. This is used to correctly name the module.
Previously the name of the linker tool was used which produces confusing
output when the module identifier is used in an error message.
llvm-svn: 24699
| -rw-r--r-- | llvm/include/llvm/Linker.h | 6 | ||||
| -rw-r--r-- | llvm/lib/Linker/Linker.cpp | 4 | ||||
| -rw-r--r-- | llvm/tools/gccld/gccld.cpp | 6 | ||||
| -rw-r--r-- | llvm/tools/llvm-ld/llvm-ld.cpp | 2 |
4 files changed, 13 insertions, 5 deletions
diff --git a/llvm/include/llvm/Linker.h b/llvm/include/llvm/Linker.h index 60227a724d8..d1854cc6296 100644 --- a/llvm/include/llvm/Linker.h +++ b/llvm/include/llvm/Linker.h @@ -62,7 +62,11 @@ 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 std::string& progname, unsigned Flags = 0 ); + Linker( + const std::string& progname, ///< name of tool running linker + const std::string& modulename, ///< name of linker's end-result module + 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. diff --git a/llvm/lib/Linker/Linker.cpp b/llvm/lib/Linker/Linker.cpp index c72f1b5aca8..9ffe7a121e0 100644 --- a/llvm/lib/Linker/Linker.cpp +++ b/llvm/lib/Linker/Linker.cpp @@ -19,14 +19,14 @@ using namespace llvm; -Linker::Linker(const std::string& progname, unsigned flags) +Linker::Linker(const std::string& progname, const std::string& modname, unsigned flags) : Composite(0) , LibPaths() , Flags(flags) , Error() , ProgramName(progname) { - Composite = new Module(progname); + Composite = new Module(modname); } Linker::Linker(const std::string& progname, Module* aModule, unsigned flags) diff --git a/llvm/tools/gccld/gccld.cpp b/llvm/tools/gccld/gccld.cpp index bad4a9cf06b..644ee7997aa 100644 --- a/llvm/tools/gccld/gccld.cpp +++ b/llvm/tools/gccld/gccld.cpp @@ -107,6 +107,10 @@ namespace { CO5("eh-frame-hdr", cl::Hidden, cl::desc("Compatibility option: ignored")); cl::opt<std::string> CO6("h", cl::Hidden, cl::desc("Compatibility option: ignored")); + cl::opt<bool> + CO7("start-group", cl::Hidden, cl::desc("Compatibility option: ignored")); + cl::opt<bool> + CO8("end-group", cl::Hidden, cl::desc("Compatibility option: ignored")); cl::alias A0("s", cl::desc("Alias for --strip-all"), cl::aliasopt(Strip)); @@ -211,7 +215,7 @@ int main(int argc, char **argv, char **envp ) { int exitCode = 0; std::string ProgName = sys::Path(argv[0]).getBasename(); - Linker TheLinker(ProgName, Verbose); + Linker TheLinker(ProgName, OutputFilename, Verbose); try { // Remove any consecutive duplicates of the same library... diff --git a/llvm/tools/llvm-ld/llvm-ld.cpp b/llvm/tools/llvm-ld/llvm-ld.cpp index 65a220a3acb..03f1c45cb4f 100644 --- a/llvm/tools/llvm-ld/llvm-ld.cpp +++ b/llvm/tools/llvm-ld/llvm-ld.cpp @@ -400,7 +400,7 @@ int main(int argc, char **argv, char **envp) { try { // Initial global variable above for convenience printing of program name. progname = sys::Path(argv[0]).getBasename(); - Linker TheLinker(progname, Verbose); + Linker TheLinker(progname, OutputFilename, Verbose); // Set up the library paths for the Linker TheLinker.addPaths(LibPaths); |

