Add support for _if_exists and __if_not_exists at namespace/global scope.

llvm-svn: 131050
diff --git a/clang/lib/Parse/ParseStmt.cpp b/clang/lib/Parse/ParseStmt.cpp
index 12ab5e2..6cc8b57 100644
--- a/clang/lib/Parse/ParseStmt.cpp
+++ b/clang/lib/Parse/ParseStmt.cpp
@@ -2008,51 +2008,18 @@
 }
 
 void Parser::ParseMicrosoftIfExistsStatement(StmtVector &Stmts) {
-  assert((Tok.is(tok::kw___if_exists) || Tok.is(tok::kw___if_not_exists)) &&
-         "Expected '__if_exists' or '__if_not_exists'");
-  Token Condition = Tok;
-  SourceLocation IfExistsLoc = ConsumeToken();
-
-  SourceLocation LParenLoc = Tok.getLocation();
-  if (Tok.isNot(tok::l_paren)) {
-    Diag(Tok, diag::err_expected_lparen_after) << IfExistsLoc;
-    SkipUntil(tok::semi);
+  bool Result;
+  if (ParseMicrosoftIfExistsCondition(Result))
     return;
-  }
-  ConsumeParen(); // eat the '('.
   
-  // Parse nested-name-specifier.
-  CXXScopeSpec SS;
-  ParseOptionalCXXScopeSpecifier(SS, ParsedType(), false);
-
-  // Check nested-name specifier.
-  if (SS.isInvalid()) {
-    SkipUntil(tok::semi);
-    return;
-  }
-
-  // Parse the unqualified-id. 
-  UnqualifiedId Name;
-  if (ParseUnqualifiedId(SS, false, true, true, ParsedType(), Name)) {
-    SkipUntil(tok::semi);
-    return;
-  }
-
-  if (MatchRHSPunctuation(tok::r_paren, LParenLoc).isInvalid())
-    return;
-
   if (Tok.isNot(tok::l_brace)) {
     Diag(Tok, diag::err_expected_lbrace);
     return;
   }
   ConsumeBrace();
 
-  // Check if the symbol exists.
-  bool Exist = Actions.CheckMicrosoftIfExistsSymbol(SS, Name);
-
-  // If the condition is false skip the tokens until the '}'
-  if ((Condition.is(tok::kw___if_exists) && !Exist) ||
-      (Condition.is(tok::kw___if_not_exists) && Exist)) {
+  // Condition is false skip all inside the {}.
+  if (!Result) {
     SkipUntil(tok::r_brace, false);
     return;
   }