summaryrefslogtreecommitdiff
path: root/tools/llvm-ld
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2004-12-19 18:00:56 +0000
committerReid Spencer <rspencer@reidspencer.com>2004-12-19 18:00:56 +0000
commitf6358c75eb393ae579aace88a1152f39b2a924f4 (patch)
treed5f6bb7769386c1bcea1c347323b86a883c7cfd5 /tools/llvm-ld
parent2a7d9e98bafb918e942c785120e2e5e65019bc52 (diff)
downloadllvm-f6358c75eb393ae579aace88a1152f39b2a924f4.tar.gz
llvm-f6358c75eb393ae579aace88a1152f39b2a924f4.tar.bz2
llvm-f6358c75eb393ae579aace88a1152f39b2a924f4.tar.xz
For PR351:
* Support changes in sys::Program::ExecuteAndWait interface git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19044 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-ld')
-rw-r--r--tools/llvm-ld/llvm-ld.cpp30
1 files changed, 16 insertions, 14 deletions
diff --git a/tools/llvm-ld/llvm-ld.cpp b/tools/llvm-ld/llvm-ld.cpp
index 2a7b535cfa..c85a6be049 100644
--- a/tools/llvm-ld/llvm-ld.cpp
+++ b/tools/llvm-ld/llvm-ld.cpp
@@ -218,13 +218,13 @@ static int GenerateAssembly(const std::string &OutputFilename,
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 @@ static int GenerateCFile(const std::string &OutputFile,
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 @@ static int GenerateNative(const std::string &OutputFilename,
// 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