aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/TextAPI
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/TextAPI')
-rw-r--r--llvm/lib/TextAPI/MachO/TextStub.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/TextAPI/MachO/TextStub.cpp b/llvm/lib/TextAPI/MachO/TextStub.cpp
index be4d69c..630663d 100644
--- a/llvm/lib/TextAPI/MachO/TextStub.cpp
+++ b/llvm/lib/TextAPI/MachO/TextStub.cpp
@@ -634,13 +634,11 @@ TextAPIReader::get(std::unique_ptr<MemoryBuffer> InputBuffer) {
std::vector<const InterfaceFile *> Files;
YAMLIn >> Files;
- auto File = std::unique_ptr<InterfaceFile>(
- const_cast<InterfaceFile *>(Files.front()));
-
if (YAMLIn.error())
return make_error<StringError>(Ctx.ErrorMessage, YAMLIn.error());
- return File;
+ auto *File = const_cast<InterfaceFile *>(Files.front());
+ return std::unique_ptr<InterfaceFile>(File);
}
Error TextAPIWriter::writeToStream(raw_ostream &OS, const InterfaceFile &File) {