diff options
author | Michael J. Spencer <bigcheesegs@gmail.com> | 2010-12-16 03:29:14 +0000 |
---|---|---|
committer | Michael J. Spencer <bigcheesegs@gmail.com> | 2010-12-16 03:29:14 +0000 |
commit | 39a0ffc3949a746d0a09c9a3e01c183c9216da04 (patch) | |
tree | d045dd753f87830314c4fede77145544f5650b6a /llvm/lib/Support/CommandLine.cpp | |
parent | 716d01a612022608467fb7071ef4669dd326e007 (diff) | |
download | llvm-39a0ffc3949a746d0a09c9a3e01c183c9216da04.zip llvm-39a0ffc3949a746d0a09c9a3e01c183c9216da04.tar.gz llvm-39a0ffc3949a746d0a09c9a3e01c183c9216da04.tar.bz2 |
MemoryBuffer now return an error_code and returns a OwningPtr<MemoryBuffer> via an out parm.
llvm-svn: 121958
Diffstat (limited to 'llvm/lib/Support/CommandLine.cpp')
-rw-r--r-- | llvm/lib/Support/CommandLine.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/llvm/lib/Support/CommandLine.cpp b/llvm/lib/Support/CommandLine.cpp index e856509..373a1a2 100644 --- a/llvm/lib/Support/CommandLine.cpp +++ b/llvm/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; } |