From d99f9373d33282ba9928657392fd5da773dff02f Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Mon, 27 May 2019 16:33:15 +0000 Subject: [PATCH] [LLParser] Fix uninitialized flag variable warnings. NFCI. Fixes a large number of warnings in the scan-build report on llvm builds. llvm-svn: 361772 --- llvm/lib/AsmParser/LLParser.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp index f16f6a2af492..6af084edbd8c 100644 --- a/llvm/lib/AsmParser/LLParser.cpp +++ b/llvm/lib/AsmParser/LLParser.cpp @@ -8484,7 +8484,7 @@ bool LLParser::ParseGVFlags(GlobalValueSummary::GVFlags &GVFlags) { return true; do { - unsigned Flag; + unsigned Flag = 0; switch (Lex.getKind()) { case lltok::kw_linkage: Lex.Lex(); @@ -8536,7 +8536,7 @@ bool LLParser::ParseGVarFlags(GlobalVarSummary::GVarFlags &GVarFlags) { 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") ||