Skip to content

Commit 584fdf9

Browse files
author
Alex B
committed
Address Feedback Nr 4
1 parent 32f7987 commit 584fdf9

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

llvm/lib/DebugInfo/GSYM/CallSiteInfo.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===- CallSiteInfo.cpp ----------------------------------*- C++ -*-===//
1+
//===- CallSiteInfo.cpp -----------------------------------------*- C++ -*-===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
@@ -160,10 +160,10 @@ Error CallSiteInfoLoader::loadYAML(std::vector<FunctionInfo> &Funcs,
160160

161161
// Step 2: Parse YAML content
162162
yaml::FunctionsYAML FuncsYAML;
163-
yaml::Input yin(Buffer->getMemBufferRef());
164-
yin >> FuncsYAML;
165-
if (yin.error())
166-
return createStringError(yin.error(), "Error parsing YAML file: %s\n",
163+
yaml::Input Yin(Buffer->getMemBufferRef());
164+
Yin >> FuncsYAML;
165+
if (Yin.error())
166+
return createStringError(Yin.error(), "Error parsing YAML file: %s\n",
167167
Buffer->getBufferIdentifier().str().c_str());
168168

169169
// Step 3: Build function map from Funcs

llvm/lib/DebugInfo/GSYM/GsymCreator.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,9 +386,10 @@ uint32_t GsymCreator::insertString(StringRef S, bool Copy) {
386386
}
387387

388388
StringRef GsymCreator::getString(uint32_t offset) {
389-
assert(StringOffsetMap.count(offset) &&
389+
auto I = StringOffsetMap.find(offset);
390+
assert(I != StringOffsetMap.end() &&
390391
"GsymCreator::getString expects a valid offset as parameter.");
391-
return StringOffsetMap.find(offset)->second.val();
392+
return I->second.val();
392393
}
393394

394395
void GsymCreator::addFunctionInfo(FunctionInfo &&FI) {

0 commit comments

Comments
 (0)