diff options
Diffstat (limited to 'llvm/tools/dsymutil/DwarfStreamer.cpp')
-rw-r--r-- | llvm/tools/dsymutil/DwarfStreamer.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/llvm/tools/dsymutil/DwarfStreamer.cpp b/llvm/tools/dsymutil/DwarfStreamer.cpp index ccc6a2c852c..fbea7426a52 100644 --- a/llvm/tools/dsymutil/DwarfStreamer.cpp +++ b/llvm/tools/dsymutil/DwarfStreamer.cpp @@ -667,12 +667,10 @@ void DwarfStreamer::translateLineTable(DataExtractor Data, uint32_t Offset, static void emitSectionContents(const object::ObjectFile &Obj, StringRef SecName, MCStreamer *MS) { - if (auto Sec = getSectionByName(Obj, SecName)) { - if (Expected<StringRef> E = Sec->getContents()) - MS->EmitBytes(*E); - else - consumeError(E.takeError()); - } + StringRef Contents; + if (auto Sec = getSectionByName(Obj, SecName)) + if (!Sec->getContents(Contents)) + MS->EmitBytes(Contents); } void DwarfStreamer::copyInvariantDebugSection(const object::ObjectFile &Obj) { |