diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2004-12-19 18:00:56 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2004-12-19 18:00:56 +0000 |
commit | 766ad0b77f87177e185d9b65573a6c7b2736bcc5 (patch) | |
tree | da9f7e52b29f6cb9877c25164470bcf8c2e3c899 /llvm/tools/gccld | |
parent | 6cb551b279720364180a9b14b365cb577da29ef3 (diff) | |
download | bcm5719-llvm-766ad0b77f87177e185d9b65573a6c7b2736bcc5.tar.gz bcm5719-llvm-766ad0b77f87177e185d9b65573a6c7b2736bcc5.zip |
For PR351:
* Support changes in sys::Program::ExecuteAndWait interface
llvm-svn: 19044
Diffstat (limited to 'llvm/tools/gccld')
-rw-r--r-- | llvm/tools/gccld/GenerateCode.cpp | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/llvm/tools/gccld/GenerateCode.cpp b/llvm/tools/gccld/GenerateCode.cpp index 773ef4962ec..b189d0654f5 100644 --- a/llvm/tools/gccld/GenerateCode.cpp +++ b/llvm/tools/gccld/GenerateCode.cpp @@ -242,13 +242,13 @@ int llvm::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 @@ -257,13 +257,13 @@ int llvm::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 @@ -308,20 +308,22 @@ int llvm::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); } |