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