diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-11-19 20:54:25 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-11-19 20:54:25 +0000 |
commit | a25b6a4b43e8b9611f7506e5fe1b448833b10a46 (patch) | |
tree | 1c8c6e68f978b9b156704e77c31beb8bf573b845 /lib/Sema/TreeTransform.h | |
parent | b95cfe4bb01f18a112bcb7eea3b82bc8d6dfe20b (diff) |
Don't warn for empty 'if' body if there is a macro that expands to nothing, e.g:
if (condition)
CALL(0); // empty macro but don't warn for empty body.
Fixes rdar://8436021.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119838 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/TreeTransform.h')
-rw-r--r-- | lib/Sema/TreeTransform.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/Sema/TreeTransform.h b/lib/Sema/TreeTransform.h index 807346c4c5..3ae4e5c5f4 100644 --- a/lib/Sema/TreeTransform.h +++ b/lib/Sema/TreeTransform.h @@ -772,9 +772,11 @@ 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, + VarDecl *CondVar, Stmt *Then, + bool MacroExpandedInThenStmt, SourceLocation ElseLoc, Stmt *Else) { - return getSema().ActOnIfStmt(IfLoc, Cond, CondVar, Then, ElseLoc, Else); + return getSema().ActOnIfStmt(IfLoc, Cond, CondVar, Then, + MacroExpandedInThenStmt, ElseLoc, Else); } /// \brief Start building a new switch statement. @@ -3692,7 +3694,7 @@ TreeTransform<Derived>::TransformIfStmt(IfStmt *S) { return SemaRef.Owned(S); return getDerived().RebuildIfStmt(S->getIfLoc(), FullCond, ConditionVar, - Then.get(), + Then.get(), S->hasMacroExpandedInThenStmt(), S->getElseLoc(), Else.get()); } |