diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2015-07-05 14:23:59 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2015-07-05 14:23:59 +0000 |
commit | c192b3dcffd5e672a2b2e1730e2440febb4fb192 (patch) | |
tree | ac719b5984165053bf83d71142e4d96b609b9784 /include/clang/Sema | |
parent | 2e645aa5697838f16ec570eb07c2bee7e13d0e0b (diff) |
Diffstat (limited to 'include/clang/Sema')
-rw-r--r-- | include/clang/Sema/DeclSpec.h | 16 | ||||
-rw-r--r-- | include/clang/Sema/Sema.h | 78 |
2 files changed, 70 insertions, 24 deletions
diff --git a/include/clang/Sema/DeclSpec.h b/include/clang/Sema/DeclSpec.h index 2ec3286ad799c..d375ec303785d 100644 --- a/include/clang/Sema/DeclSpec.h +++ b/include/clang/Sema/DeclSpec.h @@ -358,6 +358,9 @@ private: // constexpr-specifier unsigned Constexpr_specified : 1; + // concept-specifier + unsigned Concept_specified : 1; + union { UnionParsedType TypeRep; Decl *DeclRep; @@ -393,7 +396,7 @@ private: SourceLocation TQ_constLoc, TQ_restrictLoc, TQ_volatileLoc, TQ_atomicLoc; SourceLocation FS_inlineLoc, FS_virtualLoc, FS_explicitLoc, FS_noreturnLoc; SourceLocation FS_forceinlineLoc; - SourceLocation FriendLoc, ModulePrivateLoc, ConstexprLoc; + SourceLocation FriendLoc, ModulePrivateLoc, ConstexprLoc, ConceptLoc; WrittenBuiltinSpecs writtenBS; void SaveWrittenBuiltinSpecs(); @@ -437,6 +440,7 @@ public: FS_noreturn_specified(false), Friend_specified(false), Constexpr_specified(false), + Concept_specified(false), Attrs(attrFactory), ProtocolQualifiers(nullptr), NumProtocolQualifiers(0), @@ -688,6 +692,8 @@ public: unsigned &DiagID); bool SetConstexprSpec(SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID); + bool SetConceptSpec(SourceLocation Loc, const char *&PrevSpec, + unsigned &DiagID); bool isFriendSpecified() const { return Friend_specified; } SourceLocation getFriendSpecLoc() const { return FriendLoc; } @@ -698,11 +704,19 @@ public: bool isConstexprSpecified() const { return Constexpr_specified; } SourceLocation getConstexprSpecLoc() const { return ConstexprLoc; } + bool isConceptSpecified() const { return Concept_specified; } + SourceLocation getConceptSpecLoc() const { return ConceptLoc; } + void ClearConstexprSpec() { Constexpr_specified = false; ConstexprLoc = SourceLocation(); } + void ClearConceptSpec() { + Concept_specified = false; + ConceptLoc = SourceLocation(); + } + AttributePool &getAttributePool() const { return Attrs.getPool(); } diff --git a/include/clang/Sema/Sema.h b/include/clang/Sema/Sema.h index cb75b969f116a..72a0e0b19e3d8 100644 --- a/include/clang/Sema/Sema.h +++ b/include/clang/Sema/Sema.h @@ -277,7 +277,9 @@ class Sema { // it will keep having external linkage. If it has internal linkage, we // will not link it. Since it has no previous decls, it will remain // with internal linkage. - return isVisible(Old) || New->isExternallyVisible(); + if (getLangOpts().ModulesHideInternalLinkage) + return isVisible(Old) || New->isExternallyVisible(); + return true; } public: @@ -700,9 +702,15 @@ public: /// \brief The declaration of the Objective-C NSNumber class. ObjCInterfaceDecl *NSNumberDecl; + /// \brief The declaration of the Objective-C NSValue class. + ObjCInterfaceDecl *NSValueDecl; + /// \brief Pointer to NSNumber type (NSNumber *). QualType NSNumberPointer; + /// \brief Pointer to NSValue type (NSValue *). + QualType NSValuePointer; + /// \brief The Objective-C NSNumber methods used to create NSNumber literals. ObjCMethodDecl *NSNumberLiteralMethods[NSAPI::NumNSNumberLiteralMethods]; @@ -715,6 +723,9 @@ public: /// \brief The declaration of the stringWithUTF8String: method. ObjCMethodDecl *StringWithUTF8StringMethod; + /// \brief The declaration of the valueWithBytes:objCType: method. + ObjCMethodDecl *ValueWithBytesObjCTypeMethod; + /// \brief The declaration of the Objective-C NSArray class. ObjCInterfaceDecl *NSArrayDecl; @@ -1679,6 +1690,7 @@ public: bool TypeMayContainAuto); void ActOnUninitializedDecl(Decl *dcl, bool TypeMayContainAuto); void ActOnInitializerError(Decl *Dcl); + void ActOnPureSpecifier(Decl *D, SourceLocation PureSpecLoc); void ActOnCXXForRangeDecl(Decl *D); StmtResult ActOnCXXForRangeIdentifier(Scope *S, SourceLocation IdentLoc, IdentifierInfo *Ident, @@ -2976,7 +2988,7 @@ public: bool SynthesizeProperties); /// Diagnose any null-resettable synthesized setters. - void diagnoseNullResettableSynthesizedSetters(ObjCImplDecl *impDecl); + void diagnoseNullResettableSynthesizedSetters(const ObjCImplDecl *impDecl); /// DefaultSynthesizeProperties - This routine default synthesizes all /// properties which must be synthesized in the class's \@implementation. @@ -5025,9 +5037,9 @@ public: /// BuildObjCBoxedExpr - builds an ObjCBoxedExpr AST node for the /// '@' prefixed parenthesized expression. The type of the expression will - /// either be "NSNumber *" or "NSString *" depending on the type of - /// ValueType, which is allowed to be a built-in numeric type or - /// "char *" or "const char *". + /// either be "NSNumber *", "NSString *" or "NSValue *" depending on the type + /// of ValueType, which is allowed to be a built-in numeric type, "char *", + /// "const char *" or C structure with attribute 'objc_boxable'. ExprResult BuildObjCBoxedExpr(SourceRange SR, Expr *ValueExpr); ExprResult BuildObjCSubscriptExpression(SourceLocation RB, Expr *BaseExpr, @@ -7603,6 +7615,12 @@ private: bool IsOpenMPCapturedVar(VarDecl *VD); public: + /// \brief Check if the specified variable is used in one of the private + /// clauses in OpenMP constructs. + /// \param Level Relative level of nested OpenMP construct for that the check + /// is performed. + bool isOpenMPPrivateVar(VarDecl *VD, unsigned Level); + ExprResult PerformOpenMPImplicitIntegerConversion(SourceLocation OpLoc, Expr *Op); /// \brief Called on start of new data sharing attribute block. @@ -7610,9 +7628,9 @@ public: const DeclarationNameInfo &DirName, Scope *CurScope, SourceLocation Loc); /// \brief Start analysis of clauses. - void StartOpenMPClauses(); + void StartOpenMPClause(OpenMPClauseKind K); /// \brief End analysis of clauses. - void EndOpenMPClauses(); + void EndOpenMPClause(); /// \brief Called on end of data sharing attribute block. void EndOpenMPDSABlock(Stmt *CurDirective); @@ -7646,12 +7664,10 @@ public: /// /// \returns Statement for finished OpenMP region. StmtResult ActOnOpenMPRegionEnd(StmtResult S, ArrayRef<OMPClause *> Clauses); - StmtResult ActOnOpenMPExecutableDirective(OpenMPDirectiveKind Kind, - const DeclarationNameInfo &DirName, - ArrayRef<OMPClause *> Clauses, - Stmt *AStmt, - SourceLocation StartLoc, - SourceLocation EndLoc); + StmtResult ActOnOpenMPExecutableDirective( + OpenMPDirectiveKind Kind, const DeclarationNameInfo &DirName, + OpenMPDirectiveKind CancelRegion, ArrayRef<OMPClause *> Clauses, + Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc); /// \brief Called on well-formed '\#pragma omp parallel' after parsing /// of the associated statement. StmtResult ActOnOpenMPParallelDirective(ArrayRef<OMPClause *> Clauses, @@ -7757,6 +7773,15 @@ public: StmtResult ActOnOpenMPTeamsDirective(ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc); + /// \brief Called on well-formed '\#pragma omp cancellation point'. + StmtResult + ActOnOpenMPCancellationPointDirective(SourceLocation StartLoc, + SourceLocation EndLoc, + OpenMPDirectiveKind CancelRegion); + /// \brief Called on well-formed '\#pragma omp cancel'. + StmtResult ActOnOpenMPCancelDirective(SourceLocation StartLoc, + SourceLocation EndLoc, + OpenMPDirectiveKind CancelRegion); OMPClause *ActOnOpenMPSingleExprClause(OpenMPClauseKind Kind, Expr *Expr, @@ -7851,13 +7876,13 @@ public: OMPClause *ActOnOpenMPSeqCstClause(SourceLocation StartLoc, SourceLocation EndLoc); - OMPClause * - ActOnOpenMPVarListClause(OpenMPClauseKind Kind, ArrayRef<Expr *> Vars, - Expr *TailExpr, SourceLocation StartLoc, - SourceLocation LParenLoc, SourceLocation ColonLoc, - SourceLocation EndLoc, - CXXScopeSpec &ReductionIdScopeSpec, - const DeclarationNameInfo &ReductionId); + OMPClause *ActOnOpenMPVarListClause( + OpenMPClauseKind Kind, ArrayRef<Expr *> Vars, Expr *TailExpr, + SourceLocation StartLoc, SourceLocation LParenLoc, + SourceLocation ColonLoc, SourceLocation EndLoc, + CXXScopeSpec &ReductionIdScopeSpec, + const DeclarationNameInfo &ReductionId, OpenMPDependClauseKind DepKind, + SourceLocation DepLoc); /// \brief Called on well-formed 'private' clause. OMPClause *ActOnOpenMPPrivateClause(ArrayRef<Expr *> VarList, SourceLocation StartLoc, @@ -7914,6 +7939,12 @@ public: SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc); + /// \brief Called on well-formed 'depend' clause. + OMPClause * + ActOnOpenMPDependClause(OpenMPDependClauseKind DepKind, SourceLocation DepLoc, + SourceLocation ColonLoc, ArrayRef<Expr *> VarList, + SourceLocation StartLoc, SourceLocation LParenLoc, + SourceLocation EndLoc); /// \brief The kind of conversion being performed. enum CheckedConversionKind { @@ -8711,6 +8742,7 @@ private: bool SemaBuiltinARMSpecialReg(unsigned BuiltinID, CallExpr *TheCall, int ArgNum, unsigned ExpectedFieldNum, bool AllowName); + bool SemaBuiltinCpuSupports(CallExpr *TheCall); public: enum FormatStringType { FST_Scanf, @@ -8840,9 +8872,9 @@ private: mutable IdentifierInfo *Ident___float128; /// Nullability type specifiers. - IdentifierInfo *Ident___nonnull = nullptr; - IdentifierInfo *Ident___nullable = nullptr; - IdentifierInfo *Ident___null_unspecified = nullptr; + IdentifierInfo *Ident__Nonnull = nullptr; + IdentifierInfo *Ident__Nullable = nullptr; + IdentifierInfo *Ident__Null_unspecified = nullptr; IdentifierInfo *Ident_NSError = nullptr; |