aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--LICENSE.TXT257
-rw-r--r--include/clang-c/BuildSystem.h8
-rw-r--r--include/clang-c/CXCompilationDatabase.h8
-rw-r--r--include/clang-c/CXErrorCode.h8
-rw-r--r--include/clang-c/CXString.h8
-rw-r--r--include/clang-c/Documentation.h8
-rw-r--r--include/clang-c/Index.h65
-rw-r--r--include/clang-c/Platform.h8
-rw-r--r--include/clang/ARCMigrate/ARCMT.h7
-rw-r--r--include/clang/ARCMigrate/ARCMTActions.h7
-rw-r--r--include/clang/ARCMigrate/FileRemapper.h7
-rw-r--r--include/clang/AST/APValue.h245
-rw-r--r--include/clang/AST/AST.h7
-rw-r--r--include/clang/AST/ASTConsumer.h7
-rw-r--r--include/clang/AST/ASTContext.h162
-rw-r--r--include/clang/AST/ASTContextAllocate.h7
-rw-r--r--include/clang/AST/ASTDiagnostic.h7
-rw-r--r--include/clang/AST/ASTDumper.h56
-rw-r--r--include/clang/AST/ASTDumperUtils.h13
-rw-r--r--include/clang/AST/ASTFwd.h7
-rw-r--r--include/clang/AST/ASTImporter.h290
-rw-r--r--include/clang/AST/ASTImporterLookupTable.h7
-rw-r--r--include/clang/AST/ASTImporterSharedState.h81
-rw-r--r--include/clang/AST/ASTLambda.h7
-rw-r--r--include/clang/AST/ASTMutationListener.h12
-rw-r--r--include/clang/AST/ASTNodeTraverser.h654
-rw-r--r--include/clang/AST/ASTStructuralEquivalence.h11
-rw-r--r--include/clang/AST/ASTTypeTraits.h31
-rw-r--r--include/clang/AST/ASTUnresolvedSet.h7
-rw-r--r--include/clang/AST/ASTVector.h7
-rw-r--r--include/clang/AST/Attr.h7
-rw-r--r--include/clang/AST/AttrIterator.h7
-rw-r--r--include/clang/AST/AttrVisitor.h7
-rw-r--r--include/clang/AST/Availability.h7
-rw-r--r--include/clang/AST/BaseSubobject.h12
-rw-r--r--include/clang/AST/BuiltinTypes.def7
-rw-r--r--include/clang/AST/CXXInheritance.h7
-rw-r--r--include/clang/AST/CanonicalType.h9
-rw-r--r--include/clang/AST/CharUnits.h11
-rw-r--r--include/clang/AST/Comment.h7
-rw-r--r--include/clang/AST/CommentBriefParser.h7
-rw-r--r--include/clang/AST/CommentCommandTraits.h7
-rw-r--r--include/clang/AST/CommentDiagnostic.h7
-rw-r--r--include/clang/AST/CommentLexer.h7
-rw-r--r--include/clang/AST/CommentParser.h7
-rw-r--r--include/clang/AST/CommentSema.h7
-rw-r--r--include/clang/AST/CommentVisitor.h7
-rw-r--r--include/clang/AST/ComparisonCategories.h7
-rw-r--r--include/clang/AST/CurrentSourceLocExprScope.h75
-rw-r--r--include/clang/AST/DataCollection.h7
-rw-r--r--include/clang/AST/Decl.h158
-rw-r--r--include/clang/AST/DeclAccessPair.h15
-rw-r--r--include/clang/AST/DeclBase.h71
-rw-r--r--include/clang/AST/DeclCXX.h289
-rw-r--r--include/clang/AST/DeclContextInternals.h12
-rw-r--r--include/clang/AST/DeclFriend.h7
-rw-r--r--include/clang/AST/DeclGroup.h7
-rw-r--r--include/clang/AST/DeclLookups.h7
-rw-r--r--include/clang/AST/DeclObjC.h7
-rw-r--r--include/clang/AST/DeclOpenMP.h216
-rw-r--r--include/clang/AST/DeclTemplate.h211
-rw-r--r--include/clang/AST/DeclVisitor.h7
-rw-r--r--include/clang/AST/DeclarationName.h30
-rw-r--r--include/clang/AST/DependentDiagnostic.h7
-rw-r--r--include/clang/AST/EvaluatedExprVisitor.h7
-rw-r--r--include/clang/AST/Expr.h798
-rw-r--r--include/clang/AST/ExprCXX.h321
-rw-r--r--include/clang/AST/ExprObjC.h87
-rw-r--r--include/clang/AST/ExprOpenMP.h11
-rw-r--r--include/clang/AST/ExternalASTMerger.h7
-rw-r--r--include/clang/AST/ExternalASTSource.h7
-rw-r--r--include/clang/AST/FormatString.h11
-rw-r--r--include/clang/AST/GlobalDecl.h43
-rw-r--r--include/clang/AST/JSONNodeDumper.h425
-rw-r--r--include/clang/AST/LambdaCapture.h7
-rw-r--r--include/clang/AST/LexicallyOrderedRecursiveASTVisitor.h7
-rw-r--r--include/clang/AST/LocInfoType.h7
-rw-r--r--include/clang/AST/Mangle.h20
-rw-r--r--include/clang/AST/MangleNumberingContext.h7
-rw-r--r--include/clang/AST/NSAPI.h7
-rw-r--r--include/clang/AST/NestedNameSpecifier.h7
-rw-r--r--include/clang/AST/NonTrivialTypeVisitor.h7
-rw-r--r--include/clang/AST/ODRHash.h7
-rw-r--r--include/clang/AST/OSLog.h7
-rw-r--r--include/clang/AST/OpenMPClause.h1377
-rw-r--r--include/clang/AST/OperationKinds.def19
-rw-r--r--include/clang/AST/OperationKinds.h7
-rw-r--r--include/clang/AST/ParentMap.h7
-rw-r--r--include/clang/AST/PrettyDeclStackTrace.h7
-rw-r--r--include/clang/AST/PrettyPrinter.h7
-rw-r--r--include/clang/AST/QualTypeNames.h5
-rw-r--r--include/clang/AST/RawCommentList.h7
-rw-r--r--include/clang/AST/RecordLayout.h7
-rw-r--r--include/clang/AST/RecursiveASTVisitor.h72
-rw-r--r--include/clang/AST/Redeclarable.h14
-rw-r--r--include/clang/AST/SelectorLocationsKind.h7
-rw-r--r--include/clang/AST/Stmt.h359
-rw-r--r--include/clang/AST/StmtCXX.h36
-rw-r--r--include/clang/AST/StmtDataCollectors.td4
-rw-r--r--include/clang/AST/StmtGraphTraits.h7
-rw-r--r--include/clang/AST/StmtIterator.h7
-rw-r--r--include/clang/AST/StmtObjC.h35
-rw-r--r--include/clang/AST/StmtOpenMP.h88
-rw-r--r--include/clang/AST/StmtVisitor.h7
-rw-r--r--include/clang/AST/TemplateArgumentVisitor.h7
-rw-r--r--include/clang/AST/TemplateBase.h7
-rw-r--r--include/clang/AST/TemplateName.h29
-rw-r--r--include/clang/AST/TextNodeDumper.h71
-rw-r--r--include/clang/AST/Type.h153
-rw-r--r--include/clang/AST/TypeLoc.h45
-rw-r--r--include/clang/AST/TypeLocNodes.def7
-rw-r--r--include/clang/AST/TypeLocVisitor.h7
-rw-r--r--include/clang/AST/TypeNodes.def8
-rw-r--r--include/clang/AST/TypeOrdering.h7
-rw-r--r--include/clang/AST/TypeVisitor.h7
-rw-r--r--include/clang/AST/UnresolvedSet.h7
-rw-r--r--include/clang/AST/VTTBuilder.h7
-rw-r--r--include/clang/AST/VTableBuilder.h7
-rw-r--r--include/clang/ASTMatchers/ASTMatchFinder.h7
-rw-r--r--include/clang/ASTMatchers/ASTMatchers.h429
-rw-r--r--include/clang/ASTMatchers/ASTMatchersInternal.h31
-rw-r--r--include/clang/ASTMatchers/ASTMatchersMacros.h7
-rw-r--r--include/clang/ASTMatchers/Dynamic/Diagnostics.h7
-rw-r--r--include/clang/ASTMatchers/Dynamic/Parser.h7
-rw-r--r--include/clang/ASTMatchers/Dynamic/Registry.h7
-rw-r--r--include/clang/ASTMatchers/Dynamic/VariantValue.h7
-rw-r--r--include/clang/Analysis/Analyses/CFGReachabilityAnalysis.h7
-rw-r--r--include/clang/Analysis/Analyses/Consumed.h7
-rw-r--r--include/clang/Analysis/Analyses/Dominators.h315
-rw-r--r--include/clang/Analysis/Analyses/ExprMutationAnalyzer.h7
-rw-r--r--include/clang/Analysis/Analyses/LiveVariables.h7
-rw-r--r--include/clang/Analysis/Analyses/PostOrderCFGView.h7
-rw-r--r--include/clang/Analysis/Analyses/ReachableCode.h7
-rw-r--r--include/clang/Analysis/Analyses/ThreadSafety.h19
-rw-r--r--include/clang/Analysis/Analyses/ThreadSafetyCommon.h7
-rw-r--r--include/clang/Analysis/Analyses/ThreadSafetyLogical.h7
-rw-r--r--include/clang/Analysis/Analyses/ThreadSafetyOps.def7
-rw-r--r--include/clang/Analysis/Analyses/ThreadSafetyTIL.h9
-rw-r--r--include/clang/Analysis/Analyses/ThreadSafetyTraverse.h7
-rw-r--r--include/clang/Analysis/Analyses/ThreadSafetyUtil.h7
-rw-r--r--include/clang/Analysis/Analyses/UninitializedValues.h7
-rw-r--r--include/clang/Analysis/AnalysisDeclContext.h20
-rw-r--r--include/clang/Analysis/AnalysisDiagnostic.h7
-rw-r--r--include/clang/Analysis/AnyCall.h209
-rw-r--r--include/clang/Analysis/BodyFarm.h7
-rw-r--r--include/clang/Analysis/CFG.h113
-rw-r--r--include/clang/Analysis/CFGStmtMap.h7
-rw-r--r--include/clang/Analysis/CallGraph.h7
-rw-r--r--include/clang/Analysis/CloneDetection.h7
-rw-r--r--include/clang/Analysis/CodeInjector.h7
-rw-r--r--include/clang/Analysis/ConstructionContext.h7
-rw-r--r--include/clang/Analysis/DomainSpecific/CocoaConventions.h7
-rw-r--r--include/clang/Analysis/DomainSpecific/ObjCNoReturn.h7
-rw-r--r--include/clang/Analysis/FlowSensitive/DataflowValues.h7
-rw-r--r--include/clang/Analysis/ProgramPoint.h19
-rw-r--r--include/clang/Analysis/RetainSummaryManager.h (renamed from include/clang/StaticAnalyzer/Core/RetainSummaryManager.h)153
-rw-r--r--include/clang/Analysis/SelectorExtras.h7
-rw-r--r--include/clang/Analysis/Support/BumpVector.h7
-rw-r--r--include/clang/Basic/ABI.h7
-rw-r--r--include/clang/Basic/AddressSpaces.h7
-rw-r--r--include/clang/Basic/AlignedAllocation.h7
-rw-r--r--include/clang/Basic/AllDiagnostics.h7
-rw-r--r--include/clang/Basic/Attr.td165
-rw-r--r--include/clang/Basic/AttrDocs.td404
-rw-r--r--include/clang/Basic/AttrKinds.h7
-rw-r--r--include/clang/Basic/AttrSubjectMatchRules.h7
-rw-r--r--include/clang/Basic/Attributes.h7
-rw-r--r--include/clang/Basic/BitmaskEnum.h7
-rw-r--r--include/clang/Basic/Builtins.def59
-rw-r--r--include/clang/Basic/Builtins.h13
-rw-r--r--include/clang/Basic/BuiltinsAArch64.def42
-rw-r--r--include/clang/Basic/BuiltinsAMDGPU.def60
-rw-r--r--include/clang/Basic/BuiltinsARM.def15
-rw-r--r--include/clang/Basic/BuiltinsHexagon.def7
-rw-r--r--include/clang/Basic/BuiltinsLe64.def7
-rw-r--r--include/clang/Basic/BuiltinsMips.def7
-rw-r--r--include/clang/Basic/BuiltinsNEON.def7
-rw-r--r--include/clang/Basic/BuiltinsNVPTX.def65
-rw-r--r--include/clang/Basic/BuiltinsPPC.def13
-rw-r--r--include/clang/Basic/BuiltinsSystemZ.def22
-rw-r--r--include/clang/Basic/BuiltinsWebAssembly.def18
-rw-r--r--include/clang/Basic/BuiltinsX86.def880
-rw-r--r--include/clang/Basic/BuiltinsX86_64.def111
-rw-r--r--include/clang/Basic/BuiltinsXCore.def7
-rw-r--r--include/clang/Basic/CapturedStmt.h7
-rw-r--r--include/clang/Basic/CharInfo.h7
-rw-r--r--include/clang/Basic/CodeGenOptions.def11
-rw-r--r--include/clang/Basic/CodeGenOptions.h46
-rw-r--r--include/clang/Basic/CommentOptions.h7
-rw-r--r--include/clang/Basic/Cuda.h31
-rw-r--r--include/clang/Basic/DebugInfoOptions.h7
-rw-r--r--include/clang/Basic/DeclNodes.td3
-rw-r--r--include/clang/Basic/Diagnostic.h26
-rw-r--r--include/clang/Basic/Diagnostic.td7
-rw-r--r--include/clang/Basic/DiagnosticAST.h7
-rw-r--r--include/clang/Basic/DiagnosticASTKinds.td156
-rw-r--r--include/clang/Basic/DiagnosticAnalysis.h7
-rw-r--r--include/clang/Basic/DiagnosticAnalysisKinds.td7
-rw-r--r--include/clang/Basic/DiagnosticCategories.h7
-rw-r--r--include/clang/Basic/DiagnosticCategories.td7
-rw-r--r--include/clang/Basic/DiagnosticComment.h7
-rw-r--r--include/clang/Basic/DiagnosticCommentKinds.td7
-rw-r--r--include/clang/Basic/DiagnosticCommonKinds.td26
-rw-r--r--include/clang/Basic/DiagnosticCrossTU.h7
-rw-r--r--include/clang/Basic/DiagnosticCrossTUKinds.td7
-rw-r--r--include/clang/Basic/DiagnosticDocs.td7
-rw-r--r--include/clang/Basic/DiagnosticDriver.h7
-rw-r--r--include/clang/Basic/DiagnosticDriverKinds.td62
-rw-r--r--include/clang/Basic/DiagnosticError.h7
-rw-r--r--include/clang/Basic/DiagnosticFrontend.h7
-rw-r--r--include/clang/Basic/DiagnosticFrontendKinds.td27
-rw-r--r--include/clang/Basic/DiagnosticGroups.td41
-rw-r--r--include/clang/Basic/DiagnosticIDs.h19
-rw-r--r--include/clang/Basic/DiagnosticLex.h7
-rw-r--r--include/clang/Basic/DiagnosticLexKinds.td61
-rw-r--r--include/clang/Basic/DiagnosticOptions.def7
-rw-r--r--include/clang/Basic/DiagnosticOptions.h7
-rw-r--r--include/clang/Basic/DiagnosticParse.h7
-rw-r--r--include/clang/Basic/DiagnosticParseKinds.td78
-rw-r--r--include/clang/Basic/DiagnosticRefactoring.h7
-rw-r--r--include/clang/Basic/DiagnosticRefactoringKinds.td7
-rw-r--r--include/clang/Basic/DiagnosticSema.h7
-rw-r--r--include/clang/Basic/DiagnosticSemaKinds.td483
-rw-r--r--include/clang/Basic/DiagnosticSerialization.h7
-rw-r--r--include/clang/Basic/DiagnosticSerializationKinds.td11
-rw-r--r--include/clang/Basic/ExceptionSpecificationType.h11
-rw-r--r--include/clang/Basic/ExpressionTraits.h7
-rw-r--r--include/clang/Basic/Features.def17
-rw-r--r--include/clang/Basic/FileManager.h26
-rw-r--r--include/clang/Basic/FileSystemOptions.h7
-rw-r--r--include/clang/Basic/FileSystemStatCache.h68
-rw-r--r--include/clang/Basic/FixedPoint.h88
-rw-r--r--include/clang/Basic/IdentifierTable.h10
-rw-r--r--include/clang/Basic/JsonSupport.h119
-rw-r--r--include/clang/Basic/LLVM.h7
-rw-r--r--include/clang/Basic/Lambda.h7
-rw-r--r--include/clang/Basic/LangOptions.def37
-rw-r--r--include/clang/Basic/LangOptions.h14
-rw-r--r--include/clang/Basic/Linkage.h7
-rw-r--r--include/clang/Basic/MSP430Target.def7
-rw-r--r--include/clang/Basic/MacroBuilder.h7
-rw-r--r--include/clang/Basic/MemoryBufferCache.h80
-rw-r--r--include/clang/Basic/Module.h19
-rw-r--r--include/clang/Basic/ObjCRuntime.h40
-rw-r--r--include/clang/Basic/OpenCLExtensionTypes.def7
-rw-r--r--include/clang/Basic/OpenCLExtensions.def13
-rw-r--r--include/clang/Basic/OpenCLImageTypes.def7
-rw-r--r--include/clang/Basic/OpenCLOptions.h36
-rw-r--r--include/clang/Basic/OpenMPKinds.def73
-rw-r--r--include/clang/Basic/OpenMPKinds.h23
-rw-r--r--include/clang/Basic/OperatorKinds.def7
-rw-r--r--include/clang/Basic/OperatorKinds.h7
-rw-r--r--include/clang/Basic/OperatorPrecedence.h7
-rw-r--r--include/clang/Basic/PartialDiagnostic.h8
-rw-r--r--include/clang/Basic/PlistSupport.h13
-rw-r--r--include/clang/Basic/PragmaKinds.h7
-rw-r--r--include/clang/Basic/PrettyStackTrace.h7
-rw-r--r--include/clang/Basic/SanitizerBlacklist.h7
-rw-r--r--include/clang/Basic/SanitizerSpecialCaseList.h7
-rw-r--r--include/clang/Basic/Sanitizers.def27
-rw-r--r--include/clang/Basic/Sanitizers.h154
-rw-r--r--include/clang/Basic/SourceLocation.h24
-rw-r--r--include/clang/Basic/SourceManager.h65
-rw-r--r--include/clang/Basic/SourceManagerInternals.h7
-rw-r--r--include/clang/Basic/Specifiers.h36
-rw-r--r--include/clang/Basic/Stack.h7
-rw-r--r--include/clang/Basic/StmtNodes.td12
-rw-r--r--include/clang/Basic/SyncScope.h9
-rw-r--r--include/clang/Basic/TargetBuiltins.h7
-rw-r--r--include/clang/Basic/TargetCXXABI.h7
-rw-r--r--include/clang/Basic/TargetInfo.h212
-rw-r--r--include/clang/Basic/TargetOptions.h12
-rw-r--r--include/clang/Basic/TemplateKinds.h20
-rw-r--r--include/clang/Basic/TokenKinds.def63
-rw-r--r--include/clang/Basic/TokenKinds.h9
-rw-r--r--include/clang/Basic/TypeTraits.h7
-rw-r--r--include/clang/Basic/Version.h7
-rw-r--r--include/clang/Basic/Visibility.h7
-rw-r--r--include/clang/Basic/X86Target.def17
-rw-r--r--include/clang/Basic/XRayInstr.h7
-rw-r--r--include/clang/Basic/XRayLists.h7
-rw-r--r--include/clang/Basic/arm_fp16.td7
-rw-r--r--include/clang/Basic/arm_neon.td59
-rw-r--r--include/clang/Basic/arm_neon_incl.td7
-rw-r--r--include/clang/CodeGen/BackendUtil.h7
-rw-r--r--include/clang/CodeGen/CGFunctionInfo.h54
-rw-r--r--include/clang/CodeGen/CodeGenABITypes.h64
-rw-r--r--include/clang/CodeGen/CodeGenAction.h7
-rw-r--r--include/clang/CodeGen/ConstantInitBuilder.h7
-rw-r--r--include/clang/CodeGen/ConstantInitFuture.h7
-rw-r--r--include/clang/CodeGen/ModuleBuilder.h7
-rw-r--r--include/clang/CodeGen/ObjectFilePCHContainerOperations.h7
-rw-r--r--include/clang/CodeGen/SwiftCallingConv.h7
-rw-r--r--include/clang/CrossTU/CrossTUDiagnostic.h7
-rw-r--r--include/clang/CrossTU/CrossTranslationUnit.h67
-rw-r--r--include/clang/DirectoryWatcher/DirectoryWatcher.h122
-rw-r--r--include/clang/Driver/Action.h7
-rw-r--r--include/clang/Driver/CC1Options.td78
-rw-r--r--include/clang/Driver/CLCompatOptions.td117
-rw-r--r--include/clang/Driver/ClangOptionDocs.td7
-rw-r--r--include/clang/Driver/Compilation.h7
-rw-r--r--include/clang/Driver/DarwinSDKInfo.h7
-rw-r--r--include/clang/Driver/Distro.h13
-rw-r--r--include/clang/Driver/Driver.h24
-rw-r--r--include/clang/Driver/DriverDiagnostic.h7
-rw-r--r--include/clang/Driver/Job.h7
-rw-r--r--include/clang/Driver/Multilib.h14
-rw-r--r--include/clang/Driver/Options.h7
-rw-r--r--include/clang/Driver/Options.td131
-rw-r--r--include/clang/Driver/Phases.h7
-rw-r--r--include/clang/Driver/SanitizerArgs.h12
-rw-r--r--include/clang/Driver/Tool.h7
-rw-r--r--include/clang/Driver/ToolChain.h44
-rw-r--r--include/clang/Driver/Types.def8
-rw-r--r--include/clang/Driver/Types.h7
-rw-r--r--include/clang/Driver/Util.h7
-rw-r--r--include/clang/Driver/XRayArgs.h7
-rw-r--r--include/clang/Edit/Commit.h7
-rw-r--r--include/clang/Edit/EditedSource.h7
-rw-r--r--include/clang/Edit/EditsReceiver.h7
-rw-r--r--include/clang/Edit/FileOffset.h7
-rw-r--r--include/clang/Edit/Rewriters.h7
-rw-r--r--include/clang/Format/Format.h234
-rw-r--r--include/clang/Frontend/ASTConsumers.h16
-rw-r--r--include/clang/Frontend/ASTUnit.h41
-rw-r--r--include/clang/Frontend/ChainedDiagnosticConsumer.h7
-rw-r--r--include/clang/Frontend/CommandLineSourceLoc.h7
-rw-r--r--include/clang/Frontend/CompilerInstance.h42
-rw-r--r--include/clang/Frontend/CompilerInvocation.h7
-rw-r--r--include/clang/Frontend/DependencyOutputOptions.h7
-rw-r--r--include/clang/Frontend/DiagnosticRenderer.h7
-rw-r--r--include/clang/Frontend/FrontendAction.h11
-rw-r--r--include/clang/Frontend/FrontendActions.h44
-rw-r--r--include/clang/Frontend/FrontendDiagnostic.h7
-rw-r--r--include/clang/Frontend/FrontendOptions.h47
-rw-r--r--include/clang/Frontend/FrontendPluginRegistry.h7
-rw-r--r--include/clang/Frontend/LangStandard.h31
-rw-r--r--include/clang/Frontend/LangStandards.def20
-rw-r--r--include/clang/Frontend/LayoutOverrideSource.h7
-rw-r--r--include/clang/Frontend/LogDiagnosticPrinter.h7
-rw-r--r--include/clang/Frontend/MigratorOptions.h7
-rw-r--r--include/clang/Frontend/MultiplexConsumer.h7
-rw-r--r--include/clang/Frontend/PCHContainerOperations.h7
-rw-r--r--include/clang/Frontend/PrecompiledPreamble.h12
-rw-r--r--include/clang/Frontend/PreprocessorOutputOptions.h7
-rw-r--r--include/clang/Frontend/SerializedDiagnosticPrinter.h9
-rw-r--r--include/clang/Frontend/SerializedDiagnosticReader.h9
-rw-r--r--include/clang/Frontend/SerializedDiagnostics.h9
-rw-r--r--include/clang/Frontend/TextDiagnostic.h7
-rw-r--r--include/clang/Frontend/TextDiagnosticBuffer.h7
-rw-r--r--include/clang/Frontend/TextDiagnosticPrinter.h7
-rw-r--r--include/clang/Frontend/Utils.h63
-rw-r--r--include/clang/Frontend/VerifyDiagnosticConsumer.h51
-rw-r--r--include/clang/FrontendTool/Utils.h7
-rw-r--r--include/clang/Index/CodegenNameGenerator.h10
-rw-r--r--include/clang/Index/CommentToXML.h7
-rw-r--r--include/clang/Index/DeclOccurrence.h41
-rw-r--r--include/clang/Index/IndexDataConsumer.h7
-rw-r--r--include/clang/Index/IndexSymbol.h13
-rw-r--r--include/clang/Index/IndexingAction.h10
-rw-r--r--include/clang/Index/USRGeneration.h7
-rw-r--r--include/clang/Lex/CodeCompletionHandler.h7
-rw-r--r--include/clang/Lex/DependencyDirectivesSourceMinimizer.h88
-rw-r--r--include/clang/Lex/DirectoryLookup.h14
-rw-r--r--include/clang/Lex/ExternalPreprocessorSource.h7
-rw-r--r--include/clang/Lex/HeaderMap.h7
-rw-r--r--include/clang/Lex/HeaderMapTypes.h7
-rw-r--r--include/clang/Lex/HeaderSearch.h55
-rw-r--r--include/clang/Lex/HeaderSearchOptions.h7
-rw-r--r--include/clang/Lex/LexDiagnostic.h7
-rw-r--r--include/clang/Lex/Lexer.h9
-rw-r--r--include/clang/Lex/LiteralSupport.h7
-rw-r--r--include/clang/Lex/MacroArgs.h20
-rw-r--r--include/clang/Lex/MacroInfo.h7
-rw-r--r--include/clang/Lex/ModuleLoader.h7
-rw-r--r--include/clang/Lex/ModuleMap.h23
-rw-r--r--include/clang/Lex/MultipleIncludeOpt.h7
-rw-r--r--include/clang/Lex/PPCallbacks.h59
-rw-r--r--include/clang/Lex/PPConditionalDirectiveRecord.h7
-rw-r--r--include/clang/Lex/Pragma.h20
-rw-r--r--include/clang/Lex/PreprocessingRecord.h7
-rw-r--r--include/clang/Lex/Preprocessor.h237
-rw-r--r--include/clang/Lex/PreprocessorLexer.h16
-rw-r--r--include/clang/Lex/PreprocessorOptions.h7
-rw-r--r--include/clang/Lex/ScratchBuffer.h7
-rw-r--r--include/clang/Lex/Token.h33
-rw-r--r--include/clang/Lex/TokenConcatenation.h7
-rw-r--r--include/clang/Lex/TokenLexer.h19
-rw-r--r--include/clang/Lex/VariadicMacroSupport.h33
-rw-r--r--include/clang/Parse/LoopHint.h7
-rw-r--r--include/clang/Parse/ParseAST.h7
-rw-r--r--include/clang/Parse/ParseDiagnostic.h7
-rw-r--r--include/clang/Parse/Parser.h176
-rw-r--r--include/clang/Parse/RAIIObjectsForParser.h7
-rw-r--r--include/clang/Rewrite/Core/DeltaTree.h7
-rw-r--r--include/clang/Rewrite/Core/HTMLRewrite.h7
-rw-r--r--include/clang/Rewrite/Core/RewriteBuffer.h7
-rw-r--r--include/clang/Rewrite/Core/RewriteRope.h7
-rw-r--r--include/clang/Rewrite/Core/Rewriter.h25
-rw-r--r--include/clang/Rewrite/Core/TokenRewriter.h7
-rw-r--r--include/clang/Rewrite/Frontend/ASTConsumers.h7
-rw-r--r--include/clang/Rewrite/Frontend/FixItRewriter.h7
-rw-r--r--include/clang/Rewrite/Frontend/FrontendActions.h7
-rw-r--r--include/clang/Rewrite/Frontend/Rewriters.h7
-rw-r--r--include/clang/Sema/AnalysisBasedWarnings.h9
-rw-r--r--include/clang/Sema/CXXFieldCollector.h7
-rw-r--r--include/clang/Sema/CleanupInfo.h7
-rw-r--r--include/clang/Sema/CodeCompleteConsumer.h30
-rw-r--r--include/clang/Sema/CodeCompleteOptions.h7
-rw-r--r--include/clang/Sema/DeclSpec.h86
-rw-r--r--include/clang/Sema/DelayedDiagnostic.h7
-rw-r--r--include/clang/Sema/Designator.h7
-rw-r--r--include/clang/Sema/ExternalSemaSource.h7
-rw-r--r--include/clang/Sema/IdentifierResolver.h7
-rw-r--r--include/clang/Sema/Initialization.h23
-rw-r--r--include/clang/Sema/Lookup.h26
-rw-r--r--include/clang/Sema/MultiplexExternalSemaSource.h7
-rw-r--r--include/clang/Sema/ObjCMethodList.h7
-rw-r--r--include/clang/Sema/Overload.h53
-rw-r--r--include/clang/Sema/Ownership.h10
-rw-r--r--include/clang/Sema/ParsedAttr.h82
-rw-r--r--include/clang/Sema/ParsedTemplate.h7
-rw-r--r--include/clang/Sema/Scope.h10
-rw-r--r--include/clang/Sema/ScopeInfo.h220
-rw-r--r--include/clang/Sema/Sema.h825
-rw-r--r--include/clang/Sema/SemaConsumer.h7
-rw-r--r--include/clang/Sema/SemaDiagnostic.h7
-rw-r--r--include/clang/Sema/SemaFixItUtils.h7
-rw-r--r--include/clang/Sema/SemaInternal.h46
-rw-r--r--include/clang/Sema/SemaLambda.h7
-rw-r--r--include/clang/Sema/Template.h17
-rw-r--r--include/clang/Sema/TemplateDeduction.h7
-rw-r--r--include/clang/Sema/TemplateInstCallback.h7
-rw-r--r--include/clang/Sema/TypoCorrection.h38
-rw-r--r--include/clang/Sema/Weak.h7
-rw-r--r--include/clang/Serialization/ASTBitCodes.h33
-rw-r--r--include/clang/Serialization/ASTDeserializationListener.h7
-rw-r--r--include/clang/Serialization/ASTReader.h44
-rw-r--r--include/clang/Serialization/ASTWriter.h29
-rw-r--r--include/clang/Serialization/ContinuousRangeMap.h11
-rw-r--r--include/clang/Serialization/GlobalModuleIndex.h31
-rw-r--r--include/clang/Serialization/InMemoryModuleCache.h107
-rw-r--r--include/clang/Serialization/Module.h11
-rw-r--r--include/clang/Serialization/ModuleFileExtension.h7
-rw-r--r--include/clang/Serialization/ModuleManager.h15
-rw-r--r--include/clang/Serialization/PCHContainerOperations.h7
-rw-r--r--include/clang/Serialization/SerializationDiagnostic.h7
-rw-r--r--include/clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h15
-rw-r--r--include/clang/StaticAnalyzer/Checkers/CheckerBase.td101
-rw-r--r--include/clang/StaticAnalyzer/Checkers/Checkers.td662
-rw-r--r--include/clang/StaticAnalyzer/Checkers/LocalCheckers.h7
-rw-r--r--include/clang/StaticAnalyzer/Checkers/MPIFunctionClassifier.h7
-rw-r--r--include/clang/StaticAnalyzer/Checkers/SValExplainer.h7
-rw-r--r--include/clang/StaticAnalyzer/Core/Analyses.def7
-rw-r--r--include/clang/StaticAnalyzer/Core/AnalyzerOptions.def28
-rw-r--r--include/clang/StaticAnalyzer/Core/AnalyzerOptions.h116
-rw-r--r--include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h86
-rw-r--r--include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h84
-rw-r--r--include/clang/StaticAnalyzer/Core/BugReporter/BugType.h18
-rw-r--r--include/clang/StaticAnalyzer/Core/BugReporter/CommonBugCategories.h7
-rw-r--r--include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h33
-rw-r--r--include/clang/StaticAnalyzer/Core/Checker.h13
-rw-r--r--include/clang/StaticAnalyzer/Core/CheckerManager.h53
-rw-r--r--include/clang/StaticAnalyzer/Core/IssueHash.h7
-rw-r--r--include/clang/StaticAnalyzer/Core/PathDiagnosticConsumers.h7
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/APSIntType.h7
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h7
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/BasicValueFactory.h7
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/BlockCounter.h7
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h120
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h46
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/CheckerHelpers.h7
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/ConstraintManager.h19
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h18
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/DynamicTypeInfo.h7
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/DynamicTypeMap.h17
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/Environment.h13
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h7
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h50
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/FunctionSummary.h7
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/LoopUnrolling.h7
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/LoopWidening.h7
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h12
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h66
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/ProgramStateTrait.h7
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState_Fwd.h7
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/RangedConstraintManager.h10
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/Regions.def7
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/SMTConstraintManager.h87
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/SMTConv.h234
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/SMTExpr.h62
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/SMTSolver.h303
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/SMTSort.h91
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/SValBuilder.h7
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/SValVisitor.h7
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/SVals.def7
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h21
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/SimpleConstraintManager.h7
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/Store.h10
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/StoreRef.h7
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/SubEngine.h15
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/SummaryManager.h7
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/SymExpr.h7
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h7
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/Symbols.def7
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/TaintManager.h59
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/TaintTag.h30
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/WorkList.h7
-rw-r--r--include/clang/StaticAnalyzer/Frontend/AnalysisConsumer.h7
-rw-r--r--include/clang/StaticAnalyzer/Frontend/CheckerRegistration.h7
-rw-r--r--include/clang/StaticAnalyzer/Frontend/CheckerRegistry.h226
-rw-r--r--include/clang/StaticAnalyzer/Frontend/FrontendActions.h23
-rw-r--r--include/clang/StaticAnalyzer/Frontend/ModelConsumer.h7
-rw-r--r--include/clang/Tooling/ASTDiff/ASTDiff.h7
-rw-r--r--include/clang/Tooling/ASTDiff/ASTDiffInternal.h7
-rw-r--r--include/clang/Tooling/AllTUsExecution.h7
-rw-r--r--include/clang/Tooling/ArgumentsAdjusters.h11
-rw-r--r--include/clang/Tooling/CommonOptionsParser.h7
-rw-r--r--include/clang/Tooling/CompilationDatabase.h21
-rw-r--r--include/clang/Tooling/CompilationDatabasePluginRegistry.h7
-rw-r--r--include/clang/Tooling/Core/Diagnostic.h18
-rw-r--r--include/clang/Tooling/Core/Lookup.h10
-rw-r--r--include/clang/Tooling/Core/Replacement.h7
-rw-r--r--include/clang/Tooling/DependencyScanning/DependencyScanningWorker.h58
-rw-r--r--include/clang/Tooling/DiagnosticsYaml.h48
-rw-r--r--include/clang/Tooling/Execution.h7
-rw-r--r--include/clang/Tooling/FileMatchTrie.h7
-rw-r--r--include/clang/Tooling/FixIt.h30
-rw-r--r--include/clang/Tooling/Inclusions/HeaderIncludes.h7
-rw-r--r--include/clang/Tooling/Inclusions/IncludeStyle.h11
-rw-r--r--include/clang/Tooling/JSONCompilationDatabase.h7
-rw-r--r--include/clang/Tooling/Refactoring.h7
-rw-r--r--include/clang/Tooling/Refactoring/ASTSelection.h7
-rw-r--r--include/clang/Tooling/Refactoring/AtomicChange.h7
-rw-r--r--include/clang/Tooling/Refactoring/Extract/Extract.h7
-rw-r--r--include/clang/Tooling/Refactoring/RangeSelector.h89
-rw-r--r--include/clang/Tooling/Refactoring/RecursiveSymbolVisitor.h7
-rw-r--r--include/clang/Tooling/Refactoring/RefactoringAction.h7
-rw-r--r--include/clang/Tooling/Refactoring/RefactoringActionRule.h7
-rw-r--r--include/clang/Tooling/Refactoring/RefactoringActionRuleRequirements.h7
-rw-r--r--include/clang/Tooling/Refactoring/RefactoringActionRules.h7
-rw-r--r--include/clang/Tooling/Refactoring/RefactoringActionRulesInternal.h7
-rw-r--r--include/clang/Tooling/Refactoring/RefactoringDiagnostic.h7
-rw-r--r--include/clang/Tooling/Refactoring/RefactoringOption.h7
-rw-r--r--include/clang/Tooling/Refactoring/RefactoringOptionVisitor.h7
-rw-r--r--include/clang/Tooling/Refactoring/RefactoringOptions.h7
-rw-r--r--include/clang/Tooling/Refactoring/RefactoringResultConsumer.h7
-rw-r--r--include/clang/Tooling/Refactoring/RefactoringRuleContext.h7
-rw-r--r--include/clang/Tooling/Refactoring/Rename/RenamingAction.h9
-rw-r--r--include/clang/Tooling/Refactoring/Rename/SymbolName.h7
-rw-r--r--include/clang/Tooling/Refactoring/Rename/SymbolOccurrences.h7
-rw-r--r--include/clang/Tooling/Refactoring/Rename/USRFinder.h7
-rw-r--r--include/clang/Tooling/Refactoring/Rename/USRFindingAction.h7
-rw-r--r--include/clang/Tooling/Refactoring/Rename/USRLocFinder.h7
-rw-r--r--include/clang/Tooling/Refactoring/SourceCode.h77
-rw-r--r--include/clang/Tooling/Refactoring/Stencil.h173
-rw-r--r--include/clang/Tooling/Refactoring/Transformer.h308
-rw-r--r--include/clang/Tooling/RefactoringCallbacks.h7
-rw-r--r--include/clang/Tooling/ReplacementsYaml.h15
-rw-r--r--include/clang/Tooling/StandaloneExecution.h7
-rw-r--r--include/clang/Tooling/Syntax/BuildTree.h24
-rw-r--r--include/clang/Tooling/Syntax/Nodes.h92
-rw-r--r--include/clang/Tooling/Syntax/Tokens.h355
-rw-r--r--include/clang/Tooling/Syntax/Tree.h142
-rw-r--r--include/clang/Tooling/ToolExecutorPluginRegistry.h7
-rw-r--r--include/clang/Tooling/Tooling.h12
-rw-r--r--lib/ARCMigrate/ARCMT.cpp17
-rw-r--r--lib/ARCMigrate/ARCMTActions.cpp7
-rw-r--r--lib/ARCMigrate/FileRemapper.cpp7
-rw-r--r--lib/ARCMigrate/Internals.h7
-rw-r--r--lib/ARCMigrate/ObjCMT.cpp68
-rw-r--r--lib/ARCMigrate/PlistReporter.cpp9
-rw-r--r--lib/ARCMigrate/TransAPIUses.cpp7
-rw-r--r--lib/ARCMigrate/TransARCAssign.cpp7
-rw-r--r--lib/ARCMigrate/TransAutoreleasePool.cpp7
-rw-r--r--lib/ARCMigrate/TransBlockObjCVariable.cpp7
-rw-r--r--lib/ARCMigrate/TransEmptyStatementsAndDealloc.cpp14
-rw-r--r--lib/ARCMigrate/TransGCAttrs.cpp12
-rw-r--r--lib/ARCMigrate/TransGCCalls.cpp7
-rw-r--r--lib/ARCMigrate/TransProperties.cpp7
-rw-r--r--lib/ARCMigrate/TransProtectedScope.cpp7
-rw-r--r--lib/ARCMigrate/TransRetainReleaseDealloc.cpp15
-rw-r--r--lib/ARCMigrate/TransUnbridgedCasts.cpp7
-rw-r--r--lib/ARCMigrate/TransUnusedInitDelegate.cpp7
-rw-r--r--lib/ARCMigrate/TransZeroOutPropsInDealloc.cpp7
-rw-r--r--lib/ARCMigrate/TransformActions.cpp13
-rw-r--r--lib/ARCMigrate/Transforms.cpp14
-rw-r--r--lib/ARCMigrate/Transforms.h7
-rw-r--r--lib/AST/APValue.cpp166
-rw-r--r--lib/AST/ASTConsumer.cpp7
-rw-r--r--lib/AST/ASTContext.cpp584
-rw-r--r--lib/AST/ASTDiagnostic.cpp12
-rw-r--r--lib/AST/ASTDumper.cpp1455
-rw-r--r--lib/AST/ASTImporter.cpp1888
-rw-r--r--lib/AST/ASTImporterLookupTable.cpp32
-rw-r--r--lib/AST/ASTStructuralEquivalence.cpp387
-rw-r--r--lib/AST/ASTTypeTraits.cpp25
-rw-r--r--lib/AST/AttrImpl.cpp7
-rw-r--r--lib/AST/CXXABI.h7
-rw-r--r--lib/AST/CXXInheritance.cpp25
-rw-r--r--lib/AST/Comment.cpp7
-rw-r--r--lib/AST/CommentBriefParser.cpp7
-rw-r--r--lib/AST/CommentCommandTraits.cpp7
-rw-r--r--lib/AST/CommentLexer.cpp7
-rw-r--r--lib/AST/CommentParser.cpp7
-rw-r--r--lib/AST/CommentSema.cpp7
-rw-r--r--lib/AST/ComparisonCategories.cpp7
-rw-r--r--lib/AST/DataCollection.cpp7
-rw-r--r--lib/AST/Decl.cpp465
-rw-r--r--lib/AST/DeclBase.cpp61
-rw-r--r--lib/AST/DeclCXX.cpp264
-rw-r--r--lib/AST/DeclFriend.cpp7
-rw-r--r--lib/AST/DeclGroup.cpp7
-rw-r--r--lib/AST/DeclObjC.cpp9
-rw-r--r--lib/AST/DeclOpenMP.cpp110
-rw-r--r--lib/AST/DeclPrinter.cpp229
-rw-r--r--lib/AST/DeclTemplate.cpp50
-rw-r--r--lib/AST/DeclarationName.cpp15
-rw-r--r--lib/AST/Expr.cpp880
-rw-r--r--lib/AST/ExprCXX.cpp57
-rw-r--r--lib/AST/ExprClassification.cpp9
-rw-r--r--lib/AST/ExprConstant.cpp2310
-rw-r--r--lib/AST/ExprObjC.cpp38
-rw-r--r--lib/AST/ExternalASTMerger.cpp67
-rw-r--r--lib/AST/ExternalASTSource.cpp7
-rw-r--r--lib/AST/FormatString.cpp41
-rw-r--r--lib/AST/InheritViz.cpp7
-rw-r--r--lib/AST/ItaniumCXXABI.cpp7
-rw-r--r--lib/AST/ItaniumMangle.cpp139
-rw-r--r--lib/AST/JSONNodeDumper.cpp1569
-rw-r--r--lib/AST/Linkage.h7
-rw-r--r--lib/AST/Mangle.cpp212
-rw-r--r--lib/AST/MicrosoftCXXABI.cpp7
-rw-r--r--lib/AST/MicrosoftMangle.cpp176
-rw-r--r--lib/AST/NSAPI.cpp7
-rw-r--r--lib/AST/NestedNameSpecifier.cpp7
-rw-r--r--lib/AST/ODRHash.cpp90
-rw-r--r--lib/AST/OpenMPClause.cpp360
-rw-r--r--lib/AST/ParentMap.cpp19
-rw-r--r--lib/AST/PrintfFormatString.cpp41
-rw-r--r--lib/AST/QualTypeNames.cpp22
-rw-r--r--lib/AST/RawCommentList.cpp7
-rw-r--r--lib/AST/RecordLayout.cpp7
-rw-r--r--lib/AST/RecordLayoutBuilder.cpp167
-rw-r--r--lib/AST/ScanfFormatString.cpp18
-rw-r--r--lib/AST/SelectorLocationsKind.cpp7
-rw-r--r--lib/AST/Stmt.cpp91
-rw-r--r--lib/AST/StmtCXX.cpp7
-rw-r--r--lib/AST/StmtIterator.cpp7
-rw-r--r--lib/AST/StmtObjC.cpp7
-rw-r--r--lib/AST/StmtOpenMP.cpp26
-rw-r--r--lib/AST/StmtPrinter.cpp102
-rw-r--r--lib/AST/StmtProfile.cpp36
-rw-r--r--lib/AST/StmtViz.cpp7
-rw-r--r--lib/AST/TemplateBase.cpp7
-rw-r--r--lib/AST/TemplateName.cpp37
-rw-r--r--lib/AST/TextNodeDumper.cpp802
-rw-r--r--lib/AST/Type.cpp542
-rw-r--r--lib/AST/TypeLoc.cpp7
-rw-r--r--lib/AST/TypePrinter.cpp80
-rw-r--r--lib/AST/VTTBuilder.cpp7
-rw-r--r--lib/AST/VTableBuilder.cpp25
-rw-r--r--lib/ASTMatchers/ASTMatchFinder.cpp41
-rw-r--r--lib/ASTMatchers/ASTMatchersInternal.cpp15
-rw-r--r--lib/ASTMatchers/Dynamic/Diagnostics.cpp7
-rw-r--r--lib/ASTMatchers/Dynamic/Marshallers.h30
-rw-r--r--lib/ASTMatchers/Dynamic/Parser.cpp7
-rw-r--r--lib/ASTMatchers/Dynamic/Registry.cpp57
-rw-r--r--lib/ASTMatchers/Dynamic/VariantValue.cpp7
-rw-r--r--lib/Analysis/AnalysisDeclContext.cpp104
-rw-r--r--lib/Analysis/BodyFarm.cpp40
-rw-r--r--lib/Analysis/CFG.cpp288
-rw-r--r--lib/Analysis/CFGReachabilityAnalysis.cpp7
-rw-r--r--lib/Analysis/CFGStmtMap.cpp9
-rw-r--r--lib/Analysis/CallGraph.cpp7
-rw-r--r--lib/Analysis/CloneDetection.cpp13
-rw-r--r--lib/Analysis/CocoaConventions.cpp7
-rw-r--r--lib/Analysis/CodeInjector.cpp7
-rw-r--r--lib/Analysis/ConstructionContext.cpp7
-rw-r--r--lib/Analysis/Consumed.cpp9
-rw-r--r--lib/Analysis/Dominators.cpp17
-rw-r--r--lib/Analysis/ExprMutationAnalyzer.cpp53
-rw-r--r--lib/Analysis/LiveVariables.cpp9
-rw-r--r--lib/Analysis/ObjCNoReturn.cpp7
-rw-r--r--lib/Analysis/PostOrderCFGView.cpp7
-rw-r--r--lib/Analysis/ProgramPoint.cpp225
-rw-r--r--lib/Analysis/ReachableCode.cpp31
-rw-r--r--lib/Analysis/RetainSummaryManager.cpp (renamed from lib/StaticAnalyzer/Core/RetainSummaryManager.cpp)350
-rw-r--r--lib/Analysis/ThreadSafety.cpp28
-rw-r--r--lib/Analysis/ThreadSafetyCommon.cpp28
-rw-r--r--lib/Analysis/ThreadSafetyLogical.cpp7
-rw-r--r--lib/Analysis/ThreadSafetyTIL.cpp7
-rw-r--r--lib/Analysis/UninitializedValues.cpp26
-rw-r--r--lib/Analysis/plugins/CheckerDependencyHandling/CheckerDependencyHandling.cpp28
-rw-r--r--lib/Analysis/plugins/CheckerDependencyHandling/CheckerDependencyHandlingAnalyzerPlugin.exports2
-rw-r--r--lib/Analysis/plugins/CheckerOptionHandling/CheckerOptionHandling.cpp44
-rw-r--r--lib/Analysis/plugins/CheckerOptionHandling/CheckerOptionHandlingAnalyzerPlugin.exports2
-rw-r--r--lib/Analysis/plugins/SampleAnalyzer/MainCallChecker.cpp54
-rw-r--r--lib/Analysis/plugins/SampleAnalyzer/SampleAnalyzerPlugin.exports2
-rw-r--r--lib/Basic/Builtins.cpp44
-rw-r--r--lib/Basic/CharInfo.cpp7
-rw-r--r--lib/Basic/CodeGenOptions.cpp7
-rw-r--r--lib/Basic/Cuda.cpp76
-rw-r--r--lib/Basic/Diagnostic.cpp14
-rw-r--r--lib/Basic/DiagnosticIDs.cpp46
-rw-r--r--lib/Basic/DiagnosticOptions.cpp7
-rw-r--r--lib/Basic/FileManager.cpp172
-rw-r--r--lib/Basic/FileSystemStatCache.cpp80
-rw-r--r--lib/Basic/FixedPoint.cpp169
-rw-r--r--lib/Basic/IdentifierTable.cpp13
-rw-r--r--lib/Basic/LangOptions.cpp7
-rw-r--r--lib/Basic/MemoryBufferCache.cpp48
-rw-r--r--lib/Basic/Module.cpp24
-rw-r--r--lib/Basic/ObjCRuntime.cpp7
-rw-r--r--lib/Basic/OpenMPKinds.cpp73
-rw-r--r--lib/Basic/OperatorPrecedence.cpp7
-rw-r--r--lib/Basic/SanitizerBlacklist.cpp7
-rw-r--r--lib/Basic/SanitizerSpecialCaseList.cpp9
-rw-r--r--lib/Basic/Sanitizers.cpp30
-rw-r--r--lib/Basic/SourceLocation.cpp7
-rw-r--r--lib/Basic/SourceManager.cpp92
-rw-r--r--lib/Basic/TargetInfo.cpp27
-rw-r--r--lib/Basic/Targets.cpp52
-rw-r--r--lib/Basic/Targets.h11
-rw-r--r--lib/Basic/Targets/AArch64.cpp108
-rw-r--r--lib/Basic/Targets/AArch64.h31
-rw-r--r--lib/Basic/Targets/AMDGPU.cpp56
-rw-r--r--lib/Basic/Targets/AMDGPU.h10
-rw-r--r--lib/Basic/Targets/ARC.cpp9
-rw-r--r--lib/Basic/Targets/ARC.h7
-rw-r--r--lib/Basic/Targets/ARM.cpp157
-rw-r--r--lib/Basic/Targets/ARM.h21
-rw-r--r--lib/Basic/Targets/AVR.cpp7
-rw-r--r--lib/Basic/Targets/AVR.h7
-rw-r--r--lib/Basic/Targets/BPF.cpp11
-rw-r--r--lib/Basic/Targets/BPF.h7
-rw-r--r--lib/Basic/Targets/Hexagon.cpp7
-rw-r--r--lib/Basic/Targets/Hexagon.h7
-rw-r--r--lib/Basic/Targets/Lanai.cpp7
-rw-r--r--lib/Basic/Targets/Lanai.h7
-rw-r--r--lib/Basic/Targets/Le64.cpp7
-rw-r--r--lib/Basic/Targets/Le64.h7
-rw-r--r--lib/Basic/Targets/MSP430.cpp7
-rw-r--r--lib/Basic/Targets/MSP430.h13
-rw-r--r--lib/Basic/Targets/Mips.cpp15
-rw-r--r--lib/Basic/Targets/Mips.h9
-rw-r--r--lib/Basic/Targets/NVPTX.cpp15
-rw-r--r--lib/Basic/Targets/NVPTX.h31
-rw-r--r--lib/Basic/Targets/OSTargets.cpp86
-rw-r--r--lib/Basic/Targets/OSTargets.h194
-rw-r--r--lib/Basic/Targets/PNaCl.cpp7
-rw-r--r--lib/Basic/Targets/PNaCl.h7
-rw-r--r--lib/Basic/Targets/PPC.cpp36
-rw-r--r--lib/Basic/Targets/PPC.h87
-rw-r--r--lib/Basic/Targets/RISCV.cpp29
-rw-r--r--lib/Basic/Targets/RISCV.h21
-rw-r--r--lib/Basic/Targets/SPIR.cpp7
-rw-r--r--lib/Basic/Targets/SPIR.h8
-rw-r--r--lib/Basic/Targets/Sparc.cpp7
-rw-r--r--lib/Basic/Targets/Sparc.h9
-rw-r--r--lib/Basic/Targets/SystemZ.cpp13
-rw-r--r--lib/Basic/Targets/SystemZ.h11
-rw-r--r--lib/Basic/Targets/TCE.cpp7
-rw-r--r--lib/Basic/Targets/TCE.h7
-rw-r--r--lib/Basic/Targets/WebAssembly.cpp80
-rw-r--r--lib/Basic/Targets/WebAssembly.h21
-rw-r--r--lib/Basic/Targets/X86.cpp229
-rw-r--r--lib/Basic/Targets/X86.h33
-rw-r--r--lib/Basic/Targets/XCore.cpp7
-rw-r--r--lib/Basic/Targets/XCore.h7
-rw-r--r--lib/Basic/TokenKinds.cpp7
-rw-r--r--lib/Basic/Version.cpp21
-rw-r--r--lib/Basic/Warnings.cpp7
-rw-r--r--lib/Basic/XRayInstr.cpp7
-rw-r--r--lib/Basic/XRayLists.cpp9
-rw-r--r--lib/CodeGen/ABIInfo.h7
-rw-r--r--lib/CodeGen/Address.h7
-rw-r--r--lib/CodeGen/BackendUtil.cpp324
-rw-r--r--lib/CodeGen/CGAtomic.cpp34
-rw-r--r--lib/CodeGen/CGBlocks.cpp177
-rw-r--r--lib/CodeGen/CGBlocks.h7
-rw-r--r--lib/CodeGen/CGBuilder.h95
-rw-r--r--lib/CodeGen/CGBuiltin.cpp1751
-rw-r--r--lib/CodeGen/CGCUDANV.cpp249
-rw-r--r--lib/CodeGen/CGCUDARuntime.cpp7
-rw-r--r--lib/CodeGen/CGCUDARuntime.h16
-rw-r--r--lib/CodeGen/CGCXX.cpp54
-rw-r--r--lib/CodeGen/CGCXXABI.cpp15
-rw-r--r--lib/CodeGen/CGCXXABI.h31
-rw-r--r--lib/CodeGen/CGCall.cpp381
-rw-r--r--lib/CodeGen/CGCall.h22
-rw-r--r--lib/CodeGen/CGClass.cpp127
-rw-r--r--lib/CodeGen/CGCleanup.cpp25
-rw-r--r--lib/CodeGen/CGCleanup.h7
-rw-r--r--lib/CodeGen/CGCoroutine.cpp14
-rw-r--r--lib/CodeGen/CGDebugInfo.cpp417
-rw-r--r--lib/CodeGen/CGDebugInfo.h45
-rw-r--r--lib/CodeGen/CGDecl.cpp630
-rw-r--r--lib/CodeGen/CGDeclCXX.cpp104
-rw-r--r--lib/CodeGen/CGException.cpp92
-rw-r--r--lib/CodeGen/CGExpr.cpp386
-rw-r--r--lib/CodeGen/CGExprAgg.cpp125
-rw-r--r--lib/CodeGen/CGExprCXX.cpp197
-rw-r--r--lib/CodeGen/CGExprComplex.cpp35
-rw-r--r--lib/CodeGen/CGExprConstant.cpp1283
-rw-r--r--lib/CodeGen/CGExprScalar.cpp467
-rw-r--r--lib/CodeGen/CGGPUBuiltin.cpp7
-rw-r--r--lib/CodeGen/CGLoopInfo.cpp551
-rw-r--r--lib/CodeGen/CGLoopInfo.h91
-rw-r--r--lib/CodeGen/CGNonTrivialStruct.cpp225
-rw-r--r--lib/CodeGen/CGObjC.cpp324
-rw-r--r--lib/CodeGen/CGObjCGNU.cpp317
-rw-r--r--lib/CodeGen/CGObjCMac.cpp576
-rw-r--r--lib/CodeGen/CGObjCRuntime.cpp29
-rw-r--r--lib/CodeGen/CGObjCRuntime.h40
-rw-r--r--lib/CodeGen/CGOpenCLRuntime.cpp37
-rw-r--r--lib/CodeGen/CGOpenCLRuntime.h11
-rw-r--r--lib/CodeGen/CGOpenMPRuntime.cpp1871
-rw-r--r--lib/CodeGen/CGOpenMPRuntime.h141
-rw-r--r--lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp1117
-rw-r--r--lib/CodeGen/CGOpenMPRuntimeNVPTX.h40
-rw-r--r--lib/CodeGen/CGRecordLayout.h7
-rw-r--r--lib/CodeGen/CGRecordLayoutBuilder.cpp39
-rw-r--r--lib/CodeGen/CGStmt.cpp230
-rw-r--r--lib/CodeGen/CGStmtOpenMP.cpp156
-rw-r--r--lib/CodeGen/CGVTT.cpp7
-rw-r--r--lib/CodeGen/CGVTables.cpp39
-rw-r--r--lib/CodeGen/CGVTables.h7
-rw-r--r--lib/CodeGen/CGValue.h7
-rw-r--r--lib/CodeGen/CodeGenABITypes.cpp16
-rw-r--r--lib/CodeGen/CodeGenAction.cpp63
-rw-r--r--lib/CodeGen/CodeGenFunction.cpp251
-rw-r--r--lib/CodeGen/CodeGenFunction.h176
-rw-r--r--lib/CodeGen/CodeGenModule.cpp577
-rw-r--r--lib/CodeGen/CodeGenModule.h160
-rw-r--r--lib/CodeGen/CodeGenPGO.cpp13
-rw-r--r--lib/CodeGen/CodeGenPGO.h7
-rw-r--r--lib/CodeGen/CodeGenTBAA.cpp13
-rw-r--r--lib/CodeGen/CodeGenTBAA.h7
-rw-r--r--lib/CodeGen/CodeGenTypeCache.h7
-rw-r--r--lib/CodeGen/CodeGenTypes.cpp18
-rw-r--r--lib/CodeGen/CodeGenTypes.h87
-rw-r--r--lib/CodeGen/ConstantEmitter.h7
-rw-r--r--lib/CodeGen/ConstantInitBuilder.cpp7
-rw-r--r--lib/CodeGen/CoverageMappingGen.cpp28
-rw-r--r--lib/CodeGen/CoverageMappingGen.h7
-rw-r--r--lib/CodeGen/EHScopeStack.h7
-rw-r--r--lib/CodeGen/ItaniumCXXABI.cpp278
-rw-r--r--lib/CodeGen/MacroPPCallbacks.cpp7
-rw-r--r--lib/CodeGen/MacroPPCallbacks.h7
-rw-r--r--lib/CodeGen/MicrosoftCXXABI.cpp257
-rw-r--r--lib/CodeGen/ModuleBuilder.cpp7
-rw-r--r--lib/CodeGen/ObjectFilePCHContainerOperations.cpp19
-rw-r--r--lib/CodeGen/PatternInit.cpp85
-rw-r--r--lib/CodeGen/PatternInit.h27
-rw-r--r--lib/CodeGen/SanitizerMetadata.cpp28
-rw-r--r--lib/CodeGen/SanitizerMetadata.h7
-rw-r--r--lib/CodeGen/SwiftCallingConv.cpp7
-rw-r--r--lib/CodeGen/TargetInfo.cpp444
-rw-r--r--lib/CodeGen/TargetInfo.h24
-rw-r--r--lib/CodeGen/VarBypassDetector.cpp7
-rw-r--r--lib/CodeGen/VarBypassDetector.h7
-rw-r--r--lib/CrossTU/CrossTranslationUnit.cpp216
-rw-r--r--lib/DirectoryWatcher/DirectoryScanner.cpp54
-rw-r--r--lib/DirectoryWatcher/DirectoryScanner.h29
-rw-r--r--lib/DirectoryWatcher/default/DirectoryWatcher-not-implemented.cpp19
-rw-r--r--lib/DirectoryWatcher/linux/DirectoryWatcher-linux.cpp353
-rw-r--r--lib/DirectoryWatcher/mac/DirectoryWatcher-mac.cpp233
-rw-r--r--lib/Driver/Action.cpp7
-rw-r--r--lib/Driver/Compilation.cpp19
-rw-r--r--lib/Driver/DarwinSDKInfo.cpp7
-rw-r--r--lib/Driver/Distro.cpp12
-rw-r--r--lib/Driver/Driver.cpp215
-rw-r--r--lib/Driver/DriverOptions.cpp7
-rw-r--r--lib/Driver/InputInfo.h7
-rw-r--r--lib/Driver/Job.cpp13
-rw-r--r--lib/Driver/Multilib.cpp27
-rw-r--r--lib/Driver/Phases.cpp7
-rw-r--r--lib/Driver/SanitizerArgs.cpp291
-rw-r--r--lib/Driver/Tool.cpp7
-rw-r--r--lib/Driver/ToolChain.cpp147
-rw-r--r--lib/Driver/ToolChains/AMDGPU.cpp28
-rw-r--r--lib/Driver/ToolChains/AMDGPU.h11
-rw-r--r--lib/Driver/ToolChains/AVR.cpp129
-rw-r--r--lib/Driver/ToolChains/AVR.h30
-rw-r--r--lib/Driver/ToolChains/Ananas.cpp7
-rw-r--r--lib/Driver/ToolChains/Ananas.h7
-rw-r--r--lib/Driver/ToolChains/Arch/AArch64.cpp69
-rw-r--r--lib/Driver/ToolChains/Arch/AArch64.h7
-rw-r--r--lib/Driver/ToolChains/Arch/ARM.cpp132
-rw-r--r--lib/Driver/ToolChains/Arch/ARM.h10
-rw-r--r--lib/Driver/ToolChains/Arch/Mips.cpp8
-rw-r--r--lib/Driver/ToolChains/Arch/Mips.h7
-rw-r--r--lib/Driver/ToolChains/Arch/PPC.cpp9
-rw-r--r--lib/Driver/ToolChains/Arch/PPC.h7
-rw-r--r--lib/Driver/ToolChains/Arch/RISCV.cpp55
-rw-r--r--lib/Driver/ToolChains/Arch/RISCV.h7
-rw-r--r--lib/Driver/ToolChains/Arch/Sparc.cpp7
-rw-r--r--lib/Driver/ToolChains/Arch/Sparc.h7
-rw-r--r--lib/Driver/ToolChains/Arch/SystemZ.cpp7
-rw-r--r--lib/Driver/ToolChains/Arch/SystemZ.h7
-rw-r--r--lib/Driver/ToolChains/Arch/X86.cpp8
-rw-r--r--lib/Driver/ToolChains/Arch/X86.h7
-rw-r--r--lib/Driver/ToolChains/BareMetal.cpp9
-rw-r--r--lib/Driver/ToolChains/BareMetal.h7
-rw-r--r--lib/Driver/ToolChains/Clang.cpp559
-rw-r--r--lib/Driver/ToolChains/Clang.h9
-rw-r--r--lib/Driver/ToolChains/CloudABI.cpp7
-rw-r--r--lib/Driver/ToolChains/CloudABI.h7
-rw-r--r--lib/Driver/ToolChains/CommonArgs.cpp199
-rw-r--r--lib/Driver/ToolChains/CommonArgs.h20
-rw-r--r--lib/Driver/ToolChains/Contiki.cpp7
-rw-r--r--lib/Driver/ToolChains/Contiki.h7
-rw-r--r--lib/Driver/ToolChains/CrossWindows.cpp11
-rw-r--r--lib/Driver/ToolChains/CrossWindows.h7
-rw-r--r--lib/Driver/ToolChains/Cuda.cpp53
-rw-r--r--lib/Driver/ToolChains/Cuda.h7
-rw-r--r--lib/Driver/ToolChains/Darwin.cpp336
-rw-r--r--lib/Driver/ToolChains/Darwin.h25
-rw-r--r--lib/Driver/ToolChains/DragonFly.cpp7
-rw-r--r--lib/Driver/ToolChains/DragonFly.h7
-rw-r--r--lib/Driver/ToolChains/FreeBSD.cpp9
-rw-r--r--lib/Driver/ToolChains/FreeBSD.h7
-rw-r--r--lib/Driver/ToolChains/Fuchsia.cpp68
-rw-r--r--lib/Driver/ToolChains/Fuchsia.h7
-rw-r--r--lib/Driver/ToolChains/Gnu.cpp206
-rw-r--r--lib/Driver/ToolChains/Gnu.h7
-rw-r--r--lib/Driver/ToolChains/HIP.cpp134
-rw-r--r--lib/Driver/ToolChains/HIP.h7
-rw-r--r--lib/Driver/ToolChains/Haiku.cpp7
-rw-r--r--lib/Driver/ToolChains/Haiku.h7
-rw-r--r--lib/Driver/ToolChains/Hexagon.cpp13
-rw-r--r--lib/Driver/ToolChains/Hexagon.h7
-rw-r--r--lib/Driver/ToolChains/Hurd.cpp7
-rw-r--r--lib/Driver/ToolChains/Hurd.h7
-rw-r--r--lib/Driver/ToolChains/Lanai.h7
-rw-r--r--lib/Driver/ToolChains/Linux.cpp91
-rw-r--r--lib/Driver/ToolChains/Linux.h8
-rw-r--r--lib/Driver/ToolChains/MSP430.cpp7
-rw-r--r--lib/Driver/ToolChains/MSP430.h11
-rw-r--r--lib/Driver/ToolChains/MSVC.cpp43
-rw-r--r--lib/Driver/ToolChains/MSVC.h7
-rw-r--r--lib/Driver/ToolChains/MinGW.cpp38
-rw-r--r--lib/Driver/ToolChains/MinGW.h7
-rw-r--r--lib/Driver/ToolChains/Minix.cpp7
-rw-r--r--lib/Driver/ToolChains/Minix.h7
-rw-r--r--lib/Driver/ToolChains/MipsLinux.cpp27
-rw-r--r--lib/Driver/ToolChains/MipsLinux.h12
-rw-r--r--lib/Driver/ToolChains/Myriad.cpp7
-rw-r--r--lib/Driver/ToolChains/Myriad.h7
-rw-r--r--lib/Driver/ToolChains/NaCl.cpp7
-rw-r--r--lib/Driver/ToolChains/NaCl.h7
-rw-r--r--lib/Driver/ToolChains/NetBSD.cpp37
-rw-r--r--lib/Driver/ToolChains/NetBSD.h7
-rw-r--r--lib/Driver/ToolChains/OpenBSD.cpp15
-rw-r--r--lib/Driver/ToolChains/OpenBSD.h7
-rw-r--r--lib/Driver/ToolChains/PPCLinux.cpp31
-rw-r--r--lib/Driver/ToolChains/PPCLinux.h33
-rw-r--r--lib/Driver/ToolChains/PS4CPU.cpp9
-rw-r--r--lib/Driver/ToolChains/PS4CPU.h7
-rw-r--r--lib/Driver/ToolChains/RISCVToolchain.cpp7
-rw-r--r--lib/Driver/ToolChains/RISCVToolchain.h7
-rw-r--r--lib/Driver/ToolChains/Solaris.cpp27
-rw-r--r--lib/Driver/ToolChains/Solaris.h7
-rw-r--r--lib/Driver/ToolChains/TCE.cpp7
-rw-r--r--lib/Driver/ToolChains/TCE.h7
-rw-r--r--lib/Driver/ToolChains/WebAssembly.cpp116
-rw-r--r--lib/Driver/ToolChains/WebAssembly.h17
-rw-r--r--lib/Driver/ToolChains/XCore.cpp7
-rw-r--r--lib/Driver/ToolChains/XCore.h7
-rw-r--r--lib/Driver/Types.cpp7
-rw-r--r--lib/Driver/XRayArgs.cpp7
-rw-r--r--lib/Edit/Commit.cpp7
-rw-r--r--lib/Edit/EditedSource.cpp9
-rw-r--r--lib/Edit/RewriteObjCFoundationAPI.cpp10
-rw-r--r--lib/Format/AffectedRangeManager.cpp7
-rw-r--r--lib/Format/AffectedRangeManager.h7
-rw-r--r--lib/Format/BreakableToken.cpp51
-rw-r--r--lib/Format/BreakableToken.h20
-rw-r--r--lib/Format/ContinuationIndenter.cpp120
-rw-r--r--lib/Format/ContinuationIndenter.h11
-rw-r--r--lib/Format/Encoding.h7
-rw-r--r--lib/Format/Format.cpp213
-rw-r--r--lib/Format/FormatInternal.h7
-rw-r--r--lib/Format/FormatToken.cpp7
-rw-r--r--lib/Format/FormatToken.h156
-rw-r--r--lib/Format/FormatTokenLexer.cpp140
-rw-r--r--lib/Format/FormatTokenLexer.h14
-rw-r--r--lib/Format/NamespaceEndCommentsFixer.cpp98
-rw-r--r--lib/Format/NamespaceEndCommentsFixer.h7
-rw-r--r--lib/Format/SortJavaScriptImports.cpp19
-rw-r--r--lib/Format/SortJavaScriptImports.h7
-rw-r--r--lib/Format/TokenAnalyzer.cpp7
-rw-r--r--lib/Format/TokenAnalyzer.h11
-rw-r--r--lib/Format/TokenAnnotator.cpp215
-rw-r--r--lib/Format/TokenAnnotator.h24
-rw-r--r--lib/Format/UnwrappedLineFormatter.cpp90
-rw-r--r--lib/Format/UnwrappedLineFormatter.h13
-rw-r--r--lib/Format/UnwrappedLineParser.cpp123
-rw-r--r--lib/Format/UnwrappedLineParser.h10
-rw-r--r--lib/Format/UsingDeclarationsSorter.cpp10
-rw-r--r--lib/Format/UsingDeclarationsSorter.h7
-rw-r--r--lib/Format/WhitespaceManager.cpp207
-rw-r--r--lib/Format/WhitespaceManager.h12
-rw-r--r--lib/Frontend/ASTConsumers.cpp30
-rw-r--r--lib/Frontend/ASTMerge.cpp21
-rw-r--r--lib/Frontend/ASTUnit.cpp202
-rw-r--r--lib/Frontend/ChainedDiagnosticConsumer.cpp7
-rw-r--r--lib/Frontend/ChainedIncludesSource.cpp15
-rw-r--r--lib/Frontend/CompilerInstance.cpp150
-rw-r--r--lib/Frontend/CompilerInvocation.cpp193
-rw-r--r--lib/Frontend/CreateInvocationFromCommandLine.cpp7
-rw-r--r--lib/Frontend/DependencyFile.cpp285
-rw-r--r--lib/Frontend/DependencyGraph.cpp7
-rw-r--r--lib/Frontend/DiagnosticRenderer.cpp7
-rw-r--r--lib/Frontend/FrontendAction.cpp30
-rw-r--r--lib/Frontend/FrontendActions.cpp85
-rw-r--r--lib/Frontend/FrontendOptions.cpp7
-rw-r--r--lib/Frontend/FrontendTiming.cpp9
-rw-r--r--lib/Frontend/HeaderIncludeGen.cpp9
-rw-r--r--lib/Frontend/InitHeaderSearch.cpp89
-rw-r--r--lib/Frontend/InitPreprocessor.cpp45
-rw-r--r--lib/Frontend/InterfaceStubFunctionsConsumer.cpp378
-rw-r--r--lib/Frontend/LangStandards.cpp7
-rw-r--r--lib/Frontend/LayoutOverrideSource.cpp7
-rw-r--r--lib/Frontend/LogDiagnosticPrinter.cpp7
-rw-r--r--lib/Frontend/ModuleDependencyCollector.cpp31
-rw-r--r--lib/Frontend/MultiplexConsumer.cpp13
-rw-r--r--lib/Frontend/PrecompiledPreamble.cpp70
-rw-r--r--lib/Frontend/PrintPreprocessedOutput.cpp45
-rw-r--r--lib/Frontend/Rewrite/FixItRewriter.cpp7
-rw-r--r--lib/Frontend/Rewrite/FrontendActions.cpp15
-rw-r--r--lib/Frontend/Rewrite/HTMLPrint.cpp7
-rw-r--r--lib/Frontend/Rewrite/InclusionRewriter.cpp9
-rw-r--r--lib/Frontend/Rewrite/RewriteMacros.cpp7
-rw-r--r--lib/Frontend/Rewrite/RewriteModernObjC.cpp73
-rw-r--r--lib/Frontend/Rewrite/RewriteObjC.cpp41
-rw-r--r--lib/Frontend/Rewrite/RewriteTest.cpp7
-rw-r--r--lib/Frontend/SerializedDiagnosticPrinter.cpp9
-rw-r--r--lib/Frontend/SerializedDiagnosticReader.cpp118
-rw-r--r--lib/Frontend/TestModuleFileExtension.cpp24
-rw-r--r--lib/Frontend/TestModuleFileExtension.h9
-rw-r--r--lib/Frontend/TextDiagnostic.cpp35
-rw-r--r--lib/Frontend/TextDiagnosticBuffer.cpp7
-rw-r--r--lib/Frontend/TextDiagnosticPrinter.cpp7
-rw-r--r--lib/Frontend/VerifyDiagnosticConsumer.cpp443
-rw-r--r--lib/FrontendTool/ExecuteCompilerInvocation.cpp49
-rw-r--r--lib/Headers/__clang_cuda_builtin_vars.h20
-rw-r--r--lib/Headers/__clang_cuda_cmath.h49
-rw-r--r--lib/Headers/__clang_cuda_complex_builtins.h20
-rw-r--r--lib/Headers/__clang_cuda_device_functions.h93
-rw-r--r--lib/Headers/__clang_cuda_intrinsics.h20
-rw-r--r--lib/Headers/__clang_cuda_libdevice_declares.h890
-rw-r--r--lib/Headers/__clang_cuda_math_forward_declares.h70
-rw-r--r--lib/Headers/__clang_cuda_runtime_wrapper.h32
-rw-r--r--lib/Headers/__stddef_max_align_t.h22
-rw-r--r--lib/Headers/__wmmintrin_aes.h20
-rw-r--r--lib/Headers/__wmmintrin_pclmul.h20
-rw-r--r--lib/Headers/adxintrin.h20
-rw-r--r--lib/Headers/altivec.h20
-rw-r--r--lib/Headers/ammintrin.h20
-rw-r--r--lib/Headers/arm64intr.h20
-rw-r--r--lib/Headers/arm_acle.h38
-rw-r--r--lib/Headers/armintr.h20
-rw-r--r--lib/Headers/avx2intrin.h32
-rw-r--r--lib/Headers/avx512bf16intrin.h279
-rw-r--r--lib/Headers/avx512bitalgintrin.h20
-rw-r--r--lib/Headers/avx512bwintrin.h44
-rw-r--r--lib/Headers/avx512cdintrin.h52
-rw-r--r--lib/Headers/avx512dqintrin.h20
-rw-r--r--lib/Headers/avx512erintrin.h20
-rw-r--r--lib/Headers/avx512fintrin.h115
-rw-r--r--lib/Headers/avx512ifmaintrin.h20
-rw-r--r--lib/Headers/avx512ifmavlintrin.h20
-rw-r--r--lib/Headers/avx512pfintrin.h20
-rw-r--r--lib/Headers/avx512vbmi2intrin.h20
-rw-r--r--lib/Headers/avx512vbmiintrin.h20
-rw-r--r--lib/Headers/avx512vbmivlintrin.h20
-rw-r--r--lib/Headers/avx512vlbf16intrin.h474
-rw-r--r--lib/Headers/avx512vlbitalgintrin.h20
-rw-r--r--lib/Headers/avx512vlbwintrin.h36
-rw-r--r--lib/Headers/avx512vlcdintrin.h86
-rw-r--r--lib/Headers/avx512vldqintrin.h52
-rw-r--r--lib/Headers/avx512vlintrin.h77
-rw-r--r--lib/Headers/avx512vlvbmi2intrin.h20
-rw-r--r--lib/Headers/avx512vlvnniintrin.h20
-rw-r--r--lib/Headers/avx512vlvp2intersectintrin.h121
-rw-r--r--lib/Headers/avx512vnniintrin.h20
-rw-r--r--lib/Headers/avx512vp2intersectintrin.h77
-rw-r--r--lib/Headers/avx512vpopcntdqintrin.h20
-rw-r--r--lib/Headers/avx512vpopcntdqvlintrin.h20
-rw-r--r--lib/Headers/avxintrin.h50
-rw-r--r--lib/Headers/bmi2intrin.h20
-rw-r--r--lib/Headers/bmiintrin.h20
-rw-r--r--lib/Headers/cetintrin.h20
-rw-r--r--lib/Headers/cldemoteintrin.h20
-rw-r--r--lib/Headers/clflushoptintrin.h20
-rw-r--r--lib/Headers/clwbintrin.h20
-rw-r--r--lib/Headers/clzerointrin.h20
-rw-r--r--lib/Headers/cpuid.h24
-rw-r--r--lib/Headers/emmintrin.h55
-rw-r--r--lib/Headers/enqcmdintrin.h63
-rw-r--r--lib/Headers/f16cintrin.h26
-rw-r--r--lib/Headers/float.h28
-rw-r--r--lib/Headers/fma4intrin.h20
-rw-r--r--lib/Headers/fmaintrin.h20
-rw-r--r--lib/Headers/fxsrintrin.h20
-rw-r--r--lib/Headers/gfniintrin.h20
-rw-r--r--lib/Headers/htmintrin.h20
-rw-r--r--lib/Headers/htmxlintrin.h20
-rw-r--r--lib/Headers/ia32intrin.h320
-rw-r--r--lib/Headers/immintrin.h62
-rw-r--r--lib/Headers/intrin.h46
-rw-r--r--lib/Headers/inttypes.h25
-rw-r--r--lib/Headers/invpcidintrin.h20
-rw-r--r--lib/Headers/iso646.h22
-rw-r--r--lib/Headers/limits.h22
-rw-r--r--lib/Headers/lwpintrin.h20
-rw-r--r--lib/Headers/lzcntintrin.h20
-rw-r--r--lib/Headers/mm3dnow.h20
-rw-r--r--lib/Headers/mm_malloc.h20
-rw-r--r--lib/Headers/mmintrin.h22
-rw-r--r--lib/Headers/module.modulemap21
-rw-r--r--lib/Headers/movdirintrin.h20
-rw-r--r--lib/Headers/msa.h20
-rw-r--r--lib/Headers/mwaitxintrin.h20
-rw-r--r--lib/Headers/nmmintrin.h20
-rw-r--r--lib/Headers/opencl-c-base.h578
-rw-r--r--lib/Headers/opencl-c.h696
-rw-r--r--lib/Headers/openmp_wrappers/__clang_openmp_math.h35
-rw-r--r--lib/Headers/openmp_wrappers/__clang_openmp_math_declares.h33
-rw-r--r--lib/Headers/openmp_wrappers/cmath16
-rw-r--r--lib/Headers/openmp_wrappers/math.h17
-rw-r--r--lib/Headers/pconfigintrin.h24
-rw-r--r--lib/Headers/pkuintrin.h20
-rw-r--r--lib/Headers/pmmintrin.h20
-rw-r--r--lib/Headers/popcntintrin.h52
-rw-r--r--lib/Headers/ppc_wrappers/emmintrin.h2318
-rw-r--r--lib/Headers/ppc_wrappers/mm_malloc.h44
-rw-r--r--lib/Headers/ppc_wrappers/mmintrin.h1443
-rw-r--r--lib/Headers/ppc_wrappers/xmmintrin.h1838
-rw-r--r--lib/Headers/prfchwintrin.h20
-rw-r--r--lib/Headers/ptwriteintrin.h20
-rw-r--r--lib/Headers/rdseedintrin.h20
-rw-r--r--lib/Headers/rtmintrin.h20
-rw-r--r--lib/Headers/s390intrin.h20
-rw-r--r--lib/Headers/sgxintrin.h24
-rw-r--r--lib/Headers/shaintrin.h20
-rw-r--r--lib/Headers/smmintrin.h20
-rw-r--r--lib/Headers/stdalign.h20
-rw-r--r--lib/Headers/stdarg.h22
-rw-r--r--lib/Headers/stdatomic.h20
-rw-r--r--lib/Headers/stdbool.h22
-rw-r--r--lib/Headers/stddef.h22
-rw-r--r--lib/Headers/stdint.h27
-rw-r--r--lib/Headers/stdnoreturn.h20
-rw-r--r--lib/Headers/tbmintrin.h20
-rw-r--r--lib/Headers/tgmath.h22
-rw-r--r--lib/Headers/tmmintrin.h20
-rw-r--r--lib/Headers/unwind.h24
-rw-r--r--lib/Headers/vadefs.h20
-rw-r--r--lib/Headers/vaesintrin.h20
-rw-r--r--lib/Headers/varargs.h20
-rw-r--r--lib/Headers/vecintrin.h426
-rw-r--r--lib/Headers/vpclmulqdqintrin.h20
-rw-r--r--lib/Headers/waitpkgintrin.h20
-rw-r--r--lib/Headers/wbnoinvdintrin.h20
-rw-r--r--lib/Headers/wmmintrin.h20
-rw-r--r--lib/Headers/x86intrin.h20
-rw-r--r--lib/Headers/xmmintrin.h40
-rw-r--r--lib/Headers/xopintrin.h20
-rw-r--r--lib/Headers/xsavecintrin.h20
-rw-r--r--lib/Headers/xsaveintrin.h39
-rw-r--r--lib/Headers/xsaveoptintrin.h20
-rw-r--r--lib/Headers/xsavesintrin.h20
-rw-r--r--lib/Headers/xtestintrin.h20
-rw-r--r--lib/Index/CodegenNameGenerator.cpp200
-rw-r--r--lib/Index/CommentToXML.cpp14
-rw-r--r--lib/Index/FileIndexRecord.cpp60
-rw-r--r--lib/Index/FileIndexRecord.h57
-rw-r--r--lib/Index/IndexBody.cpp7
-rw-r--r--lib/Index/IndexDecl.cpp35
-rw-r--r--lib/Index/IndexSymbol.cpp49
-rw-r--r--lib/Index/IndexTypeSourceInfo.cpp58
-rw-r--r--lib/Index/IndexingAction.cpp7
-rw-r--r--lib/Index/IndexingContext.cpp28
-rw-r--r--lib/Index/IndexingContext.h11
-rw-r--r--lib/Index/SimpleFormatContext.h7
-rw-r--r--lib/Index/USRGeneration.cpp16
-rw-r--r--lib/Lex/DependencyDirectivesSourceMinimizer.cpp763
-rw-r--r--lib/Lex/HeaderMap.cpp7
-rw-r--r--lib/Lex/HeaderSearch.cpp111
-rw-r--r--lib/Lex/Lexer.cpp16
-rw-r--r--lib/Lex/LiteralSupport.cpp19
-rw-r--r--lib/Lex/MacroArgs.cpp18
-rw-r--r--lib/Lex/MacroInfo.cpp7
-rw-r--r--lib/Lex/ModuleMap.cpp23
-rw-r--r--lib/Lex/PPCaching.cpp59
-rw-r--r--lib/Lex/PPCallbacks.cpp7
-rw-r--r--lib/Lex/PPConditionalDirectiveRecord.cpp17
-rw-r--r--lib/Lex/PPDirectives.cpp562
-rw-r--r--lib/Lex/PPExpressions.cpp27
-rw-r--r--lib/Lex/PPLexerChange.cpp34
-rw-r--r--lib/Lex/PPMacroExpansion.cpp112
-rw-r--r--lib/Lex/Pragma.cpp338
-rw-r--r--lib/Lex/PreprocessingRecord.cpp25
-rw-r--r--lib/Lex/Preprocessor.cpp412
-rw-r--r--lib/Lex/PreprocessorLexer.cpp15
-rw-r--r--lib/Lex/ScratchBuffer.cpp7
-rw-r--r--lib/Lex/TokenConcatenation.cpp12
-rw-r--r--lib/Lex/TokenLexer.cpp67
-rw-r--r--lib/Lex/UnicodeCharSets.h7
-rw-r--r--lib/Parse/ParseAST.cpp9
-rw-r--r--lib/Parse/ParseCXXInlineMethods.cpp24
-rw-r--r--lib/Parse/ParseDecl.cpp258
-rw-r--r--lib/Parse/ParseDeclCXX.cpp178
-rw-r--r--lib/Parse/ParseExpr.cpp182
-rw-r--r--lib/Parse/ParseExprCXX.cpp636
-rw-r--r--lib/Parse/ParseInit.cpp38
-rw-r--r--lib/Parse/ParseObjc.cpp65
-rw-r--r--lib/Parse/ParseOpenMP.cpp528
-rw-r--r--lib/Parse/ParsePragma.cpp225
-rw-r--r--lib/Parse/ParseStmt.cpp149
-rw-r--r--lib/Parse/ParseStmtAsm.cpp87
-rw-r--r--lib/Parse/ParseTemplate.cpp156
-rw-r--r--lib/Parse/ParseTentative.cpp247
-rw-r--r--lib/Parse/Parser.cpp291
-rw-r--r--lib/Rewrite/DeltaTree.cpp7
-rw-r--r--lib/Rewrite/HTMLRewrite.cpp58
-rw-r--r--lib/Rewrite/RewriteRope.cpp7
-rw-r--r--lib/Rewrite/Rewriter.cpp16
-rw-r--r--lib/Rewrite/TokenRewriter.cpp7
-rw-r--r--lib/Sema/AnalysisBasedWarnings.cpp118
-rw-r--r--lib/Sema/CodeCompleteConsumer.cpp7
-rw-r--r--lib/Sema/CoroutineStmtBuilder.h7
-rw-r--r--lib/Sema/DeclSpec.cpp83
-rw-r--r--lib/Sema/DelayedDiagnostic.cpp7
-rw-r--r--lib/Sema/IdentifierResolver.cpp7
-rw-r--r--lib/Sema/JumpDiagnostics.cpp121
-rw-r--r--lib/Sema/MultiplexExternalSemaSource.cpp7
-rw-r--r--lib/Sema/OpenCLBuiltins.td296
-rw-r--r--lib/Sema/ParsedAttr.cpp7
-rw-r--r--lib/Sema/Scope.cpp11
-rw-r--r--lib/Sema/ScopeInfo.cpp63
-rw-r--r--lib/Sema/Sema.cpp433
-rw-r--r--lib/Sema/SemaAccess.cpp10
-rw-r--r--lib/Sema/SemaAttr.cpp22
-rw-r--r--lib/Sema/SemaCUDA.cpp262
-rw-r--r--lib/Sema/SemaCXXScopeSpec.cpp45
-rw-r--r--lib/Sema/SemaCast.cpp219
-rw-r--r--lib/Sema/SemaChecking.cpp829
-rw-r--r--lib/Sema/SemaCodeComplete.cpp904
-rw-r--r--lib/Sema/SemaConsumer.cpp7
-rw-r--r--lib/Sema/SemaCoroutine.cpp102
-rw-r--r--lib/Sema/SemaDecl.cpp1331
-rw-r--r--lib/Sema/SemaDeclAttr.cpp700
-rw-r--r--lib/Sema/SemaDeclCXX.cpp623
-rw-r--r--lib/Sema/SemaDeclObjC.cpp121
-rw-r--r--lib/Sema/SemaExceptionSpec.cpp42
-rw-r--r--lib/Sema/SemaExpr.cpp2122
-rw-r--r--lib/Sema/SemaExprCXX.cpp368
-rw-r--r--lib/Sema/SemaExprMember.cpp101
-rw-r--r--lib/Sema/SemaExprObjC.cpp92
-rw-r--r--lib/Sema/SemaFixItUtils.cpp7
-rw-r--r--lib/Sema/SemaInit.cpp480
-rw-r--r--lib/Sema/SemaLambda.cpp407
-rw-r--r--lib/Sema/SemaLookup.cpp390
-rw-r--r--lib/Sema/SemaModule.cpp710
-rw-r--r--lib/Sema/SemaObjCProperty.cpp27
-rw-r--r--lib/Sema/SemaOpenMP.cpp2385
-rw-r--r--lib/Sema/SemaOverload.cpp762
-rw-r--r--lib/Sema/SemaPseudoObject.cpp44
-rw-r--r--lib/Sema/SemaStmt.cpp149
-rw-r--r--lib/Sema/SemaStmtAsm.cpp180
-rw-r--r--lib/Sema/SemaStmtAttr.cpp77
-rw-r--r--lib/Sema/SemaTemplate.cpp609
-rw-r--r--lib/Sema/SemaTemplateDeduction.cpp54
-rw-r--r--lib/Sema/SemaTemplateInstantiate.cpp129
-rw-r--r--lib/Sema/SemaTemplateInstantiateDecl.cpp578
-rw-r--r--lib/Sema/SemaTemplateVariadic.cpp69
-rw-r--r--lib/Sema/SemaType.cpp508
-rw-r--r--lib/Sema/TreeTransform.h733
-rw-r--r--lib/Sema/TypeLocBuilder.cpp7
-rw-r--r--lib/Sema/TypeLocBuilder.h7
-rw-r--r--lib/Serialization/ASTCommon.cpp10
-rw-r--r--lib/Serialization/ASTCommon.h23
-rw-r--r--lib/Serialization/ASTReader.cpp1030
-rw-r--r--lib/Serialization/ASTReaderDecl.cpp189
-rw-r--r--lib/Serialization/ASTReaderInternals.h7
-rw-r--r--lib/Serialization/ASTReaderStmt.cpp220
-rw-r--r--lib/Serialization/ASTWriter.cpp212
-rw-r--r--lib/Serialization/ASTWriterDecl.cpp110
-rw-r--r--lib/Serialization/ASTWriterStmt.cpp131
-rw-r--r--lib/Serialization/GeneratePCH.cpp24
-rw-r--r--lib/Serialization/GlobalModuleIndex.cpp166
-rw-r--r--lib/Serialization/InMemoryModuleCache.cpp80
-rw-r--r--lib/Serialization/Module.cpp7
-rw-r--r--lib/Serialization/ModuleFileExtension.cpp7
-rw-r--r--lib/Serialization/ModuleManager.cpp60
-rw-r--r--lib/Serialization/MultiOnDiskHashTable.h7
-rw-r--r--lib/Serialization/PCHContainerOperations.cpp9
-rw-r--r--lib/StaticAnalyzer/Checkers/AllocationState.h7
-rw-r--r--lib/StaticAnalyzer/Checkers/AnalysisOrderChecker.cpp15
-rw-r--r--lib/StaticAnalyzer/Checkers/AnalyzerStatsChecker.cpp11
-rw-r--r--lib/StaticAnalyzer/Checkers/ArrayBoundChecker.cpp11
-rw-r--r--lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp15
-rw-r--r--lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp38
-rw-r--r--lib/StaticAnalyzer/Checkers/BlockInCriticalSectionChecker.cpp11
-rw-r--r--lib/StaticAnalyzer/Checkers/BoolAssignmentChecker.cpp11
-rw-r--r--lib/StaticAnalyzer/Checkers/BuiltinFunctionChecker.cpp53
-rw-r--r--lib/StaticAnalyzer/Checkers/CStringChecker.cpp237
-rw-r--r--lib/StaticAnalyzer/Checkers/CStringSyntaxChecker.cpp21
-rw-r--r--lib/StaticAnalyzer/Checkers/CXXSelfAssignmentChecker.cpp31
-rw-r--r--lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp45
-rw-r--r--lib/StaticAnalyzer/Checkers/CastSizeChecker.cpp14
-rw-r--r--lib/StaticAnalyzer/Checkers/CastToStructChecker.cpp11
-rw-r--r--lib/StaticAnalyzer/Checkers/CastValueChecker.cpp190
-rw-r--r--lib/StaticAnalyzer/Checkers/CheckObjCDealloc.cpp17
-rw-r--r--lib/StaticAnalyzer/Checkers/CheckObjCInstMethSignature.cpp13
-rw-r--r--lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp124
-rw-r--r--lib/StaticAnalyzer/Checkers/CheckSizeofPointer.cpp11
-rw-r--r--lib/StaticAnalyzer/Checkers/CheckerDocumentation.cpp9
-rw-r--r--lib/StaticAnalyzer/Checkers/ChrootChecker.cpp70
-rw-r--r--lib/StaticAnalyzer/Checkers/CloneChecker.cpp49
-rw-r--r--lib/StaticAnalyzer/Checkers/ConversionChecker.cpp11
-rw-r--r--lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp34
-rw-r--r--lib/StaticAnalyzer/Checkers/DebugCheckers.cpp129
-rw-r--r--lib/StaticAnalyzer/Checkers/DeleteWithNonVirtualDtorChecker.cpp12
-rw-r--r--lib/StaticAnalyzer/Checkers/DereferenceChecker.cpp13
-rw-r--r--lib/StaticAnalyzer/Checkers/DirectIvarAssignment.cpp30
-rw-r--r--lib/StaticAnalyzer/Checkers/DivZeroChecker.cpp17
-rw-r--r--lib/StaticAnalyzer/Checkers/DynamicTypeChecker.cpp11
-rw-r--r--lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp28
-rw-r--r--lib/StaticAnalyzer/Checkers/EnumCastOutOfRangeChecker.cpp11
-rw-r--r--lib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp20
-rw-r--r--lib/StaticAnalyzer/Checkers/FixedAddressChecker.cpp11
-rw-r--r--lib/StaticAnalyzer/Checkers/GCDAntipatternChecker.cpp15
-rw-r--r--lib/StaticAnalyzer/Checkers/GTestChecker.cpp17
-rw-r--r--lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp403
-rw-r--r--lib/StaticAnalyzer/Checkers/IdenticalExprChecker.cpp13
-rw-r--r--lib/StaticAnalyzer/Checkers/InnerPointerChecker.cpp11
-rw-r--r--lib/StaticAnalyzer/Checkers/InterCheckerAPI.h10
-rw-r--r--lib/StaticAnalyzer/Checkers/IteratorChecker.cpp609
-rw-r--r--lib/StaticAnalyzer/Checkers/IvarInvalidationChecker.cpp21
-rw-r--r--lib/StaticAnalyzer/Checkers/LLVMConventionsChecker.cpp11
-rw-r--r--lib/StaticAnalyzer/Checkers/LocalizationChecker.cpp29
-rw-r--r--lib/StaticAnalyzer/Checkers/MIGChecker.cpp295
-rw-r--r--lib/StaticAnalyzer/Checkers/MPI-Checker/MPIBugReporter.cpp7
-rw-r--r--lib/StaticAnalyzer/Checkers/MPI-Checker/MPIBugReporter.h7
-rw-r--r--lib/StaticAnalyzer/Checkers/MPI-Checker/MPIChecker.cpp11
-rw-r--r--lib/StaticAnalyzer/Checkers/MPI-Checker/MPIChecker.h7
-rw-r--r--lib/StaticAnalyzer/Checkers/MPI-Checker/MPIFunctionClassifier.cpp7
-rw-r--r--lib/StaticAnalyzer/Checkers/MPI-Checker/MPITypes.h7
-rw-r--r--lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp11
-rw-r--r--lib/StaticAnalyzer/Checkers/MacOSXAPIChecker.cpp11
-rw-r--r--lib/StaticAnalyzer/Checkers/MallocChecker.cpp134
-rw-r--r--lib/StaticAnalyzer/Checkers/MallocOverflowSecurityChecker.cpp14
-rw-r--r--lib/StaticAnalyzer/Checkers/MallocSizeofChecker.cpp11
-rw-r--r--lib/StaticAnalyzer/Checkers/MmapWriteExecChecker.cpp15
-rw-r--r--lib/StaticAnalyzer/Checkers/Move.h30
-rw-r--r--lib/StaticAnalyzer/Checkers/MoveChecker.cpp40
-rw-r--r--lib/StaticAnalyzer/Checkers/NSAutoreleasePoolChecker.cpp14
-rw-r--r--lib/StaticAnalyzer/Checkers/NSErrorChecker.cpp29
-rw-r--r--lib/StaticAnalyzer/Checkers/NoReturnFunctionChecker.cpp11
-rw-r--r--lib/StaticAnalyzer/Checkers/NonNullParamChecker.cpp11
-rw-r--r--lib/StaticAnalyzer/Checkers/NonnullGlobalConstantsChecker.cpp34
-rw-r--r--lib/StaticAnalyzer/Checkers/NullabilityChecker.cpp29
-rw-r--r--lib/StaticAnalyzer/Checkers/NumberObjectConversionChecker.cpp13
-rw-r--r--lib/StaticAnalyzer/Checkers/OSObjectCStyleCast.cpp90
-rw-r--r--lib/StaticAnalyzer/Checkers/ObjCAtSyncChecker.cpp14
-rw-r--r--lib/StaticAnalyzer/Checkers/ObjCAutoreleaseWriteChecker.cpp13
-rw-r--r--lib/StaticAnalyzer/Checkers/ObjCContainersASTChecker.cpp11
-rw-r--r--lib/StaticAnalyzer/Checkers/ObjCContainersChecker.cpp11
-rw-r--r--lib/StaticAnalyzer/Checkers/ObjCMissingSuperCallChecker.cpp10
-rw-r--r--lib/StaticAnalyzer/Checkers/ObjCPropertyChecker.cpp11
-rw-r--r--lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp11
-rw-r--r--lib/StaticAnalyzer/Checkers/ObjCSuperDeallocChecker.cpp14
-rw-r--r--lib/StaticAnalyzer/Checkers/ObjCUnusedIVarsChecker.cpp11
-rw-r--r--lib/StaticAnalyzer/Checkers/PaddingChecker.cpp32
-rw-r--r--lib/StaticAnalyzer/Checkers/PointerArithChecker.cpp11
-rw-r--r--lib/StaticAnalyzer/Checkers/PointerIterationChecker.cpp100
-rw-r--r--lib/StaticAnalyzer/Checkers/PointerSortingChecker.cpp113
-rw-r--r--lib/StaticAnalyzer/Checkers/PointerSubChecker.cpp11
-rw-r--r--lib/StaticAnalyzer/Checkers/PthreadLockChecker.cpp11
-rw-r--r--lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountChecker.cpp445
-rw-r--r--lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountChecker.h63
-rw-r--r--lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.cpp186
-rw-r--r--lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountDiagnostics.h52
-rw-r--r--lib/StaticAnalyzer/Checkers/ReturnPointerRangeChecker.cpp11
-rw-r--r--lib/StaticAnalyzer/Checkers/ReturnUndefChecker.cpp11
-rw-r--r--lib/StaticAnalyzer/Checkers/ReturnValueChecker.cpp170
-rw-r--r--lib/StaticAnalyzer/Checkers/RunLoopAutoreleaseLeakChecker.cpp13
-rw-r--r--lib/StaticAnalyzer/Checkers/SimpleStreamChecker.cpp18
-rw-r--r--lib/StaticAnalyzer/Checkers/SmartPtrModeling.cpp72
-rw-r--r--lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp29
-rw-r--r--lib/StaticAnalyzer/Checkers/StdLibraryFunctionsChecker.cpp21
-rw-r--r--lib/StaticAnalyzer/Checkers/StreamChecker.cpp22
-rw-r--r--lib/StaticAnalyzer/Checkers/Taint.cpp227
-rw-r--r--lib/StaticAnalyzer/Checkers/Taint.h102
-rw-r--r--lib/StaticAnalyzer/Checkers/TaintTesterChecker.cpp16
-rw-r--r--lib/StaticAnalyzer/Checkers/TestAfterDivZeroChecker.cpp11
-rw-r--r--lib/StaticAnalyzer/Checkers/TraversalChecker.cpp15
-rw-r--r--lib/StaticAnalyzer/Checkers/TrustNonnullChecker.cpp16
-rw-r--r--lib/StaticAnalyzer/Checkers/UndefBranchChecker.cpp11
-rw-r--r--lib/StaticAnalyzer/Checkers/UndefCapturedBlockVarChecker.cpp11
-rw-r--r--lib/StaticAnalyzer/Checkers/UndefResultChecker.cpp11
-rw-r--r--lib/StaticAnalyzer/Checkers/UndefinedArraySubscriptChecker.cpp11
-rw-r--r--lib/StaticAnalyzer/Checkers/UndefinedAssignmentChecker.cpp11
-rw-r--r--lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedObject.h37
-rw-r--r--lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedObjectChecker.cpp129
-rw-r--r--lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedPointee.cpp7
-rw-r--r--lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp238
-rw-r--r--lib/StaticAnalyzer/Checkers/UnreachableCodeChecker.cpp15
-rw-r--r--lib/StaticAnalyzer/Checkers/VLASizeChecker.cpp15
-rw-r--r--lib/StaticAnalyzer/Checkers/ValistChecker.cpp25
-rw-r--r--lib/StaticAnalyzer/Checkers/VforkChecker.cpp11
-rw-r--r--lib/StaticAnalyzer/Checkers/VirtualCallChecker.cpp14
-rw-r--r--lib/StaticAnalyzer/Core/APSIntType.cpp7
-rw-r--r--lib/StaticAnalyzer/Core/AnalysisManager.cpp13
-rw-r--r--lib/StaticAnalyzer/Core/AnalyzerOptions.cpp119
-rw-r--r--lib/StaticAnalyzer/Core/BasicValueFactory.cpp17
-rw-r--r--lib/StaticAnalyzer/Core/BlockCounter.cpp7
-rw-r--r--lib/StaticAnalyzer/Core/BugReporter.cpp47
-rw-r--r--lib/StaticAnalyzer/Core/BugReporterVisitors.cpp1365
-rw-r--r--lib/StaticAnalyzer/Core/CallEvent.cpp37
-rw-r--r--lib/StaticAnalyzer/Core/Checker.cpp7
-rw-r--r--lib/StaticAnalyzer/Core/CheckerContext.cpp7
-rw-r--r--lib/StaticAnalyzer/Core/CheckerHelpers.cpp7
-rw-r--r--lib/StaticAnalyzer/Core/CheckerManager.cpp104
-rw-r--r--lib/StaticAnalyzer/Core/CommonBugCategories.cpp7
-rw-r--r--lib/StaticAnalyzer/Core/ConstraintManager.cpp7
-rw-r--r--lib/StaticAnalyzer/Core/CoreEngine.cpp63
-rw-r--r--lib/StaticAnalyzer/Core/DynamicTypeMap.cpp53
-rw-r--r--lib/StaticAnalyzer/Core/Environment.cpp87
-rw-r--r--lib/StaticAnalyzer/Core/ExplodedGraph.cpp7
-rw-r--r--lib/StaticAnalyzer/Core/ExprEngine.cpp282
-rw-r--r--lib/StaticAnalyzer/Core/ExprEngineC.cpp54
-rw-r--r--lib/StaticAnalyzer/Core/ExprEngineCXX.cpp55
-rw-r--r--lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp78
-rw-r--r--lib/StaticAnalyzer/Core/ExprEngineObjC.cpp7
-rw-r--r--lib/StaticAnalyzer/Core/FunctionSummary.cpp7
-rw-r--r--lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp133
-rw-r--r--lib/StaticAnalyzer/Core/IssueHash.cpp11
-rw-r--r--lib/StaticAnalyzer/Core/LoopUnrolling.cpp9
-rw-r--r--lib/StaticAnalyzer/Core/LoopWidening.cpp7
-rw-r--r--lib/StaticAnalyzer/Core/MemRegion.cpp10
-rw-r--r--lib/StaticAnalyzer/Core/PathDiagnostic.cpp70
-rw-r--r--lib/StaticAnalyzer/Core/PlistDiagnostics.cpp136
-rw-r--r--lib/StaticAnalyzer/Core/PrettyStackTraceLocationContext.h13
-rw-r--r--lib/StaticAnalyzer/Core/ProgramState.cpp229
-rw-r--r--lib/StaticAnalyzer/Core/RangeConstraintManager.cpp86
-rw-r--r--lib/StaticAnalyzer/Core/RangedConstraintManager.cpp7
-rw-r--r--lib/StaticAnalyzer/Core/RegionStore.cpp227
-rw-r--r--lib/StaticAnalyzer/Core/SMTConstraintManager.cpp18
-rw-r--r--lib/StaticAnalyzer/Core/SValBuilder.cpp7
-rw-r--r--lib/StaticAnalyzer/Core/SVals.cpp19
-rw-r--r--lib/StaticAnalyzer/Core/SarifDiagnostics.cpp24
-rw-r--r--lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp7
-rw-r--r--lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp19
-rw-r--r--lib/StaticAnalyzer/Core/Store.cpp7
-rw-r--r--lib/StaticAnalyzer/Core/SubEngine.cpp7
-rw-r--r--lib/StaticAnalyzer/Core/SymbolManager.cpp17
-rw-r--r--lib/StaticAnalyzer/Core/TaintManager.cpp23
-rw-r--r--lib/StaticAnalyzer/Core/WorkList.cpp7
-rw-r--r--lib/StaticAnalyzer/Core/Z3ConstraintManager.cpp841
-rw-r--r--lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp94
-rw-r--r--lib/StaticAnalyzer/Frontend/CheckerRegistration.cpp83
-rw-r--r--lib/StaticAnalyzer/Frontend/CheckerRegistry.cpp659
-rw-r--r--lib/StaticAnalyzer/Frontend/FrontendActions.cpp7
-rw-r--r--lib/StaticAnalyzer/Frontend/ModelConsumer.cpp7
-rw-r--r--lib/StaticAnalyzer/Frontend/ModelInjector.cpp9
-rw-r--r--lib/StaticAnalyzer/Frontend/ModelInjector.h7
-rw-r--r--lib/Tooling/ASTDiff/ASTDiff.cpp11
-rw-r--r--lib/Tooling/AllTUsExecution.cpp28
-rw-r--r--lib/Tooling/ArgumentsAdjusters.cpp35
-rw-r--r--lib/Tooling/CommonOptionsParser.cpp11
-rw-r--r--lib/Tooling/CompilationDatabase.cpp7
-rw-r--r--lib/Tooling/Core/Diagnostic.cpp22
-rw-r--r--lib/Tooling/Core/Lookup.cpp92
-rw-r--r--lib/Tooling/Core/Replacement.cpp18
-rw-r--r--lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp149
-rw-r--r--lib/Tooling/Execution.cpp7
-rw-r--r--lib/Tooling/FileMatchTrie.cpp7
-rw-r--r--lib/Tooling/FixIt.cpp14
-rw-r--r--lib/Tooling/GuessTargetAndModeCompilationDatabase.cpp57
-rw-r--r--lib/Tooling/Inclusions/HeaderIncludes.cpp69
-rw-r--r--lib/Tooling/Inclusions/IncludeStyle.cpp7
-rw-r--r--lib/Tooling/InterpolatingCompilationDatabase.cpp28
-rw-r--r--lib/Tooling/JSONCompilationDatabase.cpp69
-rw-r--r--lib/Tooling/Refactoring.cpp7
-rw-r--r--lib/Tooling/Refactoring/ASTSelection.cpp7
-rw-r--r--lib/Tooling/Refactoring/ASTSelectionRequirements.cpp7
-rw-r--r--lib/Tooling/Refactoring/AtomicChange.cpp7
-rw-r--r--lib/Tooling/Refactoring/Extract/Extract.cpp7
-rw-r--r--lib/Tooling/Refactoring/Extract/SourceExtraction.cpp7
-rw-r--r--lib/Tooling/Refactoring/Extract/SourceExtraction.h7
-rw-r--r--lib/Tooling/Refactoring/RangeSelector.cpp296
-rw-r--r--lib/Tooling/Refactoring/RefactoringActions.cpp7
-rw-r--r--lib/Tooling/Refactoring/Rename/RenamingAction.cpp9
-rw-r--r--lib/Tooling/Refactoring/Rename/SymbolOccurrences.cpp7
-rw-r--r--lib/Tooling/Refactoring/Rename/USRFinder.cpp7
-rw-r--r--lib/Tooling/Refactoring/Rename/USRFindingAction.cpp7
-rw-r--r--lib/Tooling/Refactoring/Rename/USRLocFinder.cpp11
-rw-r--r--lib/Tooling/Refactoring/SourceCode.cpp31
-rw-r--r--lib/Tooling/Refactoring/Stencil.cpp175
-rw-r--r--lib/Tooling/Refactoring/Transformer.cpp263
-rw-r--r--lib/Tooling/RefactoringCallbacks.cpp7
-rw-r--r--lib/Tooling/StandaloneExecution.cpp7
-rw-r--r--lib/Tooling/Syntax/BuildTree.cpp273
-rw-r--r--lib/Tooling/Syntax/Nodes.cpp35
-rw-r--r--lib/Tooling/Syntax/Tokens.cpp618
-rw-r--r--lib/Tooling/Syntax/Tree.cpp149
-rw-r--r--lib/Tooling/Tooling.cpp18
-rw-r--r--tools/clang-format/ClangFormat.cpp39
-rw-r--r--tools/driver/cc1_main.cpp62
-rw-r--r--tools/driver/cc1as_main.cpp43
-rw-r--r--tools/driver/cc1gen_reproducer_main.cpp7
-rw-r--r--tools/driver/driver.cpp9
-rw-r--r--utils/TableGen/ClangASTNodesEmitter.cpp7
-rw-r--r--utils/TableGen/ClangAttrEmitter.cpp153
-rw-r--r--utils/TableGen/ClangCommentCommandInfoEmitter.cpp7
-rw-r--r--utils/TableGen/ClangCommentHTMLNamedCharacterReferenceEmitter.cpp7
-rw-r--r--utils/TableGen/ClangCommentHTMLTagsEmitter.cpp7
-rw-r--r--utils/TableGen/ClangDiagnosticsEmitter.cpp7
-rw-r--r--utils/TableGen/ClangOpenCLBuiltinEmitter.cpp318
-rw-r--r--utils/TableGen/ClangOptionDocEmitter.cpp7
-rw-r--r--utils/TableGen/ClangSACheckersEmitter.cpp223
-rw-r--r--utils/TableGen/NeonEmitter.cpp19
-rw-r--r--utils/TableGen/TableGen.cpp13
-rw-r--r--utils/TableGen/TableGenBackends.h68
1530 files changed, 83153 insertions, 36409 deletions
diff --git a/LICENSE.TXT b/LICENSE.TXT
index 9e71121218a6..24806ab4c9eb 100644
--- a/LICENSE.TXT
+++ b/LICENSE.TXT
@@ -1,5 +1,240 @@
==============================================================================
-LLVM Release License
+The LLVM Project is under the Apache License v2.0 with LLVM Exceptions:
+==============================================================================
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+
+---- LLVM Exceptions to the Apache 2.0 License ----
+
+As an exception, if, as a result of your compiling your source code, portions
+of this Software are embedded into an Object form of such source code, you
+may redistribute such embedded portions in such Object form without complying
+with the conditions of Sections 4(a), 4(b) and 4(d) of the License.
+
+In addition, if you combine or link compiled forms of this Software with
+software that is licensed under the GPLv2 ("Combined Software") and if a
+court of competent jurisdiction determines that the patent provision (Section
+3), the indemnity provision (Section 9) or other Section of the License
+conflicts with the conditions of the GPLv2, you may retroactively and
+prospectively choose to deem waived or otherwise exclude such Section(s) of
+the License, but only in their entirety and only with respect to the Combined
+Software.
+
+==============================================================================
+Software from third parties included in the LLVM Project:
+==============================================================================
+The LLVM Project contains third party software which is under different license
+terms. All such code will be identified clearly using at least one of two
+mechanisms:
+1) It will be in a separate directory tree with its own `LICENSE.txt` or
+ `LICENSE` file at the top containing the specific license and restrictions
+ which apply to that software, or
+2) It will contain specific license and restriction terms at the top of every
+ file.
+
+==============================================================================
+Legacy LLVM License (https://llvm.org/docs/DeveloperPolicy.html#legacy):
==============================================================================
University of Illinois/NCSA
Open Source License
@@ -41,23 +276,3 @@ CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE
SOFTWARE.
-
-==============================================================================
-The LLVM software contains code written by third parties. Such software will
-have its own individual LICENSE.TXT file in the directory in which it appears.
-This file will describe the copyrights, license, and restrictions which apply
-to that code.
-
-The disclaimer of warranty in the University of Illinois Open Source License
-applies to all code in the LLVM Distribution, and nothing in any of the
-other licenses gives permission to use the names of the LLVM Team or the
-University of Illinois to endorse or promote products derived from this
-Software.
-
-The following pieces of software have additional or alternate copyrights,
-licenses, and/or restrictions:
-
-Program Directory
-------- ---------
-<none yet>
-
diff --git a/include/clang-c/BuildSystem.h b/include/clang-c/BuildSystem.h
index 3cfec388308c..8f26a8611719 100644
--- a/include/clang-c/BuildSystem.h
+++ b/include/clang-c/BuildSystem.h
@@ -1,9 +1,9 @@
/*==-- clang-c/BuildSystem.h - Utilities for use by build systems -*- C -*-===*\
|* *|
-|* The LLVM Compiler Infrastructure *|
-|* *|
-|* This file is distributed under the University of Illinois Open Source *|
-|* License. See LICENSE.TXT for details. *|
+|* Part of the LLVM Project, under the Apache License v2.0 with LLVM *|
+|* Exceptions. *|
+|* See https://llvm.org/LICENSE.txt for license information. *|
+|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception *|
|* *|
|*===----------------------------------------------------------------------===*|
|* *|
diff --git a/include/clang-c/CXCompilationDatabase.h b/include/clang-c/CXCompilationDatabase.h
index 6f483ee28b56..2669c1a792c1 100644
--- a/include/clang-c/CXCompilationDatabase.h
+++ b/include/clang-c/CXCompilationDatabase.h
@@ -1,9 +1,9 @@
/*===-- clang-c/CXCompilationDatabase.h - Compilation database ---*- C -*-===*\
|* *|
-|* The LLVM Compiler Infrastructure *|
-|* *|
-|* This file is distributed under the University of Illinois Open Source *|
-|* License. See LICENSE.TXT for details. *|
+|* Part of the LLVM Project, under the Apache License v2.0 with LLVM *|
+|* Exceptions. *|
+|* See https://llvm.org/LICENSE.txt for license information. *|
+|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception *|
|* *|
|*===----------------------------------------------------------------------===*|
|* *|
diff --git a/include/clang-c/CXErrorCode.h b/include/clang-c/CXErrorCode.h
index caee48d76832..fed195ec1f33 100644
--- a/include/clang-c/CXErrorCode.h
+++ b/include/clang-c/CXErrorCode.h
@@ -1,9 +1,9 @@
/*===-- clang-c/CXErrorCode.h - C Index Error Codes --------------*- C -*-===*\
|* *|
-|* The LLVM Compiler Infrastructure *|
-|* *|
-|* This file is distributed under the University of Illinois Open Source *|
-|* License. See LICENSE.TXT for details. *|
+|* Part of the LLVM Project, under the Apache License v2.0 with LLVM *|
+|* Exceptions. *|
+|* See https://llvm.org/LICENSE.txt for license information. *|
+|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception *|
|* *|
|*===----------------------------------------------------------------------===*|
|* *|
diff --git a/include/clang-c/CXString.h b/include/clang-c/CXString.h
index 76eeda180109..1eb3442ccb24 100644
--- a/include/clang-c/CXString.h
+++ b/include/clang-c/CXString.h
@@ -1,9 +1,9 @@
/*===-- clang-c/CXString.h - C Index strings --------------------*- C -*-===*\
|* *|
-|* The LLVM Compiler Infrastructure *|
-|* *|
-|* This file is distributed under the University of Illinois Open Source *|
-|* License. See LICENSE.TXT for details. *|
+|* Part of the LLVM Project, under the Apache License v2.0 with LLVM *|
+|* Exceptions. *|
+|* See https://llvm.org/LICENSE.txt for license information. *|
+|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception *|
|* *|
|*===----------------------------------------------------------------------===*|
|* *|
diff --git a/include/clang-c/Documentation.h b/include/clang-c/Documentation.h
index 58c8af5aa47c..4af8c93a367e 100644
--- a/include/clang-c/Documentation.h
+++ b/include/clang-c/Documentation.h
@@ -1,9 +1,9 @@
/*==-- clang-c/Documentation.h - Utilities for comment processing -*- C -*-===*\
|* *|
-|* The LLVM Compiler Infrastructure *|
-|* *|
-|* This file is distributed under the University of Illinois Open Source *|
-|* License. See LICENSE.TXT for details. *|
+|* Part of the LLVM Project, under the Apache License v2.0 with LLVM *|
+|* Exceptions. *|
+|* See https://llvm.org/LICENSE.txt for license information. *|
+|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception *|
|* *|
|*===----------------------------------------------------------------------===*|
|* *|
diff --git a/include/clang-c/Index.h b/include/clang-c/Index.h
index c51dfb1598b9..74badac740b6 100644
--- a/include/clang-c/Index.h
+++ b/include/clang-c/Index.h
@@ -1,9 +1,9 @@
/*===-- clang-c/Index.h - Indexing Public C Interface -------------*- C -*-===*\
|* *|
-|* The LLVM Compiler Infrastructure *|
-|* *|
-|* This file is distributed under the University of Illinois Open Source *|
-|* License. See LICENSE.TXT for details. *|
+|* Part of the LLVM Project, under the Apache License v2.0 with LLVM *|
+|* Exceptions. *|
+|* See https://llvm.org/LICENSE.txt for license information. *|
+|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception *|
|* *|
|*===----------------------------------------------------------------------===*|
|* *|
@@ -32,7 +32,7 @@
* compatible, thus CINDEX_VERSION_MAJOR is expected to remain stable.
*/
#define CINDEX_VERSION_MAJOR 0
-#define CINDEX_VERSION_MINOR 50
+#define CINDEX_VERSION_MINOR 59
#define CINDEX_VERSION_ENCODE(major, minor) ( \
((major) * 10000) \
@@ -221,7 +221,12 @@ enum CXCursor_ExceptionSpecificationKind {
/**
* The exception specification has not been parsed yet.
*/
- CXCursor_ExceptionSpecificationKind_Unparsed
+ CXCursor_ExceptionSpecificationKind_Unparsed,
+
+ /**
+ * The cursor has a __declspec(nothrow) exception specification.
+ */
+ CXCursor_ExceptionSpecificationKind_NoThrow
};
/**
@@ -1341,7 +1346,17 @@ enum CXTranslationUnit_Flags {
/**
* Used to indicate that implicit attributes should be visited.
*/
- CXTranslationUnit_VisitImplicitAttributes = 0x2000
+ CXTranslationUnit_VisitImplicitAttributes = 0x2000,
+
+ /**
+ * Used to indicate that non-errors from included files should be ignored.
+ *
+ * If set, clang_getDiagnosticSetFromTU() will not report e.g. warnings from
+ * included files anymore. This speeds up clang_getDiagnosticSetFromTU() for
+ * the case where these warnings are not of interest, as for an IDE for
+ * example, which typically shows only the diagnostics in the main file.
+ */
+ CXTranslationUnit_IgnoreNonErrorsFromIncludedFiles = 0x4000
};
/**
@@ -2531,7 +2546,11 @@ enum CXCursorKind {
*/
CXCursor_OMPTargetTeamsDistributeSimdDirective = 279,
- CXCursor_LastStmt = CXCursor_OMPTargetTeamsDistributeSimdDirective,
+ /** C++2a std::bit_cast expression.
+ */
+ CXCursor_BuiltinBitCastExpr = 280,
+
+ CXCursor_LastStmt = CXCursor_BuiltinBitCastExpr,
/**
* Cursor that represents the translation unit itself.
@@ -2586,7 +2605,11 @@ enum CXCursorKind {
CXCursor_ObjCRuntimeVisible = 435,
CXCursor_ObjCBoxable = 436,
CXCursor_FlagEnum = 437,
- CXCursor_LastAttr = CXCursor_FlagEnum,
+ CXCursor_ConvergentAttr = 438,
+ CXCursor_WarnUnusedAttr = 439,
+ CXCursor_WarnUnusedResultAttr = 440,
+ CXCursor_AlignedAttr = 441,
+ CXCursor_LastAttr = CXCursor_AlignedAttr,
/* Preprocessing */
CXCursor_PreprocessingDirective = 500,
@@ -3311,7 +3334,9 @@ enum CXTypeKind {
CXType_OCLIntelSubgroupAVCImeResultDualRefStreamout = 173,
CXType_OCLIntelSubgroupAVCImeSingleRefStreamin = 174,
- CXType_OCLIntelSubgroupAVCImeDualRefStreamin = 175
+ CXType_OCLIntelSubgroupAVCImeDualRefStreamin = 175,
+
+ CXType_ExtVector = 176
};
/**
@@ -3838,7 +3863,11 @@ enum CXTypeLayoutError {
/**
* The Field name is not valid for this record.
*/
- CXTypeLayoutError_InvalidFieldName = -5
+ CXTypeLayoutError_InvalidFieldName = -5,
+ /**
+ * The type is undeduced.
+ */
+ CXTypeLayoutError_Undeduced = -6
};
/**
@@ -3911,10 +3940,22 @@ CINDEX_LINKAGE CXType clang_Type_getModifiedType(CXType T);
CINDEX_LINKAGE long long clang_Cursor_getOffsetOfField(CXCursor C);
/**
+ * Determine whether the given cursor represents an anonymous
+ * tag or namespace
+ */
+CINDEX_LINKAGE unsigned clang_Cursor_isAnonymous(CXCursor C);
+
+/**
* Determine whether the given cursor represents an anonymous record
* declaration.
*/
-CINDEX_LINKAGE unsigned clang_Cursor_isAnonymous(CXCursor C);
+CINDEX_LINKAGE unsigned clang_Cursor_isAnonymousRecordDecl(CXCursor C);
+
+/**
+ * Determine whether the given cursor represents an inline namespace
+ * declaration.
+ */
+CINDEX_LINKAGE unsigned clang_Cursor_isInlineNamespace(CXCursor C);
enum CXRefQualifierKind {
/** No ref-qualifier was provided. */
diff --git a/include/clang-c/Platform.h b/include/clang-c/Platform.h
index e2a4dccbdaf0..5284b533253d 100644
--- a/include/clang-c/Platform.h
+++ b/include/clang-c/Platform.h
@@ -1,9 +1,9 @@
/*===-- clang-c/Platform.h - C Index platform decls -------------*- C -*-===*\
|* *|
-|* The LLVM Compiler Infrastructure *|
-|* *|
-|* This file is distributed under the University of Illinois Open Source *|
-|* License. See LICENSE.TXT for details. *|
+|* Part of the LLVM Project, under the Apache License v2.0 with LLVM *|
+|* Exceptions. *|
+|* See https://llvm.org/LICENSE.txt for license information. *|
+|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception *|
|* *|
|*===----------------------------------------------------------------------===*|
|* *|
diff --git a/include/clang/ARCMigrate/ARCMT.h b/include/clang/ARCMigrate/ARCMT.h
index 30c24f1cdb10..49e94a92cd0b 100644
--- a/include/clang/ARCMigrate/ARCMT.h
+++ b/include/clang/ARCMigrate/ARCMT.h
@@ -1,9 +1,8 @@
//===-- ARCMT.h - ARC Migration Rewriter ------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/clang/ARCMigrate/ARCMTActions.h b/include/clang/ARCMigrate/ARCMTActions.h
index 2571ca75be51..641c259b3867 100644
--- a/include/clang/ARCMigrate/ARCMTActions.h
+++ b/include/clang/ARCMigrate/ARCMTActions.h
@@ -1,9 +1,8 @@
//===--- ARCMTActions.h - ARC Migrate Tool Frontend Actions -----*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/clang/ARCMigrate/FileRemapper.h b/include/clang/ARCMigrate/FileRemapper.h
index 731307f24e22..76b65b2f6884 100644
--- a/include/clang/ARCMigrate/FileRemapper.h
+++ b/include/clang/ARCMigrate/FileRemapper.h
@@ -1,9 +1,8 @@
//===-- FileRemapper.h - File Remapping Helper ------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/clang/AST/APValue.h b/include/clang/AST/APValue.h
index d4057c9da5f3..6943479831ec 100644
--- a/include/clang/AST/APValue.h
+++ b/include/clang/AST/APValue.h
@@ -1,9 +1,8 @@
//===--- APValue.h - Union class for APFloat/APSInt/Complex -----*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
@@ -14,6 +13,7 @@
#ifndef LLVM_CLANG_AST_APVALUE_H
#define LLVM_CLANG_AST_APVALUE_H
+#include "clang/Basic/FixedPoint.h"
#include "clang/Basic/LLVM.h"
#include "llvm/ADT/APFloat.h"
#include "llvm/ADT/APSInt.h"
@@ -24,14 +24,52 @@ namespace clang {
class AddrLabelExpr;
class ASTContext;
class CharUnits;
+ class CXXRecordDecl;
+ class Decl;
class DiagnosticBuilder;
class Expr;
class FieldDecl;
- class Decl;
+ struct PrintingPolicy;
+ class Type;
class ValueDecl;
- class CXXRecordDecl;
- class QualType;
+/// Symbolic representation of typeid(T) for some type T.
+class TypeInfoLValue {
+ const Type *T;
+
+public:
+ TypeInfoLValue() : T() {}
+ explicit TypeInfoLValue(const Type *T);
+
+ const Type *getType() const { return T; }
+ explicit operator bool() const { return T; }
+
+ void *getOpaqueValue() { return const_cast<Type*>(T); }
+ static TypeInfoLValue getFromOpaqueValue(void *Value) {
+ TypeInfoLValue V;
+ V.T = reinterpret_cast<const Type*>(Value);
+ return V;
+ }
+
+ void print(llvm::raw_ostream &Out, const PrintingPolicy &Policy) const;
+};
+}
+
+namespace llvm {
+template<> struct PointerLikeTypeTraits<clang::TypeInfoLValue> {
+ static void *getAsVoidPointer(clang::TypeInfoLValue V) {
+ return V.getOpaqueValue();
+ }
+ static clang::TypeInfoLValue getFromVoidPointer(void *P) {
+ return clang::TypeInfoLValue::getFromOpaqueValue(P);
+ }
+ // Validated by static_assert in APValue.cpp; hardcoded to avoid needing
+ // to include Type.h.
+ static constexpr int NumLowBitsAvailable = 3;
+};
+}
+
+namespace clang {
/// APValue - This class implements a discriminated union of [uninitialized]
/// [APSInt] [APFloat], [Complex APSInt] [Complex APFloat], [Expr + Offset],
/// [Vector: N * APValue], [Array: N * APValue]
@@ -40,9 +78,13 @@ class APValue {
typedef llvm::APFloat APFloat;
public:
enum ValueKind {
- Uninitialized,
+ /// There is no such object (it's outside its lifetime).
+ None,
+ /// This object has an indeterminate value (C++ [basic.indet]).
+ Indeterminate,
Int,
Float,
+ FixedPoint,
ComplexInt,
ComplexFloat,
LValue,
@@ -55,14 +97,14 @@ public:
};
class LValueBase {
- public:
- typedef llvm::PointerUnion<const ValueDecl *, const Expr *> PtrTy;
+ typedef llvm::PointerUnion<const ValueDecl *, const Expr *, TypeInfoLValue>
+ PtrTy;
- LValueBase() : CallIndex(0), Version(0) {}
-
- template <class T>
- LValueBase(T P, unsigned I = 0, unsigned V = 0)
- : Ptr(P), CallIndex(I), Version(V) {}
+ public:
+ LValueBase() : Local{} {}
+ LValueBase(const ValueDecl *P, unsigned I = 0, unsigned V = 0);
+ LValueBase(const Expr *P, unsigned I = 0, unsigned V = 0);
+ static LValueBase getTypeInfo(TypeInfoLValue LV, QualType TypeInfo);
template <class T>
bool is() const { return Ptr.is<T>(); }
@@ -77,45 +119,73 @@ public:
bool isNull() const;
- explicit operator bool () const;
+ explicit operator bool() const;
- PtrTy getPointer() const {
- return Ptr;
- }
+ unsigned getCallIndex() const;
+ unsigned getVersion() const;
+ QualType getTypeInfoType() const;
- unsigned getCallIndex() const {
- return CallIndex;
- }
-
- void setCallIndex(unsigned Index) {
- CallIndex = Index;
- }
-
- unsigned getVersion() const {
- return Version;
- }
-
- bool operator==(const LValueBase &Other) const {
- return Ptr == Other.Ptr && CallIndex == Other.CallIndex &&
- Version == Other.Version;
+ friend bool operator==(const LValueBase &LHS, const LValueBase &RHS);
+ friend bool operator!=(const LValueBase &LHS, const LValueBase &RHS) {
+ return !(LHS == RHS);
}
+ friend llvm::hash_code hash_value(const LValueBase &Base);
private:
PtrTy Ptr;
- unsigned CallIndex, Version;
+ struct LocalState {
+ unsigned CallIndex, Version;
+ };
+ union {
+ LocalState Local;
+ /// The type std::type_info, if this is a TypeInfoLValue.
+ void *TypeInfoType;
+ };
};
+ /// A FieldDecl or CXXRecordDecl, along with a flag indicating whether we
+ /// mean a virtual or non-virtual base class subobject.
typedef llvm::PointerIntPair<const Decl *, 1, bool> BaseOrMemberType;
- union LValuePathEntry {
- /// BaseOrMember - The FieldDecl or CXXRecordDecl indicating the next item
- /// in the path. An opaque value of type BaseOrMemberType.
- void *BaseOrMember;
- /// ArrayIndex - The array index of the next item in the path.
- uint64_t ArrayIndex;
+
+ /// A non-discriminated union of a base, field, or array index.
+ class LValuePathEntry {
+ static_assert(sizeof(uintptr_t) <= sizeof(uint64_t),
+ "pointer doesn't fit in 64 bits?");
+ uint64_t Value;
+
+ public:
+ LValuePathEntry() : Value() {}
+ LValuePathEntry(BaseOrMemberType BaseOrMember)
+ : Value{reinterpret_cast<uintptr_t>(BaseOrMember.getOpaqueValue())} {}
+ static LValuePathEntry ArrayIndex(uint64_t Index) {
+ LValuePathEntry Result;
+ Result.Value = Index;
+ return Result;
+ }
+
+ BaseOrMemberType getAsBaseOrMember() const {
+ return BaseOrMemberType::getFromOpaqueValue(
+ reinterpret_cast<void *>(Value));
+ }
+ uint64_t getAsArrayIndex() const { return Value; }
+
+ friend bool operator==(LValuePathEntry A, LValuePathEntry B) {
+ return A.Value == B.Value;
+ }
+ friend bool operator!=(LValuePathEntry A, LValuePathEntry B) {
+ return A.Value != B.Value;
+ }
+ friend llvm::hash_code hash_value(LValuePathEntry A) {
+ return llvm::hash_value(A.Value);
+ }
};
struct NoLValuePath {};
struct UninitArray {};
struct UninitStruct {};
+
+ friend class ASTReader;
+ friend class ASTWriter;
+
private:
ValueKind Kind;
@@ -168,55 +238,64 @@ private:
DataType Data;
public:
- APValue() : Kind(Uninitialized) {}
- explicit APValue(APSInt I) : Kind(Uninitialized) {
+ APValue() : Kind(None) {}
+ explicit APValue(APSInt I) : Kind(None) {
MakeInt(); setInt(std::move(I));
}
- explicit APValue(APFloat F) : Kind(Uninitialized) {
+ explicit APValue(APFloat F) : Kind(None) {
MakeFloat(); setFloat(std::move(F));
}
- explicit APValue(const APValue *E, unsigned N) : Kind(Uninitialized) {
+ explicit APValue(APFixedPoint FX) : Kind(None) {
+ MakeFixedPoint(std::move(FX));
+ }
+ explicit APValue(const APValue *E, unsigned N) : Kind(None) {
MakeVector(); setVector(E, N);
}
- APValue(APSInt R, APSInt I) : Kind(Uninitialized) {
+ APValue(APSInt R, APSInt I) : Kind(None) {
MakeComplexInt(); setComplexInt(std::move(R), std::move(I));
}
- APValue(APFloat R, APFloat I) : Kind(Uninitialized) {
+ APValue(APFloat R, APFloat I) : Kind(None) {
MakeComplexFloat(); setComplexFloat(std::move(R), std::move(I));
}
APValue(const APValue &RHS);
- APValue(APValue &&RHS) : Kind(Uninitialized) { swap(RHS); }
+ APValue(APValue &&RHS) : Kind(None) { swap(RHS); }
APValue(LValueBase B, const CharUnits &O, NoLValuePath N,
bool IsNullPtr = false)
- : Kind(Uninitialized) {
+ : Kind(None) {
MakeLValue(); setLValue(B, O, N, IsNullPtr);
}
APValue(LValueBase B, const CharUnits &O, ArrayRef<LValuePathEntry> Path,
bool OnePastTheEnd, bool IsNullPtr = false)
- : Kind(Uninitialized) {
+ : Kind(None) {
MakeLValue(); setLValue(B, O, Path, OnePastTheEnd, IsNullPtr);
}
- APValue(UninitArray, unsigned InitElts, unsigned Size) : Kind(Uninitialized) {
+ APValue(UninitArray, unsigned InitElts, unsigned Size) : Kind(None) {
MakeArray(InitElts, Size);
}
- APValue(UninitStruct, unsigned B, unsigned M) : Kind(Uninitialized) {
+ APValue(UninitStruct, unsigned B, unsigned M) : Kind(None) {
MakeStruct(B, M);
}
explicit APValue(const FieldDecl *D, const APValue &V = APValue())
- : Kind(Uninitialized) {
+ : Kind(None) {
MakeUnion(); setUnion(D, V);
}
APValue(const ValueDecl *Member, bool IsDerivedMember,
- ArrayRef<const CXXRecordDecl*> Path) : Kind(Uninitialized) {
+ ArrayRef<const CXXRecordDecl*> Path) : Kind(None) {
MakeMemberPointer(Member, IsDerivedMember, Path);
}
APValue(const AddrLabelExpr* LHSExpr, const AddrLabelExpr* RHSExpr)
- : Kind(Uninitialized) {
+ : Kind(None) {
MakeAddrLabelDiff(); setAddrLabelDiff(LHSExpr, RHSExpr);
}
+ static APValue IndeterminateValue() {
+ APValue Result;
+ Result.Kind = Indeterminate;
+ return Result;
+ }
~APValue() {
- MakeUninit();
+ if (Kind != None && Kind != Indeterminate)
+ DestroyDataAndMakeUninit();
}
/// Returns whether the object performed allocations.
@@ -230,9 +309,14 @@ public:
void swap(APValue &RHS);
ValueKind getKind() const { return Kind; }
- bool isUninit() const { return Kind == Uninitialized; }
+
+ bool isAbsent() const { return Kind == None; }
+ bool isIndeterminate() const { return Kind == Indeterminate; }
+ bool hasValue() const { return Kind != None && Kind != Indeterminate; }
+
bool isInt() const { return Kind == Int; }
bool isFloat() const { return Kind == Float; }
+ bool isFixedPoint() const { return Kind == FixedPoint; }
bool isComplexInt() const { return Kind == ComplexInt; }
bool isComplexFloat() const { return Kind == ComplexFloat; }
bool isLValue() const { return Kind == LValue; }
@@ -246,8 +330,8 @@ public:
void dump() const;
void dump(raw_ostream &OS) const;
- void printPretty(raw_ostream &OS, ASTContext &Ctx, QualType Ty) const;
- std::string getAsString(ASTContext &Ctx, QualType Ty) const;
+ void printPretty(raw_ostream &OS, const ASTContext &Ctx, QualType Ty) const;
+ std::string getAsString(const ASTContext &Ctx, QualType Ty) const;
APSInt &getInt() {
assert(isInt() && "Invalid accessor");
@@ -257,6 +341,12 @@ public:
return const_cast<APValue*>(this)->getInt();
}
+ /// Try to convert this value to an integral constant. This works if it's an
+ /// integer, null pointer, or offset from a null pointer. Returns true on
+ /// success.
+ bool toIntegralConstant(APSInt &Result, QualType SrcTy,
+ const ASTContext &Ctx) const;
+
APFloat &getFloat() {
assert(isFloat() && "Invalid accessor");
return *(APFloat*)(char*)Data.buffer;
@@ -265,6 +355,14 @@ public:
return const_cast<APValue*>(this)->getFloat();
}
+ APFixedPoint &getFixedPoint() {
+ assert(isFixedPoint() && "Invalid accessor");
+ return *(APFixedPoint *)(char *)Data.buffer;
+ }
+ const APFixedPoint &getFixedPoint() const {
+ return const_cast<APValue *>(this)->getFixedPoint();
+ }
+
APSInt &getComplexIntReal() {
assert(isComplexInt() && "Invalid accessor");
return ((ComplexAPSInt*)(char*)Data.buffer)->Real;
@@ -406,6 +504,10 @@ public:
assert(isFloat() && "Invalid accessor");
*(APFloat *)(char *)Data.buffer = std::move(F);
}
+ void setFixedPoint(APFixedPoint FX) {
+ assert(isFixedPoint() && "Invalid accessor");
+ *(APFixedPoint *)(char *)Data.buffer = std::move(FX);
+ }
void setVector(const APValue *E, unsigned N) {
assert(isVector() && "Invalid accessor");
((Vec*)(char*)Data.buffer)->Elts = new APValue[N];
@@ -451,51 +553,52 @@ public:
private:
void DestroyDataAndMakeUninit();
- void MakeUninit() {
- if (Kind != Uninitialized)
- DestroyDataAndMakeUninit();
- }
void MakeInt() {
- assert(isUninit() && "Bad state change");
+ assert(isAbsent() && "Bad state change");
new ((void*)Data.buffer) APSInt(1);
Kind = Int;
}
void MakeFloat() {
- assert(isUninit() && "Bad state change");
+ assert(isAbsent() && "Bad state change");
new ((void*)(char*)Data.buffer) APFloat(0.0);
Kind = Float;
}
+ void MakeFixedPoint(APFixedPoint &&FX) {
+ assert(isAbsent() && "Bad state change");
+ new ((void *)(char *)Data.buffer) APFixedPoint(std::move(FX));
+ Kind = FixedPoint;
+ }
void MakeVector() {
- assert(isUninit() && "Bad state change");
+ assert(isAbsent() && "Bad state change");
new ((void*)(char*)Data.buffer) Vec();
Kind = Vector;
}
void MakeComplexInt() {
- assert(isUninit() && "Bad state change");
+ assert(isAbsent() && "Bad state change");
new ((void*)(char*)Data.buffer) ComplexAPSInt();
Kind = ComplexInt;
}
void MakeComplexFloat() {
- assert(isUninit() && "Bad state change");
+ assert(isAbsent() && "Bad state change");
new ((void*)(char*)Data.buffer) ComplexAPFloat();
Kind = ComplexFloat;
}
void MakeLValue();
void MakeArray(unsigned InitElts, unsigned Size);
void MakeStruct(unsigned B, unsigned M) {
- assert(isUninit() && "Bad state change");
+ assert(isAbsent() && "Bad state change");
new ((void*)(char*)Data.buffer) StructData(B, M);
Kind = Struct;
}
void MakeUnion() {
- assert(isUninit() && "Bad state change");
+ assert(isAbsent() && "Bad state change");
new ((void*)(char*)Data.buffer) UnionData();
Kind = Union;
}
void MakeMemberPointer(const ValueDecl *Member, bool IsDerivedMember,
ArrayRef<const CXXRecordDecl*> Path);
void MakeAddrLabelDiff() {
- assert(isUninit() && "Bad state change");
+ assert(isAbsent() && "Bad state change");
new ((void*)(char*)Data.buffer) AddrLabelDiffData();
Kind = AddrLabelDiff;
}
diff --git a/include/clang/AST/AST.h b/include/clang/AST/AST.h
index 6db351d1064b..6d0f274121b2 100644
--- a/include/clang/AST/AST.h
+++ b/include/clang/AST/AST.h
@@ -1,9 +1,8 @@
//===--- AST.h - "Umbrella" header for AST library --------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
diff --git a/include/clang/AST/ASTConsumer.h b/include/clang/AST/ASTConsumer.h
index 1167c566a35f..dc216a89c205 100644
--- a/include/clang/AST/ASTConsumer.h
+++ b/include/clang/AST/ASTConsumer.h
@@ -1,9 +1,8 @@
//===--- ASTConsumer.h - Abstract interface for reading ASTs ----*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
diff --git a/include/clang/AST/ASTContext.h b/include/clang/AST/ASTContext.h
index 13870116c7fd..1d1aaf4fb115 100644
--- a/include/clang/AST/ASTContext.h
+++ b/include/clang/AST/ASTContext.h
@@ -1,9 +1,8 @@
//===- ASTContext.h - Context to hold long-lived AST nodes ------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
@@ -266,17 +265,21 @@ private:
/// Mapping from __block VarDecls to BlockVarCopyInit.
llvm::DenseMap<const VarDecl *, BlockVarCopyInit> BlockVarCopyInits;
- /// Mapping from class scope functions specialization to their
- /// template patterns.
- llvm::DenseMap<const FunctionDecl*, FunctionDecl*>
- ClassScopeSpecializationPattern;
-
/// Mapping from materialized temporaries with static storage duration
/// that appear in constant initializers to their evaluated values. These are
/// allocated in a std::map because their address must be stable.
llvm::DenseMap<const MaterializeTemporaryExpr *, APValue *>
MaterializedTemporaryValues;
+ /// Used to cleanups APValues stored in the AST.
+ mutable llvm::SmallVector<APValue *, 0> APValueCleanups;
+
+ /// A cache mapping a string value to a StringLiteral object with the same
+ /// value.
+ ///
+ /// This is lazily created. This is intentionally not serialized.
+ mutable llvm::StringMap<StringLiteral *> StringLiteralCache;
+
/// Representation of a "canonical" template template parameter that
/// is used in canonical template names.
class CanonicalTemplateTemplateParm : public llvm::FoldingSetNode {
@@ -892,11 +895,6 @@ public:
TemplateOrSpecializationInfo
getTemplateOrSpecializationInfo(const VarDecl *Var);
- FunctionDecl *getClassScopeSpecializationPattern(const FunctionDecl *FD);
-
- void setClassScopeSpecializationPattern(FunctionDecl *FD,
- FunctionDecl *Pattern);
-
/// Note that the static data member \p Inst is an instantiation of
/// the static data member template \p Tmpl of a class template.
void setInstantiatedFromStaticDataMember(VarDecl *Inst, VarDecl *Tmpl,
@@ -1334,6 +1332,10 @@ public:
ArrayType::ArraySizeModifier ASM,
unsigned IndexTypeQuals) const;
+ /// Return a type for a constant array for a string literal of the
+ /// specified element type and length.
+ QualType getStringLiteralArrayType(QualType EltTy, unsigned Length) const;
+
/// Returns a vla type where known sizes are replaced with [*].
QualType getVariableArrayDecayedType(QualType Ty) const;
@@ -1452,6 +1454,9 @@ public:
QualType getParenType(QualType NamedType) const;
+ QualType getMacroQualifiedType(QualType UnderlyingTy,
+ const IdentifierInfo *MacroII) const;
+
QualType getElaboratedType(ElaboratedTypeKeyword Keyword,
NestedNameSpecifier *NNS, QualType NamedType,
TagDecl *OwnedTagDecl = nullptr) const;
@@ -1520,7 +1525,7 @@ public:
/// C++11 deduced auto type.
QualType getAutoType(QualType DeducedType, AutoTypeKeyword Keyword,
- bool IsDependent) const;
+ bool IsDependent, bool IsPack = false) const;
/// C++11 deduction pattern for 'auto' type.
QualType getAutoDeductType() const;
@@ -1985,6 +1990,7 @@ public:
TemplateName getOverloadedTemplateName(UnresolvedSetIterator Begin,
UnresolvedSetIterator End) const;
+ TemplateName getAssumedTemplateName(DeclarationName Name) const;
TemplateName getQualifiedTemplateName(NestedNameSpecifier *NNS,
bool TemplateKeyword,
@@ -2003,6 +2009,9 @@ public:
/// No error
GE_None,
+ /// Missing a type
+ GE_Missing_type,
+
/// Missing a type from <stdio.h>
GE_Missing_stdio,
@@ -2086,6 +2095,16 @@ public:
CharUnits getTypeSizeInChars(QualType T) const;
CharUnits getTypeSizeInChars(const Type *T) const;
+ Optional<CharUnits> getTypeSizeInCharsIfKnown(QualType Ty) const {
+ if (Ty->isIncompleteType() || Ty->isDependentType())
+ return None;
+ return getTypeSizeInChars(Ty);
+ }
+
+ Optional<CharUnits> getTypeSizeInCharsIfKnown(const Type *Ty) const {
+ return getTypeSizeInCharsIfKnown(QualType(Ty, 0));
+ }
+
/// Return the ABI-specified alignment of a (complete) type \p T, in
/// bits.
unsigned getTypeAlign(QualType T) const { return getTypeInfo(T).Align; }
@@ -2160,6 +2179,13 @@ public:
/// pointers and large arrays get extra alignment.
CharUnits getDeclAlign(const Decl *D, bool ForAlignof = false) const;
+ /// Return the alignment (in bytes) of the thrown exception object. This is
+ /// only meaningful for targets that allocate C++ exceptions in a system
+ /// runtime, such as those using the Itanium C++ ABI.
+ CharUnits getExnObjectAlignment() const {
+ return toCharUnitsFromBits(Target->getExnObjectAlignment());
+ }
+
/// Get or compute information about the layout of the specified
/// record (struct/union/class) \p D, which indicates its size and field
/// position information.
@@ -2225,7 +2251,8 @@ public:
VTableContextBase *getVTableContext();
- MangleContext *createMangleContext();
+ /// If \p T is null pointer, assume the target in ASTContext.
+ MangleContext *createMangleContext(const TargetInfo *T = nullptr);
void DeepCollectObjCIvars(const ObjCInterfaceDecl *OI, bool leafClass,
SmallVectorImpl<const ObjCIvarDecl*> &Ivars) const;
@@ -2371,7 +2398,8 @@ public:
/// Retrieves the default calling convention for the current target.
CallingConv getDefaultCallingConvention(bool IsVariadic,
- bool IsCXXMethod) const;
+ bool IsCXXMethod,
+ bool IsBuiltin = false) const;
/// Retrieves the "canonical" template name that refers to a
/// given template.
@@ -2488,6 +2516,11 @@ public:
/// \p LHS < \p RHS, return -1.
int getFloatingTypeOrder(QualType LHS, QualType RHS) const;
+ /// Compare the rank of two floating point types as above, but compare equal
+ /// if both types have the same floating-point semantics on the target (i.e.
+ /// long double and double on AArch64 will return 0).
+ int getFloatingTypeSemanticOrder(QualType LHS, QualType RHS) const;
+
/// Return a real floating point or a complex type (based on
/// \p typeDomain/\p typeSize).
///
@@ -2624,6 +2657,12 @@ public:
// corresponding saturated type for a given fixed point type.
QualType getCorrespondingSaturatedType(QualType Ty) const;
+ // This method accepts fixed point types and returns the corresponding signed
+ // type. Unlike getCorrespondingUnsignedType(), this only accepts unsigned
+ // fixed point types because there are unsigned integer types like bool and
+ // char8_t that don't have signed equivalents.
+ QualType getCorrespondingSignedFixedPointType(QualType Ty) const;
+
//===--------------------------------------------------------------------===//
// Integer Values
//===--------------------------------------------------------------------===//
@@ -2677,7 +2716,7 @@ public:
/// otherwise returns null.
const ObjCInterfaceDecl *getObjContainingInterface(const NamedDecl *ND) const;
- /// Set the copy inialization expression of a block var decl. \p CanThrow
+ /// Set the copy initialization expression of a block var decl. \p CanThrow
/// indicates whether the copy expression can throw or not.
void setBlockVarCopyInit(const VarDecl* VD, Expr *CopyExpr, bool CanThrow);
@@ -2712,12 +2751,11 @@ public:
///
/// \param Data Pointer data that will be provided to the callback function
/// when it is called.
- void AddDeallocation(void (*Callback)(void*), void *Data);
+ void AddDeallocation(void (*Callback)(void *), void *Data) const;
/// If T isn't trivially destructible, calls AddDeallocation to register it
/// for destruction.
- template <typename T>
- void addDestruction(T *Ptr) {
+ template <typename T> void addDestruction(T *Ptr) const {
if (!std::is_trivially_destructible<T>::value) {
auto DestroyPtr = [](void *V) { static_cast<T *>(V)->~T(); };
AddDeallocation(DestroyPtr, Ptr);
@@ -2780,51 +2818,56 @@ public:
APValue *getMaterializedTemporaryValue(const MaterializeTemporaryExpr *E,
bool MayCreate);
+ /// Return a string representing the human readable name for the specified
+ /// function declaration or file name. Used by SourceLocExpr and
+ /// PredefinedExpr to cache evaluated results.
+ StringLiteral *getPredefinedStringLiteralFromCache(StringRef Key) const;
+
//===--------------------------------------------------------------------===//
// Statistics
//===--------------------------------------------------------------------===//
/// The number of implicitly-declared default constructors.
- static unsigned NumImplicitDefaultConstructors;
+ unsigned NumImplicitDefaultConstructors = 0;
/// The number of implicitly-declared default constructors for
/// which declarations were built.
- static unsigned NumImplicitDefaultConstructorsDeclared;
+ unsigned NumImplicitDefaultConstructorsDeclared = 0;
/// The number of implicitly-declared copy constructors.
- static unsigned NumImplicitCopyConstructors;
+ unsigned NumImplicitCopyConstructors = 0;
/// The number of implicitly-declared copy constructors for
/// which declarations were built.
- static unsigned NumImplicitCopyConstructorsDeclared;
+ unsigned NumImplicitCopyConstructorsDeclared = 0;
/// The number of implicitly-declared move constructors.
- static unsigned NumImplicitMoveConstructors;
+ unsigned NumImplicitMoveConstructors = 0;
/// The number of implicitly-declared move constructors for
/// which declarations were built.
- static unsigned NumImplicitMoveConstructorsDeclared;
+ unsigned NumImplicitMoveConstructorsDeclared = 0;
/// The number of implicitly-declared copy assignment operators.
- static unsigned NumImplicitCopyAssignmentOperators;
+ unsigned NumImplicitCopyAssignmentOperators = 0;
/// The number of implicitly-declared copy assignment operators for
/// which declarations were built.
- static unsigned NumImplicitCopyAssignmentOperatorsDeclared;
+ unsigned NumImplicitCopyAssignmentOperatorsDeclared = 0;
/// The number of implicitly-declared move assignment operators.
- static unsigned NumImplicitMoveAssignmentOperators;
+ unsigned NumImplicitMoveAssignmentOperators = 0;
/// The number of implicitly-declared move assignment operators for
/// which declarations were built.
- static unsigned NumImplicitMoveAssignmentOperatorsDeclared;
+ unsigned NumImplicitMoveAssignmentOperatorsDeclared = 0;
/// The number of implicitly-declared destructors.
- static unsigned NumImplicitDestructors;
+ unsigned NumImplicitDestructors = 0;
/// The number of implicitly-declared destructors for which
/// declarations were built.
- static unsigned NumImplicitDestructorsDeclared;
+ unsigned NumImplicitDestructorsDeclared = 0;
public:
/// Initialize built-in types.
@@ -2839,18 +2882,51 @@ public:
private:
void InitBuiltinType(CanQualType &R, BuiltinType::Kind K);
+ class ObjCEncOptions {
+ unsigned Bits;
+
+ ObjCEncOptions(unsigned Bits) : Bits(Bits) {}
+
+ public:
+ ObjCEncOptions() : Bits(0) {}
+ ObjCEncOptions(const ObjCEncOptions &RHS) : Bits(RHS.Bits) {}
+
+#define OPT_LIST(V) \
+ V(ExpandPointedToStructures, 0) \
+ V(ExpandStructures, 1) \
+ V(IsOutermostType, 2) \
+ V(EncodingProperty, 3) \
+ V(IsStructField, 4) \
+ V(EncodeBlockParameters, 5) \
+ V(EncodeClassNames, 6) \
+
+#define V(N,I) ObjCEncOptions& set##N() { Bits |= 1 << I; return *this; }
+OPT_LIST(V)
+#undef V
+
+#define V(N,I) bool N() const { return Bits & 1 << I; }
+OPT_LIST(V)
+#undef V
+
+#undef OPT_LIST
+
+ LLVM_NODISCARD ObjCEncOptions keepingOnly(ObjCEncOptions Mask) const {
+ return Bits & Mask.Bits;
+ }
+
+ LLVM_NODISCARD ObjCEncOptions forComponentType() const {
+ ObjCEncOptions Mask = ObjCEncOptions()
+ .setIsOutermostType()
+ .setIsStructField();
+ return Bits & ~Mask.Bits;
+ }
+ };
+
// Return the Objective-C type encoding for a given type.
void getObjCEncodingForTypeImpl(QualType t, std::string &S,
- bool ExpandPointedToStructures,
- bool ExpandStructures,
+ ObjCEncOptions Options,
const FieldDecl *Field,
- bool OutermostType = false,
- bool EncodingProperty = false,
- bool StructField = false,
- bool EncodeBlockParameters = false,
- bool EncodeClassNames = false,
- bool EncodePointerToObjCTypedef = false,
- QualType *NotEncodedT=nullptr) const;
+ QualType *NotEncodedT = nullptr) const;
// Adds the encoding of the structure's members.
void getObjCEncodingForStructureImpl(RecordDecl *RD, std::string &S,
@@ -2908,7 +2984,7 @@ private:
// in order to track and run destructors while we're tearing things down.
using DeallocationFunctionsAndArguments =
llvm::SmallVector<std::pair<void (*)(void *), void *>, 16>;
- DeallocationFunctionsAndArguments Deallocations;
+ mutable DeallocationFunctionsAndArguments Deallocations;
// FIXME: This currently contains the set of StoredDeclMaps used
// by DeclContext objects. This probably should not be in ASTContext,
diff --git a/include/clang/AST/ASTContextAllocate.h b/include/clang/AST/ASTContextAllocate.h
index 5b9eed208a4d..70c8e24f9185 100644
--- a/include/clang/AST/ASTContextAllocate.h
+++ b/include/clang/AST/ASTContextAllocate.h
@@ -1,9 +1,8 @@
//===- ASTContextAllocate.h - ASTContext allocate functions -----*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
diff --git a/include/clang/AST/ASTDiagnostic.h b/include/clang/AST/ASTDiagnostic.h
index fe92604587ef..d6549e12d92a 100644
--- a/include/clang/AST/ASTDiagnostic.h
+++ b/include/clang/AST/ASTDiagnostic.h
@@ -1,9 +1,8 @@
//===--- ASTDiagnostic.h - Diagnostics for the AST library ------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/clang/AST/ASTDumper.h b/include/clang/AST/ASTDumper.h
new file mode 100644
index 000000000000..61202f057a80
--- /dev/null
+++ b/include/clang/AST/ASTDumper.h
@@ -0,0 +1,56 @@
+//===--- ASTDumper.h - Dumping implementation for ASTs --------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_AST_ASTDUMPER_H
+#define LLVM_CLANG_AST_ASTDUMPER_H
+
+#include "clang/AST/ASTNodeTraverser.h"
+#include "clang/AST/TextNodeDumper.h"
+
+namespace clang {
+
+class ASTDumper : public ASTNodeTraverser<ASTDumper, TextNodeDumper> {
+
+ TextNodeDumper NodeDumper;
+
+ raw_ostream &OS;
+
+ const bool ShowColors;
+
+public:
+ ASTDumper(raw_ostream &OS, const comments::CommandTraits *Traits,
+ const SourceManager *SM)
+ : ASTDumper(OS, Traits, SM, SM && SM->getDiagnostics().getShowColors()) {}
+
+ ASTDumper(raw_ostream &OS, const comments::CommandTraits *Traits,
+ const SourceManager *SM, bool ShowColors)
+ : ASTDumper(OS, Traits, SM, ShowColors, LangOptions()) {}
+ ASTDumper(raw_ostream &OS, const comments::CommandTraits *Traits,
+ const SourceManager *SM, bool ShowColors,
+ const PrintingPolicy &PrintPolicy)
+ : NodeDumper(OS, ShowColors, SM, PrintPolicy, Traits), OS(OS),
+ ShowColors(ShowColors) {}
+
+ TextNodeDumper &doGetNodeDelegate() { return NodeDumper; }
+
+ void dumpLookups(const DeclContext *DC, bool DumpDecls);
+
+ template <typename SpecializationDecl>
+ void dumpTemplateDeclSpecialization(const SpecializationDecl *D,
+ bool DumpExplicitInst, bool DumpRefOnly);
+ template <typename TemplateDecl>
+ void dumpTemplateDecl(const TemplateDecl *D, bool DumpExplicitInst);
+
+ void VisitFunctionTemplateDecl(const FunctionTemplateDecl *D);
+ void VisitClassTemplateDecl(const ClassTemplateDecl *D);
+ void VisitVarTemplateDecl(const VarTemplateDecl *D);
+};
+
+} // namespace clang
+
+#endif
diff --git a/include/clang/AST/ASTDumperUtils.h b/include/clang/AST/ASTDumperUtils.h
index 5e62e902b423..55a085449a9b 100644
--- a/include/clang/AST/ASTDumperUtils.h
+++ b/include/clang/AST/ASTDumperUtils.h
@@ -1,9 +1,8 @@
//===--- ASTDumperUtils.h - Printing of AST nodes -------------------------===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
@@ -18,6 +17,12 @@
namespace clang {
+/// Used to specify the format for printing AST dump information.
+enum ASTDumpOutputFormat {
+ ADOF_Default,
+ ADOF_JSON
+};
+
// Colors used for various parts of the AST dump
// Do not use bold yellow for any text. It is hard to read on white screens.
diff --git a/include/clang/AST/ASTFwd.h b/include/clang/AST/ASTFwd.h
index 038d5c3d3611..93919bbdd52f 100644
--- a/include/clang/AST/ASTFwd.h
+++ b/include/clang/AST/ASTFwd.h
@@ -1,9 +1,8 @@
//===--- ASTFwd.h ----------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===--------------------------------------------------------------===//
///
diff --git a/include/clang/AST/ASTImporter.h b/include/clang/AST/ASTImporter.h
index dbb9cf35ddea..4a55c120a457 100644
--- a/include/clang/AST/ASTImporter.h
+++ b/include/clang/AST/ASTImporter.h
@@ -1,9 +1,8 @@
//===- ASTImporter.h - Importing ASTs from other Contexts -------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
@@ -15,6 +14,7 @@
#ifndef LLVM_CLANG_AST_ASTIMPORTER_H
#define LLVM_CLANG_AST_ASTIMPORTER_H
+#include "clang/AST/DeclBase.h"
#include "clang/AST/DeclarationName.h"
#include "clang/AST/NestedNameSpecifier.h"
#include "clang/AST/TemplateName.h"
@@ -33,7 +33,8 @@
namespace clang {
class ASTContext;
-class ASTImporterLookupTable;
+class ASTImporterSharedState;
+class Attr;
class CXXBaseSpecifier;
class CXXCtorInitializer;
class Decl;
@@ -43,8 +44,8 @@ class FileManager;
class NamedDecl;
class Stmt;
class TagDecl;
+class TranslationUnitDecl;
class TypeSourceInfo;
-class Attr;
class ImportError : public llvm::ErrorInfo<ImportError> {
public:
@@ -87,14 +88,140 @@ class Attr;
using ImportedCXXBaseSpecifierMap =
llvm::DenseMap<const CXXBaseSpecifier *, CXXBaseSpecifier *>;
- private:
+ // An ImportPath is the list of the AST nodes which we visit during an
+ // Import call.
+ // If node `A` depends on node `B` then the path contains an `A`->`B` edge.
+ // From the call stack of the import functions we can read the very same
+ // path.
+ //
+ // Now imagine the following AST, where the `->` represents dependency in
+ // therms of the import.
+ // ```
+ // A->B->C->D
+ // `->E
+ // ```
+ // We would like to import A.
+ // The import behaves like a DFS, so we will visit the nodes in this order:
+ // ABCDE.
+ // During the visitation we will have the following ImportPaths:
+ // ```
+ // A
+ // AB
+ // ABC
+ // ABCD
+ // ABC
+ // AB
+ // ABE
+ // AB
+ // A
+ // ```
+ // If during the visit of E there is an error then we set an error for E,
+ // then as the call stack shrinks for B, then for A:
+ // ```
+ // A
+ // AB
+ // ABC
+ // ABCD
+ // ABC
+ // AB
+ // ABE // Error! Set an error to E
+ // AB // Set an error to B
+ // A // Set an error to A
+ // ```
+ // However, during the import we could import C and D without any error and
+ // they are independent from A,B and E.
+ // We must not set up an error for C and D.
+ // So, at the end of the import we have an entry in `ImportDeclErrors` for
+ // A,B,E but not for C,D.
+ //
+ // Now what happens if there is a cycle in the import path?
+ // Let's consider this AST:
+ // ```
+ // A->B->C->A
+ // `->E
+ // ```
+ // During the visitation we will have the below ImportPaths and if during
+ // the visit of E there is an error then we will set up an error for E,B,A.
+ // But what's up with C?
+ // ```
+ // A
+ // AB
+ // ABC
+ // ABCA
+ // ABC
+ // AB
+ // ABE // Error! Set an error to E
+ // AB // Set an error to B
+ // A // Set an error to A
+ // ```
+ // This time we know that both B and C are dependent on A.
+ // This means we must set up an error for C too.
+ // As the call stack reverses back we get to A and we must set up an error
+ // to all nodes which depend on A (this includes C).
+ // But C is no longer on the import path, it just had been previously.
+ // Such situation can happen only if during the visitation we had a cycle.
+ // If we didn't have any cycle, then the normal way of passing an Error
+ // object through the call stack could handle the situation.
+ // This is why we must track cycles during the import process for each
+ // visited declaration.
+ class ImportPathTy {
+ public:
+ using VecTy = llvm::SmallVector<Decl *, 32>;
+
+ void push(Decl *D) {
+ Nodes.push_back(D);
+ ++Aux[D];
+ }
+
+ void pop() {
+ if (Nodes.empty())
+ return;
+ --Aux[Nodes.back()];
+ Nodes.pop_back();
+ }
+
+ /// Returns true if the last element can be found earlier in the path.
+ bool hasCycleAtBack() const {
+ auto Pos = Aux.find(Nodes.back());
+ return Pos != Aux.end() && Pos->second > 1;
+ }
+
+ using Cycle = llvm::iterator_range<VecTy::const_reverse_iterator>;
+ Cycle getCycleAtBack() const {
+ assert(Nodes.size() >= 2);
+ return Cycle(Nodes.rbegin(),
+ std::find(Nodes.rbegin() + 1, Nodes.rend(), Nodes.back()) +
+ 1);
+ }
+
+ /// Returns the copy of the cycle.
+ VecTy copyCycleAtBack() const {
+ auto R = getCycleAtBack();
+ return VecTy(R.begin(), R.end());
+ }
+
+ private:
+ // All nodes of the path.
+ VecTy Nodes;
+ // Auxiliary container to be able to answer "Do we have a cycle ending
+ // at last element?" as fast as possible.
+ // We count each Decl's occurrence over the path.
+ llvm::SmallDenseMap<Decl *, int, 32> Aux;
+ };
- /// Pointer to the import specific lookup table, which may be shared
- /// amongst several ASTImporter objects.
- /// This is an externally managed resource (and should exist during the
- /// lifetime of the ASTImporter object)
- /// If not set then the original C/C++ lookup is used.
- ASTImporterLookupTable *LookupTable = nullptr;
+ private:
+ std::shared_ptr<ASTImporterSharedState> SharedState = nullptr;
+
+ /// The path which we go through during the import of a given AST node.
+ ImportPathTy ImportPath;
+ /// Sometimes we have to save some part of an import path, so later we can
+ /// set up properties to the saved nodes.
+ /// We may have several of these import paths associated to one Decl.
+ using SavedImportPathsForOneDecl =
+ llvm::SmallVector<ImportPathTy::VecTy, 32>;
+ using SavedImportPathsTy =
+ llvm::SmallDenseMap<Decl *, SavedImportPathsForOneDecl, 32>;
+ SavedImportPathsTy SavedImportPaths;
/// The contexts we're importing to and from.
ASTContext &ToContext, &FromContext;
@@ -116,6 +243,18 @@ class Attr;
/// context to the corresponding declarations in the "to" context.
llvm::DenseMap<Decl *, Decl *> ImportedDecls;
+ /// Mapping from the already-imported declarations in the "from"
+ /// context to the error status of the import of that declaration.
+ /// This map contains only the declarations that were not correctly
+ /// imported. The same declaration may or may not be included in
+ /// ImportedDecls. This map is updated continuously during imports and never
+ /// cleared (like ImportedDecls).
+ llvm::DenseMap<Decl *, ImportError> ImportDeclErrors;
+
+ /// Mapping from the already-imported declarations in the "to"
+ /// context to the corresponding declarations in the "from" context.
+ llvm::DenseMap<Decl *, Decl *> ImportedFromDecls;
+
/// Mapping from the already-imported statements in the "from"
/// context to the corresponding statements in the "to" context.
llvm::DenseMap<Stmt *, Stmt *> ImportedStmts;
@@ -138,6 +277,15 @@ class Attr;
void AddToLookupTable(Decl *ToD);
+ protected:
+ /// Can be overwritten by subclasses to implement their own import logic.
+ /// The overwritten method should call this method if it didn't import the
+ /// decl on its own.
+ virtual Expected<Decl *> ImportImpl(Decl *From);
+
+ /// Used only in unittests to verify the behaviour of the error handling.
+ virtual bool returnWithErrorInTest() { return false; };
+
public:
/// \param ToContext The context we'll be importing into.
@@ -152,13 +300,13 @@ class Attr;
/// as little as it can, e.g., by importing declarations as forward
/// declarations that can be completed at a later point.
///
- /// \param LookupTable The importer specific lookup table which may be
+ /// \param SharedState The importer specific lookup table which may be
/// shared amongst several ASTImporter objects.
/// If not set then the original C/C++ lookup is used.
ASTImporter(ASTContext &ToContext, FileManager &ToFileManager,
ASTContext &FromContext, FileManager &FromFileManager,
bool MinimalImport,
- ASTImporterLookupTable *LookupTable = nullptr);
+ std::shared_ptr<ASTImporterSharedState> SharedState = nullptr);
virtual ~ASTImporter();
@@ -173,63 +321,51 @@ class Attr;
/// \return Error information (success or error).
template <typename ImportT>
LLVM_NODISCARD llvm::Error importInto(ImportT &To, const ImportT &From) {
- To = Import(From);
- if (From && !To)
- return llvm::make_error<ImportError>();
- return llvm::Error::success();
- // FIXME: this should be the final code
- //auto ToOrErr = Import(From);
- //if (ToOrErr)
- // To = *ToOrErr;
- //return ToOrErr.takeError();
+ auto ToOrErr = Import(From);
+ if (ToOrErr)
+ To = *ToOrErr;
+ return ToOrErr.takeError();
}
/// Import the given type from the "from" context into the "to"
/// context. A null type is imported as a null type (no error).
///
/// \returns The equivalent type in the "to" context, or the import error.
- llvm::Expected<QualType> Import_New(QualType FromT);
- // FIXME: Remove this version.
- QualType Import(QualType FromT);
+ llvm::Expected<QualType> Import(QualType FromT);
/// Import the given type source information from the
/// "from" context into the "to" context.
///
/// \returns The equivalent type source information in the "to"
/// context, or the import error.
- llvm::Expected<TypeSourceInfo *> Import_New(TypeSourceInfo *FromTSI);
- // FIXME: Remove this version.
- TypeSourceInfo *Import(TypeSourceInfo *FromTSI);
+ llvm::Expected<TypeSourceInfo *> Import(TypeSourceInfo *FromTSI);
/// Import the given attribute from the "from" context into the
/// "to" context.
///
/// \returns The equivalent attribute in the "to" context, or the import
/// error.
- llvm::Expected<Attr *> Import_New(const Attr *FromAttr);
- // FIXME: Remove this version.
- Attr *Import(const Attr *FromAttr);
+ llvm::Expected<Attr *> Import(const Attr *FromAttr);
/// Import the given declaration from the "from" context into the
/// "to" context.
///
/// \returns The equivalent declaration in the "to" context, or the import
/// error.
- llvm::Expected<Decl *> Import_New(Decl *FromD);
- llvm::Expected<Decl *> Import_New(const Decl *FromD) {
- return Import_New(const_cast<Decl *>(FromD));
- }
- // FIXME: Remove this version.
- Decl *Import(Decl *FromD);
- Decl *Import(const Decl *FromD) {
+ llvm::Expected<Decl *> Import(Decl *FromD);
+ llvm::Expected<const Decl *> Import(const Decl *FromD) {
return Import(const_cast<Decl *>(FromD));
}
/// Return the copy of the given declaration in the "to" context if
/// it has already been imported from the "from" context. Otherwise return
- /// NULL.
+ /// nullptr.
Decl *GetAlreadyImportedOrNull(const Decl *FromD) const;
+ /// Return the translation unit from where the declaration was
+ /// imported. If it does not exist nullptr is returned.
+ TranslationUnitDecl *GetFromTU(Decl *ToD);
+
/// Import the given declaration context from the "from"
/// AST context into the "to" AST context.
///
@@ -242,28 +378,21 @@ class Attr;
///
/// \returns The equivalent expression in the "to" context, or the import
/// error.
- llvm::Expected<Expr *> Import_New(Expr *FromE);
- // FIXME: Remove this version.
- Expr *Import(Expr *FromE);
+ llvm::Expected<Expr *> Import(Expr *FromE);
/// Import the given statement from the "from" context into the
/// "to" context.
///
/// \returns The equivalent statement in the "to" context, or the import
/// error.
- llvm::Expected<Stmt *> Import_New(Stmt *FromS);
- // FIXME: Remove this version.
- Stmt *Import(Stmt *FromS);
+ llvm::Expected<Stmt *> Import(Stmt *FromS);
/// Import the given nested-name-specifier from the "from"
/// context into the "to" context.
///
/// \returns The equivalent nested-name-specifier in the "to"
/// context, or the import error.
- llvm::Expected<NestedNameSpecifier *>
- Import_New(NestedNameSpecifier *FromNNS);
- // FIXME: Remove this version.
- NestedNameSpecifier *Import(NestedNameSpecifier *FromNNS);
+ llvm::Expected<NestedNameSpecifier *> Import(NestedNameSpecifier *FromNNS);
/// Import the given nested-name-specifier-loc from the "from"
/// context into the "to" context.
@@ -271,42 +400,32 @@ class Attr;
/// \returns The equivalent nested-name-specifier-loc in the "to"
/// context, or the import error.
llvm::Expected<NestedNameSpecifierLoc>
- Import_New(NestedNameSpecifierLoc FromNNS);
- // FIXME: Remove this version.
- NestedNameSpecifierLoc Import(NestedNameSpecifierLoc FromNNS);
+ Import(NestedNameSpecifierLoc FromNNS);
/// Import the given template name from the "from" context into the
/// "to" context, or the import error.
- llvm::Expected<TemplateName> Import_New(TemplateName From);
- // FIXME: Remove this version.
- TemplateName Import(TemplateName From);
+ llvm::Expected<TemplateName> Import(TemplateName From);
/// Import the given source location from the "from" context into
/// the "to" context.
///
/// \returns The equivalent source location in the "to" context, or the
/// import error.
- llvm::Expected<SourceLocation> Import_New(SourceLocation FromLoc);
- // FIXME: Remove this version.
- SourceLocation Import(SourceLocation FromLoc);
+ llvm::Expected<SourceLocation> Import(SourceLocation FromLoc);
/// Import the given source range from the "from" context into
/// the "to" context.
///
/// \returns The equivalent source range in the "to" context, or the import
/// error.
- llvm::Expected<SourceRange> Import_New(SourceRange FromRange);
- // FIXME: Remove this version.
- SourceRange Import(SourceRange FromRange);
+ llvm::Expected<SourceRange> Import(SourceRange FromRange);
/// Import the given declaration name from the "from"
/// context into the "to" context.
///
/// \returns The equivalent declaration name in the "to" context, or the
/// import error.
- llvm::Expected<DeclarationName> Import_New(DeclarationName FromName);
- // FIXME: Remove this version.
- DeclarationName Import(DeclarationName FromName);
+ llvm::Expected<DeclarationName> Import(DeclarationName FromName);
/// Import the given identifier from the "from" context
/// into the "to" context.
@@ -320,46 +439,32 @@ class Attr;
///
/// \returns The equivalent selector in the "to" context, or the import
/// error.
- llvm::Expected<Selector> Import_New(Selector FromSel);
- // FIXME: Remove this version.
- Selector Import(Selector FromSel);
+ llvm::Expected<Selector> Import(Selector FromSel);
/// Import the given file ID from the "from" context into the
/// "to" context.
///
/// \returns The equivalent file ID in the source manager of the "to"
/// context, or the import error.
- llvm::Expected<FileID> Import_New(FileID);
- // FIXME: Remove this version.
- FileID Import(FileID);
+ llvm::Expected<FileID> Import(FileID, bool IsBuiltin = false);
/// Import the given C++ constructor initializer from the "from"
/// context into the "to" context.
///
/// \returns The equivalent initializer in the "to" context, or the import
/// error.
- llvm::Expected<CXXCtorInitializer *>
- Import_New(CXXCtorInitializer *FromInit);
- // FIXME: Remove this version.
- CXXCtorInitializer *Import(CXXCtorInitializer *FromInit);
+ llvm::Expected<CXXCtorInitializer *> Import(CXXCtorInitializer *FromInit);
/// Import the given CXXBaseSpecifier from the "from" context into
/// the "to" context.
///
/// \returns The equivalent CXXBaseSpecifier in the source manager of the
/// "to" context, or the import error.
- llvm::Expected<CXXBaseSpecifier *>
- Import_New(const CXXBaseSpecifier *FromSpec);
- // FIXME: Remove this version.
- CXXBaseSpecifier *Import(const CXXBaseSpecifier *FromSpec);
+ llvm::Expected<CXXBaseSpecifier *> Import(const CXXBaseSpecifier *FromSpec);
/// Import the definition of the given declaration, including all of
/// the declarations it contains.
- LLVM_NODISCARD llvm::Error ImportDefinition_New(Decl *From);
-
- // FIXME: Compatibility function.
- // Usages of this should be changed to ImportDefinition_New.
- void ImportDefinition(Decl *From);
+ LLVM_NODISCARD llvm::Error ImportDefinition(Decl *From);
/// Cope with a name conflict when importing a declaration into the
/// given context.
@@ -422,9 +527,13 @@ class Attr;
/// Subclasses can override this function to observe all of the \c From ->
/// \c To declaration mappings as they are imported.
- virtual Decl *Imported(Decl *From, Decl *To) { return To; }
+ virtual void Imported(Decl *From, Decl *To) {}
+
+ void RegisterImportedDecl(Decl *FromD, Decl *ToD);
/// Store and assign the imported declaration to its counterpart.
+ /// It may happen that several decls from the 'from' context are mapped to
+ /// the same decl in the 'to' context.
Decl *MapImported(Decl *From, Decl *To);
/// Called by StructuralEquivalenceContext. If a RecordDecl is
@@ -435,6 +544,14 @@ class Attr;
/// importation, eliminating this loop.
virtual Decl *GetOriginalDecl(Decl *To) { return nullptr; }
+ /// Return if import of the given declaration has failed and if yes
+ /// the kind of the problem. This gives the first error encountered with
+ /// the node.
+ llvm::Optional<ImportError> getImportDeclErrorIfAny(Decl *FromD) const;
+
+ /// Mark (newly) imported declaration with error.
+ void setImportDeclError(Decl *From, ImportError Error);
+
/// Determine whether the given types are structurally
/// equivalent.
bool IsStructurallyEquivalent(QualType From, QualType To,
@@ -445,7 +562,6 @@ class Attr;
/// \returns The index of the field in its parent context (starting from 0).
/// On error `None` is returned (parent context is non-record).
static llvm::Optional<unsigned> getFieldIndex(Decl *F);
-
};
} // namespace clang
diff --git a/include/clang/AST/ASTImporterLookupTable.h b/include/clang/AST/ASTImporterLookupTable.h
index 14cafe817ddc..407478a51058 100644
--- a/include/clang/AST/ASTImporterLookupTable.h
+++ b/include/clang/AST/ASTImporterLookupTable.h
@@ -1,9 +1,8 @@
//===- ASTImporterLookupTable.h - ASTImporter specific lookup--*- C++ -*---===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
diff --git a/include/clang/AST/ASTImporterSharedState.h b/include/clang/AST/ASTImporterSharedState.h
new file mode 100644
index 000000000000..3635a62deef0
--- /dev/null
+++ b/include/clang/AST/ASTImporterSharedState.h
@@ -0,0 +1,81 @@
+//===- ASTImporterSharedState.h - ASTImporter specific state --*- C++ -*---===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file defines the ASTImporter specific state, which may be shared
+// amongst several ASTImporter objects.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_AST_ASTIMPORTERSHAREDSTATE_H
+#define LLVM_CLANG_AST_ASTIMPORTERSHAREDSTATE_H
+
+#include "clang/AST/ASTImporterLookupTable.h"
+#include "clang/AST/Decl.h"
+#include "llvm/ADT/DenseMap.h"
+// FIXME We need this because of ImportError.
+#include "clang/AST/ASTImporter.h"
+
+namespace clang {
+
+class TranslationUnitDecl;
+
+/// Importer specific state, which may be shared amongst several ASTImporter
+/// objects.
+class ASTImporterSharedState {
+
+ /// Pointer to the import specific lookup table.
+ std::unique_ptr<ASTImporterLookupTable> LookupTable;
+
+ /// Mapping from the already-imported declarations in the "to"
+ /// context to the error status of the import of that declaration.
+ /// This map contains only the declarations that were not correctly
+ /// imported. The same declaration may or may not be included in
+ /// ImportedFromDecls. This map is updated continuously during imports and
+ /// never cleared (like ImportedFromDecls).
+ llvm::DenseMap<Decl *, ImportError> ImportErrors;
+
+ // FIXME put ImportedFromDecls here!
+ // And from that point we can better encapsulate the lookup table.
+
+public:
+ ASTImporterSharedState() = default;
+
+ ASTImporterSharedState(TranslationUnitDecl &ToTU) {
+ LookupTable = llvm::make_unique<ASTImporterLookupTable>(ToTU);
+ }
+
+ ASTImporterLookupTable *getLookupTable() { return LookupTable.get(); }
+
+ void addDeclToLookup(Decl *D) {
+ if (LookupTable)
+ if (auto *ND = dyn_cast<NamedDecl>(D))
+ LookupTable->add(ND);
+ }
+
+ void removeDeclFromLookup(Decl *D) {
+ if (LookupTable)
+ if (auto *ND = dyn_cast<NamedDecl>(D))
+ LookupTable->remove(ND);
+ }
+
+ llvm::Optional<ImportError> getImportDeclErrorIfAny(Decl *ToD) const {
+ auto Pos = ImportErrors.find(ToD);
+ if (Pos != ImportErrors.end())
+ return Pos->second;
+ else
+ return Optional<ImportError>();
+ }
+
+ void setImportDeclError(Decl *To, ImportError Error) {
+ ImportErrors[To] = Error;
+ }
+};
+
+} // namespace clang
+#endif // LLVM_CLANG_AST_ASTIMPORTERSHAREDSTATE_H
diff --git a/include/clang/AST/ASTLambda.h b/include/clang/AST/ASTLambda.h
index 6fedcb8d3801..c1153168e41b 100644
--- a/include/clang/AST/ASTLambda.h
+++ b/include/clang/AST/ASTLambda.h
@@ -1,9 +1,8 @@
//===--- ASTLambda.h - Lambda Helper Functions --------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
///
diff --git a/include/clang/AST/ASTMutationListener.h b/include/clang/AST/ASTMutationListener.h
index 80184e1cc740..8879f9f3229f 100644
--- a/include/clang/AST/ASTMutationListener.h
+++ b/include/clang/AST/ASTMutationListener.h
@@ -1,9 +1,8 @@
//===--- ASTMutationListener.h - AST Mutation Interface --------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
@@ -128,6 +127,11 @@ public:
virtual void DeclarationMarkedOpenMPDeclareTarget(const Decl *D,
const Attr *Attr) {}
+ /// A declaration is marked as a variable with OpenMP allocator.
+ ///
+ /// \param D the declaration marked as a variable with OpenMP allocator.
+ virtual void DeclarationMarkedOpenMPAllocate(const Decl *D, const Attr *A) {}
+
/// A definition has been made visible by being redefined locally.
///
/// \param D The definition that was previously not visible.
diff --git a/include/clang/AST/ASTNodeTraverser.h b/include/clang/AST/ASTNodeTraverser.h
new file mode 100644
index 000000000000..e43eacef86c6
--- /dev/null
+++ b/include/clang/AST/ASTNodeTraverser.h
@@ -0,0 +1,654 @@
+//===--- ASTNodeTraverser.h - Traversal of AST nodes ----------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// This file implements the AST traversal facilities. Other users
+// of this class may make use of the same traversal logic by inheriting it,
+// similar to RecursiveASTVisitor.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_AST_ASTNODETRAVERSER_H
+#define LLVM_CLANG_AST_ASTNODETRAVERSER_H
+
+#include "clang/AST/AttrVisitor.h"
+#include "clang/AST/CommentVisitor.h"
+#include "clang/AST/DeclVisitor.h"
+#include "clang/AST/LocInfoType.h"
+#include "clang/AST/StmtVisitor.h"
+#include "clang/AST/TemplateArgumentVisitor.h"
+#include "clang/AST/TypeVisitor.h"
+
+namespace clang {
+
+/**
+
+ASTNodeTraverser traverses the Clang AST for dumping purposes.
+
+The `Derived::doGetNodeDelegate()` method is required to be an accessible member
+which returns a reference of type `NodeDelegateType &` which implements the
+following interface:
+
+struct {
+ template <typename Fn> void AddChild(Fn DoAddChild);
+ template <typename Fn> void AddChild(StringRef Label, Fn DoAddChild);
+
+ void Visit(const comments::Comment *C, const comments::FullComment *FC);
+ void Visit(const Attr *A);
+ void Visit(const TemplateArgument &TA, SourceRange R = {},
+ const Decl *From = nullptr, StringRef Label = {});
+ void Visit(const Stmt *Node);
+ void Visit(const Type *T);
+ void Visit(QualType T);
+ void Visit(const Decl *D);
+ void Visit(const CXXCtorInitializer *Init);
+ void Visit(const OMPClause *C);
+ void Visit(const BlockDecl::Capture &C);
+ void Visit(const GenericSelectionExpr::ConstAssociation &A);
+};
+*/
+template <typename Derived, typename NodeDelegateType>
+class ASTNodeTraverser
+ : public ConstDeclVisitor<Derived>,
+ public ConstStmtVisitor<Derived>,
+ public comments::ConstCommentVisitor<Derived, void,
+ const comments::FullComment *>,
+ public TypeVisitor<Derived>,
+ public ConstAttrVisitor<Derived>,
+ public ConstTemplateArgumentVisitor<Derived> {
+
+ /// Indicates whether we should trigger deserialization of nodes that had
+ /// not already been loaded.
+ bool Deserialize = false;
+
+ NodeDelegateType &getNodeDelegate() {
+ return getDerived().doGetNodeDelegate();
+ }
+ Derived &getDerived() { return *static_cast<Derived *>(this); }
+
+public:
+ void setDeserialize(bool D) { Deserialize = D; }
+ bool getDeserialize() const { return Deserialize; }
+
+ void Visit(const Decl *D) {
+ getNodeDelegate().AddChild([=] {
+ getNodeDelegate().Visit(D);
+ if (!D)
+ return;
+
+ ConstDeclVisitor<Derived>::Visit(D);
+
+ for (const auto &A : D->attrs())
+ Visit(A);
+
+ if (const comments::FullComment *Comment =
+ D->getASTContext().getLocalCommentForDeclUncached(D))
+ Visit(Comment, Comment);
+
+ // Decls within functions are visited by the body.
+ if (!isa<FunctionDecl>(*D) && !isa<ObjCMethodDecl>(*D)) {
+ if (const auto *DC = dyn_cast<DeclContext>(D))
+ dumpDeclContext(DC);
+ }
+ });
+ }
+
+ void Visit(const Stmt *S, StringRef Label = {}) {
+ getNodeDelegate().AddChild(Label, [=] {
+ getNodeDelegate().Visit(S);
+
+ if (!S) {
+ return;
+ }
+
+ ConstStmtVisitor<Derived>::Visit(S);
+
+ // Some statements have custom mechanisms for dumping their children.
+ if (isa<DeclStmt>(S) || isa<GenericSelectionExpr>(S)) {
+ return;
+ }
+
+ for (const Stmt *SubStmt : S->children())
+ Visit(SubStmt);
+ });
+ }
+
+ void Visit(QualType T) {
+ SplitQualType SQT = T.split();
+ if (!SQT.Quals.hasQualifiers())
+ return Visit(SQT.Ty);
+
+ getNodeDelegate().AddChild([=] {
+ getNodeDelegate().Visit(T);
+ Visit(T.split().Ty);
+ });
+ }
+
+ void Visit(const Type *T) {
+ getNodeDelegate().AddChild([=] {
+ getNodeDelegate().Visit(T);
+ if (!T)
+ return;
+ TypeVisitor<Derived>::Visit(T);
+
+ QualType SingleStepDesugar =
+ T->getLocallyUnqualifiedSingleStepDesugaredType();
+ if (SingleStepDesugar != QualType(T, 0))
+ Visit(SingleStepDesugar);
+ });
+ }
+
+ void Visit(const Attr *A) {
+ getNodeDelegate().AddChild([=] {
+ getNodeDelegate().Visit(A);
+ ConstAttrVisitor<Derived>::Visit(A);
+ });
+ }
+
+ void Visit(const CXXCtorInitializer *Init) {
+ getNodeDelegate().AddChild([=] {
+ getNodeDelegate().Visit(Init);
+ Visit(Init->getInit());
+ });
+ }
+
+ void Visit(const TemplateArgument &A, SourceRange R = {},
+ const Decl *From = nullptr, const char *Label = nullptr) {
+ getNodeDelegate().AddChild([=] {
+ getNodeDelegate().Visit(A, R, From, Label);
+ ConstTemplateArgumentVisitor<Derived>::Visit(A);
+ });
+ }
+
+ void Visit(const BlockDecl::Capture &C) {
+ getNodeDelegate().AddChild([=] {
+ getNodeDelegate().Visit(C);
+ if (C.hasCopyExpr())
+ Visit(C.getCopyExpr());
+ });
+ }
+
+ void Visit(const OMPClause *C) {
+ getNodeDelegate().AddChild([=] {
+ getNodeDelegate().Visit(C);
+ for (const auto *S : C->children())
+ Visit(S);
+ });
+ }
+
+ void Visit(const GenericSelectionExpr::ConstAssociation &A) {
+ getNodeDelegate().AddChild([=] {
+ getNodeDelegate().Visit(A);
+ if (const TypeSourceInfo *TSI = A.getTypeSourceInfo())
+ Visit(TSI->getType());
+ Visit(A.getAssociationExpr());
+ });
+ }
+
+ void Visit(const comments::Comment *C, const comments::FullComment *FC) {
+ getNodeDelegate().AddChild([=] {
+ getNodeDelegate().Visit(C, FC);
+ if (!C) {
+ return;
+ }
+ comments::ConstCommentVisitor<Derived, void,
+ const comments::FullComment *>::visit(C,
+ FC);
+ for (comments::Comment::child_iterator I = C->child_begin(),
+ E = C->child_end();
+ I != E; ++I)
+ Visit(*I, FC);
+ });
+ }
+
+ void Visit(const ast_type_traits::DynTypedNode &N) {
+ // FIXME: Improve this with a switch or a visitor pattern.
+ if (const auto *D = N.get<Decl>())
+ Visit(D);
+ else if (const auto *S = N.get<Stmt>())
+ Visit(S);
+ else if (const auto *QT = N.get<QualType>())
+ Visit(*QT);
+ else if (const auto *T = N.get<Type>())
+ Visit(T);
+ else if (const auto *C = N.get<CXXCtorInitializer>())
+ Visit(C);
+ else if (const auto *C = N.get<OMPClause>())
+ Visit(C);
+ else if (const auto *T = N.get<TemplateArgument>())
+ Visit(*T);
+ }
+
+ void dumpDeclContext(const DeclContext *DC) {
+ if (!DC)
+ return;
+
+ for (const auto *D : (Deserialize ? DC->decls() : DC->noload_decls()))
+ Visit(D);
+ }
+
+ void dumpTemplateParameters(const TemplateParameterList *TPL) {
+ if (!TPL)
+ return;
+
+ for (const auto &TP : *TPL)
+ Visit(TP);
+ }
+
+ void
+ dumpASTTemplateArgumentListInfo(const ASTTemplateArgumentListInfo *TALI) {
+ if (!TALI)
+ return;
+
+ for (const auto &TA : TALI->arguments())
+ dumpTemplateArgumentLoc(TA);
+ }
+
+ void dumpTemplateArgumentLoc(const TemplateArgumentLoc &A,
+ const Decl *From = nullptr,
+ const char *Label = nullptr) {
+ Visit(A.getArgument(), A.getSourceRange(), From, Label);
+ }
+
+ void dumpTemplateArgumentList(const TemplateArgumentList &TAL) {
+ for (unsigned i = 0, e = TAL.size(); i < e; ++i)
+ Visit(TAL[i]);
+ }
+
+ void dumpObjCTypeParamList(const ObjCTypeParamList *typeParams) {
+ if (!typeParams)
+ return;
+
+ for (const auto &typeParam : *typeParams) {
+ Visit(typeParam);
+ }
+ }
+
+ void VisitComplexType(const ComplexType *T) { Visit(T->getElementType()); }
+ void VisitLocInfoType(const LocInfoType *T) {
+ Visit(T->getTypeSourceInfo()->getType());
+ }
+ void VisitPointerType(const PointerType *T) { Visit(T->getPointeeType()); }
+ void VisitBlockPointerType(const BlockPointerType *T) {
+ Visit(T->getPointeeType());
+ }
+ void VisitReferenceType(const ReferenceType *T) {
+ Visit(T->getPointeeType());
+ }
+ void VisitMemberPointerType(const MemberPointerType *T) {
+ Visit(T->getClass());
+ Visit(T->getPointeeType());
+ }
+ void VisitArrayType(const ArrayType *T) { Visit(T->getElementType()); }
+ void VisitVariableArrayType(const VariableArrayType *T) {
+ VisitArrayType(T);
+ Visit(T->getSizeExpr());
+ }
+ void VisitDependentSizedArrayType(const DependentSizedArrayType *T) {
+ Visit(T->getElementType());
+ Visit(T->getSizeExpr());
+ }
+ void VisitDependentSizedExtVectorType(const DependentSizedExtVectorType *T) {
+ Visit(T->getElementType());
+ Visit(T->getSizeExpr());
+ }
+ void VisitVectorType(const VectorType *T) { Visit(T->getElementType()); }
+ void VisitFunctionType(const FunctionType *T) { Visit(T->getReturnType()); }
+ void VisitFunctionProtoType(const FunctionProtoType *T) {
+ VisitFunctionType(T);
+ for (const QualType &PT : T->getParamTypes())
+ Visit(PT);
+ }
+ void VisitTypeOfExprType(const TypeOfExprType *T) {
+ Visit(T->getUnderlyingExpr());
+ }
+ void VisitDecltypeType(const DecltypeType *T) {
+ Visit(T->getUnderlyingExpr());
+ }
+ void VisitUnaryTransformType(const UnaryTransformType *T) {
+ Visit(T->getBaseType());
+ }
+ void VisitAttributedType(const AttributedType *T) {
+ // FIXME: AttrKind
+ Visit(T->getModifiedType());
+ }
+ void VisitSubstTemplateTypeParmType(const SubstTemplateTypeParmType *T) {
+ Visit(T->getReplacedParameter());
+ }
+ void
+ VisitSubstTemplateTypeParmPackType(const SubstTemplateTypeParmPackType *T) {
+ Visit(T->getReplacedParameter());
+ Visit(T->getArgumentPack());
+ }
+ void VisitTemplateSpecializationType(const TemplateSpecializationType *T) {
+ for (const auto &Arg : *T)
+ Visit(Arg);
+ if (T->isTypeAlias())
+ Visit(T->getAliasedType());
+ }
+ void VisitObjCObjectPointerType(const ObjCObjectPointerType *T) {
+ Visit(T->getPointeeType());
+ }
+ void VisitAtomicType(const AtomicType *T) { Visit(T->getValueType()); }
+ void VisitPipeType(const PipeType *T) { Visit(T->getElementType()); }
+ void VisitAdjustedType(const AdjustedType *T) { Visit(T->getOriginalType()); }
+ void VisitPackExpansionType(const PackExpansionType *T) {
+ if (!T->isSugared())
+ Visit(T->getPattern());
+ }
+ // FIXME: ElaboratedType, DependentNameType,
+ // DependentTemplateSpecializationType, ObjCObjectType
+
+ void VisitTypedefDecl(const TypedefDecl *D) { Visit(D->getUnderlyingType()); }
+
+ void VisitEnumConstantDecl(const EnumConstantDecl *D) {
+ if (const Expr *Init = D->getInitExpr())
+ Visit(Init);
+ }
+
+ void VisitFunctionDecl(const FunctionDecl *D) {
+ if (const auto *FTSI = D->getTemplateSpecializationInfo())
+ dumpTemplateArgumentList(*FTSI->TemplateArguments);
+
+ if (D->param_begin())
+ for (const auto *Parameter : D->parameters())
+ Visit(Parameter);
+
+ if (const auto *C = dyn_cast<CXXConstructorDecl>(D))
+ for (const auto *I : C->inits())
+ Visit(I);
+
+ if (D->doesThisDeclarationHaveABody())
+ Visit(D->getBody());
+ }
+
+ void VisitFieldDecl(const FieldDecl *D) {
+ if (D->isBitField())
+ Visit(D->getBitWidth());
+ if (Expr *Init = D->getInClassInitializer())
+ Visit(Init);
+ }
+
+ void VisitVarDecl(const VarDecl *D) {
+ if (D->hasInit())
+ Visit(D->getInit());
+ }
+
+ void VisitDecompositionDecl(const DecompositionDecl *D) {
+ VisitVarDecl(D);
+ for (const auto *B : D->bindings())
+ Visit(B);
+ }
+
+ void VisitBindingDecl(const BindingDecl *D) {
+ if (const auto *E = D->getBinding())
+ Visit(E);
+ }
+
+ void VisitFileScopeAsmDecl(const FileScopeAsmDecl *D) {
+ Visit(D->getAsmString());
+ }
+
+ void VisitCapturedDecl(const CapturedDecl *D) { Visit(D->getBody()); }
+
+ void VisitOMPThreadPrivateDecl(const OMPThreadPrivateDecl *D) {
+ for (const auto *E : D->varlists())
+ Visit(E);
+ }
+
+ void VisitOMPDeclareReductionDecl(const OMPDeclareReductionDecl *D) {
+ Visit(D->getCombiner());
+ if (const auto *Initializer = D->getInitializer())
+ Visit(Initializer);
+ }
+
+ void VisitOMPDeclareMapperDecl(const OMPDeclareMapperDecl *D) {
+ for (const auto *C : D->clauselists())
+ Visit(C);
+ }
+
+ void VisitOMPCapturedExprDecl(const OMPCapturedExprDecl *D) {
+ Visit(D->getInit());
+ }
+
+ void VisitOMPAllocateDecl(const OMPAllocateDecl *D) {
+ for (const auto *E : D->varlists())
+ Visit(E);
+ for (const auto *C : D->clauselists())
+ Visit(C);
+ }
+
+ template <typename SpecializationDecl>
+ void dumpTemplateDeclSpecialization(const SpecializationDecl *D) {
+ for (const auto *RedeclWithBadType : D->redecls()) {
+ // FIXME: The redecls() range sometimes has elements of a less-specific
+ // type. (In particular, ClassTemplateSpecializationDecl::redecls() gives
+ // us TagDecls, and should give CXXRecordDecls).
+ auto *Redecl = dyn_cast<SpecializationDecl>(RedeclWithBadType);
+ if (!Redecl) {
+ // Found the injected-class-name for a class template. This will be
+ // dumped as part of its surrounding class so we don't need to dump it
+ // here.
+ assert(isa<CXXRecordDecl>(RedeclWithBadType) &&
+ "expected an injected-class-name");
+ continue;
+ }
+ Visit(Redecl);
+ }
+ }
+
+ template <typename TemplateDecl>
+ void dumpTemplateDecl(const TemplateDecl *D) {
+ dumpTemplateParameters(D->getTemplateParameters());
+
+ Visit(D->getTemplatedDecl());
+
+ for (const auto *Child : D->specializations())
+ dumpTemplateDeclSpecialization(Child);
+ }
+
+ void VisitTypeAliasDecl(const TypeAliasDecl *D) {
+ Visit(D->getUnderlyingType());
+ }
+
+ void VisitTypeAliasTemplateDecl(const TypeAliasTemplateDecl *D) {
+ dumpTemplateParameters(D->getTemplateParameters());
+ Visit(D->getTemplatedDecl());
+ }
+
+ void VisitStaticAssertDecl(const StaticAssertDecl *D) {
+ Visit(D->getAssertExpr());
+ Visit(D->getMessage());
+ }
+
+ void VisitFunctionTemplateDecl(const FunctionTemplateDecl *D) {
+ dumpTemplateDecl(D);
+ }
+
+ void VisitClassTemplateDecl(const ClassTemplateDecl *D) {
+ dumpTemplateDecl(D);
+ }
+
+ void VisitClassTemplateSpecializationDecl(
+ const ClassTemplateSpecializationDecl *D) {
+ dumpTemplateArgumentList(D->getTemplateArgs());
+ }
+
+ void VisitClassTemplatePartialSpecializationDecl(
+ const ClassTemplatePartialSpecializationDecl *D) {
+ VisitClassTemplateSpecializationDecl(D);
+ dumpTemplateParameters(D->getTemplateParameters());
+ }
+
+ void VisitClassScopeFunctionSpecializationDecl(
+ const ClassScopeFunctionSpecializationDecl *D) {
+ Visit(D->getSpecialization());
+ dumpASTTemplateArgumentListInfo(D->getTemplateArgsAsWritten());
+ }
+ void VisitVarTemplateDecl(const VarTemplateDecl *D) { dumpTemplateDecl(D); }
+
+ void VisitBuiltinTemplateDecl(const BuiltinTemplateDecl *D) {
+ dumpTemplateParameters(D->getTemplateParameters());
+ }
+
+ void
+ VisitVarTemplateSpecializationDecl(const VarTemplateSpecializationDecl *D) {
+ dumpTemplateArgumentList(D->getTemplateArgs());
+ VisitVarDecl(D);
+ }
+
+ void VisitVarTemplatePartialSpecializationDecl(
+ const VarTemplatePartialSpecializationDecl *D) {
+ dumpTemplateParameters(D->getTemplateParameters());
+ VisitVarTemplateSpecializationDecl(D);
+ }
+
+ void VisitTemplateTypeParmDecl(const TemplateTypeParmDecl *D) {
+ if (D->hasDefaultArgument())
+ Visit(D->getDefaultArgument(), SourceRange(),
+ D->getDefaultArgStorage().getInheritedFrom(),
+ D->defaultArgumentWasInherited() ? "inherited from" : "previous");
+ }
+
+ void VisitNonTypeTemplateParmDecl(const NonTypeTemplateParmDecl *D) {
+ if (D->hasDefaultArgument())
+ Visit(D->getDefaultArgument(), SourceRange(),
+ D->getDefaultArgStorage().getInheritedFrom(),
+ D->defaultArgumentWasInherited() ? "inherited from" : "previous");
+ }
+
+ void VisitTemplateTemplateParmDecl(const TemplateTemplateParmDecl *D) {
+ dumpTemplateParameters(D->getTemplateParameters());
+ if (D->hasDefaultArgument())
+ dumpTemplateArgumentLoc(
+ D->getDefaultArgument(), D->getDefaultArgStorage().getInheritedFrom(),
+ D->defaultArgumentWasInherited() ? "inherited from" : "previous");
+ }
+
+ void VisitConceptDecl(const ConceptDecl *D) {
+ dumpTemplateParameters(D->getTemplateParameters());
+ Visit(D->getConstraintExpr());
+ }
+
+ void VisitUsingShadowDecl(const UsingShadowDecl *D) {
+ if (auto *TD = dyn_cast<TypeDecl>(D->getUnderlyingDecl()))
+ Visit(TD->getTypeForDecl());
+ }
+
+ void VisitFriendDecl(const FriendDecl *D) {
+ if (!D->getFriendType())
+ Visit(D->getFriendDecl());
+ }
+
+ void VisitObjCMethodDecl(const ObjCMethodDecl *D) {
+ if (D->isThisDeclarationADefinition())
+ dumpDeclContext(D);
+ else
+ for (const ParmVarDecl *Parameter : D->parameters())
+ Visit(Parameter);
+
+ if (D->hasBody())
+ Visit(D->getBody());
+ }
+
+ void VisitObjCCategoryDecl(const ObjCCategoryDecl *D) {
+ dumpObjCTypeParamList(D->getTypeParamList());
+ }
+
+ void VisitObjCInterfaceDecl(const ObjCInterfaceDecl *D) {
+ dumpObjCTypeParamList(D->getTypeParamListAsWritten());
+ }
+
+ void VisitObjCImplementationDecl(const ObjCImplementationDecl *D) {
+ for (const auto &I : D->inits())
+ Visit(I);
+ }
+
+ void VisitBlockDecl(const BlockDecl *D) {
+ for (const auto &I : D->parameters())
+ Visit(I);
+
+ for (const auto &I : D->captures())
+ Visit(I);
+ Visit(D->getBody());
+ }
+
+ void VisitDeclStmt(const DeclStmt *Node) {
+ for (const auto &D : Node->decls())
+ Visit(D);
+ }
+
+ void VisitAttributedStmt(const AttributedStmt *Node) {
+ for (const auto *A : Node->getAttrs())
+ Visit(A);
+ }
+
+ void VisitCXXCatchStmt(const CXXCatchStmt *Node) {
+ Visit(Node->getExceptionDecl());
+ }
+
+ void VisitCapturedStmt(const CapturedStmt *Node) {
+ Visit(Node->getCapturedDecl());
+ }
+
+ void VisitOMPExecutableDirective(const OMPExecutableDirective *Node) {
+ for (const auto *C : Node->clauses())
+ Visit(C);
+ }
+
+ void VisitInitListExpr(const InitListExpr *ILE) {
+ if (auto *Filler = ILE->getArrayFiller()) {
+ Visit(Filler, "array_filler");
+ }
+ }
+
+ void VisitBlockExpr(const BlockExpr *Node) { Visit(Node->getBlockDecl()); }
+
+ void VisitOpaqueValueExpr(const OpaqueValueExpr *Node) {
+ if (Expr *Source = Node->getSourceExpr())
+ Visit(Source);
+ }
+
+ void VisitGenericSelectionExpr(const GenericSelectionExpr *E) {
+ Visit(E->getControllingExpr());
+ Visit(E->getControllingExpr()->getType()); // FIXME: remove
+
+ for (const auto &Assoc : E->associations()) {
+ Visit(Assoc);
+ }
+ }
+
+ void VisitLambdaExpr(const LambdaExpr *Node) {
+ Visit(Node->getLambdaClass());
+ }
+
+ void VisitSizeOfPackExpr(const SizeOfPackExpr *Node) {
+ if (Node->isPartiallySubstituted())
+ for (const auto &A : Node->getPartialArguments())
+ Visit(A);
+ }
+
+ void VisitObjCAtCatchStmt(const ObjCAtCatchStmt *Node) {
+ if (const VarDecl *CatchParam = Node->getCatchParamDecl())
+ Visit(CatchParam);
+ }
+
+ void VisitExpressionTemplateArgument(const TemplateArgument &TA) {
+ Visit(TA.getAsExpr());
+ }
+ void VisitPackTemplateArgument(const TemplateArgument &TA) {
+ for (const auto &TArg : TA.pack_elements())
+ Visit(TArg);
+ }
+
+ // Implements Visit methods for Attrs.
+#include "clang/AST/AttrNodeTraverse.inc"
+};
+
+} // namespace clang
+
+#endif // LLVM_CLANG_AST_ASTNODETRAVERSER_H
diff --git a/include/clang/AST/ASTStructuralEquivalence.h b/include/clang/AST/ASTStructuralEquivalence.h
index f8847505bc72..70e0daa08a9a 100644
--- a/include/clang/AST/ASTStructuralEquivalence.h
+++ b/include/clang/AST/ASTStructuralEquivalence.h
@@ -1,9 +1,8 @@
//===- ASTStructuralEquivalence.h -------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
@@ -112,6 +111,10 @@ struct StructuralEquivalenceContext {
static llvm::Optional<unsigned>
findUntaggedStructOrUnionIndex(RecordDecl *Anon);
+ // If ErrorOnTagTypeMismatch is set, return the the error, otherwise get the
+ // relevant warning for the input error diagnostic.
+ unsigned getApplicableDiagnostic(unsigned ErrorDiagnostic);
+
private:
/// Finish checking all of the structural equivalences.
///
diff --git a/include/clang/AST/ASTTypeTraits.h b/include/clang/AST/ASTTypeTraits.h
index 9df9793370c4..a29a04e5d242 100644
--- a/include/clang/AST/ASTTypeTraits.h
+++ b/include/clang/AST/ASTTypeTraits.h
@@ -1,9 +1,8 @@
//===--- ASTTypeTraits.h ----------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
@@ -19,6 +18,7 @@
#include "clang/AST/ASTFwd.h"
#include "clang/AST/Decl.h"
#include "clang/AST/NestedNameSpecifier.h"
+#include "clang/AST/OpenMPClause.h"
#include "clang/AST/Stmt.h"
#include "clang/AST/TemplateBase.h"
#include "clang/AST/TypeLoc.h"
@@ -38,6 +38,17 @@ struct PrintingPolicy;
namespace ast_type_traits {
+/// Defines how we descend a level in the AST when we pass
+/// through expressions.
+enum TraversalKind {
+ /// Will traverse all child nodes.
+ TK_AsIs,
+
+ /// Will not traverse implicit casts and parentheses.
+ /// Corresponds to Expr::IgnoreParenImpCasts()
+ TK_IgnoreImplicitCastsAndParentheses
+};
+
/// Kind identifier.
///
/// It can be constructed from any node kind and allows for runtime type
@@ -59,6 +70,7 @@ public:
static ASTNodeKind getFromNode(const Decl &D);
static ASTNodeKind getFromNode(const Stmt &S);
static ASTNodeKind getFromNode(const Type &T);
+ static ASTNodeKind getFromNode(const OMPClause &C);
/// \}
/// Returns \c true if \c this and \c Other represent the same kind.
@@ -137,6 +149,9 @@ private:
NKI_Type,
#define TYPE(DERIVED, BASE) NKI_##DERIVED##Type,
#include "clang/AST/TypeNodes.def"
+ NKI_OMPClause,
+#define OPENMP_CLAUSE(TextualSpelling, Class) NKI_##Class,
+#include "clang/Basic/OpenMPKinds.def"
NKI_NumberOfKinds
};
@@ -184,12 +199,15 @@ KIND_TO_KIND_ID(TypeLoc)
KIND_TO_KIND_ID(Decl)
KIND_TO_KIND_ID(Stmt)
KIND_TO_KIND_ID(Type)
+KIND_TO_KIND_ID(OMPClause)
#define DECL(DERIVED, BASE) KIND_TO_KIND_ID(DERIVED##Decl)
#include "clang/AST/DeclNodes.inc"
#define STMT(DERIVED, BASE) KIND_TO_KIND_ID(DERIVED)
#include "clang/AST/StmtNodes.inc"
#define TYPE(DERIVED, BASE) KIND_TO_KIND_ID(DERIVED##Type)
#include "clang/AST/TypeNodes.def"
+#define OPENMP_CLAUSE(TextualSpelling, Class) KIND_TO_KIND_ID(Class)
+#include "clang/Basic/OpenMPKinds.def"
#undef KIND_TO_KIND_ID
inline raw_ostream &operator<<(raw_ostream &OS, ASTNodeKind K) {
@@ -460,6 +478,11 @@ struct DynTypedNode::BaseConverter<
T, typename std::enable_if<std::is_base_of<Type, T>::value>::type>
: public DynCastPtrConverter<T, Type> {};
+template <typename T>
+struct DynTypedNode::BaseConverter<
+ T, typename std::enable_if<std::is_base_of<OMPClause, T>::value>::type>
+ : public DynCastPtrConverter<T, OMPClause> {};
+
template <>
struct DynTypedNode::BaseConverter<
NestedNameSpecifier, void> : public PtrConverter<NestedNameSpecifier> {};
diff --git a/include/clang/AST/ASTUnresolvedSet.h b/include/clang/AST/ASTUnresolvedSet.h
index 9bf63bb6e2d7..8d2b23b3539a 100644
--- a/include/clang/AST/ASTUnresolvedSet.h
+++ b/include/clang/AST/ASTUnresolvedSet.h
@@ -1,9 +1,8 @@
//===- ASTUnresolvedSet.h - Unresolved sets of declarations -----*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
diff --git a/include/clang/AST/ASTVector.h b/include/clang/AST/ASTVector.h
index 51de119f080e..d5a04767ca13 100644
--- a/include/clang/AST/ASTVector.h
+++ b/include/clang/AST/ASTVector.h
@@ -1,9 +1,8 @@
//===- ASTVector.h - Vector that uses ASTContext for allocation ---*- C++ -*-=//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
diff --git a/include/clang/AST/Attr.h b/include/clang/AST/Attr.h
index 3a319326d269..1fbed7ceebfa 100644
--- a/include/clang/AST/Attr.h
+++ b/include/clang/AST/Attr.h
@@ -1,9 +1,8 @@
//===--- Attr.h - Classes for representing attributes ----------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
diff --git a/include/clang/AST/AttrIterator.h b/include/clang/AST/AttrIterator.h
index 43ad1c931967..78ce9314a2bb 100644
--- a/include/clang/AST/AttrIterator.h
+++ b/include/clang/AST/AttrIterator.h
@@ -1,9 +1,8 @@
//===- AttrIterator.h - Classes for attribute iteration ---------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
diff --git a/include/clang/AST/AttrVisitor.h b/include/clang/AST/AttrVisitor.h
index 867f9e7ad18d..d271db010ed1 100644
--- a/include/clang/AST/AttrVisitor.h
+++ b/include/clang/AST/AttrVisitor.h
@@ -1,9 +1,8 @@
//===- AttrVisitor.h - Visitor for Attr subclasses --------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
diff --git a/include/clang/AST/Availability.h b/include/clang/AST/Availability.h
index 28f3c3c01d20..527fc4b59a5f 100644
--- a/include/clang/AST/Availability.h
+++ b/include/clang/AST/Availability.h
@@ -1,9 +1,8 @@
//===--- Availability.h - Classes for availability --------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
diff --git a/include/clang/AST/BaseSubobject.h b/include/clang/AST/BaseSubobject.h
index 8fd4ac69ebd6..15600f02fcef 100644
--- a/include/clang/AST/BaseSubobject.h
+++ b/include/clang/AST/BaseSubobject.h
@@ -1,9 +1,8 @@
//===- BaseSubobject.h - BaseSubobject class --------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
@@ -81,11 +80,6 @@ template<> struct DenseMapInfo<clang::BaseSubobject> {
}
};
-// It's OK to treat BaseSubobject as a POD type.
-template <> struct isPodLike<clang::BaseSubobject> {
- static const bool value = true;
-};
-
} // namespace llvm
#endif // LLVM_CLANG_AST_BASESUBOBJECT_H
diff --git a/include/clang/AST/BuiltinTypes.def b/include/clang/AST/BuiltinTypes.def
index 400efcb1981f..74a45ee4ccc0 100644
--- a/include/clang/AST/BuiltinTypes.def
+++ b/include/clang/AST/BuiltinTypes.def
@@ -1,9 +1,8 @@
//===-- BuiltinTypes.def - Metadata about BuiltinTypes ----------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
diff --git a/include/clang/AST/CXXInheritance.h b/include/clang/AST/CXXInheritance.h
index f5e23f8e8505..bb2ad9c64d3b 100644
--- a/include/clang/AST/CXXInheritance.h
+++ b/include/clang/AST/CXXInheritance.h
@@ -1,9 +1,8 @@
//===- CXXInheritance.h - C++ Inheritance -----------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
diff --git a/include/clang/AST/CanonicalType.h b/include/clang/AST/CanonicalType.h
index c2f01e7d5460..2e00d344533d 100644
--- a/include/clang/AST/CanonicalType.h
+++ b/include/clang/AST/CanonicalType.h
@@ -1,9 +1,8 @@
//===- CanonicalType.h - C Language Family Type Representation --*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
@@ -510,7 +509,7 @@ struct CanProxyAdaptor<FunctionProtoType>
}
LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(bool, isVariadic)
- LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(Qualifiers, getTypeQuals)
+ LLVM_CLANG_CANPROXY_SIMPLE_ACCESSOR(Qualifiers, getMethodQuals)
using param_type_iterator =
CanTypeIterator<FunctionProtoType::param_type_iterator>;
diff --git a/include/clang/AST/CharUnits.h b/include/clang/AST/CharUnits.h
index 0aadf06fffc9..37f489c7708a 100644
--- a/include/clang/AST/CharUnits.h
+++ b/include/clang/AST/CharUnits.h
@@ -1,9 +1,8 @@
//===--- CharUnits.h - Character units for sizes and offsets ----*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
@@ -238,10 +237,6 @@ template<> struct DenseMapInfo<clang::CharUnits> {
}
};
-template <> struct isPodLike<clang::CharUnits> {
- static const bool value = true;
-};
-
} // end namespace llvm
#endif // LLVM_CLANG_AST_CHARUNITS_H
diff --git a/include/clang/AST/Comment.h b/include/clang/AST/Comment.h
index 1b590562e152..2c284a271bb7 100644
--- a/include/clang/AST/Comment.h
+++ b/include/clang/AST/Comment.h
@@ -1,9 +1,8 @@
//===--- Comment.h - Comment AST nodes --------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
diff --git a/include/clang/AST/CommentBriefParser.h b/include/clang/AST/CommentBriefParser.h
index baa22930539e..cfd2137bd68c 100644
--- a/include/clang/AST/CommentBriefParser.h
+++ b/include/clang/AST/CommentBriefParser.h
@@ -1,9 +1,8 @@
//===--- CommentBriefParser.h - Dumb comment parser -------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
diff --git a/include/clang/AST/CommentCommandTraits.h b/include/clang/AST/CommentCommandTraits.h
index 4fd007872c01..83a29a540d42 100644
--- a/include/clang/AST/CommentCommandTraits.h
+++ b/include/clang/AST/CommentCommandTraits.h
@@ -1,9 +1,8 @@
//===--- CommentCommandTraits.h - Comment command properties ----*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
diff --git a/include/clang/AST/CommentDiagnostic.h b/include/clang/AST/CommentDiagnostic.h
index b9816f1a8e62..2e498d5db386 100644
--- a/include/clang/AST/CommentDiagnostic.h
+++ b/include/clang/AST/CommentDiagnostic.h
@@ -1,9 +1,8 @@
//===--- CommentDiagnostic.h - Diagnostics for the AST library --*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/clang/AST/CommentLexer.h b/include/clang/AST/CommentLexer.h
index 3ef5b7c8c998..9ddbb7d31d99 100644
--- a/include/clang/AST/CommentLexer.h
+++ b/include/clang/AST/CommentLexer.h
@@ -1,9 +1,8 @@
//===--- CommentLexer.h - Lexer for structured comments ---------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
diff --git a/include/clang/AST/CommentParser.h b/include/clang/AST/CommentParser.h
index fa8862899c14..1a0cfb06e52b 100644
--- a/include/clang/AST/CommentParser.h
+++ b/include/clang/AST/CommentParser.h
@@ -1,9 +1,8 @@
//===--- CommentParser.h - Doxygen comment parser ---------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
diff --git a/include/clang/AST/CommentSema.h b/include/clang/AST/CommentSema.h
index 632eba782b92..307618fa5363 100644
--- a/include/clang/AST/CommentSema.h
+++ b/include/clang/AST/CommentSema.h
@@ -1,9 +1,8 @@
//===--- CommentSema.h - Doxygen comment semantic analysis ------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
diff --git a/include/clang/AST/CommentVisitor.h b/include/clang/AST/CommentVisitor.h
index e37e9d6cd299..d9a7439f7cc0 100644
--- a/include/clang/AST/CommentVisitor.h
+++ b/include/clang/AST/CommentVisitor.h
@@ -1,9 +1,8 @@
//===- CommentVisitor.h - Visitor for Comment subclasses --------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
diff --git a/include/clang/AST/ComparisonCategories.h b/include/clang/AST/ComparisonCategories.h
index 23bfd708e7eb..9d591cc81495 100644
--- a/include/clang/AST/ComparisonCategories.h
+++ b/include/clang/AST/ComparisonCategories.h
@@ -1,9 +1,8 @@
//===- ComparisonCategories.h - Three Way Comparison Data -------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
diff --git a/include/clang/AST/CurrentSourceLocExprScope.h b/include/clang/AST/CurrentSourceLocExprScope.h
new file mode 100644
index 000000000000..4ebbdf63abb5
--- /dev/null
+++ b/include/clang/AST/CurrentSourceLocExprScope.h
@@ -0,0 +1,75 @@
+//===--- CurrentSourceLocExprScope.h ----------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file defines types used to track the current context needed to evaluate
+// a SourceLocExpr.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_AST_CURRENT_SOURCE_LOC_EXPR_SCOPE_H
+#define LLVM_CLANG_AST_CURRENT_SOURCE_LOC_EXPR_SCOPE_H
+
+#include <cassert>
+
+namespace clang {
+class Expr;
+
+/// Represents the current source location and context used to determine the
+/// value of the source location builtins (ex. __builtin_LINE), including the
+/// context of default argument and default initializer expressions.
+class CurrentSourceLocExprScope {
+ /// The CXXDefaultArgExpr or CXXDefaultInitExpr we're currently evaluating.
+ const Expr *DefaultExpr = nullptr;
+
+public:
+ /// A RAII style scope guard used for tracking the current source
+ /// location and context as used by the source location builtins
+ /// (ex. __builtin_LINE).
+ class SourceLocExprScopeGuard;
+
+ const Expr *getDefaultExpr() const { return DefaultExpr; }
+
+ explicit CurrentSourceLocExprScope() = default;
+
+private:
+ explicit CurrentSourceLocExprScope(const Expr *DefaultExpr)
+ : DefaultExpr(DefaultExpr) {}
+
+ CurrentSourceLocExprScope(CurrentSourceLocExprScope const &) = default;
+ CurrentSourceLocExprScope &
+ operator=(CurrentSourceLocExprScope const &) = default;
+};
+
+class CurrentSourceLocExprScope::SourceLocExprScopeGuard {
+public:
+ SourceLocExprScopeGuard(const Expr *DefaultExpr,
+ CurrentSourceLocExprScope &Current)
+ : Current(Current), OldVal(Current), Enable(false) {
+ assert(DefaultExpr && "the new scope should not be empty");
+ if ((Enable = (Current.getDefaultExpr() == nullptr)))
+ Current = CurrentSourceLocExprScope(DefaultExpr);
+ }
+
+ ~SourceLocExprScopeGuard() {
+ if (Enable)
+ Current = OldVal;
+ }
+
+private:
+ SourceLocExprScopeGuard(SourceLocExprScopeGuard const &) = delete;
+ SourceLocExprScopeGuard &operator=(SourceLocExprScopeGuard const &) = delete;
+
+ CurrentSourceLocExprScope &Current;
+ CurrentSourceLocExprScope OldVal;
+ bool Enable;
+};
+
+} // end namespace clang
+
+#endif // LLVM_CLANG_AST_CURRENT_SOURCE_LOC_EXPR_SCOPE_H
diff --git a/include/clang/AST/DataCollection.h b/include/clang/AST/DataCollection.h
index 8b2a8345d941..37f101793ecc 100644
--- a/include/clang/AST/DataCollection.h
+++ b/include/clang/AST/DataCollection.h
@@ -1,9 +1,8 @@
//===--- DatatCollection.h --------------------------------------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
/// \file
diff --git a/include/clang/AST/Decl.h b/include/clang/AST/Decl.h
index de2765391f0f..02742801f37c 100644
--- a/include/clang/AST/Decl.h
+++ b/include/clang/AST/Decl.h
@@ -1,9 +1,8 @@
//===- Decl.h - Classes for representing declarations -----------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
@@ -1227,10 +1226,15 @@ public:
void setInit(Expr *I);
- /// Determine whether this variable's value can be used in a
+ /// Determine whether this variable's value might be usable in a
/// constant expression, according to the relevant language standard.
/// This only checks properties of the declaration, and does not check
/// whether the initializer is in fact a constant expression.
+ bool mightBeUsableInConstantExpressions(ASTContext &C) const;
+
+ /// Determine whether this variable's value can be used in a
+ /// constant expression, according to the relevant language standard,
+ /// including checking whether it was initialized by a constant expression.
bool isUsableInConstantExpressions(ASTContext &C) const;
EvaluatedStmt *ensureEvaluatedStmt() const;
@@ -1396,6 +1400,10 @@ public:
NonParmVarDeclBits.IsInitCapture = IC;
}
+ /// Determine whether this variable is actually a function parameter pack or
+ /// init-capture pack.
+ bool isParameterPack() const;
+
/// Whether this local extern variable declaration's previous declaration
/// was declared in the same block scope. Only correct in C++.
bool isPreviousDeclInSameBlockScope() const {
@@ -1435,6 +1443,12 @@ public:
/// template specialization or instantiation this is.
TemplateSpecializationKind getTemplateSpecializationKind() const;
+ /// Get the template specialization kind of this variable for the purposes of
+ /// template instantiation. This differs from getTemplateSpecializationKind()
+ /// for an instantiation of a class-scope explicit specialization.
+ TemplateSpecializationKind
+ getTemplateSpecializationKindForInstantiation() const;
+
/// If this variable is an instantiation of a variable template or a
/// static data member of a class template, determine its point of
/// instantiation.
@@ -1683,10 +1697,6 @@ public:
QualType getOriginalType() const;
- /// Determine whether this parameter is actually a function
- /// parameter pack.
- bool isParameterPack() const;
-
/// Sets the function declaration that owns this
/// ParmVarDecl. Since ParmVarDecls are often created before the
/// FunctionDecls that own them, this routine is required to update
@@ -1743,10 +1753,19 @@ class FunctionDecl : public DeclaratorDecl,
public:
/// The kind of templated function a FunctionDecl can be.
enum TemplatedKind {
+ // Not templated.
TK_NonTemplate,
+ // The pattern in a function template declaration.
TK_FunctionTemplate,
+ // A non-template function that is an instantiation or explicit
+ // specialization of a member of a templated class.
TK_MemberSpecialization,
+ // An instantiation or explicit specialization of a function template.
+ // Note: this might have been instantiated from a templated class if it
+ // is a class-scope explicit specialization.
TK_FunctionTemplateSpecialization,
+ // A function template specialization that hasn't yet been resolved to a
+ // particular specialized function template.
TK_DependentFunctionTemplateSpecialization
};
@@ -1842,7 +1861,7 @@ protected:
FunctionDecl(Kind DK, ASTContext &C, DeclContext *DC, SourceLocation StartLoc,
const DeclarationNameInfo &NameInfo, QualType T,
TypeSourceInfo *TInfo, StorageClass S, bool isInlineSpecified,
- bool isConstexprSpecified);
+ ConstexprSpecKind ConstexprKind);
using redeclarable_base = Redeclarable<FunctionDecl>;
@@ -1872,29 +1891,24 @@ public:
using redeclarable_base::getMostRecentDecl;
using redeclarable_base::isFirstDecl;
- static FunctionDecl *Create(ASTContext &C, DeclContext *DC,
- SourceLocation StartLoc, SourceLocation NLoc,
- DeclarationName N, QualType T,
- TypeSourceInfo *TInfo,
- StorageClass SC,
- bool isInlineSpecified = false,
- bool hasWrittenPrototype = true,
- bool isConstexprSpecified = false) {
+ static FunctionDecl *
+ Create(ASTContext &C, DeclContext *DC, SourceLocation StartLoc,
+ SourceLocation NLoc, DeclarationName N, QualType T,
+ TypeSourceInfo *TInfo, StorageClass SC, bool isInlineSpecified = false,
+ bool hasWrittenPrototype = true,
+ ConstexprSpecKind ConstexprKind = CSK_unspecified) {
DeclarationNameInfo NameInfo(N, NLoc);
- return FunctionDecl::Create(C, DC, StartLoc, NameInfo, T, TInfo,
- SC,
+ return FunctionDecl::Create(C, DC, StartLoc, NameInfo, T, TInfo, SC,
isInlineSpecified, hasWrittenPrototype,
- isConstexprSpecified);
+ ConstexprKind);
}
static FunctionDecl *Create(ASTContext &C, DeclContext *DC,
SourceLocation StartLoc,
- const DeclarationNameInfo &NameInfo,
- QualType T, TypeSourceInfo *TInfo,
- StorageClass SC,
- bool isInlineSpecified,
- bool hasWrittenPrototype,
- bool isConstexprSpecified = false);
+ const DeclarationNameInfo &NameInfo, QualType T,
+ TypeSourceInfo *TInfo, StorageClass SC,
+ bool isInlineSpecified, bool hasWrittenPrototype,
+ ConstexprSpecKind ConstexprKind);
static FunctionDecl *CreateDeserialized(ASTContext &C, unsigned ID);
@@ -2091,8 +2105,21 @@ public:
}
/// Whether this is a (C++11) constexpr function or constexpr constructor.
- bool isConstexpr() const { return FunctionDeclBits.IsConstexpr; }
- void setConstexpr(bool IC) { FunctionDeclBits.IsConstexpr = IC; }
+ bool isConstexpr() const {
+ return FunctionDeclBits.ConstexprKind != CSK_unspecified;
+ }
+ void setConstexprKind(ConstexprSpecKind CSK) {
+ FunctionDeclBits.ConstexprKind = CSK;
+ }
+ ConstexprSpecKind getConstexprKind() const {
+ return static_cast<ConstexprSpecKind>(FunctionDeclBits.ConstexprKind);
+ }
+ bool isConstexprSpecified() const {
+ return FunctionDeclBits.ConstexprKind == CSK_constexpr;
+ }
+ bool isConsteval() const {
+ return FunctionDeclBits.ConstexprKind == CSK_consteval;
+ }
/// Whether the instantiation of this function is pending.
/// This bit is set when the decision to instantiate this function is made
@@ -2256,7 +2283,7 @@ public:
return const_cast<FunctionDecl*>(this)->getCanonicalDecl();
}
- unsigned getBuiltinID() const;
+ unsigned getBuiltinID(bool ConsiderWrapperFunctions = false) const;
// ArrayRef interface to parameters.
ArrayRef<ParmVarDecl *> parameters() const {
@@ -2316,6 +2343,14 @@ public:
return T->castAs<FunctionType>()->getReturnType();
}
+ /// Gets the ExceptionSpecificationType as declared.
+ ExceptionSpecificationType getExceptionSpecType() const {
+ auto *TSI = getTypeSourceInfo();
+ QualType T = TSI ? TSI->getType() : getType();
+ const auto *FPT = T->getAs<FunctionProtoType>();
+ return FPT ? FPT->getExceptionSpecType() : EST_None;
+ }
+
/// Attempt to compute an informative source range covering the
/// function exception specification, if any.
SourceRange getExceptionSpecSourceRange() const;
@@ -2355,22 +2390,14 @@ public:
/// that was defined in the class body.
bool isInlined() const { return FunctionDeclBits.IsInline; }
- /// Whether this function is marked as explicit explicitly.
- bool isExplicitSpecified() const {
- return FunctionDeclBits.IsExplicitSpecified;
- }
-
- /// State that this function is marked as explicit explicitly.
- void setExplicitSpecified(bool ExpSpec = true) {
- FunctionDeclBits.IsExplicitSpecified = ExpSpec;
- }
-
bool isInlineDefinitionExternallyVisible() const;
bool isMSExternInline() const;
bool doesDeclarationForceExternallyVisibleDefinition() const;
+ bool isStatic() const { return getStorageClass() == SC_Static; }
+
/// Whether this function declaration represents an C++ overloaded
/// operator, e.g., "operator+".
bool isOverloadedOperator() const {
@@ -2441,10 +2468,6 @@ public:
return getPrimaryTemplate() != nullptr;
}
- /// Retrieve the class scope template pattern that this function
- /// template specialization is instantiated from.
- FunctionDecl *getClassScopeSpecializationPattern() const;
-
/// If this function is actually a function template specialization,
/// retrieve information about this function template specialization.
/// Otherwise, returns NULL.
@@ -2531,6 +2554,11 @@ public:
/// represents.
TemplateSpecializationKind getTemplateSpecializationKind() const;
+ /// Determine the kind of template specialization this function represents
+ /// for the purpose of template instantiation.
+ TemplateSpecializationKind
+ getTemplateSpecializationKindForInstantiation() const;
+
/// Determine what kind of template instantiation this function
/// represents.
void setTemplateSpecializationKind(TemplateSpecializationKind TSK,
@@ -2703,6 +2731,11 @@ public:
/// bit-fields.
bool isZeroLengthBitField(const ASTContext &Ctx) const;
+ /// Determine if this field is a subobject of zero size, that is, either a
+ /// zero-length bit-field or a field of empty class type with the
+ /// [[no_unique_address]] attribute.
+ bool isZeroSize(const ASTContext &Ctx) const;
+
/// Get the kind of (C++11) default member initializer that this field has.
InClassInitStyle getInClassInitStyle() const {
InitStorageKind storageKind = InitStorage.getInt();
@@ -3713,6 +3746,30 @@ public:
RecordDeclBits.NonTrivialToPrimitiveDestroy = V;
}
+ bool hasNonTrivialToPrimitiveDefaultInitializeCUnion() const {
+ return RecordDeclBits.HasNonTrivialToPrimitiveDefaultInitializeCUnion;
+ }
+
+ void setHasNonTrivialToPrimitiveDefaultInitializeCUnion(bool V) {
+ RecordDeclBits.HasNonTrivialToPrimitiveDefaultInitializeCUnion = V;
+ }
+
+ bool hasNonTrivialToPrimitiveDestructCUnion() const {
+ return RecordDeclBits.HasNonTrivialToPrimitiveDestructCUnion;
+ }
+
+ void setHasNonTrivialToPrimitiveDestructCUnion(bool V) {
+ RecordDeclBits.HasNonTrivialToPrimitiveDestructCUnion = V;
+ }
+
+ bool hasNonTrivialToPrimitiveCopyCUnion() const {
+ return RecordDeclBits.HasNonTrivialToPrimitiveCopyCUnion;
+ }
+
+ void setHasNonTrivialToPrimitiveCopyCUnion(bool V) {
+ RecordDeclBits.HasNonTrivialToPrimitiveCopyCUnion = V;
+ }
+
/// Determine whether this class can be passed in registers. In C++ mode,
/// it must have at least one trivial, non-deleted copy or move constructor.
/// FIXME: This should be set as part of completeDefinition.
@@ -3852,7 +3909,7 @@ public:
static bool classofKind(Kind K) { return K == FileScopeAsm; }
};
-/// Pepresents a block literal declaration, which is like an
+/// Represents a block literal declaration, which is like an
/// unnamed FunctionDecl. For example:
/// ^{ statement-body } or ^(int arg1, float arg2){ statement-body }
class BlockDecl : public Decl, public DeclContext {
@@ -4009,6 +4066,13 @@ public:
bool doesNotEscape() const { return BlockDeclBits.DoesNotEscape; }
void setDoesNotEscape(bool B = true) { BlockDeclBits.DoesNotEscape = B; }
+ bool canAvoidCopyToHeap() const {
+ return BlockDeclBits.CanAvoidCopyToHeap;
+ }
+ void setCanAvoidCopyToHeap(bool B = true) {
+ BlockDeclBits.CanAvoidCopyToHeap = B;
+ }
+
bool capturesVariable(const VarDecl *var) const;
void setCaptures(ASTContext &Context, ArrayRef<Capture> Captures,
@@ -4233,8 +4297,10 @@ public:
SourceLocation getRBraceLoc() const { return RBraceLoc; }
void setRBraceLoc(SourceLocation L) { RBraceLoc = L; }
+ bool hasBraces() const { return RBraceLoc.isValid(); }
+
SourceLocation getEndLoc() const LLVM_READONLY {
- if (RBraceLoc.isValid())
+ if (hasBraces())
return RBraceLoc;
// No braces: get the end location of the (only) declaration in context
// (if present).
diff --git a/include/clang/AST/DeclAccessPair.h b/include/clang/AST/DeclAccessPair.h
index 3c5056c6e55b..805342c2910a 100644
--- a/include/clang/AST/DeclAccessPair.h
+++ b/include/clang/AST/DeclAccessPair.h
@@ -1,9 +1,8 @@
//===--- DeclAccessPair.h - A decl bundled with its path access -*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
@@ -61,12 +60,4 @@ public:
};
}
-// Take a moment to tell SmallVector that DeclAccessPair is POD.
-namespace llvm {
-template<typename> struct isPodLike;
-template<> struct isPodLike<clang::DeclAccessPair> {
- static const bool value = true;
-};
-}
-
#endif
diff --git a/include/clang/AST/DeclBase.h b/include/clang/AST/DeclBase.h
index 8405a43fa098..d64d0cb425db 100644
--- a/include/clang/AST/DeclBase.h
+++ b/include/clang/AST/DeclBase.h
@@ -1,9 +1,8 @@
//===- DeclBase.h - Base Classes for representing declarations --*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
@@ -14,6 +13,7 @@
#ifndef LLVM_CLANG_AST_DECLBASE_H
#define LLVM_CLANG_AST_DECLBASE_H
+#include "clang/AST/ASTDumperUtils.h"
#include "clang/AST/AttrIterator.h"
#include "clang/AST/DeclarationName.h"
#include "clang/Basic/IdentifierTable.h"
@@ -42,6 +42,7 @@ namespace clang {
class ASTContext;
class ASTMutationListener;
class Attr;
+class BlockDecl;
class DeclContext;
class ExternalSourceSymbolAttr;
class FunctionDecl;
@@ -176,7 +177,10 @@ public:
IDNS_LocalExtern = 0x0800,
/// This declaration is an OpenMP user defined reduction construction.
- IDNS_OMPReduction = 0x1000
+ IDNS_OMPReduction = 0x1000,
+
+ /// This declaration is an OpenMP user defined mapper.
+ IDNS_OMPMapper = 0x2000,
};
/// ObjCDeclQualifier - 'Qualifiers' written next to the return and
@@ -324,7 +328,7 @@ protected:
unsigned FromASTFile : 1;
/// IdentifierNamespace - This specifies what IDNS_* namespace this lives in.
- unsigned IdentifierNamespace : 13;
+ unsigned IdentifierNamespace : 14;
/// If 0, we have not computed the linkage of this declaration.
/// Otherwise, it is the linkage + 1.
@@ -364,6 +368,13 @@ private:
return ModuleOwnershipKind::Unowned;
}
+public:
+ Decl() = delete;
+ Decl(const Decl&) = delete;
+ Decl(Decl &&) = delete;
+ Decl &operator=(const Decl&) = delete;
+ Decl &operator=(Decl&&) = delete;
+
protected:
Decl(Kind DK, DeclContext *DC, SourceLocation L)
: NextInContextAndBits(nullptr, getModuleOwnershipKindForChildOf(DC)),
@@ -597,10 +608,6 @@ public:
return getModuleOwnershipKind() == ModuleOwnershipKind::ModulePrivate;
}
- /// Whether this declaration is exported (by virtue of being lexically
- /// within an ExportDecl or by being a NamespaceDecl).
- bool isExported() const;
-
/// Return true if this declaration has an attribute which acts as
/// definition of the entity, such as 'alias' or 'ifunc'.
bool hasDefiningAttr() const;
@@ -1135,7 +1142,8 @@ public:
// Same as dump(), but forces color printing.
void dumpColor() const;
- void dump(raw_ostream &Out, bool Deserialize = false) const;
+ void dump(raw_ostream &Out, bool Deserialize = false,
+ ASTDumpOutputFormat OutputFormat = ADOF_Default) const;
/// \return Unique reproducible object identifier
int64_t getID() const;
@@ -1252,6 +1260,7 @@ public:
/// NamespaceDecl
/// TagDecl
/// OMPDeclareReductionDecl
+/// OMPDeclareMapperDecl
/// FunctionDecl
/// ObjCMethodDecl
/// ObjCContainerDecl
@@ -1431,6 +1440,13 @@ class DeclContext {
uint64_t NonTrivialToPrimitiveCopy : 1;
uint64_t NonTrivialToPrimitiveDestroy : 1;
+ /// The following bits indicate whether this is or contains a C union that
+ /// is non-trivial to default-initialize, destruct, or copy. These bits
+ /// imply the associated basic non-triviality predicates declared above.
+ uint64_t HasNonTrivialToPrimitiveDefaultInitializeCUnion : 1;
+ uint64_t HasNonTrivialToPrimitiveDestructCUnion : 1;
+ uint64_t HasNonTrivialToPrimitiveCopyCUnion : 1;
+
/// Indicates whether this struct is destroyed in the callee.
uint64_t ParamDestroyedInCallee : 1;
@@ -1439,7 +1455,7 @@ class DeclContext {
};
/// Number of non-inherited bits in RecordDeclBitfields.
- enum { NumRecordDeclBits = 11 };
+ enum { NumRecordDeclBits = 14 };
/// Stores the bits used by OMPDeclareReductionDecl.
/// If modified NumOMPDeclareReductionDeclBits and the accessor
@@ -1472,10 +1488,6 @@ class DeclContext {
uint64_t IsInline : 1;
uint64_t IsInlineSpecified : 1;
- /// This is shared by CXXConstructorDecl,
- /// CXXConversionDecl, and CXXDeductionGuideDecl.
- uint64_t IsExplicitSpecified : 1;
-
uint64_t IsVirtualAsWritten : 1;
uint64_t IsPure : 1;
uint64_t HasInheritedPrototype : 1;
@@ -1495,7 +1507,9 @@ class DeclContext {
uint64_t IsExplicitlyDefaulted : 1;
uint64_t HasImplicitReturnZero : 1;
uint64_t IsLateTemplateParsed : 1;
- uint64_t IsConstexpr : 1;
+
+ /// Kind of contexpr specifier as defined by ConstexprSpecKind.
+ uint64_t ConstexprKind : 2;
uint64_t InstantiationIsPending : 1;
/// Indicates if the function uses __try.
@@ -1535,17 +1549,25 @@ class DeclContext {
/// For the bits in FunctionDeclBitfields.
uint64_t : NumFunctionDeclBits;
- /// 25 bits to fit in the remaining availible space.
+ /// 24 bits to fit in the remaining available space.
/// Note that this makes CXXConstructorDeclBitfields take
/// exactly 64 bits and thus the width of NumCtorInitializers
/// will need to be shrunk if some bit is added to NumDeclContextBitfields,
/// NumFunctionDeclBitfields or CXXConstructorDeclBitfields.
- uint64_t NumCtorInitializers : 25;
+ uint64_t NumCtorInitializers : 23;
uint64_t IsInheritingConstructor : 1;
+
+ /// Whether this constructor has a trail-allocated explicit specifier.
+ uint64_t HasTrailingExplicitSpecifier : 1;
+ /// If this constructor does't have a trail-allocated explicit specifier.
+ /// Whether this constructor is explicit specified.
+ uint64_t IsSimpleExplicit : 1;
};
/// Number of non-inherited bits in CXXConstructorDeclBitfields.
- enum { NumCXXConstructorDeclBits = 26 };
+ enum {
+ NumCXXConstructorDeclBits = 64 - NumDeclContextBits - NumFunctionDeclBits
+ };
/// Stores the bits used by ObjCMethodDecl.
/// If modified NumObjCMethodDeclBits and the accessor
@@ -1662,6 +1684,11 @@ class DeclContext {
/// A bit that indicates this block is passed directly to a function as a
/// non-escaping parameter.
uint64_t DoesNotEscape : 1;
+
+ /// A bit that indicates whether it's possible to avoid coying this block to
+ /// the heap when it initializes or is assigned to a local variable with
+ /// automatic storage.
+ uint64_t CanAvoidCopyToHeap : 1;
};
/// Number of non-inherited bits in BlockDeclBitfields.
@@ -1784,6 +1811,10 @@ public:
bool isClosure() const { return getDeclKind() == Decl::Block; }
+ /// Return this DeclContext if it is a BlockDecl. Otherwise, return the
+ /// innermost enclosing BlockDecl or null if there are no enclosing blocks.
+ const BlockDecl *getInnermostBlockDecl() const;
+
bool isObjCContainer() const {
switch (getDeclKind()) {
case Decl::ObjCCategory:
diff --git a/include/clang/AST/DeclCXX.h b/include/clang/AST/DeclCXX.h
index d3357c245d86..7add83f89624 100644
--- a/include/clang/AST/DeclCXX.h
+++ b/include/clang/AST/DeclCXX.h
@@ -1,9 +1,8 @@
//===- DeclCXX.h - Classes for representing C++ declarations --*- C++ -*-=====//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
@@ -64,6 +63,7 @@ class CXXDestructorDecl;
class CXXFinalOverriderMap;
class CXXIndirectPrimaryBaseSet;
class CXXMethodDecl;
+class DecompositionDecl;
class DiagnosticBuilder;
class FriendDecl;
class FunctionTemplateDecl;
@@ -334,10 +334,12 @@ class CXXRecordDecl : public RecordDecl {
/// True when this class is a POD-type.
unsigned PlainOldData : 1;
- /// true when this class is empty for traits purposes,
- /// i.e. has no data members other than 0-width bit-fields, has no
- /// virtual function/base, and doesn't inherit from a non-empty
- /// class. Doesn't take union-ness into account.
+ /// True when this class is empty for traits purposes, that is:
+ /// * has no data members other than 0-width bit-fields and empty fields
+ /// marked [[no_unique_address]]
+ /// * has no virtual function/base, and
+ /// * doesn't inherit from a non-empty class.
+ /// Doesn't take union-ness into account.
unsigned Empty : 1;
/// True when this class is polymorphic, i.e., has at
@@ -1222,6 +1224,9 @@ public:
/// lambda.
TemplateParameterList *getGenericLambdaTemplateParameterList() const;
+ /// Retrieve the lambda template parameters that were specified explicitly.
+ ArrayRef<NamedDecl *> getLambdaExplicitTemplateParameters() const;
+
LambdaCaptureDefault getLambdaCaptureDefault() const {
assert(isLambda());
return static_cast<LambdaCaptureDefault>(getLambdaData().CaptureDefault);
@@ -1326,6 +1331,14 @@ public:
/// \note This does NOT include a check for union-ness.
bool isEmpty() const { return data().Empty; }
+ bool hasPrivateFields() const {
+ return data().HasPrivateFields;
+ }
+
+ bool hasProtectedFields() const {
+ return data().HasProtectedFields;
+ }
+
/// Determine whether this class has direct non-static data members.
bool hasDirectFields() const {
auto &D = data();
@@ -1829,6 +1842,14 @@ public:
CXXBasePath &Path, DeclarationName Name);
/// Base-class lookup callback that determines whether there exists
+ /// an OpenMP declare mapper member with the given name.
+ ///
+ /// This callback can be used with \c lookupInBases() to find members
+ /// of the given name within a C++ class hierarchy.
+ static bool FindOMPMapperMember(const CXXBaseSpecifier *Specifier,
+ CXXBasePath &Path, DeclarationName Name);
+
+ /// Base-class lookup callback that determines whether there exists
/// a member with the given name that can be used in a nested-name-specifier.
///
/// This callback can be used with \c lookupInBases() to find members of
@@ -1975,6 +1996,53 @@ public:
}
};
+/// Store information needed for an explicit specifier.
+/// used by CXXDeductionGuideDecl, CXXConstructorDecl and CXXConversionDecl.
+class ExplicitSpecifier {
+ llvm::PointerIntPair<Expr *, 2, ExplicitSpecKind> ExplicitSpec{
+ nullptr, ExplicitSpecKind::ResolvedFalse};
+
+public:
+ ExplicitSpecifier() = default;
+ ExplicitSpecifier(Expr *Expression, ExplicitSpecKind Kind)
+ : ExplicitSpec(Expression, Kind) {}
+ ExplicitSpecKind getKind() const { return ExplicitSpec.getInt(); }
+ const Expr *getExpr() const { return ExplicitSpec.getPointer(); }
+ Expr *getExpr() { return ExplicitSpec.getPointer(); }
+
+ /// Return true if the ExplicitSpecifier isn't defaulted.
+ bool isSpecified() const {
+ return ExplicitSpec.getInt() != ExplicitSpecKind::ResolvedFalse ||
+ ExplicitSpec.getPointer();
+ }
+
+ /// Check for Equivalence of explicit specifiers.
+ /// Return True if the explicit specifier are equivalent false otherwise.
+ bool isEquivalent(const ExplicitSpecifier Other) const;
+ /// Return true if the explicit specifier is already resolved to be explicit.
+ bool isExplicit() const {
+ return ExplicitSpec.getInt() == ExplicitSpecKind::ResolvedTrue;
+ }
+ /// Return true if the ExplicitSpecifier isn't valid.
+ /// This state occurs after a substitution failures.
+ bool isInvalid() const {
+ return ExplicitSpec.getInt() == ExplicitSpecKind::Unresolved &&
+ !ExplicitSpec.getPointer();
+ }
+ void setKind(ExplicitSpecKind Kind) { ExplicitSpec.setInt(Kind); }
+ void setExpr(Expr *E) { ExplicitSpec.setPointer(E); }
+ // getFromDecl - retrieve the explicit specifier in the given declaration.
+ // if the given declaration has no explicit. the returned explicit specifier
+ // is defaulted. .isSpecified() will be false.
+ static ExplicitSpecifier getFromDecl(FunctionDecl *Function);
+ static const ExplicitSpecifier getFromDecl(const FunctionDecl *Function) {
+ return getFromDecl(const_cast<FunctionDecl *>(Function));
+ }
+ static ExplicitSpecifier Invalid() {
+ return ExplicitSpecifier(nullptr, ExplicitSpecKind::Unresolved);
+ }
+};
+
/// Represents a C++ deduction guide declaration.
///
/// \code
@@ -1990,31 +2058,36 @@ class CXXDeductionGuideDecl : public FunctionDecl {
private:
CXXDeductionGuideDecl(ASTContext &C, DeclContext *DC, SourceLocation StartLoc,
- bool IsExplicit, const DeclarationNameInfo &NameInfo,
- QualType T, TypeSourceInfo *TInfo,
- SourceLocation EndLocation)
+ ExplicitSpecifier ES,
+ const DeclarationNameInfo &NameInfo, QualType T,
+ TypeSourceInfo *TInfo, SourceLocation EndLocation)
: FunctionDecl(CXXDeductionGuide, C, DC, StartLoc, NameInfo, T, TInfo,
- SC_None, false, false) {
+ SC_None, false, CSK_unspecified),
+ ExplicitSpec(ES) {
if (EndLocation.isValid())
setRangeEnd(EndLocation);
- setExplicitSpecified(IsExplicit);
setIsCopyDeductionCandidate(false);
}
+ ExplicitSpecifier ExplicitSpec;
+ void setExplicitSpecifier(ExplicitSpecifier ES) { ExplicitSpec = ES; }
+
public:
friend class ASTDeclReader;
friend class ASTDeclWriter;
- static CXXDeductionGuideDecl *Create(ASTContext &C, DeclContext *DC,
- SourceLocation StartLoc, bool IsExplicit,
- const DeclarationNameInfo &NameInfo,
- QualType T, TypeSourceInfo *TInfo,
- SourceLocation EndLocation);
+ static CXXDeductionGuideDecl *
+ Create(ASTContext &C, DeclContext *DC, SourceLocation StartLoc,
+ ExplicitSpecifier ES, const DeclarationNameInfo &NameInfo, QualType T,
+ TypeSourceInfo *TInfo, SourceLocation EndLocation);
static CXXDeductionGuideDecl *CreateDeserialized(ASTContext &C, unsigned ID);
- /// Whether this deduction guide is explicit.
- bool isExplicit() const { return isExplicitSpecified(); }
+ ExplicitSpecifier getExplicitSpecifier() { return ExplicitSpec; }
+ const ExplicitSpecifier getExplicitSpecifier() const { return ExplicitSpec; }
+
+ /// Return true if the declartion is already resolved to be explicit.
+ bool isExplicit() const { return ExplicitSpec.isExplicit(); }
/// Get the template for which this guide performs deduction.
TemplateDecl *getDeducedTemplate() const {
@@ -2044,11 +2117,11 @@ class CXXMethodDecl : public FunctionDecl {
protected:
CXXMethodDecl(Kind DK, ASTContext &C, CXXRecordDecl *RD,
SourceLocation StartLoc, const DeclarationNameInfo &NameInfo,
- QualType T, TypeSourceInfo *TInfo,
- StorageClass SC, bool isInline,
- bool isConstexpr, SourceLocation EndLocation)
- : FunctionDecl(DK, C, RD, StartLoc, NameInfo, T, TInfo,
- SC, isInline, isConstexpr) {
+ QualType T, TypeSourceInfo *TInfo, StorageClass SC,
+ bool isInline, ConstexprSpecKind ConstexprKind,
+ SourceLocation EndLocation)
+ : FunctionDecl(DK, C, RD, StartLoc, NameInfo, T, TInfo, SC, isInline,
+ ConstexprKind) {
if (EndLocation.isValid())
setRangeEnd(EndLocation);
}
@@ -2056,11 +2129,9 @@ protected:
public:
static CXXMethodDecl *Create(ASTContext &C, CXXRecordDecl *RD,
SourceLocation StartLoc,
- const DeclarationNameInfo &NameInfo,
- QualType T, TypeSourceInfo *TInfo,
- StorageClass SC,
- bool isInline,
- bool isConstexpr,
+ const DeclarationNameInfo &NameInfo, QualType T,
+ TypeSourceInfo *TInfo, StorageClass SC,
+ bool isInline, ConstexprSpecKind ConstexprKind,
SourceLocation EndLocation);
static CXXMethodDecl *CreateDeserialized(ASTContext &C, unsigned ID);
@@ -2161,20 +2232,20 @@ public:
overridden_method_range overridden_methods() const;
- /// Returns the parent of this method declaration, which
+ /// Return the parent of this method declaration, which
/// is the class in which this method is defined.
const CXXRecordDecl *getParent() const {
return cast<CXXRecordDecl>(FunctionDecl::getParent());
}
- /// Returns the parent of this method declaration, which
+ /// Return the parent of this method declaration, which
/// is the class in which this method is defined.
CXXRecordDecl *getParent() {
return const_cast<CXXRecordDecl *>(
cast<CXXRecordDecl>(FunctionDecl::getParent()));
}
- /// Returns the type of the \c this pointer.
+ /// Return the type of the \c this pointer.
///
/// Should only be called for instance (i.e., non-static) methods. Note
/// that for the call operator of a lambda closure type, this returns the
@@ -2182,11 +2253,19 @@ public:
/// 'this' type.
QualType getThisType() const;
+ /// Return the type of the object pointed by \c this.
+ ///
+ /// See getThisType() for usage restriction.
+ QualType getThisObjectType() const;
+
static QualType getThisType(const FunctionProtoType *FPT,
const CXXRecordDecl *Decl);
- Qualifiers getTypeQualifiers() const {
- return getType()->getAs<FunctionProtoType>()->getTypeQuals();
+ static QualType getThisObjectType(const FunctionProtoType *FPT,
+ const CXXRecordDecl *Decl);
+
+ Qualifiers getMethodQualifiers() const {
+ return getType()->getAs<FunctionProtoType>()->getMethodQuals();
}
/// Retrieve the ref-qualifier associated with this method.
@@ -2231,6 +2310,17 @@ public:
->getCorrespondingMethodInClass(RD, MayBeBase);
}
+ /// Find if \p RD declares a function that overrides this function, and if so,
+ /// return it. Does not search base classes.
+ CXXMethodDecl *getCorrespondingMethodDeclaredInClass(const CXXRecordDecl *RD,
+ bool MayBeBase = false);
+ const CXXMethodDecl *
+ getCorrespondingMethodDeclaredInClass(const CXXRecordDecl *RD,
+ bool MayBeBase = false) const {
+ return const_cast<CXXMethodDecl *>(this)
+ ->getCorrespondingMethodDeclaredInClass(RD, MayBeBase);
+ }
+
// Implement isa/cast/dyncast/etc.
static bool classof(const Decl *D) { return classofKind(D->getKind()); }
static bool classofKind(Kind K) {
@@ -2483,7 +2573,8 @@ public:
/// \endcode
class CXXConstructorDecl final
: public CXXMethodDecl,
- private llvm::TrailingObjects<CXXConstructorDecl, InheritedConstructor> {
+ private llvm::TrailingObjects<CXXConstructorDecl, InheritedConstructor,
+ ExplicitSpecifier> {
// This class stores some data in DeclContext::CXXConstructorDeclBits
// to save some space. Use the provided accessors to access it.
@@ -2493,28 +2584,74 @@ class CXXConstructorDecl final
LazyCXXCtorInitializersPtr CtorInitializers;
CXXConstructorDecl(ASTContext &C, CXXRecordDecl *RD, SourceLocation StartLoc,
- const DeclarationNameInfo &NameInfo,
- QualType T, TypeSourceInfo *TInfo,
- bool isExplicitSpecified, bool isInline,
- bool isImplicitlyDeclared, bool isConstexpr,
+ const DeclarationNameInfo &NameInfo, QualType T,
+ TypeSourceInfo *TInfo, ExplicitSpecifier ES, bool isInline,
+ bool isImplicitlyDeclared, ConstexprSpecKind ConstexprKind,
InheritedConstructor Inherited);
void anchor() override;
+ size_t numTrailingObjects(OverloadToken<InheritedConstructor>) const {
+ return CXXConstructorDeclBits.IsInheritingConstructor;
+ }
+ size_t numTrailingObjects(OverloadToken<ExplicitSpecifier>) const {
+ return CXXConstructorDeclBits.HasTrailingExplicitSpecifier;
+ }
+
+ ExplicitSpecifier getExplicitSpecifierInternal() const {
+ if (CXXConstructorDeclBits.HasTrailingExplicitSpecifier)
+ return *getCanonicalDecl()->getTrailingObjects<ExplicitSpecifier>();
+ return ExplicitSpecifier(
+ nullptr, getCanonicalDecl()->CXXConstructorDeclBits.IsSimpleExplicit
+ ? ExplicitSpecKind::ResolvedTrue
+ : ExplicitSpecKind::ResolvedFalse);
+ }
+
+ void setExplicitSpecifier(ExplicitSpecifier ES) {
+ assert((!ES.getExpr() ||
+ CXXConstructorDeclBits.HasTrailingExplicitSpecifier) &&
+ "cannot set this explicit specifier. no trail-allocated space for "
+ "explicit");
+ if (ES.getExpr())
+ *getCanonicalDecl()->getTrailingObjects<ExplicitSpecifier>() = ES;
+ else
+ CXXConstructorDeclBits.IsSimpleExplicit = ES.isExplicit();
+ }
+
+ enum TraillingAllocKind {
+ TAKInheritsConstructor = 1,
+ TAKHasTailExplicit = 1 << 1,
+ };
+
+ uint64_t getTraillingAllocKind() const {
+ return numTrailingObjects(OverloadToken<InheritedConstructor>()) |
+ (numTrailingObjects(OverloadToken<ExplicitSpecifier>()) << 1);
+ }
+
public:
friend class ASTDeclReader;
friend class ASTDeclWriter;
friend TrailingObjects;
static CXXConstructorDecl *CreateDeserialized(ASTContext &C, unsigned ID,
- bool InheritsConstructor);
+ uint64_t AllocKind);
static CXXConstructorDecl *
Create(ASTContext &C, CXXRecordDecl *RD, SourceLocation StartLoc,
const DeclarationNameInfo &NameInfo, QualType T, TypeSourceInfo *TInfo,
- bool isExplicit, bool isInline, bool isImplicitlyDeclared,
- bool isConstexpr,
+ ExplicitSpecifier ES, bool isInline, bool isImplicitlyDeclared,
+ ConstexprSpecKind ConstexprKind,
InheritedConstructor Inherited = InheritedConstructor());
+ ExplicitSpecifier getExplicitSpecifier() {
+ return getExplicitSpecifierInternal();
+ }
+ const ExplicitSpecifier getExplicitSpecifier() const {
+ return getExplicitSpecifierInternal();
+ }
+
+ /// Return true if the declartion is already resolved to be explicit.
+ bool isExplicit() const { return getExplicitSpecifier().isExplicit(); }
+
/// Iterates through the member/base initializer list.
using init_iterator = CXXCtorInitializer **;
@@ -2585,11 +2722,6 @@ public:
CtorInitializers = Initializers;
}
- /// Whether this function is explicit.
- bool isExplicit() const {
- return getCanonicalDecl()->isExplicitSpecified();
- }
-
/// Determine whether this constructor is a delegating constructor.
bool isDelegatingConstructor() const {
return (getNumCtorInitializers() == 1) &&
@@ -2713,12 +2845,11 @@ class CXXDestructorDecl : public CXXMethodDecl {
Expr *OperatorDeleteThisArg = nullptr;
CXXDestructorDecl(ASTContext &C, CXXRecordDecl *RD, SourceLocation StartLoc,
- const DeclarationNameInfo &NameInfo,
- QualType T, TypeSourceInfo *TInfo,
- bool isInline, bool isImplicitlyDeclared)
- : CXXMethodDecl(CXXDestructor, C, RD, StartLoc, NameInfo, T, TInfo,
- SC_None, isInline, /*isConstexpr=*/false, SourceLocation())
- {
+ const DeclarationNameInfo &NameInfo, QualType T,
+ TypeSourceInfo *TInfo, bool isInline,
+ bool isImplicitlyDeclared)
+ : CXXMethodDecl(CXXDestructor, C, RD, StartLoc, NameInfo, T, TInfo,
+ SC_None, isInline, CSK_unspecified, SourceLocation()) {
setImplicit(isImplicitlyDeclared);
}
@@ -2768,34 +2899,39 @@ public:
class CXXConversionDecl : public CXXMethodDecl {
CXXConversionDecl(ASTContext &C, CXXRecordDecl *RD, SourceLocation StartLoc,
const DeclarationNameInfo &NameInfo, QualType T,
- TypeSourceInfo *TInfo, bool isInline,
- bool isExplicitSpecified, bool isConstexpr,
- SourceLocation EndLocation)
+ TypeSourceInfo *TInfo, bool isInline, ExplicitSpecifier ES,
+ ConstexprSpecKind ConstexprKind, SourceLocation EndLocation)
: CXXMethodDecl(CXXConversion, C, RD, StartLoc, NameInfo, T, TInfo,
- SC_None, isInline, isConstexpr, EndLocation) {
- setExplicitSpecified(isExplicitSpecified);
- }
-
+ SC_None, isInline, ConstexprKind, EndLocation),
+ ExplicitSpec(ES) {}
void anchor() override;
+ ExplicitSpecifier ExplicitSpec;
+
+ void setExplicitSpecifier(ExplicitSpecifier ES) { ExplicitSpec = ES; }
+
public:
friend class ASTDeclReader;
friend class ASTDeclWriter;
- static CXXConversionDecl *Create(ASTContext &C, CXXRecordDecl *RD,
- SourceLocation StartLoc,
- const DeclarationNameInfo &NameInfo,
- QualType T, TypeSourceInfo *TInfo,
- bool isInline, bool isExplicit,
- bool isConstexpr,
- SourceLocation EndLocation);
+ static CXXConversionDecl *
+ Create(ASTContext &C, CXXRecordDecl *RD, SourceLocation StartLoc,
+ const DeclarationNameInfo &NameInfo, QualType T, TypeSourceInfo *TInfo,
+ bool isInline, ExplicitSpecifier ES, ConstexprSpecKind ConstexprKind,
+ SourceLocation EndLocation);
static CXXConversionDecl *CreateDeserialized(ASTContext &C, unsigned ID);
- /// Whether this function is explicit.
- bool isExplicit() const {
- return getCanonicalDecl()->isExplicitSpecified();
+ ExplicitSpecifier getExplicitSpecifier() {
+ return getCanonicalDecl()->ExplicitSpec;
+ }
+
+ const ExplicitSpecifier getExplicitSpecifier() const {
+ return getCanonicalDecl()->ExplicitSpec;
}
+ /// Return true if the declartion is already resolved to be explicit.
+ bool isExplicit() const { return getExplicitSpecifier().isExplicit(); }
+
/// Returns the type that this conversion function is converting to.
QualType getConversionType() const {
return getType()->getAs<FunctionType>()->getReturnType();
@@ -3793,6 +3929,8 @@ public:
/// x[0], x[1], and x[2] respectively, where x is the implicit
/// DecompositionDecl of type 'int (&)[3]'.
class BindingDecl : public ValueDecl {
+ /// The declaration that this binding binds to part of.
+ LazyDeclPtr Decomp;
/// The binding represented by this declaration. References to this
/// declaration are effectively equivalent to this expression (except
/// that it is only evaluated once at the point of declaration of the
@@ -3816,6 +3954,10 @@ public:
/// decomposition declaration, and when the initializer is type-dependent.
Expr *getBinding() const { return Binding; }
+ /// Get the decomposition declaration that this binding represents a
+ /// decomposition of.
+ ValueDecl *getDecomposedDecl() const;
+
/// Get the variable (if any) that holds the value of evaluating the binding.
/// Only present for user-defined bindings for tuple-like types.
VarDecl *getHoldingVar() const;
@@ -3828,6 +3970,9 @@ public:
this->Binding = Binding;
}
+ /// Set the decomposed variable for this BindingDecl.
+ void setDecomposedDecl(ValueDecl *Decomposed) { Decomp = Decomposed; }
+
static bool classof(const Decl *D) { return classofKind(D->getKind()); }
static bool classofKind(Kind K) { return K == Decl::Binding; }
};
@@ -3855,6 +4000,8 @@ class DecompositionDecl final
NumBindings(Bindings.size()) {
std::uninitialized_copy(Bindings.begin(), Bindings.end(),
getTrailingObjects<BindingDecl *>());
+ for (auto *B : Bindings)
+ B->setDecomposedDecl(this);
}
void anchor() override;
diff --git a/include/clang/AST/DeclContextInternals.h b/include/clang/AST/DeclContextInternals.h
index ccd82d2cf0d2..e6a4cd4381e4 100644
--- a/include/clang/AST/DeclContextInternals.h
+++ b/include/clang/AST/DeclContextInternals.h
@@ -1,9 +1,8 @@
//===- DeclContextInternals.h - DeclContext Representation ------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
@@ -114,12 +113,11 @@ public:
}
DeclsTy &Vec = *getAsVector();
- DeclsTy::iterator I = std::find(Vec.begin(), Vec.end(), D);
+ DeclsTy::iterator I = llvm::find(Vec, D);
assert(I != Vec.end() && "list does not contain decl");
Vec.erase(I);
- assert(std::find(Vec.begin(), Vec.end(), D)
- == Vec.end() && "list still contains decl");
+ assert(llvm::find(Vec, D) == Vec.end() && "list still contains decl");
}
/// Remove any declarations which were imported from an external
diff --git a/include/clang/AST/DeclFriend.h b/include/clang/AST/DeclFriend.h
index b5808f23de6f..6f8306c6025e 100644
--- a/include/clang/AST/DeclFriend.h
+++ b/include/clang/AST/DeclFriend.h
@@ -1,9 +1,8 @@
//===- DeclFriend.h - Classes for C++ friend declarations -------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
diff --git a/include/clang/AST/DeclGroup.h b/include/clang/AST/DeclGroup.h
index 6d5aaadf529c..2be9dae9431e 100644
--- a/include/clang/AST/DeclGroup.h
+++ b/include/clang/AST/DeclGroup.h
@@ -1,9 +1,8 @@
//===- DeclGroup.h - Classes for representing groups of Decls ---*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
diff --git a/include/clang/AST/DeclLookups.h b/include/clang/AST/DeclLookups.h
index 9627f440d406..41c8999736ea 100644
--- a/include/clang/AST/DeclLookups.h
+++ b/include/clang/AST/DeclLookups.h
@@ -1,9 +1,8 @@
//===- DeclLookups.h - Low-level interface to all names in a DC -*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
diff --git a/include/clang/AST/DeclObjC.h b/include/clang/AST/DeclObjC.h
index 5b57411f9785..8d85ac36d861 100644
--- a/include/clang/AST/DeclObjC.h
+++ b/include/clang/AST/DeclObjC.h
@@ -1,9 +1,8 @@
//===- DeclObjC.h - Classes for representing declarations -------*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
diff --git a/include/clang/AST/DeclOpenMP.h b/include/clang/AST/DeclOpenMP.h
index 8540cc5b25b6..437feaba28fb 100644
--- a/include/clang/AST/DeclOpenMP.h
+++ b/include/clang/AST/DeclOpenMP.h
@@ -1,9 +1,8 @@
//===- DeclOpenMP.h - Classes for representing OpenMP directives -*- C++ -*-===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
///
@@ -207,6 +206,102 @@ public:
}
};
+/// This represents '#pragma omp declare mapper ...' directive. Map clauses are
+/// allowed to use with this directive. The following example declares a user
+/// defined mapper for the type 'struct vec'. This example instructs the fields
+/// 'len' and 'data' should be mapped when mapping instances of 'struct vec'.
+///
+/// \code
+/// #pragma omp declare mapper(mid: struct vec v) map(v.len, v.data[0:N])
+/// \endcode
+class OMPDeclareMapperDecl final : public ValueDecl, public DeclContext {
+ friend class ASTDeclReader;
+
+ /// Clauses associated with this mapper declaration
+ MutableArrayRef<OMPClause *> Clauses;
+
+ /// Mapper variable, which is 'v' in the example above
+ Expr *MapperVarRef = nullptr;
+
+ /// Name of the mapper variable
+ DeclarationName VarName;
+
+ LazyDeclPtr PrevDeclInScope;
+
+ virtual void anchor();
+
+ OMPDeclareMapperDecl(Kind DK, DeclContext *DC, SourceLocation L,
+ DeclarationName Name, QualType Ty,
+ DeclarationName VarName,
+ OMPDeclareMapperDecl *PrevDeclInScope)
+ : ValueDecl(DK, DC, L, Name, Ty), DeclContext(DK), VarName(VarName),
+ PrevDeclInScope(PrevDeclInScope) {}
+
+ void setPrevDeclInScope(OMPDeclareMapperDecl *Prev) {
+ PrevDeclInScope = Prev;
+ }
+
+ /// Sets an array of clauses to this mapper declaration
+ void setClauses(ArrayRef<OMPClause *> CL);
+
+public:
+ /// Creates declare mapper node.
+ static OMPDeclareMapperDecl *Create(ASTContext &C, DeclContext *DC,
+ SourceLocation L, DeclarationName Name,
+ QualType T, DeclarationName VarName,
+ OMPDeclareMapperDecl *PrevDeclInScope);
+ /// Creates deserialized declare mapper node.
+ static OMPDeclareMapperDecl *CreateDeserialized(ASTContext &C, unsigned ID,
+ unsigned N);
+
+ /// Creates an array of clauses to this mapper declaration and intializes
+ /// them.
+ void CreateClauses(ASTContext &C, ArrayRef<OMPClause *> CL);