[AST] In IfConfigDecl/IfConfigStmt keep track of whether the IfBlock is active or not.

Swift SVN r15444
This commit is contained in:
Argyrios Kyrtzidis
2014-03-25 03:55:29 +00:00
parent 3064e04d47
commit 121bf14dd1
4 changed files with 26 additions and 20 deletions

View File

@@ -812,15 +812,13 @@ ParserResult<Stmt> Parser::parseStmtIfConfig(BraceItemListKind Kind) {
skipUntilConfigBlockClose();
}
auto ifConfigStmt = new (Context) IfConfigStmt(IfLoc,
auto ifConfigStmt = new (Context) IfConfigStmt(ifBlockIsActive,
IfLoc,
Configuration.getPtrOrNull(),
NormalBody.get(),
ElseLoc,
ElseBody.getPtrOrNull(),
EndLoc);
ifConfigStmt->setActiveStmt(ifBlockIsActive ?
NormalBody.get() :
ElseBody.getPtrOrNull());
return makeParserResult(ifConfigStmt);
}