[cfe-commits] r40693 - in /cfe/trunk: AST/StmtPrinter.cpp Parse/ParseExpr.cpp Sema/Sema.h Sema/SemaExpr.cpp include/clang/AST/Expr.h include/clang/AST/StmtNodes.def include/clang/Parse/Action.h
Chris Lattner
clattner at apple.com
Wed Aug 1 15:26:53 PDT 2007
On Aug 1, 2007, at 3:05 PM, Steve Naroff wrote:
>
> +/// TypesCompatibleExpr - GNU builtin-in function
> __builtin_type_compatible_p.
> +/// This AST node represents a function that returns 1 if two
> *types* (not
> +/// expressions) are compatible. The result of this built-in
> function can be
> +/// used in integer constant expressions.
> +class TypesCompatibleExpr : public Expr {
> + QualType Type1;
> + QualType Type2;
> + SourceLocation LParenLoc, RParenLoc;
LParenLoc should be the location of the "__builtin_type_compatible_p"
token, right? If so, please rename it.
Thanks Steve,
-Chris
> +public:
> + TypesCompatibleExpr(QualType ReturnType, SourceLocation LP,
> + QualType t1, QualType t2, SourceLocation RP) :
> + Expr(TypesCompatibleExprClass, ReturnType), Type1(t1), Type2(t2),
> + LParenLoc(LP), RParenLoc(RP) {}
> +
> + QualType getArgType1() { return Type1; }
> + QualType getArgType2() { return Type2; }
> +
> + virtual SourceRange getSourceRange() const {
> + return SourceRange(LParenLoc, RParenLoc);
> + }
> + virtual void visit(StmtVisitor &Visitor);
> + static bool classof(const Stmt *T) {
> + return T->getStmtClass() == TypesCompatibleExprClass;
> + }
> + static bool classof(const TypesCompatibleExpr *) { return true; }
> +};
More information about the cfe-commits
mailing list