File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed
Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -5307,18 +5307,15 @@ static std::optional<object::SectionRef>
53075307getCallGraphSection (const object::ELFObjectFile<ELFT> &ObjF) {
53085308 // Get the .llvm.callgraph section.
53095309 StringRef CallGraphSectionName (" .llvm.callgraph" );
5310- std::optional<object::SectionRef> CallGraphSection;
53115310 for (auto Sec : ObjF.sections ()) {
5312- StringRef Name;
5313- if (Expected<StringRef> NameOrErr = Sec.getName ())
5314- Name = *NameOrErr;
5315- else
5311+ if (Expected<StringRef> NameOrErr = Sec.getName ()) {
5312+ StringRef Name = *NameOrErr;
5313+ if (Name == CallGraphSectionName)
5314+ return Sec;
5315+ } else
53165316 consumeError (NameOrErr.takeError ());
5317-
5318- if (Name == CallGraphSectionName)
5319- return Sec;
53205317 }
5321- return CallGraphSection ;
5318+ return std:: nullopt ;
53225319}
53235320
53245321namespace callgraph {
You can’t perform that action at this time.
0 commit comments