diff options
Diffstat (limited to 'llvm/tools/llvm-pdbutil/InputFile.cpp')
-rw-r--r-- | llvm/tools/llvm-pdbutil/InputFile.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/llvm/tools/llvm-pdbutil/InputFile.cpp b/llvm/tools/llvm-pdbutil/InputFile.cpp index bd23bfdbe31..f61d89bd70c 100644 --- a/llvm/tools/llvm-pdbutil/InputFile.cpp +++ b/llvm/tools/llvm-pdbutil/InputFile.cpp @@ -66,20 +66,17 @@ getModuleDebugStream(PDBFile &File, StringRef &ModuleName, uint32_t Index) { static inline bool isCodeViewDebugSubsection(object::SectionRef Section, StringRef Name, BinaryStreamReader &Reader) { - StringRef SectionName; + StringRef SectionName, Contents; if (Section.getName(SectionName)) return false; if (SectionName != Name) return false; - Expected<StringRef> ContentsOrErr = Section.getContents(); - if (!ContentsOrErr) { - consumeError(ContentsOrErr.takeError()); + if (Section.getContents(Contents)) return false; - } - Reader = BinaryStreamReader(*ContentsOrErr, support::little); + Reader = BinaryStreamReader(Contents, support::little); uint32_t Magic; if (Reader.bytesRemaining() < sizeof(uint32_t)) return false; |