summaryrefslogtreecommitdiff
path: root/lib/Support/CommandLine.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-06-12 15:37:27 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-06-12 15:37:27 +0000
commit234cad70a5a00c38e7c75cd0354f15e1905e2642 (patch)
tree8c19b7eeaf227b35e80ca6d426eb97afc1f675c1 /lib/Support/CommandLine.cpp
parentf69ead465110efd53cc838191080bc0f2d71c345 (diff)
downloadllvm-234cad70a5a00c38e7c75cd0354f15e1905e2642.tar.gz
llvm-234cad70a5a00c38e7c75cd0354f15e1905e2642.tar.bz2
llvm-234cad70a5a00c38e7c75cd0354f15e1905e2642.tar.xz
Don't use PathV1 in CommandLine.cpp.
No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183842 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/CommandLine.cpp')
-rw-r--r--lib/Support/CommandLine.cpp32
1 files changed, 10 insertions, 22 deletions
diff --git a/lib/Support/CommandLine.cpp b/lib/Support/CommandLine.cpp
index 7568390d64..6ab03dc675 100644
--- a/lib/Support/CommandLine.cpp
+++ b/lib/Support/CommandLine.cpp
@@ -29,7 +29,6 @@
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/Path.h"
-#include "llvm/Support/PathV1.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Support/system_error.h"
#include <cerrno>
@@ -513,27 +512,16 @@ static void ExpandResponseFiles(unsigned argc, const char*const* argv,
const char *arg = argv[i];
if (arg[0] == '@') {
- sys::PathWithStatus respFile(++arg);
-
- // Check that the response file is not empty (mmap'ing empty
- // files can be problematic).
- const sys::FileStatus *FileStat = respFile.getFileStatus();
- if (FileStat && FileStat->getSize() != 0) {
-
- // If we could open the file, parse its contents, otherwise
- // pass the @file option verbatim.
-
- // TODO: we should also support recursive loading of response files,
- // since this is how gcc behaves. (From their man page: "The file may
- // itself contain additional @file options; any such options will be
- // processed recursively.")
-
- // Mmap the response file into memory.
- OwningPtr<MemoryBuffer> respFilePtr;
- if (!MemoryBuffer::getFile(respFile.c_str(), respFilePtr)) {
- ParseCStringVector(newArgv, respFilePtr->getBufferStart());
- continue;
- }
+ // TODO: we should also support recursive loading of response files,
+ // since this is how gcc behaves. (From their man page: "The file may
+ // itself contain additional @file options; any such options will be
+ // processed recursively.")
+
+ // Mmap the response file into memory.
+ OwningPtr<MemoryBuffer> respFilePtr;
+ if (!MemoryBuffer::getFile(arg + 1, respFilePtr)) {
+ ParseCStringVector(newArgv, respFilePtr->getBufferStart());
+ continue;
}
}
newArgv.push_back(strdup(arg));