diff options
author | Teresa Johnson <tejohnson@google.com> | 2019-05-01 16:26:59 +0000 |
---|---|---|
committer | Teresa Johnson <tejohnson@google.com> | 2019-05-01 16:26:59 +0000 |
commit | b3203ec078ca72919475093aca9fc19ca58dd272 (patch) | |
tree | 132d8890999051003320683d683df4676bdb5746 /llvm/lib/AsmParser/LLParser.cpp | |
parent | a224f68a10d6191c881dfd27796a2b363aa003d3 (diff) | |
download | bcm5719-llvm-b3203ec078ca72919475093aca9fc19ca58dd272.tar.gz bcm5719-llvm-b3203ec078ca72919475093aca9fc19ca58dd272.zip |
[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
Diffstat (limited to 'llvm/lib/AsmParser/LLParser.cpp')
-rw-r--r-- | llvm/lib/AsmParser/LLParser.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp index f14ef36afb0..ebb174d39c6 100644 --- a/llvm/lib/AsmParser/LLParser.cpp +++ b/llvm/lib/AsmParser/LLParser.cpp @@ -821,19 +821,23 @@ bool LLParser::ParseSummaryEntry() { 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) { |