summaryrefslogtreecommitdiffstats
path: root/llvm/utils/FileCheck/FileCheck.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-08-27 20:03:13 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-08-27 20:03:13 +0000
commit3560ff2c1f49147da6181cfdab88b65b65e6158e (patch)
tree22ad6cea73085253977df7380573e60d7bb6dac5 /llvm/utils/FileCheck/FileCheck.cpp
parent7b343e3cc6db7f60cf5aaccf37014243c26cf536 (diff)
downloadbcm5719-llvm-3560ff2c1f49147da6181cfdab88b65b65e6158e.tar.gz
bcm5719-llvm-3560ff2c1f49147da6181cfdab88b65b65e6158e.zip
Return a std::unique_ptr when creating a new MemoryBuffer.
llvm-svn: 216583
Diffstat (limited to 'llvm/utils/FileCheck/FileCheck.cpp')
-rw-r--r--llvm/utils/FileCheck/FileCheck.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/utils/FileCheck/FileCheck.cpp b/llvm/utils/FileCheck/FileCheck.cpp
index 9203c4cf33c..9606e64d6f8 100644
--- a/llvm/utils/FileCheck/FileCheck.cpp
+++ b/llvm/utils/FileCheck/FileCheck.cpp
@@ -839,8 +839,8 @@ static bool ReadCheckFile(SourceMgr &SM,
// If we want to canonicalize whitespace, strip excess whitespace from the
// buffer containing the CHECK lines. Remove DOS style line endings.
- std::unique_ptr<MemoryBuffer> F =
- CanonicalizeInputFile(std::move(*FileOrErr), NoCanonicalizeWhiteSpace);
+ std::unique_ptr<MemoryBuffer> F = CanonicalizeInputFile(
+ std::move(FileOrErr.get()), NoCanonicalizeWhiteSpace);
// Find all instances of CheckPrefix followed by : in the file.
StringRef Buffer = F->getBuffer();
@@ -853,8 +853,9 @@ static bool ReadCheckFile(SourceMgr &SM,
// command line option responsible for the specific implicit CHECK-NOT.
std::string Prefix = std::string("-") + ImplicitCheckNot.ArgStr + "='";
std::string Suffix = "'";
- std::unique_ptr<MemoryBuffer> CmdLine(MemoryBuffer::getMemBufferCopy(
- Prefix + PatternString + Suffix, "command line"));
+ std::unique_ptr<MemoryBuffer> CmdLine = MemoryBuffer::getMemBufferCopy(
+ Prefix + PatternString + Suffix, "command line");
+
StringRef PatternInBuffer =
CmdLine->getBuffer().substr(Prefix.size(), PatternString.size());
SM.AddNewSourceBuffer(std::move(CmdLine), SMLoc());
OpenPOWER on IntegriCloud