summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ProfileData
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-07-06 17:43:13 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-07-06 17:43:13 +0000
commitadf21f2a5634f2b33b6aa2dffae67df50c72a9f2 (patch)
treeab58d9d0ff55fb26656a0152b43539b19657b9dc /llvm/lib/ProfileData
parent178cadafc1a7fc576b6f4eb86a598c24247ccad7 (diff)
downloadbcm5719-llvm-adf21f2a5634f2b33b6aa2dffae67df50c72a9f2.tar.gz
bcm5719-llvm-adf21f2a5634f2b33b6aa2dffae67df50c72a9f2.zip
Update the MemoryBuffer API to use ErrorOr.
llvm-svn: 212405
Diffstat (limited to 'llvm/lib/ProfileData')
-rw-r--r--llvm/lib/ProfileData/InstrProfReader.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/ProfileData/InstrProfReader.cpp b/llvm/lib/ProfileData/InstrProfReader.cpp
index d0493d34c20..0b367282e14 100644
--- a/llvm/lib/ProfileData/InstrProfReader.cpp
+++ b/llvm/lib/ProfileData/InstrProfReader.cpp
@@ -23,8 +23,11 @@ using namespace llvm;
static std::error_code
setupMemoryBuffer(std::string Path, std::unique_ptr<MemoryBuffer> &Buffer) {
- if (std::error_code EC = MemoryBuffer::getFileOrSTDIN(Path, Buffer))
+ ErrorOr<std::unique_ptr<MemoryBuffer>> BufferOrErr =
+ MemoryBuffer::getFileOrSTDIN(Path);
+ if (std::error_code EC = BufferOrErr.getError())
return EC;
+ Buffer = std::move(BufferOrErr.get());
// Sanity check the file.
if (Buffer->getBufferSize() > std::numeric_limits<unsigned>::max())
OpenPOWER on IntegriCloud