[cfe-commits] r41646 - /cfe/trunk/AST/CFG.cpp
Ted Kremenek
kremenek at apple.com
Fri Aug 31 10:03:42 PDT 2007
Author: kremenek
Date: Fri Aug 31 12:03:41 2007
New Revision: 41646
URL: http://llvm.org/viewvc/llvm-project?rev=41646&view=rev
Log:
Added support for __builtin_choose_expr (ChooseExpr) in CFGs.
Modified:
cfe/trunk/AST/CFG.cpp
Modified: cfe/trunk/AST/CFG.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/AST/CFG.cpp?rev=41646&r1=41645&r2=41646&view=diff
==============================================================================
--- cfe/trunk/AST/CFG.cpp (original)
+++ cfe/trunk/AST/CFG.cpp Fri Aug 31 12:03:41 2007
@@ -243,6 +243,28 @@
Block->setTerminator(C);
return addStmt(C->getCond());
}
+
+ case Stmt::ChooseExprClass: {
+ ChooseExpr* C = cast<ChooseExpr>(S);
+
+ CFGBlock* ConfluenceBlock = (Block) ? Block : createBlock();
+ ConfluenceBlock->appendStmt(C);
+ FinishBlock(ConfluenceBlock);
+
+ Succ = ConfluenceBlock;
+ Block = NULL;
+ CFGBlock* LHSBlock = Visit(C->getLHS());
+
+ Succ = ConfluenceBlock;
+ Block = NULL;
+ CFGBlock* RHSBlock = Visit(C->getRHS());
+
+ Block = createBlock(false);
+ Block->addSuccessor(LHSBlock);
+ Block->addSuccessor(RHSBlock);
+ Block->setTerminator(C);
+ return addStmt(C->getCond());
+ }
case Stmt::DeclStmtClass:
if (VarDecl* V = dyn_cast<VarDecl>(cast<DeclStmt>(S)->getDecl())) {
More information about the cfe-commits
mailing list