mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Mimic gcc behaviour with regard to response files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62688 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -388,23 +388,22 @@ static void ExpandResponseFiles(int argc, char** argv,
|
||||
// Check that the response file is not empty (mmap'ing empty
|
||||
// files can be problematic).
|
||||
const sys::FileStatus *FileStat = respFile.getFileStatus();
|
||||
if (!FileStat)
|
||||
continue;
|
||||
if (FileStat->getSize() == 0)
|
||||
continue;
|
||||
if (FileStat && FileStat->getSize() != 0) {
|
||||
|
||||
// Mmap the response file into memory.
|
||||
OwningPtr<MemoryBuffer>
|
||||
respFilePtr(MemoryBuffer::getFile(respFile.c_str()));
|
||||
// Mmap the response file into memory.
|
||||
OwningPtr<MemoryBuffer>
|
||||
respFilePtr(MemoryBuffer::getFile(respFile.c_str()));
|
||||
|
||||
if (respFilePtr == 0)
|
||||
continue;
|
||||
|
||||
ParseCStringVector(newArgv, respFilePtr->getBufferStart());
|
||||
}
|
||||
else {
|
||||
newArgv.push_back(strdup(arg));
|
||||
// If we could open the file, parse its contents, otherwise
|
||||
// pass the @file option verbatim.
|
||||
// TODO: support recursion.
|
||||
if (respFilePtr != 0) {
|
||||
ParseCStringVector(newArgv, respFilePtr->getBufferStart());
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
newArgv.push_back(strdup(arg));
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user