From: Chris Lattner Date: Mon, 29 Sep 2008 21:30:29 +0000 (+0000) Subject: move ExtVectorElementExpr down into the 'clang extensions' section. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a09f585a7fdbb01b4bf9de3679fd37005379ca66;p=clang move ExtVectorElementExpr down into the 'clang extensions' section. Wrap line to 80 cols. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56805 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/Expr.h b/include/clang/AST/Expr.h index a9c1e68012..16daa64a1c 100644 --- a/include/clang/AST/Expr.h +++ b/include/clang/AST/Expr.h @@ -761,50 +761,6 @@ public: static MemberExpr* CreateImpl(llvm::Deserializer& D, ASTContext& C); }; -/// ExtVectorElementExpr - This represents access to specific elements of a -/// vector, and may occur on the left hand side or right hand side. For example -/// the following is legal: "V.xy = V.zw" if V is a 4 element extended vector. -/// -class ExtVectorElementExpr : public Expr { - Stmt *Base; - IdentifierInfo &Accessor; - SourceLocation AccessorLoc; -public: - ExtVectorElementExpr(QualType ty, Expr *base, IdentifierInfo &accessor, - SourceLocation loc) - : Expr(ExtVectorElementExprClass, ty), - Base(base), Accessor(accessor), AccessorLoc(loc) {} - - const Expr *getBase() const { return cast(Base); } - Expr *getBase() { return cast(Base); } - - IdentifierInfo &getAccessor() const { return Accessor; } - - /// getNumElements - Get the number of components being selected. - unsigned getNumElements() const; - - /// containsDuplicateElements - Return true if any element access is - /// repeated. - bool containsDuplicateElements() const; - - /// getEncodedElementAccess - Encode the elements accessed into an llvm - /// aggregate Constant of ConstantInt(s). - void getEncodedElementAccess(llvm::SmallVectorImpl &Elts) const; - - virtual SourceRange getSourceRange() const { - return SourceRange(getBase()->getLocStart(), AccessorLoc); - } - - static bool classof(const Stmt *T) { - return T->getStmtClass() == ExtVectorElementExprClass; - } - static bool classof(const ExtVectorElementExpr *) { return true; } - - // Iterators - virtual child_iterator child_begin(); - virtual child_iterator child_end(); -}; - /// CompoundLiteralExpr - [C99 6.5.2.5] /// class CompoundLiteralExpr : public Expr { @@ -815,8 +771,10 @@ class CompoundLiteralExpr : public Expr { Stmt *Init; bool FileScope; public: - CompoundLiteralExpr(SourceLocation lparenloc, QualType ty, Expr *init, bool fileScope) : - Expr(CompoundLiteralExprClass, ty), LParenLoc(lparenloc), Init(init), FileScope(fileScope) {} + CompoundLiteralExpr(SourceLocation lparenloc, QualType ty, Expr *init, + bool fileScope) + : Expr(CompoundLiteralExprClass, ty), LParenLoc(lparenloc), Init(init), + FileScope(fileScope) {} const Expr *getInitializer() const { return cast(Init); } Expr *getInitializer() { return cast(Init); } @@ -1487,6 +1445,52 @@ private: // Clang Extensions //===----------------------------------------------------------------------===// + +/// ExtVectorElementExpr - This represents access to specific elements of a +/// vector, and may occur on the left hand side or right hand side. For example +/// the following is legal: "V.xy = V.zw" if V is a 4 element extended vector. +/// +class ExtVectorElementExpr : public Expr { + Stmt *Base; + IdentifierInfo &Accessor; + SourceLocation AccessorLoc; +public: + ExtVectorElementExpr(QualType ty, Expr *base, IdentifierInfo &accessor, + SourceLocation loc) + : Expr(ExtVectorElementExprClass, ty), + Base(base), Accessor(accessor), AccessorLoc(loc) {} + + const Expr *getBase() const { return cast(Base); } + Expr *getBase() { return cast(Base); } + + IdentifierInfo &getAccessor() const { return Accessor; } + + /// getNumElements - Get the number of components being selected. + unsigned getNumElements() const; + + /// containsDuplicateElements - Return true if any element access is + /// repeated. + bool containsDuplicateElements() const; + + /// getEncodedElementAccess - Encode the elements accessed into an llvm + /// aggregate Constant of ConstantInt(s). + void getEncodedElementAccess(llvm::SmallVectorImpl &Elts) const; + + virtual SourceRange getSourceRange() const { + return SourceRange(getBase()->getLocStart(), AccessorLoc); + } + + static bool classof(const Stmt *T) { + return T->getStmtClass() == ExtVectorElementExprClass; + } + static bool classof(const ExtVectorElementExpr *) { return true; } + + // Iterators + virtual child_iterator child_begin(); + virtual child_iterator child_end(); +}; + + /// BlockExpr - Represent a block literal with a syntax: /// ^{ statement-body } or ^(int arg1, float arg2){ statement-body } class BlockExpr : public Expr {