aboutsummaryrefslogtreecommitdiff
path: root/tools/llvm-pdbutil/InputFile.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2019-10-23 17:51:42 +0000
committerDimitry Andric <dim@FreeBSD.org>2019-10-23 17:51:42 +0000
commit1d5ae1026e831016fc29fd927877c86af904481f (patch)
tree2cdfd12620fcfa5d9e4a0389f85368e8e36f63f9 /tools/llvm-pdbutil/InputFile.cpp
parente6d1592492a3a379186bfb02bd0f4eda0669c0d5 (diff)
Notes
Diffstat (limited to 'tools/llvm-pdbutil/InputFile.cpp')
-rw-r--r--tools/llvm-pdbutil/InputFile.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/tools/llvm-pdbutil/InputFile.cpp b/tools/llvm-pdbutil/InputFile.cpp
index bd23bfdbe31a..b316882de64d 100644
--- a/tools/llvm-pdbutil/InputFile.cpp
+++ b/tools/llvm-pdbutil/InputFile.cpp
@@ -66,12 +66,13 @@ getModuleDebugStream(PDBFile &File, StringRef &ModuleName, uint32_t Index) {
static inline bool isCodeViewDebugSubsection(object::SectionRef Section,
StringRef Name,
BinaryStreamReader &Reader) {
- StringRef SectionName;
- if (Section.getName(SectionName))
- return false;
-
- if (SectionName != Name)
+ if (Expected<StringRef> NameOrErr = Section.getName()) {
+ if (*NameOrErr != Name)
+ return false;
+ } else {
+ consumeError(NameOrErr.takeError());
return false;
+ }
Expected<StringRef> ContentsOrErr = Section.getContents();
if (!ContentsOrErr) {
@@ -384,7 +385,7 @@ InputFile::getOrCreateTypeCollection(TypeCollectionKind Kind) {
uint32_t Count = Stream.getNumTypeRecords();
auto Offsets = Stream.getTypeIndexOffsets();
Collection =
- llvm::make_unique<LazyRandomTypeCollection>(Array, Count, Offsets);
+ std::make_unique<LazyRandomTypeCollection>(Array, Count, Offsets);
return *Collection;
}
@@ -397,11 +398,11 @@ InputFile::getOrCreateTypeCollection(TypeCollectionKind Kind) {
if (!isDebugTSection(Section, Records))
continue;
- Types = llvm::make_unique<LazyRandomTypeCollection>(Records, 100);
+ Types = std::make_unique<LazyRandomTypeCollection>(Records, 100);
return *Types;
}
- Types = llvm::make_unique<LazyRandomTypeCollection>(100);
+ Types = std::make_unique<LazyRandomTypeCollection>(100);
return *Types;
}