Minor code simplification.
authorDan Gohman <gohman@apple.com>
Wed, 29 Jul 2009 15:58:36 +0000 (15:58 +0000)
committerDan Gohman <gohman@apple.com>
Wed, 29 Jul 2009 15:58:36 +0000 (15:58 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77459 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AsmParser/LLParser.cpp

index 36f714b38e3df31ddc5efa737383f0fb189162b8..c96ee9e233f8c0cb8c5c8605b98c7de80cf93bbc 100644 (file)
@@ -2078,8 +2078,7 @@ bool LLParser::ParseValID(ValID &ID) {
     bool InBounds = false;
     Lex.Lex();
     if (Opc == Instruction::GetElementPtr)
-      if (EatIfPresent(lltok::kw_inbounds))
-        InBounds = true;
+      InBounds = EatIfPresent(lltok::kw_inbounds);
     if (ParseToken(lltok::lparen, "expected '(' in constantexpr") ||
         ParseGlobalValueVector(Elts) ||
         ParseToken(lltok::rparen, "expected ')' in constantexpr"))
@@ -3413,10 +3412,8 @@ bool LLParser::ParseGetResult(Instruction *&Inst, PerFunctionState &PFS) {
 ///   ::= 'getelementptr' 'inbounds'? TypeAndValue (',' TypeAndValue)*
 bool LLParser::ParseGetElementPtr(Instruction *&Inst, PerFunctionState &PFS) {
   Value *Ptr, *Val; LocTy Loc, EltLoc;
-  bool InBounds = false;
 
-  if (EatIfPresent(lltok::kw_inbounds))
-    InBounds = true;
+  bool InBounds = EatIfPresent(lltok::kw_inbounds);
 
   if (ParseTypeAndValue(Ptr, Loc, PFS)) return true;