diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/clang-c/Index.h | 6 | ||||
-rw-r--r-- | include/clang/AST/Decl.h | 4 | ||||
-rw-r--r-- | include/clang/AST/DeclTemplate.h | 3 | ||||
-rw-r--r-- | include/clang/AST/RecursiveASTVisitor.h | 3 | ||||
-rw-r--r-- | include/clang/AST/StmtOpenMP.h | 69 | ||||
-rw-r--r-- | include/clang/AST/TypeLoc.h | 28 | ||||
-rw-r--r-- | include/clang/Basic/AttrDocs.td | 1 | ||||
-rw-r--r-- | include/clang/Basic/DiagnosticSemaKinds.td | 4 | ||||
-rw-r--r-- | include/clang/Basic/OpenMPKinds.def | 35 | ||||
-rw-r--r-- | include/clang/Basic/StmtNodes.td | 1 | ||||
-rw-r--r-- | include/clang/Driver/CLCompatOptions.td | 7 | ||||
-rw-r--r-- | include/clang/Driver/Options.td | 1 | ||||
-rw-r--r-- | include/clang/Index/IndexSymbol.h | 8 | ||||
-rw-r--r-- | include/clang/Lex/HeaderSearch.h | 3 | ||||
-rw-r--r-- | include/clang/Lex/ModuleMap.h | 8 | ||||
-rw-r--r-- | include/clang/Parse/Parser.h | 7 | ||||
-rw-r--r-- | include/clang/Sema/Sema.h | 20 | ||||
-rw-r--r-- | include/clang/Serialization/ASTBitCodes.h | 1 |
18 files changed, 176 insertions, 33 deletions
diff --git a/include/clang-c/Index.h b/include/clang-c/Index.h index e9d9ab03a8b0..15fde19eb974 100644 --- a/include/clang-c/Index.h +++ b/include/clang-c/Index.h @@ -2370,7 +2370,11 @@ enum CXCursorKind { */ CXCursor_OMPTargetTeamsDistributeParallelForSimdDirective = 278, - CXCursor_LastStmt = CXCursor_OMPTargetTeamsDistributeParallelForSimdDirective, + /** \brief OpenMP target teams distribute simd directive. + */ + CXCursor_OMPTargetTeamsDistributeSimdDirective = 279, + + CXCursor_LastStmt = CXCursor_OMPTargetTeamsDistributeSimdDirective, /** * \brief Cursor that represents the translation unit itself. diff --git a/include/clang/AST/Decl.h b/include/clang/AST/Decl.h index b2e332d6d85c..8b52891af2f8 100644 --- a/include/clang/AST/Decl.h +++ b/include/clang/AST/Decl.h @@ -2061,6 +2061,10 @@ public: /// limited representation in the AST. SourceRange getReturnTypeSourceRange() const; + /// \brief Attempt to compute an informative source range covering the + /// function exception specification, if any. + SourceRange getExceptionSpecSourceRange() const; + /// \brief Determine the type of an expression that calls this function. QualType getCallResultType() const { assert(getType()->getAs<FunctionType>() && "Expected a FunctionType!"); diff --git a/include/clang/AST/DeclTemplate.h b/include/clang/AST/DeclTemplate.h index 2af95c02c460..dc50a190de42 100644 --- a/include/clang/AST/DeclTemplate.h +++ b/include/clang/AST/DeclTemplate.h @@ -2028,8 +2028,7 @@ public: SourceLocation L, DeclarationName Name, TemplateParameterList *Params, - NamedDecl *Decl, - ClassTemplateDecl *PrevDecl); + NamedDecl *Decl); /// \brief Create an empty class template node. static ClassTemplateDecl *CreateDeserialized(ASTContext &C, unsigned ID); diff --git a/include/clang/AST/RecursiveASTVisitor.h b/include/clang/AST/RecursiveASTVisitor.h index cbf0bee69f00..10a930abe6fb 100644 --- a/include/clang/AST/RecursiveASTVisitor.h +++ b/include/clang/AST/RecursiveASTVisitor.h @@ -2672,6 +2672,9 @@ DEF_TRAVERSE_STMT(OMPTargetTeamsDistributeParallelForDirective, DEF_TRAVERSE_STMT(OMPTargetTeamsDistributeParallelForSimdDirective, { TRY_TO(TraverseOMPExecutableDirective(S)); }) +DEF_TRAVERSE_STMT(OMPTargetTeamsDistributeSimdDirective, + { TRY_TO(TraverseOMPExecutableDirective(S)); }) + // OpenMP clauses. template <typename Derived> bool RecursiveASTVisitor<Derived>::TraverseOMPClause(OMPClause *C) { diff --git a/include/clang/AST/StmtOpenMP.h b/include/clang/AST/StmtOpenMP.h index 61cae7b6d258..ec532ecd5881 100644 --- a/include/clang/AST/StmtOpenMP.h +++ b/include/clang/AST/StmtOpenMP.h @@ -3711,6 +3711,75 @@ public: } }; +/// This represents '#pragma omp target teams distribute simd' combined +/// directive. +/// +/// \code +/// #pragma omp target teams distribute simd private(x) +/// \endcode +/// In this example directive '#pragma omp target teams distribute simd' +/// has clause 'private' with the variables 'x' +/// +class OMPTargetTeamsDistributeSimdDirective final : public OMPLoopDirective { + friend class ASTStmtReader; + + /// Build directive with the given start and end location. + /// + /// \param StartLoc Starting location of the directive kind. + /// \param EndLoc Ending location of the directive. + /// \param CollapsedNum Number of collapsed nested loops. + /// \param NumClauses Number of clauses. + /// + OMPTargetTeamsDistributeSimdDirective(SourceLocation StartLoc, + SourceLocation EndLoc, + unsigned CollapsedNum, + unsigned NumClauses) + : OMPLoopDirective(this, OMPTargetTeamsDistributeSimdDirectiveClass, + OMPD_target_teams_distribute_simd, StartLoc, EndLoc, + CollapsedNum, NumClauses) {} + + /// Build an empty directive. + /// + /// \param CollapsedNum Number of collapsed nested loops. + /// \param NumClauses Number of clauses. + /// + explicit OMPTargetTeamsDistributeSimdDirective(unsigned CollapsedNum, + unsigned NumClauses) + : OMPLoopDirective(this, OMPTargetTeamsDistributeSimdDirectiveClass, + OMPD_target_teams_distribute_simd, SourceLocation(), + SourceLocation(), CollapsedNum, NumClauses) {} + +public: + /// Creates directive with a list of \a Clauses. + /// + /// \param C AST context. + /// \param StartLoc Starting location of the directive kind. + /// \param EndLoc Ending Location of the directive. + /// \param CollapsedNum Number of collapsed loops. + /// \param Clauses List of clauses. + /// \param AssociatedStmt Statement, associated with the directive. + /// \param Exprs Helper expressions for CodeGen. + /// + static OMPTargetTeamsDistributeSimdDirective * + Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, + unsigned CollapsedNum, ArrayRef<OMPClause *> Clauses, + Stmt *AssociatedStmt, const HelperExprs &Exprs); + + /// Creates an empty directive with the place for \a NumClauses clauses. + /// + /// \param C AST context. + /// \param CollapsedNum Number of collapsed nested loops. + /// \param NumClauses Number of clauses. + /// + static OMPTargetTeamsDistributeSimdDirective * + CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, + EmptyShell); + + static bool classof(const Stmt *T) { + return T->getStmtClass() == OMPTargetTeamsDistributeSimdDirectiveClass; + } +}; + } // end namespace clang #endif diff --git a/include/clang/AST/TypeLoc.h b/include/clang/AST/TypeLoc.h index 7de666838d44..5b7d9e6e3ce1 100644 --- a/include/clang/AST/TypeLoc.h +++ b/include/clang/AST/TypeLoc.h @@ -1351,6 +1351,19 @@ class FunctionTypeLoc : public ConcreteTypeLoc<UnqualTypeLoc, FunctionTypeLoc, FunctionType, FunctionLocInfo> { + bool hasExceptionSpec() const { + if (auto *FPT = dyn_cast<FunctionProtoType>(getTypePtr())) { + return FPT->hasExceptionSpec(); + } + return false; + } + + SourceRange *getExceptionSpecRangePtr() const { + assert(hasExceptionSpec() && "No exception spec range"); + // After the Info comes the ParmVarDecl array, and after that comes the + // exception specification information. + return (SourceRange *)(getParmArray() + getNumParams()); + } public: SourceLocation getLocalRangeBegin() const { return getLocalData()->LocalRangeBegin; @@ -1384,6 +1397,16 @@ public: return SourceRange(getLParenLoc(), getRParenLoc()); } + SourceRange getExceptionSpecRange() const { + if (hasExceptionSpec()) + return *getExceptionSpecRangePtr(); + return SourceRange(); + } + void setExceptionSpecRange(SourceRange R) { + if (hasExceptionSpec()) + *getExceptionSpecRangePtr() = R; + } + ArrayRef<ParmVarDecl *> getParams() const { return llvm::makeArrayRef(getParmArray(), getNumParams()); } @@ -1416,12 +1439,15 @@ public: setLocalRangeEnd(Loc); for (unsigned i = 0, e = getNumParams(); i != e; ++i) setParam(i, nullptr); + if (hasExceptionSpec()) + setExceptionSpecRange(Loc); } /// \brief Returns the size of the type source info data block that is /// specific to this type. unsigned getExtraLocalDataSize() const { - return getNumParams() * sizeof(ParmVarDecl *); + unsigned ExceptSpecSize = hasExceptionSpec() ? sizeof(SourceRange) : 0; + return (getNumParams() * sizeof(ParmVarDecl *)) + ExceptSpecSize; } unsigned getExtraLocalDataAlignment() const { return alignof(ParmVarDecl *); } diff --git a/include/clang/Basic/AttrDocs.td b/include/clang/Basic/AttrDocs.td index 49b0a533cec3..8f6a7ea601b3 100644 --- a/include/clang/Basic/AttrDocs.td +++ b/include/clang/Basic/AttrDocs.td @@ -386,6 +386,7 @@ warnings or errors at compile-time if calls to the attributed function meet certain user-defined criteria. For example: .. code-block:: c + void abs(int a) __attribute__((diagnose_if(a >= 0, "Redundant abs call", "warning"))); void must_abs(int a) diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index 6a8933f23ecd..3971cf60d5e0 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -8720,10 +8720,6 @@ def err_coroutine_invalid_func_context : Error< "|a copy assignment operator|a move assignment operator|the 'main' function" "|a constexpr function|a function with a deduced return type" "|a varargs function}0">; -def ext_coroutine_without_co_await_co_yield : ExtWarn< - "'co_return' used in a function " - "that uses neither 'co_await' nor 'co_yield'">, - InGroup<DiagGroup<"coreturn-without-coawait">>; def err_implied_std_coroutine_traits_not_found : Error< "you need to include <experimental/coroutine> before defining a coroutine">; def err_malformed_std_coroutine_traits : Error< diff --git a/include/clang/Basic/OpenMPKinds.def b/include/clang/Basic/OpenMPKinds.def index 58b54ce0bcd6..74ec26f19ac2 100644 --- a/include/clang/Basic/OpenMPKinds.def +++ b/include/clang/Basic/OpenMPKinds.def @@ -165,6 +165,9 @@ #ifndef OPENMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_FOR_SIMD_CLAUSE #define OPENMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_FOR_SIMD_CLAUSE(Name) #endif +#ifndef OPENMP_TARGET_TEAMS_DISTRIBUTE_SIMD_CLAUSE +#define OPENMP_TARGET_TEAMS_DISTRIBUTE_SIMD_CLAUSE(Name) +#endif // OpenMP directives. OPENMP_DIRECTIVE(threadprivate) @@ -218,6 +221,7 @@ OPENMP_DIRECTIVE_EXT(target_teams, "target teams") OPENMP_DIRECTIVE_EXT(target_teams_distribute, "target teams distribute") OPENMP_DIRECTIVE_EXT(target_teams_distribute_parallel_for, "target teams distribute parallel for") OPENMP_DIRECTIVE_EXT(target_teams_distribute_parallel_for_simd, "target teams distribute parallel for simd") +OPENMP_DIRECTIVE_EXT(target_teams_distribute_simd, "target teams distribute simd") // OpenMP clauses. OPENMP_CLAUSE(if, OMPIfClause) @@ -446,7 +450,6 @@ OPENMP_TARGET_CLAUSE(firstprivate) OPENMP_TARGET_CLAUSE(is_device_ptr) // Clauses allowed for OpenMP directive 'target data'. -// TODO More clauses for 'target data' directive. OPENMP_TARGET_DATA_CLAUSE(if) OPENMP_TARGET_DATA_CLAUSE(device) OPENMP_TARGET_DATA_CLAUSE(map) @@ -483,7 +486,6 @@ OPENMP_TARGET_PARALLEL_CLAUSE(reduction) OPENMP_TARGET_PARALLEL_CLAUSE(is_device_ptr) // Clauses allowed for OpenMP directive 'target parallel for'. -// TODO: add target clauses 'is_device_ptr' OPENMP_TARGET_PARALLEL_FOR_CLAUSE(if) OPENMP_TARGET_PARALLEL_FOR_CLAUSE(device) OPENMP_TARGET_PARALLEL_FOR_CLAUSE(map) @@ -502,9 +504,9 @@ OPENMP_TARGET_PARALLEL_FOR_CLAUSE(collapse) OPENMP_TARGET_PARALLEL_FOR_CLAUSE(schedule) OPENMP_TARGET_PARALLEL_FOR_CLAUSE(ordered) OPENMP_TARGET_PARALLEL_FOR_CLAUSE(linear) +OPENMP_TARGET_PARALLEL_FOR_CLAUSE(is_device_ptr) // Clauses allowed for OpenMP directive 'target update'. -// TODO More clauses for 'target update' directive. OPENMP_TARGET_UPDATE_CLAUSE(if) OPENMP_TARGET_UPDATE_CLAUSE(device) OPENMP_TARGET_UPDATE_CLAUSE(to) @@ -513,7 +515,6 @@ OPENMP_TARGET_UPDATE_CLAUSE(nowait) OPENMP_TARGET_UPDATE_CLAUSE(depend) // Clauses allowed for OpenMP directive 'teams'. -// TODO More clauses for 'teams' directive. OPENMP_TEAMS_CLAUSE(default) OPENMP_TEAMS_CLAUSE(private) OPENMP_TEAMS_CLAUSE(firstprivate) @@ -523,7 +524,6 @@ OPENMP_TEAMS_CLAUSE(num_teams) OPENMP_TEAMS_CLAUSE(thread_limit) // Clauses allowed for OpenMP directive 'ordered'. -// TODO More clauses for 'ordered' directive. OPENMP_ORDERED_CLAUSE(threads) OPENMP_ORDERED_CLAUSE(simd) OPENMP_ORDERED_CLAUSE(depend) @@ -633,7 +633,6 @@ OPENMP_DISTRIBUTE_SIMD_CLAUSE(simdlen) OPENMP_DISTRIBUTE_SIMD_CLAUSE(reduction) // Clauses allowed for OpenMP directive 'target parallel for simd'. -// TODO: add target clauses 'is_device_ptr' OPENMP_TARGET_PARALLEL_FOR_SIMD_CLAUSE(if) OPENMP_TARGET_PARALLEL_FOR_SIMD_CLAUSE(device) OPENMP_TARGET_PARALLEL_FOR_SIMD_CLAUSE(map) @@ -655,6 +654,7 @@ OPENMP_TARGET_PARALLEL_FOR_SIMD_CLAUSE(linear) OPENMP_TARGET_PARALLEL_FOR_SIMD_CLAUSE(safelen) OPENMP_TARGET_PARALLEL_FOR_SIMD_CLAUSE(simdlen) OPENMP_TARGET_PARALLEL_FOR_SIMD_CLAUSE(aligned) +OPENMP_TARGET_PARALLEL_FOR_SIMD_CLAUSE(is_device_ptr) // Clauses allowed for OpenMP directive 'target simd'. OPENMP_TARGET_SIMD_CLAUSE(if) @@ -824,6 +824,28 @@ OPENMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_FOR_SIMD_CLAUSE(aligned) OPENMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_FOR_SIMD_CLAUSE(safelen) OPENMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_FOR_SIMD_CLAUSE(simdlen) +// Clauses allowed for OpenMP directive 'target teams distribute simd'. +OPENMP_TARGET_TEAMS_DISTRIBUTE_SIMD_CLAUSE(if) +OPENMP_TARGET_TEAMS_DISTRIBUTE_SIMD_CLAUSE(device) +OPENMP_TARGET_TEAMS_DISTRIBUTE_SIMD_CLAUSE(map) +OPENMP_TARGET_TEAMS_DISTRIBUTE_SIMD_CLAUSE(private) +OPENMP_TARGET_TEAMS_DISTRIBUTE_SIMD_CLAUSE(nowait) +OPENMP_TARGET_TEAMS_DISTRIBUTE_SIMD_CLAUSE(depend) +OPENMP_TARGET_TEAMS_DISTRIBUTE_SIMD_CLAUSE(defaultmap) +OPENMP_TARGET_TEAMS_DISTRIBUTE_SIMD_CLAUSE(firstprivate) +OPENMP_TARGET_TEAMS_DISTRIBUTE_SIMD_CLAUSE(lastprivate) +OPENMP_TARGET_TEAMS_DISTRIBUTE_SIMD_CLAUSE(is_device_ptr) +OPENMP_TARGET_TEAMS_DISTRIBUTE_SIMD_CLAUSE(shared) +OPENMP_TARGET_TEAMS_DISTRIBUTE_SIMD_CLAUSE(reduction) +OPENMP_TARGET_TEAMS_DISTRIBUTE_SIMD_CLAUSE(num_teams) +OPENMP_TARGET_TEAMS_DISTRIBUTE_SIMD_CLAUSE(thread_limit) +OPENMP_TARGET_TEAMS_DISTRIBUTE_SIMD_CLAUSE(collapse) +OPENMP_TARGET_TEAMS_DISTRIBUTE_SIMD_CLAUSE(dist_schedule) +OPENMP_TARGET_TEAMS_DISTRIBUTE_SIMD_CLAUSE(linear) +OPENMP_TARGET_TEAMS_DISTRIBUTE_SIMD_CLAUSE(aligned) +OPENMP_TARGET_TEAMS_DISTRIBUTE_SIMD_CLAUSE(safelen) +OPENMP_TARGET_TEAMS_DISTRIBUTE_SIMD_CLAUSE(simdlen) + #undef OPENMP_TASKLOOP_SIMD_CLAUSE #undef OPENMP_TASKLOOP_CLAUSE #undef OPENMP_LINEAR_KIND @@ -875,3 +897,4 @@ OPENMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_FOR_SIMD_CLAUSE(simdlen) #undef OPENMP_TARGET_TEAMS_DISTRIBUTE_CLAUSE #undef OPENMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_FOR_CLAUSE #undef OPENMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_FOR_SIMD_CLAUSE +#undef OPENMP_TARGET_TEAMS_DISTRIBUTE_SIMD_CLAUSE diff --git a/include/clang/Basic/StmtNodes.td b/include/clang/Basic/StmtNodes.td index 2e92e5006ff4..67a5ab773aa6 100644 --- a/include/clang/Basic/StmtNodes.td +++ b/include/clang/Basic/StmtNodes.td @@ -244,3 +244,4 @@ def OMPTargetTeamsDirective : DStmt<OMPExecutableDirective>; def OMPTargetTeamsDistributeDirective : DStmt<OMPLoopDirective>; def OMPTargetTeamsDistributeParallelForDirective : DStmt<OMPLoopDirective>; def OMPTargetTeamsDistributeParallelForSimdDirective : DStmt<OMPLoopDirective>; +def OMPTargetTeamsDistributeSimdDirective : DStmt<OMPLoopDirective>; diff --git a/include/clang/Driver/CLCompatOptions.td b/include/clang/Driver/CLCompatOptions.td index cb2745afb7e4..60048c49c0f7 100644 --- a/include/clang/Driver/CLCompatOptions.td +++ b/include/clang/Driver/CLCompatOptions.td @@ -27,7 +27,7 @@ class CLCompileFlag<string name> : Option<["/", "-"], name, KIND_FLAG>, Group<cl_compile_Group>, Flags<[CLOption, DriverOption]>; class CLIgnoredFlag<string name> : Option<["/", "-"], name, KIND_FLAG>, - Group<cl_ignored_Group>, Flags<[CLOption, DriverOption, HelpHidden]>; + Group<cl_ignored_Group>, Flags<[CLOption, DriverOption]>; class CLJoined<string name> : Option<["/", "-"], name, KIND_JOINED>, Group<cl_Group>, Flags<[CLOption, DriverOption]>; @@ -299,7 +299,7 @@ def _SLASH_d2Zi_PLUS : CLIgnoredFlag<"d2Zi+">; def _SLASH_errorReport : CLIgnoredJoined<"errorReport">; def _SLASH_FC : CLIgnoredFlag<"FC">; def _SLASH_Fd : CLIgnoredJoined<"Fd">; -def _SLASH_FS : CLIgnoredFlag<"FS">, HelpText<"Force synchronous PDB writes">; +def _SLASH_FS : CLIgnoredFlag<"FS">; def _SLASH_GF : CLIgnoredFlag<"GF">; def _SLASH_kernel_ : CLIgnoredFlag<"kernel-">; def _SLASH_nologo : CLIgnoredFlag<"nologo">; @@ -308,7 +308,8 @@ def _SLASH_openmp_ : CLIgnoredFlag<"openmp-">; def _SLASH_RTC : CLIgnoredJoined<"RTC">; def _SLASH_sdl : CLIgnoredFlag<"sdl">; def _SLASH_sdl_ : CLIgnoredFlag<"sdl-">; -def _SLASH_utf8 : CLIgnoredFlag<"utf-8">; +def _SLASH_utf8 : CLIgnoredFlag<"utf-8">, + HelpText<"Set source and runtime encoding to UTF-8 (default)">; def _SLASH_w : CLIgnoredJoined<"w">; def _SLASH_Zc_auto : CLIgnoredFlag<"Zc:auto">; def _SLASH_Zc_forScope : CLIgnoredFlag<"Zc:forScope">; diff --git a/include/clang/Driver/Options.td b/include/clang/Driver/Options.td index 7f4e59a2d233..6be159fad694 100644 --- a/include/clang/Driver/Options.td +++ b/include/clang/Driver/Options.td @@ -1032,6 +1032,7 @@ def fno_ms_extensions : Flag<["-"], "fno-ms-extensions">, Group<f_Group>, def fno_ms_compatibility : Flag<["-"], "fno-ms-compatibility">, Group<f_Group>, Flags<[CoreOption]>; def fno_delayed_template_parsing : Flag<["-"], "fno-delayed-template-parsing">, Group<f_Group>, + HelpText<"Disable delayed template parsing">, Flags<[DriverOption, CoreOption]>; def fno_objc_exceptions: Flag<["-"], "fno-objc-exceptions">, Group<f_Group>; def fno_objc_legacy_dispatch : Flag<["-"], "fno-objc-legacy-dispatch">, Group<f_Group>; diff --git a/include/clang/Index/IndexSymbol.h b/include/clang/Index/IndexSymbol.h index 559b212b9266..d19e5ebef2f0 100644 --- a/include/clang/Index/IndexSymbol.h +++ b/include/clang/Index/IndexSymbol.h @@ -64,6 +64,8 @@ enum class SymbolSubKind { None, CXXCopyConstructor, CXXMoveConstructor, + AccessorGetter, + AccessorSetter, }; /// Set of properties that provide additional info about a symbol. @@ -80,7 +82,7 @@ static const unsigned SymbolPropertyBitNum = 7; typedef unsigned SymbolPropertySet; /// Set of roles that are attributed to symbol occurrences. -enum class SymbolRole : uint16_t { +enum class SymbolRole : uint32_t { Declaration = 1 << 0, Definition = 1 << 1, Reference = 1 << 2, @@ -99,8 +101,10 @@ enum class SymbolRole : uint16_t { RelationCalledBy = 1 << 13, RelationExtendedBy = 1 << 14, RelationAccessorOf = 1 << 15, + RelationContainedBy = 1 << 16, + RelationIBTypeOf = 1 << 17, }; -static const unsigned SymbolRoleBitNum = 16; +static const unsigned SymbolRoleBitNum = 18; typedef unsigned SymbolRoleSet; /// Represents a relation to another symbol for a symbol occurrence. diff --git a/include/clang/Lex/HeaderSearch.h b/include/clang/Lex/HeaderSearch.h index 4df3e783117a..51983b9ab5d8 100644 --- a/include/clang/Lex/HeaderSearch.h +++ b/include/clang/Lex/HeaderSearch.h @@ -406,7 +406,8 @@ public: /// \return false if \#including the file will have no effect or true /// if we should include it. bool ShouldEnterIncludeFile(Preprocessor &PP, const FileEntry *File, - bool isImport, Module *CorrespondingModule); + bool isImport, bool ModulesEnabled, + Module *CorrespondingModule); /// \brief Return whether the specified file is a normal header, /// a system header, or a C++ friendly system header. diff --git a/include/clang/Lex/ModuleMap.h b/include/clang/Lex/ModuleMap.h index b3a2421af86e..46136725d87a 100644 --- a/include/clang/Lex/ModuleMap.h +++ b/include/clang/Lex/ModuleMap.h @@ -316,6 +316,14 @@ public: BuiltinIncludeDir = Dir; } + /// \brief Get the directory that contains Clang-supplied include files. + const DirectoryEntry *getBuiltinDir() const { + return BuiltinIncludeDir; + } + + /// \brief Is this a compiler builtin header? + static bool isBuiltinHeader(StringRef FileName); + /// \brief Add a module map callback. void addModuleMapCallbacks(std::unique_ptr<ModuleMapCallbacks> Callback) { Callbacks.push_back(std::move(Callback)); diff --git a/include/clang/Parse/Parser.h b/include/clang/Parse/Parser.h index 972f13daca46..fe159022c223 100644 --- a/include/clang/Parse/Parser.h +++ b/include/clang/Parse/Parser.h @@ -600,11 +600,8 @@ private: public: // If NeedType is true, then TryAnnotateTypeOrScopeToken will try harder to // find a type name by attempting typo correction. - bool TryAnnotateTypeOrScopeToken(bool EnteringContext = false, - bool NeedType = false); - bool TryAnnotateTypeOrScopeTokenAfterScopeSpec(bool EnteringContext, - bool NeedType, - CXXScopeSpec &SS, + bool TryAnnotateTypeOrScopeToken(); + bool TryAnnotateTypeOrScopeTokenAfterScopeSpec(CXXScopeSpec &SS, bool IsNewScope); bool TryAnnotateCXXScopeToken(bool EnteringContext = false); diff --git a/include/clang/Sema/Sema.h b/include/clang/Sema/Sema.h index d5e4b069f8b7..c180a8ea3ee1 100644 --- a/include/clang/Sema/Sema.h +++ b/include/clang/Sema/Sema.h @@ -1709,7 +1709,8 @@ public: static bool adjustContextForLocalExternDecl(DeclContext *&DC); void DiagnoseFunctionSpecifiers(const DeclSpec &DS); - void CheckShadow(Scope *S, VarDecl *D, const LookupResult& R); + NamedDecl *getShadowedDeclaration(const VarDecl *D, const LookupResult &R); + void CheckShadow(VarDecl *D, NamedDecl *ShadowedDecl, const LookupResult &R); void CheckShadow(Scope *S, VarDecl *D); /// Warn if 'E', which is an expression that is about to be modified, refers @@ -1790,9 +1791,8 @@ public: bool SetParamDefaultArgument(ParmVarDecl *Param, Expr *DefaultArg, SourceLocation EqualLoc); - void AddInitializerToDecl(Decl *dcl, Expr *init, bool DirectInit, - bool TypeMayContainAuto); - void ActOnUninitializedDecl(Decl *dcl, bool TypeMayContainAuto); + void AddInitializerToDecl(Decl *dcl, Expr *init, bool DirectInit); + void ActOnUninitializedDecl(Decl *dcl); void ActOnInitializerError(Decl *Dcl); bool canInitializeWithParenthesizedList(QualType TargetType); @@ -1807,8 +1807,7 @@ public: void FinalizeDeclaration(Decl *D); DeclGroupPtrTy FinalizeDeclaratorGroup(Scope *S, const DeclSpec &DS, ArrayRef<Decl *> Group); - DeclGroupPtrTy BuildDeclaratorGroup(MutableArrayRef<Decl *> Group, - bool TypeMayContainAuto = true); + DeclGroupPtrTy BuildDeclaratorGroup(MutableArrayRef<Decl *> Group); /// Should be called on all declarations that might have attached /// documentation comments. @@ -4920,8 +4919,7 @@ public: TypeSourceInfo *AllocTypeInfo, Expr *ArraySize, SourceRange DirectInitRange, - Expr *Initializer, - bool TypeMayContainAuto = true); + Expr *Initializer); bool CheckAllocatedType(QualType AllocType, SourceLocation Loc, SourceRange R); @@ -8584,6 +8582,12 @@ public: ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc, SourceLocation EndLoc, llvm::DenseMap<ValueDecl *, Expr *> &VarsWithImplicitDSA); + /// Called on well-formed '\#pragma omp target teams distribute simd' after + /// parsing of the associated statement. + StmtResult ActOnOpenMPTargetTeamsDistributeSimdDirective( + ArrayRef<OMPClause *> Clauses, Stmt *AStmt, SourceLocation StartLoc, + SourceLocation EndLoc, + llvm::DenseMap<ValueDecl *, Expr *> &VarsWithImplicitDSA); /// Checks correctness of linear modifiers. bool CheckOpenMPLinearModifier(OpenMPLinearClauseKind LinKind, diff --git a/include/clang/Serialization/ASTBitCodes.h b/include/clang/Serialization/ASTBitCodes.h index 61e2f18045ea..acbd6d1deb5b 100644 --- a/include/clang/Serialization/ASTBitCodes.h +++ b/include/clang/Serialization/ASTBitCodes.h @@ -1517,6 +1517,7 @@ namespace clang { STMT_OMP_TARGET_TEAMS_DISTRIBUTE_DIRECTIVE, STMT_OMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_FOR_DIRECTIVE, STMT_OMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_FOR_SIMD_DIRECTIVE, + STMT_OMP_TARGET_TEAMS_DISTRIBUTE_SIMD_DIRECTIVE, EXPR_OMP_ARRAY_SECTION, // ARC |