diff options
Diffstat (limited to 'tools/llvm-ld')
-rw-r--r-- | tools/llvm-ld/Optimize.cpp | 28 | ||||
-rw-r--r-- | tools/llvm-ld/llvm-ld.cpp | 40 |
2 files changed, 34 insertions, 34 deletions
diff --git a/tools/llvm-ld/Optimize.cpp b/tools/llvm-ld/Optimize.cpp index 5dc9424..1961a95 100644 --- a/tools/llvm-ld/Optimize.cpp +++ b/tools/llvm-ld/Optimize.cpp @@ -1,10 +1,10 @@ //===- Optimize.cpp - Optimize a complete program -------------------------===// -// +// // The LLVM Compiler Infrastructure // -// This file was developed by Reid Spencer and is distributed under the +// This file was developed by Reid Spencer and is distributed under the // University of Illinois Open Source License. See LICENSE.TXT for details. -// +// //===----------------------------------------------------------------------===// // // This file implements all optimization of the linked module for llvm-ld. @@ -52,7 +52,7 @@ static cl::opt<OptimizationLevels> OptLevel( ) ); -static cl::opt<bool> DisableInline("disable-inlining", +static cl::opt<bool> DisableInline("disable-inlining", cl::desc("Do not run the inliner pass")); static cl::opt<bool> @@ -62,13 +62,13 @@ DisableOptimizations("disable-opt", static cl::opt<bool> DisableInternalize("disable-internalize", cl::desc("Do not mark all symbols as internal")); -static cl::opt<bool> Verify("verify", +static cl::opt<bool> Verify("verify", cl::desc("Verify intermediate results of all passes")); -static cl::opt<bool> Strip("s", +static cl::opt<bool> Strip("s", cl::desc("Strip symbol info from executable")); -static cl::alias ExportDynamic("export-dynamic", +static cl::alias ExportDynamic("export-dynamic", cl::aliasopt(DisableInternalize), cl::desc("Alias for -disable-internalize")); @@ -81,16 +81,16 @@ static cl::list<std::string> LoadableModules("load", static inline void addPass(PassManager &PM, Pass *P) { // Add the pass to the pass manager... PM.add(P); - + // If we are verifying all of the intermediate steps, add the verifier... - if (Verify) + if (Verify) PM.add(createVerifierPass()); } namespace llvm { -/// Optimize - Perform link time optimizations. This will run the scalar -/// optimizations, any loaded plugin-optimization modules, and then the +/// Optimize - Perform link time optimizations. This will run the scalar +/// optimizations, any loaded plugin-optimization modules, and then the /// inter-procedural optimizations if applicable. void Optimize(Module* M) { @@ -98,7 +98,7 @@ void Optimize(Module* M) { PassManager Passes; // If we're verifying, start off with a verification pass. - if (Verify) + if (Verify) Passes.add(createVerifierPass()); // Add an appropriate TargetData instance for this module... @@ -171,14 +171,14 @@ void Optimize(Module* M) { } std::vector<std::string> plugins = LoadableModules; - for (std::vector<std::string>::iterator I = plugins.begin(), + for (std::vector<std::string>::iterator I = plugins.begin(), E = plugins.end(); I != E; ++I) { sys::DynamicLibrary dll(I->c_str()); typedef void (*OptimizeFunc)(PassManager&,int); OptimizeFunc OF = OptimizeFunc( dll.GetAddressOfSymbol("RunOptimizations")); if (OF == 0) { - throw std::string("Optimization Module '") + *I + + throw std::string("Optimization Module '") + *I + "' is missing the RunOptimizations symbol"; } (*OF)(Passes,OptLevel); diff --git a/tools/llvm-ld/llvm-ld.cpp b/tools/llvm-ld/llvm-ld.cpp index 944f23d..ccd643e 100644 --- a/tools/llvm-ld/llvm-ld.cpp +++ b/tools/llvm-ld/llvm-ld.cpp @@ -1,10 +1,10 @@ //===- llvm-ld.cpp - LLVM 'ld' compatible linker --------------------------===// -// +// // The LLVM Compiler Infrastructure // // This file was developed by the LLVM research group and is distributed under // the University of Illinois Open Source License. See LICENSE.TXT for details. -// +// //===----------------------------------------------------------------------===// // // This utility is intended to be compatible with GCC, and follows standard @@ -44,21 +44,21 @@ static cl::list<std::string> InputFilenames(cl::Positional, cl::OneOrMore, cl::desc("<input bytecode files>")); static cl::opt<std::string> OutputFilename("o", cl::init("a.out"), - cl::desc("Override output filename"), + cl::desc("Override output filename"), cl::value_desc("filename")); -static cl::opt<bool> Verbose("v", +static cl::opt<bool> Verbose("v", cl::desc("Print information about actions taken")); - + static cl::list<std::string> LibPaths("L", cl::Prefix, - cl::desc("Specify a library search path"), + cl::desc("Specify a library search path"), cl::value_desc("directory")); static cl::list<std::string> Libraries("l", cl::Prefix, - cl::desc("Specify libraries to link to"), + cl::desc("Specify libraries to link to"), cl::value_desc("library prefix")); -static cl::opt<bool> LinkAsLibrary("link-as-library", +static cl::opt<bool> LinkAsLibrary("link-as-library", cl::desc("Link the .bc files together as a library, not an executable")); static cl::alias Relink("r", cl::aliasopt(LinkAsLibrary), @@ -75,18 +75,18 @@ static cl::opt<bool>NativeCBE("native-cbe", static cl::opt<bool>DisableCompression("disable-compression",cl::init(false), cl::desc("Disable writing of compressed bytecode files")); - + // Compatibility options that are ignored but supported by LD -static cl::opt<std::string> CO3("soname", cl::Hidden, +static cl::opt<std::string> CO3("soname", cl::Hidden, cl::desc("Compatibility option: ignored")); -static cl::opt<std::string> CO4("version-script", cl::Hidden, +static cl::opt<std::string> CO4("version-script", cl::Hidden, cl::desc("Compatibility option: ignored")); -static cl::opt<bool> CO5("eh-frame-hdr", cl::Hidden, +static cl::opt<bool> CO5("eh-frame-hdr", cl::Hidden, cl::desc("Compatibility option: ignored")); -static cl::opt<std::string> CO6("h", cl::Hidden, +static cl::opt<std::string> CO6("h", cl::Hidden, cl::desc("Compatibility option: ignored")); /// This is just for convenience so it doesn't have to be passed around @@ -342,12 +342,12 @@ static void EmitShellScript(char **argv) { LibPaths.push_back("/usr/X11R6/lib"); // We don't need to link in libc! In fact, /usr/lib/libc.so may not be a // shared object at all! See RH 8: plain text. - std::vector<std::string>::iterator libc = + std::vector<std::string>::iterator libc = std::find(Libraries.begin(), Libraries.end(), "c"); if (libc != Libraries.end()) Libraries.erase(libc); // List all the shared object (native) libraries this executable will need // on the command line, so that we don't have to do this manually! - for (std::vector<std::string>::iterator i = Libraries.begin(), + for (std::vector<std::string>::iterator i = Libraries.begin(), e = Libraries.end(); i != e; ++i) { sys::Path FullLibraryPath = sys::Path::FindLibrary(*i); if (!FullLibraryPath.isEmpty() && FullLibraryPath.isDynamicLibrary()) @@ -365,7 +365,7 @@ static void BuildLinkItems( const cl::list<std::string>& Files, const cl::list<std::string>& Libraries) { - // Build the list of linkage items for LinkItems. + // Build the list of linkage items for LinkItems. cl::list<std::string>::const_iterator fileIt = Files.begin(); cl::list<std::string>::const_iterator libIt = Libraries.begin(); @@ -401,7 +401,7 @@ int main(int argc, char **argv, char **envp) { // Initial global variable above for convenience printing of program name. progname = sys::Path(argv[0]).getBasename(); Linker TheLinker(progname, Verbose); - + // Set up the library paths for the Linker TheLinker.addPaths(LibPaths); TheLinker.addSystemPaths(); @@ -423,7 +423,7 @@ int main(int argc, char **argv, char **envp) { // The libraries aren't linked in but are noted as "dependent" in the // module. - for (cl::list<std::string>::const_iterator I = Libraries.begin(), + for (cl::list<std::string>::const_iterator I = Libraries.begin(), E = Libraries.end(); I != E ; ++I) { TheLinker.getModule()->addLibrary(*I); } @@ -476,7 +476,7 @@ int main(int argc, char **argv, char **envp) { if (Verbose) std::cout << "Generating Assembly Code\n"; GenerateAssembly(AssemblyFile.toString(), RealBytecodeOutput, llc); if (Verbose) std::cout << "Generating Native Code\n"; - GenerateNative(OutputFilename, AssemblyFile.toString(), Libraries, + GenerateNative(OutputFilename, AssemblyFile.toString(), Libraries, gcc, envp); // Remove the assembly language file. @@ -510,7 +510,7 @@ int main(int argc, char **argv, char **envp) { } else { EmitShellScript(argv); } - + // Make the script executable... sys::Path(OutputFilename).makeExecutable(); |