diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2011-04-15 00:35:48 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2011-04-15 00:35:48 +0000 |
commit | 91147596414d94e39c2d04a2f91a13bda877093c (patch) | |
tree | da823c184dd34a13fcaade472a96413a3c9fa163 /clang/lib/AST/StmtProfile.cpp | |
parent | a686b5f8bf7b5a2ab636c0c2de5ad4c174aa33e0 (diff) | |
download | bcm5719-llvm-91147596414d94e39c2d04a2f91a13bda877093c.tar.gz bcm5719-llvm-91147596414d94e39c2d04a2f91a13bda877093c.zip |
C1X: implement generic selections
As an extension, generic selection support has been added for all
supported languages. The syntax is the same as for C1X.
llvm-svn: 129554
Diffstat (limited to 'clang/lib/AST/StmtProfile.cpp')
-rw-r--r-- | clang/lib/AST/StmtProfile.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/lib/AST/StmtProfile.cpp b/clang/lib/AST/StmtProfile.cpp index 92292cea719..dbcb7e4fe60 100644 --- a/clang/lib/AST/StmtProfile.cpp +++ b/clang/lib/AST/StmtProfile.cpp @@ -434,6 +434,18 @@ void StmtProfiler::VisitBlockDeclRefExpr(BlockDeclRefExpr *S) { ID.AddBoolean(S->isConstQualAdded()); } +void StmtProfiler::VisitGenericSelectionExpr(GenericSelectionExpr *S) { + VisitExpr(S); + for (unsigned i = 0; i != S->getNumAssocs(); ++i) { + QualType T = S->getAssocType(i); + if (T.isNull()) + ID.AddPointer(0); + else + VisitType(T); + VisitExpr(S->getAssocExpr(i)); + } +} + static Stmt::StmtClass DecodeOperatorCall(CXXOperatorCallExpr *S, UnaryOperatorKind &UnaryOp, BinaryOperatorKind &BinaryOp) { |