aboutsummaryrefslogtreecommitdiff
path: root/include/clang
diff options
context:
space:
mode:
Diffstat (limited to 'include/clang')
-rw-r--r--include/clang/AST/Expr.h19
-rw-r--r--include/clang/AST/StmtNodes.def1
-rw-r--r--include/clang/Parse/Action.h7
-rw-r--r--include/clang/Parse/Parser.h3
4 files changed, 29 insertions, 1 deletions
diff --git a/include/clang/AST/Expr.h b/include/clang/AST/Expr.h
index 94cf512e30..4136a9eb1d 100644
--- a/include/clang/AST/Expr.h
+++ b/include/clang/AST/Expr.h
@@ -834,6 +834,25 @@ public:
static bool classof(const ObjCStringLiteral *) { return true; }
};
+/// ObjCEncodeExpr, used for @encode in Objective-C.
+class ObjCEncodeExpr : public Expr {
+ QualType EncType;
+ SourceLocation EncLoc, RParenLoc;
+public:
+ ObjCEncodeExpr(QualType T, QualType ET,
+ SourceLocation enc, SourceLocation rp)
+ : Expr(ObjCEncodeExprClass, T), EncType(ET), EncLoc(enc), RParenLoc(rp) {}
+
+ SourceRange getSourceRange() const { return SourceRange(EncLoc, RParenLoc); }
+
+ QualType getEncodedType() const { return EncType; }
+
+ static bool classof(const Stmt *T) {
+ return T->getStmtClass() == ObjCEncodeExprClass;
+ }
+ static bool classof(const ObjCEncodeExpr *) { return true; }
+};
+
} // end namespace clang
#endif
diff --git a/include/clang/AST/StmtNodes.def b/include/clang/AST/StmtNodes.def
index 9fa780c314..6a67e76cda 100644
--- a/include/clang/AST/StmtNodes.def
+++ b/include/clang/AST/StmtNodes.def
@@ -76,6 +76,7 @@ STMT(55, CXXBoolLiteralExpr , Expr)
// Obj-C Expressions.
STMT(56, ObjCStringLiteral , Expr)
+STMT(57, ObjCEncodeExpr , Expr)
LAST_EXPR(56)
diff --git a/include/clang/Parse/Action.h b/include/clang/Parse/Action.h
index 668bfb6d01..1ddbe85fb4 100644
--- a/include/clang/Parse/Action.h
+++ b/include/clang/Parse/Action.h
@@ -409,6 +409,13 @@ public:
virtual ExprResult ParseObjCStringLiteral(ExprTy *string) {
return 0;
}
+
+ virtual ExprResult ParseObjCEncodeExpression(SourceLocation EncLoc,
+ SourceLocation LParenLoc,
+ TypeTy *Ty,
+ SourceLocation RParenLoc) {
+ return 0;
+ }
};
diff --git a/include/clang/Parse/Parser.h b/include/clang/Parse/Parser.h
index 02c2ee70f3..f0063f3748 100644
--- a/include/clang/Parse/Parser.h
+++ b/include/clang/Parse/Parser.h
@@ -327,7 +327,8 @@ private:
// Objective-C Expressions
ExprResult ParseObjCExpression();
ExprResult ParseObjCStringLiteral();
-
+ ExprResult ParseObjCEncodeExpression();
+
//===--------------------------------------------------------------------===//
// C99 6.8: Statements and Blocks.