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