[llvm] r183842 - Don't use PathV1 in CommandLine.cpp.
Rafael Espindola
rafael.espindola at gmail.com
Wed Jun 12 08:37:27 PDT 2013
Author: rafael
Date: Wed Jun 12 10:37:27 2013
New Revision: 183842
URL: http://llvm.org/viewvc/llvm-project?rev=183842&view=rev
Log:
Don't use PathV1 in CommandLine.cpp.
No functionality change.
Modified:
llvm/trunk/lib/Support/CommandLine.cpp
Modified: llvm/trunk/lib/Support/CommandLine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/CommandLine.cpp?rev=183842&r1=183841&r2=183842&view=diff
==============================================================================
--- llvm/trunk/lib/Support/CommandLine.cpp (original)
+++ llvm/trunk/lib/Support/CommandLine.cpp Wed Jun 12 10:37:27 2013
@@ -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
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));
More information about the llvm-commits
mailing list