[llvm] r361772 - [LLParser] Fix uninitialized flag variable warnings. NFCI.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Mon May 27 09:33:16 PDT 2019
Author: rksimon
Date: Mon May 27 09:33:15 2019
New Revision: 361772
URL: http://llvm.org/viewvc/llvm-project?rev=361772&view=rev
Log:
[LLParser] Fix uninitialized flag variable warnings. NFCI.
Fixes a large number of warnings in the scan-build report on llvm builds.
Modified:
llvm/trunk/lib/AsmParser/LLParser.cpp
Modified: llvm/trunk/lib/AsmParser/LLParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLParser.cpp?rev=361772&r1=361771&r2=361772&view=diff
==============================================================================
--- llvm/trunk/lib/AsmParser/LLParser.cpp (original)
+++ llvm/trunk/lib/AsmParser/LLParser.cpp Mon May 27 09:33:15 2019
@@ -8484,7 +8484,7 @@ bool LLParser::ParseGVFlags(GlobalValueS
return true;
do {
- unsigned Flag;
+ unsigned Flag = 0;
switch (Lex.getKind()) {
case lltok::kw_linkage:
Lex.Lex();
@@ -8536,7 +8536,7 @@ bool LLParser::ParseGVarFlags(GlobalVarS
assert(Lex.getKind() == lltok::kw_varFlags);
Lex.Lex();
- unsigned Flag;
+ unsigned Flag = 0;
if (ParseToken(lltok::colon, "expected ':' here") ||
ParseToken(lltok::lparen, "expected '(' here") ||
ParseToken(lltok::kw_readonly, "expected 'readonly' here") ||
More information about the llvm-commits
mailing list