Mimic gcc behaviour with regard to response files.
llvm-svn: 62688
This commit is contained in:
parent
1a0c083748
commit
6a4f729dc9
|
@ -78,8 +78,24 @@ options intended for developers.
|
||||||
|
|
||||||
Print version information and exit.
|
Print version information and exit.
|
||||||
|
|
||||||
|
=item B<@>I<file>
|
||||||
|
|
||||||
|
Read command-line options from I<file>. The options read are inserted
|
||||||
|
in place of the original @I<file> option. If I<file> does not exist, or
|
||||||
|
cannot be read, then the option will be treated literally, and not
|
||||||
|
removed.
|
||||||
|
|
||||||
|
Options in I<file> are separated by whitespace. A whitespace character
|
||||||
|
may be included in an option by surrounding the entire option in
|
||||||
|
either single or double quotes. Any character (including a backslash)
|
||||||
|
may be included by prefixing the character to be included with a
|
||||||
|
backslash. The file may itself contain additional @I<file> options;
|
||||||
|
any such options will be processed recursively.
|
||||||
|
|
||||||
|
|
||||||
=back
|
=back
|
||||||
|
|
||||||
|
|
||||||
=head2 Control Options
|
=head2 Control Options
|
||||||
|
|
||||||
By default, LLVMC is built with some standard configuration libraries
|
By default, LLVMC is built with some standard configuration libraries
|
||||||
|
|
|
@ -388,23 +388,22 @@ static void ExpandResponseFiles(int argc, char** argv,
|
||||||
// Check that the response file is not empty (mmap'ing empty
|
// Check that the response file is not empty (mmap'ing empty
|
||||||
// files can be problematic).
|
// files can be problematic).
|
||||||
const sys::FileStatus *FileStat = respFile.getFileStatus();
|
const sys::FileStatus *FileStat = respFile.getFileStatus();
|
||||||
if (!FileStat)
|
if (FileStat && FileStat->getSize() != 0) {
|
||||||
continue;
|
|
||||||
if (FileStat->getSize() == 0)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
// Mmap the response file into memory.
|
// Mmap the response file into memory.
|
||||||
OwningPtr<MemoryBuffer>
|
OwningPtr<MemoryBuffer>
|
||||||
respFilePtr(MemoryBuffer::getFile(respFile.c_str()));
|
respFilePtr(MemoryBuffer::getFile(respFile.c_str()));
|
||||||
|
|
||||||
if (respFilePtr == 0)
|
// If we could open the file, parse its contents, otherwise
|
||||||
continue;
|
// pass the @file option verbatim.
|
||||||
|
// TODO: support recursion.
|
||||||
ParseCStringVector(newArgv, respFilePtr->getBufferStart());
|
if (respFilePtr != 0) {
|
||||||
}
|
ParseCStringVector(newArgv, respFilePtr->getBufferStart());
|
||||||
else {
|
continue;
|
||||||
newArgv.push_back(strdup(arg));
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
newArgv.push_back(strdup(arg));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue