in facebook-clang-plugins/libtooling/ASTExporter.h [3783:3817]
void ASTExporter<ATDWriter>::VisitUnaryExprOrTypeTraitExpr(
const UnaryExprOrTypeTraitExpr *Node) {
VisitExpr(Node);
ObjectScope Scope(OF, 2); // not covered by tests
OF.emitTag("kind");
switch (Node->getKind()) {
case UETT_AlignOf:
OF.emitSimpleVariant("AlignOf");
break;
case UETT_OpenMPRequiredSimdAlign:
OF.emitSimpleVariant("OpenMPRequiredSimdAlign");
break;
case UETT_PreferredAlignOf:
OF.emitSimpleVariant("PreferredAlignOf");
break;
case UETT_SizeOf: {
const Type *ArgType = Node->getTypeOfArgument().getTypePtr();
if (hasMeaningfulTypeInfo(ArgType)) {
VariantScope Scope(OF, "SizeOfWithSize");
OF.emitInteger(Context.getTypeInfo(ArgType).Width / 8);
} else {
OF.emitSimpleVariant("SizeOf");
}
break;
}
case UETT_VecStep:
OF.emitSimpleVariant("VecStep");
break;
}
OF.emitTag("qual_type");
dumpQualType(Node->getTypeOfArgument());
}