[llvm-commits] CVS: llvm/tools/llvm-ld/llvm-ld.cpp

Reid Spencer reid at x10sys.com
Sun Dec 19 10:01:08 PST 2004



Changes in directory llvm/tools/llvm-ld:

llvm-ld.cpp updated: 1.15 -> 1.16
---
Log message:

For PR351: http://llvm.cs.uiuc.edu/PR351 :
* Support changes in sys::Program::ExecuteAndWait interface 

---
Diffs of the changes:  (+16 -14)

Index: llvm/tools/llvm-ld/llvm-ld.cpp
diff -u llvm/tools/llvm-ld/llvm-ld.cpp:1.15 llvm/tools/llvm-ld/llvm-ld.cpp:1.16
--- llvm/tools/llvm-ld/llvm-ld.cpp:1.15	Sat Dec 18 00:54:21 2004
+++ llvm/tools/llvm-ld/llvm-ld.cpp	Sun Dec 19 12:00:56 2004
@@ -218,13 +218,13 @@
                             const std::string &InputFilename,
                             const sys::Path &llc) {
   // Run LLC to convert the bytecode file into assembly code.
-  std::vector<std::string> args;
+  std::vector<const char*> args;
   args.push_back( "-f");
   args.push_back( "-o");
-  args.push_back( OutputFilename);
-  args.push_back( InputFilename);
+  args.push_back( OutputFilename.c_str() );
+  args.push_back( InputFilename.c_str() );
 
-  return sys::Program::ExecuteAndWait(llc,args);
+  return sys::Program::ExecuteAndWait(llc,&args[0]);
 }
 
 /// GenerateAssembly - generates a native assembly language source file from the
@@ -233,13 +233,13 @@
                          const std::string &InputFile,
                          const sys::Path &llc) {
   // Run LLC to convert the bytecode file into C.
-  std::vector<std::string> args;
+  std::vector<const char*> args;
   args.push_back( "-march=c");
   args.push_back( "-f");
   args.push_back( "-o");
-  args.push_back( OutputFile);
-  args.push_back( InputFile);
-  return sys::Program::ExecuteAndWait(llc, args);
+  args.push_back( OutputFile.c_str() );
+  args.push_back( InputFile.c_str() );
+  return sys::Program::ExecuteAndWait(llc, &args[0]);
 }
 
 /// GenerateNative - generates a native assembly language source file from the
@@ -285,20 +285,22 @@
   //  We can't just assemble and link the file with the system assembler
   //  and linker because we don't know where to put the _start symbol.
   //  GCC mysteriously knows how to do it.
-  std::vector<std::string> args;
+  std::vector<const char*> args;
   args.push_back("-fno-strict-aliasing");
   args.push_back("-O3");
   args.push_back("-o");
-  args.push_back(OutputFilename);
-  args.push_back(InputFilename);
+  args.push_back(OutputFilename.c_str());
+  args.push_back(InputFilename.c_str());
 
   // Add in the libraries to link.
   for (unsigned index = 0; index < Libraries.size(); index++)
-    if (Libraries[index] != "crtend")
-      args.push_back("-l" + Libraries[index]);
+    if (Libraries[index] != "crtend") {
+      args.push_back("-l");
+      args.push_back(Libraries[index].c_str());
+    }
 
   // Run the compiler to assembly and link together the program.
-  return sys::Program::ExecuteAndWait(gcc, args, (const char**)clean_env);
+  return sys::Program::ExecuteAndWait(gcc, &args[0], (const char**)clean_env);
 }
 
 /// EmitShellScript - Output the wrapper file that invokes the JIT on the LLVM






More information about the llvm-commits mailing list