[ThinLTO] Fix unreachable code when parsing summary entries.
Summary:
Early returns were causing some code to be skipped. This was missed
since the summary entries are typically at the end of the llvm assembly
file.
Fixes PR41663.
Reviewers: RKSimon, wristow
Subscribers: mehdi_amini, inglorion, eraman, steven_wu, dexonsmith, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D61355
llvm-svn: 359697
diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp
index f14ef36..ebb174d 100644
--- a/llvm/lib/AsmParser/LLParser.cpp
+++ b/llvm/lib/AsmParser/LLParser.cpp
@@ -821,19 +821,23 @@
if (!Index)
return SkipModuleSummaryEntry();
+ bool result = false;
switch (Lex.getKind()) {
case lltok::kw_gv:
- return ParseGVEntry(SummaryID);
+ result = ParseGVEntry(SummaryID);
+ break;
case lltok::kw_module:
- return ParseModuleEntry(SummaryID);
+ result = ParseModuleEntry(SummaryID);
+ break;
case lltok::kw_typeid:
- return ParseTypeIdEntry(SummaryID);
+ result = ParseTypeIdEntry(SummaryID);
break;
default:
- return Error(Lex.getLoc(), "unexpected summary kind");
+ result = Error(Lex.getLoc(), "unexpected summary kind");
+ break;
}
Lex.setIgnoreColonInIdentifiers(false);
- return false;
+ return result;
}
static bool isValidVisibilityForLinkage(unsigned V, unsigned L) {