summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/StmtProfile.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2012-02-24 07:38:34 +0000
committerDouglas Gregor <dgregor@apple.com>2012-02-24 07:38:34 +0000
commit29c42f2a25d6ce7008b9164be2cfc8f30e678ab9 (patch)
tree459d18b3a5c129ed1392a46e0e20bf79bb9a0274 /clang/lib/AST/StmtProfile.cpp
parent1bf3b0472654a8f3f89f1af4496c728f24cf7433 (diff)
downloadbcm5719-llvm-29c42f2a25d6ce7008b9164be2cfc8f30e678ab9.tar.gz
bcm5719-llvm-29c42f2a25d6ce7008b9164be2cfc8f30e678ab9.zip
Implement a new type trait __is_trivially_constructible(T, Args...)
that provides the behavior of the C++11 library trait std::is_trivially_constructible<T, Args...>, which can't be implemented purely as a library. Since __is_trivially_constructible can have zero or more arguments, I needed to add Yet Another Type Trait Expression Class, this one handling arbitrary arguments. The next step will be to migrate UnaryTypeTrait and BinaryTypeTrait over to this new, more general TypeTrait class. Fixes the Clang side of <rdar://problem/10895483> / PR12038. llvm-svn: 151352
Diffstat (limited to 'clang/lib/AST/StmtProfile.cpp')
-rw-r--r--clang/lib/AST/StmtProfile.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/AST/StmtProfile.cpp b/clang/lib/AST/StmtProfile.cpp
index fdd0c8502db..643bca817c4 100644
--- a/clang/lib/AST/StmtProfile.cpp
+++ b/clang/lib/AST/StmtProfile.cpp
@@ -868,6 +868,14 @@ void StmtProfiler::VisitBinaryTypeTraitExpr(const BinaryTypeTraitExpr *S) {
VisitType(S->getRhsType());
}
+void StmtProfiler::VisitTypeTraitExpr(const TypeTraitExpr *S) {
+ VisitExpr(S);
+ ID.AddInteger(S->getTrait());
+ ID.AddInteger(S->getNumArgs());
+ for (unsigned I = 0, N = S->getNumArgs(); I != N; ++I)
+ VisitType(S->getArg(I)->getType());
+}
+
void StmtProfiler::VisitArrayTypeTraitExpr(const ArrayTypeTraitExpr *S) {
VisitExpr(S);
ID.AddInteger(S->getTrait());
OpenPOWER on IntegriCloud