From 29c42f2a25d6ce7008b9164be2cfc8f30e678ab9 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Fri, 24 Feb 2012 07:38:34 +0000 Subject: Implement a new type trait __is_trivially_constructible(T, Args...) that provides the behavior of the C++11 library trait std::is_trivially_constructible, 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 / PR12038. llvm-svn: 151352 --- clang/lib/Serialization/ASTWriterStmt.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'clang/lib/Serialization/ASTWriterStmt.cpp') diff --git a/clang/lib/Serialization/ASTWriterStmt.cpp b/clang/lib/Serialization/ASTWriterStmt.cpp index 0ba413df722..f9c3c5de43b 100644 --- a/clang/lib/Serialization/ASTWriterStmt.cpp +++ b/clang/lib/Serialization/ASTWriterStmt.cpp @@ -1341,6 +1341,16 @@ void ASTStmtWriter::VisitBinaryTypeTraitExpr(BinaryTypeTraitExpr *E) { Code = serialization::EXPR_BINARY_TYPE_TRAIT; } +void ASTStmtWriter::VisitTypeTraitExpr(TypeTraitExpr *E) { + VisitExpr(E); + Record.push_back(E->TypeTraitExprBits.NumArgs); + Record.push_back(E->TypeTraitExprBits.Kind); // FIXME: Stable encoding + Record.push_back(E->TypeTraitExprBits.Value); + for (unsigned I = 0, N = E->getNumArgs(); I != N; ++I) + Writer.AddTypeSourceInfo(E->getArg(I), Record); + Code = serialization::EXPR_TYPE_TRAIT; +} + void ASTStmtWriter::VisitArrayTypeTraitExpr(ArrayTypeTraitExpr *E) { VisitExpr(E); Record.push_back(E->getTrait()); -- cgit v1.2.3