summaryrefslogtreecommitdiff
path: root/lib/Support/CommandLine.cpp
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2010-12-16 03:29:14 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2010-12-16 03:29:14 +0000
commit3ff9563c3e391954b2e224afcf8b2b0fcc3888aa (patch)
treecccde9111a73ba5895f6cefbfb280290fa6c469d /lib/Support/CommandLine.cpp
parentb29b20e7deb7297f6a10b2d6922feeca8c6df055 (diff)
downloadllvm-3ff9563c3e391954b2e224afcf8b2b0fcc3888aa.tar.gz
llvm-3ff9563c3e391954b2e224afcf8b2b0fcc3888aa.tar.bz2
llvm-3ff9563c3e391954b2e224afcf8b2b0fcc3888aa.tar.xz
MemoryBuffer now return an error_code and returns a OwningPtr<MemoryBuffer> via an out parm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121958 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/CommandLine.cpp')
-rw-r--r--lib/Support/CommandLine.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/Support/CommandLine.cpp b/lib/Support/CommandLine.cpp
index e856509d4f..373a1a2c52 100644
--- a/lib/Support/CommandLine.cpp
+++ b/lib/Support/CommandLine.cpp
@@ -464,11 +464,6 @@ static void ExpandResponseFiles(unsigned argc, char** argv,
const sys::FileStatus *FileStat = respFile.getFileStatus();
if (FileStat && FileStat->getSize() != 0) {
- // Mmap the response file into memory.
- error_code ec;
- OwningPtr<MemoryBuffer>
- respFilePtr(MemoryBuffer::getFile(respFile.c_str(), ec));
-
// If we could open the file, parse its contents, otherwise
// pass the @file option verbatim.
@@ -477,7 +472,9 @@ static void ExpandResponseFiles(unsigned argc, char** argv,
// itself contain additional @file options; any such options will be
// processed recursively.")
- if (respFilePtr != 0) {
+ // Mmap the response file into memory.
+ OwningPtr<MemoryBuffer> respFilePtr;
+ if (!MemoryBuffer::getFile(respFile.c_str(), respFilePtr)) {
ParseCStringVector(newArgv, respFilePtr->getBufferStart());
continue;
}