Index: test/Other/ResponseFile.ll =================================================================== --- test/Other/ResponseFile.ll (revision 0) +++ test/Other/ResponseFile.ll (revision 0) @@ -0,0 +1,12 @@ +; Test response file with llvm-link +; RUN: i=1; while [[ $i -lt 10 ]]; do echo "define void @foo$i(){ret void}"|llvm-as -o %t.foo$i.bc; i=$((i+1)); done +; RUN: rm -f %t.bar.ll +; RUN: i=1; while [[ $i -lt 10 ]]; do echo "declare void @foo$i(...)" >> %t.bar.ll; i=$((i+1)); done +; RUN: echo "define void @bar() {" >> %t.bar.ll +; RUN: i=1; while [[ $i -lt 10 ]]; do echo "call void (...)* @foo$i()" >> %t.bar.ll; i=$((i+1)); done +; RUN: echo "ret void }" >> %t.bar.ll +; RUN: llvm-as %t.bar.ll -o %t.bar.bc +; RUN: rm -f %t.lnk +; RUN: i=1; while [[ $i -lt 10 ]]; do echo %t.foo$i.bc >> %t.lnk; i=$((i+1)); done +; RUN: echo %t.bar.bc >> %t.lnk +; RUN: llvm-link @%t.lnk -o %t.bc Index: include/llvm/Support/CommandLine.h =================================================================== --- include/llvm/Support/CommandLine.h (revision 165015) +++ include/llvm/Support/CommandLine.h (working copy) @@ -41,16 +41,14 @@ // ParseCommandLineOptions - Command line option processing entry point. // void ParseCommandLineOptions(int argc, const char * const *argv, - const char *Overview = 0, - bool ReadResponseFiles = false); + const char *Overview = 0); //===----------------------------------------------------------------------===// // ParseEnvironmentOptions - Environment variable option processing alternate // entry point. // void ParseEnvironmentOptions(const char *progName, const char *envvar, - const char *Overview = 0, - bool ReadResponseFiles = false); + const char *Overview = 0); ///===---------------------------------------------------------------------===// /// SetVersionPrinter - Override the default (LLVM specific) version printer Index: lib/Support/CommandLine.cpp =================================================================== --- lib/Support/CommandLine.cpp (revision 165015) +++ lib/Support/CommandLine.cpp (working copy) @@ -464,7 +464,7 @@ /// an environment variable (whose name is given in ENVVAR). /// void cl::ParseEnvironmentOptions(const char *progName, const char *envVar, - const char *Overview, bool ReadResponseFiles) { + const char *Overview) { // Check args. assert(progName && "Program name not specified"); assert(envVar && "Environment variable name missing"); @@ -483,7 +483,7 @@ // and hand it off to ParseCommandLineOptions(). ParseCStringVector(newArgv, envValue); int newArgc = static_cast(newArgv.size()); - ParseCommandLineOptions(newArgc, &newArgv[0], Overview, ReadResponseFiles); + ParseCommandLineOptions(newArgc, &newArgv[0], Overview); // Free all the strdup()ed strings. for (std::vector::iterator i = newArgv.begin(), e = newArgv.end(); @@ -529,7 +529,7 @@ } void cl::ParseCommandLineOptions(int argc, const char * const *argv, - const char *Overview, bool ReadResponseFiles) { + const char *Overview) { // Process all registered options. SmallVector PositionalOpts; SmallVector SinkOpts; @@ -541,12 +541,10 @@ // Expand response files. std::vector newArgv; - if (ReadResponseFiles) { - newArgv.push_back(strdup(argv[0])); - ExpandResponseFiles(argc, argv, newArgv); - argv = &newArgv[0]; - argc = static_cast(newArgv.size()); - } + newArgv.push_back(strdup(argv[0])); + ExpandResponseFiles(argc, argv, newArgv); + argv = &newArgv[0]; + argc = static_cast(newArgv.size()); // Copy the program name into ProgName, making sure not to overflow it. std::string ProgName = sys::path::filename(argv[0]); @@ -839,12 +837,10 @@ MoreHelp->clear(); // Free the memory allocated by ExpandResponseFiles. - if (ReadResponseFiles) { - // Free all the strdup()ed strings. - for (std::vector::iterator i = newArgv.begin(), e = newArgv.end(); - i != e; ++i) - free(*i); - } + // Free all the strdup()ed strings. + for (std::vector::iterator i = newArgv.begin(), e = newArgv.end(); + i != e; ++i) + free(*i); // If we had an error processing our arguments, don't let the program execute if (ErrorParsing) exit(1);