From: Craig Topper Date: Wed, 21 Aug 2013 03:59:22 +0000 (+0000) Subject: Replace avx-512 with avx512f to match llvm side and what gcc patches appear to be... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b7a95d2941869f2dfd0d2f0e805f794b46dd4b55;p=clang Replace avx-512 with avx512f to match llvm side and what gcc patches appear to be using. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188860 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/Stmt.h b/include/clang/AST/Stmt.h index a968149a29..2d8e26542e 100644 --- a/include/clang/AST/Stmt.h +++ b/include/clang/AST/Stmt.h @@ -544,7 +544,7 @@ class CompoundStmt : public Stmt { Stmt** Body; SourceLocation LBracLoc, RBracLoc; public: - CompoundStmt(ASTContext &C, ArrayRef Stmts, + CompoundStmt(const ASTContext &C, ArrayRef Stmts, SourceLocation LB, SourceLocation RB); // \brief Build an empty compound statment with a location. @@ -559,7 +559,7 @@ public: CompoundStmtBits.NumStmts = 0; } - void setStmts(ASTContext &C, Stmt **Stmts, unsigned NumStmts); + void setStmts(const ASTContext &C, Stmt **Stmts, unsigned NumStmts); bool body_empty() const { return CompoundStmtBits.NumStmts == 0; } unsigned size() const { return CompoundStmtBits.NumStmts; } @@ -818,10 +818,10 @@ class AttributedStmt : public Stmt { } public: - static AttributedStmt *Create(ASTContext &C, SourceLocation Loc, + static AttributedStmt *Create(const ASTContext &C, SourceLocation Loc, ArrayRef Attrs, Stmt *SubStmt); // \brief Build an empty attributed statement. - static AttributedStmt *CreateEmpty(ASTContext &C, unsigned NumAttrs); + static AttributedStmt *CreateEmpty(const ASTContext &C, unsigned NumAttrs); SourceLocation getAttrLoc() const { return AttrLoc; } ArrayRef getAttrs() const { @@ -851,7 +851,7 @@ class IfStmt : public Stmt { SourceLocation ElseLoc; public: - IfStmt(ASTContext &C, SourceLocation IL, VarDecl *var, Expr *cond, + IfStmt(const ASTContext &C, SourceLocation IL, VarDecl *var, Expr *cond, Stmt *then, SourceLocation EL = SourceLocation(), Stmt *elsev = 0); /// \brief Build an empty if/then/else statement @@ -866,7 +866,7 @@ public: /// } /// \endcode VarDecl *getConditionVariable() const; - void setConditionVariable(ASTContext &C, VarDecl *V); + void setConditionVariable(const ASTContext &C, VarDecl *V); /// If this IfStmt has a condition variable, return the faux DeclStmt /// associated with the creation of that condition variable. @@ -924,7 +924,7 @@ class SwitchStmt : public Stmt { unsigned AllEnumCasesCovered : 1; public: - SwitchStmt(ASTContext &C, VarDecl *Var, Expr *cond); + SwitchStmt(const ASTContext &C, VarDecl *Var, Expr *cond); /// \brief Build a empty switch statement. explicit SwitchStmt(EmptyShell Empty) : Stmt(SwitchStmtClass, Empty) { } @@ -939,7 +939,7 @@ public: /// } /// \endcode VarDecl *getConditionVariable() const; - void setConditionVariable(ASTContext &C, VarDecl *V); + void setConditionVariable(const ASTContext &C, VarDecl *V); /// If this SwitchStmt has a condition variable, return the faux DeclStmt /// associated with the creation of that condition variable. @@ -1009,7 +1009,7 @@ class WhileStmt : public Stmt { Stmt* SubExprs[END_EXPR]; SourceLocation WhileLoc; public: - WhileStmt(ASTContext &C, VarDecl *Var, Expr *cond, Stmt *body, + WhileStmt(const ASTContext &C, VarDecl *Var, Expr *cond, Stmt *body, SourceLocation WL); /// \brief Build an empty while statement. @@ -1024,7 +1024,7 @@ public: /// } /// \endcode VarDecl *getConditionVariable() const; - void setConditionVariable(ASTContext &C, VarDecl *V); + void setConditionVariable(const ASTContext &C, VarDecl *V); /// If this WhileStmt has a condition variable, return the faux DeclStmt /// associated with the creation of that condition variable. @@ -1117,8 +1117,9 @@ class ForStmt : public Stmt { SourceLocation LParenLoc, RParenLoc; public: - ForStmt(ASTContext &C, Stmt *Init, Expr *Cond, VarDecl *condVar, Expr *Inc, - Stmt *Body, SourceLocation FL, SourceLocation LP, SourceLocation RP); + ForStmt(const ASTContext &C, Stmt *Init, Expr *Cond, VarDecl *condVar, + Expr *Inc, Stmt *Body, SourceLocation FL, SourceLocation LP, + SourceLocation RP); /// \brief Build an empty for statement. explicit ForStmt(EmptyShell Empty) : Stmt(ForStmtClass, Empty) { } @@ -1134,7 +1135,7 @@ public: /// } /// \endcode VarDecl *getConditionVariable() const; - void setConditionVariable(ASTContext &C, VarDecl *V); + void setConditionVariable(const ASTContext &C, VarDecl *V); /// If this ForStmt has a condition variable, return the faux DeclStmt /// associated with the creation of that condition variable. @@ -1405,7 +1406,7 @@ public: //===--- Asm String Analysis ---===// /// Assemble final IR asm string. - std::string generateAsmString(ASTContext &C) const; + std::string generateAsmString(const ASTContext &C) const; //===--- Output operands ---===// @@ -1508,7 +1509,7 @@ class GCCAsmStmt : public AsmStmt { friend class ASTStmtReader; public: - GCCAsmStmt(ASTContext &C, SourceLocation asmloc, bool issimple, + GCCAsmStmt(const ASTContext &C, SourceLocation asmloc, bool issimple, bool isvolatile, unsigned numoutputs, unsigned numinputs, IdentifierInfo **names, StringLiteral **constraints, Expr **exprs, StringLiteral *asmstr, unsigned numclobbers, @@ -1574,10 +1575,10 @@ public: /// translation of strings from GCC syntax to LLVM IR syntax, and handles //// flattening of named references like %[foo] to Operand AsmStringPiece's. unsigned AnalyzeAsmString(SmallVectorImpl &Pieces, - ASTContext &C, unsigned &DiagOffs) const; + const ASTContext &C, unsigned &DiagOffs) const; /// Assemble final IR asm string. - std::string generateAsmString(ASTContext &C) const; + std::string generateAsmString(const ASTContext &C) const; //===--- Output operands ---===// @@ -1637,7 +1638,7 @@ public: } private: - void setOutputsAndInputsAndClobbers(ASTContext &C, + void setOutputsAndInputsAndClobbers(const ASTContext &C, IdentifierInfo **Names, StringLiteral **Constraints, Stmt **Exprs, @@ -1683,8 +1684,8 @@ class MSAsmStmt : public AsmStmt { friend class ASTStmtReader; public: - MSAsmStmt(ASTContext &C, SourceLocation asmloc, SourceLocation lbraceloc, - bool issimple, bool isvolatile, ArrayRef asmtoks, + MSAsmStmt(const ASTContext &C, SourceLocation asmloc, SourceLocation + lbraceloc, bool issimple, bool isvolatile, ArrayRef asmtoks, unsigned numoutputs, unsigned numinputs, ArrayRef constraints, ArrayRef exprs, StringRef asmstr, @@ -1708,7 +1709,7 @@ public: StringRef getAsmString() const { return AsmStr; } /// Assemble final IR asm string. - std::string generateAsmString(ASTContext &C) const; + std::string generateAsmString(const ASTContext &C) const; //===--- Output operands ---===// @@ -1753,7 +1754,7 @@ public: StringRef getClobber(unsigned i) const { return getClobbers()[i]; } private: - void initialize(ASTContext &C, + void initialize(const ASTContext &C, StringRef AsmString, ArrayRef AsmToks, ArrayRef Constraints, @@ -1788,7 +1789,7 @@ class SEHExceptStmt : public Stmt { explicit SEHExceptStmt(EmptyShell E) : Stmt(SEHExceptStmtClass, E) { } public: - static SEHExceptStmt* Create(ASTContext &C, + static SEHExceptStmt* Create(const ASTContext &C, SourceLocation ExceptLoc, Expr *FilterExpr, Stmt *Block); @@ -1829,7 +1830,7 @@ class SEHFinallyStmt : public Stmt { explicit SEHFinallyStmt(EmptyShell E) : Stmt(SEHFinallyStmtClass, E) { } public: - static SEHFinallyStmt* Create(ASTContext &C, + static SEHFinallyStmt* Create(const ASTContext &C, SourceLocation FinallyLoc, Stmt *Block); @@ -1868,10 +1869,8 @@ class SEHTryStmt : public Stmt { explicit SEHTryStmt(EmptyShell E) : Stmt(SEHTryStmtClass, E) { } public: - static SEHTryStmt* Create(ASTContext &C, - bool isCXXTry, - SourceLocation TryLoc, - Stmt *TryBlock, + static SEHTryStmt* Create(const ASTContext &C, bool isCXXTry, + SourceLocation TryLoc, Stmt *TryBlock, Stmt *Handler); SourceLocation getLocStart() const LLVM_READONLY { return getTryLoc(); } @@ -1994,13 +1993,13 @@ private: void setCapturedStmt(Stmt *S) { getStoredStmts()[NumCaptures] = S; } public: - static CapturedStmt *Create(ASTContext &Context, Stmt *S, + static CapturedStmt *Create(const ASTContext &Context, Stmt *S, CapturedRegionKind Kind, ArrayRef Captures, ArrayRef CaptureInits, CapturedDecl *CD, RecordDecl *RD); - static CapturedStmt *CreateDeserialized(ASTContext &Context, + static CapturedStmt *CreateDeserialized(const ASTContext &Context, unsigned NumCaptures); /// \brief Retrieve the statement being captured. diff --git a/include/clang/AST/StmtCXX.h b/include/clang/AST/StmtCXX.h index 0112befb29..df98d41ad5 100644 --- a/include/clang/AST/StmtCXX.h +++ b/include/clang/AST/StmtCXX.h @@ -79,10 +79,10 @@ class CXXTryStmt : public Stmt { } public: - static CXXTryStmt *Create(ASTContext &C, SourceLocation tryLoc, + static CXXTryStmt *Create(const ASTContext &C, SourceLocation tryLoc, Stmt *tryBlock, ArrayRef handlers); - static CXXTryStmt *Create(ASTContext &C, EmptyShell Empty, + static CXXTryStmt *Create(const ASTContext &C, EmptyShell Empty, unsigned numHandlers); SourceLocation getLocStart() const LLVM_READONLY { return getTryLoc(); } diff --git a/include/clang/AST/StmtObjC.h b/include/clang/AST/StmtObjC.h index e97c1a5a31..bfb4a9b0bb 100644 --- a/include/clang/AST/StmtObjC.h +++ b/include/clang/AST/StmtObjC.h @@ -181,13 +181,12 @@ private: HasFinally(HasFinally) { } public: - static ObjCAtTryStmt *Create(ASTContext &Context, SourceLocation atTryLoc, - Stmt *atTryStmt, + static ObjCAtTryStmt *Create(const ASTContext &Context, + SourceLocation atTryLoc, Stmt *atTryStmt, Stmt **CatchStmts, unsigned NumCatchStmts, Stmt *atFinallyStmt); - static ObjCAtTryStmt *CreateEmpty(ASTContext &Context, - unsigned NumCatchStmts, - bool HasFinally); + static ObjCAtTryStmt *CreateEmpty(const ASTContext &Context, + unsigned NumCatchStmts, bool HasFinally); /// \brief Retrieve the location of the @ in the \@try. SourceLocation getAtTryLoc() const { return AtTryLoc; } diff --git a/include/clang/AST/StmtOpenMP.h b/include/clang/AST/StmtOpenMP.h index 404a47864f..fbaa4f1880 100644 --- a/include/clang/AST/StmtOpenMP.h +++ b/include/clang/AST/StmtOpenMP.h @@ -228,7 +228,7 @@ public: /// \param EndLoc Ending location of the clause. /// \param VL List of references to the variables. /// - static OMPPrivateClause *Create(ASTContext &C, SourceLocation StartLoc, + static OMPPrivateClause *Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef VL); @@ -237,7 +237,7 @@ public: /// \param C AST context. /// \param N The number of variables. /// - static OMPPrivateClause *CreateEmpty(ASTContext &C, unsigned N); + static OMPPrivateClause *CreateEmpty(const ASTContext &C, unsigned N); StmtRange children() { return StmtRange(reinterpret_cast(varlist_begin()), @@ -386,7 +386,8 @@ public: /// \param Clauses List of clauses. /// \param AssociatedStmt Statement associated with the directive. /// - static OMPParallelDirective *Create(ASTContext &C, SourceLocation StartLoc, + static OMPParallelDirective *Create(const ASTContext &C, + SourceLocation StartLoc, SourceLocation EndLoc, ArrayRef Clauses, Stmt *AssociatedStmt); @@ -396,7 +397,7 @@ public: /// \param C AST context. /// \param N The number of clauses. /// - static OMPParallelDirective *CreateEmpty(ASTContext &C, unsigned N, + static OMPParallelDirective *CreateEmpty(const ASTContext &C, unsigned N, EmptyShell); static bool classof(const Stmt *T) { diff --git a/include/clang/Driver/Options.td b/include/clang/Driver/Options.td index d8d2cd3730..1a98b7d22c 100644 --- a/include/clang/Driver/Options.td +++ b/include/clang/Driver/Options.td @@ -968,6 +968,7 @@ def mno_ssse3 : Flag<["-"], "mno-ssse3">, Group; def mno_aes : Flag<["-"], "mno-aes">, Group; def mno_avx : Flag<["-"], "mno-avx">, Group; def mno_avx2 : Flag<["-"], "mno-avx2">, Group; +def mno_avx512f : Flag<["-"], "mno-avx512f">, Group; def mno_pclmul : Flag<["-"], "mno-pclmul">, Group; def mno_lzcnt : Flag<["-"], "mno-lzcnt">, Group; def mno_rdrnd : Flag<["-"], "mno-rdrnd">, Group; @@ -1014,6 +1015,7 @@ def mssse3 : Flag<["-"], "mssse3">, Group; def maes : Flag<["-"], "maes">, Group; def mavx : Flag<["-"], "mavx">, Group; def mavx2 : Flag<["-"], "mavx2">, Group; +def mavx512f : Flag<["-"], "mavx512f">, Group; def mpclmul : Flag<["-"], "mpclmul">, Group; def mlzcnt : Flag<["-"], "mlzcnt">, Group; def mrdrnd : Flag<["-"], "mrdrnd">, Group; diff --git a/lib/AST/Stmt.cpp b/lib/AST/Stmt.cpp index 9b271c81ac..4772359743 100644 --- a/lib/AST/Stmt.cpp +++ b/lib/AST/Stmt.cpp @@ -248,7 +248,7 @@ SourceLocation Stmt::getLocEnd() const { llvm_unreachable("unknown statement kind"); } -CompoundStmt::CompoundStmt(ASTContext &C, ArrayRef Stmts, +CompoundStmt::CompoundStmt(const ASTContext &C, ArrayRef Stmts, SourceLocation LB, SourceLocation RB) : Stmt(CompoundStmtClass), LBracLoc(LB), RBracLoc(RB) { CompoundStmtBits.NumStmts = Stmts.size(); @@ -264,7 +264,8 @@ CompoundStmt::CompoundStmt(ASTContext &C, ArrayRef Stmts, std::copy(Stmts.begin(), Stmts.end(), Body); } -void CompoundStmt::setStmts(ASTContext &C, Stmt **Stmts, unsigned NumStmts) { +void CompoundStmt::setStmts(const ASTContext &C, Stmt **Stmts, + unsigned NumStmts) { if (this->Body) C.Deallocate(Body); this->CompoundStmtBits.NumStmts = NumStmts; @@ -277,7 +278,7 @@ const char *LabelStmt::getName() const { return getDecl()->getIdentifier()->getNameStart(); } -AttributedStmt *AttributedStmt::Create(ASTContext &C, SourceLocation Loc, +AttributedStmt *AttributedStmt::Create(const ASTContext &C, SourceLocation Loc, ArrayRef Attrs, Stmt *SubStmt) { void *Mem = C.Allocate(sizeof(AttributedStmt) + @@ -286,7 +287,8 @@ AttributedStmt *AttributedStmt::Create(ASTContext &C, SourceLocation Loc, return new (Mem) AttributedStmt(Loc, Attrs, SubStmt); } -AttributedStmt *AttributedStmt::CreateEmpty(ASTContext &C, unsigned NumAttrs) { +AttributedStmt *AttributedStmt::CreateEmpty(const ASTContext &C, + unsigned NumAttrs) { assert(NumAttrs > 0 && "NumAttrs should be greater than zero"); void *Mem = C.Allocate(sizeof(AttributedStmt) + sizeof(Attr*) * (NumAttrs - 1), @@ -294,7 +296,7 @@ AttributedStmt *AttributedStmt::CreateEmpty(ASTContext &C, unsigned NumAttrs) { return new (Mem) AttributedStmt(EmptyShell(), NumAttrs); } -std::string AsmStmt::generateAsmString(ASTContext &C) const { +std::string AsmStmt::generateAsmString(const ASTContext &C) const { if (const GCCAsmStmt *gccAsmStmt = dyn_cast(this)) return gccAsmStmt->generateAsmString(C); if (const MSAsmStmt *msAsmStmt = dyn_cast(this)) @@ -380,14 +382,14 @@ StringRef GCCAsmStmt::getInputConstraint(unsigned i) const { return getInputConstraintLiteral(i)->getString(); } -void GCCAsmStmt::setOutputsAndInputsAndClobbers(ASTContext &C, - IdentifierInfo **Names, - StringLiteral **Constraints, - Stmt **Exprs, - unsigned NumOutputs, - unsigned NumInputs, - StringLiteral **Clobbers, - unsigned NumClobbers) { +void GCCAsmStmt::setOutputsAndInputsAndClobbers(const ASTContext &C, + IdentifierInfo **Names, + StringLiteral **Constraints, + Stmt **Exprs, + unsigned NumOutputs, + unsigned NumInputs, + StringLiteral **Clobbers, + unsigned NumClobbers) { this->NumOutputs = NumOutputs; this->NumInputs = NumInputs; this->NumClobbers = NumClobbers; @@ -435,7 +437,7 @@ int GCCAsmStmt::getNamedOperand(StringRef SymbolicName) const { /// it into pieces. If the asm string is erroneous, emit errors and return /// true, otherwise return false. unsigned GCCAsmStmt::AnalyzeAsmString(SmallVectorImpl&Pieces, - ASTContext &C, unsigned &DiagOffs) const { + const ASTContext &C, unsigned &DiagOffs) const { StringRef Str = getAsmString()->getString(); const char *StrStart = Str.begin(); const char *StrEnd = Str.end(); @@ -573,7 +575,7 @@ unsigned GCCAsmStmt::AnalyzeAsmString(SmallVectorImpl&Pieces, } /// Assemble final IR asm string (GCC-style). -std::string GCCAsmStmt::generateAsmString(ASTContext &C) const { +std::string GCCAsmStmt::generateAsmString(const ASTContext &C) const { // Analyze the asm string to decompose it into its pieces. We know that Sema // has already done this, so it is guaranteed to be successful. SmallVector Pieces; @@ -594,7 +596,7 @@ std::string GCCAsmStmt::generateAsmString(ASTContext &C) const { } /// Assemble final IR asm string (MS-style). -std::string MSAsmStmt::generateAsmString(ASTContext &C) const { +std::string MSAsmStmt::generateAsmString(const ASTContext &C) const { // FIXME: This needs to be translated into the IR string representation. return AsmStr; } @@ -620,11 +622,12 @@ QualType CXXCatchStmt::getCaughtType() const { // Constructors //===----------------------------------------------------------------------===// -GCCAsmStmt::GCCAsmStmt(ASTContext &C, SourceLocation asmloc, bool issimple, - bool isvolatile, unsigned numoutputs, unsigned numinputs, - IdentifierInfo **names, StringLiteral **constraints, - Expr **exprs, StringLiteral *asmstr, - unsigned numclobbers, StringLiteral **clobbers, +GCCAsmStmt::GCCAsmStmt(const ASTContext &C, SourceLocation asmloc, + bool issimple, bool isvolatile, unsigned numoutputs, + unsigned numinputs, IdentifierInfo **names, + StringLiteral **constraints, Expr **exprs, + StringLiteral *asmstr, unsigned numclobbers, + StringLiteral **clobbers, SourceLocation rparenloc) : AsmStmt(GCCAsmStmtClass, asmloc, issimple, isvolatile, numoutputs, numinputs, numclobbers), RParenLoc(rparenloc), AsmStr(asmstr) { @@ -644,7 +647,7 @@ GCCAsmStmt::GCCAsmStmt(ASTContext &C, SourceLocation asmloc, bool issimple, std::copy(clobbers, clobbers + NumClobbers, Clobbers); } -MSAsmStmt::MSAsmStmt(ASTContext &C, SourceLocation asmloc, +MSAsmStmt::MSAsmStmt(const ASTContext &C, SourceLocation asmloc, SourceLocation lbraceloc, bool issimple, bool isvolatile, ArrayRef asmtoks, unsigned numoutputs, unsigned numinputs, @@ -658,14 +661,14 @@ MSAsmStmt::MSAsmStmt(ASTContext &C, SourceLocation asmloc, initialize(C, asmstr, asmtoks, constraints, exprs, clobbers); } -static StringRef copyIntoContext(ASTContext &C, StringRef str) { +static StringRef copyIntoContext(const ASTContext &C, StringRef str) { size_t size = str.size(); char *buffer = new (C) char[size]; memcpy(buffer, str.data(), size); return StringRef(buffer, size); } -void MSAsmStmt::initialize(ASTContext &C, +void MSAsmStmt::initialize(const ASTContext &C, StringRef asmstr, ArrayRef asmtoks, ArrayRef constraints, @@ -726,7 +729,7 @@ ObjCAtTryStmt::ObjCAtTryStmt(SourceLocation atTryLoc, Stmt *atTryStmt, Stmts[NumCatchStmts + 1] = atFinallyStmt; } -ObjCAtTryStmt *ObjCAtTryStmt::Create(ASTContext &Context, +ObjCAtTryStmt *ObjCAtTryStmt::Create(const ASTContext &Context, SourceLocation atTryLoc, Stmt *atTryStmt, Stmt **CatchStmts, @@ -739,9 +742,9 @@ ObjCAtTryStmt *ObjCAtTryStmt::Create(ASTContext &Context, atFinallyStmt); } -ObjCAtTryStmt *ObjCAtTryStmt::CreateEmpty(ASTContext &Context, - unsigned NumCatchStmts, - bool HasFinally) { +ObjCAtTryStmt *ObjCAtTryStmt::CreateEmpty(const ASTContext &Context, + unsigned NumCatchStmts, + bool HasFinally) { unsigned Size = sizeof(ObjCAtTryStmt) + (1 + NumCatchStmts + HasFinally) * sizeof(Stmt *); void *Mem = Context.Allocate(Size, llvm::alignOf()); @@ -756,7 +759,7 @@ SourceLocation ObjCAtTryStmt::getLocEnd() const { return getTryBody()->getLocEnd(); } -CXXTryStmt *CXXTryStmt::Create(ASTContext &C, SourceLocation tryLoc, +CXXTryStmt *CXXTryStmt::Create(const ASTContext &C, SourceLocation tryLoc, Stmt *tryBlock, ArrayRef handlers) { std::size_t Size = sizeof(CXXTryStmt); Size += ((handlers.size() + 1) * sizeof(Stmt)); @@ -765,7 +768,7 @@ CXXTryStmt *CXXTryStmt::Create(ASTContext &C, SourceLocation tryLoc, return new (Mem) CXXTryStmt(tryLoc, tryBlock, handlers); } -CXXTryStmt *CXXTryStmt::Create(ASTContext &C, EmptyShell Empty, +CXXTryStmt *CXXTryStmt::Create(const ASTContext &C, EmptyShell Empty, unsigned numHandlers) { std::size_t Size = sizeof(CXXTryStmt); Size += ((numHandlers + 1) * sizeof(Stmt)); @@ -816,7 +819,7 @@ const VarDecl *CXXForRangeStmt::getLoopVariable() const { return const_cast(this)->getLoopVariable(); } -IfStmt::IfStmt(ASTContext &C, SourceLocation IL, VarDecl *var, Expr *cond, +IfStmt::IfStmt(const ASTContext &C, SourceLocation IL, VarDecl *var, Expr *cond, Stmt *then, SourceLocation EL, Stmt *elsev) : Stmt(IfStmtClass), IfLoc(IL), ElseLoc(EL) { @@ -834,7 +837,7 @@ VarDecl *IfStmt::getConditionVariable() const { return cast(DS->getSingleDecl()); } -void IfStmt::setConditionVariable(ASTContext &C, VarDecl *V) { +void IfStmt::setConditionVariable(const ASTContext &C, VarDecl *V) { if (!V) { SubExprs[VAR] = 0; return; @@ -845,7 +848,7 @@ void IfStmt::setConditionVariable(ASTContext &C, VarDecl *V) { VarRange.getEnd()); } -ForStmt::ForStmt(ASTContext &C, Stmt *Init, Expr *Cond, VarDecl *condVar, +ForStmt::ForStmt(const ASTContext &C, Stmt *Init, Expr *Cond, VarDecl *condVar, Expr *Inc, Stmt *Body, SourceLocation FL, SourceLocation LP, SourceLocation RP) : Stmt(ForStmtClass), ForLoc(FL), LParenLoc(LP), RParenLoc(RP) @@ -865,7 +868,7 @@ VarDecl *ForStmt::getConditionVariable() const { return cast(DS->getSingleDecl()); } -void ForStmt::setConditionVariable(ASTContext &C, VarDecl *V) { +void ForStmt::setConditionVariable(const ASTContext &C, VarDecl *V) { if (!V) { SubExprs[CONDVAR] = 0; return; @@ -876,7 +879,7 @@ void ForStmt::setConditionVariable(ASTContext &C, VarDecl *V) { VarRange.getEnd()); } -SwitchStmt::SwitchStmt(ASTContext &C, VarDecl *Var, Expr *cond) +SwitchStmt::SwitchStmt(const ASTContext &C, VarDecl *Var, Expr *cond) : Stmt(SwitchStmtClass), FirstCase(0), AllEnumCasesCovered(0) { setConditionVariable(C, Var); @@ -892,7 +895,7 @@ VarDecl *SwitchStmt::getConditionVariable() const { return cast(DS->getSingleDecl()); } -void SwitchStmt::setConditionVariable(ASTContext &C, VarDecl *V) { +void SwitchStmt::setConditionVariable(const ASTContext &C, VarDecl *V) { if (!V) { SubExprs[VAR] = 0; return; @@ -909,7 +912,7 @@ Stmt *SwitchCase::getSubStmt() { return cast(this)->getSubStmt(); } -WhileStmt::WhileStmt(ASTContext &C, VarDecl *Var, Expr *cond, Stmt *body, +WhileStmt::WhileStmt(const ASTContext &C, VarDecl *Var, Expr *cond, Stmt *body, SourceLocation WL) : Stmt(WhileStmtClass) { setConditionVariable(C, Var); @@ -926,7 +929,7 @@ VarDecl *WhileStmt::getConditionVariable() const { return cast(DS->getSingleDecl()); } -void WhileStmt::setConditionVariable(ASTContext &C, VarDecl *V) { +void WhileStmt::setConditionVariable(const ASTContext &C, VarDecl *V) { if (!V) { SubExprs[VAR] = 0; return; @@ -965,10 +968,8 @@ SEHTryStmt::SEHTryStmt(bool IsCXXTry, Children[HANDLER] = Handler; } -SEHTryStmt* SEHTryStmt::Create(ASTContext &C, - bool IsCXXTry, - SourceLocation TryLoc, - Stmt *TryBlock, +SEHTryStmt* SEHTryStmt::Create(const ASTContext &C, bool IsCXXTry, + SourceLocation TryLoc, Stmt *TryBlock, Stmt *Handler) { return new(C) SEHTryStmt(IsCXXTry,TryLoc,TryBlock,Handler); } @@ -991,10 +992,8 @@ SEHExceptStmt::SEHExceptStmt(SourceLocation Loc, Children[BLOCK] = Block; } -SEHExceptStmt* SEHExceptStmt::Create(ASTContext &C, - SourceLocation Loc, - Expr *FilterExpr, - Stmt *Block) { +SEHExceptStmt* SEHExceptStmt::Create(const ASTContext &C, SourceLocation Loc, + Expr *FilterExpr, Stmt *Block) { return new(C) SEHExceptStmt(Loc,FilterExpr,Block); } @@ -1005,8 +1004,7 @@ SEHFinallyStmt::SEHFinallyStmt(SourceLocation Loc, Block(Block) {} -SEHFinallyStmt* SEHFinallyStmt::Create(ASTContext &C, - SourceLocation Loc, +SEHFinallyStmt* SEHFinallyStmt::Create(const ASTContext &C, SourceLocation Loc, Stmt *Block) { return new(C)SEHFinallyStmt(Loc,Block); } @@ -1053,7 +1051,7 @@ CapturedStmt::CapturedStmt(EmptyShell Empty, unsigned NumCaptures) getStoredStmts()[NumCaptures] = 0; } -CapturedStmt *CapturedStmt::Create(ASTContext &Context, Stmt *S, +CapturedStmt *CapturedStmt::Create(const ASTContext &Context, Stmt *S, CapturedRegionKind Kind, ArrayRef Captures, ArrayRef CaptureInits, @@ -1081,7 +1079,7 @@ CapturedStmt *CapturedStmt::Create(ASTContext &Context, Stmt *S, return new (Mem) CapturedStmt(S, Kind, Captures, CaptureInits, CD, RD); } -CapturedStmt *CapturedStmt::CreateDeserialized(ASTContext &Context, +CapturedStmt *CapturedStmt::CreateDeserialized(const ASTContext &Context, unsigned NumCaptures) { unsigned Size = sizeof(CapturedStmt) + sizeof(Stmt *) * (NumCaptures + 1); if (NumCaptures > 0) { @@ -1115,7 +1113,7 @@ bool CapturedStmt::capturesVariable(const VarDecl *Var) const { return false; } -OMPPrivateClause *OMPPrivateClause::Create(ASTContext &C, +OMPPrivateClause *OMPPrivateClause::Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, @@ -1128,7 +1126,7 @@ OMPPrivateClause *OMPPrivateClause::Create(ASTContext &C, return Clause; } -OMPPrivateClause *OMPPrivateClause::CreateEmpty(ASTContext &C, +OMPPrivateClause *OMPPrivateClause::CreateEmpty(const ASTContext &C, unsigned N) { void *Mem = C.Allocate(sizeof(OMPPrivateClause) + sizeof(Expr *) * N, llvm::alignOf()); @@ -1141,12 +1139,11 @@ void OMPExecutableDirective::setClauses(ArrayRef Clauses) { std::copy(Clauses.begin(), Clauses.end(), this->Clauses.begin()); } -OMPParallelDirective *OMPParallelDirective::Create( - ASTContext &C, - SourceLocation StartLoc, - SourceLocation EndLoc, - ArrayRef Clauses, - Stmt *AssociatedStmt) { +OMPParallelDirective *OMPParallelDirective::Create(const ASTContext &C, + SourceLocation StartLoc, + SourceLocation EndLoc, + ArrayRef Clauses, + Stmt *AssociatedStmt) { void *Mem = C.Allocate(sizeof(OMPParallelDirective) + sizeof(OMPClause *) * Clauses.size() + sizeof(Stmt *), llvm::alignOf()); @@ -1157,7 +1154,7 @@ OMPParallelDirective *OMPParallelDirective::Create( return Dir; } -OMPParallelDirective *OMPParallelDirective::CreateEmpty(ASTContext &C, +OMPParallelDirective *OMPParallelDirective::CreateEmpty(const ASTContext &C, unsigned N, EmptyShell) { void *Mem = C.Allocate(sizeof(OMPParallelDirective) + diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp index 9d6406be25..8816ac3bb4 100644 --- a/lib/Basic/Targets.cpp +++ b/lib/Basic/Targets.cpp @@ -1538,7 +1538,7 @@ const TargetInfo::AddlRegName AddlRegNames[] = { // most of the implementation can be shared. class X86TargetInfo : public TargetInfo { enum X86SSEEnum { - NoSSE, SSE1, SSE2, SSE3, SSSE3, SSE41, SSE42, AVX, AVX2, AVX512 + NoSSE, SSE1, SSE2, SSE3, SSSE3, SSE41, SSE42, AVX, AVX2, AVX512F } SSELevel; enum MMX3DNowEnum { NoMMX3DNow, MMX, AMD3DNow, AMD3DNowAthlon @@ -2072,8 +2072,8 @@ void X86TargetInfo::setSSELevel(llvm::StringMap &Features, X86SSEEnum Level, bool Enabled) const { if (Enabled) { switch (Level) { - case AVX512: - Features["avx-512"] = true; + case AVX512F: + Features["avx512f"] = true; case AVX2: Features["avx2"] = true; case AVX: @@ -2118,8 +2118,8 @@ void X86TargetInfo::setSSELevel(llvm::StringMap &Features, setXOPLevel(Features, SSE4A, false); case AVX2: Features["avx2"] = false; - case AVX512: - Features["avx-512"] = false; + case AVX512F: + Features["avx512f"] = false; } } @@ -2222,7 +2222,7 @@ void X86TargetInfo::setFeatureEnabled(llvm::StringMap &Features, else if (Name == "avx2") setSSELevel(Features, AVX2, Enabled); else if (Name == "avx-512") - setSSELevel(Features, AVX512, Enabled); + setSSELevel(Features, AVX512F, Enabled); else if (Name == "fma") { if (Enabled) setSSELevel(Features, AVX, Enabled); @@ -2308,7 +2308,7 @@ void X86TargetInfo::HandleTargetFeatures(std::vector &Features) { assert(Features[i][0] == '+' && "Invalid target feature!"); X86SSEEnum Level = llvm::StringSwitch(Feature) - .Case("avx-512", AVX512) + .Case("avx-512", AVX512F) .Case("avx2", AVX2) .Case("avx", AVX) .Case("sse42", SSE42) @@ -2543,7 +2543,7 @@ void X86TargetInfo::getTargetDefines(const LangOptions &Opts, // Each case falls through to the previous one here. switch (SSELevel) { - case AVX512: + case AVX512F: Builder.defineMacro("__AVX512F__"); case AVX2: Builder.defineMacro("__AVX2__"); @@ -2569,7 +2569,7 @@ void X86TargetInfo::getTargetDefines(const LangOptions &Opts, if (Opts.MicrosoftExt && getTriple().getArch() == llvm::Triple::x86) { switch (SSELevel) { - case AVX512: + case AVX512F: case AVX2: case AVX: case SSE42: @@ -2613,7 +2613,7 @@ bool X86TargetInfo::hasFeature(StringRef Feature) const { .Case("aes", HasAES) .Case("avx", SSELevel >= AVX) .Case("avx2", SSELevel >= AVX2) - .Case("avx512", SSELevel >= AVX512) + .Case("avx512f", SSELevel >= AVX512F) .Case("bmi", HasBMI) .Case("bmi2", HasBMI2) .Case("fma", HasFMA)