diff options
Diffstat (limited to 'lib/Sema')
-rw-r--r-- | lib/Sema/SemaStmt.cpp | 13 | ||||
-rw-r--r-- | lib/Sema/TreeTransform.h | 8 |
2 files changed, 9 insertions, 12 deletions
diff --git a/lib/Sema/SemaStmt.cpp b/lib/Sema/SemaStmt.cpp index c6194edac3..68b7a8c163 100644 --- a/lib/Sema/SemaStmt.cpp +++ b/lib/Sema/SemaStmt.cpp @@ -42,8 +42,8 @@ StmtResult Sema::ActOnExprStmt(FullExprArg expr) { } -StmtResult Sema::ActOnNullStmt(SourceLocation SemiLoc) { - return Owned(new (Context) NullStmt(SemiLoc)); +StmtResult Sema::ActOnNullStmt(SourceLocation SemiLoc, bool LeadingEmptyMacro) { + return Owned(new (Context) NullStmt(SemiLoc, LeadingEmptyMacro)); } StmtResult Sema::ActOnDeclStmt(DeclGroupPtrTy dg, @@ -282,8 +282,8 @@ Sema::ActOnLabelStmt(SourceLocation IdentLoc, IdentifierInfo *II, StmtResult Sema::ActOnIfStmt(SourceLocation IfLoc, FullExprArg CondVal, Decl *CondVar, - Stmt *thenStmt, bool MacroExpandedInThenStmt, - SourceLocation ElseLoc, Stmt *elseStmt) { + Stmt *thenStmt, SourceLocation ElseLoc, + Stmt *elseStmt) { ExprResult CondResult(CondVal.release()); VarDecl *ConditionVar = 0; @@ -312,15 +312,14 @@ Sema::ActOnIfStmt(SourceLocation IfLoc, FullExprArg CondVal, Decl *CondVar, // if (condition) // CALL(0); // - if (!MacroExpandedInThenStmt) + if (!stmt->hasLeadingEmptyMacro()) Diag(stmt->getSemiLoc(), diag::warn_empty_if_body); } DiagnoseUnusedExprResult(elseStmt); return Owned(new (Context) IfStmt(Context, IfLoc, ConditionVar, ConditionExpr, - thenStmt, ElseLoc, elseStmt, - MacroExpandedInThenStmt)); + thenStmt, ElseLoc, elseStmt)); } /// ConvertIntegerToTypeWarnOnOverflow - Convert the specified APInt to have diff --git a/lib/Sema/TreeTransform.h b/lib/Sema/TreeTransform.h index 3ae4e5c5f4..807346c4c5 100644 --- a/lib/Sema/TreeTransform.h +++ b/lib/Sema/TreeTransform.h @@ -772,11 +772,9 @@ public: /// By default, performs semantic analysis to build the new statement. /// Subclasses may override this routine to provide different behavior. StmtResult RebuildIfStmt(SourceLocation IfLoc, Sema::FullExprArg Cond, - VarDecl *CondVar, Stmt *Then, - bool MacroExpandedInThenStmt, + VarDecl *CondVar, Stmt *Then, SourceLocation ElseLoc, Stmt *Else) { - return getSema().ActOnIfStmt(IfLoc, Cond, CondVar, Then, - MacroExpandedInThenStmt, ElseLoc, Else); + return getSema().ActOnIfStmt(IfLoc, Cond, CondVar, Then, ElseLoc, Else); } /// \brief Start building a new switch statement. @@ -3694,7 +3692,7 @@ TreeTransform<Derived>::TransformIfStmt(IfStmt *S) { return SemaRef.Owned(S); return getDerived().RebuildIfStmt(S->getIfLoc(), FullCond, ConditionVar, - Then.get(), S->hasMacroExpandedInThenStmt(), + Then.get(), S->getElseLoc(), Else.get()); } |