diff options
author | Lang Hames <lhames@gmail.com> | 2024-11-29 15:14:18 +1100 |
---|---|---|
committer | Lang Hames <lhames@gmail.com> | 2024-11-29 15:57:53 +1100 |
commit | d02c1676d75a6bab1252b48da9a955fc7dc1251f (patch) | |
tree | 2d0b9a2505921de9876504131ba48089bb0b7e68 /llvm/lib/Object/Archive.cpp | |
parent | 8fcbba82d6c8038c4a0c5859275523414107b198 (diff) | |
download | llvm-d02c1676d75a6bab1252b48da9a955fc7dc1251f.zip llvm-d02c1676d75a6bab1252b48da9a955fc7dc1251f.tar.gz llvm-d02c1676d75a6bab1252b48da9a955fc7dc1251f.tar.bz2 |
[Support][Error] Add ErrorAsOutParameter constructor that takes an Error by ref.
ErrorAsOutParameter's Error* constructor supports cases where an Error might not
be passed in (because in the calling context it's known that this call won't
fail). Most clients always have an Error present however, and for them an Error&
overload is more convenient.
Diffstat (limited to 'llvm/lib/Object/Archive.cpp')
-rw-r--r-- | llvm/lib/Object/Archive.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Object/Archive.cpp b/llvm/lib/Object/Archive.cpp index e755e81..92f31c9 100644 --- a/llvm/lib/Object/Archive.cpp +++ b/llvm/lib/Object/Archive.cpp @@ -707,7 +707,7 @@ void Archive::setFirstRegular(const Child &C) { Archive::Archive(MemoryBufferRef Source, Error &Err) : Binary(Binary::ID_Archive, Source) { - ErrorAsOutParameter ErrAsOutParam(&Err); + ErrorAsOutParameter ErrAsOutParam(Err); StringRef Buffer = Data.getBuffer(); // Check for sufficient magic. if (Buffer.starts_with(ThinArchiveMagic)) { |