summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Object/MachOObjectFile.cpp
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2016-03-25 23:54:32 +0000
committerLang Hames <lhames@gmail.com>2016-03-25 23:54:32 +0000
commitd1af8fce0fa1d05d635eeb892b82f2cca1cee1cd (patch)
tree083faace094981e0a867770913a0cf38702fb70f /llvm/lib/Object/MachOObjectFile.cpp
parented963704f5371835efde99bea9333de05e73deac (diff)
downloadbcm5719-llvm-d1af8fce0fa1d05d635eeb892b82f2cca1cee1cd.tar.gz
bcm5719-llvm-d1af8fce0fa1d05d635eeb892b82f2cca1cee1cd.zip
[Support] Switch to RAII helper for error-as-out-parameter idiom.
As discussed on the llvm-commits thread for r264467. llvm-svn: 264479
Diffstat (limited to 'llvm/lib/Object/MachOObjectFile.cpp')
-rw-r--r--llvm/lib/Object/MachOObjectFile.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Object/MachOObjectFile.cpp b/llvm/lib/Object/MachOObjectFile.cpp
index 864d76f7112..607c24688e4 100644
--- a/llvm/lib/Object/MachOObjectFile.cpp
+++ b/llvm/lib/Object/MachOObjectFile.cpp
@@ -246,7 +246,7 @@ static Error parseSegmentLoadCommand(
Expected<std::unique_ptr<MachOObjectFile>>
MachOObjectFile::create(MemoryBufferRef Object, bool IsLittleEndian,
bool Is64Bits) {
- Error Err = Error::errorForOutParameter();
+ Error Err;
std::unique_ptr<MachOObjectFile> Obj(
new MachOObjectFile(std::move(Object), IsLittleEndian,
Is64Bits, Err));
@@ -262,7 +262,7 @@ MachOObjectFile::MachOObjectFile(MemoryBufferRef Object, bool IsLittleEndian,
DataInCodeLoadCmd(nullptr), LinkOptHintsLoadCmd(nullptr),
DyldInfoLoadCmd(nullptr), UuidLoadCmd(nullptr),
HasPageZeroSegment(false) {
-
+ ErrorAsOutParameter ErrAsOutParam(Err);
if (is64Bit())
parseHeader(this, Header64, Err);
else
OpenPOWER on IntegriCloud