aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2018-08-02 17:33:11 +0000
committerDimitry Andric <dim@FreeBSD.org>2018-08-02 17:33:11 +0000
commitc7e70c433efc6953dc3888b9fbf9f3512d7da2b0 (patch)
tree27425930fc0c91650a7f3527fcac8e0f92907b90
parent486754660bb926339aefcf012a3f848592babb8b (diff)
downloadsrc-c7e70c433efc6953dc3888b9fbf9f3512d7da2b0.tar.gz
src-c7e70c433efc6953dc3888b9fbf9f3512d7da2b0.zip
Vendor import of clang trunk r338536:vendor/clang/clang-trunk-r338536
Notes
Notes: svn path=/vendor/clang/dist/; revision=337139 svn path=/vendor/clang/clang-trunk-r338536/; revision=337140; tag=vendor/clang/clang-trunk-r338536
-rw-r--r--docs/ClangFormatStyleOptions.rst22
-rw-r--r--docs/ReleaseNotes.rst32
-rw-r--r--docs/UndefinedBehaviorSanitizer.rst34
-rw-r--r--docs/UsersManual.rst30
-rw-r--r--include/clang-c/Index.h272
-rw-r--r--include/clang/ARCMigrate/FileRemapper.h2
-rw-r--r--include/clang/AST/ASTContext.h24
-rw-r--r--include/clang/AST/ASTDiagnostic.h4
-rw-r--r--include/clang/AST/ASTImporter.h48
-rw-r--r--include/clang/AST/ASTLambda.h14
-rw-r--r--include/clang/AST/ASTMutationListener.h4
-rw-r--r--include/clang/AST/Attr.h2
-rw-r--r--include/clang/AST/AttrIterator.h2
-rw-r--r--include/clang/AST/BaseSubobject.h10
-rw-r--r--include/clang/AST/CXXInheritance.h44
-rw-r--r--include/clang/AST/CanonicalType.h6
-rw-r--r--include/clang/AST/CharUnits.h32
-rw-r--r--include/clang/AST/Comment.h16
-rw-r--r--include/clang/AST/CommentCommandTraits.h8
-rw-r--r--include/clang/AST/CommentLexer.h4
-rw-r--r--include/clang/AST/CommentSema.h6
-rw-r--r--include/clang/AST/Decl.h52
-rw-r--r--include/clang/AST/DeclBase.h22
-rw-r--r--include/clang/AST/DeclCXX.h66
-rw-r--r--include/clang/AST/DeclFriend.h2
-rw-r--r--include/clang/AST/DeclLookups.h2
-rw-r--r--include/clang/AST/DeclObjC.h144
-rw-r--r--include/clang/AST/DeclTemplate.h22
-rw-r--r--include/clang/AST/DeclarationName.h14
-rw-r--r--include/clang/AST/DependentDiagnostic.h4
-rw-r--r--include/clang/AST/EvaluatedExprVisitor.h4
-rw-r--r--include/clang/AST/Expr.h48
-rw-r--r--include/clang/AST/ExprCXX.h79
-rw-r--r--include/clang/AST/ExprObjC.h183
-rw-r--r--include/clang/AST/ExternalASTMerger.h8
-rw-r--r--include/clang/AST/ExternalASTSource.h28
-rw-r--r--include/clang/AST/GlobalDecl.h16
-rw-r--r--include/clang/AST/LambdaCapture.h2
-rw-r--r--include/clang/AST/Mangle.h2
-rw-r--r--include/clang/AST/NSAPI.h2
-rw-r--r--include/clang/AST/NestedNameSpecifier.h6
-rw-r--r--include/clang/AST/OperationKinds.def6
-rw-r--r--include/clang/AST/OperationKinds.h2
-rw-r--r--include/clang/AST/PrettyPrinter.h10
-rw-r--r--include/clang/AST/RecordLayout.h18
-rw-r--r--include/clang/AST/Stmt.h12
-rw-r--r--include/clang/AST/StmtIterator.h4
-rw-r--r--include/clang/AST/StmtObjC.h34
-rw-r--r--include/clang/AST/StmtOpenMP.h20
-rw-r--r--include/clang/AST/TemplateBase.h42
-rw-r--r--include/clang/AST/TemplateName.h74
-rw-r--r--include/clang/AST/Type.h18
-rw-r--r--include/clang/AST/TypeLoc.h12
-rw-r--r--include/clang/AST/TypeOrdering.h10
-rw-r--r--include/clang/AST/UnresolvedSet.h2
-rw-r--r--include/clang/AST/VTTBuilder.h28
-rw-r--r--include/clang/AST/VTableBuilder.h2
-rw-r--r--include/clang/ASTMatchers/ASTMatchers.h13
-rw-r--r--include/clang/Analysis/Analyses/CFGReachabilityAnalysis.h4
-rw-r--r--include/clang/Analysis/Analyses/Consumed.h60
-rw-r--r--include/clang/Analysis/Analyses/Dominators.h2
-rw-r--r--include/clang/Analysis/Analyses/FormatString.h2
-rw-r--r--include/clang/Analysis/Analyses/LiveVariables.h34
-rw-r--r--include/clang/Analysis/Analyses/ReachableCode.h2
-rw-r--r--include/clang/Analysis/Analyses/ThreadSafetyCommon.h2
-rw-r--r--include/clang/Analysis/AnalysisDeclContext.h12
-rw-r--r--include/clang/Analysis/CFG.h148
-rw-r--r--include/clang/Analysis/CFGStmtMap.h8
-rw-r--r--include/clang/Analysis/CloneDetection.h2
-rw-r--r--include/clang/Analysis/ConstructionContext.h267
-rw-r--r--include/clang/Analysis/DomainSpecific/CocoaConventions.h10
-rw-r--r--include/clang/Analysis/DomainSpecific/ObjCNoReturn.h4
-rw-r--r--include/clang/Analysis/ProgramPoint.h28
-rw-r--r--include/clang/Analysis/Support/BumpVector.h52
-rw-r--r--include/clang/Basic/ABI.h20
-rw-r--r--include/clang/Basic/AllDiagnostics.h4
-rw-r--r--include/clang/Basic/Attr.td22
-rw-r--r--include/clang/Basic/AttrDocs.td16
-rw-r--r--include/clang/Basic/Builtins.def6
-rw-r--r--include/clang/Basic/BuiltinsAMDGPU.def14
-rw-r--r--include/clang/Basic/BuiltinsPPC.def2
-rw-r--r--include/clang/Basic/Diagnostic.h60
-rw-r--r--include/clang/Basic/DiagnosticASTKinds.td16
-rw-r--r--include/clang/Basic/DiagnosticCommentKinds.td6
-rw-r--r--include/clang/Basic/DiagnosticCommonKinds.td10
-rw-r--r--include/clang/Basic/DiagnosticDriverKinds.td5
-rw-r--r--include/clang/Basic/DiagnosticFrontendKinds.td6
-rw-r--r--include/clang/Basic/DiagnosticGroups.td7
-rw-r--r--include/clang/Basic/DiagnosticIDs.h22
-rw-r--r--include/clang/Basic/DiagnosticLexKinds.td12
-rw-r--r--include/clang/Basic/DiagnosticOptions.def6
-rw-r--r--include/clang/Basic/DiagnosticOptions.h2
-rw-r--r--include/clang/Basic/DiagnosticParseKinds.td28
-rw-r--r--include/clang/Basic/DiagnosticSemaKinds.td138
-rw-r--r--include/clang/Basic/DiagnosticSerializationKinds.td2
-rw-r--r--include/clang/Basic/FileSystemStatCache.h6
-rw-r--r--include/clang/Basic/IdentifierTable.h38
-rw-r--r--include/clang/Basic/LLVM.h2
-rw-r--r--include/clang/Basic/LangOptions.h14
-rw-r--r--include/clang/Basic/Linkage.h4
-rw-r--r--include/clang/Basic/Module.h58
-rw-r--r--include/clang/Basic/ObjCRuntime.h2
-rw-r--r--include/clang/Basic/OperatorKinds.h2
-rw-r--r--include/clang/Basic/Sanitizers.def9
-rw-r--r--include/clang/Basic/Sanitizers.h3
-rw-r--r--include/clang/Basic/SourceLocation.h20
-rw-r--r--include/clang/Basic/SourceManager.h8
-rw-r--r--include/clang/Basic/SourceManagerInternals.h2
-rw-r--r--include/clang/Basic/Specifiers.h6
-rw-r--r--include/clang/Basic/StmtNodes.td2
-rw-r--r--include/clang/Basic/TargetInfo.h3
-rw-r--r--include/clang/Basic/TemplateKinds.h4
-rw-r--r--include/clang/Basic/arm_neon.td6
-rw-r--r--include/clang/Basic/arm_neon_incl.td2
-rw-r--r--include/clang/Driver/CC1Options.td8
-rw-r--r--include/clang/Driver/Driver.h10
-rw-r--r--include/clang/Driver/ToolChain.h5
-rw-r--r--include/clang/Edit/Commit.h2
-rw-r--r--include/clang/Edit/EditedSource.h2
-rw-r--r--include/clang/Edit/Rewriters.h2
-rw-r--r--include/clang/Frontend/ASTUnit.h96
-rw-r--r--include/clang/Frontend/CompilerInstance.h22
-rw-r--r--include/clang/Frontend/CompilerInvocation.h12
-rw-r--r--include/clang/Frontend/DiagnosticRenderer.h12
-rw-r--r--include/clang/Frontend/FrontendActions.h8
-rw-r--r--include/clang/Frontend/LayoutOverrideSource.h12
-rw-r--r--include/clang/Frontend/LogDiagnosticPrinter.h10
-rw-r--r--include/clang/Frontend/PCHContainerOperations.h8
-rw-r--r--include/clang/Frontend/VerifyDiagnosticConsumer.h2
-rw-r--r--include/clang/Lex/CodeCompletionHandler.h20
-rw-r--r--include/clang/Lex/DirectoryLookup.h12
-rw-r--r--include/clang/Lex/ExternalPreprocessorSource.h10
-rw-r--r--include/clang/Lex/HeaderSearch.h54
-rw-r--r--include/clang/Lex/HeaderSearchOptions.h6
-rw-r--r--include/clang/Lex/LiteralSupport.h4
-rw-r--r--include/clang/Lex/MacroArgs.h12
-rw-r--r--include/clang/Lex/MacroInfo.h2
-rw-r--r--include/clang/Lex/ModuleLoader.h14
-rw-r--r--include/clang/Lex/ModuleMap.h18
-rw-r--r--include/clang/Lex/PPCallbacks.h18
-rw-r--r--include/clang/Lex/PPConditionalDirectiveRecord.h4
-rw-r--r--include/clang/Lex/PTHLexer.h2
-rw-r--r--include/clang/Lex/Pragma.h8
-rw-r--r--include/clang/Lex/PreprocessingRecord.h58
-rw-r--r--include/clang/Lex/Preprocessor.h26
-rw-r--r--include/clang/Lex/PreprocessorLexer.h8
-rw-r--r--include/clang/Lex/PreprocessorOptions.h16
-rw-r--r--include/clang/Lex/Token.h2
-rw-r--r--include/clang/Lex/TokenConcatenation.h4
-rw-r--r--include/clang/Lex/TokenLexer.h2
-rw-r--r--include/clang/Lex/VariadicMacroSupport.h32
-rw-r--r--include/clang/Parse/ParseAST.h2
-rw-r--r--include/clang/Parse/Parser.h21
-rw-r--r--include/clang/Parse/RAIIObjectsForParser.h50
-rw-r--r--include/clang/Sema/DeclSpec.h136
-rw-r--r--include/clang/Sema/DelayedDiagnostic.h2
-rw-r--r--include/clang/Sema/ExternalSemaSource.h18
-rw-r--r--include/clang/Sema/IdentifierResolver.h10
-rw-r--r--include/clang/Sema/Initialization.h156
-rw-r--r--include/clang/Sema/Lookup.h10
-rw-r--r--include/clang/Sema/MultiplexExternalSemaSource.h24
-rw-r--r--include/clang/Sema/Overload.h38
-rw-r--r--include/clang/Sema/ParsedAttr.h12
-rw-r--r--include/clang/Sema/ParsedTemplate.h76
-rw-r--r--include/clang/Sema/Scope.h4
-rw-r--r--include/clang/Sema/ScopeInfo.h98
-rw-r--r--include/clang/Sema/SemaInternal.h16
-rw-r--r--include/clang/Sema/SemaLambda.h6
-rw-r--r--include/clang/Sema/Template.h62
-rw-r--r--include/clang/Serialization/ASTBitCodes.h68
-rw-r--r--include/clang/Serialization/ASTReader.h36
-rw-r--r--include/clang/Serialization/ASTWriter.h6
-rw-r--r--include/clang/Serialization/ContinuousRangeMap.h10
-rw-r--r--include/clang/Serialization/GlobalModuleIndex.h4
-rw-r--r--include/clang/Serialization/Module.h16
-rw-r--r--include/clang/Serialization/ModuleFileExtension.h4
-rw-r--r--include/clang/Serialization/ModuleManager.h14
-rw-r--r--include/clang/StaticAnalyzer/Checkers/Checkers.td10
-rw-r--r--include/clang/StaticAnalyzer/Checkers/ObjCRetainCount.h18
-rw-r--r--include/clang/StaticAnalyzer/Core/AnalyzerOptions.h26
-rw-r--r--include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h16
-rw-r--r--include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h2
-rw-r--r--include/clang/StaticAnalyzer/Core/BugReporter/BugType.h2
-rw-r--r--include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h50
-rw-r--r--include/clang/StaticAnalyzer/Core/Checker.h12
-rw-r--r--include/clang/StaticAnalyzer/Core/CheckerManager.h40
-rw-r--r--include/clang/StaticAnalyzer/Core/CheckerOptInfo.h2
-rw-r--r--include/clang/StaticAnalyzer/Core/CheckerRegistry.h2
-rw-r--r--include/clang/StaticAnalyzer/Core/IssueHash.h2
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/APSIntType.h4
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h6
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/BasicValueFactory.h4
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/BlockCounter.h4
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h61
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h10
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h20
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/Environment.h4
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h12
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h87
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h48
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h3
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/SValBuilder.h14
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h14
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/Store.h16
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/StoreRef.h10
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/SubEngine.h6
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/SummaryManager.h16
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h12
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/WorkList.h6
-rw-r--r--lib/ARCMigrate/ARCMT.cpp6
-rw-r--r--lib/ARCMigrate/FileRemapper.cpp6
-rw-r--r--lib/ARCMigrate/Internals.h2
-rw-r--r--lib/ARCMigrate/ObjCMT.cpp144
-rw-r--r--lib/ARCMigrate/PlistReporter.cpp2
-rw-r--r--lib/ARCMigrate/TransARCAssign.cpp2
-rw-r--r--lib/ARCMigrate/TransAutoreleasePool.cpp10
-rw-r--r--lib/ARCMigrate/TransBlockObjCVariable.cpp6
-rw-r--r--lib/ARCMigrate/TransEmptyStatementsAndDealloc.cpp2
-rw-r--r--lib/ARCMigrate/TransGCAttrs.cpp6
-rw-r--r--lib/ARCMigrate/TransProperties.cpp14
-rw-r--r--lib/ARCMigrate/TransProtectedScope.cpp2
-rw-r--r--lib/ARCMigrate/TransRetainReleaseDealloc.cpp4
-rw-r--r--lib/ARCMigrate/TransUnbridgedCasts.cpp4
-rw-r--r--lib/ARCMigrate/TransZeroOutPropsInDealloc.cpp14
-rw-r--r--lib/ARCMigrate/TransformActions.cpp6
-rw-r--r--lib/ARCMigrate/Transforms.cpp38
-rw-r--r--lib/ARCMigrate/Transforms.h2
-rw-r--r--lib/AST/ASTContext.cpp396
-rw-r--r--lib/AST/ASTDiagnostic.cpp12
-rw-r--r--lib/AST/ASTDumper.cpp2
-rw-r--r--lib/AST/ASTImporter.cpp478
-rw-r--r--lib/AST/ASTStructuralEquivalence.cpp4
-rw-r--r--lib/AST/CXXInheritance.cpp64
-rw-r--r--lib/AST/Comment.cpp2
-rw-r--r--lib/AST/CommentLexer.cpp2
-rw-r--r--lib/AST/Decl.cpp129
-rw-r--r--lib/AST/DeclBase.cpp50
-rw-r--r--lib/AST/DeclCXX.cpp156
-rw-r--r--lib/AST/DeclObjC.cpp62
-rw-r--r--lib/AST/DeclPrinter.cpp28
-rw-r--r--lib/AST/DeclTemplate.cpp14
-rw-r--r--lib/AST/DeclarationName.cpp16
-rw-r--r--lib/AST/Expr.cpp193
-rw-r--r--lib/AST/ExprCXX.cpp94
-rw-r--r--lib/AST/ExprClassification.cpp12
-rw-r--r--lib/AST/ExprConstant.cpp310
-rw-r--r--lib/AST/ExternalASTSource.cpp2
-rw-r--r--lib/AST/ItaniumCXXABI.cpp2
-rw-r--r--lib/AST/ItaniumMangle.cpp136
-rw-r--r--lib/AST/Mangle.cpp2
-rw-r--r--lib/AST/MicrosoftMangle.cpp18
-rw-r--r--lib/AST/NSAPI.cpp6
-rw-r--r--lib/AST/NestedNameSpecifier.cpp104
-rw-r--r--lib/AST/ParentMap.cpp2
-rw-r--r--lib/AST/RecordLayout.cpp6
-rw-r--r--lib/AST/RecordLayoutBuilder.cpp242
-rw-r--r--lib/AST/StmtOpenMP.cpp12
-rw-r--r--lib/AST/StmtPrinter.cpp16
-rw-r--r--lib/AST/StmtProfile.cpp55
-rw-r--r--lib/AST/TemplateBase.cpp68
-rw-r--r--lib/AST/TemplateName.cpp14
-rw-r--r--lib/AST/Type.cpp158
-rw-r--r--lib/AST/TypeLoc.cpp20
-rw-r--r--lib/AST/TypePrinter.cpp216
-rw-r--r--lib/AST/VTTBuilder.cpp50
-rw-r--r--lib/AST/VTableBuilder.cpp566
-rw-r--r--lib/Analysis/AnalysisDeclContext.cpp18
-rw-r--r--lib/Analysis/BodyFarm.cpp52
-rw-r--r--lib/Analysis/CFG.cpp212
-rw-r--r--lib/Analysis/CFGReachabilityAnalysis.cpp14
-rw-r--r--lib/Analysis/CFGStmtMap.cpp12
-rw-r--r--lib/Analysis/CallGraph.cpp2
-rw-r--r--lib/Analysis/CocoaConventions.cpp32
-rw-r--r--lib/Analysis/ConstructionContext.cpp303
-rw-r--r--lib/Analysis/Consumed.cpp216
-rw-r--r--lib/Analysis/FormatString.cpp10
-rw-r--r--lib/Analysis/FormatStringParsing.h10
-rw-r--r--lib/Analysis/LiveVariables.cpp78
-rw-r--r--lib/Analysis/ObjCNoReturn.cpp8
-rw-r--r--lib/Analysis/PostOrderCFGView.cpp6
-rw-r--r--lib/Analysis/PrintfFormatString.cpp6
-rw-r--r--lib/Analysis/ProgramPoint.cpp2
-rw-r--r--lib/Analysis/ReachableCode.cpp22
-rw-r--r--lib/Analysis/ScanfFormatString.cpp26
-rw-r--r--lib/Analysis/UninitializedValues.cpp22
-rw-r--r--lib/Basic/Diagnostic.cpp12
-rw-r--r--lib/Basic/DiagnosticIDs.cpp2
-rw-r--r--lib/Basic/FileManager.cpp16
-rw-r--r--lib/Basic/FileSystemStatCache.cpp8
-rw-r--r--lib/Basic/IdentifierTable.cpp18
-rw-r--r--lib/Basic/Module.cpp28
-rw-r--r--lib/Basic/ObjCRuntime.cpp2
-rw-r--r--lib/Basic/SourceLocation.cpp2
-rw-r--r--lib/Basic/SourceManager.cpp64
-rw-r--r--lib/Basic/Targets/ARM.cpp4
-rw-r--r--lib/Basic/Targets/X86.cpp2
-rw-r--r--lib/Basic/Targets/X86.h8
-rw-r--r--lib/Basic/Warnings.cpp20
-rw-r--r--lib/CodeGen/CGBlocks.cpp38
-rw-r--r--lib/CodeGen/CGBlocks.h10
-rw-r--r--lib/CodeGen/CGBuilder.h2
-rw-r--r--lib/CodeGen/CGBuiltin.cpp6
-rw-r--r--lib/CodeGen/CGCXX.cpp4
-rw-r--r--lib/CodeGen/CGCXXABI.cpp4
-rw-r--r--lib/CodeGen/CGCall.cpp20
-rw-r--r--lib/CodeGen/CGCall.h4
-rw-r--r--lib/CodeGen/CGClass.cpp52
-rw-r--r--lib/CodeGen/CGCleanup.cpp18
-rw-r--r--lib/CodeGen/CGCleanup.h2
-rw-r--r--lib/CodeGen/CGDebugInfo.cpp84
-rw-r--r--lib/CodeGen/CGDeclCXX.cpp14
-rw-r--r--lib/CodeGen/CGException.cpp8
-rw-r--r--lib/CodeGen/CGExpr.cpp10
-rw-r--r--lib/CodeGen/CGExprAgg.cpp54
-rw-r--r--lib/CodeGen/CGExprCXX.cpp84
-rw-r--r--lib/CodeGen/CGExprConstant.cpp37
-rw-r--r--lib/CodeGen/CGExprScalar.cpp107
-rw-r--r--lib/CodeGen/CGLoopInfo.cpp2
-rw-r--r--lib/CodeGen/CGObjC.cpp162
-rw-r--r--lib/CodeGen/CGObjCGNU.cpp48
-rw-r--r--lib/CodeGen/CGObjCMac.cpp228
-rw-r--r--lib/CodeGen/CGObjCRuntime.cpp4
-rw-r--r--lib/CodeGen/CGObjCRuntime.h12
-rw-r--r--lib/CodeGen/CGOpenMPRuntime.cpp19
-rw-r--r--lib/CodeGen/CGRecordLayoutBuilder.cpp23
-rw-r--r--lib/CodeGen/CGVTT.cpp30
-rw-r--r--lib/CodeGen/CGVTables.cpp2
-rw-r--r--lib/CodeGen/CGVTables.h14
-rw-r--r--lib/CodeGen/CGValue.h33
-rw-r--r--lib/CodeGen/CodeGenAction.cpp2
-rw-r--r--lib/CodeGen/CodeGenFunction.h9
-rw-r--r--lib/CodeGen/CodeGenModule.cpp6
-rw-r--r--lib/CodeGen/CodeGenModule.h28
-rw-r--r--lib/CodeGen/CodeGenTypes.cpp50
-rw-r--r--lib/CodeGen/CodeGenTypes.h14
-rw-r--r--lib/CodeGen/ConstantInitBuilder.cpp2
-rw-r--r--lib/CodeGen/ItaniumCXXABI.cpp18
-rw-r--r--lib/CodeGen/MicrosoftCXXABI.cpp14
-rw-r--r--lib/CodeGen/SwiftCallingConv.cpp4
-rw-r--r--lib/CodeGen/TargetInfo.cpp53
-rw-r--r--lib/Driver/CMakeLists.txt1
-rw-r--r--lib/Driver/Driver.cpp5
-rw-r--r--lib/Driver/SanitizerArgs.cpp12
-rw-r--r--lib/Driver/ToolChain.cpp6
-rw-r--r--lib/Driver/ToolChains/Arch/RISCV.cpp2
-rw-r--r--lib/Driver/ToolChains/Clang.cpp211
-rw-r--r--lib/Driver/ToolChains/Cuda.cpp12
-rw-r--r--lib/Driver/ToolChains/Cuda.h1
-rw-r--r--lib/Driver/ToolChains/Darwin.cpp73
-rw-r--r--lib/Driver/ToolChains/Darwin.h15
-rw-r--r--lib/Driver/ToolChains/Gnu.cpp6
-rw-r--r--lib/Driver/ToolChains/Linux.cpp9
-rw-r--r--lib/Driver/ToolChains/RISCV.cpp117
-rw-r--r--lib/Driver/ToolChains/RISCV.h57
-rw-r--r--lib/Edit/Commit.cpp4
-rw-r--r--lib/Edit/RewriteObjCFoundationAPI.cpp18
-rw-r--r--lib/Format/BreakableToken.cpp52
-rw-r--r--lib/Format/BreakableToken.h27
-rw-r--r--lib/Format/ContinuationIndenter.cpp25
-rw-r--r--lib/Format/ContinuationIndenter.h2
-rw-r--r--lib/Format/Format.cpp9
-rw-r--r--lib/Frontend/ASTConsumers.cpp2
-rw-r--r--lib/Frontend/ASTMerge.cpp10
-rw-r--r--lib/Frontend/ChainedIncludesSource.cpp6
-rw-r--r--lib/Frontend/CompilerInstance.cpp38
-rw-r--r--lib/Frontend/DependencyFile.cpp2
-rw-r--r--lib/Frontend/DependencyGraph.cpp20
-rw-r--r--lib/Frontend/DiagnosticRenderer.cpp6
-rw-r--r--lib/Frontend/FrontendAction.cpp8
-rw-r--r--lib/Frontend/FrontendActions.cpp10
-rw-r--r--lib/Frontend/LayoutOverrideSource.cpp58
-rw-r--r--lib/Frontend/MultiplexConsumer.cpp6
-rw-r--r--lib/Frontend/PrintPreprocessedOutput.cpp12
-rw-r--r--lib/Frontend/Rewrite/FixItRewriter.cpp2
-rw-r--r--lib/Frontend/Rewrite/FrontendActions.cpp4
-rw-r--r--lib/Frontend/Rewrite/RewriteModernObjC.cpp964
-rw-r--r--lib/Frontend/Rewrite/RewriteObjC.cpp388
-rw-r--r--lib/Frontend/SerializedDiagnosticPrinter.cpp46
-rw-r--r--lib/Frontend/TestModuleFileExtension.cpp2
-rw-r--r--lib/Frontend/TextDiagnostic.cpp28
-rw-r--r--lib/FrontendTool/ExecuteCompilerInvocation.cpp4
-rw-r--r--lib/Headers/avx512fintrin.h4
-rw-r--r--lib/Headers/avx512vlcdintrin.h2
-rw-r--r--lib/Headers/clzerointrin.h2
-rw-r--r--lib/Headers/lwpintrin.h4
-rw-r--r--lib/Headers/opencl-c.h8
-rw-r--r--lib/Index/IndexBody.cpp4
-rw-r--r--lib/Index/IndexTypeSourceInfo.cpp4
-rw-r--r--lib/Index/IndexingContext.cpp2
-rw-r--r--lib/Index/USRGeneration.cpp40
-rw-r--r--lib/Lex/HeaderSearch.cpp32
-rw-r--r--lib/Lex/LiteralSupport.cpp6
-rw-r--r--lib/Lex/MacroArgs.cpp14
-rw-r--r--lib/Lex/ModuleMap.cpp178
-rw-r--r--lib/Lex/PPDirectives.cpp6
-rw-r--r--lib/Lex/PPExpressions.cpp10
-rw-r--r--lib/Lex/PPLexerChange.cpp14
-rw-r--r--lib/Lex/PPMacroExpansion.cpp6
-rw-r--r--lib/Lex/Pragma.cpp26
-rw-r--r--lib/Lex/PreprocessingRecord.cpp46
-rw-r--r--lib/Lex/Preprocessor.cpp24
-rw-r--r--lib/Lex/TokenLexer.cpp20
-rw-r--r--lib/Parse/ParseAST.cpp4
-rw-r--r--lib/Parse/ParseCXXInlineMethods.cpp8
-rw-r--r--lib/Parse/ParseDecl.cpp32
-rw-r--r--lib/Parse/ParseDeclCXX.cpp64
-rw-r--r--lib/Parse/ParseExpr.cpp148
-rw-r--r--lib/Parse/ParseExprCXX.cpp190
-rw-r--r--lib/Parse/ParseInit.cpp50
-rw-r--r--lib/Parse/ParseObjc.cpp224
-rw-r--r--lib/Parse/ParsePragma.cpp30
-rw-r--r--lib/Parse/ParseStmtAsm.cpp2
-rw-r--r--lib/Parse/ParseTemplate.cpp74
-rw-r--r--lib/Parse/ParseTentative.cpp38
-rw-r--r--lib/Parse/Parser.cpp68
-rw-r--r--lib/Rewrite/DeltaTree.cpp4
-rw-r--r--lib/Rewrite/HTMLRewrite.cpp2
-rw-r--r--lib/Rewrite/Rewriter.cpp6
-rw-r--r--lib/Sema/AnalysisBasedWarnings.cpp52
-rw-r--r--lib/Sema/CMakeLists.txt1
-rw-r--r--lib/Sema/CodeCompleteConsumer.cpp110
-rw-r--r--lib/Sema/DeclSpec.cpp50
-rw-r--r--lib/Sema/DelayedDiagnostic.cpp4
-rw-r--r--lib/Sema/IdentifierResolver.cpp54
-rw-r--r--lib/Sema/MultiplexExternalSemaSource.cpp14
-rw-r--r--lib/Sema/Sema.cpp2
-rw-r--r--lib/Sema/SemaAccess.cpp36
-rw-r--r--lib/Sema/SemaAttr.cpp4
-rw-r--r--lib/Sema/SemaCXXScopeSpec.cpp34
-rw-r--r--lib/Sema/SemaCast.cpp120
-rw-r--r--lib/Sema/SemaChecking.cpp174
-rw-r--r--lib/Sema/SemaCodeComplete.cpp30
-rw-r--r--lib/Sema/SemaDecl.cpp136
-rw-r--r--lib/Sema/SemaDeclAttr.cpp77
-rw-r--r--lib/Sema/SemaDeclObjC.cpp382
-rw-r--r--lib/Sema/SemaExceptionSpec.cpp2
-rw-r--r--lib/Sema/SemaExpr.cpp446
-rw-r--r--lib/Sema/SemaExprMember.cpp36
-rw-r--r--lib/Sema/SemaExprObjC.cpp380
-rw-r--r--lib/Sema/SemaInit.cpp296
-rw-r--r--lib/Sema/SemaLambda.cpp198
-rw-r--r--lib/Sema/SemaLookup.cpp26
-rw-r--r--lib/Sema/SemaObjCProperty.cpp138
-rw-r--r--lib/Sema/SemaPseudoObject.cpp134
-rw-r--r--lib/Sema/SemaStmt.cpp12
-rw-r--r--lib/Sema/SemaStmtAsm.cpp2
-rw-r--r--lib/Sema/SemaTemplate.cpp68
-rw-r--r--lib/Sema/SemaTemplateDeduction.cpp2
-rw-r--r--lib/Sema/SemaTemplateInstantiate.cpp292
-rw-r--r--lib/Sema/SemaTemplateInstantiateDecl.cpp16
-rw-r--r--lib/Sema/SemaTemplateVariadic.cpp114
-rw-r--r--lib/Sema/SemaType.cpp65
-rw-r--r--lib/Sema/TreeTransform.h10
-rw-r--r--lib/Sema/TypeLocBuilder.h12
-rw-r--r--lib/Serialization/ASTReader.cpp13
-rw-r--r--lib/Serialization/ASTReaderDecl.cpp68
-rw-r--r--lib/Serialization/ASTReaderInternals.h54
-rw-r--r--lib/Serialization/ASTWriterDecl.cpp52
-rw-r--r--lib/Serialization/ASTWriterStmt.cpp24
-rw-r--r--lib/Serialization/Module.cpp24
-rw-r--r--lib/Serialization/ModuleManager.cpp10
-rw-r--r--lib/StaticAnalyzer/Checkers/CStringChecker.cpp1
-rw-r--r--lib/StaticAnalyzer/Checkers/InnerPointerChecker.cpp188
-rw-r--r--lib/StaticAnalyzer/Checkers/IteratorChecker.cpp25
-rw-r--r--lib/StaticAnalyzer/Checkers/MallocChecker.cpp43
-rw-r--r--lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp2
-rw-r--r--lib/StaticAnalyzer/Checkers/RunLoopAutoreleaseLeakChecker.cpp18
-rw-r--r--lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp10
-rw-r--r--lib/StaticAnalyzer/Core/BugReporterVisitors.cpp37
-rw-r--r--lib/StaticAnalyzer/Core/CallEvent.cpp63
-rw-r--r--lib/StaticAnalyzer/Core/ExprEngine.cpp150
-rw-r--r--lib/StaticAnalyzer/Core/ExprEngineC.cpp2
-rw-r--r--lib/StaticAnalyzer/Core/ExprEngineCXX.cpp43
-rw-r--r--lib/StaticAnalyzer/Core/IssueHash.cpp2
-rw-r--r--lib/StaticAnalyzer/Core/ProgramState.cpp5
-rw-r--r--lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp46
-rw-r--r--lib/StaticAnalyzer/Core/Store.cpp4
-rw-r--r--test/Analysis/Checkers/RunLoopAutoreleaseLeakChecker.m22
-rw-r--r--test/Analysis/casts.c7
-rw-r--r--test/Analysis/cfg-rich-constructors.cpp75
-rw-r--r--test/Analysis/cfg-rich-constructors.mm66
-rw-r--r--test/Analysis/copy-elision.cpp (renamed from test/Analysis/cxx17-mandatory-elision.cpp)0
-rw-r--r--test/Analysis/cstring-ranges.c15
-rw-r--r--test/Analysis/inner-pointer.cpp94
-rw-r--r--test/Analysis/lifetime-extension.mm64
-rw-r--r--test/Analysis/temporaries.cpp49
-rw-r--r--test/Analysis/temporaries.mm23
-rw-r--r--test/CodeGen/aapcs-align.cc141
-rw-r--r--test/CodeGen/aapcs64-align.cc103
-rw-r--r--test/CodeGen/arm-arguments.c17
-rw-r--r--test/CodeGen/builtin-memfns.c17
-rw-r--r--test/CodeGen/catch-implicit-integer-truncations.c395
-rw-r--r--test/CodeGen/exceptions-seh-finally.c1
-rw-r--r--test/CodeGen/exceptions-seh.c14
-rw-r--r--test/CodeGen/mips-unsigned-ext-var.c6
-rw-r--r--test/CodeGen/mips-varargs.c8
-rw-r--r--test/CodeGen/mips-vector-arg.c4
-rw-r--r--test/CodeGenCUDA/device-var-init.cu6
-rw-r--r--test/CodeGenCXX/Inputs/override-layout-nameless-struct-union.layout16
-rw-r--r--test/CodeGenCXX/Inputs/override-layout-packed-base.layout18
-rw-r--r--test/CodeGenCXX/castexpr-basepathsize-threshold.cpp27
-rw-r--r--test/CodeGenCXX/catch-implicit-integer-truncations.cpp256
-rw-r--r--test/CodeGenCXX/ctor-dtor-alias.cpp41
-rw-r--r--test/CodeGenCXX/float16-declarations.cpp2
-rw-r--r--test/CodeGenCXX/override-layout-nameless-struct-union.cpp33
-rw-r--r--test/CodeGenCXX/override-layout-packed-base.cpp26
-rw-r--r--test/CodeGenCXX/ubsan-new-checks.cpp146
-rw-r--r--test/CodeGenOpenCL/blocks.cl12
-rw-r--r--test/CodeGenOpenCL/builtins-amdgcn-dl-insts-err-clamp.cl25
-rw-r--r--test/CodeGenOpenCL/builtins-amdgcn-dl-insts-err.cl24
-rw-r--r--test/CodeGenOpenCL/builtins-amdgcn-dl-insts.cl48
-rwxr-xr-xtest/Driver/Inputs/basic_riscv32_tree/bin/riscv32-unknown-elf-ld1
-rw-r--r--test/Driver/Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1/crtbegin.o (renamed from test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.asan_ios_dynamic.dylib)0
-rw-r--r--test/Driver/Inputs/basic_riscv32_tree/lib/gcc/riscv32-unknown-elf/8.0.1/crtend.o (renamed from test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.asan_iossim_dynamic.dylib)0
-rw-r--r--test/Driver/Inputs/basic_riscv32_tree/riscv32-unknown-elf/include/c++/8.0.1/.keep (renamed from test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.asan_osx_dynamic.dylib)0
-rw-r--r--test/Driver/Inputs/basic_riscv32_tree/riscv32-unknown-elf/lib/crt0.o (renamed from test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.asan_tvos_dynamic.dylib)0
-rw-r--r--test/Driver/Inputs/openembedded_aarch64_linux_tree/usr/include/c++/6.3.0/backward/.keep (renamed from test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.asan_tvossim_dynamic.dylib)0
-rw-r--r--test/Driver/Inputs/openembedded_aarch64_linux_tree/usr/lib64/aarch64-oe-linux/6.3.0/crtbegin.o (renamed from test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.asan_watchos_dynamic.dylib)0
-rw-r--r--test/Driver/Inputs/openembedded_aarch64_linux_tree/usr/lib64/aarch64-oe-linux/6.3.0/crtend.o (renamed from test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.asan_watchossim_dynamic.dylib)0
-rw-r--r--test/Driver/Inputs/openembedded_aarch64_linux_tree/usr/lib64/crt1.o (renamed from test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.fuzzer_osx.a)0
-rw-r--r--test/Driver/Inputs/openembedded_aarch64_linux_tree/usr/lib64/crti.o (renamed from test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.lsan_ios_dynamic.dylib)0
-rw-r--r--test/Driver/Inputs/openembedded_aarch64_linux_tree/usr/lib64/crtn.o (renamed from test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.lsan_iossim_dynamic.dylib)0
-rw-r--r--test/Driver/Inputs/openembedded_arm_linux_tree/usr/include/c++/6.3.0/backward/.keep (renamed from test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.lsan_osx_dynamic.dylib)0
-rw-r--r--test/Driver/Inputs/openembedded_arm_linux_tree/usr/lib/arm-oe-linux-gnueabi/6.3.0/crtbegin.o (renamed from test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.lsan_tvossim_dynamic.dylib)0
-rw-r--r--test/Driver/Inputs/openembedded_arm_linux_tree/usr/lib/arm-oe-linux-gnueabi/6.3.0/crtend.o (renamed from test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.tsan_iossim_dynamic.dylib)0
-rw-r--r--test/Driver/Inputs/openembedded_arm_linux_tree/usr/lib/crt1.o (renamed from test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.tsan_osx_dynamic.dylib)0
-rw-r--r--test/Driver/Inputs/openembedded_arm_linux_tree/usr/lib/crti.o (renamed from test/Driver/Inputs/resource_dir/lib/darwin/libclang_rt.tsan_tvossim_dynamic.dylib)0
-rw-r--r--test/Driver/Inputs/openembedded_arm_linux_tree/usr/lib/crtn.o0
-rw-r--r--test/Driver/aarch64-cpus.c73
-rw-r--r--test/Driver/arm-cortex-cpus.c49
-rw-r--r--test/Driver/baremetal.cpp10
-rw-r--r--test/Driver/cuda-dwarf-2.cu3
-rw-r--r--test/Driver/cuda-unsupported-debug-options.cu22
-rw-r--r--test/Driver/darwin-asan-nofortify.c2
-rw-r--r--test/Driver/darwin-sanitizer-ld.c19
-rw-r--r--test/Driver/fsanitize.c43
-rw-r--r--test/Driver/fuzzer.c10
-rw-r--r--test/Driver/linux-header-search.cpp22
-rw-r--r--test/Driver/linux-ld.c38
-rw-r--r--test/Driver/openmp-offload-gpu.c3
-rw-r--r--test/Driver/openmp-unsupported-debug-options.c22
-rw-r--r--test/Driver/riscv32-toolchain.c30
-rw-r--r--test/Driver/sanitizer-ld.c3
-rw-r--r--test/Frontend/clang-abi-compat.cpp2
-rw-r--r--test/Index/complete-access-checks-crash.cpp13
-rw-r--r--test/Modules/resolution-change.m2
-rw-r--r--test/OpenMP/declare_target_codegen.cpp9
-rw-r--r--test/OpenMP/nvptx_declare_target_var_ctor_dtor_codegen.cpp2
-rw-r--r--test/OpenMP/target_codegen.cpp4
-rw-r--r--test/OpenMP/target_codegen_registration.cpp4
-rw-r--r--test/OpenMP/target_depend_codegen.cpp4
-rw-r--r--test/OpenMP/target_parallel_codegen.cpp4
-rw-r--r--test/OpenMP/target_parallel_codegen_registration.cpp4
-rw-r--r--test/OpenMP/target_parallel_depend_codegen.cpp4
-rw-r--r--test/OpenMP/target_parallel_for_codegen.cpp4
-rw-r--r--test/OpenMP/target_parallel_for_codegen_registration.cpp4
-rw-r--r--test/OpenMP/target_parallel_for_depend_codegen.cpp4
-rw-r--r--test/OpenMP/target_parallel_for_simd_codegen.cpp4
-rw-r--r--test/OpenMP/target_parallel_for_simd_codegen_registration.cpp4
-rw-r--r--test/OpenMP/target_parallel_for_simd_depend_codegen.cpp4
-rw-r--r--test/OpenMP/target_parallel_if_codegen.cpp4
-rw-r--r--test/OpenMP/target_parallel_num_threads_codegen.cpp4
-rw-r--r--test/OpenMP/target_simd_codegen.cpp4
-rw-r--r--test/OpenMP/target_simd_codegen_registration.cpp4
-rw-r--r--test/OpenMP/target_simd_depend_codegen.cpp4
-rw-r--r--test/OpenMP/target_teams_codegen.cpp4
-rw-r--r--test/OpenMP/target_teams_codegen_registration.cpp4
-rw-r--r--test/OpenMP/target_teams_depend_codegen.cpp4
-rw-r--r--test/OpenMP/target_teams_distribute_codegen.cpp4
-rw-r--r--test/OpenMP/target_teams_distribute_codegen_registration.cpp4
-rw-r--r--test/OpenMP/target_teams_distribute_depend_codegen.cpp4
-rw-r--r--test/OpenMP/target_teams_distribute_parallel_for_depend_codegen.cpp4
-rw-r--r--test/OpenMP/target_teams_distribute_parallel_for_simd_codegen_registration.cpp4
-rw-r--r--test/OpenMP/target_teams_distribute_parallel_for_simd_depend_codegen.cpp4
-rw-r--r--test/OpenMP/target_teams_distribute_simd_codegen.cpp4
-rw-r--r--test/OpenMP/target_teams_distribute_simd_codegen_registration.cpp4
-rw-r--r--test/OpenMP/target_teams_distribute_simd_depend_codegen.cpp4
-rw-r--r--test/OpenMP/target_teams_num_teams_codegen.cpp4
-rw-r--r--test/OpenMP/target_teams_thread_limit_codegen.cpp4
-rw-r--r--test/PCH/coroutines.cpp8
-rw-r--r--test/PCH/cxx-templates.cpp16
-rw-r--r--test/PCH/cxx-templates.h35
-rw-r--r--test/Parser/cxx1z-fold-expressions.cpp26
-rw-r--r--test/SemaCUDA/device-var-init.cu13
-rw-r--r--test/SemaCXX/attr-lifetimebound.cpp115
-rw-r--r--test/SemaCXX/constexpr-string.cpp148
-rw-r--r--test/SemaCXX/cxx1z-class-template-argument-deduction.cpp29
-rw-r--r--test/SemaCXX/warn-dangling-local.cpp6
-rw-r--r--test/SemaObjCXX/class-templ-error-null-init.mm7
-rw-r--r--test/SemaObjCXX/noescape.mm39
-rw-r--r--test/SemaOpenCL/invalid-kernel-parameters.cl43
-rw-r--r--unittests/Format/FormatTestComments.cpp100
-rw-r--r--unittests/Format/FormatTestJS.cpp77
-rw-r--r--utils/TableGen/ClangAttrEmitter.cpp9
-rwxr-xr-xutils/analyzer/CmpRuns.py14
-rw-r--r--utils/analyzer/SATestBuild.py18
596 files changed, 13281 insertions, 9217 deletions
diff --git a/docs/ClangFormatStyleOptions.rst b/docs/ClangFormatStyleOptions.rst
index e4892d79b91f..49f9f68088bc 100644
--- a/docs/ClangFormatStyleOptions.rst
+++ b/docs/ClangFormatStyleOptions.rst
@@ -1134,17 +1134,21 @@ the configuration (without a prefix: ``Auto``).
.. code-block:: c++
true:
- SomeClass::Constructor()
- : aaaaaaaa(aaaaaaaa), aaaaaaaa(aaaaaaaa), aaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaa) {
- return 0;
- }
+ FitsOnOneLine::Constructor()
+ : aaaaaaaaaaaaa(aaaaaaaaaaaaaa), aaaaaaaaaaaaa(aaaaaaaaaaaaaa) {}
+
+ DoesntFit::Constructor()
+ : aaaaaaaaaaaaa(aaaaaaaaaaaaaa),
+ aaaaaaaaaaaaa(aaaaaaaaaaaaaa),
+ aaaaaaaaaaaaa(aaaaaaaaaaaaaa) {}
false:
- SomeClass::Constructor()
- : aaaaaaaa(aaaaaaaa), aaaaaaaa(aaaaaaaa),
- aaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaa) {
- return 0;
- }
+ FitsOnOneLine::Constructor()
+ : aaaaaaaaaaaaa(aaaaaaaaaaaaaa), aaaaaaaaaaaaa(aaaaaaaaaaaaaa) {}
+
+ DoesntFit::Constructor()
+ : aaaaaaaaaaaaa(aaaaaaaaaaaaaa), aaaaaaaaaaaaa(aaaaaaaaaaaaaa),
+ aaaaaaaaaaaaa(aaaaaaaaaaaaaa) {}
**ConstructorInitializerIndentWidth** (``unsigned``)
The number of characters to use for indentation of constructor
diff --git a/docs/ReleaseNotes.rst b/docs/ReleaseNotes.rst
index 342fed3393b1..1e45a13ef916 100644
--- a/docs/ReleaseNotes.rst
+++ b/docs/ReleaseNotes.rst
@@ -46,7 +46,9 @@ sections with improvements to Clang's support for those languages.
Major New Features
------------------
-- ...
+- A new Implicit Conversion Sanitizer (``-fsanitize=implicit-conversion``) group
+ was added. Please refer to the :ref:`release-notes-ubsan` section of the
+ release notes for the details.
Improvements to Clang's diagnostics
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -280,10 +282,36 @@ Static Analyzer
...
+.. _release-notes-ubsan:
+
Undefined Behavior Sanitizer (UBSan)
------------------------------------
-* ...
+* A new Implicit Conversion Sanitizer (``-fsanitize=implicit-conversion``) group
+ was added.
+
+ Currently, only one type of issues is caught - implicit integer truncation
+ (``-fsanitize=implicit-integer-truncation``), also known as integer demotion.
+ While there is a ``-Wconversion`` diagnostic group that catches this kind of
+ issues, it is both noisy, and does not catch **all** the cases.
+
+ .. code-block:: c++
+
+ unsigned char store = 0;
+
+ bool consume(unsigned int val);
+
+ void test(unsigned long val) {
+ if (consume(val)) // the value may have been silently truncated.
+ store = store + 768; // before addition, 'store' was promoted to int.
+ (void)consume((unsigned int)val); // OK, the truncation is explicit.
+ }
+
+ Just like other ``-fsanitize=integer`` checks, these issues are **not**
+ undefined behaviour. But they are not *always* intentional, and are somewhat
+ hard to track down. This group is **not** enabled by ``-fsanitize=undefined``,
+ but the ``-fsanitize=implicit-integer-truncation`` check
+ is enabled by ``-fsanitize=integer``.
Core Analysis Improvements
==========================
diff --git a/docs/UndefinedBehaviorSanitizer.rst b/docs/UndefinedBehaviorSanitizer.rst
index 71a8ebd4bc64..86d0193a23c2 100644
--- a/docs/UndefinedBehaviorSanitizer.rst
+++ b/docs/UndefinedBehaviorSanitizer.rst
@@ -89,6 +89,12 @@ Available checks are:
- ``-fsanitize=function``: Indirect call of a function through a
function pointer of the wrong type (Darwin/Linux, C++ and x86/x86_64
only).
+ - ``-fsanitize=implicit-integer-truncation``: Implicit conversion from
+ integer of larger bit width to smaller bit width, if that results in data
+ loss. That is, if the demoted value, after casting back to the original
+ width, is not equal to the original value before the downcast.
+ Issues caught by this sanitizer are not undefined behavior,
+ but are often unintentional.
- ``-fsanitize=integer-divide-by-zero``: Integer division by zero.
- ``-fsanitize=nonnull-attribute``: Passing null pointer as a function
parameter which is declared to never be null.
@@ -121,15 +127,21 @@ Available checks are:
unsigned overflow in C++. You can use ``-fsanitize=shift-base`` or
``-fsanitize=shift-exponent`` to check only left-hand side or
right-hand side of shift operation, respectively.
- - ``-fsanitize=signed-integer-overflow``: Signed integer overflow,
- including all the checks added by ``-ftrapv``, and checking for
- overflow in signed division (``INT_MIN / -1``).
+ - ``-fsanitize=signed-integer-overflow``: Signed integer overflow, where the
+ result of a signed integer computation cannot be represented in its type.
+ This includes all the checks covered by ``-ftrapv``, as well as checks for
+ signed division overflow (``INT_MIN/-1``), but not checks for
+ lossy implicit conversions performed before the computation
+ (see ``-fsanitize=implicit-conversion``). Both of these two issues are
+ handled by ``-fsanitize=implicit-conversion`` group of checks.
- ``-fsanitize=unreachable``: If control flow reaches an unreachable
program point.
- - ``-fsanitize=unsigned-integer-overflow``: Unsigned integer
- overflows. Note that unlike signed integer overflow, unsigned integer
- is not undefined behavior. However, while it has well-defined semantics,
- it is often unintentional, so UBSan offers to catch it.
+ - ``-fsanitize=unsigned-integer-overflow``: Unsigned integer overflow, where
+ the result of an unsigned integer computation cannot be represented in its
+ type. Unlike signed integer overflow, this is not undefined behavior, but
+ it is often unintentional. This sanitizer does not check for lossy implicit
+ conversions performed before such a computation
+ (see ``-fsanitize=implicit-conversion``).
- ``-fsanitize=vla-bound``: A variable-length array whose bound
does not evaluate to a positive value.
- ``-fsanitize=vptr``: Use of an object whose vptr indicates that it is of
@@ -140,11 +152,17 @@ Available checks are:
You can also use the following check groups:
- ``-fsanitize=undefined``: All of the checks listed above other than
- ``unsigned-integer-overflow`` and the ``nullability-*`` checks.
+ ``unsigned-integer-overflow``, ``implicit-conversion`` and the
+ ``nullability-*`` group of checks.
- ``-fsanitize=undefined-trap``: Deprecated alias of
``-fsanitize=undefined``.
- ``-fsanitize=integer``: Checks for undefined or suspicious integer
behavior (e.g. unsigned integer overflow).
+ Enables ``signed-integer-overflow``, ``unsigned-integer-overflow``,
+ ``shift``, ``integer-divide-by-zero``, and ``implicit-integer-truncation``.
+ - ``-fsanitize=implicit-conversion``: Checks for suspicious behaviours of
+ implicit conversions.
+ Currently, only ``-fsanitize=implicit-integer-truncation`` is implemented.
- ``-fsanitize=nullability``: Enables ``nullability-arg``,
``nullability-assign``, and ``nullability-return``. While violating
nullability does not have undefined behavior, it is often unintentional,
diff --git a/docs/UsersManual.rst b/docs/UsersManual.rst
index 418afb2d546c..363bb4e461a6 100644
--- a/docs/UsersManual.rst
+++ b/docs/UsersManual.rst
@@ -2155,13 +2155,8 @@ Objective-C++ Language Features
OpenMP Features
===============
-Clang supports all OpenMP 3.1 directives and clauses. In addition, some
-features of OpenMP 4.0 are supported. For example, ``#pragma omp simd``,
-``#pragma omp for simd``, ``#pragma omp parallel for simd`` directives, extended
-set of atomic constructs, ``proc_bind`` clause for all parallel-based
-directives, ``depend`` clause for ``#pragma omp task`` directive (except for
-array sections), ``#pragma omp cancel`` and ``#pragma omp cancellation point``
-directives, and ``#pragma omp taskgroup`` directive.
+Clang supports all OpenMP 4.5 directives and clauses. See :doc:`OpenMPSupport`
+for additional details.
Use `-fopenmp` to enable OpenMP. Support for OpenMP can be disabled with
`-fno-openmp`.
@@ -2783,6 +2778,7 @@ Execute ``clang-cl /?`` to see a list of supported options:
/Brepro Emit an object file which can be reproduced over time
/C Don't discard comments when preprocessing
/c Compile only
+ /d1PP Retain macro definitions in /E mode
/d1reportAllClassLayout Dump record layout information
/diagnostics:caret Enable caret and column diagnostics (on by default)
/diagnostics:classic Disable column and caret diagnostics
@@ -2816,6 +2812,7 @@ Execute ``clang-cl /?`` to see a list of supported options:
/GS- Disable buffer security check
/GS Enable buffer security check
/Gs<value> Set stack probe size
+ /guard:<value> Enable Control Flow Guard with /guard:cf
/Gv Set __vectorcall as a default calling convention
/Gw- Don't put each data item in its own section
/Gw Put each data item in its own section
@@ -2871,6 +2868,7 @@ Execute ``clang-cl /?`` to see a list of supported options:
/WX- Do not treat warnings as errors
/WX Treat warnings as errors
/w Disable all warnings
+ /X Don't add %INCLUDE% to the include search path
/Y- Disable precompiled headers, overrides /Yc and /Yu
/Yc<filename> Generate a pch file for all code up to and including <filename>
/Yu<filename> Load a pch file and use it instead of all code up to and including <filename>
@@ -2894,8 +2892,15 @@ Execute ``clang-cl /?`` to see a list of supported options:
OPTIONS:
-### Print (but do not run) the commands to run for this compilation
--analyze Run the static analyzer
+ -faddrsig Emit an address-significance table
-fansi-escape-codes Use ANSI escape codes for diagnostics
+ -fblocks Enable the 'blocks' language feature
+ -fcf-protection=<value> Instrument control-flow architecture protection. Options: return, branch, full, none.
+ -fcf-protection Enable cf-protection in 'full' mode
-fcolor-diagnostics Use colors in diagnostics
+ -fcomplete-member-pointers
+ Require member pointer base types to be complete if they would be significant under the Microsoft ABI
+ -fcoverage-mapping Generate coverage mapping to enable code coverage analysis
-fdebug-macro Emit macro debug information
-fdelayed-template-parsing
Parse templated function definitions at the end of the translation unit
@@ -2905,6 +2910,7 @@ Execute ``clang-cl /?`` to see a list of supported options:
Print fix-its in machine parseable form
-flto=<value> Set LTO mode to either 'full' or 'thin'
-flto Enable LTO in 'full' mode
+ -fmerge-all-constants Allow merging of constants
-fms-compatibility-version=<value>
Dot-separated value representing the Microsoft compiler version
number to report in _MSC_VER (0 = don't define it (default))
@@ -2912,9 +2918,17 @@ Execute ``clang-cl /?`` to see a list of supported options:
-fms-extensions Accept some non-standard constructs supported by the Microsoft compiler
-fmsc-version=<value> Microsoft compiler version number to report in _MSC_VER
(0 = don't define it (default))
+ -fno-addrsig Don't emit an address-significance table
+ -fno-builtin-<value> Disable implicit builtin knowledge of a specific function
+ -fno-builtin Disable implicit builtin knowledge of functions
+ -fno-complete-member-pointers
+ Do not require member pointer base types to be complete if they would be significant under the Microsoft ABI
+ -fno-coverage-mapping Disable code coverage analysis
-fno-debug-macro Do not emit macro debug information
-fno-delayed-template-parsing
Disable delayed template parsing
+ -fno-sanitize-address-poison-class-member-array-new-cookie
+ Disable poisoning array cookies when using class member operator new[] in AddressSanitizer
-fno-sanitize-address-use-after-scope
Disable use-after-scope detection in AddressSanitizer
-fno-sanitize-blacklist Don't use blacklist file for sanitizers
@@ -2950,6 +2964,8 @@ Execute ``clang-cl /?`` to see a list of supported options:
Level of field padding for AddressSanitizer
-fsanitize-address-globals-dead-stripping
Enable linker dead stripping of globals in AddressSanitizer
+ -fsanitize-address-poison-class-member-array-new-cookie
+ Enable poisoning array cookies when using class member operator new[] in AddressSanitizer
-fsanitize-address-use-after-scope
Enable use-after-scope detection in AddressSanitizer
-fsanitize-blacklist=<value>
diff --git a/include/clang-c/Index.h b/include/clang-c/Index.h
index 0ad90010ccd9..65dada38b050 100644
--- a/include/clang-c/Index.h
+++ b/include/clang-c/Index.h
@@ -160,7 +160,7 @@ typedef struct CXVersion {
int Major;
/**
* The minor version number, e.g., the '7' in '10.7.3'. This value
- * will be negative if no minor version number was provided, e.g., for
+ * will be negative if no minor version number was provided, e.g., for
* version '10'.
*/
int Minor;
@@ -387,7 +387,7 @@ CINDEX_LINKAGE int clang_getFileUniqueID(CXFile file, CXFileUniqueID *outID);
* multiple inclusions, either with the conventional
* \#ifndef/\#define/\#endif macro guards or with \#pragma once.
*/
-CINDEX_LINKAGE unsigned
+CINDEX_LINKAGE unsigned
clang_isFileMultipleIncludeGuarded(CXTranslationUnit tu, CXFile file);
/**
@@ -786,7 +786,7 @@ typedef void *CXDiagnostic;
* A group of CXDiagnostics.
*/
typedef void *CXDiagnosticSet;
-
+
/**
* Determine the number of diagnostics in a CXDiagnosticSet.
*/
@@ -802,7 +802,7 @@ CINDEX_LINKAGE unsigned clang_getNumDiagnosticsInSet(CXDiagnosticSet Diags);
* via a call to \c clang_disposeDiagnostic().
*/
CINDEX_LINKAGE CXDiagnostic clang_getDiagnosticInSet(CXDiagnosticSet Diags,
- unsigned Index);
+ unsigned Index);
/**
* Describes the kind of error that occurred (if any) in a call to
@@ -813,26 +813,26 @@ enum CXLoadDiag_Error {
* Indicates that no error occurred.
*/
CXLoadDiag_None = 0,
-
+
/**
* Indicates that an unknown error occurred while attempting to
* deserialize diagnostics.
*/
CXLoadDiag_Unknown = 1,
-
+
/**
* Indicates that the file containing the serialized diagnostics
* could not be opened.
*/
CXLoadDiag_CannotLoad = 2,
-
+
/**
* Indicates that the serialized diagnostics file is invalid or
* corrupt.
*/
CXLoadDiag_InvalidFile = 3
};
-
+
/**
* Deserialize a set of diagnostics from a Clang diagnostics bitcode
* file.
@@ -856,7 +856,7 @@ CINDEX_LINKAGE CXDiagnosticSet clang_loadDiagnostics(const char *file,
CINDEX_LINKAGE void clang_disposeDiagnosticSet(CXDiagnosticSet Diags);
/**
- * Retrieve the child diagnostics of a CXDiagnostic.
+ * Retrieve the child diagnostics of a CXDiagnostic.
*
* This CXDiagnosticSet does not need to be released by
* clang_disposeDiagnosticSet.
@@ -888,7 +888,7 @@ CINDEX_LINKAGE CXDiagnostic clang_getDiagnostic(CXTranslationUnit Unit,
* \param Unit the translation unit to query.
*/
CINDEX_LINKAGE CXDiagnosticSet
- clang_getDiagnosticSetFromTU(CXTranslationUnit Unit);
+ clang_getDiagnosticSetFromTU(CXTranslationUnit Unit);
/**
* Destroy a diagnostic.
@@ -934,7 +934,7 @@ enum CXDiagnosticDisplayOptions {
* \c -fdiagnostics-print-source-range-info.
*/
CXDiagnostic_DisplaySourceRanges = 0x04,
-
+
/**
* Display the option name associated with this diagnostic, if any.
*
@@ -943,12 +943,12 @@ enum CXDiagnosticDisplayOptions {
* \c -fdiagnostics-show-option.
*/
CXDiagnostic_DisplayOption = 0x08,
-
+
/**
* Display the category number associated with this diagnostic, if any.
*
* The category number is displayed within brackets after the diagnostic text.
- * This option corresponds to the clang flag
+ * This option corresponds to the clang flag
* \c -fdiagnostics-show-category=id.
*/
CXDiagnostic_DisplayCategoryId = 0x10,
@@ -957,7 +957,7 @@ enum CXDiagnosticDisplayOptions {
* Display the category name associated with this diagnostic, if any.
*
* The category name is displayed within brackets after the diagnostic text.
- * This option corresponds to the clang flag
+ * This option corresponds to the clang flag
* \c -fdiagnostics-show-category=name.
*/
CXDiagnostic_DisplayCategoryName = 0x20
@@ -1019,7 +1019,7 @@ CINDEX_LINKAGE CXString clang_getDiagnosticSpelling(CXDiagnostic);
* diagnostic (if any).
*
* \returns A string that contains the command-line option used to enable this
- * warning, such as "-Wconversion" or "-pedantic".
+ * warning, such as "-Wconversion" or "-pedantic".
*/
CINDEX_LINKAGE CXString clang_getDiagnosticOption(CXDiagnostic Diag,
CXString *Disable);
@@ -1028,7 +1028,7 @@ CINDEX_LINKAGE CXString clang_getDiagnosticOption(CXDiagnostic Diag,
* Retrieve the category number for this diagnostic.
*
* Diagnostics can be categorized into groups along with other, related
- * diagnostics (e.g., diagnostics under the same warning flag). This routine
+ * diagnostics (e.g., diagnostics under the same warning flag). This routine
* retrieves the category number for the given diagnostic.
*
* \returns The number of the category that contains this diagnostic, or zero
@@ -1041,7 +1041,7 @@ CINDEX_LINKAGE unsigned clang_getDiagnosticCategory(CXDiagnostic);
* is now deprecated. Use clang_getDiagnosticCategoryText()
* instead.
*
- * \param Category A diagnostic category number, as returned by
+ * \param Category A diagnostic category number, as returned by
* \c clang_getDiagnosticCategory().
*
* \returns The name of the given diagnostic category.
@@ -1055,7 +1055,7 @@ CXString clang_getDiagnosticCategoryName(unsigned Category);
* \returns The text of the given diagnostic category.
*/
CINDEX_LINKAGE CXString clang_getDiagnosticCategoryText(CXDiagnostic);
-
+
/**
* Determine the number of source ranges associated with the given
* diagnostic.
@@ -1242,9 +1242,9 @@ enum CXTranslationUnit_Flags {
* intent of producing a precompiled header.
*/
CXTranslationUnit_Incomplete = 0x02,
-
+
/**
- * Used to indicate that the translation unit should be built with an
+ * Used to indicate that the translation unit should be built with an
* implicit precompiled header for the preamble.
*
* An implicit precompiled header is used as an optimization when a
@@ -1258,7 +1258,7 @@ enum CXTranslationUnit_Flags {
* precompiled header to improve parsing performance.
*/
CXTranslationUnit_PrecompiledPreamble = 0x04,
-
+
/**
* Used to indicate that the translation unit should cache some
* code-completion results with each reparse of the source file.
@@ -1343,7 +1343,7 @@ enum CXTranslationUnit_Flags {
* to indicate that the translation unit is likely to be reparsed many times,
* either explicitly (via \c clang_reparseTranslationUnit()) or implicitly
* (e.g., by code completion (\c clang_codeCompletionAt())). The returned flag
- * set contains an unspecified set of optimizations (e.g., the precompiled
+ * set contains an unspecified set of optimizations (e.g., the precompiled
* preamble) geared toward improving the performance of these routines. The
* set of optimizations enabled may change from one version to the next.
*/
@@ -1374,7 +1374,7 @@ clang_parseTranslationUnit(CXIndex CIdx,
* command-line arguments so that the compilation can be configured in the same
* way that the compiler is configured on the command line.
*
- * \param CIdx The index object with which the translation unit will be
+ * \param CIdx The index object with which the translation unit will be
* associated.
*
* \param source_filename The name of the source file to load, or NULL if the
@@ -1383,7 +1383,7 @@ clang_parseTranslationUnit(CXIndex CIdx,
* \param command_line_args The command-line arguments that would be
* passed to the \c clang executable if it were being invoked out-of-process.
* These command-line options will be parsed and will affect how the translation
- * unit is parsed. Note that the following options are ignored: '-c',
+ * unit is parsed. Note that the following options are ignored: '-c',
* '-emit-ast', '-fsyntax-only' (which is the default), and '-o \<output file>'.
*
* \param num_command_line_args The number of command-line arguments in
@@ -1463,32 +1463,32 @@ enum CXSaveError {
* Indicates that no error occurred while saving a translation unit.
*/
CXSaveError_None = 0,
-
+
/**
* Indicates that an unknown error occurred while attempting to save
* the file.
*
- * This error typically indicates that file I/O failed when attempting to
+ * This error typically indicates that file I/O failed when attempting to
* write the file.
*/
CXSaveError_Unknown = 1,
-
+
/**
* Indicates that errors during translation prevented this attempt
* to save the translation unit.
- *
+ *
* Errors that prevent the translation unit from being saved can be
* extracted using \c clang_getNumDiagnostics() and \c clang_getDiagnostic().
*/
CXSaveError_TranslationErrors = 2,
-
+
/**
* Indicates that the translation unit to be saved was somehow
* invalid (e.g., NULL).
*/
CXSaveError_InvalidTU = 3
};
-
+
/**
* Saves a translation unit into a serialized representation of
* that translation unit on disk.
@@ -1509,7 +1509,7 @@ enum CXSaveError {
* CXSaveTranslationUnit_XXX flags.
*
* \returns A value that will match one of the enumerators of the CXSaveError
- * enumeration. Zero (CXSaveError_None) indicates that the translation unit was
+ * enumeration. Zero (CXSaveError_None) indicates that the translation unit was
* saved successfully, while a non-zero value indicates that a problem occurred.
*/
CINDEX_LINKAGE int clang_saveTranslationUnit(CXTranslationUnit TU,
@@ -1543,7 +1543,7 @@ enum CXReparse_Flags {
*/
CXReparse_None = 0x0
};
-
+
/**
* Returns the set of flags that is suitable for reparsing a translation
* unit.
@@ -1551,7 +1551,7 @@ enum CXReparse_Flags {
* The set of flags returned provide options for
* \c clang_reparseTranslationUnit() by default. The returned flag
* set contains an unspecified set of optimizations geared toward common uses
- * of reparsing. The set of optimizations enabled may change from one version
+ * of reparsing. The set of optimizations enabled may change from one version
* to the next.
*/
CINDEX_LINKAGE unsigned clang_defaultReparseOptions(CXTranslationUnit TU);
@@ -1563,17 +1563,17 @@ CINDEX_LINKAGE unsigned clang_defaultReparseOptions(CXTranslationUnit TU);
* created the given translation unit, for example because those source files
* have changed (either on disk or as passed via \p unsaved_files). The
* source code will be reparsed with the same command-line options as it
- * was originally parsed.
+ * was originally parsed.
*
* Reparsing a translation unit invalidates all cursors and source locations
* that refer into that translation unit. This makes reparsing a translation
* unit semantically equivalent to destroying the translation unit and then
* creating a new translation unit with the same command-line arguments.
- * However, it may be more efficient to reparse a translation
+ * However, it may be more efficient to reparse a translation
* unit using this routine.
*
* \param TU The translation unit whose contents will be re-parsed. The
- * translation unit must originally have been built with
+ * translation unit must originally have been built with
* \c clang_createTranslationUnitFromSourceFile().
*
* \param num_unsaved_files The number of unsaved file entries in \p
@@ -1584,7 +1584,7 @@ CINDEX_LINKAGE unsigned clang_defaultReparseOptions(CXTranslationUnit TU);
* those files. The contents and name of these files (as specified by
* CXUnsavedFile) are copied when necessary, so the client only needs to
* guarantee their validity until the call to this function returns.
- *
+ *
* \param options A bitset of options composed of the flags in CXReparse_Flags.
* The function \c clang_defaultReparseOptions() produces a default set of
* options recommended for most uses, based on the translation unit.
@@ -1612,8 +1612,8 @@ enum CXTUResourceUsageKind {
CXTUResourceUsage_AST_SideTables = 6,
CXTUResourceUsage_SourceManager_Membuffer_Malloc = 7,
CXTUResourceUsage_SourceManager_Membuffer_MMap = 8,
- CXTUResourceUsage_ExternalASTSource_Membuffer_Malloc = 9,
- CXTUResourceUsage_ExternalASTSource_Membuffer_MMap = 10,
+ CXTUResourceUsage_ExternalASTSource_Membuffer_Malloc = 9,
+ CXTUResourceUsage_ExternalASTSource_Membuffer_MMap = 10,
CXTUResourceUsage_Preprocessor = 11,
CXTUResourceUsage_PreprocessingRecord = 12,
CXTUResourceUsage_SourceManager_DataStructures = 13,
@@ -1635,8 +1635,8 @@ const char *clang_getTUResourceUsageName(enum CXTUResourceUsageKind kind);
typedef struct CXTUResourceUsageEntry {
/* The memory usage category. */
- enum CXTUResourceUsageKind kind;
- /* Amount of resources used.
+ enum CXTUResourceUsageKind kind;
+ /* Amount of resources used.
The units will depend on the resource kind. */
unsigned long amount;
} CXTUResourceUsageEntry;
@@ -1819,7 +1819,7 @@ enum CXCursorKind {
*/
CXCursor_TypeRef = 43,
CXCursor_CXXBaseSpecifier = 44,
- /**
+ /**
* A reference to a class template, function template, template
* template parameter, or class template partial specialization.
*/
@@ -1829,14 +1829,14 @@ enum CXCursorKind {
*/
CXCursor_NamespaceRef = 46,
/**
- * A reference to a member of a struct, union, or class that occurs in
+ * A reference to a member of a struct, union, or class that occurs in
* some non-expression context, e.g., a designated initializer.
*/
CXCursor_MemberRef = 47,
/**
* A reference to a labeled statement.
*
- * This cursor kind is used to describe the jump to "start_over" in the
+ * This cursor kind is used to describe the jump to "start_over" in the
* goto statement in the following example:
*
* \code
@@ -1849,7 +1849,7 @@ enum CXCursorKind {
* A label reference cursor refers to a label statement.
*/
CXCursor_LabelRef = 48,
-
+
/**
* A reference to a set of overloaded functions or function templates
* that has not yet been resolved to a specific function or function template.
@@ -1882,18 +1882,18 @@ enum CXCursorKind {
* argument-dependent lookup (e.g., the "swap" function at the end of the
* example).
*
- * The functions \c clang_getNumOverloadedDecls() and
+ * The functions \c clang_getNumOverloadedDecls() and
* \c clang_getOverloadedDecl() can be used to retrieve the definitions
* referenced by this cursor.
*/
CXCursor_OverloadedDeclRef = 49,
-
+
/**
- * A reference to a variable that occurs in some non-expression
+ * A reference to a variable that occurs in some non-expression
* context, e.g., a C++ lambda capture list.
*/
CXCursor_VariableRef = 50,
-
+
CXCursor_LastRef = CXCursor_VariableRef,
/* Error conditions */
@@ -2153,7 +2153,7 @@ enum CXCursorKind {
* \endcode
*/
CXCursor_LambdaExpr = 144,
-
+
/** Objective-c Boolean Literal.
*/
CXCursor_ObjCBoolLiteralExpr = 145,
@@ -2189,10 +2189,10 @@ enum CXCursorKind {
* reported.
*/
CXCursor_UnexposedStmt = 200,
-
- /** A labelled statement in a function.
+
+ /** A labelled statement in a function.
*
- * This cursor kind is used to describe the "start_over:" label statement in
+ * This cursor kind is used to describe the "start_over:" label statement in
* the following example:
*
* \code
@@ -2650,7 +2650,7 @@ CINDEX_LINKAGE int clang_Cursor_isNull(CXCursor cursor);
* Compute a hash value for the given cursor.
*/
CINDEX_LINKAGE unsigned clang_hashCursor(CXCursor);
-
+
/**
* Retrieve the kind of the given cursor.
*/
@@ -2718,7 +2718,7 @@ CINDEX_LINKAGE unsigned clang_isTranslationUnit(enum CXCursorKind);
* element, such as a preprocessor directive or macro instantiation.
*/
CINDEX_LINKAGE unsigned clang_isPreprocessing(enum CXCursorKind);
-
+
/***
* Determine whether the given cursor represents a currently
* unexposed piece of the AST (e.g., CXCursor_UnexposedStmt).
@@ -2785,7 +2785,7 @@ CINDEX_LINKAGE enum CXVisibilityKind clang_getCursorVisibility(CXCursor cursor);
*
* \returns The availability of the cursor.
*/
-CINDEX_LINKAGE enum CXAvailabilityKind
+CINDEX_LINKAGE enum CXAvailabilityKind
clang_getCursorAvailability(CXCursor cursor);
/**
@@ -2831,10 +2831,10 @@ typedef struct CXPlatformAvailability {
*
* \param cursor The cursor to query.
*
- * \param always_deprecated If non-NULL, will be set to indicate whether the
+ * \param always_deprecated If non-NULL, will be set to indicate whether the
* entity is deprecated on all platforms.
*
- * \param deprecated_message If non-NULL, will be set to the message text
+ * \param deprecated_message If non-NULL, will be set to the message text
* provided along with the unconditional deprecation of this entity. The client
* is responsible for deallocating this string.
*
@@ -2842,7 +2842,7 @@ typedef struct CXPlatformAvailability {
* entity is unavailable on all platforms.
*
* \param unavailable_message If non-NULL, will be set to the message text
- * provided along with the unconditional unavailability of this entity. The
+ * provided along with the unconditional unavailability of this entity. The
* client is responsible for deallocating this string.
*
* \param availability If non-NULL, an array of CXPlatformAvailability instances
@@ -2850,15 +2850,15 @@ typedef struct CXPlatformAvailability {
* the number of platforms for which availability information is available (as
* returned by this function) or \c availability_size, whichever is smaller.
*
- * \param availability_size The number of elements available in the
+ * \param availability_size The number of elements available in the
* \c availability array.
*
* \returns The number of platforms (N) for which availability information is
* available (which is unrelated to \c availability_size).
*
- * Note that the client is responsible for calling
- * \c clang_disposeCXPlatformAvailability to free each of the
- * platform-availability structures returned. There are
+ * Note that the client is responsible for calling
+ * \c clang_disposeCXPlatformAvailability to free each of the
+ * platform-availability structures returned. There are
* \c min(N, availability_size) such structures.
*/
CINDEX_LINKAGE int
@@ -2875,7 +2875,7 @@ clang_getCursorPlatformAvailability(CXCursor cursor,
*/
CINDEX_LINKAGE void
clang_disposeCXPlatformAvailability(CXPlatformAvailability *availability);
-
+
/**
* Describe the "language" of the entity referred to by a cursor.
*/
@@ -2948,7 +2948,7 @@ CINDEX_LINKAGE unsigned clang_CXCursorSet_insert(CXCursorSet cset,
*
* The semantic parent of a cursor is the cursor that semantically contains
* the given \p cursor. For many declarations, the lexical and semantic parents
- * are equivalent (the lexical parent is returned by
+ * are equivalent (the lexical parent is returned by
* \c clang_getCursorLexicalParent()). They diverge when declarations or
* definitions are provided out-of-line. For example:
*
@@ -2983,7 +2983,7 @@ CINDEX_LINKAGE CXCursor clang_getCursorSemanticParent(CXCursor cursor);
*
* The lexical parent of a cursor is the cursor in which the given \p cursor
* was actually written. For many declarations, the lexical and semantic parents
- * are equivalent (the semantic parent is returned by
+ * are equivalent (the semantic parent is returned by
* \c clang_getCursorSemanticParent()). They diverge when declarations or
* definitions are provided out-of-line. For example:
*
@@ -3046,18 +3046,18 @@ CINDEX_LINKAGE CXCursor clang_getCursorLexicalParent(CXCursor cursor);
* \param cursor A cursor representing an Objective-C or C++
* method. This routine will compute the set of methods that this
* method overrides.
- *
+ *
* \param overridden A pointer whose pointee will be replaced with a
* pointer to an array of cursors, representing the set of overridden
* methods. If there are no overridden methods, the pointee will be
- * set to NULL. The pointee must be freed via a call to
+ * set to NULL. The pointee must be freed via a call to
* \c clang_disposeOverriddenCursors().
*
* \param num_overridden A pointer to the number of overridden
* functions, will be set to the number of overridden functions in the
* array pointed to by \p overridden.
*/
-CINDEX_LINKAGE void clang_getOverriddenCursors(CXCursor cursor,
+CINDEX_LINKAGE void clang_getOverriddenCursors(CXCursor cursor,
CXCursor **overridden,
unsigned *num_overridden);
@@ -3072,7 +3072,7 @@ CINDEX_LINKAGE void clang_disposeOverriddenCursors(CXCursor *overridden);
* cursor.
*/
CINDEX_LINKAGE CXFile clang_getIncludedFile(CXCursor cursor);
-
+
/**
* @}
*/
@@ -3133,7 +3133,7 @@ CINDEX_LINKAGE CXSourceRange clang_getCursorExtent(CXCursor);
/**
* @}
*/
-
+
/**
* \defgroup CINDEX_TYPES Type information for CXCursors
*
@@ -3582,7 +3582,7 @@ CINDEX_LINKAGE CXString clang_getDeclObjCTypeEncoding(CXCursor C);
/**
* Returns the Objective-C type encoding for the specified CXType.
*/
-CINDEX_LINKAGE CXString clang_Type_getObjCEncoding(CXType type);
+CINDEX_LINKAGE CXString clang_Type_getObjCEncoding(CXType type);
/**
* Retrieve the spelling of a given CXTypeKind.
@@ -3842,7 +3842,7 @@ CINDEX_LINKAGE unsigned clang_Cursor_isBitField(CXCursor C);
* CX_CXXBaseSpecifier is virtual.
*/
CINDEX_LINKAGE unsigned clang_isVirtualBase(CXCursor);
-
+
/**
* Represents the C++ access control level to a base class for a
* cursor with kind CX_CXXBaseSpecifier.
@@ -3887,7 +3887,7 @@ enum CX_StorageClass {
CINDEX_LINKAGE enum CX_StorageClass clang_Cursor_getStorageClass(CXCursor);
/**
- * Determine the number of overloaded declarations referenced by a
+ * Determine the number of overloaded declarations referenced by a
* \c CXCursor_OverloadedDeclRef cursor.
*
* \param cursor The cursor whose overloaded declarations are being queried.
@@ -3906,18 +3906,18 @@ CINDEX_LINKAGE unsigned clang_getNumOverloadedDecls(CXCursor cursor);
* \param index The zero-based index into the set of overloaded declarations in
* the cursor.
*
- * \returns A cursor representing the declaration referenced by the given
- * \c cursor at the specified \c index. If the cursor does not have an
+ * \returns A cursor representing the declaration referenced by the given
+ * \c cursor at the specified \c index. If the cursor does not have an
* associated set of overloaded declarations, or if the index is out of bounds,
* returns \c clang_getNullCursor();
*/
-CINDEX_LINKAGE CXCursor clang_getOverloadedDecl(CXCursor cursor,
+CINDEX_LINKAGE CXCursor clang_getOverloadedDecl(CXCursor cursor,
unsigned index);
-
+
/**
* @}
*/
-
+
/**
* \defgroup CINDEX_ATTRIBUTES Information for attributes
*
@@ -4021,7 +4021,7 @@ CINDEX_LINKAGE unsigned clang_visitChildren(CXCursor parent,
* The visitor should return one of the \c CXChildVisitResult values
* to direct clang_visitChildrenWithBlock().
*/
-typedef enum CXChildVisitResult
+typedef enum CXChildVisitResult
(^CXCursorVisitorBlock)(CXCursor cursor, CXCursor parent);
/**
@@ -4109,10 +4109,10 @@ CINDEX_LINKAGE CXString clang_getCursorSpelling(CXCursor);
* Most of the times there is only one range for the complete spelling but for
* Objective-C methods and Objective-C message expressions, there are multiple
* pieces for each selector identifier.
- *
+ *
* \param pieceIndex the index of the spelling name piece. If this is greater
* than the actual number of pieces, it will return a NULL (invalid) range.
- *
+ *
* \param options Reserved.
*/
CINDEX_LINKAGE CXSourceRange clang_Cursor_getSpellingNameRange(CXCursor,
@@ -4206,11 +4206,11 @@ CINDEX_LINKAGE CXString clang_getCursorPrettyPrinted(CXCursor Cursor,
* Retrieve the display name for the entity referenced by this cursor.
*
* The display name contains extra information that helps identify the cursor,
- * such as the parameters of a function or template or the arguments of a
+ * such as the parameters of a function or template or the arguments of a
* class template specialization.
*/
CINDEX_LINKAGE CXString clang_getCursorDisplayName(CXCursor);
-
+
/** For a cursor that is a reference, retrieve a cursor representing the
* entity that it references.
*
@@ -4274,10 +4274,10 @@ CINDEX_LINKAGE unsigned clang_isCursorDefinition(CXCursor);
* };
* \endcode
*
- * The declarations and the definition of \c X are represented by three
- * different cursors, all of which are declarations of the same underlying
+ * The declarations and the definition of \c X are represented by three
+ * different cursors, all of which are declarations of the same underlying
* entity. One of these cursor is considered the "canonical" cursor, which
- * is effectively the representative for the underlying entity. One can
+ * is effectively the representative for the underlying entity. One can
* determine if two cursors are declarations of the same underlying entity by
* comparing their canonical cursors.
*
@@ -4301,11 +4301,11 @@ CINDEX_LINKAGE int clang_Cursor_getObjCSelectorIndex(CXCursor);
/**
* Given a cursor pointing to a C++ method call or an Objective-C
* message, returns non-zero if the method/message is "dynamic", meaning:
- *
+ *
* For a C++ method: the call is virtual.
* For an Objective-C message: the receiver is an object instance, not 'super'
* or a specific class.
- *
+ *
* If the method/message is "static" or the cursor does not point to a
* method/message, it will return zero.
*/
@@ -4575,7 +4575,7 @@ CINDEX_LINKAGE unsigned clang_CXXMethod_isDefaulted(CXCursor C);
CINDEX_LINKAGE unsigned clang_CXXMethod_isPureVirtual(CXCursor C);
/**
- * Determine if a C++ member function or member function template is
+ * Determine if a C++ member function or member function template is
* declared 'static'.
*/
CINDEX_LINKAGE unsigned clang_CXXMethod_isStatic(CXCursor C);
@@ -4622,16 +4622,16 @@ CINDEX_LINKAGE unsigned clang_CXXMethod_isConst(CXCursor C);
* \c CXCursor_NoDeclFound.
*/
CINDEX_LINKAGE enum CXCursorKind clang_getTemplateCursorKind(CXCursor C);
-
+
/**
* Given a cursor that may represent a specialization or instantiation
* of a template, retrieve the cursor that represents the template that it
* specializes or from which it was instantiated.
*
- * This routine determines the template involved both for explicit
+ * This routine determines the template involved both for explicit
* specializations of templates and for implicit instantiations of the template,
* both of which are referred to as "specializations". For a class template
- * specialization (e.g., \c std::vector<bool>), this routine will return
+ * specialization (e.g., \c std::vector<bool>), this routine will return
* either the primary template (\c std::vector) or, if the specialization was
* instantiated from a class template partial specialization, the class template
* partial specialization. For a class template partial specialization and a
@@ -4639,7 +4639,7 @@ CINDEX_LINKAGE enum CXCursorKind clang_getTemplateCursorKind(CXCursor C);
* this routine will return the specialized template.
*
* For members of a class template (e.g., member functions, member classes, or
- * static data members), returns the specialized or instantiated member.
+ * static data members), returns the specialized or instantiated member.
* Although not strictly "templates" in the C++ language, members of class
* templates have the same notions of specializations and instantiations that
* templates do, so this routine treats them similarly.
@@ -4647,7 +4647,7 @@ CINDEX_LINKAGE enum CXCursorKind clang_getTemplateCursorKind(CXCursor C);
* \param C A cursor that may be a specialization of a template or a member
* of a template.
*
- * \returns If the given cursor is a specialization or instantiation of a
+ * \returns If the given cursor is a specialization or instantiation of a
* template or a member thereof, the template or member that it specializes or
* from which it was instantiated. Otherwise, returns a NULL cursor.
*/
@@ -4659,11 +4659,11 @@ CINDEX_LINKAGE CXCursor clang_getSpecializedCursorTemplate(CXCursor C);
*
* \param C A cursor pointing to a member reference, a declaration reference, or
* an operator call.
- * \param NameFlags A bitset with three independent flags:
+ * \param NameFlags A bitset with three independent flags:
* CXNameRange_WantQualifier, CXNameRange_WantTemplateArgs, and
* CXNameRange_WantSinglePiece.
- * \param PieceIndex For contiguous names or when passing the flag
- * CXNameRange_WantSinglePiece, only one piece with index 0 is
+ * \param PieceIndex For contiguous names or when passing the flag
+ * CXNameRange_WantSinglePiece, only one piece with index 0 is
* available. When the CXNameRange_WantSinglePiece flag is not passed for a
* non-contiguous names, this index can be used to retrieve the individual
* pieces of the name. See also CXNameRange_WantSinglePiece.
@@ -4672,7 +4672,7 @@ CINDEX_LINKAGE CXCursor clang_getSpecializedCursorTemplate(CXCursor C);
* name, or if the PieceIndex is out-of-range, a null-cursor will be returned.
*/
CINDEX_LINKAGE CXSourceRange clang_getCursorReferenceNameRange(CXCursor C,
- unsigned NameFlags,
+ unsigned NameFlags,
unsigned PieceIndex);
enum CXNameRefFlags {
@@ -4681,7 +4681,7 @@ enum CXNameRefFlags {
* range.
*/
CXNameRange_WantQualifier = 0x1,
-
+
/**
* Include the explicit template arguments, e.g. \<int> in x.f<int>,
* in the range.
@@ -4700,7 +4700,7 @@ enum CXNameRefFlags {
*/
CXNameRange_WantSinglePiece = 0x4
};
-
+
/**
* @}
*/
@@ -5153,7 +5153,7 @@ clang_getNumCompletionChunks(CXCompletionString completion_string);
/**
* Determine the priority of this code completion.
*
- * The priority of a code completion indicates how likely it is that this
+ * The priority of a code completion indicates how likely it is that this
* particular completion is the completion that the user will select. The
* priority is selected by various internal heuristics.
*
@@ -5164,7 +5164,7 @@ clang_getNumCompletionChunks(CXCompletionString completion_string);
*/
CINDEX_LINKAGE unsigned
clang_getCompletionPriority(CXCompletionString completion_string);
-
+
/**
* Determine the availability of the entity that this code-completion
* string refers to.
@@ -5173,7 +5173,7 @@ clang_getCompletionPriority(CXCompletionString completion_string);
*
* \returns The availability of the completion string.
*/
-CINDEX_LINKAGE enum CXAvailabilityKind
+CINDEX_LINKAGE enum CXAvailabilityKind
clang_getCompletionAvailability(CXCompletionString completion_string);
/**
@@ -5206,7 +5206,7 @@ clang_getCompletionAnnotation(CXCompletionString completion_string,
/**
* Retrieve the parent context of the given completion string.
*
- * The parent context of a completion string is the semantic parent of
+ * The parent context of a completion string is the semantic parent of
* the declaration (if any) that the code completion represents. For example,
* a code completion for an Objective-C method would have the method's class
* or protocol as its context.
@@ -5241,7 +5241,7 @@ clang_getCompletionBriefComment(CXCompletionString completion_string);
*/
CINDEX_LINKAGE CXCompletionString
clang_getCursorCompletionString(CXCursor cursor);
-
+
/**
* Contains the results of code-completion.
*
@@ -5378,12 +5378,12 @@ enum CXCompletionContext {
* should be included. (This is equivalent to having no context bits set.)
*/
CXCompletionContext_Unexposed = 0,
-
+
/**
* Completions for any possible type should be included in the results.
*/
CXCompletionContext_AnyType = 1 << 0,
-
+
/**
* Completions for any possible value (variables, function calls, etc.)
* should be included in the results.
@@ -5404,7 +5404,7 @@ enum CXCompletionContext {
* included in the results.
*/
CXCompletionContext_CXXClassTypeValue = 1 << 4,
-
+
/**
* Completions for fields of the member being accessed using the dot
* operator should be included in the results.
@@ -5420,7 +5420,7 @@ enum CXCompletionContext {
* using the dot operator should be included in the results.
*/
CXCompletionContext_ObjCPropertyAccess = 1 << 7,
-
+
/**
* Completions for enum tags should be included in the results.
*/
@@ -5433,7 +5433,7 @@ enum CXCompletionContext {
* Completions for struct tags should be included in the results.
*/
CXCompletionContext_StructTag = 1 << 10,
-
+
/**
* Completions for C++ class names should be included in the results.
*/
@@ -5448,7 +5448,7 @@ enum CXCompletionContext {
* the results.
*/
CXCompletionContext_NestedNameSpecifier = 1 << 13,
-
+
/**
* Completions for Objective-C interfaces (classes) should be included
* in the results.
@@ -5479,27 +5479,27 @@ enum CXCompletionContext {
* the results.
*/
CXCompletionContext_ObjCSelectorName = 1 << 19,
-
+
/**
* Completions for preprocessor macro names should be included in
* the results.
*/
CXCompletionContext_MacroName = 1 << 20,
-
+
/**
* Natural language completions should be included in the results.
*/
CXCompletionContext_NaturalLanguage = 1 << 21,
-
+
/**
* The current context is unknown, so set all contexts.
*/
CXCompletionContext_Unknown = ((1 << 22) - 1)
};
-
+
/**
* Returns a default set of code-completion options that can be
- * passed to\c clang_codeCompleteAt().
+ * passed to\c clang_codeCompleteAt().
*/
CINDEX_LINKAGE unsigned clang_defaultCodeCompleteOptions(void);
@@ -5562,7 +5562,7 @@ CINDEX_LINKAGE unsigned clang_defaultCodeCompleteOptions(void);
*
* \param options Extra options that control the behavior of code
* completion, expressed as a bitwise OR of the enumerators of the
- * CXCodeComplete_Flags enumeration. The
+ * CXCodeComplete_Flags enumeration. The
* \c clang_defaultCodeCompleteOptions() function returns a default set
* of code-completion options.
*
@@ -5581,7 +5581,7 @@ CXCodeCompleteResults *clang_codeCompleteAt(CXTranslationUnit TU,
unsigned options);
/**
- * Sort the code-completion results in case-insensitive alphabetical
+ * Sort the code-completion results in case-insensitive alphabetical
* order.
*
* \param Results The set of results to sort.
@@ -5590,13 +5590,13 @@ CXCodeCompleteResults *clang_codeCompleteAt(CXTranslationUnit TU,
CINDEX_LINKAGE
void clang_sortCodeCompletionResults(CXCompletionResult *Results,
unsigned NumResults);
-
+
/**
* Free the given set of code-completion results.
*/
CINDEX_LINKAGE
void clang_disposeCodeCompleteResults(CXCodeCompleteResults *Results);
-
+
/**
* Determine the number of diagnostics produced prior to the
* location where code completion was performed.
@@ -5620,7 +5620,7 @@ CXDiagnostic clang_codeCompleteGetDiagnostic(CXCodeCompleteResults *Results,
/**
* Determines what completions are appropriate for the context
* the given code completion.
- *
+ *
* \param Results the code completion results to query
*
* \returns the kinds of completions that are appropriate for use
@@ -5676,7 +5676,7 @@ CXString clang_codeCompleteGetContainerUSR(CXCodeCompleteResults *Results);
*/
CINDEX_LINKAGE
CXString clang_codeCompleteGetObjCSelector(CXCodeCompleteResults *Results);
-
+
/**
* @}
*/
@@ -5700,7 +5700,7 @@ CINDEX_LINKAGE CXString clang_getClangVersion(void);
* value enables crash recovery, while 0 disables it.
*/
CINDEX_LINKAGE void clang_toggleCrashRecovery(unsigned isEnabled);
-
+
/**
* Visitor invoked for each file in a translation unit
* (used with clang_getInclusions()).
@@ -5745,7 +5745,7 @@ typedef enum {
typedef void * CXEvalResult;
/**
- * If cursor is a statement declaration tries to evaluate the
+ * If cursor is a statement declaration tries to evaluate the
* statement and if its variable, tries to evaluate its initializer,
* into its corresponding type.
*/
@@ -5844,7 +5844,7 @@ CINDEX_LINKAGE unsigned clang_remap_getNumFiles(CXRemapping);
/**
* Get the original and the associated filename from the remapping.
- *
+ *
* \param original If non-NULL, will be set to the original filename.
*
* \param transformed If non-NULL, will be set to the filename that the original
@@ -5896,7 +5896,7 @@ typedef enum {
/**
* Find references of a declaration in a specific file.
- *
+ *
* \param cursor pointing to a declaration or a reference of one.
*
* \param file to search for references.
@@ -6255,11 +6255,11 @@ typedef struct {
const CXIdxEntityInfo *referencedEntity;
/**
* Immediate "parent" of the reference. For example:
- *
+ *
* \code
* Foo *var;
* \endcode
- *
+ *
* The parent of reference of type 'Foo' is the variable 'var'.
* For references inside statement bodies of functions/methods,
* the parentEntity will be the function/method.
@@ -6294,16 +6294,16 @@ typedef struct {
CXIdxClientFile (*enteredMainFile)(CXClientData client_data,
CXFile mainFile, void *reserved);
-
+
/**
* Called when a file gets \#included/\#imported.
*/
CXIdxClientFile (*ppIncludedFile)(CXClientData client_data,
const CXIdxIncludedFileInfo *);
-
+
/**
* Called when a AST file (PCH or module) gets imported.
- *
+ *
* AST files will not get indexed (there will not be callbacks to index all
* the entities in an AST file). The recommended action is that, if the AST
* file is not already indexed, to initiate a new indexing job specific to
@@ -6405,7 +6405,7 @@ typedef enum {
* Used to indicate that no special indexing options are needed.
*/
CXIndexOpt_None = 0x0,
-
+
/**
* Used to indicate that IndexerCallbacks#indexEntityReference should
* be invoked for only one reference of an entity per source file that does
@@ -6492,16 +6492,16 @@ CINDEX_LINKAGE int clang_indexSourceFileFullArgv(
/**
* Index the given translation unit via callbacks implemented through
* #IndexerCallbacks.
- *
+ *
* The order of callback invocations is not guaranteed to be the same as
* when indexing a source file. The high level order will be:
- *
+ *
* -Preprocessor callbacks invocations
* -Declaration/reference callbacks invocations
* -Diagnostic callback invocations
*
* The parameters are the same as #clang_indexSourceFile.
- *
+ *
* \returns If there is a failure from which there is no recovery, returns
* non-zero, otherwise returns 0.
*/
diff --git a/include/clang/ARCMigrate/FileRemapper.h b/include/clang/ARCMigrate/FileRemapper.h
index 53b88e9eb5e5..731307f24e22 100644
--- a/include/clang/ARCMigrate/FileRemapper.h
+++ b/include/clang/ARCMigrate/FileRemapper.h
@@ -41,7 +41,7 @@ class FileRemapper {
public:
FileRemapper();
~FileRemapper();
-
+
bool initFromDisk(StringRef outputDir, DiagnosticsEngine &Diag,
bool ignoreIfFilesChanged);
bool initFromFile(StringRef filePath, DiagnosticsEngine &Diag,
diff --git a/include/clang/AST/ASTContext.h b/include/clang/AST/ASTContext.h
index c6f8e2973e8e..a9ab687a8de9 100644
--- a/include/clang/AST/ASTContext.h
+++ b/include/clang/AST/ASTContext.h
@@ -226,6 +226,12 @@ class ASTContext : public RefCountedBase<ASTContext> {
using TypeInfoMap = llvm::DenseMap<const Type *, struct TypeInfo>;
mutable TypeInfoMap MemoizedTypeInfo;
+ /// A cache from types to unadjusted alignment information. Only ARM and
+ /// AArch64 targets need this information, keeping it separate prevents
+ /// imposing overhead on TypeInfo size.
+ using UnadjustedAlignMap = llvm::DenseMap<const Type *, unsigned>;
+ mutable UnadjustedAlignMap MemoizedUnadjustedAlign;
+
/// A cache mapping from CXXRecordDecls to key functions.
llvm::DenseMap<const CXXRecordDecl*, LazyDeclPtr> KeyFunctions;
@@ -1522,7 +1528,7 @@ public:
/// The sizeof operator requires this (C99 6.5.3.4p4).
CanQualType getSizeType() const;
- /// Return the unique signed counterpart of
+ /// Return the unique signed counterpart of
/// the integer type corresponding to size_t.
CanQualType getSignedSizeType() const;
@@ -2067,6 +2073,16 @@ public:
unsigned getTypeAlign(QualType T) const { return getTypeInfo(T).Align; }
unsigned getTypeAlign(const Type *T) const { return getTypeInfo(T).Align; }
+ /// Return the ABI-specified natural alignment of a (complete) type \p T,
+ /// before alignment adjustments, in bits.
+ ///
+ /// This alignment is curently used only by ARM and AArch64 when passing
+ /// arguments of a composite type.
+ unsigned getTypeUnadjustedAlign(QualType T) const {
+ return getTypeUnadjustedAlign(T.getTypePtr());
+ }
+ unsigned getTypeUnadjustedAlign(const Type *T) const;
+
/// Return the ABI-specified alignment of a type, in bits, or 0 if
/// the type is incomplete and we cannot determine the alignment (for
/// example, from alignment attributes).
@@ -2077,6 +2093,12 @@ public:
CharUnits getTypeAlignInChars(QualType T) const;
CharUnits getTypeAlignInChars(const Type *T) const;
+ /// getTypeUnadjustedAlignInChars - Return the ABI-specified alignment of a type,
+ /// in characters, before alignment adjustments. This method does not work on
+ /// incomplete types.
+ CharUnits getTypeUnadjustedAlignInChars(QualType T) const;
+ CharUnits getTypeUnadjustedAlignInChars(const Type *T) const;
+
// getTypeInfoDataSizeInChars - Return the size of a type, in chars. If the
// type is a record, its data size is returned.
std::pair<CharUnits, CharUnits> getTypeInfoDataSizeInChars(QualType T) const;
diff --git a/include/clang/AST/ASTDiagnostic.h b/include/clang/AST/ASTDiagnostic.h
index b08865dde3c1..2534272da3a3 100644
--- a/include/clang/AST/ASTDiagnostic.h
+++ b/include/clang/AST/ASTDiagnostic.h
@@ -23,11 +23,11 @@ namespace clang {
NUM_BUILTIN_AST_DIAGNOSTICS
};
} // end namespace diag
-
+
/// DiagnosticsEngine argument formatting function for diagnostics that
/// involve AST nodes.
///
- /// This function formats diagnostic arguments for various AST nodes,
+ /// This function formats diagnostic arguments for various AST nodes,
/// including types, declaration names, nested name specifiers, and
/// declaration contexts, into strings that can be printed as part of
/// diagnostics. It is meant to be used as the argument to
diff --git a/include/clang/AST/ASTImporter.h b/include/clang/AST/ASTImporter.h
index 6e6a1926254b..2e9a8775a8a2 100644
--- a/include/clang/AST/ASTImporter.h
+++ b/include/clang/AST/ASTImporter.h
@@ -63,7 +63,7 @@ class Attr;
private:
/// The contexts we're importing to and from.
ASTContext &ToContext, &FromContext;
-
+
/// The file managers we're importing to and from.
FileManager &ToFileManager, &FromFileManager;
@@ -72,11 +72,11 @@ class Attr;
/// Whether the last diagnostic came from the "from" context.
bool LastDiagFromFrom = false;
-
+
/// Mapping from the already-imported types in the "from" context
/// to the corresponding types in the "to" context.
llvm::DenseMap<const Type *, const Type *> ImportedTypes;
-
+
/// Mapping from the already-imported declarations in the "from"
/// context to the corresponding declarations in the "to" context.
llvm::DenseMap<Decl *, Decl *> ImportedDecls;
@@ -93,11 +93,11 @@ class Attr;
/// the "from" source manager to the corresponding CXXBasesSpecifier
/// in the "to" source manager.
ImportedCXXBaseSpecifierMap ImportedCXXBaseSpecifiers;
-
+
/// Declaration (from, to) pairs that are known not to be equivalent
/// (which we have already complained about).
NonEquivalentDeclSet NonEquivalentDecls;
-
+
public:
/// Create a new AST importer.
///
@@ -115,13 +115,13 @@ class Attr;
ASTImporter(ASTContext &ToContext, FileManager &ToFileManager,
ASTContext &FromContext, FileManager &FromFileManager,
bool MinimalImport);
-
+
virtual ~ASTImporter();
-
+
/// Whether the importer will perform a minimal import, creating
/// to-be-completed forward declarations when possible.
bool isMinimalImport() const { return Minimal; }
-
+
/// Import the given type from the "from" context into the "to"
/// context.
///
@@ -142,10 +142,10 @@ class Attr;
/// \returns the equivalent attribute in the "to" context.
Attr *Import(const Attr *FromAttr);
- /// Import the given declaration from the "from" context into the
+ /// Import the given declaration from the "from" context into the
/// "to" context.
///
- /// \returns the equivalent declaration in the "to" context, or a NULL type
+ /// \returns the equivalent declaration in the "to" context, or a NULL type
/// if an error occurred.
Decl *Import(Decl *FromD);
Decl *Import(const Decl *FromD) {
@@ -163,7 +163,7 @@ class Attr;
/// \returns the equivalent declaration context in the "to"
/// context, or a NULL type if an error occurred.
DeclContext *ImportContext(DeclContext *FromDC);
-
+
/// Import the given expression from the "from" context into the
/// "to" context.
///
@@ -195,7 +195,7 @@ class Attr;
/// Import the goven template name from the "from" context into the
/// "to" context.
TemplateName Import(TemplateName From);
-
+
/// Import the given source location from the "from" context into
/// the "to" context.
///
@@ -229,7 +229,7 @@ class Attr;
/// \returns the equivalent selector in the "to" context.
Selector Import(Selector FromSel);
- /// Import the given file ID from the "from" context into the
+ /// 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"
@@ -252,13 +252,13 @@ class Attr;
/// Import the definition of the given declaration, including all of
/// the declarations it contains.
///
- /// This routine is intended to be used
+ /// This routine is intended to be used
void ImportDefinition(Decl *From);
/// Cope with a name conflict when importing a declaration into the
/// given context.
///
- /// This routine is invoked whenever there is a name conflict while
+ /// This routine is invoked whenever there is a name conflict while
/// importing a declaration. The returned name will become the name of the
/// imported declaration. By default, the returned name is the same as the
/// original name, leaving the conflict unresolve such that name lookup
@@ -270,7 +270,7 @@ class Attr;
/// \param Name the name of the declaration being imported, which conflicts
/// with other declarations.
///
- /// \param DC the declaration context (in the "to" AST context) in which
+ /// \param DC the declaration context (in the "to" AST context) in which
/// the name is being imported.
///
/// \param IDNS the identifier namespace in which the name will be found.
@@ -286,25 +286,25 @@ class Attr;
unsigned IDNS,
NamedDecl **Decls,
unsigned NumDecls);
-
+
/// Retrieve the context that AST nodes are being imported into.
ASTContext &getToContext() const { return ToContext; }
-
+
/// Retrieve the context that AST nodes are being imported from.
ASTContext &getFromContext() const { return FromContext; }
-
+
/// Retrieve the file manager that AST nodes are being imported into.
FileManager &getToFileManager() const { return ToFileManager; }
/// Retrieve the file manager that AST nodes are being imported from.
FileManager &getFromFileManager() const { return FromFileManager; }
-
+
/// Report a diagnostic in the "to" context.
DiagnosticBuilder ToDiag(SourceLocation Loc, unsigned DiagID);
-
+
/// Report a diagnostic in the "from" context.
DiagnosticBuilder FromDiag(SourceLocation Loc, unsigned DiagID);
-
+
/// Return the set of declarations that we know are not equivalent.
NonEquivalentDeclSet &getNonEquivalentDecls() { return NonEquivalentDecls; }
@@ -313,7 +313,7 @@ class Attr;
///
/// \param D A declaration in the "to" context.
virtual void CompleteDecl(Decl* D);
-
+
/// 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; }
@@ -328,7 +328,7 @@ class Attr;
/// RecordDecl can be found, we can complete it without the need for
/// importation, eliminating this loop.
virtual Decl *GetOriginalDecl(Decl *To) { return nullptr; }
-
+
/// Determine whether the given types are structurally
/// equivalent.
bool IsStructurallyEquivalent(QualType From, QualType To,
diff --git a/include/clang/AST/ASTLambda.h b/include/clang/AST/ASTLambda.h
index 2fe4e2563b36..6fedcb8d3801 100644
--- a/include/clang/AST/ASTLambda.h
+++ b/include/clang/AST/ASTLambda.h
@@ -40,7 +40,7 @@ inline bool isGenericLambdaCallOperatorSpecialization(const CXXMethodDecl *MD) {
if (!MD) return false;
const CXXRecordDecl *LambdaClass = MD->getParent();
if (LambdaClass && LambdaClass->isGenericLambda())
- return isLambdaCallOperator(MD) &&
+ return isLambdaCallOperator(MD) &&
MD->isFunctionTemplateSpecialization();
return false;
}
@@ -51,11 +51,11 @@ inline bool isLambdaConversionOperator(CXXConversionDecl *C) {
inline bool isLambdaConversionOperator(Decl *D) {
if (!D) return false;
- if (CXXConversionDecl *Conv = dyn_cast<CXXConversionDecl>(D))
- return isLambdaConversionOperator(Conv);
- if (FunctionTemplateDecl *F = dyn_cast<FunctionTemplateDecl>(D))
- if (CXXConversionDecl *Conv =
- dyn_cast_or_null<CXXConversionDecl>(F->getTemplatedDecl()))
+ if (CXXConversionDecl *Conv = dyn_cast<CXXConversionDecl>(D))
+ return isLambdaConversionOperator(Conv);
+ if (FunctionTemplateDecl *F = dyn_cast<FunctionTemplateDecl>(D))
+ if (CXXConversionDecl *Conv =
+ dyn_cast_or_null<CXXConversionDecl>(F->getTemplatedDecl()))
return isLambdaConversionOperator(Conv);
return false;
}
@@ -71,7 +71,7 @@ inline bool isGenericLambdaCallOperatorSpecialization(DeclContext *DC) {
inline DeclContext *getLambdaAwareParentOfDeclContext(DeclContext *DC) {
if (isLambdaCallOperator(DC))
return DC->getParent()->getParent();
- else
+ else
return DC->getParent();
}
diff --git a/include/clang/AST/ASTMutationListener.h b/include/clang/AST/ASTMutationListener.h
index 31ae2b111e01..80184e1cc740 100644
--- a/include/clang/AST/ASTMutationListener.h
+++ b/include/clang/AST/ASTMutationListener.h
@@ -134,13 +134,13 @@ public:
/// \param M The containing module in which the definition was made visible,
/// if any.
virtual void RedefinedHiddenDefinition(const NamedDecl *D, Module *M) {}
-
+
/// An attribute was added to a RecordDecl
///
/// \param Attr The attribute that was added to the Record
///
/// \param Record The RecordDecl that got a new attribute
- virtual void AddedAttributeToRecord(const Attr *Attr,
+ virtual void AddedAttributeToRecord(const Attr *Attr,
const RecordDecl *Record) {}
// NOTE: If new methods are added they should also be added to
diff --git a/include/clang/AST/Attr.h b/include/clang/AST/Attr.h
index 32a61c59d236..20922742f687 100644
--- a/include/clang/AST/Attr.h
+++ b/include/clang/AST/Attr.h
@@ -86,7 +86,7 @@ public:
attr::Kind getKind() const {
return static_cast<attr::Kind>(AttrKind);
}
-
+
unsigned getSpellingListIndex() const { return SpellingListIndex; }
const char *getSpelling() const;
diff --git a/include/clang/AST/AttrIterator.h b/include/clang/AST/AttrIterator.h
index 56807b4590d3..2087ecc0e70c 100644
--- a/include/clang/AST/AttrIterator.h
+++ b/include/clang/AST/AttrIterator.h
@@ -106,7 +106,7 @@ public:
specific_attr_iterator Right) {
assert((Left.Current == nullptr) == (Right.Current == nullptr));
if (Left.Current < Right.Current)
- Left.AdvanceToNext(Right.Current);
+ Left.AdvanceToNext(Right.Current);
else
Right.AdvanceToNext(Left.Current);
return Left.Current == Right.Current;
diff --git a/include/clang/AST/BaseSubobject.h b/include/clang/AST/BaseSubobject.h
index fdb7e718fe9e..2b702c76b2fa 100644
--- a/include/clang/AST/BaseSubobject.h
+++ b/include/clang/AST/BaseSubobject.h
@@ -24,21 +24,21 @@ namespace clang {
class CXXRecordDecl;
-// BaseSubobject - Uniquely identifies a direct or indirect base class.
+// BaseSubobject - Uniquely identifies a direct or indirect base class.
// Stores both the base class decl and the offset from the most derived class to
// the base class. Used for vtable and VTT generation.
class BaseSubobject {
/// Base - The base class declaration.
const CXXRecordDecl *Base;
-
+
/// BaseOffset - The offset from the most derived class to the base class.
CharUnits BaseOffset;
-
+
public:
BaseSubobject() = default;
BaseSubobject(const CXXRecordDecl *Base, CharUnits BaseOffset)
: Base(Base), BaseOffset(BaseOffset) {}
-
+
/// getBase - Returns the base class declaration.
const CXXRecordDecl *getBase() const { return Base; }
@@ -74,7 +74,7 @@ template<> struct DenseMapInfo<clang::BaseSubobject> {
Base.getBaseOffset()));
}
- static bool isEqual(const clang::BaseSubobject &LHS,
+ static bool isEqual(const clang::BaseSubobject &LHS,
const clang::BaseSubobject &RHS) {
return LHS == RHS;
}
diff --git a/include/clang/AST/CXXInheritance.h b/include/clang/AST/CXXInheritance.h
index 2ae1d8b25823..f5e23f8e8505 100644
--- a/include/clang/AST/CXXInheritance.h
+++ b/include/clang/AST/CXXInheritance.h
@@ -34,10 +34,10 @@ namespace clang {
class ASTContext;
class NamedDecl;
-
+
/// Represents an element in a path from a derived class to a
-/// base class.
-///
+/// base class.
+///
/// Each step in the path references the link from a
/// derived class to one of its direct base classes, along with a
/// base "number" that identifies which base subobject of the
@@ -47,12 +47,12 @@ struct CXXBasePathElement {
/// class to a base class, which will be followed by this base
/// path element.
const CXXBaseSpecifier *Base;
-
+
/// The record decl of the class that the base is a base of.
const CXXRecordDecl *Class;
-
+
/// Identifies which base class subobject (of type
- /// \c Base->getType()) this base path element refers to.
+ /// \c Base->getType()) this base path element refers to.
///
/// This value is only valid if \c !Base->isVirtual(), because there
/// is no base numbering for the zero or one virtual bases of a
@@ -64,7 +64,7 @@ struct CXXBasePathElement {
/// (which is not represented as part of the path) to a particular
/// (direct or indirect) base class subobject.
///
-/// Individual elements in the path are described by the \c CXXBasePathElement
+/// Individual elements in the path are described by the \c CXXBasePathElement
/// structure, which captures both the link from a derived class to one of its
/// direct bases and identification describing which base class
/// subobject is being used.
@@ -121,7 +121,7 @@ class CXXBasePaths {
/// The type from which this search originated.
CXXRecordDecl *Origin = nullptr;
-
+
/// Paths - The actual set of paths that can be taken from the
/// derived class to the same base class.
std::list<CXXBasePath> Paths;
@@ -160,12 +160,12 @@ class CXXBasePaths {
/// ambiguous paths while it is looking for a path from a derived
/// type to a base type.
bool FindAmbiguities;
-
+
/// RecordPaths - Whether Sema::IsDerivedFrom should record paths
/// while it is determining whether there are paths from a derived
/// type to a base type.
bool RecordPaths;
-
+
/// DetectVirtual - Whether Sema::IsDerivedFrom should abort the search
/// if it finds a path that goes across a virtual base. The virtual class
/// is also recorded.
@@ -181,7 +181,7 @@ public:
using paths_iterator = std::list<CXXBasePath>::iterator;
using const_paths_iterator = std::list<CXXBasePath>::const_iterator;
using decl_iterator = NamedDecl **;
-
+
/// BasePaths - Construct a new BasePaths structure to record the
/// paths for a derived-to-base search.
explicit CXXBasePaths(bool FindAmbiguities = true, bool RecordPaths = true,
@@ -193,31 +193,31 @@ public:
paths_iterator end() { return Paths.end(); }
const_paths_iterator begin() const { return Paths.begin(); }
const_paths_iterator end() const { return Paths.end(); }
-
+
CXXBasePath& front() { return Paths.front(); }
const CXXBasePath& front() const { return Paths.front(); }
-
+
using decl_range = llvm::iterator_range<decl_iterator>;
decl_range found_decls();
-
+
/// Determine whether the path from the most-derived type to the
/// given base type is ambiguous (i.e., it refers to multiple subobjects of
/// the same base type).
bool isAmbiguous(CanQualType BaseType);
-
+
/// Whether we are finding multiple paths to detect ambiguities.
bool isFindingAmbiguities() const { return FindAmbiguities; }
-
+
/// Whether we are recording paths.
bool isRecordingPaths() const { return RecordPaths; }
-
+
/// Specify whether we should be recording paths or not.
void setRecordingPaths(bool RP) { RecordPaths = RP; }
-
+
/// Whether we are detecting virtual bases.
bool isDetectingVirtual() const { return DetectVirtual; }
-
+
/// The virtual base discovered on the path (if we are merely
/// detecting virtuals).
const RecordType* getDetectedVirtual() const {
@@ -228,11 +228,11 @@ public:
/// began
CXXRecordDecl *getOrigin() const { return Origin; }
void setOrigin(CXXRecordDecl *Rec) { Origin = Rec; }
-
+
/// Clear the base-paths results.
void clear();
-
- /// Swap this data structure's contents with another CXXBasePaths
+
+ /// Swap this data structure's contents with another CXXBasePaths
/// object.
void swap(CXXBasePaths &Other);
};
diff --git a/include/clang/AST/CanonicalType.h b/include/clang/AST/CanonicalType.h
index 63a0af66eec3..0e738da43ad4 100644
--- a/include/clang/AST/CanonicalType.h
+++ b/include/clang/AST/CanonicalType.h
@@ -85,8 +85,8 @@ public:
/// Retrieve the underlying type pointer, which refers to a
/// canonical type, or nullptr.
- const T *getTypePtrOrNull() const {
- return cast_or_null<T>(Stored.getTypePtrOrNull());
+ const T *getTypePtrOrNull() const {
+ return cast_or_null<T>(Stored.getTypePtrOrNull());
}
/// Implicit conversion to a qualified type.
@@ -94,7 +94,7 @@ public:
/// Implicit conversion to bool.
explicit operator bool() const { return !isNull(); }
-
+
bool isNull() const {
return Stored.isNull();
}
diff --git a/include/clang/AST/CharUnits.h b/include/clang/AST/CharUnits.h
index ddead6046a14..0aadf06fffc9 100644
--- a/include/clang/AST/CharUnits.h
+++ b/include/clang/AST/CharUnits.h
@@ -61,7 +61,7 @@ namespace clang {
/// fromQuantity - Construct a CharUnits quantity from a raw integer type.
static CharUnits fromQuantity(QuantityType Quantity) {
- return CharUnits(Quantity);
+ return CharUnits(Quantity);
}
// Compound assignment.
@@ -87,7 +87,7 @@ namespace clang {
CharUnits operator-- (int) {
return CharUnits(Quantity--);
}
-
+
// Comparison operators.
bool operator== (const CharUnits &Other) const {
return Quantity == Other.Quantity;
@@ -97,21 +97,21 @@ namespace clang {
}
// Relational operators.
- bool operator< (const CharUnits &Other) const {
- return Quantity < Other.Quantity;
+ bool operator< (const CharUnits &Other) const {
+ return Quantity < Other.Quantity;
}
- bool operator<= (const CharUnits &Other) const {
+ bool operator<= (const CharUnits &Other) const {
return Quantity <= Other.Quantity;
}
- bool operator> (const CharUnits &Other) const {
- return Quantity > Other.Quantity;
+ bool operator> (const CharUnits &Other) const {
+ return Quantity > Other.Quantity;
}
- bool operator>= (const CharUnits &Other) const {
- return Quantity >= Other.Quantity;
+ bool operator>= (const CharUnits &Other) const {
+ return Quantity >= Other.Quantity;
}
// Other predicates.
-
+
/// isZero - Test whether the quantity equals zero.
bool isZero() const { return Quantity == 0; }
@@ -172,7 +172,7 @@ namespace clang {
return CharUnits(-Quantity);
}
-
+
// Conversions.
/// getQuantity - Get the raw integer representation of this quantity.
@@ -205,7 +205,7 @@ namespace clang {
}; // class CharUnit
} // namespace clang
-inline clang::CharUnits operator* (clang::CharUnits::QuantityType Scale,
+inline clang::CharUnits operator* (clang::CharUnits::QuantityType Scale,
const clang::CharUnits &CU) {
return CU * Scale;
}
@@ -223,8 +223,8 @@ template<> struct DenseMapInfo<clang::CharUnits> {
static clang::CharUnits getTombstoneKey() {
clang::CharUnits::QuantityType Quantity =
DenseMapInfo<clang::CharUnits::QuantityType>::getTombstoneKey();
-
- return clang::CharUnits::fromQuantity(Quantity);
+
+ return clang::CharUnits::fromQuantity(Quantity);
}
static unsigned getHashValue(const clang::CharUnits &CU) {
@@ -232,7 +232,7 @@ template<> struct DenseMapInfo<clang::CharUnits> {
return DenseMapInfo<clang::CharUnits::QuantityType>::getHashValue(Quantity);
}
- static bool isEqual(const clang::CharUnits &LHS,
+ static bool isEqual(const clang::CharUnits &LHS,
const clang::CharUnits &RHS) {
return LHS == RHS;
}
@@ -241,7 +241,7 @@ 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 e3a427d8aa0d..f5538dec2a14 100644
--- a/include/clang/AST/Comment.h
+++ b/include/clang/AST/Comment.h
@@ -98,7 +98,7 @@ protected:
unsigned RenderKind : 2;
unsigned CommandID : CommandInfo::NumCommandIDBits;
};
- enum { NumInlineCommandCommentBits = NumInlineContentCommentBits + 2 +
+ enum { NumInlineCommandCommentBits = NumInlineContentCommentBits + 2 +
CommandInfo::NumCommandIDBits };
class HTMLTagCommentBitfields {
@@ -146,7 +146,7 @@ protected:
/// Contains values from CommandMarkerKind enum.
unsigned CommandMarker : 1;
};
- enum { NumBlockCommandCommentBits = NumCommentBits +
+ enum { NumBlockCommandCommentBits = NumCommentBits +
CommandInfo::NumCommandIDBits + 1 };
class ParamCommandCommentBitfields {
@@ -987,7 +987,7 @@ struct DeclInfo {
/// Declaration the comment is actually attached to (in the source).
/// Should not be NULL.
const Decl *CommentDecl;
-
+
/// CurrentDecl is the declaration with which the FullComment is associated.
///
/// It can be different from \c CommentDecl. It happens when we decide
@@ -997,7 +997,7 @@ struct DeclInfo {
///
/// The information in the DeclInfo corresponds to CurrentDecl.
const Decl *CurrentDecl;
-
+
/// Parameters that can be referenced by \\param if \c CommentDecl is something
/// that we consider a "function".
ArrayRef<const ParmVarDecl *> ParamVars;
@@ -1119,21 +1119,21 @@ public:
}
child_iterator child_end() const {
- return reinterpret_cast<child_iterator>(Blocks.end());
+ return reinterpret_cast<child_iterator>(Blocks.end());
}
const Decl *getDecl() const LLVM_READONLY {
return ThisDeclInfo->CommentDecl;
}
-
+
const DeclInfo *getDeclInfo() const LLVM_READONLY {
if (!ThisDeclInfo->IsFilled)
ThisDeclInfo->fill();
return ThisDeclInfo;
}
-
+
ArrayRef<BlockContentComment *> getBlocks() const { return Blocks; }
-
+
};
} // end namespace comments
} // end namespace clang
diff --git a/include/clang/AST/CommentCommandTraits.h b/include/clang/AST/CommentCommandTraits.h
index bac4e99dc7a4..4fd007872c01 100644
--- a/include/clang/AST/CommentCommandTraits.h
+++ b/include/clang/AST/CommentCommandTraits.h
@@ -107,17 +107,17 @@ struct CommandInfo {
/// \fn void f(int a);
/// \endcode
unsigned IsDeclarationCommand : 1;
-
+
/// True if verbatim-like line command is a function declaration.
unsigned IsFunctionDeclarationCommand : 1;
/// True if block command is further describing a container API; such
/// as \@coclass, \@classdesign, etc.
unsigned IsRecordLikeDetailCommand : 1;
-
+
/// True if block command is a container API; such as \@interface.
unsigned IsRecordLikeDeclarationCommand : 1;
-
+
/// True if this command is unknown. This \c CommandInfo object was
/// created during parsing.
unsigned IsUnknownCommand : 1;
@@ -150,7 +150,7 @@ public:
}
const CommandInfo *getTypoCorrectCommandInfo(StringRef Typo) const;
-
+
const CommandInfo *getCommandInfo(unsigned CommandID) const;
const CommandInfo *registerUnknownCommand(StringRef CommandName);
diff --git a/include/clang/AST/CommentLexer.h b/include/clang/AST/CommentLexer.h
index 52c4eb9e309a..3ef5b7c8c998 100644
--- a/include/clang/AST/CommentLexer.h
+++ b/include/clang/AST/CommentLexer.h
@@ -76,7 +76,7 @@ class Token {
/// unused (command spelling can be found with CommandTraits). Otherwise,
/// contains the length of the string that starts at TextPtr.
unsigned IntVal;
-
+
public:
SourceLocation getLocation() const LLVM_READONLY { return Loc; }
void setLocation(SourceLocation SL) { Loc = SL; }
@@ -228,7 +228,7 @@ private:
llvm::BumpPtrAllocator &Allocator;
DiagnosticsEngine &Diags;
-
+
const CommandTraits &Traits;
const char *const BufferStart;
diff --git a/include/clang/AST/CommentSema.h b/include/clang/AST/CommentSema.h
index 0e94c33970ca..632eba782b92 100644
--- a/include/clang/AST/CommentSema.h
+++ b/include/clang/AST/CommentSema.h
@@ -191,11 +191,11 @@ public:
void checkBlockCommandDuplicate(const BlockCommandComment *Command);
void checkDeprecatedCommand(const BlockCommandComment *Comment);
-
+
void checkFunctionDeclVerbatimLine(const BlockCommandComment *Comment);
-
+
void checkContainerDeclVerbatimLine(const BlockCommandComment *Comment);
-
+
void checkContainerDecl(const BlockCommandComment *Comment);
/// Resolve parameter names to parameter indexes in function declaration.
diff --git a/include/clang/AST/Decl.h b/include/clang/AST/Decl.h
index dde94599636f..ebdb2890daf5 100644
--- a/include/clang/AST/Decl.h
+++ b/include/clang/AST/Decl.h
@@ -98,7 +98,7 @@ public:
/// Return the TypeLoc wrapper for the type source info.
TypeLoc getTypeLoc() const; // implemented in TypeLoc.h
-
+
/// Override the type stored in this TypeSourceInfo. Use with caution!
void overrideType(QualType T) { Ty = T; }
};
@@ -488,7 +488,7 @@ public:
SourceLocation IdentL, IdentifierInfo *II,
SourceLocation GnuLabelL);
static LabelDecl *CreateDeserialized(ASTContext &C, unsigned ID);
-
+
LabelStmt *getStmt() const { return TheStmt; }
void setStmt(LabelStmt *T) { TheStmt = T; }
@@ -511,8 +511,8 @@ public:
};
/// Represent a C++ namespace.
-class NamespaceDecl : public NamedDecl, public DeclContext,
- public Redeclarable<NamespaceDecl>
+class NamespaceDecl : public NamedDecl, public DeclContext,
+ public Redeclarable<NamespaceDecl>
{
/// The starting location of the source range, pointing
/// to either the namespace or the inline keyword.
@@ -523,7 +523,7 @@ class NamespaceDecl : public NamedDecl, public DeclContext,
/// A pointer to either the anonymous namespace that lives just inside
/// this namespace or to the first namespace in the chain (the latter case
- /// only when this is not the first in the chain), along with a
+ /// only when this is not the first in the chain), along with a
/// boolean value indicating whether this is an inline namespace.
llvm::PointerIntPair<NamespaceDecl *, 1, bool> AnonOrFirstNamespaceAndInline;
@@ -1931,7 +1931,7 @@ public:
bool isConstexprSpecified = false);
static FunctionDecl *CreateDeserialized(ASTContext &C, unsigned ID);
-
+
DeclarationNameInfo getNameInfo() const {
return DeclarationNameInfo(getDeclName(), getLocation(), DNLoc);
}
@@ -2598,7 +2598,7 @@ public:
InClassInitStyle InitStyle);
static FieldDecl *CreateDeserialized(ASTContext &C, unsigned ID);
-
+
/// Returns the index of this field within its record,
/// as appropriate for passing to ASTRecordLayout::getFieldOffset.
unsigned getFieldIndex() const;
@@ -2754,7 +2754,7 @@ public:
QualType T, Expr *E,
const llvm::APSInt &V);
static EnumConstantDecl *CreateDeserialized(ASTContext &C, unsigned ID);
-
+
const Expr *getInitExpr() const { return (const Expr*) Init; }
Expr *getInitExpr() { return (Expr*) Init; }
const llvm::APSInt &getInitVal() const { return Val; }
@@ -3812,7 +3812,7 @@ public:
/// Finds the first data member which has a name.
/// nullptr is returned if no named data member exists.
- const FieldDecl *findFirstNamedDataMember() const;
+ const FieldDecl *findFirstNamedDataMember() const;
private:
/// Deserialize just the fields.
@@ -3835,7 +3835,7 @@ public:
SourceLocation RParenLoc);
static FileScopeAsmDecl *CreateDeserialized(ASTContext &C, unsigned ID);
-
+
SourceLocation getAsmLoc() const { return getLocation(); }
SourceLocation getRParenLoc() const { return RParenLoc; }
void setRParenLoc(SourceLocation L) { RParenLoc = L; }
@@ -3927,9 +3927,9 @@ protected:
IsConversionFromLambda(false), DoesNotEscape(false) {}
public:
- static BlockDecl *Create(ASTContext &C, DeclContext *DC, SourceLocation L);
+ static BlockDecl *Create(ASTContext &C, DeclContext *DC, SourceLocation L);
static BlockDecl *CreateDeserialized(ASTContext &C, unsigned ID);
-
+
SourceLocation getCaretLocation() const { return getLocation(); }
bool isVariadic() const { return IsVariadic; }
@@ -4009,7 +4009,7 @@ public:
}
Decl *getBlockManglingContextDecl() const {
- return ManglingContextDecl;
+ return ManglingContextDecl;
}
void setBlockMangling(unsigned Number, Decl *Ctx) {
@@ -4145,16 +4145,16 @@ class ImportDecl final : public Decl,
/// The imported module, along with a bit that indicates whether
/// we have source-location information for each identifier in the module
- /// name.
+ /// name.
///
/// When the bit is false, we only have a single source location for the
/// end of the import declaration.
llvm::PointerIntPair<Module *, 1, bool> ImportedAndComplete;
-
+
/// The next import in the list of imports local to the translation
/// unit being parsed (not loaded from an AST file).
ImportDecl *NextLocalImport = nullptr;
-
+
ImportDecl(DeclContext *DC, SourceLocation StartLoc, Module *Imported,
ArrayRef<SourceLocation> IdentifierLocs);
@@ -4162,26 +4162,26 @@ class ImportDecl final : public Decl,
SourceLocation EndLoc);
ImportDecl(EmptyShell Empty) : Decl(Import, Empty) {}
-
+
public:
/// Create a new module import declaration.
- static ImportDecl *Create(ASTContext &C, DeclContext *DC,
+ static ImportDecl *Create(ASTContext &C, DeclContext *DC,
SourceLocation StartLoc, Module *Imported,
ArrayRef<SourceLocation> IdentifierLocs);
-
+
/// Create a new module import declaration for an implicitly-generated
/// import.
- static ImportDecl *CreateImplicit(ASTContext &C, DeclContext *DC,
- SourceLocation StartLoc, Module *Imported,
+ static ImportDecl *CreateImplicit(ASTContext &C, DeclContext *DC,
+ SourceLocation StartLoc, Module *Imported,
SourceLocation EndLoc);
-
+
/// Create a new, deserialized module import declaration.
- static ImportDecl *CreateDeserialized(ASTContext &C, unsigned ID,
+ static ImportDecl *CreateDeserialized(ASTContext &C, unsigned ID,
unsigned NumLocations);
-
+
/// Retrieve the module that was imported by the import declaration.
Module *getImportedModule() const { return ImportedAndComplete.getPointer(); }
-
+
/// Retrieves the locations of each of the identifiers that make up
/// the complete module name in the import declaration.
///
@@ -4218,7 +4218,7 @@ public:
static ExportDecl *Create(ASTContext &C, DeclContext *DC,
SourceLocation ExportLoc);
static ExportDecl *CreateDeserialized(ASTContext &C, unsigned ID);
-
+
SourceLocation getExportLoc() const { return getLocation(); }
SourceLocation getRBraceLoc() const { return RBraceLoc; }
void setRBraceLoc(SourceLocation L) { RBraceLoc = L; }
diff --git a/include/clang/AST/DeclBase.h b/include/clang/AST/DeclBase.h
index f99bd627877c..d6b89d971d94 100644
--- a/include/clang/AST/DeclBase.h
+++ b/include/clang/AST/DeclBase.h
@@ -302,7 +302,7 @@ private:
/// global variable, etc.) that is lexically inside an objc container
/// definition.
unsigned TopLevelDeclInObjCContainer : 1;
-
+
/// Whether statistic collection is enabled.
static bool StatisticsEnabled;
@@ -629,7 +629,7 @@ protected:
assert(isFromASTFile() && "Only works on a deserialized declaration");
*((unsigned*)this - 2) = ID;
}
-
+
public:
/// Determine the availability of the given declaration.
///
@@ -879,7 +879,7 @@ public:
/// Whether this particular Decl is a canonical one.
bool isCanonicalDecl() const { return getCanonicalDecl() == this; }
-
+
protected:
/// Returns the next redeclaration or itself if this is the only decl.
///
@@ -956,10 +956,10 @@ public:
/// Retrieve the previous declaration that declares the same entity
/// as this declaration, or NULL if there is no previous declaration.
Decl *getPreviousDecl() { return getPreviousDeclImpl(); }
-
+
/// Retrieve the most recent declaration that declares the same entity
/// as this declaration, or NULL if there is no previous declaration.
- const Decl *getPreviousDecl() const {
+ const Decl *getPreviousDecl() const {
return const_cast<Decl *>(this)->getPreviousDeclImpl();
}
@@ -974,7 +974,7 @@ public:
/// Retrieve the most recent declaration that declares the same entity
/// as this declaration (which may be this declaration).
- const Decl *getMostRecentDecl() const {
+ const Decl *getMostRecentDecl() const {
return const_cast<Decl *>(this)->getMostRecentDeclImpl();
}
@@ -1159,13 +1159,13 @@ protected:
inline bool declaresSameEntity(const Decl *D1, const Decl *D2) {
if (!D1 || !D2)
return false;
-
+
if (D1 == D2)
return true;
-
+
return D1->getCanonicalDecl() == D2->getCanonicalDecl();
}
-
+
/// PrettyStackTraceDecl - If a crash occurs, indicate that it happened when
/// doing something to a specific decl.
class PrettyStackTraceDecl : public llvm::PrettyStackTraceEntry {
@@ -1517,7 +1517,7 @@ public:
/// connected to this declaration context.
///
/// For declaration contexts that have multiple semantically connected but
- /// syntactically distinct contexts, such as C++ namespaces, this routine
+ /// syntactically distinct contexts, such as C++ namespaces, this routine
/// retrieves the complete set of such declaration contexts in source order.
/// For example, given:
///
@@ -1921,7 +1921,7 @@ public:
/// Determine whether the given declaration is stored in the list of
/// declarations lexically within this context.
bool isDeclInLexicalTraversal(const Decl *D) const {
- return D && (D->NextInContextAndBits.getPointer() || D == FirstDecl ||
+ return D && (D->NextInContextAndBits.getPointer() || D == FirstDecl ||
D == LastDecl);
}
diff --git a/include/clang/AST/DeclCXX.h b/include/clang/AST/DeclCXX.h
index 1d0489912c6b..4353f66a34e4 100644
--- a/include/clang/AST/DeclCXX.h
+++ b/include/clang/AST/DeclCXX.h
@@ -264,7 +264,7 @@ public:
return EllipsisLoc;
}
- /// Returns the access specifier for this base specifier.
+ /// Returns the access specifier for this base specifier.
///
/// This is the actual base specifier as used for semantic analysis, so
/// the result can never be AS_none. To retrieve the access specifier as
@@ -564,7 +564,7 @@ class CXXRecordDecl : public RecordDecl {
CXXRecordDecl *Definition;
/// The first friend declaration in this class, or null if there
- /// aren't any.
+ /// aren't any.
///
/// This is actually currently stored in reverse order.
LazyDeclPtr FirstFriend;
@@ -606,14 +606,14 @@ class CXXRecordDecl : public RecordDecl {
/// Whether this lambda is known to be dependent, even if its
/// context isn't dependent.
- ///
+ ///
/// A lambda with a non-dependent context can be dependent if it occurs
/// within the default argument of a function template, because the
/// lambda will have been created with the enclosing context as its
/// declaration context, rather than function. This is an unfortunate
- /// artifact of having to parse the default arguments before.
+ /// artifact of having to parse the default arguments before.
unsigned Dependent : 1;
-
+
/// Whether this lambda is a generic lambda.
unsigned IsGenericLambda : 1;
@@ -626,28 +626,28 @@ class CXXRecordDecl : public RecordDecl {
/// The number of explicit captures in this lambda.
unsigned NumExplicitCaptures : 13;
- /// The number used to indicate this lambda expression for name
+ /// The number used to indicate this lambda expression for name
/// mangling in the Itanium C++ ABI.
unsigned ManglingNumber = 0;
-
+
/// The declaration that provides context for this lambda, if the
/// actual DeclContext does not suffice. This is used for lambdas that
/// occur within default arguments of function parameters within the class
/// or within a data member initializer.
LazyDeclPtr ContextDecl;
-
- /// The list of captures, both explicit and implicit, for this
+
+ /// The list of captures, both explicit and implicit, for this
/// lambda.
Capture *Captures = nullptr;
/// The type of the call method.
TypeSourceInfo *MethodTyInfo;
- LambdaDefinitionData(CXXRecordDecl *D, TypeSourceInfo *Info,
- bool Dependent, bool IsGeneric,
- LambdaCaptureDefault CaptureDefault)
- : DefinitionData(D), Dependent(Dependent), IsGenericLambda(IsGeneric),
- CaptureDefault(CaptureDefault), NumCaptures(0), NumExplicitCaptures(0),
+ LambdaDefinitionData(CXXRecordDecl *D, TypeSourceInfo *Info,
+ bool Dependent, bool IsGeneric,
+ LambdaCaptureDefault CaptureDefault)
+ : DefinitionData(D), Dependent(Dependent), IsGenericLambda(IsGeneric),
+ CaptureDefault(CaptureDefault), NumCaptures(0), NumExplicitCaptures(0),
MethodTyInfo(Info) {
IsLambda = true;
@@ -1205,22 +1205,22 @@ public:
return DD && DD->IsLambda;
}
- /// Determine whether this class describes a generic
+ /// Determine whether this class describes a generic
/// lambda function object (i.e. function call operator is
- /// a template).
- bool isGenericLambda() const;
+ /// a template).
+ bool isGenericLambda() const;
/// Retrieve the lambda call operator of the closure type
/// if this is a closure type.
- CXXMethodDecl *getLambdaCallOperator() const;
+ CXXMethodDecl *getLambdaCallOperator() const;
/// Retrieve the lambda static invoker, the address of which
/// is returned by the conversion operator, and the body of which
- /// is forwarded to the lambda call operator.
- CXXMethodDecl *getLambdaStaticInvoker() const;
+ /// is forwarded to the lambda call operator.
+ CXXMethodDecl *getLambdaStaticInvoker() const;
/// Retrieve the generic lambda's template parameter list.
- /// Returns null if the class does not represent a lambda or a generic
+ /// Returns null if the class does not represent a lambda or a generic
/// lambda.
TemplateParameterList *getGenericLambdaTemplateParameterList() const;
@@ -1345,11 +1345,11 @@ public:
/// not overridden.
bool isAbstract() const { return data().Abstract; }
- /// Determine whether this class is standard-layout per
+ /// Determine whether this class is standard-layout per
/// C++ [class]p7.
bool isStandardLayout() const { return data().IsStandardLayout; }
- /// Determine whether this class was standard-layout per
+ /// Determine whether this class was standard-layout per
/// C++11 [class]p7, specifically using the C++11 rules without any DRs.
bool isCXX11StandardLayout() const { return data().IsCXX11StandardLayout; }
@@ -1900,25 +1900,25 @@ public:
/// If this is the closure type of a lambda expression, retrieve the
/// number to be used for name mangling in the Itanium C++ ABI.
///
- /// Zero indicates that this closure type has internal linkage, so the
+ /// Zero indicates that this closure type has internal linkage, so the
/// mangling number does not matter, while a non-zero value indicates which
/// lambda expression this is in this particular context.
unsigned getLambdaManglingNumber() const {
assert(isLambda() && "Not a lambda closure type!");
return getLambdaData().ManglingNumber;
}
-
- /// Retrieve the declaration that provides additional context for a
+
+ /// Retrieve the declaration that provides additional context for a
/// lambda, when the normal declaration context is not specific enough.
///
- /// Certain contexts (default arguments of in-class function parameters and
+ /// Certain contexts (default arguments of in-class function parameters and
/// the initializers of data members) have separate name mangling rules for
/// lambdas within the Itanium C++ ABI. For these cases, this routine provides
- /// the declaration in which the lambda occurs, e.g., the function parameter
+ /// the declaration in which the lambda occurs, e.g., the function parameter
/// or the non-static data member. Otherwise, it returns NULL to imply that
/// the declaration context suffices.
Decl *getLambdaContextDecl() const;
-
+
/// Set the mangling number and context declaration for a lambda
/// class.
void setLambdaMangling(unsigned ManglingNumber, Decl *ContextDecl) {
@@ -2799,7 +2799,7 @@ public:
/// Determine whether this conversion function is a conversion from
/// a lambda closure type to a block pointer.
bool isLambdaToBlockPointerConversion() const;
-
+
CXXConversionDecl *getCanonicalDecl() override {
return cast<CXXConversionDecl>(FunctionDecl::getCanonicalDecl());
}
@@ -2812,7 +2812,7 @@ public:
static bool classofKind(Kind K) { return K == CXXConversion; }
};
-/// Represents a linkage specification.
+/// Represents a linkage specification.
///
/// For example:
/// \code
@@ -2862,7 +2862,7 @@ public:
SourceLocation LangLoc, LanguageIDs Lang,
bool HasBraces);
static LinkageSpecDecl *CreateDeserialized(ASTContext &C, unsigned ID);
-
+
/// Return the language specified by this linkage specification.
LanguageIDs getLanguage() const { return LanguageIDs(Language); }
@@ -3770,7 +3770,7 @@ public:
Expr *AssertExpr, StringLiteral *Message,
SourceLocation RParenLoc, bool Failed);
static StaticAssertDecl *CreateDeserialized(ASTContext &C, unsigned ID);
-
+
Expr *getAssertExpr() { return AssertExprAndFailed.getPointer(); }
const Expr *getAssertExpr() const { return AssertExprAndFailed.getPointer(); }
diff --git a/include/clang/AST/DeclFriend.h b/include/clang/AST/DeclFriend.h
index 47fb68bf42d3..a8de8ed16840 100644
--- a/include/clang/AST/DeclFriend.h
+++ b/include/clang/AST/DeclFriend.h
@@ -254,7 +254,7 @@ inline void CXXRecordDecl::pushFriendDecl(FriendDecl *FD) {
FD->NextFriend = data().FirstFriend;
data().FirstFriend = FD;
}
-
+
} // namespace clang
#endif // LLVM_CLANG_AST_DECLFRIEND_H
diff --git a/include/clang/AST/DeclLookups.h b/include/clang/AST/DeclLookups.h
index 64eb3f24b370..9627f440d406 100644
--- a/include/clang/AST/DeclLookups.h
+++ b/include/clang/AST/DeclLookups.h
@@ -54,7 +54,7 @@ public:
++It;
} while (It != End &&
It->first == DeclarationName::getUsingDirectiveName());
-
+
return *this;
}
diff --git a/include/clang/AST/DeclObjC.h b/include/clang/AST/DeclObjC.h
index c81a5f805fc0..c1cc726e3152 100644
--- a/include/clang/AST/DeclObjC.h
+++ b/include/clang/AST/DeclObjC.h
@@ -587,7 +587,7 @@ class ObjCTypeParamDecl : public TypedefNameDecl {
/// explicitly specified.
SourceLocation ColonLoc;
- ObjCTypeParamDecl(ASTContext &ctx, DeclContext *dc,
+ ObjCTypeParamDecl(ASTContext &ctx, DeclContext *dc,
ObjCTypeParamVariance variance, SourceLocation varianceLoc,
unsigned index,
SourceLocation nameLoc, IdentifierInfo *name,
@@ -659,7 +659,7 @@ class ObjCTypeParamList final
unsigned End;
};
- union {
+ union {
/// Location of the left and right angle brackets.
PODSourceRange Brackets;
@@ -1123,7 +1123,7 @@ public:
ObjCPropertyDecl *>;
using ProtocolPropertySet = llvm::SmallDenseSet<const ObjCProtocolDecl *, 8>;
using PropertyDeclOrder = llvm::SmallVector<ObjCPropertyDecl *, 8>;
-
+
/// This routine collects list of properties to be implemented in the class.
/// This includes, class's and its conforming protocols' properties.
/// Note, the superclass's properties are not included in the list.
@@ -1195,15 +1195,15 @@ class ObjCInterfaceDecl : public ObjCContainerDecl
/// TypeForDecl - This indicates the Type object that represents this
/// TypeDecl. It is a cache maintained by ASTContext::getObjCInterfaceType
mutable const Type *TypeForDecl = nullptr;
-
+
struct DefinitionData {
- /// The definition of this class, for quick access from any
+ /// The definition of this class, for quick access from any
/// declaration.
ObjCInterfaceDecl *Definition = nullptr;
-
+
/// When non-null, this is always an ObjCObjectType.
TypeSourceInfo *SuperClassTInfo = nullptr;
-
+
/// Protocols referenced in the \@interface declaration
ObjCProtocolList ReferencedProtocols;
@@ -1247,11 +1247,11 @@ class ObjCInterfaceDecl : public ObjCContainerDecl
/// One of the \c InheritedDesignatedInitializersState enumeratos.
mutable unsigned InheritedDesignatedInitializers : 2;
-
+
/// The location of the last location in this declaration, before
- /// the properties/methods. For example, this will be the '>', '}', or
- /// identifier,
- SourceLocation EndLoc;
+ /// the properties/methods. For example, this will be the '>', '}', or
+ /// identifier,
+ SourceLocation EndLoc;
DefinitionData()
: ExternallyCompleted(false), IvarListMissingImplementation(true),
@@ -1285,7 +1285,7 @@ class ObjCInterfaceDecl : public ObjCContainerDecl
/// Allocate the definition data for this class.
void allocateDefinitionData();
-
+
using redeclarable_base = Redeclarable<ObjCInterfaceDecl>;
ObjCInterfaceDecl *getNextRedeclarationImpl() override {
@@ -1334,7 +1334,7 @@ public:
SourceRange getSourceRange() const override LLVM_READONLY {
if (isThisDeclarationADefinition())
return ObjCContainerDecl::getSourceRange();
-
+
return SourceRange(getAtStartLoc(), getLocation());
}
@@ -1390,7 +1390,7 @@ public:
// FIXME: Should make sure no callers ever do this.
if (!hasDefinition())
return protocol_iterator();
-
+
if (data().ExternallyCompleted)
LoadExternalDefinition();
@@ -1453,7 +1453,7 @@ public:
if (data().ExternallyCompleted)
LoadExternalDefinition();
- return data().AllReferencedProtocols.empty()
+ return data().AllReferencedProtocols.empty()
? protocol_begin()
: data().AllReferencedProtocols.begin();
}
@@ -1462,11 +1462,11 @@ public:
// FIXME: Should make sure no callers ever do this.
if (!hasDefinition())
return all_protocol_iterator();
-
+
if (data().ExternallyCompleted)
LoadExternalDefinition();
- return data().AllReferencedProtocols.empty()
+ return data().AllReferencedProtocols.empty()
? protocol_end()
: data().AllReferencedProtocols.end();
}
@@ -1476,17 +1476,17 @@ public:
ivar_range ivars() const { return ivar_range(ivar_begin(), ivar_end()); }
- ivar_iterator ivar_begin() const {
+ ivar_iterator ivar_begin() const {
if (const ObjCInterfaceDecl *Def = getDefinition())
- return ivar_iterator(Def->decls_begin());
-
+ return ivar_iterator(Def->decls_begin());
+
// FIXME: Should make sure no callers ever do this.
return ivar_iterator();
}
- ivar_iterator ivar_end() const {
+ ivar_iterator ivar_end() const {
if (const ObjCInterfaceDecl *Def = getDefinition())
- return ivar_iterator(Def->decls_end());
+ return ivar_iterator(Def->decls_end());
// FIXME: Should make sure no callers ever do this.
return ivar_iterator();
@@ -1546,10 +1546,10 @@ public:
/// Determine whether this particular declaration of this class is
/// actually also a definition.
- bool isThisDeclarationADefinition() const {
+ bool isThisDeclarationADefinition() const {
return getDefinition() == this;
}
-
+
/// Determine whether this class has been defined.
bool hasDefinition() const {
// If the name of this class is out-of-date, bring it up-to-date, which
@@ -1561,16 +1561,16 @@ public:
return Data.getPointer();
}
-
- /// Retrieve the definition of this class, or NULL if this class
- /// has been forward-declared (with \@class) but not yet defined (with
+
+ /// Retrieve the definition of this class, or NULL if this class
+ /// has been forward-declared (with \@class) but not yet defined (with
/// \@interface).
ObjCInterfaceDecl *getDefinition() {
return hasDefinition()? Data.getPointer()->Definition : nullptr;
}
- /// Retrieve the definition of this class, or NULL if this class
- /// has been forward-declared (with \@class) but not yet defined (with
+ /// Retrieve the definition of this class, or NULL if this class
+ /// has been forward-declared (with \@class) but not yet defined (with
/// \@interface).
const ObjCInterfaceDecl *getDefinition() const {
return hasDefinition()? Data.getPointer()->Definition : nullptr;
@@ -1579,7 +1579,7 @@ public:
/// Starts the definition of this Objective-C class, taking it from
/// a forward declaration (\@class) to a definition (\@interface).
void startDefinition();
-
+
/// Retrieve the superclass type.
const ObjCObjectType *getSuperClassType() const {
if (TypeSourceInfo *TInfo = getSuperClassTInfo())
@@ -1593,7 +1593,7 @@ public:
// FIXME: Should make sure no callers ever do this.
if (!hasDefinition())
return nullptr;
-
+
if (data().ExternallyCompleted)
LoadExternalDefinition();
@@ -1604,7 +1604,7 @@ public:
// does not include any type arguments that apply to the superclass.
ObjCInterfaceDecl *getSuperClass() const;
- void setSuperClass(TypeSourceInfo *superClass) {
+ void setSuperClass(TypeSourceInfo *superClass) {
data().SuperClassTInfo = superClass;
}
@@ -1618,7 +1618,7 @@ public:
ObjCCategoryDecl *Current = nullptr;
void findAcceptableCategory();
-
+
public:
using value_type = ObjCCategoryDecl *;
using reference = value_type;
@@ -1659,7 +1659,7 @@ private:
///
/// Used in the \c visible_categories_iterator.
static bool isVisibleCategory(ObjCCategoryDecl *Cat);
-
+
public:
/// Iterator that walks over the list of categories and extensions
/// that are visible, i.e., not hidden in a non-imported submodule.
@@ -1765,7 +1765,7 @@ private:
///
/// Used in the \c known_extensions_iterator.
static bool isKnownExtension(ObjCCategoryDecl *Cat);
-
+
public:
friend class ASTDeclReader;
friend class ASTDeclWriter;
@@ -1787,7 +1787,7 @@ public:
known_extensions_iterator known_extensions_begin() const {
return known_extensions_iterator(getCategoryListRaw());
}
-
+
/// Retrieve an iterator to the end of the known-extensions list.
known_extensions_iterator known_extensions_end() const {
return known_extensions_iterator();
@@ -1804,7 +1804,7 @@ public:
// FIXME: Should make sure no callers ever do this.
if (!hasDefinition())
return nullptr;
-
+
if (data().ExternallyCompleted)
LoadExternalDefinition();
@@ -1831,7 +1831,7 @@ public:
while (I != nullptr) {
if (declaresSameEntity(this, I))
return true;
-
+
I = I->getSuperClass();
}
return false;
@@ -1841,7 +1841,7 @@ public:
/// to be incompatible with __weak references. Returns true if it is.
bool isArcWeakrefUnavailable() const;
- /// isObjCRequiresPropertyDefs - Checks that a class or one of its super
+ /// isObjCRequiresPropertyDefs - Checks that a class or one of its super
/// classes must not be auto-synthesized. Returns class decl. if it must not
/// be; 0, otherwise.
const ObjCInterfaceDecl *isObjCRequiresPropertyDefs() const;
@@ -1854,7 +1854,7 @@ public:
}
ObjCProtocolDecl *lookupNestedProtocol(IdentifierInfo *Name);
-
+
// Lookup a method. First, we search locally. If a method isn't
// found, we search referenced protocols and class categories.
ObjCMethodDecl *lookupMethod(Selector Sel, bool isInstance,
@@ -1893,14 +1893,14 @@ public:
true /* followsSuper */,
Cat);
}
-
- SourceLocation getEndOfDefinitionLoc() const {
+
+ SourceLocation getEndOfDefinitionLoc() const {
if (!hasDefinition())
return getLocation();
-
- return data().EndLoc;
+
+ return data().EndLoc;
}
-
+
void setEndOfDefinitionLoc(SourceLocation LE) { data().EndLoc = LE; }
/// Retrieve the starting location of the superclass.
@@ -1909,7 +1909,7 @@ public:
/// isImplicitInterfaceDecl - check that this is an implicitly declared
/// ObjCInterfaceDecl node. This is for legacy objective-c \@implementation
/// declaration without an \@interface declaration.
- bool isImplicitInterfaceDecl() const {
+ bool isImplicitInterfaceDecl() const {
return hasDefinition() ? data().Definition->isImplicit() : isImplicit();
}
@@ -1987,7 +1987,7 @@ public:
bool synthesized=false);
static ObjCIvarDecl *CreateDeserialized(ASTContext &C, unsigned ID);
-
+
/// Return the class interface that this ivar is logically contained
/// in; this is either the interface where the ivar was declared, or the
/// interface the ivar is conceptually a part of in the case of synthesized
@@ -2045,7 +2045,7 @@ public:
QualType T, Expr *BW);
static ObjCAtDefsFieldDecl *CreateDeserialized(ASTContext &C, unsigned ID);
-
+
// Implement isa/cast/dyncast/etc.
static bool classof(const Decl *D) { return classofKind(D->getKind()); }
static bool classofKind(Kind K) { return K == ObjCAtDefsField; }
@@ -2087,7 +2087,7 @@ class ObjCProtocolDecl : public ObjCContainerDecl,
ObjCProtocolDecl *Definition;
/// Referenced protocols
- ObjCProtocolList ReferencedProtocols;
+ ObjCProtocolList ReferencedProtocols;
};
/// Contains a pointer to the data associated with this class,
@@ -2107,7 +2107,7 @@ class ObjCProtocolDecl : public ObjCContainerDecl,
assert(Data.getPointer() && "Objective-C protocol has no definition!");
return *Data.getPointer();
}
-
+
void allocateDefinitionData();
using redeclarable_base = Redeclarable<ObjCProtocolDecl>;
@@ -2152,15 +2152,15 @@ public:
protocol_iterator protocol_begin() const {
if (!hasDefinition())
return protocol_iterator();
-
+
return data().ReferencedProtocols.begin();
}
- protocol_iterator protocol_end() const {
+ protocol_iterator protocol_end() const {
if (!hasDefinition())
return protocol_iterator();
-
- return data().ReferencedProtocols.end();
+
+ return data().ReferencedProtocols.end();
}
using protocol_loc_iterator = ObjCProtocolList::loc_iterator;
@@ -2173,22 +2173,22 @@ public:
protocol_loc_iterator protocol_loc_begin() const {
if (!hasDefinition())
return protocol_loc_iterator();
-
+
return data().ReferencedProtocols.loc_begin();
}
protocol_loc_iterator protocol_loc_end() const {
if (!hasDefinition())
return protocol_loc_iterator();
-
+
return data().ReferencedProtocols.loc_end();
}
- unsigned protocol_size() const {
+ unsigned protocol_size() const {
if (!hasDefinition())
return 0;
-
- return data().ReferencedProtocols.size();
+
+ return data().ReferencedProtocols.size();
}
/// setProtocolList - Set the list of protocols that this interface
@@ -2235,12 +2235,12 @@ public:
return hasDefinition()? Data.getPointer()->Definition : nullptr;
}
- /// Determine whether this particular declaration is also the
+ /// Determine whether this particular declaration is also the
/// definition.
bool isThisDeclarationADefinition() const {
return getDefinition() == this;
}
-
+
/// Starts the definition of this Objective-C protocol.
void startDefinition();
@@ -2251,10 +2251,10 @@ public:
SourceRange getSourceRange() const override LLVM_READONLY {
if (isThisDeclarationADefinition())
return ObjCContainerDecl::getSourceRange();
-
+
return SourceRange(getAtStartLoc(), getLocation());
}
-
+
using redecl_range = redeclarable_base::redecl_range;
using redecl_iterator = redeclarable_base::redecl_iterator;
@@ -2316,7 +2316,7 @@ class ObjCCategoryDecl : public ObjCContainerDecl {
/// class extension may have private ivars.
SourceLocation IvarLBraceLoc;
SourceLocation IvarRBraceLoc;
-
+
ObjCCategoryDecl(DeclContext *DC, SourceLocation AtLoc,
SourceLocation ClassNameLoc, SourceLocation CategoryNameLoc,
IdentifierInfo *Id, ObjCInterfaceDecl *IDecl,
@@ -2431,7 +2431,7 @@ public:
SourceLocation getCategoryNameLoc() const { return CategoryNameLoc; }
void setCategoryNameLoc(SourceLocation Loc) { CategoryNameLoc = Loc; }
-
+
void setIvarLBraceLoc(SourceLocation Loc) { IvarLBraceLoc = Loc; }
SourceLocation getIvarLBraceLoc() const { return IvarLBraceLoc; }
void setIvarRBraceLoc(SourceLocation Loc) { IvarRBraceLoc = Loc; }
@@ -2576,7 +2576,7 @@ class ObjCImplementationDecl : public ObjCImplDecl {
/// \@implementation may have private ivars.
SourceLocation IvarLBraceLoc;
SourceLocation IvarRBraceLoc;
-
+
/// Support for ivar initialization.
/// The arguments used to initialize the ivars
LazyCXXCtorInitializersPtr IvarInitializers;
@@ -2594,7 +2594,7 @@ class ObjCImplementationDecl : public ObjCImplDecl {
ObjCInterfaceDecl *superDecl,
SourceLocation nameLoc, SourceLocation atStartLoc,
SourceLocation superLoc = SourceLocation(),
- SourceLocation IvarLBraceLoc=SourceLocation(),
+ SourceLocation IvarLBraceLoc=SourceLocation(),
SourceLocation IvarRBraceLoc=SourceLocation())
: ObjCImplDecl(ObjCImplementation, DC, classInterface,
classInterface ? classInterface->getIdentifier()
@@ -2616,7 +2616,7 @@ public:
SourceLocation nameLoc,
SourceLocation atStartLoc,
SourceLocation superLoc = SourceLocation(),
- SourceLocation IvarLBraceLoc=SourceLocation(),
+ SourceLocation IvarLBraceLoc=SourceLocation(),
SourceLocation IvarRBraceLoc=SourceLocation());
static ObjCImplementationDecl *CreateDeserialized(ASTContext &C, unsigned ID);
@@ -2700,7 +2700,7 @@ public:
std::string getNameAsString() const {
return getName();
}
-
+
/// Produce a name to be used for class's metadata. It comes either via
/// class's objc_runtime_name attribute or class name.
StringRef getObjCRuntimeNameAsString() const;
@@ -2715,7 +2715,7 @@ public:
SourceLocation getIvarLBraceLoc() const { return IvarLBraceLoc; }
void setIvarRBraceLoc(SourceLocation Loc) { IvarRBraceLoc = Loc; }
SourceLocation getIvarRBraceLoc() const { return IvarRBraceLoc; }
-
+
using ivar_iterator = specific_decl_iterator<ObjCIvarDecl>;
using ivar_range = llvm::iterator_range<specific_decl_iterator<ObjCIvarDecl>>;
@@ -2760,9 +2760,9 @@ public:
SourceLocation L, IdentifierInfo *Id,
ObjCInterfaceDecl* aliasedClass);
- static ObjCCompatibleAliasDecl *CreateDeserialized(ASTContext &C,
+ static ObjCCompatibleAliasDecl *CreateDeserialized(ASTContext &C,
unsigned ID);
-
+
const ObjCInterfaceDecl *getClassInterface() const { return AliasedClass; }
ObjCInterfaceDecl *getClassInterface() { return AliasedClass; }
void setClassInterface(ObjCInterfaceDecl *D) { AliasedClass = D; }
diff --git a/include/clang/AST/DeclTemplate.h b/include/clang/AST/DeclTemplate.h
index a2f00ec9ffa2..e0ea7cb8b1b8 100644
--- a/include/clang/AST/DeclTemplate.h
+++ b/include/clang/AST/DeclTemplate.h
@@ -734,8 +734,8 @@ public:
};
/// Declaration of a redeclarable template.
-class RedeclarableTemplateDecl : public TemplateDecl,
- public Redeclarable<RedeclarableTemplateDecl>
+class RedeclarableTemplateDecl : public TemplateDecl,
+ public Redeclarable<RedeclarableTemplateDecl>
{
using redeclarable_base = Redeclarable<RedeclarableTemplateDecl>;
@@ -823,7 +823,7 @@ protected:
/// Pointer to the common data shared by all declarations of this
/// template.
mutable CommonBase *Common = nullptr;
-
+
/// Retrieves the "common" pointer shared by all (re-)declarations of
/// the same template. Calling this routine may implicitly allocate memory
/// for the common pointer.
@@ -888,10 +888,10 @@ public:
}
/// Retrieve the member template from which this template was
- /// instantiated, or nullptr if this template was not instantiated from a
+ /// instantiated, or nullptr if this template was not instantiated from a
/// member template.
///
- /// A template is instantiated from a member template when the member
+ /// A template is instantiated from a member template when the member
/// template itself is part of a class template (or member thereof). For
/// example, given
///
@@ -1178,7 +1178,7 @@ public:
unsigned D, unsigned P,
IdentifierInfo *Id, bool Typename,
bool ParameterPack);
- static TemplateTypeParmDecl *CreateDeserialized(const ASTContext &C,
+ static TemplateTypeParmDecl *CreateDeserialized(const ASTContext &C,
unsigned ID);
/// Whether this template type parameter was declared with
@@ -1312,12 +1312,12 @@ public:
QualType T, TypeSourceInfo *TInfo, ArrayRef<QualType> ExpandedTypes,
ArrayRef<TypeSourceInfo *> ExpandedTInfos);
- static NonTypeTemplateParmDecl *CreateDeserialized(ASTContext &C,
+ static NonTypeTemplateParmDecl *CreateDeserialized(ASTContext &C,
unsigned ID);
- static NonTypeTemplateParmDecl *CreateDeserialized(ASTContext &C,
+ static NonTypeTemplateParmDecl *CreateDeserialized(ASTContext &C,
unsigned ID,
unsigned NumExpandedTypes);
-
+
using TemplateParmPosition::getDepth;
using TemplateParmPosition::setDepth;
using TemplateParmPosition::getPosition;
@@ -1495,7 +1495,7 @@ public:
static TemplateTemplateParmDecl *CreateDeserialized(ASTContext &C,
unsigned ID,
unsigned NumExpansions);
-
+
using TemplateParmPosition::getDepth;
using TemplateParmPosition::setDepth;
using TemplateParmPosition::getPosition;
@@ -2442,7 +2442,7 @@ public:
static ClassScopeFunctionSpecializationDecl *
CreateDeserialized(ASTContext &Context, unsigned ID);
-
+
// Implement isa/cast/dyncast/etc.
static bool classof(const Decl *D) { return classofKind(D->getKind()); }
diff --git a/include/clang/AST/DeclarationName.h b/include/clang/AST/DeclarationName.h
index 9d3dad6bbd9d..856f3ab5720e 100644
--- a/include/clang/AST/DeclarationName.h
+++ b/include/clang/AST/DeclarationName.h
@@ -211,14 +211,14 @@ public:
/// getNameKind - Determine what kind of name this is.
NameKind getNameKind() const;
- /// Determines whether the name itself is dependent, e.g., because it
+ /// Determines whether the name itself is dependent, e.g., because it
/// involves a C++ type that is itself dependent.
///
/// Note that this does not capture all of the notions of "dependent name",
- /// because an identifier can be a dependent name if it is used as the
+ /// because an identifier can be a dependent name if it is used as the
/// callee in a call expression with dependent arguments.
bool isDependentName() const;
-
+
/// getNameAsString - Retrieve the human-readable string for this name.
std::string getAsString() const;
@@ -543,7 +543,7 @@ public:
/// Determine whether this name involves a template parameter.
bool isInstantiationDependent() const;
-
+
/// Determine whether this name contains an unexpanded
/// parameter pack.
bool containsUnexpandedParameterPack() const;
@@ -558,7 +558,7 @@ public:
SourceLocation getBeginLoc() const { return NameLoc; }
/// getEndLoc - Retrieve the location of the last token.
- SourceLocation getEndLoc() const;
+ SourceLocation getEndLoc() const { return getLocEnd(); }
/// getSourceRange - The range of the declaration name.
SourceRange getSourceRange() const LLVM_READONLY {
@@ -570,9 +570,11 @@ public:
}
SourceLocation getLocEnd() const LLVM_READONLY {
- SourceLocation EndLoc = getEndLoc();
+ SourceLocation EndLoc = getEndLocPrivate();
return EndLoc.isValid() ? EndLoc : getLocStart();
}
+private:
+ SourceLocation getEndLocPrivate() const;
};
/// Insertion operator for diagnostics. This allows sending DeclarationName's
diff --git a/include/clang/AST/DependentDiagnostic.h b/include/clang/AST/DependentDiagnostic.h
index a514326c6cb1..c21ef7907b8a 100644
--- a/include/clang/AST/DependentDiagnostic.h
+++ b/include/clang/AST/DependentDiagnostic.h
@@ -101,9 +101,9 @@ private:
friend class DependentStoredDeclsMap;
DependentDiagnostic(const PartialDiagnostic &PDiag,
- PartialDiagnostic::Storage *Storage)
+ PartialDiagnostic::Storage *Storage)
: Diag(PDiag, Storage) {}
-
+
static DependentDiagnostic *Create(ASTContext &Context,
DeclContext *Parent,
const PartialDiagnostic &PDiag);
diff --git a/include/clang/AST/EvaluatedExprVisitor.h b/include/clang/AST/EvaluatedExprVisitor.h
index e00986dbe9c8..1aec5ae842d4 100644
--- a/include/clang/AST/EvaluatedExprVisitor.h
+++ b/include/clang/AST/EvaluatedExprVisitor.h
@@ -21,9 +21,9 @@
#include "clang/AST/StmtVisitor.h"
namespace clang {
-
+
class ASTContext;
-
+
/// Given a potentially-evaluated expression, this visitor visits all
/// of its potentially-evaluated subexpressions, recursively.
template<template <typename> class Ptr, typename ImplClass>
diff --git a/include/clang/AST/Expr.h b/include/clang/AST/Expr.h
index 7585231e62e5..c18fbf05df68 100644
--- a/include/clang/AST/Expr.h
+++ b/include/clang/AST/Expr.h
@@ -884,7 +884,7 @@ public:
: Expr(OpaqueValueExprClass, T, VK, OK,
T->isDependentType() ||
(SourceExpr && SourceExpr->isTypeDependent()),
- T->isDependentType() ||
+ T->isDependentType() ||
(SourceExpr && SourceExpr->isValueDependent()),
T->isInstantiationDependentType() ||
(SourceExpr && SourceExpr->isInstantiationDependent()),
@@ -2787,20 +2787,26 @@ public:
/// representation in the source code (ExplicitCastExpr's derived
/// classes).
class CastExpr : public Expr {
+public:
+ using BasePathSizeTy = unsigned int;
+ static_assert(std::numeric_limits<BasePathSizeTy>::max() >= 16384,
+ "[implimits] Direct and indirect base classes [16384].");
+
private:
Stmt *Op;
bool CastConsistency() const;
+ BasePathSizeTy *BasePathSize();
+
const CXXBaseSpecifier * const *path_buffer() const {
return const_cast<CastExpr*>(this)->path_buffer();
}
CXXBaseSpecifier **path_buffer();
- void setBasePathSize(unsigned basePathSize) {
- CastExprBits.BasePathSize = basePathSize;
- assert(CastExprBits.BasePathSize == basePathSize &&
- "basePathSize doesn't fit in bits of CastExprBits.BasePathSize!");
+ void setBasePathSize(BasePathSizeTy basePathSize) {
+ assert(!path_empty() && basePathSize != 0);
+ *(BasePathSize()) = basePathSize;
}
protected:
@@ -2823,7 +2829,9 @@ protected:
Op(op) {
CastExprBits.Kind = kind;
CastExprBits.PartOfExplicitCast = false;
- setBasePathSize(BasePathSize);
+ CastExprBits.BasePathIsEmpty = BasePathSize == 0;
+ if (!path_empty())
+ setBasePathSize(BasePathSize);
assert(CastConsistency());
}
@@ -2831,7 +2839,9 @@ protected:
CastExpr(StmtClass SC, EmptyShell Empty, unsigned BasePathSize)
: Expr(SC, Empty) {
CastExprBits.PartOfExplicitCast = false;
- setBasePathSize(BasePathSize);
+ CastExprBits.BasePathIsEmpty = BasePathSize == 0;
+ if (!path_empty())
+ setBasePathSize(BasePathSize);
}
public:
@@ -2859,8 +2869,12 @@ public:
typedef CXXBaseSpecifier **path_iterator;
typedef const CXXBaseSpecifier * const *path_const_iterator;
- bool path_empty() const { return CastExprBits.BasePathSize == 0; }
- unsigned path_size() const { return CastExprBits.BasePathSize; }
+ bool path_empty() const { return CastExprBits.BasePathIsEmpty; }
+ unsigned path_size() const {
+ if (path_empty())
+ return 0U;
+ return *(const_cast<CastExpr *>(this)->BasePathSize());
+ }
path_iterator path_begin() { return path_buffer(); }
path_iterator path_end() { return path_buffer() + path_size(); }
path_const_iterator path_begin() const { return path_buffer(); }
@@ -2908,7 +2922,12 @@ public:
/// @endcode
class ImplicitCastExpr final
: public CastExpr,
- private llvm::TrailingObjects<ImplicitCastExpr, CXXBaseSpecifier *> {
+ private llvm::TrailingObjects<ImplicitCastExpr, CastExpr::BasePathSizeTy,
+ CXXBaseSpecifier *> {
+ size_t numTrailingObjects(OverloadToken<CastExpr::BasePathSizeTy>) const {
+ return path_empty() ? 0 : 1;
+ }
+
private:
ImplicitCastExpr(QualType ty, CastKind kind, Expr *op,
unsigned BasePathLength, ExprValueKind VK)
@@ -3013,7 +3032,8 @@ public:
/// (Type)expr. For example: @c (int)f.
class CStyleCastExpr final
: public ExplicitCastExpr,
- private llvm::TrailingObjects<CStyleCastExpr, CXXBaseSpecifier *> {
+ private llvm::TrailingObjects<CStyleCastExpr, CastExpr::BasePathSizeTy,
+ CXXBaseSpecifier *> {
SourceLocation LPLoc; // the location of the left paren
SourceLocation RPLoc; // the location of the right paren
@@ -3027,6 +3047,10 @@ class CStyleCastExpr final
explicit CStyleCastExpr(EmptyShell Shell, unsigned PathSize)
: ExplicitCastExpr(CStyleCastExprClass, Shell, PathSize) { }
+ size_t numTrailingObjects(OverloadToken<CastExpr::BasePathSizeTy>) const {
+ return path_empty() ? 0 : 1;
+ }
+
public:
static CStyleCastExpr *Create(const ASTContext &Context, QualType T,
ExprValueKind VK, CastKind K,
@@ -5341,7 +5365,7 @@ public:
SourceLocation getLocStart() const LLVM_READONLY { return SourceLocation(); }
SourceLocation getLocEnd() const LLVM_READONLY { return SourceLocation(); }
-
+
static bool classof(const Stmt *T) {
return T->getStmtClass() == TypoExprClass;
}
diff --git a/include/clang/AST/ExprCXX.h b/include/clang/AST/ExprCXX.h
index 8206a26b2c4b..7ab8020dec64 100644
--- a/include/clang/AST/ExprCXX.h
+++ b/include/clang/AST/ExprCXX.h
@@ -301,7 +301,8 @@ public:
/// \c static_cast<int>(1.0).
class CXXStaticCastExpr final
: public CXXNamedCastExpr,
- private llvm::TrailingObjects<CXXStaticCastExpr, CXXBaseSpecifier *> {
+ private llvm::TrailingObjects<CXXStaticCastExpr, CastExpr::BasePathSizeTy,
+ CXXBaseSpecifier *> {
CXXStaticCastExpr(QualType ty, ExprValueKind vk, CastKind kind, Expr *op,
unsigned pathSize, TypeSourceInfo *writtenTy,
SourceLocation l, SourceLocation RParenLoc,
@@ -312,6 +313,10 @@ class CXXStaticCastExpr final
explicit CXXStaticCastExpr(EmptyShell Empty, unsigned PathSize)
: CXXNamedCastExpr(CXXStaticCastExprClass, Empty, PathSize) {}
+ size_t numTrailingObjects(OverloadToken<CastExpr::BasePathSizeTy>) const {
+ return path_empty() ? 0 : 1;
+ }
+
public:
friend class CastExpr;
friend TrailingObjects;
@@ -337,7 +342,8 @@ public:
/// check to determine how to perform the type conversion.
class CXXDynamicCastExpr final
: public CXXNamedCastExpr,
- private llvm::TrailingObjects<CXXDynamicCastExpr, CXXBaseSpecifier *> {
+ private llvm::TrailingObjects<
+ CXXDynamicCastExpr, CastExpr::BasePathSizeTy, CXXBaseSpecifier *> {
CXXDynamicCastExpr(QualType ty, ExprValueKind VK, CastKind kind,
Expr *op, unsigned pathSize, TypeSourceInfo *writtenTy,
SourceLocation l, SourceLocation RParenLoc,
@@ -348,6 +354,10 @@ class CXXDynamicCastExpr final
explicit CXXDynamicCastExpr(EmptyShell Empty, unsigned pathSize)
: CXXNamedCastExpr(CXXDynamicCastExprClass, Empty, pathSize) {}
+ size_t numTrailingObjects(OverloadToken<CastExpr::BasePathSizeTy>) const {
+ return path_empty() ? 0 : 1;
+ }
+
public:
friend class CastExpr;
friend TrailingObjects;
@@ -380,6 +390,7 @@ public:
class CXXReinterpretCastExpr final
: public CXXNamedCastExpr,
private llvm::TrailingObjects<CXXReinterpretCastExpr,
+ CastExpr::BasePathSizeTy,
CXXBaseSpecifier *> {
CXXReinterpretCastExpr(QualType ty, ExprValueKind vk, CastKind kind,
Expr *op, unsigned pathSize,
@@ -392,6 +403,10 @@ class CXXReinterpretCastExpr final
CXXReinterpretCastExpr(EmptyShell Empty, unsigned pathSize)
: CXXNamedCastExpr(CXXReinterpretCastExprClass, Empty, pathSize) {}
+ size_t numTrailingObjects(OverloadToken<CastExpr::BasePathSizeTy>) const {
+ return path_empty() ? 0 : 1;
+ }
+
public:
friend class CastExpr;
friend TrailingObjects;
@@ -419,7 +434,8 @@ public:
/// value.
class CXXConstCastExpr final
: public CXXNamedCastExpr,
- private llvm::TrailingObjects<CXXConstCastExpr, CXXBaseSpecifier *> {
+ private llvm::TrailingObjects<CXXConstCastExpr, CastExpr::BasePathSizeTy,
+ CXXBaseSpecifier *> {
CXXConstCastExpr(QualType ty, ExprValueKind VK, Expr *op,
TypeSourceInfo *writtenTy, SourceLocation l,
SourceLocation RParenLoc, SourceRange AngleBrackets)
@@ -429,6 +445,10 @@ class CXXConstCastExpr final
explicit CXXConstCastExpr(EmptyShell Empty)
: CXXNamedCastExpr(CXXConstCastExprClass, Empty, 0) {}
+ size_t numTrailingObjects(OverloadToken<CastExpr::BasePathSizeTy>) const {
+ return path_empty() ? 0 : 1;
+ }
+
public:
friend class CastExpr;
friend TrailingObjects;
@@ -721,7 +741,7 @@ public:
}
};
-/// A member reference to an MSPropertyDecl.
+/// A member reference to an MSPropertyDecl.
///
/// This expression always has pseudo-object type, and therefore it is
/// typically not encountered in a fully-typechecked expression except
@@ -1471,7 +1491,8 @@ public:
/// \endcode
class CXXFunctionalCastExpr final
: public ExplicitCastExpr,
- private llvm::TrailingObjects<CXXFunctionalCastExpr, CXXBaseSpecifier *> {
+ private llvm::TrailingObjects<
+ CXXFunctionalCastExpr, CastExpr::BasePathSizeTy, CXXBaseSpecifier *> {
SourceLocation LParenLoc;
SourceLocation RParenLoc;
@@ -1486,6 +1507,10 @@ class CXXFunctionalCastExpr final
explicit CXXFunctionalCastExpr(EmptyShell Shell, unsigned PathSize)
: ExplicitCastExpr(CXXFunctionalCastExprClass, Shell, PathSize) {}
+ size_t numTrailingObjects(OverloadToken<CastExpr::BasePathSizeTy>) const {
+ return path_empty() ? 0 : 1;
+ }
+
public:
friend class CastExpr;
friend TrailingObjects;
@@ -1591,7 +1616,7 @@ class LambdaExpr final : public Expr,
/// The number of captures.
unsigned NumCaptures : 16;
-
+
/// The default capture kind, which is a value of type
/// LambdaCaptureDefault.
unsigned CaptureDefault : 2;
@@ -1602,10 +1627,10 @@ class LambdaExpr final : public Expr,
/// Whether this lambda had the result type explicitly specified.
unsigned ExplicitResultType : 1;
-
+
/// The location of the closing brace ('}') that completes
/// the lambda.
- ///
+ ///
/// The location of the brace is also available by looking up the
/// function call operator in the lambda class. However, it is
/// stored here to improve the performance of getSourceRange(), and
@@ -1673,7 +1698,7 @@ public:
/// Retrieve this lambda's captures.
capture_range captures() const;
-
+
/// Retrieve an iterator pointing to the first lambda capture.
capture_iterator capture_begin() const;
@@ -1686,7 +1711,7 @@ public:
/// Retrieve this lambda's explicit captures.
capture_range explicit_captures() const;
-
+
/// Retrieve an iterator pointing to the first explicit
/// lambda capture.
capture_iterator explicit_capture_begin() const;
@@ -1754,18 +1779,18 @@ public:
SourceRange getIntroducerRange() const { return IntroducerRange; }
/// Retrieve the class that corresponds to the lambda.
- ///
+ ///
/// This is the "closure type" (C++1y [expr.prim.lambda]), and stores the
/// captures in its fields and provides the various operations permitted
/// on a lambda (copying, calling).
CXXRecordDecl *getLambdaClass() const;
/// Retrieve the function call operator associated with this
- /// lambda expression.
+ /// lambda expression.
CXXMethodDecl *getCallOperator() const;
- /// If this is a generic lambda expression, retrieve the template
- /// parameter list associated with it, or else return null.
+ /// If this is a generic lambda expression, retrieve the template
+ /// parameter list associated with it, or else return null.
TemplateParameterList *getTemplateParameterList() const;
/// Whether this is a generic lambda.
@@ -1784,7 +1809,7 @@ public:
/// Whether this lambda had its result type explicitly specified.
bool hasExplicitResultType() const { return ExplicitResultType; }
-
+
static bool classof(const Stmt *T) {
return T->getStmtClass() == LambdaExprClass;
}
@@ -2129,7 +2154,7 @@ public:
Expr *getArgument() { return cast<Expr>(Argument); }
const Expr *getArgument() const { return cast<Expr>(Argument); }
- /// Retrieve the type being destroyed.
+ /// Retrieve the type being destroyed.
///
/// If the type being destroyed is a dependent type which may or may not
/// be a pointer, return an invalid type.
@@ -2345,13 +2370,13 @@ class TypeTraitExpr final
private llvm::TrailingObjects<TypeTraitExpr, TypeSourceInfo *> {
/// The location of the type trait keyword.
SourceLocation Loc;
-
+
/// The location of the closing parenthesis.
SourceLocation RParenLoc;
-
+
// Note: The TypeSourceInfos for the arguments are allocated after the
// TypeTraitExpr.
-
+
TypeTraitExpr(QualType T, SourceLocation Loc, TypeTrait Kind,
ArrayRef<TypeSourceInfo *> Args,
SourceLocation RParenLoc,
@@ -2377,26 +2402,26 @@ public:
static TypeTraitExpr *CreateDeserialized(const ASTContext &C,
unsigned NumArgs);
-
+
/// Determine which type trait this expression uses.
TypeTrait getTrait() const {
return static_cast<TypeTrait>(TypeTraitExprBits.Kind);
}
- bool getValue() const {
- assert(!isValueDependent());
- return TypeTraitExprBits.Value;
+ bool getValue() const {
+ assert(!isValueDependent());
+ return TypeTraitExprBits.Value;
}
-
+
/// Determine the number of arguments to this type trait.
unsigned getNumArgs() const { return TypeTraitExprBits.NumArgs; }
-
+
/// Retrieve the Ith argument.
TypeSourceInfo *getArg(unsigned I) const {
assert(I < getNumArgs() && "Argument out-of-range");
return getArgs()[I];
}
-
+
/// Retrieve the argument types.
ArrayRef<TypeSourceInfo *> getArgs() const {
return llvm::makeArrayRef(getTrailingObjects<TypeSourceInfo *>(),
@@ -2409,7 +2434,7 @@ public:
static bool classof(const Stmt *T) {
return T->getStmtClass() == TypeTraitExprClass;
}
-
+
// Iterators
child_range children() {
return child_range(child_iterator(), child_iterator());
diff --git a/include/clang/AST/ExprObjC.h b/include/clang/AST/ExprObjC.h
index 5dac0e037da1..bb0402c27080 100644
--- a/include/clang/AST/ExprObjC.h
+++ b/include/clang/AST/ExprObjC.h
@@ -90,16 +90,16 @@ public:
Value(val), Loc(l) {}
explicit ObjCBoolLiteralExpr(EmptyShell Empty)
: Expr(ObjCBoolLiteralExprClass, Empty) {}
-
+
bool getValue() const { return Value; }
void setValue(bool V) { Value = V; }
-
+
SourceLocation getLocStart() const LLVM_READONLY { return Loc; }
SourceLocation getLocEnd() const LLVM_READONLY { return Loc; }
SourceLocation getLocation() const { return Loc; }
void setLocation(SourceLocation L) { Loc = L; }
-
+
// Iterators
child_range children() {
return child_range(child_iterator(), child_iterator());
@@ -124,30 +124,30 @@ public:
ObjCBoxedExpr(Expr *E, QualType T, ObjCMethodDecl *method,
SourceRange R)
- : Expr(ObjCBoxedExprClass, T, VK_RValue, OK_Ordinary,
- E->isTypeDependent(), E->isValueDependent(),
+ : Expr(ObjCBoxedExprClass, T, VK_RValue, OK_Ordinary,
+ E->isTypeDependent(), E->isValueDependent(),
E->isInstantiationDependent(),
- E->containsUnexpandedParameterPack()),
+ E->containsUnexpandedParameterPack()),
SubExpr(E), BoxingMethod(method), Range(R) {}
explicit ObjCBoxedExpr(EmptyShell Empty)
: Expr(ObjCBoxedExprClass, Empty) {}
-
+
Expr *getSubExpr() { return cast<Expr>(SubExpr); }
const Expr *getSubExpr() const { return cast<Expr>(SubExpr); }
-
+
ObjCMethodDecl *getBoxingMethod() const {
- return BoxingMethod;
+ return BoxingMethod;
}
-
+
SourceLocation getAtLoc() const { return Range.getBegin(); }
-
+
SourceLocation getLocStart() const LLVM_READONLY { return Range.getBegin(); }
SourceLocation getLocEnd() const LLVM_READONLY { return Range.getEnd(); }
SourceRange getSourceRange() const LLVM_READONLY {
return Range;
}
-
+
// Iterators
child_range children() { return child_range(&SubExpr, &SubExpr+1); }
@@ -208,7 +208,7 @@ public:
/// getNumElements - Return number of elements of objective-c array literal.
unsigned getNumElements() const { return NumElements; }
-
+
/// getElement - Return the Element at the specified index.
Expr *getElement(unsigned Index) {
assert((Index < NumElements) && "Arg access out of range!");
@@ -218,11 +218,11 @@ public:
assert((Index < NumElements) && "Arg access out of range!");
return getElements()[Index];
}
-
+
ObjCMethodDecl *getArrayWithObjectsMethod() const {
- return ArrayWithObjectsMethod;
+ return ArrayWithObjectsMethod;
}
-
+
// Iterators
child_range children() {
return child_range(reinterpret_cast<Stmt **>(getElements()),
@@ -239,13 +239,13 @@ public:
struct ObjCDictionaryElement {
/// The key for the dictionary element.
Expr *Key;
-
+
/// The value of the dictionary element.
Expr *Value;
-
+
/// The location of the ellipsis, if this is a pack expansion.
SourceLocation EllipsisLoc;
-
+
/// The number of elements this pack expansion will expand to, if
/// this is a pack expansion and is known.
Optional<unsigned> NumExpansions;
@@ -308,7 +308,7 @@ class ObjCDictionaryLiteral final
using KeyValuePair = ObjCDictionaryLiteral_KeyValuePair;
using ExpansionData = ObjCDictionaryLiteral_ExpansionData;
- ObjCDictionaryLiteral(ArrayRef<ObjCDictionaryElement> VK,
+ ObjCDictionaryLiteral(ArrayRef<ObjCDictionaryElement> VK,
bool HasPackExpansions,
QualType T, ObjCMethodDecl *method,
SourceRange SR);
@@ -328,16 +328,16 @@ public:
friend TrailingObjects;
static ObjCDictionaryLiteral *Create(const ASTContext &C,
- ArrayRef<ObjCDictionaryElement> VK,
+ ArrayRef<ObjCDictionaryElement> VK,
bool HasPackExpansions,
QualType T, ObjCMethodDecl *method,
SourceRange SR);
-
+
static ObjCDictionaryLiteral *CreateEmpty(const ASTContext &C,
unsigned NumElements,
bool HasPackExpansions);
-
- /// getNumElements - Return number of elements of objective-c dictionary
+
+ /// getNumElements - Return number of elements of objective-c dictionary
/// literal.
unsigned getNumElements() const { return NumElements; }
@@ -354,7 +354,7 @@ public:
}
return Result;
}
-
+
ObjCMethodDecl *getDictWithObjectsMethod() const {
return DictWithObjectsMethod;
}
@@ -394,7 +394,7 @@ public:
EncodedType->getType()->isDependentType(),
EncodedType->getType()->isDependentType(),
EncodedType->getType()->isInstantiationDependentType(),
- EncodedType->getType()->containsUnexpandedParameterPack()),
+ EncodedType->getType()->containsUnexpandedParameterPack()),
EncodedType(EncodedType), AtLoc(at), RParenLoc(rp) {}
explicit ObjCEncodeExpr(EmptyShell Empty) : Expr(ObjCEncodeExprClass, Empty){}
@@ -408,8 +408,8 @@ public:
TypeSourceInfo *getEncodedTypeSourceInfo() const { return EncodedType; }
- void setEncodedTypeSourceInfo(TypeSourceInfo *EncType) {
- EncodedType = EncType;
+ void setEncodedTypeSourceInfo(TypeSourceInfo *EncType) {
+ EncodedType = EncType;
}
SourceLocation getLocStart() const LLVM_READONLY { return AtLoc; }
@@ -531,9 +531,9 @@ public:
bool arrow = false, bool freeIvar = false)
: Expr(ObjCIvarRefExprClass, t, VK_LValue,
d->isBitField() ? OK_BitField : OK_Ordinary,
- /*TypeDependent=*/false, base->isValueDependent(),
+ /*TypeDependent=*/false, base->isValueDependent(),
base->isInstantiationDependent(),
- base->containsUnexpandedParameterPack()),
+ base->containsUnexpandedParameterPack()),
D(d), Base(base), Loc(l), OpLoc(oploc), IsArrow(arrow),
IsFreeIvar(freeIvar) {}
@@ -560,7 +560,7 @@ public:
return isFreeIvar() ? Loc : getBase()->getLocStart();
}
SourceLocation getLocEnd() const LLVM_READONLY { return Loc; }
-
+
SourceLocation getOpLoc() const { return OpLoc; }
void setOpLoc(SourceLocation L) { OpLoc = L; }
@@ -600,13 +600,13 @@ private:
// transformation is lossy on the first character).
SourceLocation IdLoc;
-
+
/// When the receiver in property access is 'super', this is
/// the location of the 'super' keyword. When it's an interface,
/// this is that interface.
SourceLocation ReceiverLoc;
llvm::PointerUnion3<Stmt *, const Type *, ObjCInterfaceDecl *> Receiver;
-
+
public:
ObjCPropertyRefExpr(ObjCPropertyDecl *PD, QualType t,
ExprValueKind VK, ExprObjectKind OK,
@@ -618,7 +618,7 @@ public:
PropertyOrGetter(PD, false), IdLoc(l), Receiver(base) {
assert(t->isSpecificPlaceholderType(BuiltinType::PseudoObject));
}
-
+
ObjCPropertyRefExpr(ObjCPropertyDecl *PD, QualType t,
ExprValueKind VK, ExprObjectKind OK,
SourceLocation l, SourceLocation sl, QualType st)
@@ -716,19 +716,19 @@ public:
setMethodRefFlag(MethodRef_Setter, val);
}
- const Expr *getBase() const {
- return cast<Expr>(Receiver.get<Stmt*>());
+ const Expr *getBase() const {
+ return cast<Expr>(Receiver.get<Stmt*>());
}
- Expr *getBase() {
- return cast<Expr>(Receiver.get<Stmt*>());
+ Expr *getBase() {
+ return cast<Expr>(Receiver.get<Stmt*>());
}
SourceLocation getLocation() const { return IdLoc; }
-
+
SourceLocation getReceiverLocation() const { return ReceiverLoc; }
- QualType getSuperReceiverType() const {
- return QualType(Receiver.get<const Type*>(), 0);
+ QualType getSuperReceiverType() const {
+ return QualType(Receiver.get<const Type*>(), 0);
}
ObjCInterfaceDecl *getClassReceiver() const {
@@ -796,7 +796,7 @@ private:
SetterAndMethodRefFlags.setInt(f);
}
};
-
+
/// ObjCSubscriptRefExpr - used for array and dictionary subscripting.
/// array[4] = array[3]; dictionary[key] = dictionary[alt_key];
class ObjCSubscriptRefExpr : public Expr {
@@ -808,20 +808,20 @@ class ObjCSubscriptRefExpr : public Expr {
// an objective-c object pointer expression.
enum { BASE, KEY, END_EXPR };
Stmt* SubExprs[END_EXPR];
-
+
ObjCMethodDecl *GetAtIndexMethodDecl;
-
+
// For immutable objects this is null. When ObjCSubscriptRefExpr is to read
// an indexed object this is null too.
ObjCMethodDecl *SetAtIndexMethodDecl;
-
+
public:
ObjCSubscriptRefExpr(Expr *base, Expr *key, QualType T,
ExprValueKind VK, ExprObjectKind OK,
ObjCMethodDecl *getMethod,
ObjCMethodDecl *setMethod, SourceLocation RB)
- : Expr(ObjCSubscriptRefExprClass, T, VK, OK,
- base->isTypeDependent() || key->isTypeDependent(),
+ : Expr(ObjCSubscriptRefExprClass, T, VK, OK,
+ base->isTypeDependent() || key->isTypeDependent(),
base->isValueDependent() || key->isValueDependent(),
(base->isInstantiationDependent() ||
key->isInstantiationDependent()),
@@ -834,7 +834,7 @@ public:
explicit ObjCSubscriptRefExpr(EmptyShell Empty)
: Expr(ObjCSubscriptRefExprClass, Empty) {}
-
+
SourceLocation getRBracket() const { return RBracket; }
void setRBracket(SourceLocation RB) { RBracket = RB; }
@@ -843,25 +843,25 @@ public:
}
SourceLocation getLocEnd() const LLVM_READONLY { return RBracket; }
-
+
Expr *getBaseExpr() const { return cast<Expr>(SubExprs[BASE]); }
void setBaseExpr(Stmt *S) { SubExprs[BASE] = S; }
-
+
Expr *getKeyExpr() const { return cast<Expr>(SubExprs[KEY]); }
void setKeyExpr(Stmt *S) { SubExprs[KEY] = S; }
-
+
ObjCMethodDecl *getAtIndexMethodDecl() const {
return GetAtIndexMethodDecl;
}
-
+
ObjCMethodDecl *setAtIndexMethodDecl() const {
return SetAtIndexMethodDecl;
}
-
+
bool isArraySubscriptRefExpr() const {
return getKeyExpr()->getType()->isIntegralOrEnumerationType();
}
-
+
child_range children() {
return child_range(SubExprs, SubExprs+END_EXPR);
}
@@ -913,7 +913,7 @@ class ObjCMessageExpr final
/// The number of arguments in the message send, not
/// including the receiver.
unsigned NumArgs : NumArgsBitWidth;
-
+
/// The kind of message send this is, which is one of the
/// ReceiverKind values.
///
@@ -958,7 +958,7 @@ class ObjCMessageExpr final
SourceLocation SuperLoc,
bool IsInstanceSuper,
QualType SuperType,
- Selector Sel,
+ Selector Sel,
ArrayRef<SourceLocation> SelLocs,
SelectorLocationsKind SelLocsK,
ObjCMethodDecl *Method,
@@ -968,7 +968,7 @@ class ObjCMessageExpr final
ObjCMessageExpr(QualType T, ExprValueKind VK,
SourceLocation LBracLoc,
TypeSourceInfo *Receiver,
- Selector Sel,
+ Selector Sel,
ArrayRef<SourceLocation> SelLocs,
SelectorLocationsKind SelLocsK,
ObjCMethodDecl *Method,
@@ -978,7 +978,7 @@ class ObjCMessageExpr final
ObjCMessageExpr(QualType T, ExprValueKind VK,
SourceLocation LBracLoc,
Expr *Receiver,
- Selector Sel,
+ Selector Sel,
ArrayRef<SourceLocation> SelLocs,
SelectorLocationsKind SelLocsK,
ObjCMethodDecl *Method,
@@ -1091,7 +1091,7 @@ public:
SourceLocation SuperLoc,
bool IsInstanceSuper,
QualType SuperType,
- Selector Sel,
+ Selector Sel,
ArrayRef<SourceLocation> SelLocs,
ObjCMethodDecl *Method,
ArrayRef<Expr *> Args,
@@ -1125,7 +1125,7 @@ public:
ExprValueKind VK,
SourceLocation LBracLoc,
TypeSourceInfo *Receiver,
- Selector Sel,
+ Selector Sel,
ArrayRef<SourceLocation> SelLocs,
ObjCMethodDecl *Method,
ArrayRef<Expr *> Args,
@@ -1159,7 +1159,7 @@ public:
ExprValueKind VK,
SourceLocation LBracLoc,
Expr *Receiver,
- Selector Sel,
+ Selector Sel,
ArrayRef<SourceLocation> SeLocs,
ObjCMethodDecl *Method,
ArrayRef<Expr *> Args,
@@ -1215,14 +1215,14 @@ public:
/// Turn this message send into an instance message that
/// computes the receiver object with the given expression.
- void setInstanceReceiver(Expr *rec) {
+ void setInstanceReceiver(Expr *rec) {
Kind = Instance;
setReceiverPointer(rec);
}
-
+
/// Returns the type of a class message send, or NULL if the
/// message is not a class message.
- QualType getClassReceiver() const {
+ QualType getClassReceiver() const {
if (TypeSourceInfo *TSInfo = getClassReceiverTypeInfo())
return TSInfo->getType();
@@ -1244,7 +1244,7 @@ public:
/// Retrieve the location of the 'super' keyword for a class
/// or instance message to 'super', otherwise an invalid source location.
- SourceLocation getSuperLoc() const {
+ SourceLocation getSuperLoc() const {
if (getReceiverKind() == SuperInstance || getReceiverKind() == SuperClass)
return SuperLoc;
@@ -1274,7 +1274,7 @@ public:
/// \returns The Objective-C interface if known, otherwise nullptr.
ObjCInterfaceDecl *getReceiverInterface() const;
- /// Retrieve the type referred to by 'super'.
+ /// Retrieve the type referred to by 'super'.
///
/// The returned type will either be an ObjCInterfaceType (for an
/// class message to super) or an ObjCObjectPointerType that refers
@@ -1294,26 +1294,26 @@ public:
Selector getSelector() const;
- void setSelector(Selector S) {
+ void setSelector(Selector S) {
HasMethod = false;
SelectorOrMethod = reinterpret_cast<uintptr_t>(S.getAsOpaquePtr());
}
- const ObjCMethodDecl *getMethodDecl() const {
+ const ObjCMethodDecl *getMethodDecl() const {
if (HasMethod)
return reinterpret_cast<const ObjCMethodDecl *>(SelectorOrMethod);
return nullptr;
}
- ObjCMethodDecl *getMethodDecl() {
+ ObjCMethodDecl *getMethodDecl() {
if (HasMethod)
return reinterpret_cast<ObjCMethodDecl *>(SelectorOrMethod);
return nullptr;
}
- void setMethodDecl(ObjCMethodDecl *MD) {
+ void setMethodDecl(ObjCMethodDecl *MD) {
HasMethod = true;
SelectorOrMethod = reinterpret_cast<uintptr_t>(MD);
}
@@ -1414,16 +1414,16 @@ public:
arg_iterator arg_begin() { return reinterpret_cast<Stmt **>(getArgs()); }
- arg_iterator arg_end() {
- return reinterpret_cast<Stmt **>(getArgs() + NumArgs);
+ arg_iterator arg_end() {
+ return reinterpret_cast<Stmt **>(getArgs() + NumArgs);
}
- const_arg_iterator arg_begin() const {
- return reinterpret_cast<Stmt const * const*>(getArgs());
+ const_arg_iterator arg_begin() const {
+ return reinterpret_cast<Stmt const * const*>(getArgs());
}
- const_arg_iterator arg_end() const {
- return reinterpret_cast<Stmt const * const*>(getArgs() + NumArgs);
+ const_arg_iterator arg_end() const {
+ return reinterpret_cast<Stmt const * const*>(getArgs() + NumArgs);
}
static bool classof(const Stmt *T) {
@@ -1439,7 +1439,7 @@ class ObjCIsaExpr : public Expr {
/// IsaMemberLoc - This is the location of the 'isa'.
SourceLocation IsaMemberLoc;
-
+
/// OpLoc - This is the location of '.' or '->'
SourceLocation OpLoc;
@@ -1468,18 +1468,18 @@ public:
/// location of 'F'.
SourceLocation getIsaMemberLoc() const { return IsaMemberLoc; }
void setIsaMemberLoc(SourceLocation L) { IsaMemberLoc = L; }
-
+
SourceLocation getOpLoc() const { return OpLoc; }
void setOpLoc(SourceLocation L) { OpLoc = L; }
SourceLocation getLocStart() const LLVM_READONLY {
return getBase()->getLocStart();
}
-
+
SourceLocation getBaseLocEnd() const LLVM_READONLY {
return getBase()->getLocEnd();
}
-
+
SourceLocation getLocEnd() const LLVM_READONLY { return IsaMemberLoc; }
SourceLocation getExprLoc() const LLVM_READONLY { return IsaMemberLoc; }
@@ -1546,7 +1546,7 @@ public:
/// copy-restore. If false, the temporary will be zero-initialized.
bool shouldCopy() const { return ObjCIndirectCopyRestoreExprBits.ShouldCopy; }
- child_range children() { return child_range(&Operand, &Operand+1); }
+ child_range children() { return child_range(&Operand, &Operand+1); }
// Source locations are determined by the subexpression.
SourceLocation getLocStart() const LLVM_READONLY {
@@ -1571,7 +1571,8 @@ public:
/// \endcode
class ObjCBridgedCastExpr final
: public ExplicitCastExpr,
- private llvm::TrailingObjects<ObjCBridgedCastExpr, CXXBaseSpecifier *> {
+ private llvm::TrailingObjects<
+ ObjCBridgedCastExpr, CastExpr::BasePathSizeTy, CXXBaseSpecifier *> {
friend class ASTStmtReader;
friend class ASTStmtWriter;
friend class CastExpr;
@@ -1581,6 +1582,10 @@ class ObjCBridgedCastExpr final
SourceLocation BridgeKeywordLoc;
unsigned Kind : 2;
+ size_t numTrailingObjects(OverloadToken<CastExpr::BasePathSizeTy>) const {
+ return path_empty() ? 0 : 1;
+ }
+
public:
ObjCBridgedCastExpr(SourceLocation LParenLoc, ObjCBridgeCastKind Kind,
CastKind CK, SourceLocation BridgeKeywordLoc,
@@ -1588,7 +1593,7 @@ public:
: ExplicitCastExpr(ObjCBridgedCastExprClass, TSInfo->getType(), VK_RValue,
CK, Operand, 0, TSInfo),
LParenLoc(LParenLoc), BridgeKeywordLoc(BridgeKeywordLoc), Kind(Kind) {}
-
+
/// Construct an empty Objective-C bridged cast.
explicit ObjCBridgedCastExpr(EmptyShell Shell)
: ExplicitCastExpr(ObjCBridgedCastExprClass, Shell, 0) {}
@@ -1596,22 +1601,22 @@ public:
SourceLocation getLParenLoc() const { return LParenLoc; }
/// Determine which kind of bridge is being performed via this cast.
- ObjCBridgeCastKind getBridgeKind() const {
- return static_cast<ObjCBridgeCastKind>(Kind);
+ ObjCBridgeCastKind getBridgeKind() const {
+ return static_cast<ObjCBridgeCastKind>(Kind);
}
-
+
/// Retrieve the kind of bridge being performed as a string.
StringRef getBridgeKindName() const;
-
+
/// The location of the bridge keyword.
SourceLocation getBridgeKeywordLoc() const { return BridgeKeywordLoc; }
-
+
SourceLocation getLocStart() const LLVM_READONLY { return LParenLoc; }
SourceLocation getLocEnd() const LLVM_READONLY {
return getSubExpr()->getLocEnd();
}
-
+
static bool classof(const Stmt *T) {
return T->getStmtClass() == ObjCBridgedCastExprClass;
}
diff --git a/include/clang/AST/ExternalASTMerger.h b/include/clang/AST/ExternalASTMerger.h
index ae8a761e127e..7b01fa8cbced 100644
--- a/include/clang/AST/ExternalASTMerger.h
+++ b/include/clang/AST/ExternalASTMerger.h
@@ -37,7 +37,7 @@ namespace clang {
/// lookup. In this case, Origins contains an entry overriding lookup and
/// specifying the correct pair of DeclContext/ASTContext.
///
-/// - The DeclContext of origin was determined by another ExterenalASTMerger.
+/// - The DeclContext of origin was determined by another ExterenalASTMerger.
/// (This is possible when the source ASTContext for one of the Importers has
/// its own ExternalASTMerger). The origin must be properly forwarded in this
/// case.
@@ -57,7 +57,7 @@ public:
typedef std::map<const DeclContext *, DCOrigin> OriginMap;
typedef std::vector<std::unique_ptr<ASTImporter>> ImporterVector;
private:
- /// One importer exists for each source.
+ /// One importer exists for each source.
ImporterVector Importers;
/// Overrides in case name lookup would return nothing or would return
/// the wrong thing.
@@ -106,7 +106,7 @@ public:
/// Remove a set of ASTContexts as possible origins.
///
/// Sometimes an origin goes away (for example, if a source file gets
- /// superseded by a newer version).
+ /// superseded by a newer version).
///
/// The caller is responsible for ensuring that this doesn't leave
/// DeclContexts that can't be completed.
@@ -163,7 +163,7 @@ private:
template <typename CallbackType>
void ForEachMatchingDC(const DeclContext *DC, CallbackType Callback);
-public:
+public:
/// Log something if there is a logging callback installed.
llvm::raw_ostream &logs() { return *LogStream; }
diff --git a/include/clang/AST/ExternalASTSource.h b/include/clang/AST/ExternalASTSource.h
index 82255bb1c44c..525d4c78b362 100644
--- a/include/clang/AST/ExternalASTSource.h
+++ b/include/clang/AST/ExternalASTSource.h
@@ -270,10 +270,10 @@ public:
///
/// The default implementation of this method is a no-op.
virtual void PrintStats();
-
+
/// Perform layout on the given record.
///
- /// This routine allows the external AST source to provide an specific
+ /// This routine allows the external AST source to provide an specific
/// layout for a record, overriding the layout that would normally be
/// constructed. It is intended for clients who receive specific layout
/// details rather than source code (such as LLDB). The client is expected
@@ -290,13 +290,13 @@ public:
/// expressed in bits. All of the fields must be provided with offsets.
///
/// \param BaseOffsets The offset of each of the direct, non-virtual base
- /// classes. If any bases are not given offsets, the bases will be laid
+ /// classes. If any bases are not given offsets, the bases will be laid
/// out according to the ABI.
///
/// \param VirtualBaseOffsets The offset of each of the virtual base classes
- /// (either direct or not). If any bases are not given offsets, the bases will be laid
+ /// (either direct or not). If any bases are not given offsets, the bases will be laid
/// out according to the ABI.
- ///
+ ///
/// \returns true if the record layout was provided, false otherwise.
virtual bool layoutRecordType(
const RecordDecl *Record, uint64_t &Size, uint64_t &Alignment,
@@ -307,15 +307,15 @@ public:
//===--------------------------------------------------------------------===//
// Queries for performance analysis.
//===--------------------------------------------------------------------===//
-
+
struct MemoryBufferSizes {
size_t malloc_bytes;
size_t mmap_bytes;
-
+
MemoryBufferSizes(size_t malloc_bytes, size_t mmap_bytes)
: malloc_bytes(malloc_bytes), mmap_bytes(mmap_bytes) {}
};
-
+
/// Return the amount of memory used by memory buffers, breaking down
/// by heap-backed versus mmap'ed memory.
MemoryBufferSizes getMemoryBufferSizes() const {
@@ -512,10 +512,10 @@ namespace clang {
/// Represents a lazily-loaded vector of data.
///
/// The lazily-loaded vector of data contains data that is partially loaded
-/// from an external source and partially added by local translation. The
+/// from an external source and partially added by local translation. The
/// items loaded from the external source are loaded lazily, when needed for
/// iteration over the complete vector.
-template<typename T, typename Source,
+template<typename T, typename Source,
void (Source::*Loader)(SmallVectorImpl<T>&),
unsigned LoadedStorage = 2, unsigned LocalStorage = 4>
class LazyVector {
@@ -564,20 +564,20 @@ public:
iterator begin(Source *source, bool LocalOnly = false) {
if (LocalOnly)
return iterator(this, 0);
-
+
if (source)
(source->*Loader)(Loaded);
return iterator(this, -(int)Loaded.size());
}
-
+
iterator end() {
return iterator(this, Local.size());
}
-
+
void push_back(const T& LocalValue) {
Local.push_back(LocalValue);
}
-
+
void erase(iterator From, iterator To) {
if (From.isLoaded() && To.isLoaded()) {
Loaded.erase(&*From, &*To);
diff --git a/include/clang/AST/GlobalDecl.h b/include/clang/AST/GlobalDecl.h
index 3b3e4367d56c..7f017994216f 100644
--- a/include/clang/AST/GlobalDecl.h
+++ b/include/clang/AST/GlobalDecl.h
@@ -57,7 +57,7 @@ public:
GlobalDecl CanonGD;
CanonGD.Value.setPointer(Value.getPointer()->getCanonicalDecl());
CanonGD.Value.setInt(Value.getInt());
-
+
return CanonGD;
}
@@ -72,11 +72,11 @@ public:
assert(isa<CXXDestructorDecl>(getDecl()) && "Decl is not a dtor!");
return static_cast<CXXDtorType>(Value.getInt());
}
-
+
friend bool operator==(const GlobalDecl &LHS, const GlobalDecl &RHS) {
return LHS.Value == RHS.Value;
}
-
+
void *getAsOpaquePtr() const { return Value.getOpaqueValue(); }
static GlobalDecl getFromOpaquePtr(void *P) {
@@ -84,7 +84,7 @@ public:
GD.Value.setFromOpaqueValue(P);
return GD;
}
-
+
GlobalDecl getWithDecl(const Decl *D) {
GlobalDecl Result(*this);
Result.Value.setPointer(D);
@@ -100,7 +100,7 @@ namespace llvm {
static inline clang::GlobalDecl getEmptyKey() {
return clang::GlobalDecl();
}
-
+
static inline clang::GlobalDecl getTombstoneKey() {
return clang::GlobalDecl::
getFromOpaquePtr(reinterpret_cast<void*>(-1));
@@ -109,13 +109,13 @@ namespace llvm {
static unsigned getHashValue(clang::GlobalDecl GD) {
return DenseMapInfo<void*>::getHashValue(GD.getAsOpaquePtr());
}
-
- static bool isEqual(clang::GlobalDecl LHS,
+
+ static bool isEqual(clang::GlobalDecl LHS,
clang::GlobalDecl RHS) {
return LHS == RHS;
}
};
-
+
// GlobalDecl isn't *technically* a POD type. However, its copy constructor,
// copy assignment operator, and destructor are all trivial.
template <>
diff --git a/include/clang/AST/LambdaCapture.h b/include/clang/AST/LambdaCapture.h
index bcc5352c1c9d..f246bc423bfb 100644
--- a/include/clang/AST/LambdaCapture.h
+++ b/include/clang/AST/LambdaCapture.h
@@ -41,7 +41,7 @@ class LambdaCapture {
};
// Decl could represent:
- // - a VarDecl* that represents the variable that was captured or the
+ // - a VarDecl* that represents the variable that was captured or the
// init-capture.
// - or, is a nullptr and Capture_This is set in Bits if this represents a
// capture of '*this' by value or reference.
diff --git a/include/clang/AST/Mangle.h b/include/clang/AST/Mangle.h
index 401574b265b0..c42fe91b3246 100644
--- a/include/clang/AST/Mangle.h
+++ b/include/clang/AST/Mangle.h
@@ -73,7 +73,7 @@ public:
DiagnosticsEngine &getDiags() const { return Diags; }
virtual void startNewFunction() { LocalBlockIds.clear(); }
-
+
unsigned getBlockId(const BlockDecl *BD, bool Local) {
llvm::DenseMap<const BlockDecl *, unsigned> &BlockIds
= Local? LocalBlockIds : GlobalBlockIds;
diff --git a/include/clang/AST/NSAPI.h b/include/clang/AST/NSAPI.h
index ee07745b1242..bf2afe38cbca 100644
--- a/include/clang/AST/NSAPI.h
+++ b/include/clang/AST/NSAPI.h
@@ -113,7 +113,7 @@ public:
NSMutableDict_setValueForKey
};
static const unsigned NumNSDictionaryMethods = 13;
-
+
/// The Objective-C NSDictionary selectors.
Selector getNSDictionarySelector(NSDictionaryMethodKind MK) const;
diff --git a/include/clang/AST/NestedNameSpecifier.h b/include/clang/AST/NestedNameSpecifier.h
index 2255d5114350..3a7b45767dac 100644
--- a/include/clang/AST/NestedNameSpecifier.h
+++ b/include/clang/AST/NestedNameSpecifier.h
@@ -44,7 +44,7 @@ class TypeLoc;
/// specifier. Nested name specifiers are made up of a sequence of
/// specifiers, each of which can be a namespace, type, identifier
/// (for dependent names), decltype specifier, or the global specifier ('::').
-/// The last two specifiers can only appear at the start of a
+/// The last two specifiers can only appear at the start of a
/// nested-namespace-specifier.
class NestedNameSpecifier : public llvm::FoldingSetNode {
/// Enumeration describing
@@ -438,7 +438,7 @@ public:
/// Turn this (empty) nested-name-specifier into the global
/// nested-name-specifier '::'.
void MakeGlobal(ASTContext &Context, SourceLocation ColonColonLoc);
-
+
/// Turns this (empty) nested-name-specifier into '__super'
/// nested-name-specifier.
///
@@ -452,7 +452,7 @@ public:
/// name.
///
/// \param ColonColonLoc The location of the trailing '::'.
- void MakeSuper(ASTContext &Context, CXXRecordDecl *RD,
+ void MakeSuper(ASTContext &Context, CXXRecordDecl *RD,
SourceLocation SuperLoc, SourceLocation ColonColonLoc);
/// Make a new nested-name-specifier from incomplete source-location
diff --git a/include/clang/AST/OperationKinds.def b/include/clang/AST/OperationKinds.def
index 823e32424f1e..e2d65d84880c 100644
--- a/include/clang/AST/OperationKinds.def
+++ b/include/clang/AST/OperationKinds.def
@@ -307,7 +307,7 @@ CAST_OPERATION(AtomicToNonAtomic)
/// Converts from T to _Atomic(T).
CAST_OPERATION(NonAtomicToAtomic)
-/// Causes a block literal to by copied to the heap and then
+/// Causes a block literal to by copied to the heap and then
/// autoreleased.
///
/// This particular cast kind is used for the conversion from a C++11
@@ -391,13 +391,13 @@ BINARY_OPERATION(Comma, ",")
// [C99 6.5.2.4] Postfix increment and decrement
UNARY_OPERATION(PostInc, "++")
UNARY_OPERATION(PostDec, "--")
-// [C99 6.5.3.1] Prefix increment and decrement
+// [C99 6.5.3.1] Prefix increment and decrement
UNARY_OPERATION(PreInc, "++")
UNARY_OPERATION(PreDec, "--")
// [C99 6.5.3.2] Address and indirection
UNARY_OPERATION(AddrOf, "&")
UNARY_OPERATION(Deref, "*")
-// [C99 6.5.3.3] Unary arithmetic
+// [C99 6.5.3.3] Unary arithmetic
UNARY_OPERATION(Plus, "+")
UNARY_OPERATION(Minus, "-")
UNARY_OPERATION(Not, "~")
diff --git a/include/clang/AST/OperationKinds.h b/include/clang/AST/OperationKinds.h
index c7e01fa1834e..ac512d721e34 100644
--- a/include/clang/AST/OperationKinds.h
+++ b/include/clang/AST/OperationKinds.h
@@ -16,7 +16,7 @@
#define LLVM_CLANG_AST_OPERATIONKINDS_H
namespace clang {
-
+
/// CastKind - The kind of operation required for a conversion.
enum CastKind {
#define CAST_OPERATION(Name) CK_##Name,
diff --git a/include/clang/AST/PrettyPrinter.h b/include/clang/AST/PrettyPrinter.h
index 41c804486c35..b49f5be1b1e6 100644
--- a/include/clang/AST/PrettyPrinter.h
+++ b/include/clang/AST/PrettyPrinter.h
@@ -109,7 +109,7 @@ struct PrintingPolicy {
/// Suppress printing parts of scope specifiers that don't need
/// to be written, e.g., for inline or anonymous namespaces.
bool SuppressUnwrittenScope : 1;
-
+
/// Suppress printing of variable initializers.
///
/// This flag is used when printing the loop variable in a for-range
@@ -140,15 +140,15 @@ struct PrintingPolicy {
/// char a[9] = "A string";
/// \endcode
bool ConstantArraySizeAsWritten : 1;
-
+
/// When printing an anonymous tag name, also print the location of that
/// entity (e.g., "enum <anonymous at t.h:10:5>"). Otherwise, just prints
/// "(anonymous)" for the name.
bool AnonymousTagLocations : 1;
-
+
/// When true, suppress printing of the __strong lifetime qualifier in ARC.
unsigned SuppressStrongLifetime : 1;
-
+
/// When true, suppress printing of lifetime qualifier in ARC.
unsigned SuppressLifetimeQualifiers : 1;
@@ -179,7 +179,7 @@ struct PrintingPolicy {
/// declarations inside namespaces etc. Effectively, this should print
/// only the requested declaration.
unsigned TerseOutput : 1;
-
+
/// When true, do certain refinement needed for producing proper declaration
/// tag; such as, do not print attributes attached to the declaration.
///
diff --git a/include/clang/AST/RecordLayout.h b/include/clang/AST/RecordLayout.h
index dc60ef892b07..a546c200ffe0 100644
--- a/include/clang/AST/RecordLayout.h
+++ b/include/clang/AST/RecordLayout.h
@@ -71,6 +71,10 @@ private:
// Alignment - Alignment of record in characters.
CharUnits Alignment;
+ // UnadjustedAlignment - Maximum of the alignments of the record members in
+ // characters.
+ CharUnits UnadjustedAlignment;
+
/// RequiredAlignment - The required alignment of the object. In the MS-ABI
/// the __declspec(align()) trumps #pramga pack and must always be obeyed.
CharUnits RequiredAlignment;
@@ -120,10 +124,10 @@ private:
/// BaseSharingVBPtr - The base we share vbptr with.
const CXXRecordDecl *BaseSharingVBPtr;
-
+
/// FIXME: This should really use a SmallPtrMap, once we have one in LLVM :)
using BaseOffsetsMapTy = llvm::DenseMap<const CXXRecordDecl *, CharUnits>;
-
+
/// BaseOffsets - Contains a map from base classes to their offset.
BaseOffsetsMapTy BaseOffsets;
@@ -136,6 +140,7 @@ private:
CXXRecordLayoutInfo *CXXInfo = nullptr;
ASTRecordLayout(const ASTContext &Ctx, CharUnits size, CharUnits alignment,
+ CharUnits unadjustedAlignment,
CharUnits requiredAlignment, CharUnits datasize,
ArrayRef<uint64_t> fieldoffsets);
@@ -144,6 +149,7 @@ private:
// Constructor for C++ records.
ASTRecordLayout(const ASTContext &Ctx,
CharUnits size, CharUnits alignment,
+ CharUnits unadjustedAlignment,
CharUnits requiredAlignment,
bool hasOwnVFPtr, bool hasExtendableVFPtr,
CharUnits vbptroffset,
@@ -162,7 +168,7 @@ private:
~ASTRecordLayout() = default;
void Destroy(ASTContext &Ctx);
-
+
public:
ASTRecordLayout(const ASTRecordLayout &) = delete;
ASTRecordLayout &operator=(const ASTRecordLayout &) = delete;
@@ -170,6 +176,10 @@ public:
/// getAlignment - Get the record alignment in characters.
CharUnits getAlignment() const { return Alignment; }
+ /// getUnadjustedAlignment - Get the record alignment in characters, before
+ /// alignment adjustement.
+ CharUnits getUnadjustedAlignment() const { return UnadjustedAlignment; }
+
/// getSize - Get the record size in characters.
CharUnits getSize() const { return Size; }
@@ -259,7 +269,7 @@ public:
assert(CXXInfo && "Record layout does not have C++ specific info!");
return CXXInfo->HasExtendableVFPtr;
}
-
+
/// hasOwnVBPtr - Does this class provide its own virtual-base
/// table pointer, rather than inheriting one from a primary base
/// class?
diff --git a/include/clang/AST/Stmt.h b/include/clang/AST/Stmt.h
index 91dbcb71a600..aa0f88b71023 100644
--- a/include/clang/AST/Stmt.h
+++ b/include/clang/AST/Stmt.h
@@ -204,7 +204,7 @@ protected:
unsigned Kind : 6;
unsigned PartOfExplicitCast : 1; // Only set for ImplicitCastExpr.
- unsigned BasePathSize : 32 - 6 - 1 - NumExprBits;
+ unsigned BasePathIsEmpty : 1;
};
class CallExprBitfields {
@@ -271,12 +271,12 @@ protected:
friend class ASTStmtReader;
friend class ASTStmtWriter;
friend class TypeTraitExpr;
-
+
unsigned : NumExprBits;
-
+
/// The kind of type trait, which is a value of a TypeTrait enumerator.
unsigned Kind : 8;
-
+
/// If this expression is not value-dependent, this indicates whether
/// the trait evaluated true or false.
unsigned Value : 1;
@@ -1556,7 +1556,7 @@ public:
/// getInputConstraint - Return the specified input constraint. Unlike output
/// constraints, these can be empty.
StringRef getInputConstraint(unsigned i) const;
-
+
const Expr *getInputExpr(unsigned i) const;
//===--- Other ---===//
@@ -2133,7 +2133,7 @@ private:
/// The number of variable captured, including 'this'.
unsigned NumCaptures;
- /// The pointer part is the implicit the outlined function and the
+ /// The pointer part is the implicit the outlined function and the
/// int part is the captured region kind, 'CR_Default' etc.
llvm::PointerIntPair<CapturedDecl *, 2, CapturedRegionKind> CapDeclAndKind;
diff --git a/include/clang/AST/StmtIterator.h b/include/clang/AST/StmtIterator.h
index 33aab08bbb71..806edaa38821 100644
--- a/include/clang/AST/StmtIterator.h
+++ b/include/clang/AST/StmtIterator.h
@@ -33,14 +33,14 @@ protected:
DeclGroupMode = 0x2,
Flags = 0x3
};
-
+
union {
Stmt **stmt;
Decl **DGI;
};
uintptr_t RawVAPtr = 0;
Decl **DGE;
-
+
StmtIteratorBase(Stmt **s) : stmt(s) {}
StmtIteratorBase(const VariableArrayType *t);
StmtIteratorBase(Decl **dgi, Decl **dge);
diff --git a/include/clang/AST/StmtObjC.h b/include/clang/AST/StmtObjC.h
index 571ad76be8a9..0b2cc78b65be 100644
--- a/include/clang/AST/StmtObjC.h
+++ b/include/clang/AST/StmtObjC.h
@@ -81,7 +81,7 @@ public:
ObjCAtCatchStmt(SourceLocation atCatchLoc, SourceLocation rparenloc,
VarDecl *catchVarDecl,
Stmt *atCatchStmt)
- : Stmt(ObjCAtCatchStmtClass), ExceptionDecl(catchVarDecl),
+ : Stmt(ObjCAtCatchStmtClass), ExceptionDecl(catchVarDecl),
Body(atCatchStmt), AtCatchLoc(atCatchLoc), RParenLoc(rparenloc) { }
explicit ObjCAtCatchStmt(EmptyShell Empty) :
@@ -155,27 +155,27 @@ class ObjCAtTryStmt : public Stmt {
private:
// The location of the @ in the \@try.
SourceLocation AtTryLoc;
-
+
// The number of catch blocks in this statement.
unsigned NumCatchStmts : 16;
-
+
// Whether this statement has a \@finally statement.
bool HasFinally : 1;
-
+
/// Retrieve the statements that are stored after this \@try statement.
///
/// The order of the statements in memory follows the order in the source,
/// with the \@try body first, followed by the \@catch statements (if any)
/// and, finally, the \@finally (if it exists).
Stmt **getStmts() { return reinterpret_cast<Stmt **> (this + 1); }
- const Stmt* const *getStmts() const {
- return reinterpret_cast<const Stmt * const*> (this + 1);
+ const Stmt* const *getStmts() const {
+ return reinterpret_cast<const Stmt * const*> (this + 1);
}
-
+
ObjCAtTryStmt(SourceLocation atTryLoc, Stmt *atTryStmt,
Stmt **CatchStmts, unsigned NumCatchStmts,
Stmt *atFinallyStmt);
-
+
explicit ObjCAtTryStmt(EmptyShell Empty, unsigned NumCatchStmts,
bool HasFinally)
: Stmt(ObjCAtTryStmtClass, Empty), NumCatchStmts(NumCatchStmts),
@@ -188,7 +188,7 @@ public:
Stmt *atFinallyStmt);
static ObjCAtTryStmt *CreateEmpty(const ASTContext &Context,
unsigned NumCatchStmts, bool HasFinally);
-
+
/// Retrieve the location of the @ in the \@try.
SourceLocation getAtTryLoc() const { return AtTryLoc; }
void setAtTryLoc(SourceLocation Loc) { AtTryLoc = Loc; }
@@ -201,41 +201,41 @@ public:
/// Retrieve the number of \@catch statements in this try-catch-finally
/// block.
unsigned getNumCatchStmts() const { return NumCatchStmts; }
-
+
/// Retrieve a \@catch statement.
const ObjCAtCatchStmt *getCatchStmt(unsigned I) const {
assert(I < NumCatchStmts && "Out-of-bounds @catch index");
return cast_or_null<ObjCAtCatchStmt>(getStmts()[I + 1]);
}
-
+
/// Retrieve a \@catch statement.
ObjCAtCatchStmt *getCatchStmt(unsigned I) {
assert(I < NumCatchStmts && "Out-of-bounds @catch index");
return cast_or_null<ObjCAtCatchStmt>(getStmts()[I + 1]);
}
-
+
/// Set a particular catch statement.
void setCatchStmt(unsigned I, ObjCAtCatchStmt *S) {
assert(I < NumCatchStmts && "Out-of-bounds @catch index");
getStmts()[I + 1] = S;
}
-
+
/// Retrieve the \@finally statement, if any.
const ObjCAtFinallyStmt *getFinallyStmt() const {
if (!HasFinally)
return nullptr;
-
+
return cast_or_null<ObjCAtFinallyStmt>(getStmts()[1 + NumCatchStmts]);
}
ObjCAtFinallyStmt *getFinallyStmt() {
if (!HasFinally)
return nullptr;
-
+
return cast_or_null<ObjCAtFinallyStmt>(getStmts()[1 + NumCatchStmts]);
}
- void setFinallyStmt(Stmt *S) {
+ void setFinallyStmt(Stmt *S) {
assert(HasFinally && "@try does not have a @finally slot!");
- getStmts()[1 + NumCatchStmts] = S;
+ getStmts()[1 + NumCatchStmts] = S;
}
SourceLocation getLocStart() const LLVM_READONLY { return AtTryLoc; }
diff --git a/include/clang/AST/StmtOpenMP.h b/include/clang/AST/StmtOpenMP.h
index 84a35db938b0..d23375e7606b 100644
--- a/include/clang/AST/StmtOpenMP.h
+++ b/include/clang/AST/StmtOpenMP.h
@@ -2319,7 +2319,7 @@ class OMPTargetDataDirective : public OMPExecutableDirective {
///
OMPTargetDataDirective(SourceLocation StartLoc, SourceLocation EndLoc,
unsigned NumClauses)
- : OMPExecutableDirective(this, OMPTargetDataDirectiveClass,
+ : OMPExecutableDirective(this, OMPTargetDataDirectiveClass,
OMPD_target_data, StartLoc, EndLoc, NumClauses,
1) {}
@@ -2328,7 +2328,7 @@ class OMPTargetDataDirective : public OMPExecutableDirective {
/// \param NumClauses Number of clauses.
///
explicit OMPTargetDataDirective(unsigned NumClauses)
- : OMPExecutableDirective(this, OMPTargetDataDirectiveClass,
+ : OMPExecutableDirective(this, OMPTargetDataDirectiveClass,
OMPD_target_data, SourceLocation(),
SourceLocation(), NumClauses, 1) {}
@@ -3157,7 +3157,7 @@ class OMPDistributeParallelForSimdDirective final : public OMPLoopDirective {
unsigned CollapsedNum,
unsigned NumClauses)
: OMPLoopDirective(this, OMPDistributeParallelForSimdDirectiveClass,
- OMPD_distribute_parallel_for_simd, StartLoc,
+ OMPD_distribute_parallel_for_simd, StartLoc,
EndLoc, CollapsedNum, NumClauses) {}
/// Build an empty directive.
@@ -3168,7 +3168,7 @@ class OMPDistributeParallelForSimdDirective final : public OMPLoopDirective {
explicit OMPDistributeParallelForSimdDirective(unsigned CollapsedNum,
unsigned NumClauses)
: OMPLoopDirective(this, OMPDistributeParallelForSimdDirectiveClass,
- OMPD_distribute_parallel_for_simd,
+ OMPD_distribute_parallel_for_simd,
SourceLocation(), SourceLocation(), CollapsedNum,
NumClauses) {}
@@ -3232,7 +3232,7 @@ class OMPDistributeSimdDirective final : public OMPLoopDirective {
/// \param CollapsedNum Number of collapsed nested loops.
/// \param NumClauses Number of clauses.
///
- explicit OMPDistributeSimdDirective(unsigned CollapsedNum,
+ explicit OMPDistributeSimdDirective(unsigned CollapsedNum,
unsigned NumClauses)
: OMPLoopDirective(this, OMPDistributeSimdDirectiveClass,
OMPD_distribute_simd, SourceLocation(),
@@ -3369,7 +3369,7 @@ class OMPTargetSimdDirective final : public OMPLoopDirective {
/// \param NumClauses Number of clauses.
///
explicit OMPTargetSimdDirective(unsigned CollapsedNum, unsigned NumClauses)
- : OMPLoopDirective(this, OMPTargetSimdDirectiveClass, OMPD_target_simd,
+ : OMPLoopDirective(this, OMPTargetSimdDirectiveClass, OMPD_target_simd,
SourceLocation(),SourceLocation(), CollapsedNum,
NumClauses) {}
@@ -3425,8 +3425,8 @@ class OMPTeamsDistributeDirective final : public OMPLoopDirective {
///
OMPTeamsDistributeDirective(SourceLocation StartLoc, SourceLocation EndLoc,
unsigned CollapsedNum, unsigned NumClauses)
- : OMPLoopDirective(this, OMPTeamsDistributeDirectiveClass,
- OMPD_teams_distribute, StartLoc, EndLoc,
+ : OMPLoopDirective(this, OMPTeamsDistributeDirectiveClass,
+ OMPD_teams_distribute, StartLoc, EndLoc,
CollapsedNum, NumClauses) {}
/// Build an empty directive.
@@ -3567,7 +3567,7 @@ class OMPTeamsDistributeParallelForSimdDirective final
unsigned CollapsedNum,
unsigned NumClauses)
: OMPLoopDirective(this, OMPTeamsDistributeParallelForSimdDirectiveClass,
- OMPD_teams_distribute_parallel_for_simd, StartLoc,
+ OMPD_teams_distribute_parallel_for_simd, StartLoc,
EndLoc, CollapsedNum, NumClauses) {}
/// Build an empty directive.
@@ -3578,7 +3578,7 @@ class OMPTeamsDistributeParallelForSimdDirective final
explicit OMPTeamsDistributeParallelForSimdDirective(unsigned CollapsedNum,
unsigned NumClauses)
: OMPLoopDirective(this, OMPTeamsDistributeParallelForSimdDirectiveClass,
- OMPD_teams_distribute_parallel_for_simd,
+ OMPD_teams_distribute_parallel_for_simd,
SourceLocation(), SourceLocation(), CollapsedNum,
NumClauses) {}
diff --git a/include/clang/AST/TemplateBase.h b/include/clang/AST/TemplateBase.h
index a1920253de78..6898ef4e1b8a 100644
--- a/include/clang/AST/TemplateBase.h
+++ b/include/clang/AST/TemplateBase.h
@@ -252,7 +252,7 @@ public:
/// Determine whether this template argument is a pack expansion.
bool isPackExpansion() const;
-
+
/// Retrieve the type for a type template argument.
QualType getAsType() const {
assert(getKind() == Type && "Unexpected kind");
@@ -288,14 +288,14 @@ public:
TemplateName getAsTemplateOrTemplatePattern() const {
assert((getKind() == Template || getKind() == TemplateExpansion) &&
"Unexpected kind");
-
+
return TemplateName::getFromVoidPointer(TemplateArg.Name);
}
/// Retrieve the number of expansions that a template template argument
/// expansion will produce, if known.
Optional<unsigned> getNumTemplateExpansions() const;
-
+
/// Retrieve the template argument as an integral value.
// FIXME: Provide a way to read the integral data without copying the value.
llvm::APSInt getAsIntegral() const {
@@ -378,13 +378,13 @@ public:
/// Print this template argument to the given output stream.
void print(const PrintingPolicy &Policy, raw_ostream &Out) const;
-
+
/// Debugging aid that dumps the template argument.
void dump(raw_ostream &Out) const;
/// Debugging aid that dumps the template argument to standard error.
void dump() const;
-
+
/// Used to insert TemplateArguments into FoldingSets.
void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context) const;
};
@@ -411,9 +411,9 @@ public:
constexpr TemplateArgumentLocInfo() : Template({nullptr, nullptr, 0, 0}) {}
TemplateArgumentLocInfo(TypeSourceInfo *TInfo) : Declarator(TInfo) {}
-
+
TemplateArgumentLocInfo(Expr *E) : Expression(E) {}
-
+
TemplateArgumentLocInfo(NestedNameSpecifierLoc QualifierLoc,
SourceLocation TemplateNameLoc,
SourceLocation EllipsisLoc) {
@@ -432,14 +432,14 @@ public:
}
NestedNameSpecifierLoc getTemplateQualifierLoc() const {
- return NestedNameSpecifierLoc(Template.Qualifier,
+ return NestedNameSpecifierLoc(Template.Qualifier,
Template.QualifierLocData);
}
-
+
SourceLocation getTemplateNameLoc() const {
return SourceLocation::getFromRawEncoding(Template.TemplateNameLoc);
}
-
+
SourceLocation getTemplateEllipsisLoc() const {
return SourceLocation::getFromRawEncoding(Template.EllipsisLoc);
}
@@ -465,10 +465,16 @@ public:
TemplateArgumentLoc(const TemplateArgument &Argument, Expr *E)
: Argument(Argument), LocInfo(E) {
- assert(Argument.getKind() == TemplateArgument::Expression);
+
+ // Permit any kind of template argument that can be represented with an
+ // expression
+ assert(Argument.getKind() == TemplateArgument::NullPtr ||
+ Argument.getKind() == TemplateArgument::Integral ||
+ Argument.getKind() == TemplateArgument::Declaration ||
+ Argument.getKind() == TemplateArgument::Expression);
}
- TemplateArgumentLoc(const TemplateArgument &Argument,
+ TemplateArgumentLoc(const TemplateArgument &Argument,
NestedNameSpecifierLoc QualifierLoc,
SourceLocation TemplateNameLoc,
SourceLocation EllipsisLoc = SourceLocation())
@@ -477,13 +483,13 @@ public:
assert(Argument.getKind() == TemplateArgument::Template ||
Argument.getKind() == TemplateArgument::TemplateExpansion);
}
-
+
/// - Fetches the primary location of the argument.
SourceLocation getLocation() const {
if (Argument.getKind() == TemplateArgument::Template ||
Argument.getKind() == TemplateArgument::TemplateExpansion)
return getTemplateNameLoc();
-
+
return getSourceRange().getBegin();
}
@@ -528,13 +534,13 @@ public:
Argument.getKind() == TemplateArgument::TemplateExpansion);
return LocInfo.getTemplateQualifierLoc();
}
-
+
SourceLocation getTemplateNameLoc() const {
assert(Argument.getKind() == TemplateArgument::Template ||
Argument.getKind() == TemplateArgument::TemplateExpansion);
return LocInfo.getTemplateNameLoc();
- }
-
+ }
+
SourceLocation getTemplateEllipsisLoc() const {
assert(Argument.getKind() == TemplateArgument::TemplateExpansion);
return LocInfo.getTemplateEllipsisLoc();
@@ -689,7 +695,7 @@ inline const TemplateArgument &
assert(Idx < getNumArgs() && "Template argument out of range");
return getArgs()[Idx];
}
-
+
} // namespace clang
#endif // LLVM_CLANG_AST_TEMPLATEBASE_H
diff --git a/include/clang/AST/TemplateName.h b/include/clang/AST/TemplateName.h
index 50549e1a0a6a..d88d58d0a2aa 100644
--- a/include/clang/AST/TemplateName.h
+++ b/include/clang/AST/TemplateName.h
@@ -22,7 +22,7 @@
#include <cassert>
namespace clang {
-
+
class ASTContext;
class DependentTemplateName;
class DiagnosticBuilder;
@@ -38,7 +38,7 @@ class SubstTemplateTemplateParmStorage;
class TemplateArgument;
class TemplateDecl;
class TemplateTemplateParmDecl;
-
+
/// Implementation class used to describe either a set of overloaded
/// template names or an already-substituted template template parameter pack.
class UncommonTemplateNameStorage {
@@ -52,7 +52,7 @@ protected:
struct BitsTag {
/// A Kind.
unsigned Kind : 2;
-
+
/// The number of stored templates or template arguments,
/// depending on which subclass we have.
unsigned Size : 30;
@@ -62,21 +62,21 @@ protected:
struct BitsTag Bits;
void *PointerAlignment;
};
-
+
UncommonTemplateNameStorage(Kind kind, unsigned size) {
Bits.Kind = kind;
Bits.Size = size;
}
-
+
public:
unsigned size() const { return Bits.Size; }
-
+
OverloadedTemplateStorage *getAsOverloadedStorage() {
return Bits.Kind == Overloaded
- ? reinterpret_cast<OverloadedTemplateStorage *>(this)
+ ? reinterpret_cast<OverloadedTemplateStorage *>(this)
: nullptr;
}
-
+
SubstTemplateTemplateParmStorage *getAsSubstTemplateTemplateParm() {
return Bits.Kind == SubstTemplateTemplateParm
? reinterpret_cast<SubstTemplateTemplateParmStorage *>(this)
@@ -89,13 +89,13 @@ public:
: nullptr;
}
};
-
+
/// A structure for storing the information associated with an
/// overloaded template name.
class OverloadedTemplateStorage : public UncommonTemplateNameStorage {
friend class ASTContext;
- OverloadedTemplateStorage(unsigned size)
+ OverloadedTemplateStorage(unsigned size)
: UncommonTemplateNameStorage(Overloaded, size) {}
NamedDecl **getStorage() {
@@ -115,7 +115,7 @@ public:
/// A structure for storing an already-substituted template template
/// parameter pack.
///
-/// This kind of template names occurs when the parameter pack has been
+/// This kind of template names occurs when the parameter pack has been
/// provided with a template template argument pack in a context where its
/// enclosing pack expansion could not be fully expanded.
class SubstTemplateTemplateParmPackStorage
@@ -123,25 +123,25 @@ class SubstTemplateTemplateParmPackStorage
{
TemplateTemplateParmDecl *Parameter;
const TemplateArgument *Arguments;
-
+
public:
SubstTemplateTemplateParmPackStorage(TemplateTemplateParmDecl *Parameter,
- unsigned Size,
+ unsigned Size,
const TemplateArgument *Arguments)
: UncommonTemplateNameStorage(SubstTemplateTemplateParmPack, Size),
Parameter(Parameter), Arguments(Arguments) {}
-
+
/// Retrieve the template template parameter pack being substituted.
TemplateTemplateParmDecl *getParameterPack() const {
return Parameter;
}
-
+
/// Retrieve the template template argument pack with which this
/// parameter was substituted.
TemplateArgument getArgumentPack() const;
-
+
void Profile(llvm::FoldingSetNodeID &ID, ASTContext &Context);
-
+
static void Profile(llvm::FoldingSetNodeID &ID,
ASTContext &Context,
TemplateTemplateParmDecl *Parameter,
@@ -193,11 +193,11 @@ public:
/// A set of overloaded template declarations.
OverloadedTemplate,
- /// A qualified template name, where the qualification is kept
+ /// A qualified template name, where the qualification is kept
/// to describe the source code as written.
QualifiedTemplate,
- /// A dependent template name that has not been resolved to a
+ /// A dependent template name that has not been resolved to a
/// template (or set of templates).
DependentTemplate,
@@ -205,7 +205,7 @@ public:
/// for some other template name.
SubstTemplateTemplateParm,
- /// A template template parameter pack that has been substituted for
+ /// A template template parameter pack that has been substituted for
/// a template template argument pack, but has not yet been expanded into
/// individual arguments.
SubstTemplateTemplateParmPack
@@ -221,7 +221,7 @@ public:
/// Determine whether this template name is NULL.
bool isNull() const;
-
+
// Get the kind of name that is actually stored.
NameKind getKind() const;
@@ -243,14 +243,14 @@ public:
/// refers to a single template, returns NULL.
OverloadedTemplateStorage *getAsOverloadedTemplate() const;
- /// Retrieve the substituted template template parameter, if
+ /// Retrieve the substituted template template parameter, if
/// known.
///
/// \returns The storage for the substituted template template parameter,
/// if known. Otherwise, returns NULL.
SubstTemplateTemplateParmStorage *getAsSubstTemplateTemplateParm() const;
- /// Retrieve the substituted template template parameter pack, if
+ /// Retrieve the substituted template template parameter pack, if
/// known.
///
/// \returns The storage for the substituted template template parameter pack,
@@ -339,7 +339,7 @@ public:
TemplateName getReplacement() const { return Replacement; }
void Profile(llvm::FoldingSetNodeID &ID);
-
+
static void Profile(llvm::FoldingSetNodeID &ID,
TemplateTemplateParmDecl *parameter,
TemplateName replacement);
@@ -436,7 +436,7 @@ class DependentTemplateName : public llvm::FoldingSetNode {
///
/// Only valid when the bit on \c Qualifier is clear.
const IdentifierInfo *Identifier;
-
+
/// The overloaded operator name.
///
/// Only valid when the bit on \c Qualifier is set.
@@ -453,26 +453,26 @@ class DependentTemplateName : public llvm::FoldingSetNode {
DependentTemplateName(NestedNameSpecifier *Qualifier,
const IdentifierInfo *Identifier)
- : Qualifier(Qualifier, false), Identifier(Identifier),
+ : Qualifier(Qualifier, false), Identifier(Identifier),
CanonicalTemplateName(this) {}
DependentTemplateName(NestedNameSpecifier *Qualifier,
const IdentifierInfo *Identifier,
TemplateName Canon)
- : Qualifier(Qualifier, false), Identifier(Identifier),
+ : Qualifier(Qualifier, false), Identifier(Identifier),
CanonicalTemplateName(Canon) {}
DependentTemplateName(NestedNameSpecifier *Qualifier,
OverloadedOperatorKind Operator)
- : Qualifier(Qualifier, true), Operator(Operator),
+ : Qualifier(Qualifier, true), Operator(Operator),
CanonicalTemplateName(this) {}
-
+
DependentTemplateName(NestedNameSpecifier *Qualifier,
OverloadedOperatorKind Operator,
TemplateName Canon)
- : Qualifier(Qualifier, true), Operator(Operator),
+ : Qualifier(Qualifier, true), Operator(Operator),
CanonicalTemplateName(Canon) {}
-
+
public:
/// Return the nested name specifier that qualifies this name.
NestedNameSpecifier *getQualifier() const { return Qualifier.getPointer(); }
@@ -481,22 +481,22 @@ public:
bool isIdentifier() const { return !Qualifier.getInt(); }
/// Returns the identifier to which this template name refers.
- const IdentifierInfo *getIdentifier() const {
+ const IdentifierInfo *getIdentifier() const {
assert(isIdentifier() && "Template name isn't an identifier?");
return Identifier;
}
-
+
/// Determine whether this template name refers to an overloaded
/// operator.
bool isOverloadedOperator() const { return Qualifier.getInt(); }
-
+
/// Return the overloaded operator to which this template name refers.
- OverloadedOperatorKind getOperator() const {
+ OverloadedOperatorKind getOperator() const {
assert(isOverloadedOperator() &&
"Template name isn't an overloaded operator?");
- return Operator;
+ return Operator;
}
-
+
void Profile(llvm::FoldingSetNodeID &ID) {
if (isIdentifier())
Profile(ID, getQualifier(), getIdentifier());
diff --git a/include/clang/AST/Type.h b/include/clang/AST/Type.h
index c692707847a6..9a8dd6faff31 100644
--- a/include/clang/AST/Type.h
+++ b/include/clang/AST/Type.h
@@ -992,7 +992,7 @@ public:
static std::string getAsString(const Type *ty, Qualifiers qs,
const PrintingPolicy &Policy);
- std::string getAsString() const;
+ std::string getAsString() const;
std::string getAsString(const PrintingPolicy &Policy) const;
void print(raw_ostream &OS, const PrintingPolicy &Policy,
@@ -2017,6 +2017,9 @@ public:
/// type of a class template or class template partial specialization.
CXXRecordDecl *getAsCXXRecordDecl() const;
+ /// Retrieves the RecordDecl this type refers to.
+ RecordDecl *getAsRecordDecl() const;
+
/// Retrieves the TagDecl that this type refers to, either
/// because the type is a TagType or because it is the injected-class-name
/// type of a class template or class template partial specialization.
@@ -2926,7 +2929,7 @@ public:
};
/// Represents an extended address space qualifier where the input address space
-/// value is dependent. Non-dependent address spaces are not represented with a
+/// value is dependent. Non-dependent address spaces are not represented with a
/// special Type subclass; they are stored on an ExtQuals node as part of a QualType.
///
/// For example:
@@ -2945,7 +2948,7 @@ class DependentAddressSpaceType : public Type, public llvm::FoldingSetNode {
SourceLocation loc;
DependentAddressSpaceType(const ASTContext &Context, QualType PointeeType,
- QualType can, Expr *AddrSpaceExpr,
+ QualType can, Expr *AddrSpaceExpr,
SourceLocation loc);
public:
@@ -3264,7 +3267,7 @@ public:
Bits = ((unsigned)cc) | (noReturn ? NoReturnMask : 0) |
(producesResult ? ProducesResultMask : 0) |
(noCallerSavedRegs ? NoCallerSavedRegsMask : 0) |
- (hasRegParm ? ((regParm + 1) << RegParmOffset) : 0) |
+ (hasRegParm ? ((regParm + 1) << RegParmOffset) : 0) |
(NoCfCheck ? NoCfCheckMask : 0);
}
@@ -4234,6 +4237,7 @@ public:
attr_null_unspecified,
attr_objc_kindof,
attr_objc_inert_unsafe_unretained,
+ attr_lifetimebound,
};
private:
@@ -5336,7 +5340,7 @@ public:
/// with base C and no protocols.
///
/// 'C<P>' is an unspecialized ObjCObjectType with base C and protocol list [P].
-/// 'C<C*>' is a specialized ObjCObjectType with type arguments 'C*' and no
+/// 'C<C*>' is a specialized ObjCObjectType with type arguments 'C*' and no
/// protocol list.
/// 'C<C*><P>' is a specialized ObjCObjectType with base C, type arguments 'C*',
/// and protocol list [P].
@@ -5968,7 +5972,7 @@ inline QualType QualType::getUnqualifiedType() const {
return QualType(getSplitUnqualifiedTypeImpl(*this).Ty, 0);
}
-
+
inline SplitQualType QualType::getSplitUnqualifiedType() const {
if (!getTypePtr()->getCanonicalTypeInternal().hasLocalQualifiers())
return split();
@@ -6443,7 +6447,7 @@ inline bool Type::isIntegralOrEnumerationType() const {
if (const auto *ET = dyn_cast<EnumType>(CanonicalType))
return IsEnumDeclComplete(ET->getDecl());
- return false;
+ return false;
}
inline bool Type::isBooleanType() const {
diff --git a/include/clang/AST/TypeLoc.h b/include/clang/AST/TypeLoc.h
index 25cd014efe5f..c69f4aa4abcf 100644
--- a/include/clang/AST/TypeLoc.h
+++ b/include/clang/AST/TypeLoc.h
@@ -992,7 +992,7 @@ class ObjCObjectTypeLoc : public ConcreteTypeLoc<UnqualTypeLoc,
return (TypeSourceInfo**)this->getExtraLocalData();
}
- // SourceLocations are stored after the type argument information, one for
+ // SourceLocations are stored after the type argument information, one for
// each Protocol.
SourceLocation *getProtocolLocArray() const {
return (SourceLocation*)(getTypeArgLocArray() + getNumTypeArgs());
@@ -1131,11 +1131,11 @@ public:
void setNameLoc(SourceLocation Loc) {
getLocalData()->NameLoc = Loc;
}
-
+
SourceRange getLocalSourceRange() const {
return SourceRange(getNameLoc(), getNameEndLoc());
}
-
+
SourceLocation getNameEndLoc() const {
return getLocalData()->NameEndLoc;
}
@@ -1766,10 +1766,10 @@ public:
return range;
}
- /// Returns the type before the address space attribute application
- /// area.
+ /// Returns the type before the address space attribute application
+ /// area.
/// int * __attribute__((address_space(11))) *
- /// ^ ^
+ /// ^ ^
QualType getInnerType() const {
return this->getTypePtr()->getPointeeType();
}
diff --git a/include/clang/AST/TypeOrdering.h b/include/clang/AST/TypeOrdering.h
index d29dd6d60124..7ea78071f5cf 100644
--- a/include/clang/AST/TypeOrdering.h
+++ b/include/clang/AST/TypeOrdering.h
@@ -56,20 +56,20 @@ namespace llvm {
};
template<> struct DenseMapInfo<clang::CanQualType> {
- static inline clang::CanQualType getEmptyKey() {
- return clang::CanQualType();
+ static inline clang::CanQualType getEmptyKey() {
+ return clang::CanQualType();
}
-
+
static inline clang::CanQualType getTombstoneKey() {
using clang::CanQualType;
return CanQualType::getFromOpaquePtr(reinterpret_cast<clang::Type *>(-1));
}
-
+
static unsigned getHashValue(clang::CanQualType Val) {
return (unsigned)((uintptr_t)Val.getAsOpaquePtr()) ^
((unsigned)((uintptr_t)Val.getAsOpaquePtr() >> 9));
}
-
+
static bool isEqual(clang::CanQualType LHS, clang::CanQualType RHS) {
return LHS == RHS;
}
diff --git a/include/clang/AST/UnresolvedSet.h b/include/clang/AST/UnresolvedSet.h
index d6b01cb57334..b62e9f138bb6 100644
--- a/include/clang/AST/UnresolvedSet.h
+++ b/include/clang/AST/UnresolvedSet.h
@@ -146,7 +146,7 @@ template <unsigned InlineCapacity> class UnresolvedSet :
SmallVector<DeclAccessPair, InlineCapacity> Decls;
};
-
+
} // namespace clang
#endif // LLVM_CLANG_AST_UNRESOLVEDSET_H
diff --git a/include/clang/AST/VTTBuilder.h b/include/clang/AST/VTTBuilder.h
index 84661c8cc7f2..3a8a6a9c15f0 100644
--- a/include/clang/AST/VTTBuilder.h
+++ b/include/clang/AST/VTTBuilder.h
@@ -76,15 +76,15 @@ class VTTBuilder {
const CXXRecordDecl *MostDerivedClass;
using VTTVTablesVectorTy = SmallVector<VTTVTable, 64>;
-
+
/// The VTT vtables.
VTTVTablesVectorTy VTTVTables;
-
+
using VTTComponentsVectorTy = SmallVector<VTTComponent, 64>;
-
+
/// The VTT components.
VTTComponentsVectorTy VTTComponents;
-
+
/// The AST record layout of the most derived class.
const ASTRecordLayout &MostDerivedClassLayout;
@@ -105,35 +105,35 @@ class VTTBuilder {
/// Add a vtable pointer to the VTT currently being built.
void AddVTablePointer(BaseSubobject Base, uint64_t VTableIndex,
const CXXRecordDecl *VTableClass);
-
+
/// Lay out the secondary VTTs of the given base subobject.
void LayoutSecondaryVTTs(BaseSubobject Base);
-
+
/// Lay out the secondary virtual pointers for the given base
/// subobject.
///
/// \param BaseIsMorallyVirtual whether the base subobject is a virtual base
/// or a direct or indirect base of a virtual base.
- void LayoutSecondaryVirtualPointers(BaseSubobject Base,
+ void LayoutSecondaryVirtualPointers(BaseSubobject Base,
bool BaseIsMorallyVirtual,
uint64_t VTableIndex,
const CXXRecordDecl *VTableClass,
VisitedVirtualBasesSetTy &VBases);
-
+
/// Lay out the secondary virtual pointers for the given base
/// subobject.
- void LayoutSecondaryVirtualPointers(BaseSubobject Base,
+ void LayoutSecondaryVirtualPointers(BaseSubobject Base,
uint64_t VTableIndex);
/// Lay out the VTTs for the virtual base classes of the given
/// record declaration.
void LayoutVirtualVTTs(const CXXRecordDecl *RD,
VisitedVirtualBasesSetTy &VBases);
-
+
/// Lay out the VTT for the given subobject, including any
/// secondary VTTs, secondary virtual pointers and virtual VTTs.
void LayoutVTT(BaseSubobject Base, bool BaseIsVirtual);
-
+
public:
VTTBuilder(ASTContext &Ctx, const CXXRecordDecl *MostDerivedClass,
bool GenerateDefinition);
@@ -142,17 +142,17 @@ public:
const VTTComponentsVectorTy &getVTTComponents() const {
return VTTComponents;
}
-
+
// Returns a reference to the VTT vtables.
const VTTVTablesVectorTy &getVTTVTables() const {
return VTTVTables;
}
-
+
/// Returns a reference to the sub-VTT indices.
const llvm::DenseMap<BaseSubobject, uint64_t> &getSubVTTIndicies() const {
return SubVTTIndicies;
}
-
+
/// Returns a reference to the secondary virtual pointer indices.
const llvm::DenseMap<BaseSubobject, uint64_t> &
getSecondaryVirtualPointerIndices() const {
diff --git a/include/clang/AST/VTableBuilder.h b/include/clang/AST/VTableBuilder.h
index 643103916149..4a779db01ff8 100644
--- a/include/clang/AST/VTableBuilder.h
+++ b/include/clang/AST/VTableBuilder.h
@@ -394,7 +394,7 @@ public:
/// Return the offset in chars (relative to the vtable address point) where
/// the offset of the virtual base that contains the given base is stored,
- /// otherwise, if no virtual base contains the given class, return 0.
+ /// otherwise, if no virtual base contains the given class, return 0.
///
/// Base must be a virtual base class or an unambiguous base.
CharUnits getVirtualBaseOffsetOffset(const CXXRecordDecl *RD,
diff --git a/include/clang/ASTMatchers/ASTMatchers.h b/include/clang/ASTMatchers/ASTMatchers.h
index 58f65a39fb48..51f2ce2af75c 100644
--- a/include/clang/ASTMatchers/ASTMatchers.h
+++ b/include/clang/ASTMatchers/ASTMatchers.h
@@ -1247,7 +1247,7 @@ extern const internal::VariadicDynCastAllOfMatcher<Decl, ObjCMethodDecl>
objcMethodDecl;
/// Matches block declarations.
-///
+///
/// Example matches the declaration of the nameless block printing an input
/// integer.
///
@@ -1654,7 +1654,6 @@ extern const internal::VariadicDynCastAllOfMatcher<Stmt, DeclRefExpr>
/// - (void) init {
/// a = @"hello";
/// }
-//}
/// \endcode
extern const internal::VariadicDynCastAllOfMatcher<Stmt, ObjCIvarRefExpr>
objcIvarRefExpr;
@@ -2886,7 +2885,7 @@ AST_MATCHER(ObjCMessageExpr, hasKeywordSelector) {
AST_MATCHER_P(ObjCMessageExpr, numSelectorArgs, unsigned, N) {
return Node.getSelector().getNumArgs() == N;
}
-
+
/// Matches if the call expression's callee expression matches.
///
/// Given
@@ -3679,7 +3678,7 @@ AST_POLYMORPHIC_MATCHER_P2(forEachArgumentWithParam,
/// \code
/// b = ^(int y) { printf("%d", y) };
/// \endcode
-///
+///
/// the matcher blockDecl(hasAnyParameter(hasName("y")))
/// matches the declaration of the block b with hasParameter
/// matching y.
@@ -5141,7 +5140,7 @@ extern const AstTypeMatcher<AutoType> autoType;
/// int j = 42;
/// decltype(i + j) result = i + j;
/// \endcode
-/// decltypeType()
+/// decltypeType()
/// matches "decltype(i + j)"
extern const AstTypeMatcher<DecltypeType> decltypeType;
@@ -6048,8 +6047,8 @@ AST_MATCHER(NamedDecl, hasExternalFormalLinkage) {
/// void x(int val) {}
/// void y(int val = 0) {}
/// \endcode
-AST_MATCHER(ParmVarDecl, hasDefaultArgument) {
- return Node.hasDefaultArg();
+AST_MATCHER(ParmVarDecl, hasDefaultArgument) {
+ return Node.hasDefaultArg();
}
/// Matches array new expressions.
diff --git a/include/clang/Analysis/Analyses/CFGReachabilityAnalysis.h b/include/clang/Analysis/Analyses/CFGReachabilityAnalysis.h
index da59514c4fa6..49da6815ace9 100644
--- a/include/clang/Analysis/Analyses/CFGReachabilityAnalysis.h
+++ b/include/clang/Analysis/Analyses/CFGReachabilityAnalysis.h
@@ -23,7 +23,7 @@ namespace clang {
class CFG;
class CFGBlock;
-
+
// A class that performs reachability queries for CFGBlocks. Several internal
// checks in this checker require reachability information. The requests all
// tend to have a common destination, so we lazily do a predecessor search
@@ -45,7 +45,7 @@ public:
private:
void mapReachability(const CFGBlock *Dst);
};
-
+
} // namespace clang
#endif // LLVM_CLANG_ANALYSIS_ANALYSES_CFGREACHABILITYANALYSIS_H
diff --git a/include/clang/Analysis/Analyses/Consumed.h b/include/clang/Analysis/Analyses/Consumed.h
index 6003d665fd88..5a70989e5087 100644
--- a/include/clang/Analysis/Analyses/Consumed.h
+++ b/include/clang/Analysis/Analyses/Consumed.h
@@ -38,18 +38,18 @@ class Stmt;
class VarDecl;
namespace consumed {
-
+
class ConsumedStmtVisitor;
enum ConsumedState {
// No state information for the given variable.
CS_None,
-
+
CS_Unknown,
CS_Unconsumed,
CS_Consumed
};
-
+
using OptionalNotes = SmallVector<PartialDiagnosticAt, 1>;
using DelayedDiag = std::pair<PartialDiagnosticAt, OptionalNotes>;
using DiagList = std::list<DelayedDiag>;
@@ -60,7 +60,7 @@ namespace consumed {
/// Emit the warnings and notes left by the analysis.
virtual void emitDiagnostics() {}
-
+
/// Warn that a variable's state doesn't match at the entry and exit
/// of a loop.
///
@@ -70,7 +70,7 @@ namespace consumed {
/// state.
virtual void warnLoopStateMismatch(SourceLocation Loc,
StringRef VariableName) {}
-
+
/// Warn about parameter typestate mismatches upon return.
///
/// \param Loc -- The SourceLocation of the return statement.
@@ -84,22 +84,22 @@ namespace consumed {
StringRef VariableName,
StringRef ExpectedState,
StringRef ObservedState) {}
-
+
// FIXME: Add documentation.
virtual void warnParamTypestateMismatch(SourceLocation LOC,
StringRef ExpectedState,
StringRef ObservedState) {}
-
+
// FIXME: This can be removed when the attr propagation fix for templated
// classes lands.
/// Warn about return typestates set for unconsumable types.
- ///
+ ///
/// \param Loc -- The location of the attributes.
///
/// \param TypeName -- The name of the unconsumable type.
virtual void warnReturnTypestateForUnconsumableType(SourceLocation Loc,
StringRef TypeName) {}
-
+
/// Warn about return typestate mismatches.
///
/// \param Loc -- The SourceLocation of the return statement.
@@ -144,71 +144,71 @@ namespace consumed {
using VarMapType = llvm::DenseMap<const VarDecl *, ConsumedState>;
using TmpMapType =
llvm::DenseMap<const CXXBindTemporaryExpr *, ConsumedState>;
-
+
protected:
bool Reachable = true;
const Stmt *From = nullptr;
VarMapType VarMap;
TmpMapType TmpMap;
-
+
public:
ConsumedStateMap() = default;
ConsumedStateMap(const ConsumedStateMap &Other)
: Reachable(Other.Reachable), From(Other.From), VarMap(Other.VarMap),
TmpMap() {}
-
+
/// Warn if any of the parameters being tracked are not in the state
/// they were declared to be in upon return from a function.
void checkParamsForReturnTypestate(SourceLocation BlameLoc,
ConsumedWarningsHandlerBase &WarningsHandler) const;
-
+
/// Clear the TmpMap.
void clearTemporaries();
-
+
/// Get the consumed state of a given variable.
ConsumedState getState(const VarDecl *Var) const;
-
+
/// Get the consumed state of a given temporary value.
ConsumedState getState(const CXXBindTemporaryExpr *Tmp) const;
-
+
/// Merge this state map with another map.
void intersect(const ConsumedStateMap &Other);
void intersectAtLoopHead(const CFGBlock *LoopHead, const CFGBlock *LoopBack,
const ConsumedStateMap *LoopBackStates,
ConsumedWarningsHandlerBase &WarningsHandler);
-
+
/// Return true if this block is reachable.
bool isReachable() const { return Reachable; }
-
+
/// Mark the block as unreachable.
void markUnreachable();
-
+
/// Set the source for a decision about the branching of states.
/// \param Source -- The statement that was the origin of a branching
/// decision.
void setSource(const Stmt *Source) { this->From = Source; }
-
+
/// Set the consumed state of a given variable.
void setState(const VarDecl *Var, ConsumedState State);
-
+
/// Set the consumed state of a given temporary value.
void setState(const CXXBindTemporaryExpr *Tmp, ConsumedState State);
-
+
/// Remove the temporary value from our state map.
void remove(const CXXBindTemporaryExpr *Tmp);
-
+
/// Tests to see if there is a mismatch in the states stored in two
/// maps.
///
/// \param Other -- The second map to compare against.
bool operator!=(const ConsumedStateMap *Other) const;
};
-
+
class ConsumedBlockInfo {
std::vector<std::unique_ptr<ConsumedStateMap>> StateMapsArray;
std::vector<unsigned int> VisitOrder;
-
+
public:
ConsumedBlockInfo() = default;
@@ -218,7 +218,7 @@ namespace consumed {
for (const auto BI : *SortedGraph)
VisitOrder[BI->getBlockID()] = VisitOrderCounter++;
}
-
+
bool allBackEdgesVisited(const CFGBlock *CurrBlock,
const CFGBlock *TargetBlock);
@@ -228,7 +228,7 @@ namespace consumed {
std::unique_ptr<ConsumedStateMap> StateMap);
ConsumedStateMap* borrowInfo(const CFGBlock *Block);
-
+
void discardInfo(const CFGBlock *Block);
std::unique_ptr<ConsumedStateMap> getInfo(const CFGBlock *Block);
@@ -243,12 +243,12 @@ namespace consumed {
std::unique_ptr<ConsumedStateMap> CurrStates;
ConsumedState ExpectedReturnState;
-
+
void determineExpectedReturnState(AnalysisDeclContext &AC,
const FunctionDecl *D);
bool splitState(const CFGBlock *CurrBlock,
const ConsumedStmtVisitor &Visitor);
-
+
public:
ConsumedWarningsHandlerBase &WarningsHandler;
@@ -256,7 +256,7 @@ namespace consumed {
: WarningsHandler(WarningsHandler) {}
ConsumedState getExpectedReturnState() const { return ExpectedReturnState; }
-
+
/// Check a function's CFG for consumed violations.
///
/// We traverse the blocks in the CFG, keeping track of the state of each
diff --git a/include/clang/Analysis/Analyses/Dominators.h b/include/clang/Analysis/Analyses/Dominators.h
index a9cdc5560bc0..021e98dcd885 100644
--- a/include/clang/Analysis/Analyses/Dominators.h
+++ b/include/clang/Analysis/Analyses/Dominators.h
@@ -20,7 +20,7 @@
#include "llvm/ADT/GraphTraits.h"
#include "llvm/ADT/iterator.h"
#include "llvm/Support/GenericDomTree.h"
-#include "llvm/Support/GenericDomTreeConstruction.h"
+#include "llvm/Support/GenericDomTreeConstruction.h"
#include "llvm/Support/raw_ostream.h"
// FIXME: There is no good reason for the domtree to require a print method
diff --git a/include/clang/Analysis/Analyses/FormatString.h b/include/clang/Analysis/Analyses/FormatString.h
index 6f8bb9b4095f..598d341ac829 100644
--- a/include/clang/Analysis/Analyses/FormatString.h
+++ b/include/clang/Analysis/Analyses/FormatString.h
@@ -236,7 +236,7 @@ public:
const char *toString() const;
bool isPrintfKind() const { return IsPrintf; }
-
+
Optional<ConversionSpecifier> getStandardSpecifier() const;
protected:
diff --git a/include/clang/Analysis/Analyses/LiveVariables.h b/include/clang/Analysis/Analyses/LiveVariables.h
index 21c3ba255c36..0cb500fffb95 100644
--- a/include/clang/Analysis/Analyses/LiveVariables.h
+++ b/include/clang/Analysis/Analyses/LiveVariables.h
@@ -25,7 +25,7 @@ class CFGBlock;
class Stmt;
class DeclRefExpr;
class SourceManager;
-
+
class LiveVariables : public ManagedAnalysis {
public:
class LivenessValues {
@@ -34,7 +34,7 @@ public:
llvm::ImmutableSet<const Stmt *> liveStmts;
llvm::ImmutableSet<const VarDecl *> liveDecls;
llvm::ImmutableSet<const BindingDecl *> liveBindings;
-
+
bool equals(const LivenessValues &V) const;
LivenessValues()
@@ -48,21 +48,21 @@ public:
bool isLive(const Stmt *S) const;
bool isLive(const VarDecl *D) const;
-
- friend class LiveVariables;
+
+ friend class LiveVariables;
};
-
+
class Observer {
virtual void anchor();
public:
virtual ~Observer() {}
-
+
/// A callback invoked right before invoking the
/// liveness transfer function on the given statement.
virtual void observeStmt(const Stmt *S,
const CFGBlock *currentBlock,
const LivenessValues& V) {}
-
+
/// Called when the live variables analysis registers
/// that a variable is killed.
virtual void observerKill(const DeclRefExpr *DR) {}
@@ -73,47 +73,47 @@ public:
/// Compute the liveness information for a given CFG.
static LiveVariables *computeLiveness(AnalysisDeclContext &analysisContext,
bool killAtAssign);
-
+
/// Return true if a variable is live at the end of a
/// specified block.
bool isLive(const CFGBlock *B, const VarDecl *D);
-
+
/// Returns true if a variable is live at the beginning of the
/// the statement. This query only works if liveness information
/// has been recorded at the statement level (see runOnAllBlocks), and
/// only returns liveness information for block-level expressions.
bool isLive(const Stmt *S, const VarDecl *D);
-
+
/// Returns true the block-level expression "value" is live
/// before the given block-level expression (see runOnAllBlocks).
bool isLive(const Stmt *Loc, const Stmt *StmtVal);
-
+
/// Print to stderr the liveness information associated with
/// each basic block.
void dumpBlockLiveness(const SourceManager& M);
void runOnAllBlocks(Observer &obs);
-
+
static LiveVariables *create(AnalysisDeclContext &analysisContext) {
return computeLiveness(analysisContext, true);
}
-
+
static const void *getTag();
-
+
private:
LiveVariables(void *impl);
void *impl;
};
-
+
class RelaxedLiveVariables : public LiveVariables {
public:
static LiveVariables *create(AnalysisDeclContext &analysisContext) {
return computeLiveness(analysisContext, false);
}
-
+
static const void *getTag();
};
-
+
} // end namespace clang
#endif
diff --git a/include/clang/Analysis/Analyses/ReachableCode.h b/include/clang/Analysis/Analyses/ReachableCode.h
index 4c523bfc8b56..d79f1b03df7b 100644
--- a/include/clang/Analysis/Analyses/ReachableCode.h
+++ b/include/clang/Analysis/Analyses/ReachableCode.h
@@ -57,7 +57,7 @@ public:
};
/// ScanReachableFromBlock - Mark all blocks reachable from Start.
-/// Returns the total number of blocks that were marked reachable.
+/// Returns the total number of blocks that were marked reachable.
unsigned ScanReachableFromBlock(const CFGBlock *Start,
llvm::BitVector &Reachable);
diff --git a/include/clang/Analysis/Analyses/ThreadSafetyCommon.h b/include/clang/Analysis/Analyses/ThreadSafetyCommon.h
index 580872e17ef4..599c164923cb 100644
--- a/include/clang/Analysis/Analyses/ThreadSafetyCommon.h
+++ b/include/clang/Analysis/Analyses/ThreadSafetyCommon.h
@@ -500,7 +500,7 @@ private:
std::vector<til::BasicBlock *> BlockMap;
// Extra information per BB. Indexed by clang BlockID.
- std::vector<BlockInfo> BBInfo;
+ std::vector<BlockInfo> BBInfo;
LVarDefinitionMap CurrentLVarMap;
std::vector<til::Phi *> CurrentArguments;
diff --git a/include/clang/Analysis/AnalysisDeclContext.h b/include/clang/Analysis/AnalysisDeclContext.h
index 8c391b5ee1e5..19531d92e645 100644
--- a/include/clang/Analysis/AnalysisDeclContext.h
+++ b/include/clang/Analysis/AnalysisDeclContext.h
@@ -111,7 +111,7 @@ public:
AnalysisDeclContextManager *getManager() const {
return Manager;
}
-
+
/// Return the build options used to construct the CFG.
CFG::BuildOptions &getCFGBuildOptions() {
return cfgBuildOptions;
@@ -190,7 +190,7 @@ public:
const Stmt *S,
const CFGBlock *Blk,
unsigned Idx);
-
+
const BlockInvocationContext *
getBlockInvocationContext(const LocationContext *parent,
const BlockDecl *BD,
@@ -359,7 +359,7 @@ class BlockInvocationContext : public LocationContext {
friend class LocationContextManager;
const BlockDecl *BD;
-
+
// FIXME: Come up with a more type-safe way to model context-sensitivity.
const void *ContextData;
@@ -372,7 +372,7 @@ public:
~BlockInvocationContext() override = default;
const BlockDecl *getBlockDecl() const { return BD; }
-
+
const void *getContextData() const { return ContextData; }
void Profile(llvm::FoldingSetNodeID &ID) override;
@@ -403,7 +403,7 @@ public:
const ScopeContext *getScope(AnalysisDeclContext *ctx,
const LocationContext *parent,
const Stmt *s);
-
+
const BlockInvocationContext *
getBlockInvocationContext(AnalysisDeclContext *ctx,
const LocationContext *parent,
@@ -463,7 +463,7 @@ public:
CFG::BuildOptions &getCFGBuildOptions() {
return cfgBuildOptions;
}
-
+
/// Return true if faux bodies should be synthesized for well-known
/// functions.
bool synthesizeBodies() const { return SynthesizeBodies; }
diff --git a/include/clang/Analysis/CFG.h b/include/clang/Analysis/CFG.h
index f25789822d16..bf81d8358a54 100644
--- a/include/clang/Analysis/CFG.h
+++ b/include/clang/Analysis/CFG.h
@@ -15,9 +15,10 @@
#ifndef LLVM_CLANG_ANALYSIS_CFG_H
#define LLVM_CLANG_ANALYSIS_CFG_H
-#include "clang/AST/ExprCXX.h"
#include "clang/Analysis/Support/BumpVector.h"
#include "clang/Analysis/ConstructionContext.h"
+#include "clang/AST/ExprCXX.h"
+#include "clang/AST/ExprObjC.h"
#include "clang/Basic/LLVM.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/GraphTraits.h"
@@ -51,7 +52,7 @@ class FieldDecl;
class LangOptions;
class VarDecl;
-/// CFGElement - Represents a top-level expression in a basic block.
+/// Represents a top-level expression in a basic block.
class CFGElement {
public:
enum Kind {
@@ -144,9 +145,9 @@ protected:
CFGStmt() = default;
};
-/// CFGConstructor - Represents C++ constructor call. Maintains information
-/// necessary to figure out what memory is being initialized by the
-/// constructor expression. For now this is only used by the analyzer's CFG.
+/// Represents C++ constructor call. Maintains information necessary to figure
+/// out what memory is being initialized by the constructor expression. For now
+/// this is only used by the analyzer's CFG.
class CFGConstructor : public CFGStmt {
public:
explicit CFGConstructor(CXXConstructExpr *CE, const ConstructionContext *C)
@@ -169,30 +170,34 @@ private:
}
};
-/// CFGCXXRecordTypedCall - Represents a function call that returns a C++ object
-/// by value. This, like constructor, requires a construction context in order
-/// to understand the storage of the returned object . In C such tracking is not
-/// necessary because no additional effort is required for destroying the object
-/// or modeling copy elision. Like CFGConstructor, this element is for now only
-/// used by the analyzer's CFG.
+/// Represents a function call that returns a C++ object by value. This, like
+/// constructor, requires a construction context in order to understand the
+/// storage of the returned object . In C such tracking is not necessary because
+/// no additional effort is required for destroying the object or modeling copy
+/// elision. Like CFGConstructor, this element is for now only used by the
+/// analyzer's CFG.
class CFGCXXRecordTypedCall : public CFGStmt {
public:
/// Returns true when call expression \p CE needs to be represented
/// by CFGCXXRecordTypedCall, as opposed to a regular CFGStmt.
- static bool isCXXRecordTypedCall(CallExpr *CE, const ASTContext &ACtx) {
- return CE->getCallReturnType(ACtx).getCanonicalType()->getAsCXXRecordDecl();
- }
-
- explicit CFGCXXRecordTypedCall(CallExpr *CE, const ConstructionContext *C)
- : CFGStmt(CE, CXXRecordTypedCall) {
- // FIXME: This is not protected against squeezing a non-record-typed-call
- // into the constructor. An assertion would require passing an ASTContext
- // which would mean paying for something we don't use.
+ static bool isCXXRecordTypedCall(Expr *E) {
+ assert(isa<CallExpr>(E) || isa<ObjCMessageExpr>(E));
+ // There is no such thing as reference-type expression. If the function
+ // returns a reference, it'll return the respective lvalue or xvalue
+ // instead, and we're only interested in objects.
+ return !E->isGLValue() &&
+ E->getType().getCanonicalType()->getAsCXXRecordDecl();
+ }
+
+ explicit CFGCXXRecordTypedCall(Expr *E, const ConstructionContext *C)
+ : CFGStmt(E, CXXRecordTypedCall) {
+ assert(isCXXRecordTypedCall(E));
assert(C && (isa<TemporaryObjectConstructionContext>(C) ||
// These are possible in C++17 due to mandatory copy elision.
isa<ReturnedValueConstructionContext>(C) ||
isa<VariableConstructionContext>(C) ||
- isa<ConstructorInitializerConstructionContext>(C)));
+ isa<ConstructorInitializerConstructionContext>(C) ||
+ isa<ArgumentConstructionContext>(C)));
Data2.setPointer(const_cast<ConstructionContext *>(C));
}
@@ -210,8 +215,8 @@ private:
}
};
-/// CFGInitializer - Represents C++ base or member initializer from
-/// constructor's initialization list.
+/// Represents C++ base or member initializer from constructor's initialization
+/// list.
class CFGInitializer : public CFGElement {
public:
explicit CFGInitializer(CXXCtorInitializer *initializer)
@@ -231,7 +236,7 @@ private:
}
};
-/// CFGNewAllocator - Represents C++ allocator call.
+/// Represents C++ allocator call.
class CFGNewAllocator : public CFGElement {
public:
explicit CFGNewAllocator(const CXXNewExpr *S)
@@ -349,8 +354,8 @@ private:
}
};
-/// CFGImplicitDtor - Represents C++ object destructor implicitly generated
-/// by compiler on various occasions.
+/// Represents C++ object destructor implicitly generated by compiler on various
+/// occasions.
class CFGImplicitDtor : public CFGElement {
protected:
CFGImplicitDtor() = default;
@@ -373,9 +378,9 @@ private:
}
};
-/// CFGAutomaticObjDtor - Represents C++ object destructor implicitly generated
-/// for automatic object or temporary bound to const reference at the point
-/// of leaving its local scope.
+/// Represents C++ object destructor implicitly generated for automatic object
+/// or temporary bound to const reference at the point of leaving its local
+/// scope.
class CFGAutomaticObjDtor: public CFGImplicitDtor {
public:
CFGAutomaticObjDtor(const VarDecl *var, const Stmt *stmt)
@@ -400,8 +405,7 @@ private:
}
};
-/// CFGDeleteDtor - Represents C++ object destructor generated
-/// from a call to delete.
+/// Represents C++ object destructor generated from a call to delete.
class CFGDeleteDtor : public CFGImplicitDtor {
public:
CFGDeleteDtor(const CXXRecordDecl *RD, const CXXDeleteExpr *DE)
@@ -426,8 +430,8 @@ private:
}
};
-/// CFGBaseDtor - Represents C++ object destructor implicitly generated for
-/// base object in destructor.
+/// Represents C++ object destructor implicitly generated for base object in
+/// destructor.
class CFGBaseDtor : public CFGImplicitDtor {
public:
CFGBaseDtor(const CXXBaseSpecifier *base)
@@ -447,8 +451,8 @@ private:
}
};
-/// CFGMemberDtor - Represents C++ object destructor implicitly generated for
-/// member object in destructor.
+/// Represents C++ object destructor implicitly generated for member object in
+/// destructor.
class CFGMemberDtor : public CFGImplicitDtor {
public:
CFGMemberDtor(const FieldDecl *field)
@@ -468,8 +472,8 @@ private:
}
};
-/// CFGTemporaryDtor - Represents C++ object destructor implicitly generated
-/// at the end of full expression for temporary object.
+/// Represents C++ object destructor implicitly generated at the end of full
+/// expression for temporary object.
class CFGTemporaryDtor : public CFGImplicitDtor {
public:
CFGTemporaryDtor(CXXBindTemporaryExpr *expr)
@@ -489,7 +493,7 @@ private:
}
};
-/// CFGTerminator - Represents CFGBlock terminator statement.
+/// Represents CFGBlock terminator statement.
///
/// TemporaryDtorsBranch bit is set to true if the terminator marks a branch
/// in control flow of destructors of temporaries. In this case terminator
@@ -520,7 +524,7 @@ public:
explicit operator bool() const { return getStmt(); }
};
-/// CFGBlock - Represents a single basic block in a source-level CFG.
+/// Represents a single basic block in a source-level CFG.
/// It consists of:
///
/// (1) A set of statements/expressions (which may contain subexpressions).
@@ -588,26 +592,24 @@ class CFGBlock {
bool empty() const { return Impl.empty(); }
};
- /// Stmts - The set of statements in the basic block.
+ /// The set of statements in the basic block.
ElementList Elements;
- /// Label - An (optional) label that prefixes the executable
- /// statements in the block. When this variable is non-NULL, it is
- /// either an instance of LabelStmt, SwitchCase or CXXCatchStmt.
+ /// An (optional) label that prefixes the executable statements in the block.
+ /// When this variable is non-NULL, it is either an instance of LabelStmt,
+ /// SwitchCase or CXXCatchStmt.
Stmt *Label = nullptr;
- /// Terminator - The terminator for a basic block that
- /// indicates the type of control-flow that occurs between a block
- /// and its successors.
+ /// The terminator for a basic block that indicates the type of control-flow
+ /// that occurs between a block and its successors.
CFGTerminator Terminator;
- /// LoopTarget - Some blocks are used to represent the "loop edge" to
- /// the start of a loop from within the loop body. This Stmt* will be
- /// refer to the loop statement for such blocks (and be null otherwise).
+ /// Some blocks are used to represent the "loop edge" to the start of a loop
+ /// from within the loop body. This Stmt* will be refer to the loop statement
+ /// for such blocks (and be null otherwise).
const Stmt *LoopTarget = nullptr;
- /// BlockID - A numerical ID assigned to a CFGBlock during construction
- /// of the CFG.
+ /// A numerical ID assigned to a CFGBlock during construction of the CFG.
unsigned BlockID;
public:
@@ -629,7 +631,7 @@ public:
public:
/// Construct an AdjacentBlock with a possibly unreachable block.
AdjacentBlock(CFGBlock *B, bool IsReachable);
-
+
/// Construct an AdjacentBlock with a reachable block and an alternate
/// unreachable block.
AdjacentBlock(CFGBlock *B, CFGBlock *AlternateBlock);
@@ -665,13 +667,12 @@ public:
};
private:
- /// Predecessors/Successors - Keep track of the predecessor / successor
- /// CFG blocks.
+ /// Keep track of the predecessor / successor CFG blocks.
using AdjacentBlocks = BumpVector<AdjacentBlock>;
AdjacentBlocks Preds;
AdjacentBlocks Succs;
- /// NoReturn - This bit is set when the basic block contains a function call
+ /// This bit is set when the basic block contains a function call
/// or implicit destructor that is attributed as 'noreturn'. In that case,
/// control cannot technically ever proceed past this block. All such blocks
/// will have a single immediate successor: the exit block. This allows them
@@ -682,7 +683,7 @@ private:
/// storage if the memory usage of CFGBlock becomes an issue.
unsigned HasNoReturnElement : 1;
- /// Parent - The parent CFG that owns this CFGBlock.
+ /// The parent CFG that owns this CFGBlock.
CFG *Parent;
public:
@@ -878,10 +879,10 @@ public:
Elements.push_back(CFGConstructor(CE, CC), C);
}
- void appendCXXRecordTypedCall(CallExpr *CE,
+ void appendCXXRecordTypedCall(Expr *E,
const ConstructionContext *CC,
BumpVectorContext &C) {
- Elements.push_back(CFGCXXRecordTypedCall(CE, CC), C);
+ Elements.push_back(CFGCXXRecordTypedCall(E, CC), C);
}
void appendInitializer(CXXCtorInitializer *initializer,
@@ -992,7 +993,7 @@ public:
bool isAlwaysTrue) {}
};
-/// CFG - Represents a source-level, intra-procedural CFG that represents the
+/// Represents a source-level, intra-procedural CFG that represents the
/// control-flow of a Stmt. The Stmt can represent an entire function body,
/// or a single expression. A CFG will always contain one empty block that
/// represents the Exit point of the CFG. A CFG will also contain a designated
@@ -1044,21 +1045,21 @@ public:
}
};
- /// buildCFG - Builds a CFG from an AST.
+ /// Builds a CFG from an AST.
static std::unique_ptr<CFG> buildCFG(const Decl *D, Stmt *AST, ASTContext *C,
const BuildOptions &BO);
- /// createBlock - Create a new block in the CFG. The CFG owns the block;
- /// the caller should not directly free it.
+ /// Create a new block in the CFG. The CFG owns the block; the caller should
+ /// not directly free it.
CFGBlock *createBlock();
- /// setEntry - Set the entry block of the CFG. This is typically used
- /// only during CFG construction. Most CFG clients expect that the
- /// entry block has no predecessors and contains no statements.
+ /// Set the entry block of the CFG. This is typically used only during CFG
+ /// construction. Most CFG clients expect that the entry block has no
+ /// predecessors and contains no statements.
void setEntry(CFGBlock *B) { Entry = B; }
- /// setIndirectGotoBlock - Set the block used for indirect goto jumps.
- /// This is typically used only during CFG construction.
+ /// Set the block used for indirect goto jumps. This is typically used only
+ /// during CFG construction.
void setIndirectGotoBlock(CFGBlock *B) { IndirectGotoBlock = B; }
//===--------------------------------------------------------------------===//
@@ -1152,8 +1153,8 @@ public:
template <typename CALLBACK>
void VisitBlockStmts(CALLBACK& O) const {
- for (const_iterator I=begin(), E=end(); I != E; ++I)
- for (CFGBlock::const_iterator BI=(*I)->begin(), BE=(*I)->end();
+ for (const_iterator I = begin(), E = end(); I != E; ++I)
+ for (CFGBlock::const_iterator BI = (*I)->begin(), BE = (*I)->end();
BI != BE; ++BI) {
if (Optional<CFGStmt> stmt = BI->getAs<CFGStmt>())
O(const_cast<Stmt*>(stmt->getStmt()));
@@ -1164,13 +1165,12 @@ public:
// CFG Introspection.
//===--------------------------------------------------------------------===//
- /// getNumBlockIDs - Returns the total number of BlockIDs allocated (which
- /// start at 0).
+ /// Returns the total number of BlockIDs allocated (which start at 0).
unsigned getNumBlockIDs() const { return NumBlockIDs; }
- /// size - Return the total number of CFGBlocks within the CFG
- /// This is simply a renaming of the getNumBlockIDs(). This is necessary
- /// because the dominator implementation needs such an interface.
+ /// Return the total number of CFGBlocks within the CFG This is simply a
+ /// renaming of the getNumBlockIDs(). This is necessary because the dominator
+ /// implementation needs such an interface.
unsigned size() const { return NumBlockIDs; }
//===--------------------------------------------------------------------===//
diff --git a/include/clang/Analysis/CFGStmtMap.h b/include/clang/Analysis/CFGStmtMap.h
index 4dfa91df0f42..78e637daf379 100644
--- a/include/clang/Analysis/CFGStmtMap.h
+++ b/include/clang/Analysis/CFGStmtMap.h
@@ -19,20 +19,18 @@
namespace clang {
-class CFG;
-class CFGBlock;
class ParentMap;
class Stmt;
class CFGStmtMap {
ParentMap *PM;
void *M;
-
+
CFGStmtMap(ParentMap *pm, void *m) : PM(pm), M(m) {}
-
+
public:
~CFGStmtMap();
-
+
/// Returns a new CFGMap for the given CFG. It is the caller's
/// responsibility to 'delete' this object when done using it.
static CFGStmtMap *Build(CFG* C, ParentMap *PM);
diff --git a/include/clang/Analysis/CloneDetection.h b/include/clang/Analysis/CloneDetection.h
index 955777a11a65..915ec58a5144 100644
--- a/include/clang/Analysis/CloneDetection.h
+++ b/include/clang/Analysis/CloneDetection.h
@@ -332,7 +332,7 @@ struct FilenamePatternConstraint {
StringRef IgnoredFilesPattern;
std::shared_ptr<llvm::Regex> IgnoredFilesRegex;
- FilenamePatternConstraint(StringRef IgnoredFilesPattern)
+ FilenamePatternConstraint(StringRef IgnoredFilesPattern)
: IgnoredFilesPattern(IgnoredFilesPattern) {
IgnoredFilesRegex = std::make_shared<llvm::Regex>("^(" +
IgnoredFilesPattern.str() + "$)");
diff --git a/include/clang/Analysis/ConstructionContext.h b/include/clang/Analysis/ConstructionContext.h
index 40cb0e7e5dda..aee67865df25 100644
--- a/include/clang/Analysis/ConstructionContext.h
+++ b/include/clang/Analysis/ConstructionContext.h
@@ -22,65 +22,200 @@
namespace clang {
-/// Construction context is a linked list of multiple layers. Layers are
-/// created gradually while traversing the AST, and layers that represent
-/// the outmost AST nodes are built first, while the node that immediately
-/// contains the constructor would be built last and capture the previous
-/// layers as its parents. Construction context captures the last layer
-/// (which has links to the previous layers) and classifies the seemingly
-/// arbitrary chain of layers into one of the possible ways of constructing
-/// an object in C++ for user-friendly experience.
-class ConstructionContextLayer {
+/// Represents a single point (AST node) in the program that requires attention
+/// during construction of an object. ConstructionContext would be represented
+/// as a list of such items.
+class ConstructionContextItem {
public:
- typedef llvm::PointerUnion<Stmt *, CXXCtorInitializer *> TriggerTy;
+ enum ItemKind {
+ VariableKind,
+ NewAllocatorKind,
+ ReturnKind,
+ MaterializationKind,
+ TemporaryDestructorKind,
+ ElidedDestructorKind,
+ ElidableConstructorKind,
+ ArgumentKind,
+ STATEMENT_WITH_INDEX_KIND_BEGIN=ArgumentKind,
+ STATEMENT_WITH_INDEX_KIND_END=ArgumentKind,
+ STATEMENT_KIND_BEGIN = VariableKind,
+ STATEMENT_KIND_END = ArgumentKind,
+ InitializerKind,
+ INITIALIZER_KIND_BEGIN=InitializerKind,
+ INITIALIZER_KIND_END=InitializerKind
+ };
+
+ LLVM_DUMP_METHOD static StringRef getKindAsString(ItemKind K) {
+ switch (K) {
+ case VariableKind: return "construct into local variable";
+ case NewAllocatorKind: return "construct into new-allocator";
+ case ReturnKind: return "construct into return address";
+ case MaterializationKind: return "materialize temporary";
+ case TemporaryDestructorKind: return "destroy temporary";
+ case ElidedDestructorKind: return "elide destructor";
+ case ElidableConstructorKind: return "elide constructor";
+ case ArgumentKind: return "construct into argument";
+ case InitializerKind: return "construct into member variable";
+ };
+ llvm_unreachable("Unknown ItemKind");
+ }
private:
+ const void *const Data;
+ const ItemKind Kind;
+ const unsigned Index = 0;
+
+ bool hasStatement() const {
+ return Kind >= STATEMENT_KIND_BEGIN &&
+ Kind <= STATEMENT_KIND_END;
+ }
+
+ bool hasIndex() const {
+ return Kind >= STATEMENT_WITH_INDEX_KIND_BEGIN &&
+ Kind >= STATEMENT_WITH_INDEX_KIND_END;
+ }
+
+ bool hasInitializer() const {
+ return Kind >= INITIALIZER_KIND_BEGIN &&
+ Kind <= INITIALIZER_KIND_END;
+ }
+
+public:
+ // ConstructionContextItem should be simple enough so that it was easy to
+ // re-construct it from the AST node it captures. For that reason we provide
+ // simple implicit conversions from all sorts of supported AST nodes.
+ ConstructionContextItem(const DeclStmt *DS)
+ : Data(DS), Kind(VariableKind) {}
+
+ ConstructionContextItem(const CXXNewExpr *NE)
+ : Data(NE), Kind(NewAllocatorKind) {}
+
+ ConstructionContextItem(const ReturnStmt *RS)
+ : Data(RS), Kind(ReturnKind) {}
+
+ ConstructionContextItem(const MaterializeTemporaryExpr *MTE)
+ : Data(MTE), Kind(MaterializationKind) {}
+
+ ConstructionContextItem(const CXXBindTemporaryExpr *BTE,
+ bool IsElided = false)
+ : Data(BTE),
+ Kind(IsElided ? ElidedDestructorKind : TemporaryDestructorKind) {}
+
+ ConstructionContextItem(const CXXConstructExpr *CE)
+ : Data(CE), Kind(ElidableConstructorKind) {}
+
+ ConstructionContextItem(const CallExpr *CE, unsigned Index)
+ : Data(CE), Kind(ArgumentKind), Index(Index) {}
+
+ ConstructionContextItem(const CXXConstructExpr *CE, unsigned Index)
+ : Data(CE), Kind(ArgumentKind), Index(Index) {}
+
+ ConstructionContextItem(const ObjCMessageExpr *ME, unsigned Index)
+ : Data(ME), Kind(ArgumentKind), Index(Index) {}
+
+ // A polymorphic version of the previous calls with dynamic type check.
+ ConstructionContextItem(const Expr *E, unsigned Index)
+ : Data(E), Kind(ArgumentKind), Index(Index) {
+ assert(isa<CallExpr>(E) || isa<CXXConstructExpr>(E) ||
+ isa<ObjCMessageExpr>(E));
+ }
+
+ ConstructionContextItem(const CXXCtorInitializer *Init)
+ : Data(Init), Kind(InitializerKind), Index(0) {}
+
+ ItemKind getKind() const { return Kind; }
+
+ LLVM_DUMP_METHOD StringRef getKindAsString() const {
+ return getKindAsString(getKind());
+ }
+
/// The construction site - the statement that triggered the construction
/// for one of its parts. For instance, stack variable declaration statement
/// triggers construction of itself or its elements if it's an array,
/// new-expression triggers construction of the newly allocated object(s).
- TriggerTy Trigger;
-
- /// Sometimes a single trigger is not enough to describe the construction
- /// site. In this case we'd have a chain of "partial" construction context
- /// layers.
- /// Some examples:
- /// - A constructor within in an aggregate initializer list within a variable
- /// would have a construction context of the initializer list with
- /// the parent construction context of a variable.
- /// - A constructor for a temporary that needs to be both destroyed
- /// and materialized into an elidable copy constructor would have a
- /// construction context of a CXXBindTemporaryExpr with the parent
- /// construction context of a MaterializeTemproraryExpr.
- /// Not all of these are currently supported.
- const ConstructionContextLayer *Parent = nullptr;
+ const Stmt *getStmt() const {
+ assert(hasStatement());
+ return static_cast<const Stmt *>(Data);
+ }
- ConstructionContextLayer(TriggerTy Trigger,
- const ConstructionContextLayer *Parent)
- : Trigger(Trigger), Parent(Parent) {}
+ const Stmt *getStmtOrNull() const {
+ return hasStatement() ? getStmt() : nullptr;
+ }
-public:
- static const ConstructionContextLayer *
- create(BumpVectorContext &C, TriggerTy Trigger,
- const ConstructionContextLayer *Parent = nullptr);
+ /// The construction site is not necessarily a statement. It may also be a
+ /// CXXCtorInitializer, which means that a member variable is being
+ /// constructed during initialization of the object that contains it.
+ const CXXCtorInitializer *getCXXCtorInitializer() const {
+ assert(hasInitializer());
+ return static_cast<const CXXCtorInitializer *>(Data);
+ }
- const ConstructionContextLayer *getParent() const { return Parent; }
- bool isLast() const { return !Parent; }
+ /// If a single trigger statement triggers multiple constructors, they are
+ /// usually being enumerated. This covers function argument constructors
+ /// triggered by a call-expression and items in an initializer list triggered
+ /// by an init-list-expression.
+ unsigned getIndex() const {
+ // This is a fairly specific request. Let's make sure the user knows
+ // what he's doing.
+ assert(hasIndex());
+ return Index;
+ }
- const Stmt *getTriggerStmt() const {
- return Trigger.dyn_cast<Stmt *>();
+ void Profile(llvm::FoldingSetNodeID &ID) const {
+ ID.AddPointer(Data);
+ ID.AddInteger(Kind);
+ ID.AddInteger(Index);
}
- const CXXCtorInitializer *getTriggerInit() const {
- return Trigger.dyn_cast<CXXCtorInitializer *>();
+ bool operator==(const ConstructionContextItem &Other) const {
+ // For most kinds the Index comparison is trivially true, but
+ // checking kind separately doesn't seem to be less expensive
+ // than checking Index. Same in operator<().
+ return std::make_tuple(Data, Kind, Index) ==
+ std::make_tuple(Other.Data, Other.Kind, Other.Index);
}
- /// Returns true if these layers are equal as individual layers, even if
- /// their parents are different.
- bool isSameLayer(const ConstructionContextLayer *Other) const {
- assert(Other);
- return (Trigger == Other->Trigger);
+ bool operator<(const ConstructionContextItem &Other) const {
+ return std::make_tuple(Data, Kind, Index) <
+ std::make_tuple(Other.Data, Other.Kind, Other.Index);
}
+};
+
+/// Construction context can be seen as a linked list of multiple layers.
+/// Sometimes a single trigger is not enough to describe the construction
+/// site. That's what causing us to have a chain of "partial" construction
+/// context layers. Some examples:
+/// - A constructor within in an aggregate initializer list within a variable
+/// would have a construction context of the initializer list with
+/// the parent construction context of a variable.
+/// - A constructor for a temporary that needs to be both destroyed
+/// and materialized into an elidable copy constructor would have a
+/// construction context of a CXXBindTemporaryExpr with the parent
+/// construction context of a MaterializeTemproraryExpr.
+/// Not all of these are currently supported.
+/// Layers are created gradually while traversing the AST, and layers that
+/// represent the outmost AST nodes are built first, while the node that
+/// immediately contains the constructor would be built last and capture the
+/// previous layers as its parents. Construction context captures the last layer
+/// (which has links to the previous layers) and classifies the seemingly
+/// arbitrary chain of layers into one of the possible ways of constructing
+/// an object in C++ for user-friendly experience.
+class ConstructionContextLayer {
+ const ConstructionContextLayer *Parent = nullptr;
+ ConstructionContextItem Item;
+
+ ConstructionContextLayer(ConstructionContextItem Item,
+ const ConstructionContextLayer *Parent)
+ : Parent(Parent), Item(Item) {}
+
+public:
+ static const ConstructionContextLayer *
+ create(BumpVectorContext &C, const ConstructionContextItem &Item,
+ const ConstructionContextLayer *Parent = nullptr);
+
+ const ConstructionContextItem &getItem() const { return Item; }
+ const ConstructionContextLayer *getParent() const { return Parent; }
+ bool isLast() const { return !Parent; }
/// See if Other is a proper initial segment of this construction context
/// in terms of the parent chain - i.e. a few first parents coincide and
@@ -114,7 +249,8 @@ public:
SimpleReturnedValueKind,
CXX17ElidedCopyReturnedValueKind,
RETURNED_VALUE_BEGIN = SimpleReturnedValueKind,
- RETURNED_VALUE_END = CXX17ElidedCopyReturnedValueKind
+ RETURNED_VALUE_END = CXX17ElidedCopyReturnedValueKind,
+ ArgumentKind
};
protected:
@@ -132,6 +268,23 @@ private:
return new (CC) T(Args...);
}
+ // A sub-routine of createFromLayers() that deals with temporary objects
+ // that need to be materialized. The BTE argument is for the situation when
+ // the object also needs to be bound for destruction.
+ static const ConstructionContext *createMaterializedTemporaryFromLayers(
+ BumpVectorContext &C, const MaterializeTemporaryExpr *MTE,
+ const CXXBindTemporaryExpr *BTE,
+ const ConstructionContextLayer *ParentLayer);
+
+ // A sub-routine of createFromLayers() that deals with temporary objects
+ // that need to be bound for destruction. Automatically finds out if the
+ // object also needs to be materialized and delegates to
+ // createMaterializedTemporaryFromLayers() if necessary.
+ static const ConstructionContext *
+ createBoundTemporaryFromLayers(
+ BumpVectorContext &C, const CXXBindTemporaryExpr *BTE,
+ const ConstructionContextLayer *ParentLayer);
+
public:
/// Consume the construction context layer, together with its parent layers,
/// and wrap it up into a complete construction context. May return null
@@ -469,6 +622,32 @@ public:
}
};
+class ArgumentConstructionContext : public ConstructionContext {
+ const Expr *CE; // The call of which the context is an argument.
+ unsigned Index; // Which argument we're constructing.
+ const CXXBindTemporaryExpr *BTE; // Whether the object needs to be destroyed.
+
+ friend class ConstructionContext; // Allows to create<>() itself.
+
+ explicit ArgumentConstructionContext(const Expr *CE, unsigned Index,
+ const CXXBindTemporaryExpr *BTE)
+ : ConstructionContext(ArgumentKind), CE(CE),
+ Index(Index), BTE(BTE) {
+ assert(isa<CallExpr>(CE) || isa<CXXConstructExpr>(CE) ||
+ isa<ObjCMessageExpr>(CE));
+ // BTE is optional.
+ }
+
+public:
+ const Expr *getCallLikeExpr() const { return CE; }
+ unsigned getIndex() const { return Index; }
+ const CXXBindTemporaryExpr *getCXXBindTemporaryExpr() const { return BTE; }
+
+ static bool classof(const ConstructionContext *CC) {
+ return CC->getKind() == ArgumentKind;
+ }
+};
+
} // end namespace clang
#endif // LLVM_CLANG_ANALYSIS_CONSTRUCTIONCONTEXT_H
diff --git a/include/clang/Analysis/DomainSpecific/CocoaConventions.h b/include/clang/Analysis/DomainSpecific/CocoaConventions.h
index 8b3fcff52d08..9326d1abbac1 100644
--- a/include/clang/Analysis/DomainSpecific/CocoaConventions.h
+++ b/include/clang/Analysis/DomainSpecific/CocoaConventions.h
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
//
-// This file implements cocoa naming convention analysis.
+// This file implements cocoa naming convention analysis.
//
//===----------------------------------------------------------------------===//
@@ -20,20 +20,20 @@
namespace clang {
class FunctionDecl;
class QualType;
-
+
namespace ento {
namespace cocoa {
-
+
bool isRefType(QualType RetTy, StringRef Prefix,
StringRef Name = StringRef());
-
+
bool isCocoaObjectRef(QualType T);
}
namespace coreFoundation {
bool isCFObjectRef(QualType T);
-
+
bool followsCreateRule(const FunctionDecl *FD);
}
diff --git a/include/clang/Analysis/DomainSpecific/ObjCNoReturn.h b/include/clang/Analysis/DomainSpecific/ObjCNoReturn.h
index f9e800a4a412..e304d83615d4 100644
--- a/include/clang/Analysis/DomainSpecific/ObjCNoReturn.h
+++ b/include/clang/Analysis/DomainSpecific/ObjCNoReturn.h
@@ -21,7 +21,7 @@ namespace clang {
class ASTContext;
class ObjCMessageExpr;
-
+
class ObjCNoReturn {
/// Cached "raise" selector.
Selector RaiseSel;
@@ -36,7 +36,7 @@ class ObjCNoReturn {
public:
ObjCNoReturn(ASTContext &C);
-
+
/// Return true if the given message expression is known to never
/// return.
bool isImplicitNoReturn(const ObjCMessageExpr *ME);
diff --git a/include/clang/Analysis/ProgramPoint.h b/include/clang/Analysis/ProgramPoint.h
index e8f0d61617eb..25ae93fae6b8 100644
--- a/include/clang/Analysis/ProgramPoint.h
+++ b/include/clang/Analysis/ProgramPoint.h
@@ -33,7 +33,7 @@ namespace clang {
class AnalysisDeclContext;
class FunctionDecl;
class LocationContext;
-
+
/// ProgramPoints can be "tagged" as representing points specific to a given
/// analysis entity. Tags are abstract annotations, with an associated
/// description and potentially other information.
@@ -41,12 +41,12 @@ class ProgramPointTag {
public:
ProgramPointTag(void *tagKind = nullptr) : TagKind(tagKind) {}
virtual ~ProgramPointTag();
- virtual StringRef getTagDescription() const = 0;
+ virtual StringRef getTagDescription() const = 0;
protected:
/// Used to implement 'isKind' in subclasses.
const void *getTagKind() { return TagKind; }
-
+
private:
const void *TagKind;
};
@@ -111,7 +111,7 @@ protected:
assert(getLocationContext() == l);
assert(getData1() == P);
}
-
+
ProgramPoint(const void *P1,
const void *P2,
Kind k,
@@ -223,7 +223,7 @@ class BlockEntrance : public ProgramPoint {
public:
BlockEntrance(const CFGBlock *B, const LocationContext *L,
const ProgramPointTag *tag = nullptr)
- : ProgramPoint(B, BlockEntranceKind, L, tag) {
+ : ProgramPoint(B, BlockEntranceKind, L, tag) {
assert(B && "BlockEntrance requires non-null block");
}
@@ -235,7 +235,7 @@ public:
const CFGBlock *B = getBlock();
return B->empty() ? Optional<CFGElement>() : B->front();
}
-
+
private:
friend class ProgramPoint;
BlockEntrance() = default;
@@ -350,7 +350,7 @@ protected:
LocationCheck(const Stmt *S, const LocationContext *L,
ProgramPoint::Kind K, const ProgramPointTag *tag)
: StmtPoint(S, nullptr, K, L, tag) {}
-
+
private:
friend class ProgramPoint;
static bool isKind(const ProgramPoint &location) {
@@ -358,13 +358,13 @@ private:
return k == PreLoadKind || k == PreStoreKind;
}
};
-
+
class PreLoad : public LocationCheck {
public:
PreLoad(const Stmt *S, const LocationContext *L,
const ProgramPointTag *tag = nullptr)
: LocationCheck(S, L, PreLoadKind, tag) {}
-
+
private:
friend class ProgramPoint;
PreLoad() = default;
@@ -378,7 +378,7 @@ public:
PreStore(const Stmt *S, const LocationContext *L,
const ProgramPointTag *tag = nullptr)
: LocationCheck(S, L, PreStoreKind, tag) {}
-
+
private:
friend class ProgramPoint;
PreStore() = default;
@@ -405,7 +405,7 @@ private:
class PostStore : public PostStmt {
public:
/// Construct the post store point.
- /// \param Loc can be used to store the information about the location
+ /// \param Loc can be used to store the information about the location
/// used in the form it was uttered in the code.
PostStore(const Stmt *S, const LocationContext *L, const void *Loc,
const ProgramPointTag *tag = nullptr)
@@ -479,7 +479,7 @@ public:
BlockEdge(const CFGBlock *B1, const CFGBlock *B2, const LocationContext *L)
: ProgramPoint(B1, B2, BlockEdgeKind, L) {
assert(B1 && "BlockEdge: source block must be non-null");
- assert(B2 && "BlockEdge: destination block must be non-null");
+ assert(B2 && "BlockEdge: destination block must be non-null");
}
const CFGBlock *getSrc() const {
@@ -603,7 +603,7 @@ private:
/// CallEnter uses the caller's location context.
class CallEnter : public ProgramPoint {
public:
- CallEnter(const Stmt *stmt, const StackFrameContext *calleeCtx,
+ CallEnter(const Stmt *stmt, const StackFrameContext *calleeCtx,
const LocationContext *callerCtx)
: ProgramPoint(stmt, calleeCtx, CallEnterKind, callerCtx, nullptr) {}
@@ -749,7 +749,7 @@ static bool isEqual(const clang::ProgramPoint &L,
}
};
-
+
template <>
struct isPodLike<clang::ProgramPoint> { static const bool value = true; };
diff --git a/include/clang/Analysis/Support/BumpVector.h b/include/clang/Analysis/Support/BumpVector.h
index 5940520855ef..00a7417e20f9 100644
--- a/include/clang/Analysis/Support/BumpVector.h
+++ b/include/clang/Analysis/Support/BumpVector.h
@@ -29,7 +29,7 @@
#include <type_traits>
namespace clang {
-
+
class BumpVectorContext {
llvm::PointerIntPair<llvm::BumpPtrAllocator*, 1> Alloc;
@@ -47,15 +47,15 @@ public:
/// BumpPtrAllocator. This BumpPtrAllocator is not destroyed when the
/// BumpVectorContext object is destroyed.
BumpVectorContext(llvm::BumpPtrAllocator &A) : Alloc(&A, 0) {}
-
+
~BumpVectorContext() {
if (Alloc.getInt())
delete Alloc.getPointer();
}
-
+
llvm::BumpPtrAllocator &getAllocator() { return *Alloc.getPointer(); }
};
-
+
template<typename T>
class BumpVector {
T *Begin = nullptr;
@@ -67,34 +67,34 @@ public:
explicit BumpVector(BumpVectorContext &C, unsigned N) {
reserve(C, N);
}
-
+
~BumpVector() {
if (std::is_class<T>::value) {
// Destroy the constructed elements in the vector.
destroy_range(Begin, End);
}
}
-
+
using size_type = size_t;
using difference_type = ptrdiff_t;
using value_type = T;
using iterator = T *;
using const_iterator = const T *;
-
+
using const_reverse_iterator = std::reverse_iterator<const_iterator>;
using reverse_iterator = std::reverse_iterator<iterator>;
-
+
using reference = T &;
using const_reference = const T &;
using pointer = T *;
using const_pointer = const T *;
-
+
// forward iterator creation methods.
iterator begin() { return Begin; }
const_iterator begin() const { return Begin; }
iterator end() { return End; }
const_iterator end() const { return End; }
-
+
// reverse iterator creation methods.
reverse_iterator rbegin() { return reverse_iterator(end()); }
const_reverse_iterator rbegin() const{ return const_reverse_iterator(end()); }
@@ -102,7 +102,7 @@ public:
const_reverse_iterator rend() const {
return const_reverse_iterator(begin());
}
-
+
bool empty() const { return Begin == End; }
size_type size() const { return End-Begin; }
@@ -114,49 +114,49 @@ public:
assert(Begin + idx < End);
return Begin[idx];
}
-
+
reference front() {
return begin()[0];
}
const_reference front() const {
return begin()[0];
}
-
+
reference back() {
return end()[-1];
}
const_reference back() const {
return end()[-1];
}
-
+
void pop_back() {
--End;
End->~T();
}
-
+
T pop_back_val() {
T Result = back();
pop_back();
return Result;
}
-
+
void clear() {
if (std::is_class<T>::value) {
destroy_range(Begin, End);
}
End = Begin;
}
-
+
/// data - Return a pointer to the vector's buffer, even if empty().
pointer data() {
return pointer(Begin);
}
-
+
/// data - Return a pointer to the vector's buffer, even if empty().
const_pointer data() const {
return const_pointer(Begin);
}
-
+
void push_back(const_reference Elt, BumpVectorContext &C) {
if (End < Capacity) {
Retry:
@@ -165,7 +165,7 @@ public:
return;
}
grow(C);
- goto Retry;
+ goto Retry;
}
/// insert - Insert some number of copies of element into a position. Return
@@ -193,18 +193,18 @@ public:
/// capacity - Return the total number of elements in the currently allocated
/// buffer.
- size_t capacity() const { return Capacity - Begin; }
-
+ size_t capacity() const { return Capacity - Begin; }
+
private:
/// grow - double the size of the allocated memory, guaranteeing space for at
/// least one more element or MinSize if specified.
void grow(BumpVectorContext &C, size_type MinSize = 1);
-
+
void construct_range(T *S, T *E, const T &Elt) {
for (; S != E; ++S)
new (S) T(Elt);
}
-
+
void destroy_range(T *S, T *E) {
while (S != E) {
--E;
@@ -220,7 +220,7 @@ private:
}
}
};
-
+
// Define this out-of-line to dissuade the C++ compiler from inlining it.
template <typename T>
void BumpVector<T>::grow(BumpVectorContext &C, size_t MinSize) {
@@ -232,7 +232,7 @@ void BumpVector<T>::grow(BumpVectorContext &C, size_t MinSize) {
// Allocate the memory from the BumpPtrAllocator.
T *NewElts = C.getAllocator().template Allocate<T>(NewCapacity);
-
+
// Copy the elements over.
if (Begin != End) {
if (std::is_class<T>::value) {
diff --git a/include/clang/Basic/ABI.h b/include/clang/Basic/ABI.h
index bd919ce24f81..dc0e49cded63 100644
--- a/include/clang/Basic/ABI.h
+++ b/include/clang/Basic/ABI.h
@@ -81,12 +81,12 @@ struct ReturnAdjustment {
return memcmp(this, &RHS, sizeof(RHS)) < 0;
}
} Virtual;
-
+
ReturnAdjustment() : NonVirtual(0) {}
-
+
bool isEmpty() const { return !NonVirtual && Virtual.isEmpty(); }
- friend bool operator==(const ReturnAdjustment &LHS,
+ friend bool operator==(const ReturnAdjustment &LHS,
const ReturnAdjustment &RHS) {
return LHS.NonVirtual == RHS.NonVirtual && LHS.Virtual.Equals(RHS.Virtual);
}
@@ -103,7 +103,7 @@ struct ReturnAdjustment {
return LHS.NonVirtual == RHS.NonVirtual && LHS.Virtual.Less(RHS.Virtual);
}
};
-
+
/// A \c this pointer adjustment.
struct ThisAdjustment {
/// The non-virtual adjustment from the derived object to its
@@ -149,12 +149,12 @@ struct ThisAdjustment {
return memcmp(this, &RHS, sizeof(RHS)) < 0;
}
} Virtual;
-
+
ThisAdjustment() : NonVirtual(0) { }
bool isEmpty() const { return !NonVirtual && Virtual.isEmpty(); }
- friend bool operator==(const ThisAdjustment &LHS,
+ friend bool operator==(const ThisAdjustment &LHS,
const ThisAdjustment &RHS) {
return LHS.NonVirtual == RHS.NonVirtual && LHS.Virtual.Equals(RHS.Virtual);
}
@@ -162,12 +162,12 @@ struct ThisAdjustment {
friend bool operator!=(const ThisAdjustment &LHS, const ThisAdjustment &RHS) {
return !(LHS == RHS);
}
-
+
friend bool operator<(const ThisAdjustment &LHS,
const ThisAdjustment &RHS) {
if (LHS.NonVirtual < RHS.NonVirtual)
return true;
-
+
return LHS.NonVirtual == RHS.NonVirtual && LHS.Virtual.Less(RHS.Virtual);
}
};
@@ -179,7 +179,7 @@ class CXXMethodDecl;
struct ThunkInfo {
/// The \c this pointer adjustment.
ThisAdjustment This;
-
+
/// The return adjustment.
ReturnAdjustment Return;
@@ -204,7 +204,7 @@ struct ThunkInfo {
bool isEmpty() const {
return This.isEmpty() && Return.isEmpty() && Method == nullptr;
}
-};
+};
} // end namespace clang
diff --git a/include/clang/Basic/AllDiagnostics.h b/include/clang/Basic/AllDiagnostics.h
index 20c29d459d22..afec2d7e0f2f 100644
--- a/include/clang/Basic/AllDiagnostics.h
+++ b/include/clang/Basic/AllDiagnostics.h
@@ -34,9 +34,9 @@ class StringSizerHelper {
public:
enum { Size = SizeOfStr };
};
-} // end namespace clang
+} // end namespace clang
#define STR_SIZE(str, fieldTy) clang::StringSizerHelper<sizeof(str)-1, \
- fieldTy>::Size
+ fieldTy>::Size
#endif
diff --git a/include/clang/Basic/Attr.td b/include/clang/Basic/Attr.td
index 0bbe52bf5f36..fea8e129d7da 100644
--- a/include/clang/Basic/Attr.td
+++ b/include/clang/Basic/Attr.td
@@ -141,6 +141,13 @@ def HasFunctionProto : SubsetSubject<DeclBase,
isa<BlockDecl>(S)}],
"non-K&R-style functions">;
+// A subject that matches the implicit object parameter of a non-static member
+// function. Accepted as a function type attribute on the type of such a
+// member function.
+// FIXME: This does not actually ever match currently.
+def ImplicitObjectParameter : SubsetSubject<Function, [{false}],
+ "implicit object parameters">;
+
// A single argument to an attribute
class Argument<string name, bit optional, bit fake = 0> {
string Name = name;
@@ -456,7 +463,7 @@ class Attr {
// Set to true if all of the attribute's arguments should be parsed in an
// unevaluated context.
bit ParseArgumentsAsUnevaluated = 0;
- // Set to true if this attribute meaningful when applied to or inherited
+ // Set to true if this attribute meaningful when applied to or inherited
// in a class template definition.
bit MeaningfulToClassTemplateDefinition = 0;
// Set to true if this attribute can be used with '#pragma clang attribute'.
@@ -583,7 +590,7 @@ def AlignValue : Attr {
// the future (and a corresponding C++ attribute), but this can be done
// later once we decide if we also want them to have slightly-different
// semantics than Intel's align_value.
- //
+ //
// Does not get a [[]] spelling because the attribute is not exposed as such
// by Intel.
GNU<"align_value">
@@ -1211,6 +1218,13 @@ def LayoutVersion : InheritableAttr, TargetSpecificAttr<TargetMicrosoftCXXABI> {
let Documentation = [LayoutVersionDocs];
}
+def LifetimeBound : InheritableAttr {
+ let Spellings = [Clang<"lifetimebound", 0>];
+ let Subjects = SubjectList<[ParmVar, ImplicitObjectParameter], ErrorDiag>;
+ let Documentation = [LifetimeBoundDocs];
+ let LangOpts = [CPlusPlus];
+}
+
def TrivialABI : InheritableAttr {
// This attribute does not have a C [[]] spelling because it requires the
// CPlusPlus language option.
@@ -1703,7 +1717,7 @@ def Overloadable : Attr {
let Documentation = [OverloadableDocs];
}
-def Override : InheritableAttr {
+def Override : InheritableAttr {
let Spellings = [Keyword<"override">];
let SemaHandler = 0;
let Documentation = [Undocumented];
@@ -1782,7 +1796,7 @@ def RequireConstantInit : InheritableAttr {
def WorkGroupSizeHint : InheritableAttr {
// Does not have a [[]] spelling because it is an OpenCL-related attribute.
let Spellings = [GNU<"work_group_size_hint">];
- let Args = [UnsignedArgument<"XDim">,
+ let Args = [UnsignedArgument<"XDim">,
UnsignedArgument<"YDim">,
UnsignedArgument<"ZDim">];
let Subjects = SubjectList<[Function], ErrorDiag>;
diff --git a/include/clang/Basic/AttrDocs.td b/include/clang/Basic/AttrDocs.td
index 5a5ab78b49d1..bb2993eab4bc 100644
--- a/include/clang/Basic/AttrDocs.td
+++ b/include/clang/Basic/AttrDocs.td
@@ -2362,6 +2362,22 @@ It is only supported when using the Microsoft C++ ABI.
}];
}
+def LifetimeBoundDocs : Documentation {
+ let Category = DocCatFunction;
+ let Content = [{
+The ``lifetimebound`` attribute indicates that a resource owned by
+a function parameter or implicit object parameter
+is retained by the return value of the annotated function
+(or, for a parameter of a constructor, in the value of the constructed object).
+It is only supported in C++.
+
+This attribute provides an experimental implementation of the facility
+described in the C++ committee paper [http://wg21.link/p0936r0](P0936R0),
+and is subject to change as the design of the corresponding functionality
+changes.
+ }];
+}
+
def TrivialABIDocs : Documentation {
let Category = DocCatVariable;
let Content = [{
diff --git a/include/clang/Basic/Builtins.def b/include/clang/Basic/Builtins.def
index edd823754a37..c4d11cd827c1 100644
--- a/include/clang/Basic/Builtins.def
+++ b/include/clang/Basic/Builtins.def
@@ -471,6 +471,8 @@ BUILTIN(__builtin_wcslen, "zwC*", "nF")
BUILTIN(__builtin_wcsncmp, "iwC*wC*z", "nF")
BUILTIN(__builtin_wmemchr, "w*wC*wz", "nF")
BUILTIN(__builtin_wmemcmp, "iwC*wC*z", "nF")
+BUILTIN(__builtin_wmemcpy, "w*w*wC*z", "nF")
+BUILTIN(__builtin_wmemmove, "w*w*wC*z", "nF")
BUILTIN(__builtin_return_address, "v*IUi", "n")
BUILTIN(__builtin_extract_return_addr, "v*v*", "n")
BUILTIN(__builtin_frame_address, "v*IUi", "n")
@@ -908,6 +910,8 @@ LIBBUILTIN(wcslen, "zwC*", "f", "wchar.h", ALL_LANGUAGES)
LIBBUILTIN(wcsncmp, "iwC*wC*z", "f", "wchar.h", ALL_LANGUAGES)
LIBBUILTIN(wmemchr, "w*wC*wz", "f", "wchar.h", ALL_LANGUAGES)
LIBBUILTIN(wmemcmp, "iwC*wC*z", "f", "wchar.h", ALL_LANGUAGES)
+LIBBUILTIN(wmemcpy, "w*w*wC*z", "f", "wchar.h", ALL_LANGUAGES)
+LIBBUILTIN(wmemmove,"w*w*wC*z", "f", "wchar.h", ALL_LANGUAGES)
// C99
// In some systems setjmp is a macro that expands to _setjmp. We undefine
@@ -956,7 +960,7 @@ LIBBUILTIN(strlcpy, "zc*cC*z", "f", "string.h", ALL_GNU_LANGUAGES)
LIBBUILTIN(strlcat, "zc*cC*z", "f", "string.h", ALL_GNU_LANGUAGES)
// id objc_msgSend(id, SEL, ...)
LIBBUILTIN(objc_msgSend, "GGH.", "f", "objc/message.h", OBJC_LANG)
-// long double objc_msgSend_fpret(id self, SEL op, ...)
+// long double objc_msgSend_fpret(id self, SEL op, ...)
LIBBUILTIN(objc_msgSend_fpret, "LdGH.", "f", "objc/message.h", OBJC_LANG)
// _Complex long double objc_msgSend_fp2ret(id self, SEL op, ...)
LIBBUILTIN(objc_msgSend_fp2ret, "XLdGH.", "f", "objc/message.h", OBJC_LANG)
diff --git a/include/clang/Basic/BuiltinsAMDGPU.def b/include/clang/Basic/BuiltinsAMDGPU.def
index 46cd738ae43f..4a447eb9f6a8 100644
--- a/include/clang/Basic/BuiltinsAMDGPU.def
+++ b/include/clang/Basic/BuiltinsAMDGPU.def
@@ -124,13 +124,13 @@ TARGET_BUILTIN(__builtin_amdgcn_fmed3h, "hhhh", "nc", "gfx9-insts")
// Deep learning builtins.
//===----------------------------------------------------------------------===//
-TARGET_BUILTIN(__builtin_amdgcn_fdot2, "fV2hV2hf", "nc", "dl-insts")
-TARGET_BUILTIN(__builtin_amdgcn_sdot2, "SiV2SsV2SsSi", "nc", "dl-insts")
-TARGET_BUILTIN(__builtin_amdgcn_udot2, "UiV2UsV2UsUi", "nc", "dl-insts")
-TARGET_BUILTIN(__builtin_amdgcn_sdot4, "SiSiSiSi", "nc", "dl-insts")
-TARGET_BUILTIN(__builtin_amdgcn_udot4, "UiUiUiUi", "nc", "dl-insts")
-TARGET_BUILTIN(__builtin_amdgcn_sdot8, "SiSiSiSi", "nc", "dl-insts")
-TARGET_BUILTIN(__builtin_amdgcn_udot8, "UiUiUiUi", "nc", "dl-insts")
+TARGET_BUILTIN(__builtin_amdgcn_fdot2, "fV2hV2hfIb", "nc", "dl-insts")
+TARGET_BUILTIN(__builtin_amdgcn_sdot2, "SiV2SsV2SsSiIb", "nc", "dl-insts")
+TARGET_BUILTIN(__builtin_amdgcn_udot2, "UiV2UsV2UsUiIb", "nc", "dl-insts")
+TARGET_BUILTIN(__builtin_amdgcn_sdot4, "SiSiSiSiIb", "nc", "dl-insts")
+TARGET_BUILTIN(__builtin_amdgcn_udot4, "UiUiUiUiIb", "nc", "dl-insts")
+TARGET_BUILTIN(__builtin_amdgcn_sdot8, "SiSiSiSiIb", "nc", "dl-insts")
+TARGET_BUILTIN(__builtin_amdgcn_udot8, "UiUiUiUiIb", "nc", "dl-insts")
//===----------------------------------------------------------------------===//
// Special builtins.
diff --git a/include/clang/Basic/BuiltinsPPC.def b/include/clang/Basic/BuiltinsPPC.def
index 8cd8a2be2003..9be760853d50 100644
--- a/include/clang/Basic/BuiltinsPPC.def
+++ b/include/clang/Basic/BuiltinsPPC.def
@@ -58,7 +58,7 @@ BUILTIN(__builtin_altivec_vctuxs, "V4UiV4fIi", "")
BUILTIN(__builtin_altivec_dss, "vUi", "")
BUILTIN(__builtin_altivec_dssall, "v", "")
-BUILTIN(__builtin_altivec_dst, "vvC*iUi", "")
+BUILTIN(__builtin_altivec_dst, "vvC*iUi", "")
BUILTIN(__builtin_altivec_dstt, "vvC*iUi", "")
BUILTIN(__builtin_altivec_dstst, "vvC*iUi", "")
BUILTIN(__builtin_altivec_dststt, "vvC*iUi", "")
diff --git a/include/clang/Basic/Diagnostic.h b/include/clang/Basic/Diagnostic.h
index 5205b4c210a6..d30ac14e02fe 100644
--- a/include/clang/Basic/Diagnostic.h
+++ b/include/clang/Basic/Diagnostic.h
@@ -25,7 +25,7 @@
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/iterator_range.h"
-#include "llvm/Support/Compiler.h"
+#include "llvm/Support/Compiler.h"
#include <cassert>
#include <cstdint>
#include <limits>
@@ -86,7 +86,7 @@ public:
bool isNull() const {
return !RemoveRange.isValid();
}
-
+
/// Create a code modification hint that inserts the given
/// code string at a specific location.
static FixItHint CreateInsertion(SourceLocation InsertionLoc,
@@ -99,7 +99,7 @@ public:
Hint.BeforePreviousInsertions = BeforePreviousInsertions;
return Hint;
}
-
+
/// Create a code modification hint that inserts the given
/// code from \p FromRange at a specific location.
static FixItHint CreateInsertionFromRange(SourceLocation InsertionLoc,
@@ -123,7 +123,7 @@ public:
static FixItHint CreateRemoval(SourceRange RemoveRange) {
return CreateRemoval(CharSourceRange::getTokenRange(RemoveRange));
}
-
+
/// Create a code modification hint that replaces the given
/// source range with the given code string.
static FixItHint CreateReplacement(CharSourceRange RemoveRange,
@@ -133,7 +133,7 @@ public:
Hint.CodeToInsert = Code;
return Hint;
}
-
+
static FixItHint CreateReplacement(SourceRange RemoveRange,
StringRef Code) {
return CreateReplacement(CharSourceRange::getTokenRange(RemoveRange), Code);
@@ -348,7 +348,7 @@ private:
unsigned Offset;
DiagStatePoint(DiagState *State, unsigned Offset)
- : State(State), Offset(Offset) {}
+ : State(State), Offset(Offset) {}
};
/// Description of the diagnostic states and state transitions for a
@@ -420,7 +420,7 @@ private:
/// Indicates that an unrecoverable error has occurred.
bool UnrecoverableErrorOccurred;
-
+
/// Counts for DiagnosticErrorTrap to check whether an error occurred
/// during a parsing section, e.g. during parsing a function.
unsigned TrapNumErrorsOccurred;
@@ -556,7 +556,7 @@ public:
///
/// Zero disables the limit.
void setErrorLimit(unsigned Limit) { ErrorLimit = Limit; }
-
+
/// Specify the maximum number of template instantiation
/// notes to emit along with a given diagnostic.
void setTemplateBacktraceLimit(unsigned Limit) {
@@ -626,11 +626,11 @@ public:
return GetCurDiagState()->SuppressSystemWarnings;
}
- /// Suppress all diagnostics, to silence the front end when we
+ /// Suppress all diagnostics, to silence the front end when we
/// know that we don't want any more diagnostics to be passed along to the
/// client
- void setSuppressAllDiagnostics(bool Val = true) {
- SuppressAllDiagnostics = Val;
+ void setSuppressAllDiagnostics(bool Val = true) {
+ SuppressAllDiagnostics = Val;
}
bool getSuppressAllDiagnostics() const { return SuppressAllDiagnostics; }
@@ -638,12 +638,12 @@ public:
/// template types.
void setElideType(bool Val = true) { ElideType = Val; }
bool getElideType() { return ElideType; }
-
+
/// Set tree printing, to outputting the template difference in a
/// tree format.
void setPrintTemplateTree(bool Val = false) { PrintTemplateTree = Val; }
bool getPrintTemplateTree() { return PrintTemplateTree; }
-
+
/// Set color printing, so the type diffing will inject color markers
/// into the output.
void setShowColors(bool Val = false) { ShowColors = Val; }
@@ -657,7 +657,7 @@ public:
ShowOverloads = Val;
}
OverloadsShown getShowOverloads() const { return ShowOverloads; }
-
+
/// Pretend that the last diagnostic issued was ignored, so any
/// subsequent notes will be suppressed, or restore a prior ignoring
/// state after ignoring some diagnostics and their notes, possibly in
@@ -751,12 +751,12 @@ public:
return UncompilableErrorOccurred;
}
bool hasFatalErrorOccurred() const { return FatalErrorOccurred; }
-
+
/// Determine whether any kind of unrecoverable error has occurred.
bool hasUnrecoverableErrorOccurred() const {
return FatalErrorOccurred || UnrecoverableErrorOccurred;
}
-
+
unsigned getNumWarnings() const { return NumWarnings; }
void setNumWarnings(unsigned NumWarnings) {
@@ -799,10 +799,10 @@ public:
LastDiagLevel = Other.LastDiagLevel;
}
- /// Reset the state of the diagnostic object to its initial
+ /// Reset the state of the diagnostic object to its initial
/// configuration.
void Reset();
-
+
//===--------------------------------------------------------------------===//
// DiagnosticsEngine classification and reporting interfaces.
//
@@ -875,7 +875,7 @@ public:
/// DiagnosticsEngine object itself.
void SetDelayedDiagnostic(unsigned DiagID, StringRef Arg1 = "",
StringRef Arg2 = "");
-
+
/// Clear out the current diagnostic.
void Clear() { CurDiagID = std::numeric_limits<unsigned>::max(); }
@@ -894,7 +894,7 @@ private:
friend class DiagnosticErrorTrap;
friend class DiagnosticIDs;
friend class PartialDiagnostic;
-
+
/// Report the delayed diagnostic.
void ReportDelayed();
@@ -1042,7 +1042,7 @@ public:
class DiagnosticBuilder {
friend class DiagnosticsEngine;
friend class PartialDiagnostic;
-
+
mutable DiagnosticsEngine *DiagObj = nullptr;
mutable unsigned NumArgs = 0;
@@ -1105,7 +1105,7 @@ protected:
return Result;
}
-
+
public:
/// Copy constructor. When copied, this "takes" the diagnostic info from the
/// input and neuters it.
@@ -1430,8 +1430,8 @@ public:
};
/**
- * Represents a diagnostic in a form that can be retained until its
- * corresponding source manager is destroyed.
+ * Represents a diagnostic in a form that can be retained until its
+ * corresponding source manager is destroyed.
*/
class StoredDiagnostic {
unsigned ID;
@@ -1444,9 +1444,9 @@ class StoredDiagnostic {
public:
StoredDiagnostic() = default;
StoredDiagnostic(DiagnosticsEngine::Level Level, const Diagnostic &Info);
- StoredDiagnostic(DiagnosticsEngine::Level Level, unsigned ID,
+ StoredDiagnostic(DiagnosticsEngine::Level Level, unsigned ID,
StringRef Message);
- StoredDiagnostic(DiagnosticsEngine::Level Level, unsigned ID,
+ StoredDiagnostic(DiagnosticsEngine::Level Level, unsigned ID,
StringRef Message, FullSourceLoc Loc,
ArrayRef<CharSourceRange> Ranges,
ArrayRef<FixItHint> Fixits);
@@ -1466,7 +1466,7 @@ public:
range_iterator range_begin() const { return Ranges.begin(); }
range_iterator range_end() const { return Ranges.end(); }
unsigned range_size() const { return Ranges.size(); }
-
+
ArrayRef<CharSourceRange> getRanges() const {
return llvm::makeArrayRef(Ranges);
}
@@ -1476,7 +1476,7 @@ public:
fixit_iterator fixit_begin() const { return FixIts.begin(); }
fixit_iterator fixit_end() const { return FixIts.end(); }
unsigned fixit_size() const { return FixIts.size(); }
-
+
ArrayRef<FixItHint> getFixIts() const {
return llvm::makeArrayRef(FixIts);
}
@@ -1488,7 +1488,7 @@ class DiagnosticConsumer {
protected:
unsigned NumWarnings = 0; ///< Number of warnings reported
unsigned NumErrors = 0; ///< Number of errors reported
-
+
public:
DiagnosticConsumer() = default;
virtual ~DiagnosticConsumer();
@@ -1506,7 +1506,7 @@ public:
/// in between BeginSourceFile() and EndSourceFile().
///
/// \param LangOpts The language options for the source file being processed.
- /// \param PP The preprocessor object being used for the source; this is
+ /// \param PP The preprocessor object being used for the source; this is
/// optional, e.g., it may not be present when processing AST source files.
virtual void BeginSourceFile(const LangOptions &LangOpts,
const Preprocessor *PP = nullptr) {}
diff --git a/include/clang/Basic/DiagnosticASTKinds.td b/include/clang/Basic/DiagnosticASTKinds.td
index 4fa1db96cb89..3358fc3d70c7 100644
--- a/include/clang/Basic/DiagnosticASTKinds.td
+++ b/include/clang/Basic/DiagnosticASTKinds.td
@@ -163,12 +163,26 @@ def note_constexpr_unsupported_unsized_array : Note<
def note_constexpr_unsized_array_indexed : Note<
"indexing of array without known bound is not allowed "
"in a constant expression">;
+def note_constexpr_memcpy_type_pun : Note<
+ "cannot constant evaluate '%select{memcpy|memmove}0' from object of "
+ "type %1 to object of type %2">;
+def note_constexpr_memcpy_nontrivial : Note<
+ "cannot constant evaluate '%select{memcpy|memmove}0' between objects of "
+ "non-trivially-copyable type %1">;
+def note_constexpr_memcpy_overlap : Note<
+ "'%select{memcpy|wmemcpy}0' between overlapping memory regions">;
+def note_constexpr_memcpy_unsupported : Note<
+ "'%select{%select{memcpy|wmemcpy}1|%select{memmove|wmemmove}1}0' "
+ "not supported: %select{"
+ "size to copy (%4) is not a multiple of size of element type %3 (%5)|"
+ "source is not a contiguous array of at least %4 elements of type %3|"
+ "destination is not a contiguous array of at least %4 elements of type %3}2">;
def warn_integer_constant_overflow : Warning<
"overflow in expression; result is %0 with type %1">,
InGroup<DiagGroup<"integer-overflow">>;
-// This is a temporary diagnostic, and shall be removed once our
+// This is a temporary diagnostic, and shall be removed once our
// implementation is complete, and like the preceding constexpr notes belongs
// in Sema.
def note_unimplemented_constexpr_lambda_feature_ast : Note<
diff --git a/include/clang/Basic/DiagnosticCommentKinds.td b/include/clang/Basic/DiagnosticCommentKinds.td
index ab24582c1180..ebe62e4738f0 100644
--- a/include/clang/Basic/DiagnosticCommentKinds.td
+++ b/include/clang/Basic/DiagnosticCommentKinds.td
@@ -83,19 +83,19 @@ def warn_doc_function_method_decl_mismatch : Warning<
"%select{a function|a function|an Objective-C method|an Objective-C method|"
"a pointer to function}2 declaration">,
InGroup<Documentation>, DefaultIgnore;
-
+
def warn_doc_api_container_decl_mismatch : Warning<
"'%select{\\|@}0%select{class|interface|protocol|struct|union}1' "
"command should not be used in a comment attached to a "
"non-%select{class|interface|protocol|struct|union}2 declaration">,
InGroup<Documentation>, DefaultIgnore;
-
+
def warn_doc_container_decl_mismatch : Warning<
"'%select{\\|@}0%select{classdesign|coclass|dependency|helper"
"|helperclass|helps|instancesize|ownership|performance|security|superclass}1' "
"command should not be used in a comment attached to a non-container declaration">,
InGroup<Documentation>, DefaultIgnore;
-
+
def warn_doc_param_duplicate : Warning<
"parameter '%0' is already documented">,
InGroup<Documentation>, DefaultIgnore;
diff --git a/include/clang/Basic/DiagnosticCommonKinds.td b/include/clang/Basic/DiagnosticCommonKinds.td
index 61a73541d0b3..b98b183c9d6f 100644
--- a/include/clang/Basic/DiagnosticCommonKinds.td
+++ b/include/clang/Basic/DiagnosticCommonKinds.td
@@ -16,7 +16,7 @@ let Component = "Common" in {
// Basic.
def fatal_too_many_errors
- : Error<"too many errors emitted, stopping now">, DefaultFatal;
+ : Error<"too many errors emitted, stopping now">, DefaultFatal;
def note_declared_at : Note<"declared here">;
def note_previous_definition : Note<"previous definition is here">;
@@ -97,11 +97,11 @@ def remark_module_lock_timeout : Remark<
def err_module_shadowed : Error<"import of shadowed module '%0'">, DefaultFatal;
def err_module_build_shadowed_submodule : Error<
"build a shadowed submodule '%0'">, DefaultFatal;
-def err_module_cycle : Error<"cyclic dependency in module '%0': %1">,
+def err_module_cycle : Error<"cyclic dependency in module '%0': %1">,
DefaultFatal;
def err_module_prebuilt : Error<
"error in loading module '%0' from prebuilt module path">, DefaultFatal;
-def note_pragma_entered_here : Note<"#pragma entered here">;
+def note_pragma_entered_here : Note<"#pragma entered here">;
def note_decl_hiding_tag_type : Note<
"%1 %0 is hidden by a non-type declaration of %0 here">;
def err_attribute_not_type_attr : Error<
@@ -115,7 +115,7 @@ let CategoryName = "Nullability Issue" in {
def warn_nullability_duplicate : Warning<
"duplicate nullability specifier %0">,
InGroup<Nullability>;
-
+
def warn_conflicting_nullability_attr_overriding_ret_types : Warning<
"conflicting nullability specifier on return types, %0 "
"conflicts with existing specifier %1">,
@@ -223,7 +223,7 @@ def err_unable_to_rename_temp : Error<
"unable to rename temporary '%0' to output file '%1': '%2'">;
def err_unable_to_make_temp : Error<
"unable to make temporary file: %0">;
-
+
// Modules
def err_module_format_unhandled : Error<
"no handler registered for module format '%0'">, DefaultFatal;
diff --git a/include/clang/Basic/DiagnosticDriverKinds.td b/include/clang/Basic/DiagnosticDriverKinds.td
index a6be0595e1ae..7f75f45c6578 100644
--- a/include/clang/Basic/DiagnosticDriverKinds.td
+++ b/include/clang/Basic/DiagnosticDriverKinds.td
@@ -208,7 +208,7 @@ def err_drv_omp_host_target_not_supported : Error<
def err_drv_expecting_fopenmp_with_fopenmp_targets : Error<
"The option -fopenmp-targets must be used in conjunction with a -fopenmp option compatible with offloading, please use -fopenmp=libomp or -fopenmp=libiomp5.">;
def warn_drv_omp_offload_target_duplicate : Warning<
- "The OpenMP offloading target '%0' is similar to target '%1' already specified - will be ignored.">,
+ "The OpenMP offloading target '%0' is similar to target '%1' already specified - will be ignored.">,
InGroup<OpenMPTarget>;
def warn_drv_omp_offload_target_missingbcruntime : Warning<
"No library '%0' found in the default clang lib directory or in LIBRARY_PATH. Expect degraded performance due to no inlining of runtime functions on target devices.">,
@@ -226,6 +226,9 @@ def warn_ignored_clang_option : Warning<"the flag '%0' has been deprecated and w
def warn_drv_unsupported_opt_for_target : Warning<
"optimization flag '%0' is not supported for target '%1'">,
InGroup<IgnoredOptimizationArgument>;
+def warn_drv_unsupported_debug_info_opt_for_target : Warning<
+ "debug information option '%0' is not supported for target '%1'">,
+ InGroup<UnsupportedTargetOpt>;
def warn_c_kext : Warning<
"ignoring -fapple-kext which is valid for C++ and Objective-C++ only">;
def warn_drv_input_file_unused : Warning<
diff --git a/include/clang/Basic/DiagnosticFrontendKinds.td b/include/clang/Basic/DiagnosticFrontendKinds.td
index 6add448871fe..66287933b7ca 100644
--- a/include/clang/Basic/DiagnosticFrontendKinds.td
+++ b/include/clang/Basic/DiagnosticFrontendKinds.td
@@ -36,7 +36,7 @@ def remark_fe_backend_plugin: Remark<"%0">, BackendInfo, InGroup<RemarkBackendPl
def note_fe_backend_plugin: Note<"%0">, BackendInfo;
def warn_fe_override_module : Warning<
- "overriding the module target triple with %0">,
+ "overriding the module target triple with %0">,
InGroup<DiagGroup<"override-module">>;
def remark_fe_backend_optimization_remark : Remark<"%0">, BackendInfo,
@@ -190,10 +190,10 @@ def err_module_interface_requires_modules_ts : Error<
def warn_module_config_mismatch : Warning<
"module file %0 cannot be loaded due to a configuration mismatch with the current "
"compilation">, InGroup<DiagGroup<"module-file-config-mismatch">>, DefaultError;
-def err_module_map_not_found : Error<"module map file '%0' not found">,
+def err_module_map_not_found : Error<"module map file '%0' not found">,
DefaultFatal;
def err_missing_module_name : Error<
- "no module name provided; specify one with -fmodule-name=">,
+ "no module name provided; specify one with -fmodule-name=">,
DefaultFatal;
def err_missing_module : Error<
"no module named '%0' declared in module map file '%1'">, DefaultFatal;
diff --git a/include/clang/Basic/DiagnosticGroups.td b/include/clang/Basic/DiagnosticGroups.td
index 7087db7f0fb8..2156ef93c19f 100644
--- a/include/clang/Basic/DiagnosticGroups.td
+++ b/include/clang/Basic/DiagnosticGroups.td
@@ -72,6 +72,7 @@ def UnsupportedNan : DiagGroup<"unsupported-nan">;
def UnsupportedAbs : DiagGroup<"unsupported-abs">;
def UnsupportedCB : DiagGroup<"unsupported-cb">;
def UnsupportedGPOpt : DiagGroup<"unsupported-gpopt">;
+def UnsupportedTargetOpt : DiagGroup<"unsupported-target-opt">;
def NonLiteralNullConversion : DiagGroup<"non-literal-null-conversion">;
def NullConversion : DiagGroup<"null-conversion">;
def ImplicitConversionFloatingPointToBool :
@@ -287,7 +288,7 @@ def IgnoredQualifiers : DiagGroup<"ignored-qualifiers">;
def : DiagGroup<"import">;
def GNUIncludeNext : DiagGroup<"gnu-include-next">;
def IncompatibleMSStruct : DiagGroup<"incompatible-ms-struct">;
-def IncompatiblePointerTypesDiscardsQualifiers
+def IncompatiblePointerTypesDiscardsQualifiers
: DiagGroup<"incompatible-pointer-types-discards-qualifiers">;
def IncompatibleFunctionPointerTypes
: DiagGroup<"incompatible-function-pointer-types">;
@@ -799,14 +800,14 @@ def Most : DiagGroup<"most", [
UserDefinedWarnings
]>;
-// Thread Safety warnings
+// Thread Safety warnings
def ThreadSafetyAttributes : DiagGroup<"thread-safety-attributes">;
def ThreadSafetyAnalysis : DiagGroup<"thread-safety-analysis">;
def ThreadSafetyPrecise : DiagGroup<"thread-safety-precise">;
def ThreadSafetyReference : DiagGroup<"thread-safety-reference">;
def ThreadSafetyNegative : DiagGroup<"thread-safety-negative">;
def ThreadSafety : DiagGroup<"thread-safety",
- [ThreadSafetyAttributes,
+ [ThreadSafetyAttributes,
ThreadSafetyAnalysis,
ThreadSafetyPrecise,
ThreadSafetyReference]>;
diff --git a/include/clang/Basic/DiagnosticIDs.h b/include/clang/Basic/DiagnosticIDs.h
index b610af953fba..983dcb21cfdf 100644
--- a/include/clang/Basic/DiagnosticIDs.h
+++ b/include/clang/Basic/DiagnosticIDs.h
@@ -214,7 +214,7 @@ public:
bool ignored;
return isBuiltinExtensionDiag(DiagID, ignored);
}
-
+
/// Determine whether the given built-in diagnostic ID is for an
/// extension of some sort, and whether it is enabled by default.
///
@@ -223,14 +223,14 @@ public:
/// treated as a warning/error by default.
///
static bool isBuiltinExtensionDiag(unsigned DiagID, bool &EnabledByDefault);
-
+
/// Return the lowest-level warning option that enables the specified
/// diagnostic.
///
/// If there is no -Wfoo flag that controls the diagnostic, this returns null.
static StringRef getWarningOptionForDiag(unsigned DiagID);
-
+
/// Return the category number that a specified \p DiagID belongs to,
/// or 0 if no category.
static unsigned getCategoryNumberForDiag(unsigned DiagID);
@@ -240,7 +240,7 @@ public:
/// Given a category ID, return the name of the category.
static StringRef getCategoryNameFromID(unsigned CategoryID);
-
+
/// Return true if a given diagnostic falls into an ARC diagnostic
/// category.
static bool isARCDiagnostic(unsigned DiagID);
@@ -251,26 +251,26 @@ public:
/// The diagnostic should not be reported, but it should cause
/// template argument deduction to fail.
///
- /// The vast majority of errors that occur during template argument
+ /// The vast majority of errors that occur during template argument
/// deduction fall into this category.
SFINAE_SubstitutionFailure,
-
+
/// The diagnostic should be suppressed entirely.
///
/// Warnings generally fall into this category.
SFINAE_Suppress,
-
+
/// The diagnostic should be reported.
///
- /// The diagnostic should be reported. Various fatal errors (e.g.,
+ /// The diagnostic should be reported. Various fatal errors (e.g.,
/// template instantiation depth exceeded) fall into this category.
SFINAE_Report,
-
+
/// The diagnostic is an access-control diagnostic, which will be
/// substitution failures in some contexts and reported in others.
SFINAE_AccessControl
};
-
+
/// Determines whether the given built-in diagnostic ID is
/// for an error that is suppressed if it occurs during C++ template
/// argument deduction.
@@ -306,7 +306,7 @@ public:
private:
/// Classify the specified diagnostic ID into a Level, consumable by
/// the DiagnosticClient.
- ///
+ ///
/// The classification is based on the way the client configured the
/// DiagnosticsEngine object.
///
diff --git a/include/clang/Basic/DiagnosticLexKinds.td b/include/clang/Basic/DiagnosticLexKinds.td
index b5b5e8f654bc..1c960711bccb 100644
--- a/include/clang/Basic/DiagnosticLexKinds.td
+++ b/include/clang/Basic/DiagnosticLexKinds.td
@@ -53,7 +53,7 @@ def ext_multi_line_line_comment : Extension<"multi-line // comment">,
def ext_line_comment : Extension<
"// comments are not allowed in this language">,
InGroup<Comment>;
-def ext_no_newline_eof : Extension<"no newline at end of file">,
+def ext_no_newline_eof : Extension<"no newline at end of file">,
InGroup<NewlineEOF>;
def warn_no_newline_eof : Warning<"no newline at end of file">,
InGroup<NewlineEOF>, DefaultIgnore;
@@ -294,7 +294,7 @@ def pp_nonportable_path : NonportablePath,
InGroup<DiagGroup<"nonportable-include-path">>;
def pp_nonportable_system_path : NonportablePath, DefaultIgnore,
InGroup<DiagGroup<"nonportable-system-include-path">>;
-
+
def pp_pragma_once_in_main_file : Warning<"#pragma once in main file">,
InGroup<DiagGroup<"pragma-once-outside-header">>;
def pp_pragma_sysheader_in_main_file : Warning<
@@ -353,7 +353,7 @@ def ext_pp_warning_directive : Extension<"#warning is a language extension">;
def ext_pp_extra_tokens_at_eol : ExtWarn<
"extra tokens at end of #%0 directive">, InGroup<ExtraTokens>;
-
+
def ext_pp_comma_expr : Extension<"comma operator in operand of #if">;
def ext_pp_bad_vaargs_use : Extension<
"__VA_ARGS__ can only appear in the expansion of a C99 variadic macro">;
@@ -594,7 +594,7 @@ def err_pp_illegal_floating_literal : Error<
def err_pp_line_requires_integer : Error<
"#line directive requires a positive integer argument">;
def ext_pp_line_zero : Extension<
- "#line directive with zero argument is a GNU extension">,
+ "#line directive with zero argument is a GNU extension">,
InGroup<GNUZeroLineDirective>;
def err_pp_line_invalid_filename : Error<
"invalid filename for #line directive">;
@@ -736,7 +736,7 @@ def warn_auto_module_import : Warning<
def note_implicit_top_level_module_import_here : Note<
"submodule of top-level module '%0' implicitly imported here">;
def warn_uncovered_module_header : Warning<
- "umbrella header for module '%0' does not include header '%1'">,
+ "umbrella header for module '%0' does not include header '%1'">,
InGroup<IncompleteUmbrella>;
def warn_mmap_umbrella_dir_not_found : Warning<
"umbrella directory '%0' not found">,
@@ -755,7 +755,7 @@ def warn_non_modular_include_in_module : Warning<
"include of non-modular header inside module '%0': '%1'">,
InGroup<NonModularIncludeInModule>, DefaultIgnore;
def warn_module_conflict : Warning<
- "module '%0' conflicts with already-imported module '%1': %2">,
+ "module '%0' conflicts with already-imported module '%1': %2">,
InGroup<ModuleConflict>;
def warn_header_guard : Warning<
diff --git a/include/clang/Basic/DiagnosticOptions.def b/include/clang/Basic/DiagnosticOptions.def
index 2467b24fd909..22645654afd8 100644
--- a/include/clang/Basic/DiagnosticOptions.def
+++ b/include/clang/Basic/DiagnosticOptions.def
@@ -61,9 +61,9 @@ DIAGOPT(ShowOptionNames, 1, 0) /// Show the option name for mappable
DIAGOPT(ShowNoteIncludeStack, 1, 0) /// Show include stacks for notes.
VALUE_DIAGOPT(ShowCategories, 2, 0) /// Show categories: 0 -> none, 1 -> Number,
/// 2 -> Full Name.
-
-ENUM_DIAGOPT(Format, TextDiagnosticFormat, 2, Clang) /// Format for diagnostics:
-
+
+ENUM_DIAGOPT(Format, TextDiagnosticFormat, 2, Clang) /// Format for diagnostics:
+
DIAGOPT(ShowColors, 1, 0) /// Show diagnostics with ANSI color sequences.
ENUM_DIAGOPT(ShowOverloads, OverloadsShown, 1,
Ovl_All) /// Overload candidates to show.
diff --git a/include/clang/Basic/DiagnosticOptions.h b/include/clang/Basic/DiagnosticOptions.h
index 391e252eaddd..4c5bcb4e8793 100644
--- a/include/clang/Basic/DiagnosticOptions.h
+++ b/include/clang/Basic/DiagnosticOptions.h
@@ -91,7 +91,7 @@ protected:
public:
/// The file to log diagnostic output to.
std::string DiagnosticLogFile;
-
+
/// The file to serialize diagnostics to (non-appending).
std::string DiagnosticSerializationFile;
diff --git a/include/clang/Basic/DiagnosticParseKinds.td b/include/clang/Basic/DiagnosticParseKinds.td
index dd4c81922592..609dca4f075c 100644
--- a/include/clang/Basic/DiagnosticParseKinds.td
+++ b/include/clang/Basic/DiagnosticParseKinds.td
@@ -86,7 +86,7 @@ def err_enumerator_list_missing_comma : Error<
def err_enumerator_unnamed_no_def : Error<
"unnamed enumeration must be a definition">;
def ext_cxx11_enum_fixed_underlying_type : Extension<
- "enumeration types with a fixed underlying type are a C++11 extension">,
+ "enumeration types with a fixed underlying type are a C++11 extension">,
InGroup<CXX11>;
def ext_c_enum_fixed_underlying_type : Extension<
"enumeration types with a fixed underlying type are a Microsoft extension">,
@@ -101,7 +101,7 @@ def ext_alignof_expr : ExtWarn<
"%0 applied to an expression is a GNU extension">, InGroup<GNUAlignofExpression>;
def warn_microsoft_dependent_exists : Warning<
- "dependent %select{__if_not_exists|__if_exists}0 declarations are ignored">,
+ "dependent %select{__if_not_exists|__if_exists}0 declarations are ignored">,
InGroup<DiagGroup<"microsoft-exists">>;
def warn_microsoft_qualifiers_ignored : Warning<
"qualifiers after comma in declarator list are ignored">,
@@ -134,14 +134,14 @@ def ext_gnu_conditional_expr : Extension<
"use of GNU ?: conditional expression extension, omitting middle operand">, InGroup<GNUConditionalOmittedOperand>;
def ext_gnu_empty_initializer : Extension<
"use of GNU empty initializer extension">, InGroup<GNUEmptyInitializer>;
-def ext_gnu_array_range : Extension<"use of GNU array range extension">,
+def ext_gnu_array_range : Extension<"use of GNU array range extension">,
InGroup<GNUDesignator>;
def ext_gnu_missing_equal_designator : ExtWarn<
- "use of GNU 'missing =' extension in designator">,
+ "use of GNU 'missing =' extension in designator">,
InGroup<GNUDesignator>;
def err_expected_equal_designator : Error<"expected '=' or another designator">;
def ext_gnu_old_style_field_designator : ExtWarn<
- "use of GNU old-style field designator extension">,
+ "use of GNU old-style field designator extension">,
InGroup<GNUDesignator>;
def ext_gnu_case_range : Extension<"use of GNU case range extension">,
InGroup<GNUCaseRange>;
@@ -168,16 +168,16 @@ def err_unexpected_semi : Error<"unexpected ';' before %0">;
def err_expected_fn_body : Error<
"expected function body after function declarator">;
def warn_attribute_on_function_definition : Warning<
- "GCC does not allow %0 attribute in this position on a function definition">,
+ "GCC does not allow %0 attribute in this position on a function definition">,
InGroup<GccCompat>;
def warn_gcc_attribute_location : Warning<
- "GCC does not allow an attribute in this position on a function declaration">,
+ "GCC does not allow an attribute in this position on a function declaration">,
InGroup<GccCompat>;
def warn_gcc_variable_decl_in_for_loop : Warning<
"GCC does not allow variable declarations in for loop initializers before "
"C99">, InGroup<GccCompat>;
def warn_attribute_no_decl : Warning<
- "attribute %0 ignored, because it is not attached to a declaration">,
+ "attribute %0 ignored, because it is not attached to a declaration">,
InGroup<IgnoredAttributes>;
def err_ms_attributes_not_enabled : Error<
"'__declspec' attributes are not enabled; use '-fdeclspec' or "
@@ -319,7 +319,7 @@ def warn_cxx98_compat_decltype : Warning<
def err_unexpected_scope_on_base_decltype : Error<
"unexpected namespace scope prior to decltype">;
def err_expected_class_name : Error<"expected class name">;
-def err_expected_class_name_not_template :
+def err_expected_class_name_not_template :
Error<"'typename' is redundant; base classes are implicitly types">;
def err_unspecified_vla_size_with_static : Error<
"'static' may not be used with an unspecified variable length array size">;
@@ -395,7 +395,7 @@ def warn_arc_bridge_cast_nonarc : Warning<
"'%0' casts have no effect when not using ARC">,
InGroup<DiagGroup<"arc-bridge-casts-disallowed-in-nonarc">>;
}
-
+
def err_objc_illegal_visibility_spec : Error<
"illegal visibility specification">;
def err_objc_illegal_interface_qual : Error<"illegal interface qualifier">;
@@ -687,7 +687,7 @@ def warn_cxx98_compat_extern_template : Warning<
def warn_static_inline_explicit_inst_ignored : Warning<
"ignoring '%select{static|inline}0' keyword on explicit template "
"instantiation">, InGroup<DiagGroup<"static-inline-explicit-instantiation">>;
-
+
// Constructor template diagnostics.
def err_out_of_line_constructor_template_id : Error<
"out-of-line constructor for %0 cannot have template arguments">;
@@ -703,7 +703,7 @@ def err_expected_type_name_after_typename : Error<
"expected an identifier or template-id after '::'">;
def err_explicit_spec_non_template : Error<
"explicit %select{specialization|instantiation}0 of non-template %1 %2">;
-
+
def err_default_template_template_parameter_not_template : Error<
"default template argument for a template template parameter must be a class "
"template">;
@@ -850,7 +850,7 @@ def err_zero_version : Error<
"version number must have non-zero major, minor, or sub-minor version">;
def err_availability_expected_platform : Error<
"expected a platform name, e.g., 'macos'">;
-
+
// objc_bridge_related attribute
def err_objcbridge_related_expected_related_class : Error<
"expected a related ObjectiveC class name, e.g., 'NSColor'">;
@@ -994,7 +994,7 @@ def warn_pragma_init_seg_unsupported_target : Warning<
// - #pragma fp_contract
def err_pragma_fp_contract_scope : Error<
"'#pragma fp_contract' can only appear at file scope or at the start of a "
- "compound statement">;
+ "compound statement">;
// - #pragma stdc unknown
def ext_stdc_pragma_ignored : ExtWarn<"unknown pragma in STDC namespace">,
InGroup<UnknownPragmas>;
diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td
index d0a2bec78052..586f65e9201c 100644
--- a/include/clang/Basic/DiagnosticSemaKinds.td
+++ b/include/clang/Basic/DiagnosticSemaKinds.td
@@ -243,7 +243,7 @@ def err_invalid_vector_double_decl_spec : Error <
"(available on POWER7 or later)">;
def err_invalid_vector_long_long_decl_spec : Error <
"use of 'long long' with '__vector bool' requires VSX support (available on "
- "POWER7 or later) or extended Altivec support (available on POWER8 or later) "
+ "POWER7 or later) or extended Altivec support (available on POWER8 or later) "
"to be enabled">;
def err_invalid_vector_long_double_decl_spec : Error<
"cannot use 'long double' with '__vector'">;
@@ -388,7 +388,7 @@ def err_inline_non_function : Error<
"'inline' can only appear on functions%select{| and non-local variables}0">;
def err_noreturn_non_function : Error<
"'_Noreturn' can only appear on functions">;
-def warn_qual_return_type : Warning<
+def warn_qual_return_type : Warning<
"'%0' type qualifier%s1 on return type %plural{1:has|:have}1 no effect">,
InGroup<IgnoredQualifiers>, DefaultIgnore;
def warn_deprecated_redundant_constexpr_static_def : Warning<
@@ -640,8 +640,8 @@ def warn_dyn_class_memaccess : Warning<
def note_bad_memaccess_silence : Note<
"explicitly cast the pointer to silence this warning">;
def warn_sizeof_pointer_expr_memaccess : Warning<
- "'%0' call operates on objects of type %1 while the size is based on a "
- "different type %2">,
+ "'%0' call operates on objects of type %1 while the size is based on a "
+ "different type %2">,
InGroup<SizeofPointerMemaccess>;
def warn_sizeof_pointer_expr_memaccess_note : Note<
"did you mean to %select{dereference the argument to 'sizeof' (and multiply "
@@ -679,14 +679,14 @@ def note_suspicious_bzero_size_silence : Note<
"parenthesize the second argument to silence">;
def warn_strncat_large_size : Warning<
- "the value of the size argument in 'strncat' is too large, might lead to a "
+ "the value of the size argument in 'strncat' is too large, might lead to a "
"buffer overflow">, InGroup<StrncatSize>;
-def warn_strncat_src_size : Warning<"size argument in 'strncat' call appears "
+def warn_strncat_src_size : Warning<"size argument in 'strncat' call appears "
"to be size of the source">, InGroup<StrncatSize>;
def warn_strncat_wrong_size : Warning<
"the value of the size argument to 'strncat' is wrong">, InGroup<StrncatSize>;
def note_strncat_wrong_size : Note<
- "change the argument to be the free space in the destination buffer minus "
+ "change the argument to be the free space in the destination buffer minus "
"the terminating null byte">;
def warn_assume_side_effects : Warning<
@@ -1030,15 +1030,15 @@ def note_property_attribute : Note<"property %0 is declared "
"%select{deprecated|unavailable|partial}1 here">;
def err_setter_type_void : Error<"type of setter must be void">;
def err_duplicate_method_decl : Error<"duplicate declaration of method %0">;
-def warn_duplicate_method_decl :
- Warning<"multiple declarations of method %0 found and ignored">,
+def warn_duplicate_method_decl :
+ Warning<"multiple declarations of method %0 found and ignored">,
InGroup<MethodDuplicate>, DefaultIgnore;
def warn_objc_cdirective_format_string :
Warning<"using %0 directive in %select{NSString|CFString}1 "
"which is being passed as a formatting argument to the formatting "
"%select{method|CFfunction}2">,
InGroup<ObjCCStringFormat>, DefaultIgnore;
-def err_objc_var_decl_inclass :
+def err_objc_var_decl_inclass :
Error<"cannot declare variable inside @interface or @protocol">;
def err_missing_method_context : Error<
"missing context for method declaration">;
@@ -1250,7 +1250,7 @@ def warn_auto_implicit_atomic_property : Warning<
"property is assumed atomic when auto-synthesizing the property">,
InGroup<ImplicitAtomic>, DefaultIgnore;
def warn_unimplemented_selector: Warning<
- "no method with selector %0 is implemented in this translation unit">,
+ "no method with selector %0 is implemented in this translation unit">,
InGroup<Selector>, DefaultIgnore;
def warn_unimplemented_protocol_method : Warning<
"method %0 in protocol %1 not implemented">, InGroup<Protocol>;
@@ -1379,7 +1379,7 @@ def err_capture_default_non_local : Error<
"non-local lambda expression cannot have a capture-default">;
def err_multiple_final_overriders : Error<
- "virtual function %q0 has more than one final overrider in %1">;
+ "virtual function %q0 has more than one final overrider in %1">;
def note_final_overrider : Note<"final overrider of %q0 in %1">;
def err_type_defined_in_type_specifier : Error<
@@ -1421,7 +1421,7 @@ def warn_weak_template_vtable : Warning<
def ext_using_undefined_std : ExtWarn<
"using directive refers to implicitly-defined namespace 'std'">;
-
+
// C++ exception specifications
def err_exception_spec_in_typedef : Error<
"exception specifications are not allowed in %select{typedefs|type aliases}0">;
@@ -1475,7 +1475,7 @@ def ext_ms_using_declaration_inaccessible : ExtWarn<
"to accessible member '%1') is a Microsoft compatibility extension">,
AccessControl, InGroup<MicrosoftUsingDecl>;
def err_access_ctor : Error<
- "calling a %select{private|protected}0 constructor of class %2">,
+ "calling a %select{private|protected}0 constructor of class %2">,
AccessControl;
def ext_rvalue_to_reference_access_ctor : Extension<
"C++98 requires an accessible copy constructor for class %2 when binding "
@@ -1498,7 +1498,7 @@ def err_access_friend_function : Error<
AccessControl;
def err_access_dtor : Error<
- "calling a %select{private|protected}1 destructor of class %0">,
+ "calling a %select{private|protected}1 destructor of class %0">,
AccessControl;
def err_access_dtor_base :
Error<"base class %0 has %select{private|protected}1 destructor">,
@@ -1540,7 +1540,7 @@ def note_access_protected_restricted_object : Note<
def warn_cxx98_compat_sfinae_access_control : Warning<
"substitution failure due to access control is incompatible with C++98">,
InGroup<CXX98Compat>, DefaultIgnore, NoSFINAE;
-
+
// C++ name lookup
def err_incomplete_nested_name_spec : Error<
"incomplete type %0 named in nested name specifier">;
@@ -1733,6 +1733,8 @@ def warn_overriding_method_missing_noescape : Warning<
"__attribute__((noescape))">, InGroup<MissingNoEscape>;
def note_overridden_marked_noescape : Note<
"parameter of overridden method is annotated with __attribute__((noescape))">;
+def note_cat_conform_to_noescape_prot : Note<
+ "%select{category|class extension}0 conforms to protocol %1 which defines method %2">;
def err_covariant_return_inaccessible_base : Error<
"invalid covariant return for virtual function: %1 is a "
@@ -1979,7 +1981,7 @@ def note_explicit_ctor_deduction_guide_here : Note<
// C++11 decltype
def err_decltype_in_declarator : Error<
"'decltype' cannot be used to name a declaration">;
-
+
// C++11 auto
def warn_cxx98_compat_auto_type_specifier : Warning<
"'auto' type specifier is incompatible with C++98">,
@@ -2632,7 +2634,7 @@ def warn_objc_literal_comparison : Warning<
def err_missing_atsign_prefix : Error<
"string literal must be prefixed by '@' ">;
def warn_objc_string_literal_comparison : Warning<
- "direct comparison of a string literal has undefined behavior">,
+ "direct comparison of a string literal has undefined behavior">,
InGroup<ObjCStringComparison>;
def warn_concatenated_nsarray_literal : Warning<
"concatenated NSString literal for an NSArray expression - "
@@ -2746,7 +2748,7 @@ def warn_cxx11_gnu_attribute_on_type : Warning<
"attribute %0 ignored, because it cannot be applied to a type">,
InGroup<IgnoredAttributes>;
def warn_unhandled_ms_attribute_ignored : Warning<
- "__declspec attribute %0 is not supported">,
+ "__declspec attribute %0 is not supported">,
InGroup<IgnoredAttributes>;
def err_decl_attribute_invalid_on_stmt : Error<
"%0 attribute cannot be applied to a statement">;
@@ -3001,7 +3003,7 @@ def err_attribute_argument_out_of_range : Error<
"1:can only be 1, since there is one parameter|"
":must be between 1 and %2}2">;
-// Thread Safety Analysis
+// Thread Safety Analysis
def warn_unlock_but_no_lock : Warning<"releasing %0 '%1' that was not held">,
InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
def warn_unlock_kind_mismatch : Warning<
@@ -3015,7 +3017,7 @@ def warn_no_unlock : Warning<
InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
def warn_expecting_locked : Warning<
"expecting %0 '%1' to be held at the end of function">,
- InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
+ InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
// FIXME: improve the error message about locks not in scope
def warn_lock_some_predecessors : Warning<
"%0 '%1' is not held on every path through here">,
@@ -3092,13 +3094,13 @@ def warn_fun_requires_lock_precise :
def note_found_mutex_near_match : Note<"found near match '%0'">;
// Verbose thread safety warnings
-def warn_thread_safety_verbose : Warning<"Thread safety verbose warning.">,
+def warn_thread_safety_verbose : Warning<"Thread safety verbose warning.">,
InGroup<ThreadSafetyVerbose>, DefaultIgnore;
def note_thread_warning_in_fun : Note<"Thread warning in function %0">;
def note_guarded_by_declared_here : Note<"Guarded_by declared here.">;
-// Dummy warning that will trigger "beta" warnings from the analysis if enabled.
-def warn_thread_safety_beta : Warning<"Thread safety beta warning.">,
+// Dummy warning that will trigger "beta" warnings from the analysis if enabled.
+def warn_thread_safety_beta : Warning<"Thread safety beta warning.">,
InGroup<ThreadSafetyBeta>, DefaultIgnore;
// Consumed warnings
@@ -3354,7 +3356,7 @@ def err_attribute_sentinel_not_zero_or_one : Error<
"'sentinel' parameter 2 not 0 or 1">;
def warn_cleanup_ext : Warning<
"GCC does not allow the 'cleanup' attribute argument to be anything other "
- "than a simple identifier">,
+ "than a simple identifier">,
InGroup<GccCompat>;
def err_attribute_cleanup_arg_not_function : Error<
"'cleanup' argument %select{|%1 |%1 }0is not a %select{||single }0function">;
@@ -3389,7 +3391,7 @@ def warn_iboutlet_object_type : Warning<
def warn_iboutletcollection_property_assign : Warning<
"IBOutletCollection properties should be copy/strong and not assign">,
InGroup<ObjCInvalidIBOutletProperty>;
-
+
def err_attribute_overloadable_mismatch : Error<
"redeclaration of %0 must %select{not |}1have the 'overloadable' attribute">;
def note_attribute_overloadable_prev_overload : Note<
@@ -3854,7 +3856,7 @@ def note_template_param_different_kind : Note<
def err_invalid_decl_specifier_in_nontype_parm : Error<
"invalid declaration specifier in template non-type parameter">;
-
+
def err_template_nontype_parm_different_type : Error<
"template non-type parameter has a different type %0 in template "
"%select{|template parameter }1redeclaration">;
@@ -4156,7 +4158,7 @@ def err_dependent_typed_non_type_arg_in_partial_spec : Error<
def err_partial_spec_args_match_primary_template : Error<
"%select{class|variable}0 template partial specialization does not "
"specialize any template argument; to %select{declare|define}1 the "
- "primary template, remove the template argument list">;
+ "primary template, remove the template argument list">;
def ext_partial_spec_not_more_specialized_than_primary : ExtWarn<
"%select{class|variable}0 template partial specialization is not "
"more specialized than the primary template">, DefaultError,
@@ -4191,7 +4193,7 @@ def err_var_spec_no_template : Error<
def err_var_spec_no_template_but_method : Error<
"no variable template matches specialization; "
"did you mean to use %0 as function template instead?">;
-
+
// C++ Function template specializations
def err_function_template_spec_no_match : Error<
"no function template matches function template specialization %0">;
@@ -4312,12 +4314,12 @@ def err_explicit_instantiation_out_of_scope : Error<
def err_explicit_instantiation_must_be_global : Error<
"explicit instantiation of %0 must occur at global scope">;
def warn_explicit_instantiation_out_of_scope_0x : Warning<
- "explicit instantiation of %0 not in a namespace enclosing %1">,
+ "explicit instantiation of %0 not in a namespace enclosing %1">,
InGroup<CXX11Compat>, DefaultIgnore;
def warn_explicit_instantiation_must_be_global_0x : Warning<
- "explicit instantiation of %0 must occur at global scope">,
+ "explicit instantiation of %0 must occur at global scope">,
InGroup<CXX11Compat>, DefaultIgnore;
-
+
def err_explicit_instantiation_requires_name : Error<
"explicit instantiation declaration requires a name">;
def err_explicit_instantiation_of_typedef : Error<
@@ -4378,7 +4380,7 @@ def err_mismatched_exception_spec_explicit_instantiation : Error<
def ext_mismatched_exception_spec_explicit_instantiation : ExtWarn<
err_mismatched_exception_spec_explicit_instantiation.Text>,
InGroup<MicrosoftExceptionSpec>;
-
+
// C++ typename-specifiers
def err_typename_nested_not_found : Error<"no type named %0 in %1">;
def err_typename_nested_not_found_enable_if : Error<
@@ -4456,7 +4458,7 @@ def note_template_parameter_pack_non_pack : Note<
def note_template_parameter_pack_here : Note<
"previous %select{template type|non-type template|template template}0 "
"parameter%select{| pack}1 declared here">;
-
+
def err_unexpanded_parameter_pack : Error<
"%select{expression|base type|declaration type|data member type|bit-field "
"size|static assertion|fixed underlying type|enumerator value|"
@@ -4560,7 +4562,7 @@ def warn_missing_prototype : Warning<
"no previous prototype for function %0">,
InGroup<DiagGroup<"missing-prototypes">>, DefaultIgnore;
def note_declaration_not_a_prototype : Note<
- "this declaration is not a prototype; add 'void' to make it a prototype for a zero-parameter function">;
+ "this declaration is not a prototype; add 'void' to make it a prototype for a zero-parameter function">;
def warn_strict_prototypes : Warning<
"this %select{function declaration is not|block declaration is not|"
"old-style function definition is not preceded by}0 a prototype">,
@@ -4768,7 +4770,7 @@ def ext_ms_forward_ref_enum : ExtWarn<
def ext_forward_ref_enum_def : Extension<
"redeclaration of already-defined enum %0 is a GNU extension">,
InGroup<GNURedeclaredEnum>;
-
+
def err_redefinition_of_enumerator : Error<"redefinition of enumerator %0">;
def err_duplicate_member : Error<"duplicate member %0">;
def err_misplaced_ivar : Error<
@@ -4787,7 +4789,7 @@ def ext_enumerator_increment_too_large : ExtWarn<
def warn_flag_enum_constant_out_of_range : Warning<
"enumeration value %0 is out of range of flags in enumeration type %1">,
InGroup<FlagEnum>;
-
+
def warn_illegal_constant_array_size : Extension<
"size of static array must be an integer constant expression">;
def err_vm_decl_in_file_scope : Error<
@@ -4892,7 +4894,7 @@ def err_illegal_initializer : Error<
"illegal initializer (only variables can be initialized)">;
def err_illegal_initializer_type : Error<"illegal initializer type %0">;
def ext_init_list_type_narrowing : ExtWarn<
- "type %0 cannot be narrowed to %1 in initializer list">,
+ "type %0 cannot be narrowed to %1 in initializer list">,
InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure;
def ext_init_list_variable_narrowing : ExtWarn<
"non-constant-expression cannot be narrowed from type %0 to %1 in "
@@ -5230,9 +5232,9 @@ def err_arc_illegal_method_def : Error<
def warn_arc_strong_pointer_objc_pointer : Warning<
"method parameter of type %0 with no explicit ownership">,
InGroup<DiagGroup<"explicit-ownership-type">>, DefaultIgnore;
-
+
} // end "ARC Restrictions" category
-
+
def err_arc_lost_method_convention : Error<
"method was declared as %select{an 'alloc'|a 'copy'|an 'init'|a 'new'}0 "
"method, but its implementation doesn't match because %select{"
@@ -5301,7 +5303,7 @@ def warn_receiver_forward_instance : Warning<
InGroup<ForwardClassReceiver>, DefaultIgnore;
def err_arc_collection_forward : Error<
"collection expression type %0 is a forward declaration">;
-def err_arc_multiple_method_decl : Error<
+def err_arc_multiple_method_decl : Error<
"multiple methods named %0 found with mismatched result, "
"parameter type or attributes">;
def warn_arc_lifetime_result_type : Warning<
@@ -5694,7 +5696,7 @@ def warn_namespace_member_extra_qualification : Warning<
"extra qualification on member %0">,
InGroup<DiagGroup<"extra-qualification">>;
def err_member_qualification : Error<
- "non-friend class member %0 cannot have a qualified name">;
+ "non-friend class member %0 cannot have a qualified name">;
def note_member_def_close_match : Note<"member declaration nearly matches">;
def note_member_def_close_const_match : Note<
"member declaration does not match because "
@@ -5800,7 +5802,7 @@ def err_typecheck_invalid_lvalue_addrof_addrof_function : Error<
def err_typecheck_invalid_lvalue_addrof : Error<
"cannot take the address of an rvalue of type %0">;
def ext_typecheck_addrof_temporary : ExtWarn<
- "taking the address of a temporary object of type %0">,
+ "taking the address of a temporary object of type %0">,
InGroup<AddressOfTemporary>, DefaultError;
def err_typecheck_addrof_temporary : Error<
"taking the address of a temporary object of type %0">;
@@ -5911,7 +5913,7 @@ def warn_mixed_sign_comparison : Warning<
"comparison of integers of different signs: %0 and %1">,
InGroup<SignCompare>, DefaultIgnore;
def warn_out_of_range_compare : Warning<
- "result of comparison of %select{constant %0|true|false}1 with "
+ "result of comparison of %select{constant %0|true|false}1 with "
"%select{expression of type %2|boolean expression}3 is always %4">,
InGroup<TautologicalOutOfRangeCompare>;
def warn_tautological_bool_compare : Warning<warn_out_of_range_compare.Text>,
@@ -6069,7 +6071,7 @@ def err_no_subobject_property_setting : Error<
"expression is not assignable">;
def err_qualified_objc_access : Error<
"%select{property|instance variable}0 access cannot be qualified with '%1'">;
-
+
def ext_freestanding_complex : Extension<
"complex numbers are an extension in a freestanding C99 implementation">;
@@ -6235,13 +6237,13 @@ def warn_cxx98_compat_cast_fn_obj : Warning<
def err_bad_reinterpret_cast_small_int : Error<
"cast from pointer to smaller type %2 loses information">;
def err_bad_cxx_cast_vector_to_scalar_different_size : Error<
- "%select{||reinterpret_cast||C-style cast|}0 from vector %1 "
+ "%select{||reinterpret_cast||C-style cast|}0 from vector %1 "
"to scalar %2 of different size">;
def err_bad_cxx_cast_scalar_to_vector_different_size : Error<
- "%select{||reinterpret_cast||C-style cast|}0 from scalar %1 "
+ "%select{||reinterpret_cast||C-style cast|}0 from scalar %1 "
"to vector %2 of different size">;
def err_bad_cxx_cast_vector_to_vector_different_size : Error<
- "%select{||reinterpret_cast||C-style cast|}0 from vector %1 "
+ "%select{||reinterpret_cast||C-style cast|}0 from vector %1 "
"to vector %2 of different size">;
def err_bad_lvalue_to_rvalue_cast : Error<
"cannot cast from lvalue of type %1 to rvalue reference type %2; types are "
@@ -6643,7 +6645,7 @@ def err_typecheck_nonviable_condition_incomplete : Error<
def err_typecheck_deleted_function : Error<
"conversion function %diff{from $ to $|between types}0,1 "
"invokes a deleted function">;
-
+
def err_expected_class_or_namespace : Error<"%0 is not a class"
"%select{ or namespace|, namespace, or enumeration}1">;
def err_invalid_declarator_scope : Error<"cannot define or redeclare %0 here "
@@ -7011,11 +7013,11 @@ def err_typecheck_call_too_many_args_at_most_suggest : Error<
"too many %select{|||execution configuration }0arguments to "
"%select{function|block|method|kernel function}0 call, "
"expected at most %1, have %2; did you mean %3?">;
-
+
def err_arc_typecheck_convert_incompatible_pointer : Error<
"incompatible pointer types passing retainable parameter of type %0"
"to a CF function expecting %1 type">;
-
+
def err_builtin_fn_use : Error<"builtin functions must be directly called">;
def warn_call_wrong_number_of_arguments : Warning<
@@ -7129,7 +7131,8 @@ def err_shared_var_init : Error<
"initialization is not supported for __shared__ variables.">;
def err_device_static_local_var : Error<
"within a %select{__device__|__global__|__host__|__host__ __device__}0 "
- "function, only __shared__ variables may be marked 'static'">;
+ "function, only __shared__ variables or const variables without device "
+ "memory qualifier may be marked 'static'">;
def err_cuda_vla : Error<
"cannot use variable-length arrays in "
"%select{__device__|__global__|__host__|__host__ __device__}0 functions">;
@@ -7505,8 +7508,8 @@ def err_reference_to_local_in_enclosing_context : Error<
"%select{%3|block literal|lambda expression|context}2">;
def err_static_data_member_not_allowed_in_local_class : Error<
- "static data member %0 not allowed in local class %1">;
-
+ "static data member %0 not allowed in local class %1">;
+
// C++ derived classes
def err_base_clause_on_union : Error<"unions cannot have base classes">;
def err_base_must_be_class : Error<"base specifier must name a class">;
@@ -7851,6 +7854,13 @@ def warn_null_ret : Warning<
"null returned from %select{function|method}0 that requires a non-null return value">,
InGroup<NonNull>;
+def err_lifetimebound_no_object_param : Error<
+ "'lifetimebound' attribute cannot be applied; %select{static |non-}0member "
+ "function has no implicit object parameter">;
+def err_lifetimebound_ctor_dtor : Error<
+ "'lifetimebound' attribute cannot be applied to a "
+ "%select{constructor|destructor}0">;
+
// CHECK: returning address/reference of stack memory
def warn_ret_stack_addr_ref : Warning<
"%select{address of|reference to}0 stack memory associated with "
@@ -7865,7 +7875,8 @@ def warn_ret_addr_label : Warning<
def err_ret_local_block : Error<
"returning block that lives on the local stack">;
def note_local_var_initializer : Note<
- "%select{via initialization of|binding reference}0 variable %1 here">;
+ "%select{via initialization of|binding reference}0 variable "
+ "%select{%2 |}1here">;
def note_init_with_default_member_initalizer : Note<
"initializing field %0 with default member initializer">;
@@ -7897,13 +7908,14 @@ def note_lifetime_extending_member_declared_here : Note<
"member with %select{reference|'std::initializer_list'}0 subobject}1 "
"declared here">;
def warn_dangling_variable : Warning<
- "%select{temporary %select{whose address is used as value of|bound to}3 "
- "%select{%select{|reference }3member of local variable|"
- "local %select{variable|reference}3}1|"
+ "%select{temporary %select{whose address is used as value of|"
+ "%select{|implicitly }2bound to}4 "
+ "%select{%select{|reference }4member of local variable|"
+ "local %select{variable|reference}4}1|"
"array backing "
"%select{initializer list subobject of local variable|"
"local initializer list}1}0 "
- "%2 will be destroyed at the end of the full-expression">,
+ "%select{%3 |}2will be destroyed at the end of the full-expression">,
InGroup<Dangling>;
def warn_new_dangling_reference : Warning<
"temporary bound to reference member of allocated object "
@@ -8219,7 +8231,7 @@ def err_vector_incorrect_num_initializers : Error<
def err_altivec_empty_initializer : Error<"expected initializer">;
def err_invalid_neon_type_code : Error<
- "incompatible constant for this __builtin_neon function">;
+ "incompatible constant for this __builtin_neon function">;
def err_argument_invalid_range : Error<
"argument value %0 is outside the valid range [%1, %2]">;
def warn_argument_invalid_range : Warning<
@@ -8275,7 +8287,7 @@ def err_constant_integer_arg_type : Error<
def ext_mixed_decls_code : Extension<
"ISO C90 forbids mixing declarations and code">,
InGroup<DiagGroup<"declaration-after-statement">>;
-
+
def err_non_local_variable_decl_in_for : Error<
"declaration of non-local variable in 'for' loop">;
def err_non_variable_decl_in_for : Error<
@@ -8343,7 +8355,7 @@ def warn_nsconsumed_attribute_mismatch : Warning<
err_nsconsumed_attribute_mismatch.Text>, InGroup<NSConsumedMismatch>;
def warn_nsreturns_retained_attribute_mismatch : Warning<
err_nsreturns_retained_attribute_mismatch.Text>, InGroup<NSReturnsMismatch>;
-
+
def note_getter_unavailable : Note<
"or because setter is declared here, but no getter method %0 is found">;
def err_invalid_protocol_qualifiers : Error<
@@ -8599,7 +8611,7 @@ def err_opencl_extern_block_declaration : Error<
def err_opencl_block_ref_block : Error<
"cannot refer to a block inside block">;
-// OpenCL v2.0 s6.13.9 - Address space qualifier functions.
+// OpenCL v2.0 s6.13.9 - Address space qualifier functions.
def err_opencl_builtin_to_addr_arg_num : Error<
"invalid number of arguments to function: %0">;
def err_opencl_builtin_to_addr_invalid_arg : Error<
diff --git a/include/clang/Basic/DiagnosticSerializationKinds.td b/include/clang/Basic/DiagnosticSerializationKinds.td
index 3a552e2f3db4..54237d16f5c1 100644
--- a/include/clang/Basic/DiagnosticSerializationKinds.td
+++ b/include/clang/Basic/DiagnosticSerializationKinds.td
@@ -49,7 +49,7 @@ def err_pch_diagopt_mismatch : Error<"%0 is currently enabled, but was not in "
"the PCH file">;
def err_pch_modulecache_mismatch : Error<"PCH was compiled with module cache "
"path '%0', but the path is currently '%1'">;
-
+
def err_pch_version_too_old : Error<
"PCH file uses an older PCH format that is no longer supported">;
def err_pch_version_too_new : Error<
diff --git a/include/clang/Basic/FileSystemStatCache.h b/include/clang/Basic/FileSystemStatCache.h
index 45aded527c1b..1ec344623a0d 100644
--- a/include/clang/Basic/FileSystemStatCache.h
+++ b/include/clang/Basic/FileSystemStatCache.h
@@ -62,7 +62,7 @@ protected:
public:
virtual ~FileSystemStatCache() = default;
-
+
enum LookupResult {
/// We know the file exists and its cached stat data.
CacheExists,
@@ -90,10 +90,10 @@ public:
void setNextStatCache(std::unique_ptr<FileSystemStatCache> Cache) {
NextStatCache = std::move(Cache);
}
-
+
/// Retrieve the next stat call cache in the chain.
FileSystemStatCache *getNextStatCache() { return NextStatCache.get(); }
-
+
/// Retrieve the next stat call cache in the chain, transferring
/// ownership of this cache (and, transitively, all of the remaining caches)
/// to the caller.
diff --git a/include/clang/Basic/IdentifierTable.h b/include/clang/Basic/IdentifierTable.h
index f43df5c64829..c2e9c71b0f0d 100644
--- a/include/clang/Basic/IdentifierTable.h
+++ b/include/clang/Basic/IdentifierTable.h
@@ -63,7 +63,7 @@ class IdentifierInfo {
bool IsPoisoned : 1; // True if identifier is poisoned.
bool IsCPPOperatorKeyword : 1; // True if ident is a C++ operator keyword.
bool NeedsHandleIdentifier : 1; // See "RecomputeNeedsHandleIdentifier".
- bool IsFromAST : 1; // True if identifier was loaded (at least
+ bool IsFromAST : 1; // True if identifier was loaded (at least
// partially) from an AST file.
bool ChangedAfterLoad : 1; // True if identifier has changed from the
// definition loaded from an AST file.
@@ -308,7 +308,7 @@ public:
bool hasChangedSinceDeserialization() const {
return ChangedAfterLoad;
}
-
+
/// Note that this identifier has changed since it was loaded from
/// an AST file.
void setChangedSinceDeserialization() {
@@ -320,7 +320,7 @@ public:
bool hasFETokenInfoChangedSinceDeserialization() const {
return FEChangedAfterLoad;
}
-
+
/// Note that the frontend token information for this identifier has
/// changed since it was loaded from an AST file.
void setFETokenInfoChangedSinceDeserialization() {
@@ -330,7 +330,7 @@ public:
/// Determine whether the information for this identifier is out of
/// date with respect to the external source.
bool isOutOfDate() const { return OutOfDate; }
-
+
/// Set whether the information for this identifier is out of
/// date with respect to the external source.
void setOutOfDate(bool OOD) {
@@ -340,10 +340,10 @@ public:
else
RecomputeNeedsHandleIdentifier();
}
-
+
/// Determine whether this is the contextual keyword \c import.
bool isModulesImport() const { return IsModulesImport; }
-
+
/// Set whether this identifier is the contextual keyword \c import.
void setModulesImport(bool I) {
IsModulesImport = I;
@@ -419,7 +419,7 @@ public:
class IdentifierIterator {
protected:
IdentifierIterator() = default;
-
+
public:
IdentifierIterator(const IdentifierIterator &) = delete;
IdentifierIterator &operator=(const IdentifierIterator &) = delete;
@@ -490,7 +490,7 @@ public:
IdentifierInfoLookup *getExternalIdentifierLookup() const {
return ExternalLookup;
}
-
+
llvm::BumpPtrAllocator& getAllocator() {
return HashTable.getAllocator();
}
@@ -572,7 +572,7 @@ public:
void AddKeywords(const LangOptions &LangOpts);
};
-/// A family of Objective-C methods.
+/// A family of Objective-C methods.
///
/// These families have no inherent meaning in the language, but are
/// nonetheless central enough in the existing implementations to
@@ -687,13 +687,13 @@ class Selector {
MultiKeywordSelector *getMultiKeywordSelector() const {
return reinterpret_cast<MultiKeywordSelector *>(InfoPtr & ~ArgFlags);
}
-
+
unsigned getIdentifierInfoFlag() const {
return InfoPtr & ArgFlags;
}
static ObjCMethodFamily getMethodFamilyImpl(Selector sel);
-
+
static ObjCStringFormatFamily getStringFormatFamilyImpl(Selector sel);
public:
@@ -730,11 +730,11 @@ public:
}
unsigned getNumArgs() const;
-
+
/// Retrieve the identifier at a given position in the selector.
///
/// Note that the identifier pointer returned may be NULL. Clients that only
- /// care about the text of the identifier string, and not the specific,
+ /// care about the text of the identifier string, and not the specific,
/// uniqued identifier pointer, should use \c getNameForSlot(), which returns
/// an empty string when the identifier pointer would be NULL.
///
@@ -745,7 +745,7 @@ public:
/// \returns the uniqued identifier for this slot, or NULL if this slot has
/// no corresponding identifier.
IdentifierInfo *getIdentifierInfoForSlot(unsigned argIndex) const;
-
+
/// Retrieve the name at a given position in the selector.
///
/// \param argIndex The index for which we want to retrieve the name.
@@ -755,7 +755,7 @@ public:
/// \returns the name for this slot, which may be the empty string if no
/// name was supplied.
StringRef getNameForSlot(unsigned argIndex) const;
-
+
/// Derive the full selector name (e.g. "foo:bar:") and return
/// it as an std::string.
std::string getAsString() const;
@@ -769,11 +769,11 @@ public:
ObjCMethodFamily getMethodFamily() const {
return getMethodFamilyImpl(*this);
}
-
+
ObjCStringFormatFamily getStringFormatFamily() const {
return getStringFormatFamilyImpl(*this);
}
-
+
static Selector getEmptyMarker() {
return Selector(uintptr_t(-1));
}
@@ -781,7 +781,7 @@ public:
static Selector getTombstoneMarker() {
return Selector(uintptr_t(-2));
}
-
+
static ObjCInstanceTypeFamily getInstTypeMethodFamily(Selector sel);
};
@@ -901,7 +901,7 @@ struct PointerLikeTypeTraits<clang::Selector> {
return clang::Selector(reinterpret_cast<uintptr_t>(P));
}
- enum { NumLowBitsAvailable = 0 };
+ enum { NumLowBitsAvailable = 0 };
};
// Provide PointerLikeTypeTraits for IdentifierInfo pointers, which
diff --git a/include/clang/Basic/LLVM.h b/include/clang/Basic/LLVM.h
index 8a432db911da..3f833c62c0a8 100644
--- a/include/clang/Basic/LLVM.h
+++ b/include/clang/Basic/LLVM.h
@@ -59,7 +59,7 @@ namespace clang {
using llvm::dyn_cast;
using llvm::dyn_cast_or_null;
using llvm::cast_or_null;
-
+
// ADT's.
using llvm::ArrayRef;
using llvm::MutableArrayRef;
diff --git a/include/clang/Basic/LangOptions.h b/include/clang/Basic/LangOptions.h
index f3a6292e5ade..a1396f84352f 100644
--- a/include/clang/Basic/LangOptions.h
+++ b/include/clang/Basic/LangOptions.h
@@ -50,10 +50,10 @@ protected:
class LangOptions : public LangOptionsBase {
public:
using Visibility = clang::Visibility;
-
+
enum GCMode { NonGC, GCOnly, HybridGC };
enum StackProtectorMode { SSPOff, SSPOn, SSPStrong, SSPReq };
-
+
enum SignedOverflowBehaviorTy {
// Default C standard behavior.
SOB_Undefined,
@@ -165,7 +165,7 @@ public:
clang::ObjCRuntime ObjCRuntime;
std::string ObjCConstantStringClass;
-
+
/// The name of the handler function to be called when -ftrapv is
/// specified.
///
@@ -209,10 +209,10 @@ public:
LangOptions();
// Define accessors/mutators for language options of enumeration type.
-#define LANGOPT(Name, Bits, Default, Description)
+#define LANGOPT(Name, Bits, Default, Description)
#define ENUM_LANGOPT(Name, Type, Bits, Default, Description) \
Type get##Name() const { return static_cast<Type>(Name); } \
- void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
+ void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
#include "clang/Basic/LangOptions.def"
/// Are we compiling a module interface (.cppm or module map)?
@@ -228,7 +228,7 @@ public:
bool isSignedOverflowDefined() const {
return getSignedOverflowBehavior() == SOB_Defined;
}
-
+
bool isSubscriptPointerArithmetic() const {
return ObjCRuntime.isSubscriptPointerArithmetic() &&
!ObjCSubscriptingLegacyRuntime;
@@ -309,7 +309,7 @@ enum TranslationUnitKind {
/// The translation unit is a module.
TU_Module
};
-
+
} // namespace clang
#endif // LLVM_CLANG_BASIC_LANGOPTIONS_H
diff --git a/include/clang/Basic/Linkage.h b/include/clang/Basic/Linkage.h
index 94dcfd445b0b..529cfa9f3f8d 100644
--- a/include/clang/Basic/Linkage.h
+++ b/include/clang/Basic/Linkage.h
@@ -19,7 +19,7 @@
namespace clang {
-/// Describes the different kinds of linkage
+/// Describes the different kinds of linkage
/// (C++ [basic.link], C99 6.2.2) that an entity may have.
enum Linkage : unsigned char {
/// No linkage, which means that the entity is unique and
@@ -31,7 +31,7 @@ enum Linkage : unsigned char {
/// translation units).
InternalLinkage,
- /// External linkage within a unique namespace.
+ /// External linkage within a unique namespace.
///
/// From the language perspective, these entities have external
/// linkage. However, since they reside in an anonymous namespace,
diff --git a/include/clang/Basic/Module.h b/include/clang/Basic/Module.h
index 4aebda1887c4..02a4ef610b64 100644
--- a/include/clang/Basic/Module.h
+++ b/include/clang/Basic/Module.h
@@ -44,7 +44,7 @@ class raw_ostream;
} // namespace llvm
namespace clang {
-
+
class LangOptions;
class TargetInfo;
@@ -66,7 +66,7 @@ class Module {
public:
/// The name of this module.
std::string Name;
-
+
/// The location of the module definition.
SourceLocation DefinitionLoc;
@@ -111,12 +111,12 @@ public:
/// The module through which entities defined in this module will
/// eventually be exposed, for use in "private" modules.
std::string ExportAsModule;
-
+
private:
/// The submodules of this module, indexed by name.
std::vector<Module *> SubModules;
-
- /// A mapping from the submodule name to the index into the
+
+ /// A mapping from the submodule name to the index into the
/// \c SubModules vector at which that submodule resides.
llvm::StringMap<unsigned> SubModuleIndex;
@@ -214,13 +214,13 @@ public:
/// Whether this module was loaded from a module file.
unsigned IsFromModuleFile : 1;
-
+
/// Whether this is a framework module.
unsigned IsFramework : 1;
-
+
/// Whether this is an explicit submodule.
unsigned IsExplicit : 1;
-
+
/// Whether this is a "system" module (which assumes that all
/// headers in it are system headers).
unsigned IsSystem : 1;
@@ -233,16 +233,16 @@ public:
/// Whether this is an inferred submodule (module * { ... }).
unsigned IsInferred : 1;
- /// Whether we should infer submodules for this module based on
+ /// Whether we should infer submodules for this module based on
/// the headers.
///
/// Submodules can only be inferred for modules with an umbrella header.
unsigned InferSubmodules : 1;
-
+
/// Whether, when inferring submodules, the inferred submodules
/// should be explicit.
unsigned InferExplicitSubmodules : 1;
-
+
/// Whether, when inferring submodules, the inferr submodules should
/// export all modules they import (e.g., the equivalent of "export *").
unsigned InferExportWildcard : 1;
@@ -280,31 +280,31 @@ public:
/// The set of modules imported by this module, and on which this
/// module depends.
llvm::SmallSetVector<Module *, 2> Imports;
-
+
/// Describes an exported module.
///
/// The pointer is the module being re-exported, while the bit will be true
/// to indicate that this is a wildcard export.
using ExportDecl = llvm::PointerIntPair<Module *, 1, bool>;
-
+
/// The set of export declarations.
SmallVector<ExportDecl, 2> Exports;
-
+
/// Describes an exported module that has not yet been resolved
/// (perhaps because the module it refers to has not yet been loaded).
struct UnresolvedExportDecl {
/// The location of the 'export' keyword in the module map file.
SourceLocation ExportLoc;
-
+
/// The name of the module.
ModuleId Id;
-
+
/// Whether this export declaration ends in a wildcard, indicating
/// that all of its submodules should be exported (rather than the named
/// module itself).
bool Wildcard;
};
-
+
/// The set of export declarations that have yet to be resolved.
SmallVector<UnresolvedExportDecl, 2> UnresolvedExports;
@@ -320,7 +320,7 @@ public:
LinkLibrary() = default;
LinkLibrary(const std::string &Library, bool IsFramework)
: Library(Library), IsFramework(IsFramework) {}
-
+
/// The library to link against.
///
/// This will typically be a library or framework name, but can also
@@ -371,9 +371,9 @@ public:
/// Construct a new module or submodule.
Module(StringRef Name, SourceLocation DefinitionLoc, Module *Parent,
bool IsFramework, bool IsExplicit, unsigned VisibilityID);
-
+
~Module();
-
+
/// Determine whether this module is available for use within the
/// current translation unit.
bool isAvailable() const { return IsAvailable; }
@@ -395,7 +395,7 @@ public:
///
/// \param ShadowingModule If this module is unavailable because it is
/// shadowed, this parameter will be set to the shadowing module.
- bool isAvailable(const LangOptions &LangOpts,
+ bool isAvailable(const LangOptions &LangOpts,
const TargetInfo &Target,
Requirement &Req,
UnresolvedHeaderDirective &MissingHeader,
@@ -403,19 +403,19 @@ public:
/// Determine whether this module is a submodule.
bool isSubModule() const { return Parent != nullptr; }
-
+
/// Determine whether this module is a submodule of the given other
/// module.
bool isSubModuleOf(const Module *Other) const;
-
+
/// Determine whether this module is a part of a framework,
/// either because it is a framework module or because it is a submodule
/// of a framework module.
bool isPartOfFramework() const {
- for (const Module *Mod = this; Mod; Mod = Mod->Parent)
+ for (const Module *Mod = this; Mod; Mod = Mod->Parent)
if (Mod->IsFramework)
return true;
-
+
return false;
}
@@ -456,7 +456,7 @@ public:
/// Retrieve the top-level module for this (sub)module, which may
/// be this module.
const Module *getTopLevelModule() const;
-
+
/// Retrieve the name of the top-level module.
StringRef getTopLevelModuleName() const {
return getTopLevelModule()->Name;
@@ -552,7 +552,7 @@ public:
using submodule_iterator = std::vector<Module *>::iterator;
using submodule_const_iterator = std::vector<Module *>::const_iterator;
-
+
submodule_iterator submodule_begin() { return SubModules.begin(); }
submodule_const_iterator submodule_begin() const {return SubModules.begin();}
submodule_iterator submodule_end() { return SubModules.end(); }
@@ -575,9 +575,9 @@ public:
return "<module-includes>";
}
- /// Print the module map for this module to the given stream.
+ /// Print the module map for this module to the given stream.
void print(raw_ostream &OS, unsigned Indent = 0) const;
-
+
/// Dump the contents of this module to the given output stream.
void dump() const;
diff --git a/include/clang/Basic/ObjCRuntime.h b/include/clang/Basic/ObjCRuntime.h
index d5f4f50fe36f..c307c9643390 100644
--- a/include/clang/Basic/ObjCRuntime.h
+++ b/include/clang/Basic/ObjCRuntime.h
@@ -154,7 +154,7 @@ public:
llvm_unreachable("bad kind");
}
- /// Does this runtime natively provide the ARC entrypoints?
+ /// Does this runtime natively provide the ARC entrypoints?
///
/// ARC cannot be directly supported on a platform that does not provide
/// these entrypoints, although it may be supportable via a stub
diff --git a/include/clang/Basic/OperatorKinds.h b/include/clang/Basic/OperatorKinds.h
index b0064cfb4e5a..3096f835e66b 100644
--- a/include/clang/Basic/OperatorKinds.h
+++ b/include/clang/Basic/OperatorKinds.h
@@ -27,7 +27,7 @@ enum OverloadedOperatorKind : int {
NUM_OVERLOADED_OPERATORS
};
-/// Retrieve the spelling of the given overloaded operator, without
+/// Retrieve the spelling of the given overloaded operator, without
/// the preceding "operator" keyword.
const char *getOperatorSpelling(OverloadedOperatorKind Operator);
diff --git a/include/clang/Basic/Sanitizers.def b/include/clang/Basic/Sanitizers.def
index 5a36822a6303..ae5c75fc5bbd 100644
--- a/include/clang/Basic/Sanitizers.def
+++ b/include/clang/Basic/Sanitizers.def
@@ -131,9 +131,14 @@ SANITIZER_GROUP("undefined", Undefined,
// -fsanitize=undefined-trap is an alias for -fsanitize=undefined.
SANITIZER_GROUP("undefined-trap", UndefinedTrap, Undefined)
+// ImplicitConversionSanitizer
+SANITIZER("implicit-integer-truncation", ImplicitIntegerTruncation)
+SANITIZER_GROUP("implicit-conversion", ImplicitConversion,
+ ImplicitIntegerTruncation)
+
SANITIZER_GROUP("integer", Integer,
- SignedIntegerOverflow | UnsignedIntegerOverflow | Shift |
- IntegerDivideByZero)
+ ImplicitIntegerTruncation | IntegerDivideByZero | Shift |
+ SignedIntegerOverflow | UnsignedIntegerOverflow)
SANITIZER("local-bounds", LocalBounds)
SANITIZER_GROUP("bounds", Bounds, ArrayBounds | LocalBounds)
diff --git a/include/clang/Basic/Sanitizers.h b/include/clang/Basic/Sanitizers.h
index 469d9e2e9591..2ecbde821599 100644
--- a/include/clang/Basic/Sanitizers.h
+++ b/include/clang/Basic/Sanitizers.h
@@ -84,7 +84,8 @@ SanitizerMask expandSanitizerGroups(SanitizerMask Kinds);
/// Return the sanitizers which do not affect preprocessing.
inline SanitizerMask getPPTransparentSanitizers() {
return SanitizerKind::CFI | SanitizerKind::Integer |
- SanitizerKind::Nullability | SanitizerKind::Undefined;
+ SanitizerKind::ImplicitConversion | SanitizerKind::Nullability |
+ SanitizerKind::Undefined;
}
} // namespace clang
diff --git a/include/clang/Basic/SourceLocation.h b/include/clang/Basic/SourceLocation.h
index f174f83abf4a..488a604a452f 100644
--- a/include/clang/Basic/SourceLocation.h
+++ b/include/clang/Basic/SourceLocation.h
@@ -38,7 +38,7 @@ class SourceManager;
/// source file (MemoryBuffer) along with its \#include path and \#line data.
///
class FileID {
- /// A mostly-opaque identifier, where 0 is "invalid", >0 is
+ /// A mostly-opaque identifier, where 0 is "invalid", >0 is
/// this module, and <-1 is something loaded from another module.
int ID = 0;
@@ -60,7 +60,7 @@ private:
friend class ASTWriter;
friend class ASTReader;
friend class SourceManager;
-
+
static FileID get(int V) {
FileID F;
F.ID = V;
@@ -221,7 +221,7 @@ public:
return B != X.B || E != X.E;
}
};
-
+
/// Represents a character-granular source range.
///
/// The underlying SourceRange can either specify the starting/ending character
@@ -229,7 +229,7 @@ public:
/// last token of the range (a "token range"). In the token range case, the
/// size of the last token must be measured to determine the actual end of the
/// range.
-class CharSourceRange {
+class CharSourceRange {
SourceRange Range;
bool IsTokenRange = false;
@@ -244,7 +244,7 @@ public:
static CharSourceRange getCharRange(SourceRange R) {
return CharSourceRange(R, false);
}
-
+
static CharSourceRange getTokenRange(SourceLocation B, SourceLocation E) {
return getTokenRange(SourceRange(B, E));
}
@@ -252,21 +252,21 @@ public:
static CharSourceRange getCharRange(SourceLocation B, SourceLocation E) {
return getCharRange(SourceRange(B, E));
}
-
+
/// Return true if the end of this range specifies the start of
/// the last token. Return false if the end of this range specifies the last
/// character in the range.
bool isTokenRange() const { return IsTokenRange; }
bool isCharRange() const { return !IsTokenRange; }
-
+
SourceLocation getBegin() const { return Range.getBegin(); }
SourceLocation getEnd() const { return Range.getEnd(); }
SourceRange getAsRange() const { return Range; }
-
+
void setBegin(SourceLocation b) { Range.setBegin(b); }
void setEnd(SourceLocation e) { Range.setEnd(e); }
void setTokenRange(bool TR) { IsTokenRange = TR; }
-
+
bool isValid() const { return Range.isValid(); }
bool isInvalid() const { return !isValid(); }
};
@@ -453,7 +453,7 @@ namespace llvm {
return LHS == RHS;
}
};
-
+
template <>
struct isPodLike<clang::SourceLocation> { static const bool value = true; };
template <>
diff --git a/include/clang/Basic/SourceManager.h b/include/clang/Basic/SourceManager.h
index 99c36f4cdfcc..af7dbbc13ca7 100644
--- a/include/clang/Basic/SourceManager.h
+++ b/include/clang/Basic/SourceManager.h
@@ -155,7 +155,7 @@ namespace SrcMgr {
ContentCache(const FileEntry *Ent, const FileEntry *contentEnt)
: Buffer(nullptr, false), OrigEntry(Ent), ContentsEntry(contentEnt),
BufferOverridden(false), IsSystemFile(false), IsTransient(false) {}
-
+
/// The copy ctor does not allow copies where source object has either
/// a non-NULL Buffer or SourceLineCache. Ownership of allocated memory
/// is not transferred, so this is a logical error.
@@ -1072,7 +1072,7 @@ public:
unsigned FileOffset = Entry.getOffset();
return SourceLocation::getFileLoc(FileOffset);
}
-
+
/// Return the source location corresponding to the last byte of the
/// specified file.
SourceLocation getLocForEndOfFile(FileID FID) const {
@@ -1080,7 +1080,7 @@ public:
const SrcMgr::SLocEntry &Entry = getSLocEntry(FID, &Invalid);
if (Invalid || !Entry.isFile())
return SourceLocation();
-
+
unsigned FileOffset = Entry.getOffset();
return SourceLocation::getFileLoc(FileOffset + getFileIDSize(FID));
}
@@ -1403,7 +1403,7 @@ public:
PresumedLoc getPresumedLoc(SourceLocation Loc,
bool UseLineDirectives = true) const;
- /// Returns whether the PresumedLoc for a given SourceLocation is
+ /// Returns whether the PresumedLoc for a given SourceLocation is
/// in the main file.
///
/// This computes the "presumed" location for a SourceLocation, then checks
diff --git a/include/clang/Basic/SourceManagerInternals.h b/include/clang/Basic/SourceManagerInternals.h
index 68873be594d4..ddc58ffb6969 100644
--- a/include/clang/Basic/SourceManagerInternals.h
+++ b/include/clang/Basic/SourceManagerInternals.h
@@ -79,7 +79,7 @@ inline bool operator<(unsigned Offset, const LineEntry &E) {
/// Used to hold and unique data used to represent \#line information.
class LineTableInfo {
- /// Map used to assign unique IDs to filenames in \#line directives.
+ /// Map used to assign unique IDs to filenames in \#line directives.
///
/// This allows us to unique the filenames that
/// frequently reoccur and reference them with indices. FilenameIDs holds
diff --git a/include/clang/Basic/Specifiers.h b/include/clang/Basic/Specifiers.h
index 303b77e44805..cd8213f6cfd4 100644
--- a/include/clang/Basic/Specifiers.h
+++ b/include/clang/Basic/Specifiers.h
@@ -28,14 +28,14 @@ namespace clang {
TSW_long,
TSW_longlong
};
-
+
/// Specifies the signedness of a type, e.g., signed or unsigned.
enum TypeSpecifierSign {
TSS_unspecified,
TSS_signed,
TSS_unsigned
};
-
+
enum TypeSpecifiersPipe {
TSP_unspecified,
TSP_pipe
@@ -134,7 +134,7 @@ namespace clang {
/// An Objective-C property is a logical field of an Objective-C
/// object which is read and written via Objective-C method calls.
OK_ObjCProperty,
-
+
/// An Objective-C array/dictionary subscripting which reads an
/// object or writes at the subscripted array/dictionary element via
/// Objective-C method calls.
diff --git a/include/clang/Basic/StmtNodes.td b/include/clang/Basic/StmtNodes.td
index 506da0720338..1517d741cb3c 100644
--- a/include/clang/Basic/StmtNodes.td
+++ b/include/clang/Basic/StmtNodes.td
@@ -187,7 +187,7 @@ def TypoExpr : DStmt<Expr>;
// Microsoft Extensions.
def MSPropertyRefExpr : DStmt<Expr>;
def MSPropertySubscriptExpr : DStmt<Expr>;
-def CXXUuidofExpr : DStmt<Expr>;
+def CXXUuidofExpr : DStmt<Expr>;
def SEHTryStmt : Stmt;
def SEHExceptStmt : Stmt;
def SEHFinallyStmt : Stmt;
diff --git a/include/clang/Basic/TargetInfo.h b/include/clang/Basic/TargetInfo.h
index ec5c59b23906..958b9106bc99 100644
--- a/include/clang/Basic/TargetInfo.h
+++ b/include/clang/Basic/TargetInfo.h
@@ -1139,7 +1139,8 @@ public:
bool isSEHTrySupported() const {
return getTriple().isOSWindows() &&
(getTriple().getArch() == llvm::Triple::x86 ||
- getTriple().getArch() == llvm::Triple::x86_64);
+ getTriple().getArch() == llvm::Triple::x86_64 ||
+ getTriple().getArch() == llvm::Triple::aarch64);
}
/// Return true if {|} are normal characters in the asm string.
diff --git a/include/clang/Basic/TemplateKinds.h b/include/clang/Basic/TemplateKinds.h
index 3b68cba73655..a0bc362e7a44 100644
--- a/include/clang/Basic/TemplateKinds.h
+++ b/include/clang/Basic/TemplateKinds.h
@@ -31,7 +31,7 @@ enum TemplateNameKind {
/// The name refers to a variable template whose specialization produces a
/// variable.
TNK_Var_template,
- /// The name refers to a dependent template name:
+ /// The name refers to a dependent template name:
/// \code
/// template<typename MetaFun, typename T1, typename T2> struct apply2 {
/// typedef typename MetaFun::template apply<T1, T2>::type type;
@@ -39,7 +39,7 @@ enum TemplateNameKind {
/// \endcode
///
/// Here, "apply" is a dependent template name within the typename
- /// specifier in the typedef. "apply" is a nested template, and
+ /// specifier in the typedef. "apply" is a nested template, and
/// whether the template name is assumed to refer to a type template or a
/// function template depends on the context in which the template
/// name occurs.
diff --git a/include/clang/Basic/arm_neon.td b/include/clang/Basic/arm_neon.td
index d405aac10650..c35336166c39 100644
--- a/include/clang/Basic/arm_neon.td
+++ b/include/clang/Basic/arm_neon.td
@@ -772,9 +772,9 @@ def RSHRN_HIGH_N : IOpInst<"vrshrn_high_n", "hmdi",
"HsHiHlHUsHUiHUl", OP_NARROW_HI>;
def QRSHRUN_HIGH_N : SOpInst<"vqrshrun_high_n", "hmdi",
"HsHiHl", OP_NARROW_HI>;
-def QSHRN_HIGH_N : SOpInst<"vqshrn_high_n", "hmdi",
+def QSHRN_HIGH_N : SOpInst<"vqshrn_high_n", "hmdi",
"HsHiHlHUsHUiHUl", OP_NARROW_HI>;
-def QRSHRN_HIGH_N : SOpInst<"vqrshrn_high_n", "hmdi",
+def QRSHRN_HIGH_N : SOpInst<"vqrshrn_high_n", "hmdi",
"HsHiHlHUsHUiHUl", OP_NARROW_HI>;
}
@@ -927,7 +927,7 @@ def VMINV : SInst<"vminv", "sd", "csifUcUsUiQcQsQiQUcQUsQUiQfQd">;
def VADDV : SInst<"vaddv", "sd", "csifUcUsUiQcQsQiQUcQUsQUiQfQdQlQUl">;
def FMAXNMV : SInst<"vmaxnmv", "sd", "fQfQd">;
def FMINNMV : SInst<"vminnmv", "sd", "fQfQd">;
-
+
////////////////////////////////////////////////////////////////////////////////
// Newly added Vector Extract for f64
def VEXT_A64 : WInst<"vext", "dddi", "dQdPlQPl">;
diff --git a/include/clang/Basic/arm_neon_incl.td b/include/clang/Basic/arm_neon_incl.td
index 46708a52aa3a..5f3aa6fc0221 100644
--- a/include/clang/Basic/arm_neon_incl.td
+++ b/include/clang/Basic/arm_neon_incl.td
@@ -9,7 +9,7 @@
//
// This file defines data structures shared by arm_neon.td and arm_fp16.td.
// It constains base operation classes, operations, instructions, instruction
-// modifiers, etc.
+// modifiers, etc.
//
//===----------------------------------------------------------------------===//
//
diff --git a/include/clang/Driver/CC1Options.td b/include/clang/Driver/CC1Options.td
index 7cb9724a57e1..672231e70fad 100644
--- a/include/clang/Driver/CC1Options.td
+++ b/include/clang/Driver/CC1Options.td
@@ -87,16 +87,16 @@ def analyzer_viz_egraph_ubigraph : Flag<["-"], "analyzer-viz-egraph-ubigraph">,
def analyzer_inline_max_stack_depth : Separate<["-"], "analyzer-inline-max-stack-depth">,
HelpText<"Bound on stack depth while inlining (4 by default)">;
-def analyzer_inline_max_stack_depth_EQ : Joined<["-"], "analyzer-inline-max-stack-depth=">,
+def analyzer_inline_max_stack_depth_EQ : Joined<["-"], "analyzer-inline-max-stack-depth=">,
Alias<analyzer_inline_max_stack_depth>;
-
+
def analyzer_inlining_mode : Separate<["-"], "analyzer-inlining-mode">,
HelpText<"Specify the function selection heuristic used during inlining">;
def analyzer_inlining_mode_EQ : Joined<["-"], "analyzer-inlining-mode=">, Alias<analyzer_inlining_mode>;
def analyzer_disable_retry_exhausted : Flag<["-"], "analyzer-disable-retry-exhausted">,
HelpText<"Do not re-analyze paths leading to exhausted nodes with a different strategy (may decrease code coverage)">;
-
+
def analyzer_max_loop : Separate<["-"], "analyzer-max-loop">,
HelpText<"The maximum number of times the analyzer will go through a loop">;
def analyzer_stats : Flag<["-"], "analyzer-stats">,
@@ -815,7 +815,7 @@ def fopenmp_is_device : Flag<["-"], "fopenmp-is-device">,
HelpText<"Generate code only for an OpenMP target device.">;
def fopenmp_host_ir_file_path : Separate<["-"], "fopenmp-host-ir-file-path">,
HelpText<"Path to the IR file produced by the frontend for the host.">;
-
+
} // let Flags = [CC1Option]
diff --git a/include/clang/Driver/Driver.h b/include/clang/Driver/Driver.h
index 017248c3690f..b7b802221180 100644
--- a/include/clang/Driver/Driver.h
+++ b/include/clang/Driver/Driver.h
@@ -256,7 +256,7 @@ private:
llvm::opt::DerivedArgList *
TranslateInputArgs(const llvm::opt::InputArgList &Args) const;
- // getFinalPhase - Determine which compilation mode we are in and record
+ // getFinalPhase - Determine which compilation mode we are in and record
// which option we used to determine the final phase.
phases::ID getFinalPhase(const llvm::opt::DerivedArgList &DAL,
llvm::opt::Arg **FinalPhaseArg = nullptr) const;
@@ -365,12 +365,12 @@ public:
llvm::opt::InputArgList ParseArgStrings(ArrayRef<const char *> Args,
bool &ContainsError);
- /// BuildInputs - Construct the list of inputs and their types from
+ /// BuildInputs - Construct the list of inputs and their types from
/// the given arguments.
///
/// \param TC - The default host tool chain.
/// \param Args - The input arguments.
- /// \param Inputs - The list to store the resulting compilation
+ /// \param Inputs - The list to store the resulting compilation
/// inputs onto.
void BuildInputs(const ToolChain &TC, llvm::opt::DerivedArgList &Args,
InputList &Inputs) const;
@@ -493,7 +493,7 @@ public:
/// \param JA - The action of interest.
/// \param BaseInput - The original input file that this action was
/// triggered by.
- /// \param BoundArch - The bound architecture.
+ /// \param BoundArch - The bound architecture.
/// \param AtTopLevel - Whether this is a "top-level" action.
/// \param MultipleArchs - Whether multiple -arch options were supplied.
/// \param NormalizedTriple - The normalized triple of the relevant target.
@@ -502,7 +502,7 @@ public:
bool AtTopLevel, bool MultipleArchs,
StringRef NormalizedTriple) const;
- /// GetTemporaryPath - Return the pathname of a temporary file to use
+ /// GetTemporaryPath - Return the pathname of a temporary file to use
/// as part of compilation; the file will have the given prefix and suffix.
///
/// GCC goes to extra lengths here to be a bit more robust.
diff --git a/include/clang/Driver/ToolChain.h b/include/clang/Driver/ToolChain.h
index addf7aa6a9c8..2f9c2c190e32 100644
--- a/include/clang/Driver/ToolChain.h
+++ b/include/clang/Driver/ToolChain.h
@@ -413,6 +413,11 @@ public:
return llvm::DebuggerKind::GDB;
}
+ /// Does this toolchain supports given debug info option or not.
+ virtual bool supportsDebugInfoOption(const llvm::opt::Arg *) const {
+ return true;
+ }
+
/// GetExceptionModel - Return the tool chain exception model.
virtual llvm::ExceptionHandling
GetExceptionModel(const llvm::opt::ArgList &Args) const;
diff --git a/include/clang/Edit/Commit.h b/include/clang/Edit/Commit.h
index a574b8ef4cd2..d6eb6cd84f93 100644
--- a/include/clang/Edit/Commit.h
+++ b/include/clang/Edit/Commit.h
@@ -57,7 +57,7 @@ private:
bool IsCommitable = true;
SmallVector<Edit, 8> CachedEdits;
-
+
llvm::BumpPtrAllocator StrAlloc;
public:
diff --git a/include/clang/Edit/EditedSource.h b/include/clang/Edit/EditedSource.h
index 3d33688f5f73..52873c3c3841 100644
--- a/include/clang/Edit/EditedSource.h
+++ b/include/clang/Edit/EditedSource.h
@@ -85,7 +85,7 @@ public:
bool canInsertInOffset(SourceLocation OrigLoc, FileOffset Offs);
bool commit(const Commit &commit);
-
+
void applyRewrites(EditsReceiver &receiver, bool adjustRemovals = true);
void clearRewrites();
diff --git a/include/clang/Edit/Rewriters.h b/include/clang/Edit/Rewriters.h
index 980ed1d3363f..8338d71b3e52 100644
--- a/include/clang/Edit/Rewriters.h
+++ b/include/clang/Edit/Rewriters.h
@@ -29,7 +29,7 @@ bool rewriteObjCRedundantCallWithLiteral(const ObjCMessageExpr *Msg,
bool rewriteToObjCLiteralSyntax(const ObjCMessageExpr *Msg,
const NSAPI &NS, Commit &commit,
const ParentMap *PMap);
-
+
bool rewriteToObjCSubscriptSyntax(const ObjCMessageExpr *Msg,
const NSAPI &NS, Commit &commit);
diff --git a/include/clang/Frontend/ASTUnit.h b/include/clang/Frontend/ASTUnit.h
index 9f529ba0e0e8..ba145965462f 100644
--- a/include/clang/Frontend/ASTUnit.h
+++ b/include/clang/Frontend/ASTUnit.h
@@ -159,7 +159,7 @@ private:
/// Whether the ASTUnit should delete the remapped buffers.
bool OwnsRemappedFileBuffers = true;
-
+
/// Track the top-level decls which appeared in an ASTUnit which was loaded
/// from a source file.
//
@@ -176,7 +176,7 @@ private:
/// Map from FileID to the file-level declarations that it contains.
/// The files and decls are only local (and non-preamble) ones.
FileDeclsTy FileDecls;
-
+
/// The name of the original source file used to generate this ASTUnit.
std::string OriginalSourceFile;
@@ -197,7 +197,7 @@ private:
/// Diagnostics that come from the driver are retained from one parse to
/// the next.
unsigned NumStoredDiagnosticsFromDriver = 0;
-
+
/// Counter that determines when we want to try building a
/// precompiled preamble.
///
@@ -236,7 +236,7 @@ private:
/// A list of the serialization ID numbers for each of the top-level
/// declarations parsed within the precompiled preamble.
std::vector<serialization::DeclID> TopLevelDeclsInPreamble;
-
+
/// Whether we should be caching code-completion results.
bool ShouldCacheCodeCompletionResults : 1;
@@ -247,7 +247,7 @@ private:
/// True if non-system source files should be treated as volatile
/// (likely to change while trying to use them).
bool UserFilesAreVolatile : 1;
-
+
static void ConfigureDiags(IntrusiveRefCntPtr<DiagnosticsEngine> Diags,
ASTUnit &AST, bool CaptureDiagnostics);
@@ -265,7 +265,7 @@ public:
/// The code-completion string corresponding to this completion
/// result.
CodeCompletionString *Completion;
-
+
/// A bitmask that indicates which code-completion contexts should
/// contain this completion result.
///
@@ -274,20 +274,20 @@ public:
/// bit, shift 1 by that number of bits. Many completions can occur in
/// several different contexts.
uint64_t ShowInContexts;
-
+
/// The priority given to this code-completion result.
unsigned Priority;
-
- /// The libclang cursor kind corresponding to this code-completion
+
+ /// The libclang cursor kind corresponding to this code-completion
/// result.
CXCursorKind Kind;
-
+
/// The availability of this code-completion result.
CXAvailabilityKind Availability;
-
+
/// The simplified type class for a non-macro completion result.
SimplifiedTypeClass TypeClass;
-
+
/// The type of a non-macro completion result, stored as a unique
/// integer used by the string map of cached completion types.
///
@@ -296,13 +296,13 @@ public:
/// for more information.
unsigned Type;
};
-
+
/// Retrieve the mapping from formatted type names to unique type
/// identifiers.
llvm::StringMap<unsigned> &getCachedCompletionTypes() {
- return CachedCompletionTypes;
+ return CachedCompletionTypes;
}
-
+
/// Retrieve the allocator used to cache global code completions.
std::shared_ptr<GlobalCodeCompletionAllocator>
getCachedCompletionAllocator() {
@@ -324,29 +324,29 @@ private:
/// The set of cached code-completion results.
std::vector<CachedCodeCompletionResult> CachedCompletionResults;
-
+
/// A mapping from the formatted type name to a unique number for that
/// type, which is used for type equality comparisons.
llvm::StringMap<unsigned> CachedCompletionTypes;
-
- /// A string hash of the top-level declaration and macro definition
+
+ /// A string hash of the top-level declaration and macro definition
/// names processed the last time that we reparsed the file.
///
- /// This hash value is used to determine when we need to refresh the
+ /// This hash value is used to determine when we need to refresh the
/// global code-completion cache.
unsigned CompletionCacheTopLevelHashValue = 0;
- /// A string hash of the top-level declaration and macro definition
+ /// A string hash of the top-level declaration and macro definition
/// names processed the last time that we reparsed the precompiled preamble.
///
- /// This hash value is used to determine when we need to refresh the
+ /// This hash value is used to determine when we need to refresh the
/// global code-completion cache after a rebuild of the precompiled preamble.
unsigned PreambleTopLevelHashValue = 0;
/// The current hash value for the top-level declaration and macro
/// definition names
unsigned CurrentTopLevelHashValue = 0;
-
+
/// Bit used by CIndex to mark when a translation unit may be in an
/// inconsistent state, and is not safe to free.
unsigned UnsafeToFree : 1;
@@ -357,10 +357,10 @@ private:
/// Cache any "global" code-completion results, so that we can avoid
/// recomputing them with each completion.
void CacheCodeCompletionResults();
-
- /// Clear out and deallocate
+
+ /// Clear out and deallocate
void ClearCachedCompletionResults();
-
+
explicit ASTUnit(bool MainFileIsAST);
bool Parse(std::shared_ptr<PCHContainerOperations> PCHContainerOps,
@@ -402,9 +402,9 @@ public:
class ConcurrencyCheck {
ASTUnit &Self;
-
+
public:
- explicit ConcurrencyCheck(ASTUnit &Self) : Self(Self) {
+ explicit ConcurrencyCheck(ASTUnit &Self) : Self(Self) {
Self.ConcurrencyCheckValue.start();
}
@@ -424,7 +424,7 @@ public:
const DiagnosticsEngine &getDiagnostics() const { return *Diagnostics; }
DiagnosticsEngine &getDiagnostics() { return *Diagnostics; }
-
+
const SourceManager &getSourceManager() const { return *SourceMgr; }
SourceManager &getSourceManager() { return *SourceMgr; }
@@ -449,7 +449,7 @@ public:
bool hasSema() const { return (bool)TheSema; }
- Sema &getSema() const {
+ Sema &getSema() const {
assert(TheSema && "ASTUnit does not have a Sema object!");
return *TheSema;
}
@@ -463,12 +463,12 @@ public:
assert(HSOpts && "ASTUnit does not have header search options");
return *HSOpts;
}
-
+
const PreprocessorOptions &getPreprocessorOpts() const {
assert(PPOpts && "ASTUnit does not have preprocessor options");
return *PPOpts;
}
-
+
const FileManager &getFileManager() const { return *FileMgr; }
FileManager &getFileManager() { return *FileMgr; }
@@ -529,7 +529,7 @@ public:
/// Get the decls that are contained in a file in the Offset/Length
/// range. \p Length can be 0 to indicate a point at \p Offset instead of
- /// a range.
+ /// a range.
void findFileRegionDecls(FileID File, unsigned Offset, unsigned Length,
SmallVectorImpl<Decl *> &Decls);
@@ -575,25 +575,25 @@ public:
return SourceRange(mapLocationToPreamble(R.getBegin()),
mapLocationToPreamble(R.getEnd()));
}
-
+
// Retrieve the diagnostics associated with this AST
using stored_diag_iterator = StoredDiagnostic *;
using stored_diag_const_iterator = const StoredDiagnostic *;
- stored_diag_const_iterator stored_diag_begin() const {
- return StoredDiagnostics.begin();
+ stored_diag_const_iterator stored_diag_begin() const {
+ return StoredDiagnostics.begin();
}
- stored_diag_iterator stored_diag_begin() {
- return StoredDiagnostics.begin();
+ stored_diag_iterator stored_diag_begin() {
+ return StoredDiagnostics.begin();
}
- stored_diag_const_iterator stored_diag_end() const {
- return StoredDiagnostics.end();
+ stored_diag_const_iterator stored_diag_end() const {
+ return StoredDiagnostics.end();
}
- stored_diag_iterator stored_diag_end() {
- return StoredDiagnostics.end();
+ stored_diag_iterator stored_diag_end() {
+ return StoredDiagnostics.end();
}
unsigned stored_diag_size() const { return StoredDiagnostics.size(); }
@@ -601,12 +601,12 @@ public:
stored_diag_iterator stored_diag_afterDriver_begin() {
if (NumStoredDiagnosticsFromDriver > StoredDiagnostics.size())
NumStoredDiagnosticsFromDriver = 0;
- return StoredDiagnostics.begin() + NumStoredDiagnosticsFromDriver;
+ return StoredDiagnostics.begin() + NumStoredDiagnosticsFromDriver;
}
using cached_completion_iterator =
std::vector<CachedCodeCompletionResult>::iterator;
-
+
cached_completion_iterator cached_completion_begin() {
return CachedCompletionResults.begin();
}
@@ -615,8 +615,8 @@ public:
return CachedCompletionResults.end();
}
- unsigned cached_completion_size() const {
- return CachedCompletionResults.size();
+ unsigned cached_completion_size() const {
+ return CachedCompletionResults.size();
}
/// Returns an iterator range for the local preprocessing entities
@@ -712,7 +712,7 @@ private:
public:
/// Create an ASTUnit from a source file, via a CompilerInvocation
- /// object, by invoking the optionally provided ASTFrontendAction.
+ /// object, by invoking the optionally provided ASTFrontendAction.
///
/// \param CI - The compiler invocation to use; it must have exactly one input
/// source file. The ASTUnit takes ownership of the CompilerInvocation object.
@@ -854,10 +854,10 @@ public:
///
/// \param Column The column at which code completion will occur.
///
- /// \param IncludeMacros Whether to include macros in the code-completion
+ /// \param IncludeMacros Whether to include macros in the code-completion
/// results.
///
- /// \param IncludeCodePatterns Whether to include code patterns (such as a
+ /// \param IncludeCodePatterns Whether to include code patterns (such as a
/// for loop) in the code-completion results.
///
/// \param IncludeBriefComments Whether to include brief documentation within
diff --git a/include/clang/Frontend/CompilerInstance.h b/include/clang/Frontend/CompilerInstance.h
index 977d1b2ed65f..818c733982d9 100644
--- a/include/clang/Frontend/CompilerInstance.h
+++ b/include/clang/Frontend/CompilerInstance.h
@@ -144,9 +144,9 @@ class CompilerInstance : public ModuleLoader {
bool DeleteBuiltModules = true;
/// The location of the module-import keyword for the last module
- /// import.
+ /// import.
SourceLocation LastModuleImportLoc;
-
+
/// The result of the last module import.
///
ModuleLoadResult LastModuleImportResult;
@@ -246,7 +246,7 @@ public:
/// Indicates whether we should (re)build the global module index.
bool shouldBuildGlobalModuleIndex() const;
-
+
/// Set the flag indicating whether we should (re)build the global
/// module index.
void setBuildGlobalModuleIndex(bool Build) {
@@ -350,7 +350,7 @@ public:
void setDiagnostics(DiagnosticsEngine *Value);
DiagnosticConsumer &getDiagnosticClient() const {
- assert(Diagnostics && Diagnostics->getClient() &&
+ assert(Diagnostics && Diagnostics->getClient() &&
"Compiler instance has no diagnostic client!");
return *Diagnostics->getClient();
}
@@ -409,7 +409,7 @@ public:
assert(FileMgr && "Compiler instance has no file manager!");
return *FileMgr;
}
-
+
void resetAndLeakFileManager() {
BuryPointer(FileMgr.get());
FileMgr.resetWithoutRelease();
@@ -429,7 +429,7 @@ public:
assert(SourceMgr && "Compiler instance has no source manager!");
return *SourceMgr;
}
-
+
void resetAndLeakSourceManager() {
BuryPointer(SourceMgr.get());
SourceMgr.resetWithoutRelease();
@@ -469,7 +469,7 @@ public:
assert(Context && "Compiler instance has no AST context!");
return *Context;
}
-
+
void resetAndLeakASTContext() {
BuryPointer(Context.get());
Context.resetWithoutRelease();
@@ -481,7 +481,7 @@ public:
/// Replace the current Sema; the compiler instance takes ownership
/// of S.
void setSema(Sema *S);
-
+
/// }
/// @name ASTConsumer
/// {
@@ -506,7 +506,7 @@ public:
/// {
bool hasSema() const { return (bool)TheSema; }
- Sema &getSema() const {
+ Sema &getSema() const {
assert(TheSema && "Compiler instance has no Sema object!");
return *TheSema;
}
@@ -613,7 +613,7 @@ public:
/// attached to (and, then, owned by) the DiagnosticsEngine inside this AST
/// unit.
///
- /// \param ShouldOwnClient If Client is non-NULL, specifies whether
+ /// \param ShouldOwnClient If Client is non-NULL, specifies whether
/// the diagnostic object should take ownership of the client.
void createDiagnostics(DiagnosticConsumer *Client = nullptr,
bool ShouldOwnClient = true);
@@ -693,7 +693,7 @@ public:
/// Create the Sema object to be used for parsing.
void createSema(TranslationUnitKind TUKind,
CodeCompleteConsumer *CompletionConsumer);
-
+
/// Create the frontend timer and replace any existing one with it.
void createFrontendTimer();
diff --git a/include/clang/Frontend/CompilerInvocation.h b/include/clang/Frontend/CompilerInvocation.h
index 3d302051d298..1d421f09fdcc 100644
--- a/include/clang/Frontend/CompilerInvocation.h
+++ b/include/clang/Frontend/CompilerInvocation.h
@@ -106,7 +106,7 @@ public:
return *PreprocessorOpts;
}
};
-
+
/// Helper class for holding the data necessary to invoke the compiler.
///
/// This class is designed to represent an abstract "invocation" of the
@@ -117,7 +117,7 @@ class CompilerInvocation : public CompilerInvocationBase {
AnalyzerOptionsRef AnalyzerOpts;
MigratorOptions MigratorOpts;
-
+
/// Options controlling IRgen and the backend.
CodeGenOptions CodeGenOpts;
@@ -172,11 +172,11 @@ public:
static void setLangDefaults(LangOptions &Opts, InputKind IK,
const llvm::Triple &T, PreprocessorOptions &PPOpts,
LangStandard::Kind LangStd = LangStandard::lang_unspecified);
-
- /// Retrieve a module hash string that is suitable for uniquely
+
+ /// Retrieve a module hash string that is suitable for uniquely
/// identifying the conditions under which the module was built.
std::string getModuleHash() const;
-
+
/// @}
/// @name Option Subgroups
/// @{
@@ -185,7 +185,7 @@ public:
MigratorOptions &getMigratorOpts() { return MigratorOpts; }
const MigratorOptions &getMigratorOpts() const { return MigratorOpts; }
-
+
CodeGenOptions &getCodeGenOpts() { return CodeGenOpts; }
const CodeGenOptions &getCodeGenOpts() const { return CodeGenOpts; }
diff --git a/include/clang/Frontend/DiagnosticRenderer.h b/include/clang/Frontend/DiagnosticRenderer.h
index 191d32accf2f..3bbf37946d0b 100644
--- a/include/clang/Frontend/DiagnosticRenderer.h
+++ b/include/clang/Frontend/DiagnosticRenderer.h
@@ -32,7 +32,7 @@ class SourceManager;
using DiagOrStoredDiag =
llvm::PointerUnion<const Diagnostic *, const StoredDiagnostic *>;
-
+
/// Class to encapsulate the logic for formatting a diagnostic message.
///
/// Actual "printing" logic is implemented by subclasses.
@@ -49,20 +49,20 @@ class DiagnosticRenderer {
protected:
const LangOptions &LangOpts;
IntrusiveRefCntPtr<DiagnosticOptions> DiagOpts;
-
+
/// The location of the previous diagnostic if known.
///
/// This will be invalid in cases where there is no (known) previous
/// diagnostic location, or that location itself is invalid or comes from
/// a different source manager than SM.
SourceLocation LastLoc;
-
+
/// The location of the last include whose stack was printed if known.
///
/// Same restriction as LastLoc essentially, but tracking include stack
/// root locations rather than diagnostic locations.
SourceLocation LastIncludeLoc;
-
+
/// The level of the last diagnostic emitted.
///
/// The level of the last diagnostic emitted. Used to detect level changes
@@ -71,7 +71,7 @@ protected:
DiagnosticRenderer(const LangOptions &LangOpts,
DiagnosticOptions *DiagOpts);
-
+
virtual ~DiagnosticRenderer();
virtual void emitDiagnosticMessage(FullSourceLoc Loc, PresumedLoc PLoc,
@@ -137,7 +137,7 @@ public:
void emitStoredDiagnostic(StoredDiagnostic &Diag);
};
-
+
/// Subclass of DiagnosticRender that turns all subdiagostics into explicit
/// notes. It is up to subclasses to further define the behavior.
class DiagnosticNoteRenderer : public DiagnosticRenderer {
diff --git a/include/clang/Frontend/FrontendActions.h b/include/clang/Frontend/FrontendActions.h
index 20f1b3e11bdb..54539a5b3cee 100644
--- a/include/clang/Frontend/FrontendActions.h
+++ b/include/clang/Frontend/FrontendActions.h
@@ -18,7 +18,7 @@ namespace clang {
class Module;
class FileEntry;
-
+
//===----------------------------------------------------------------------===//
// Custom Consumer Actions
//===----------------------------------------------------------------------===//
@@ -198,7 +198,7 @@ protected:
class ASTMergeAction : public FrontendAction {
/// The action that the merge action adapts.
std::unique_ptr<FrontendAction> AdaptedAction;
-
+
/// The set of AST files to merge.
std::vector<std::string> ASTFiles;
@@ -233,7 +233,7 @@ protected:
bool usesPreprocessorOnly() const override { return true; }
};
-
+
//===----------------------------------------------------------------------===//
// Preprocessor Actions
//===----------------------------------------------------------------------===//
@@ -264,7 +264,7 @@ protected:
bool hasPCHSupport() const override { return true; }
};
-
+
} // end namespace clang
#endif
diff --git a/include/clang/Frontend/LayoutOverrideSource.h b/include/clang/Frontend/LayoutOverrideSource.h
index 0b7f7dc7a7d6..28e3cf005b30 100644
--- a/include/clang/Frontend/LayoutOverrideSource.h
+++ b/include/clang/Frontend/LayoutOverrideSource.h
@@ -27,24 +27,24 @@ namespace clang {
struct Layout {
/// The size of the record.
uint64_t Size;
-
+
/// The alignment of the record.
uint64_t Align;
-
+
/// The offsets of the fields, in source order.
SmallVector<uint64_t, 8> FieldOffsets;
};
-
+
/// The set of layouts that will be overridden.
llvm::StringMap<Layout> Layouts;
-
+
public:
/// Create a new AST source that overrides the layout of some
/// set of record types.
///
/// The file is the result of passing -fdump-record-layouts to a file.
explicit LayoutOverrideSource(StringRef Filename);
-
+
/// If this particular record type has an overridden layout,
/// return that layout.
bool
@@ -54,7 +54,7 @@ namespace clang {
llvm::DenseMap<const CXXRecordDecl *, CharUnits> &BaseOffsets,
llvm::DenseMap<const CXXRecordDecl *,
CharUnits> &VirtualBaseOffsets) override;
-
+
/// Dump the overridden layouts.
void dump();
};
diff --git a/include/clang/Frontend/LogDiagnosticPrinter.h b/include/clang/Frontend/LogDiagnosticPrinter.h
index 98adf655fcf1..3286ecf2cdd3 100644
--- a/include/clang/Frontend/LogDiagnosticPrinter.h
+++ b/include/clang/Frontend/LogDiagnosticPrinter.h
@@ -23,22 +23,22 @@ class LogDiagnosticPrinter : public DiagnosticConsumer {
struct DiagEntry {
/// The primary message line of the diagnostic.
std::string Message;
-
+
/// The source file name, if available.
std::string Filename;
-
+
/// The source file line number, if available.
unsigned Line;
-
+
/// The source file column number, if available.
unsigned Column;
-
+
/// The ID of the diagnostic.
unsigned DiagnosticID;
/// The Option Flag for the diagnostic
std::string WarningOption;
-
+
/// The level of the diagnostic.
DiagnosticsEngine::Level DiagnosticLevel;
};
diff --git a/include/clang/Frontend/PCHContainerOperations.h b/include/clang/Frontend/PCHContainerOperations.h
index f9a73508d700..7a12ebc862e7 100644
--- a/include/clang/Frontend/PCHContainerOperations.h
+++ b/include/clang/Frontend/PCHContainerOperations.h
@@ -34,12 +34,12 @@ struct PCHBuffer {
llvm::SmallVector<char, 0> Data;
bool IsComplete;
};
-
+
/// This abstract interface provides operations for creating
/// containers for serialized ASTs (precompiled headers and clang
/// modules).
class PCHContainerWriter {
-public:
+public:
virtual ~PCHContainerWriter() = 0;
virtual StringRef getFormat() const = 0;
@@ -58,7 +58,7 @@ public:
/// containers for serialized ASTs (precompiled headers and clang
/// modules).
class PCHContainerReader {
-public:
+public:
virtual ~PCHContainerReader() = 0;
/// Equivalent to the format passed to -fmodule-format=
virtual StringRef getFormat() const = 0;
@@ -102,7 +102,7 @@ public:
}
void registerReader(std::unique_ptr<PCHContainerReader> Reader) {
Readers[Reader->getFormat()] = std::move(Reader);
- }
+ }
const PCHContainerWriter *getWriterOrNull(StringRef Format) {
return Writers[Format].get();
}
diff --git a/include/clang/Frontend/VerifyDiagnosticConsumer.h b/include/clang/Frontend/VerifyDiagnosticConsumer.h
index 9d985bc4955f..f36970f1eb39 100644
--- a/include/clang/Frontend/VerifyDiagnosticConsumer.h
+++ b/include/clang/Frontend/VerifyDiagnosticConsumer.h
@@ -252,7 +252,7 @@ private:
public:
/// Create a new verifying diagnostic client, which will issue errors to
- /// the currently-attached diagnostic client when a diagnostic does not match
+ /// the currently-attached diagnostic client when a diagnostic does not match
/// what is expected (as indicated in the source file).
VerifyDiagnosticConsumer(DiagnosticsEngine &Diags);
~VerifyDiagnosticConsumer() override;
diff --git a/include/clang/Lex/CodeCompletionHandler.h b/include/clang/Lex/CodeCompletionHandler.h
index be153cc1ad50..87089fd7d50b 100644
--- a/include/clang/Lex/CodeCompletionHandler.h
+++ b/include/clang/Lex/CodeCompletionHandler.h
@@ -18,13 +18,13 @@ namespace clang {
class IdentifierInfo;
class MacroInfo;
-
-/// Callback handler that receives notifications when performing code
+
+/// Callback handler that receives notifications when performing code
/// completion within the preprocessor.
class CodeCompletionHandler {
public:
virtual ~CodeCompletionHandler();
-
+
/// Callback invoked when performing code completion for a preprocessor
/// directive.
///
@@ -34,23 +34,23 @@ public:
/// \param InConditional Whether we're inside a preprocessor conditional
/// already.
virtual void CodeCompleteDirective(bool InConditional) { }
-
+
/// Callback invoked when performing code completion within a block of
/// code that was excluded due to preprocessor conditionals.
virtual void CodeCompleteInConditionalExclusion() { }
-
+
/// Callback invoked when performing code completion in a context
/// where the name of a macro is expected.
///
/// \param IsDefinition Whether this is the definition of a macro, e.g.,
/// in a \#define.
virtual void CodeCompleteMacroName(bool IsDefinition) { }
-
+
/// Callback invoked when performing code completion in a preprocessor
/// expression, such as the condition of an \#if or \#elif directive.
virtual void CodeCompletePreprocessorExpression() { }
-
- /// Callback invoked when performing code completion inside a
+
+ /// Callback invoked when performing code completion inside a
/// function-like macro argument.
///
/// There will be another callback invocation after the macro arguments are
@@ -61,11 +61,11 @@ public:
unsigned ArgumentIndex) { }
/// Callback invoked when performing code completion in a part of the
- /// file where we expect natural language, e.g., a comment, string, or
+ /// file where we expect natural language, e.g., a comment, string, or
/// \#error directive.
virtual void CodeCompleteNaturalLanguage() { }
};
-
+
}
#endif // LLVM_CLANG_LEX_CODECOMPLETIONHANDLER_H
diff --git a/include/clang/Lex/DirectoryLookup.h b/include/clang/Lex/DirectoryLookup.h
index 222ebf025ac0..55065b7d8547 100644
--- a/include/clang/Lex/DirectoryLookup.h
+++ b/include/clang/Lex/DirectoryLookup.h
@@ -24,7 +24,7 @@ class DirectoryEntry;
class FileEntry;
class HeaderSearch;
class Module;
-
+
/// DirectoryLookup - This class represents one entry in the search list that
/// specifies the search order for directories in \#include directives. It
/// represents either a directory, a framework, or a headermap.
@@ -54,14 +54,14 @@ private:
/// LookupType - This indicates whether this DirectoryLookup object is a
/// normal directory, a framework, or a headermap.
unsigned LookupType : 2;
-
+
/// Whether this is a header map used when building a framework.
unsigned IsIndexHeaderMap : 1;
/// Whether we've performed an exhaustive search for module maps
/// within the subdirectories of this directory.
unsigned SearchedAllModuleMaps : 1;
-
+
public:
/// DirectoryLookup ctor - Note that this ctor *does not take ownership* of
/// 'dir'.
@@ -140,10 +140,10 @@ public:
}
/// Whether this header map is building a framework or not.
- bool isIndexHeaderMap() const {
- return isHeaderMap() && IsIndexHeaderMap;
+ bool isIndexHeaderMap() const {
+ return isHeaderMap() && IsIndexHeaderMap;
}
-
+
/// LookupFile - Lookup the specified file in this search path, returning it
/// if it exists or returning null if not.
///
diff --git a/include/clang/Lex/ExternalPreprocessorSource.h b/include/clang/Lex/ExternalPreprocessorSource.h
index f34be682617c..d849bbd76188 100644
--- a/include/clang/Lex/ExternalPreprocessorSource.h
+++ b/include/clang/Lex/ExternalPreprocessorSource.h
@@ -19,18 +19,18 @@ namespace clang {
class IdentifierInfo;
class Module;
-/// Abstract interface for external sources of preprocessor
+/// Abstract interface for external sources of preprocessor
/// information.
///
-/// This abstract class allows an external sources (such as the \c ASTReader)
+/// This abstract class allows an external sources (such as the \c ASTReader)
/// to provide additional preprocessing information.
class ExternalPreprocessorSource {
public:
virtual ~ExternalPreprocessorSource();
-
+
/// Read the set of macros defined by this external macro source.
virtual void ReadDefinedMacros() = 0;
-
+
/// Update an out-of-date identifier.
virtual void updateOutOfDateIdentifier(IdentifierInfo &II) = 0;
@@ -42,7 +42,7 @@ public:
/// Map a module ID to a module.
virtual Module *getModule(unsigned ModuleID) = 0;
};
-
+
}
#endif
diff --git a/include/clang/Lex/HeaderSearch.h b/include/clang/Lex/HeaderSearch.h
index b7147c54faac..6bb0f58f2db9 100644
--- a/include/clang/Lex/HeaderSearch.h
+++ b/include/clang/Lex/HeaderSearch.h
@@ -74,9 +74,9 @@ struct HeaderFileInfo {
/// Whether this structure is considered to already have been
/// "resolved", meaning that it was loaded from the external source.
unsigned Resolved : 1;
-
+
/// Whether this is a header inside a framework that is currently
- /// being built.
+ /// being built.
///
/// When a framework is being built, the headers have not yet been placed
/// into the appropriate framework subdirectories, and therefore are
@@ -86,7 +86,7 @@ struct HeaderFileInfo {
/// Whether this file has been looked up as a header.
unsigned IsValid : 1;
-
+
/// The number of times the file has been included already.
unsigned short NumIncludes = 0;
@@ -110,9 +110,9 @@ struct HeaderFileInfo {
/// If this header came from a framework include, this is the name
/// of the framework.
StringRef Framework;
-
+
HeaderFileInfo()
- : isImport(false), isPragmaOnce(false), DirInfo(SrcMgr::C_User),
+ : isImport(false), isPragmaOnce(false), DirInfo(SrcMgr::C_User),
External(false), isModuleHeader(false), isCompilingModuleHeader(false),
Resolved(false), IndexHeaderMapHeader(false), IsValid(false) {}
@@ -124,7 +124,7 @@ struct HeaderFileInfo {
/// Determine whether this is a non-default header file info, e.g.,
/// it corresponds to an actual header we've included or tried to include.
bool isNonDefault() const {
- return isImport || isPragmaOnce || NumIncludes || ControllingMacro ||
+ return isImport || isPragmaOnce || NumIncludes || ControllingMacro ||
ControllingMacroID;
}
};
@@ -134,15 +134,15 @@ struct HeaderFileInfo {
class ExternalHeaderFileInfoSource {
public:
virtual ~ExternalHeaderFileInfoSource();
-
+
/// Retrieve the header file information for the given file entry.
///
/// \returns Header file information for the given file entry, with the
- /// \c External bit set. If the file entry is not known, return a
+ /// \c External bit set. If the file entry is not known, return a
/// default-constructed \c HeaderFileInfo.
virtual HeaderFileInfo GetHeaderFileInfo(const FileEntry *FE) = 0;
};
-
+
/// Encapsulates the information needed to find the file referenced
/// by a \#include or \#include_next, (sub-)framework lookup, etc.
class HeaderSearch {
@@ -186,7 +186,7 @@ class HeaderSearch {
/// The path to the module cache.
std::string ModuleCachePath;
-
+
/// All of the preprocessor-specific data about files that are
/// included, indexed by the FileEntry's UID.
mutable std::vector<HeaderFileInfo> FileInfo;
@@ -232,7 +232,7 @@ class HeaderSearch {
/// The mapping between modules and headers.
mutable ModuleMap ModMap;
-
+
/// Describes whether a given directory has a module map in it.
llvm::DenseMap<const DirectoryEntry *, bool> DirectoryHasModuleMap;
@@ -240,10 +240,10 @@ class HeaderSearch {
/// whether they were valid or not.
llvm::DenseMap<const FileEntry *, bool> LoadedModuleMaps;
- /// Uniqued set of framework names, which is used to track which
+ /// Uniqued set of framework names, which is used to track which
/// headers were included as framework headers.
llvm::StringSet<llvm::BumpPtrAllocator> FrameworkNames;
-
+
/// Entity used to resolve the identifier IDs of controlling
/// macros into IdentifierInfo pointers, and keep the identifire up to date,
/// as needed.
@@ -251,7 +251,7 @@ class HeaderSearch {
/// Entity used to look up stored header file information.
ExternalHeaderFileInfoSource *ExternalSource = nullptr;
-
+
// Various statistics we track for performance analysis.
unsigned NumIncluded = 0;
unsigned NumMultiIncludeFileOptzn = 0;
@@ -269,7 +269,7 @@ public:
/// Retrieve the header-search options with which this header search
/// was initialized.
HeaderSearchOptions &getHeaderSearchOpts() const { return *HSOpts; }
-
+
FileManager &getFileMgr() const { return FileMgr; }
DiagnosticsEngine &getDiags() const { return Diags; }
@@ -306,7 +306,7 @@ public:
/// Map the source include name to the dest include name.
///
- /// The Source should include the angle brackets or quotes, the dest
+ /// The Source should include the angle brackets or quotes, the dest
/// should not. This allows for distinction between <> and "" headers.
void AddIncludeAlias(StringRef Source, StringRef Dest) {
if (!IncludeAliases)
@@ -332,7 +332,7 @@ public:
void setModuleCachePath(StringRef CachePath) {
ModuleCachePath = CachePath;
}
-
+
/// Retrieve the path to the module cache.
StringRef getModuleCachePath() const { return ModuleCachePath; }
@@ -340,7 +340,7 @@ public:
void setDirectoryHasModuleMap(const DirectoryEntry* Dir) {
DirectoryHasModuleMap[Dir] = true;
}
-
+
/// Forget everything we know about headers so far.
void ClearFileInfo() {
FileInfo.clear();
@@ -353,16 +353,16 @@ public:
ExternalPreprocessorSource *getExternalLookup() const {
return ExternalLookup;
}
-
+
/// Set the external source of header information.
void SetExternalSource(ExternalHeaderFileInfoSource *ES) {
ExternalSource = ES;
}
-
+
/// Set the target information for the header search, if not
/// already known.
void setTarget(const TargetInfo &Target);
-
+
/// Given a "foo" or \<foo> reference, look up the indicated file,
/// return null on failure.
///
@@ -540,7 +540,7 @@ public:
/// \c nullptr if none is found.
const FileEntry *lookupModuleMapFile(const DirectoryEntry *Dir,
bool IsFramework);
-
+
void IncrementFrameworkLookupCount() { ++NumFrameworkLookups; }
/// Determine whether there is a module map that may map the header
@@ -556,7 +556,7 @@ public:
/// header directories.
bool hasModuleMap(StringRef Filename, const DirectoryEntry *Root,
bool IsSystem);
-
+
/// Retrieve the module that corresponds to the given file, if any.
///
/// \param File The header that we wish to map to a module.
@@ -617,7 +617,7 @@ private:
/// frameworks.
///
/// \returns The module, if found; otherwise, null.
- Module *loadFrameworkModule(StringRef Name,
+ Module *loadFrameworkModule(StringRef Name,
const DirectoryEntry *Dir,
bool IsSystem);
@@ -655,10 +655,10 @@ private:
public:
/// Retrieve the module map.
ModuleMap &getModuleMap() { return ModMap; }
-
+
/// Retrieve the module map.
const ModuleMap &getModuleMap() const { return ModMap; }
-
+
unsigned header_file_size() const { return FileInfo.size(); }
/// Return the HeaderFileInfo structure for the specified FileEntry,
@@ -722,7 +722,7 @@ public:
bool *IsSystem = nullptr);
void PrintStats();
-
+
size_t getTotalMemory() const;
private:
diff --git a/include/clang/Lex/HeaderSearchOptions.h b/include/clang/Lex/HeaderSearchOptions.h
index 298179e91a6f..e5b52b30323f 100644
--- a/include/clang/Lex/HeaderSearchOptions.h
+++ b/include/clang/Lex/HeaderSearchOptions.h
@@ -14,7 +14,7 @@
#include "llvm/ADT/CachedHashString.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/StringRef.h"
-#include <cstdint>
+#include <cstdint>
#include <string>
#include <vector>
#include <map>
@@ -36,7 +36,7 @@ enum IncludeDirGroup {
Angled,
/// Like Angled, but marks header maps used when building frameworks.
- IndexHeaderMap,
+ IndexHeaderMap,
/// Like Angled, but marks system directories.
System,
@@ -70,7 +70,7 @@ public:
std::string Path;
frontend::IncludeDirGroup Group;
unsigned IsFramework : 1;
-
+
/// IgnoreSysRoot - This is false if an absolute path should be treated
/// relative to the sysroot, or true if it should always be the absolute
/// path.
diff --git a/include/clang/Lex/LiteralSupport.h b/include/clang/Lex/LiteralSupport.h
index 1b6bf6bcffb0..3843a5afd2b0 100644
--- a/include/clang/Lex/LiteralSupport.h
+++ b/include/clang/Lex/LiteralSupport.h
@@ -208,7 +208,7 @@ class StringLiteralParser {
const LangOptions &Features;
const TargetInfo &Target;
DiagnosticsEngine *Diags;
-
+
unsigned MaxTokenLength;
unsigned SizeBound;
unsigned CharByteWidth;
@@ -230,7 +230,7 @@ public:
ResultPtr(ResultBuf.data()), hadError(false), Pascal(false) {
init(StringToks);
}
-
+
bool hadError;
bool Pascal;
diff --git a/include/clang/Lex/MacroArgs.h b/include/clang/Lex/MacroArgs.h
index a202550da3b3..853eee2fd779 100644
--- a/include/clang/Lex/MacroArgs.h
+++ b/include/clang/Lex/MacroArgs.h
@@ -27,7 +27,7 @@ namespace clang {
/// MacroArgs - An instance of this class captures information about
/// the formal arguments specified to a function-like macro invocation.
-class MacroArgs final
+class MacroArgs final
: private llvm::TrailingObjects<MacroArgs, Token> {
friend TrailingObjects;
@@ -43,7 +43,7 @@ class MacroArgs final
/// if in strict mode and the C99 varargs macro had only a ... argument, this
/// is false.
bool VarargsElided;
-
+
/// PreExpArgTokens - Pre-expanded tokens for arguments that need them. Empty
/// if not yet computed. This includes the EOF marker at the end of the
/// stream.
@@ -115,7 +115,7 @@ public:
/// Returns true if the macro was defined with a variadic (ellipsis) parameter
/// AND was invoked with at least one token supplied as a variadic argument.
///
- /// \code
+ /// \code
/// #define F(a) a
/// #define V(a, ...) __VA_OPT__(a)
/// F() <-- returns false on this invocation.
@@ -123,7 +123,7 @@ public:
/// V(,) <-- returns false on this invocation.
/// \endcode
///
-
+
bool invokedWithVariadicArgument(const MacroInfo *const MI) const;
/// StringifyArgument - Implement C99 6.10.3.2p2, converting a sequence of
@@ -135,8 +135,8 @@ public:
Preprocessor &PP, bool Charify,
SourceLocation ExpansionLocStart,
SourceLocation ExpansionLocEnd);
-
-
+
+
/// deallocate - This should only be called by the Preprocessor when managing
/// its freelist.
MacroArgs *deallocate();
diff --git a/include/clang/Lex/MacroInfo.h b/include/clang/Lex/MacroInfo.h
index 13e5313a9c30..0cc1cb92e67e 100644
--- a/include/clang/Lex/MacroInfo.h
+++ b/include/clang/Lex/MacroInfo.h
@@ -174,7 +174,7 @@ public:
std::copy(List.begin(), List.end(), ParameterList);
}
- /// Parameters - The list of parameters for a function-like macro. This can
+ /// Parameters - The list of parameters for a function-like macro. This can
/// be empty, for, e.g. "#define X()".
using param_iterator = IdentifierInfo *const *;
bool param_empty() const { return NumParameters == 0; }
diff --git a/include/clang/Lex/ModuleLoader.h b/include/clang/Lex/ModuleLoader.h
index a2766fa35984..05396dd20597 100644
--- a/include/clang/Lex/ModuleLoader.h
+++ b/include/clang/Lex/ModuleLoader.h
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
//
-// This file defines the ModuleLoader interface, which is responsible for
+// This file defines the ModuleLoader interface, which is responsible for
// loading named modules.
//
//===----------------------------------------------------------------------===//
@@ -80,7 +80,7 @@ public:
: BuildingModule(BuildingModule) {}
virtual ~ModuleLoader();
-
+
/// Returns true if this instance is building a module.
bool buildingModule() const {
return BuildingModule;
@@ -90,17 +90,17 @@ public:
void setBuildingModule(bool BuildingModuleFlag) {
BuildingModule = BuildingModuleFlag;
}
-
+
/// Attempt to load the given module.
///
- /// This routine attempts to load the module described by the given
+ /// This routine attempts to load the module described by the given
/// parameters.
///
/// \param ImportLoc The location of the 'import' keyword.
///
/// \param Path The identifiers (and their locations) of the module
/// "path", e.g., "std.vector" would be split into "std" and "vector".
- ///
+ ///
/// \param Visibility The visibility provided for the names in the loaded
/// module.
///
@@ -108,7 +108,7 @@ public:
/// implicitly, due to the presence of an inclusion directive. Otherwise,
/// it is being loaded due to an import declaration.
///
- /// \returns If successful, returns the loaded module. Otherwise, returns
+ /// \returns If successful, returns the loaded module. Otherwise, returns
/// NULL to indicate that the module could not be loaded.
virtual ModuleLoadResult loadModule(SourceLocation ImportLoc,
ModuleIdPath Path,
@@ -177,7 +177,7 @@ public:
return false;
}
};
-
+
} // namespace clang
#endif // LLVM_CLANG_LEX_MODULELOADER_H
diff --git a/include/clang/Lex/ModuleMap.h b/include/clang/Lex/ModuleMap.h
index 577f4008978e..aa519891c1ce 100644
--- a/include/clang/Lex/ModuleMap.h
+++ b/include/clang/Lex/ModuleMap.h
@@ -69,7 +69,7 @@ public:
virtual void moduleMapAddUmbrellaHeader(FileManager *FileMgr,
const FileEntry *Header) {}
};
-
+
class ModuleMap {
SourceManager &SourceMgr;
DiagnosticsEngine &Diags;
@@ -78,11 +78,11 @@ class ModuleMap {
HeaderSearch &HeaderInfo;
llvm::SmallVector<std::unique_ptr<ModuleMapCallbacks>, 1> Callbacks;
-
+
/// The directory used for Clang-supplied, builtin include headers,
/// such as "stdint.h".
const DirectoryEntry *BuiltinIncludeDir = nullptr;
-
+
/// Language options used to parse the module map itself.
///
/// These are always simple C language options.
@@ -285,7 +285,7 @@ private:
///
/// \returns The resolved export declaration, which will have a NULL pointer
/// if the export could not be resolved.
- Module::ExportDecl
+ Module::ExportDecl
resolveExport(Module *Mod, const Module::UnresolvedExportDecl &Unresolved,
bool Complain) const;
@@ -494,13 +494,13 @@ public:
/// using direct (qualified) name lookup.
///
/// \param Name The name of the module to look up.
- ///
+ ///
/// \param Context The module for which we will look for a submodule. If
/// null, we will look for a top-level module.
///
/// \returns The named submodule, if known; otherwose, returns null.
Module *lookupModuleQualified(StringRef Name, Module *Context) const;
-
+
/// Find a new module or submodule, or create it if it does not already
/// exist.
///
@@ -645,7 +645,7 @@ public:
/// Marks this header as being excluded from the given module.
void excludeHeader(Module *Mod, Module::Header Header);
- /// Parse the given module map file, and record any modules we
+ /// Parse the given module map file, and record any modules we
/// encounter.
///
/// \param File The file to be parsed.
@@ -672,13 +672,13 @@ public:
/// Dump the contents of the module map, for debugging purposes.
void dump();
-
+
using module_iterator = llvm::StringMap<Module *>::const_iterator;
module_iterator module_begin() const { return Modules.begin(); }
module_iterator module_end() const { return Modules.end(); }
};
-
+
} // namespace clang
#endif // LLVM_CLANG_LEX_MODULEMAP_H
diff --git a/include/clang/Lex/PPCallbacks.h b/include/clang/Lex/PPCallbacks.h
index eb85bda840af..45c2d18da6e2 100644
--- a/include/clang/Lex/PPCallbacks.h
+++ b/include/clang/Lex/PPCallbacks.h
@@ -66,10 +66,10 @@ public:
/// Callback invoked whenever an inclusion directive results in a
/// file-not-found error.
///
- /// \param FileName The name of the file being included, as written in the
+ /// \param FileName The name of the file being included, as written in the
/// source code.
///
- /// \param RecoveryPath If this client indicates that it can recover from
+ /// \param RecoveryPath If this client indicates that it can recover from
/// this missing file, the client should set this as an additional header
/// search patch.
///
@@ -84,13 +84,13 @@ public:
/// any kind (\c \#include, \c \#import, etc.) has been processed, regardless
/// of whether the inclusion will actually result in an inclusion.
///
- /// \param HashLoc The location of the '#' that starts the inclusion
+ /// \param HashLoc The location of the '#' that starts the inclusion
/// directive.
///
- /// \param IncludeTok The token that indicates the kind of inclusion
+ /// \param IncludeTok The token that indicates the kind of inclusion
/// directive, e.g., 'include' or 'import'.
///
- /// \param FileName The name of the file being included, as written in the
+ /// \param FileName The name of the file being included, as written in the
/// source code.
///
/// \param IsAngled Whether the file name was enclosed in angle brackets;
@@ -99,7 +99,7 @@ public:
/// \param FilenameRange The character range of the quotes or angle brackets
/// for the written file name.
///
- /// \param File The actual file that may be included by this inclusion
+ /// \param File The actual file that may be included by this inclusion
/// directive.
///
/// \param SearchPath Contains the search path which was used to find the file
@@ -222,7 +222,7 @@ public:
/// Called when an OpenCL extension is either disabled or
/// enabled with a pragma.
- virtual void PragmaOpenCLExtension(SourceLocation NameLoc,
+ virtual void PragmaOpenCLExtension(SourceLocation NameLoc,
const IdentifierInfo *Name,
SourceLocation StateLoc, unsigned State) {
}
@@ -269,13 +269,13 @@ public:
const MacroDefinition &MD,
const MacroDirective *Undef) {
}
-
+
/// Hook called whenever the 'defined' operator is seen.
/// \param MD The MacroDirective if the name was a macro, null otherwise.
virtual void Defined(const Token &MacroNameTok, const MacroDefinition &MD,
SourceRange Range) {
}
-
+
/// Hook called when a source range is skipped.
/// \param Range The SourceRange that was skipped. The range begins at the
/// \#if/\#else directive and ends after the \#endif/\#else directive.
diff --git a/include/clang/Lex/PPConditionalDirectiveRecord.h b/include/clang/Lex/PPConditionalDirectiveRecord.h
index a653b8339948..a2ccf1407f79 100644
--- a/include/clang/Lex/PPConditionalDirectiveRecord.h
+++ b/include/clang/Lex/PPConditionalDirectiveRecord.h
@@ -20,12 +20,12 @@
#include <vector>
namespace clang {
-
+
/// Records preprocessor conditional directive regions and allows
/// querying in which region source locations belong to.
class PPConditionalDirectiveRecord : public PPCallbacks {
SourceManager &SourceMgr;
-
+
SmallVector<SourceLocation, 6> CondDirectiveStack;
class CondDirectiveLoc {
diff --git a/include/clang/Lex/PTHLexer.h b/include/clang/Lex/PTHLexer.h
index f122a008e4aa..0b84df1434ae 100644
--- a/include/clang/Lex/PTHLexer.h
+++ b/include/clang/Lex/PTHLexer.h
@@ -49,7 +49,7 @@ class PTHLexer : public PreprocessorLexer {
/// ReadToken - Used by PTHLexer to read tokens TokBuf.
void ReadToken(Token &T);
-
+
bool LexEndOfFile(Token &Result);
/// PTHMgr - The PTHManager object that created this PTHLexer.
diff --git a/include/clang/Lex/Pragma.h b/include/clang/Lex/Pragma.h
index 9348388bc28c..4d74face5275 100644
--- a/include/clang/Lex/Pragma.h
+++ b/include/clang/Lex/Pragma.h
@@ -34,19 +34,19 @@ class Token;
* The pragma was introduced via \#pragma.
*/
PIK_HashPragma,
-
+
/**
* The pragma was introduced via the C99 _Pragma(string-literal).
*/
PIK__Pragma,
-
+
/**
- * The pragma was introduced via the Microsoft
+ * The pragma was introduced via the Microsoft
* __pragma(token-string).
*/
PIK___pragma
};
-
+
/// PragmaHandler - Instances of this interface defined to handle the various
/// pragmas that the language front-end uses. Each handler optionally has a
/// name (e.g. "pack") and the HandlePragma method is invoked when a pragma with
diff --git a/include/clang/Lex/PreprocessingRecord.h b/include/clang/Lex/PreprocessingRecord.h
index 54e28a52f5b3..44d79d9b6229 100644
--- a/include/clang/Lex/PreprocessingRecord.h
+++ b/include/clang/Lex/PreprocessingRecord.h
@@ -66,13 +66,13 @@ class Token;
/// A macro expansion.
MacroExpansionKind,
-
+
/// \defgroup Preprocessing directives
/// @{
-
+
/// A macro definition.
MacroDefinitionKind,
-
+
/// An inclusion directive, such as \c \#include, \c
/// \#import, or \c \#include_next.
InclusionDirectiveKind,
@@ -86,10 +86,10 @@ class Token;
private:
/// The kind of preprocessed entity that this object describes.
EntityKind Kind;
-
+
/// The source range that covers this preprocessed entity.
SourceRange Range;
-
+
protected:
friend class PreprocessingRecord;
@@ -99,8 +99,8 @@ class Token;
public:
/// Retrieve the kind of preprocessed entity stored in this object.
EntityKind getKind() const { return Kind; }
-
- /// Retrieve the source range that covers this entire preprocessed
+
+ /// Retrieve the source range that covers this entire preprocessed
/// entity.
SourceRange getSourceRange() const LLVM_READONLY { return Range; }
@@ -108,7 +108,7 @@ class Token;
/// entity.
bool isInvalid() const { return Kind == InvalidKind; }
- // Only allow allocation of preprocessed entities using the allocator
+ // Only allow allocation of preprocessed entities using the allocator
// in PreprocessingRecord or by doing a placement new.
void *operator new(size_t bytes, PreprocessingRecord &PR,
unsigned alignment = 8) noexcept {
@@ -130,15 +130,15 @@ class Token;
void *operator new(size_t bytes) noexcept;
void operator delete(void *data) noexcept;
};
-
+
/// Records the presence of a preprocessor directive.
class PreprocessingDirective : public PreprocessedEntity {
public:
- PreprocessingDirective(EntityKind Kind, SourceRange Range)
+ PreprocessingDirective(EntityKind Kind, SourceRange Range)
: PreprocessedEntity(Kind, Range) {}
-
+
// Implement isa/cast/dyncast/etc.
- static bool classof(const PreprocessedEntity *PD) {
+ static bool classof(const PreprocessedEntity *PD) {
return PD->getKind() >= FirstPreprocessingDirective &&
PD->getKind() <= LastPreprocessingDirective;
}
@@ -159,13 +159,13 @@ class Token;
/// Retrieve the location of the macro name in the definition.
SourceLocation getLocation() const { return getSourceRange().getBegin(); }
-
+
// Implement isa/cast/dyncast/etc.
static bool classof(const PreprocessedEntity *PE) {
return PE->getKind() == MacroDefinitionKind;
}
};
-
+
/// Records the location of a macro expansion.
class MacroExpansion : public PreprocessedEntity {
/// The definition of this macro or the name of the macro if it is
@@ -246,16 +246,16 @@ class Token;
public:
InclusionDirective(PreprocessingRecord &PPRec,
- InclusionKind Kind, StringRef FileName,
+ InclusionKind Kind, StringRef FileName,
bool InQuotes, bool ImportedModule,
const FileEntry *File, SourceRange Range);
-
+
/// Determine what kind of inclusion directive this is.
InclusionKind getKind() const { return static_cast<InclusionKind>(Kind); }
-
+
/// Retrieve the included file name as it was written in the source.
StringRef getFileName() const { return FileName; }
-
+
/// Determine whether the included file name was written in quotes;
/// otherwise, it was written in angle brackets.
bool wasInQuotes() const { return InQuotes; }
@@ -263,23 +263,23 @@ class Token;
/// Determine whether the inclusion directive was automatically
/// turned into a module import.
bool importedModule() const { return ImportedModule; }
-
+
/// Retrieve the file entry for the actual file that was included
/// by this directive.
const FileEntry *getFile() const { return File; }
-
+
// Implement isa/cast/dyncast/etc.
static bool classof(const PreprocessedEntity *PE) {
return PE->getKind() == InclusionDirectiveKind;
}
};
-
+
/// An abstract class that should be subclassed by any external source
/// of preprocessing record entries.
class ExternalPreprocessingRecordSource {
public:
virtual ~ExternalPreprocessingRecordSource();
-
+
/// Read a preallocated preprocessed entity from the external source.
///
/// \returns null if an error occurred that prevented the preprocessed
@@ -301,20 +301,20 @@ class Token;
/// Read a preallocated skipped range from the external source.
virtual SourceRange ReadSkippedRange(unsigned Index) = 0;
};
-
+
/// A record of the steps taken while preprocessing a source file,
- /// including the various preprocessing directives processed, macros
+ /// including the various preprocessing directives processed, macros
/// expanded, etc.
class PreprocessingRecord : public PPCallbacks {
SourceManager &SourceMgr;
-
+
/// Allocator used to store preprocessing objects.
llvm::BumpPtrAllocator BumpAlloc;
/// The set of preprocessed entities in this record, in order they
/// were seen.
std::vector<PreprocessedEntity *> PreprocessedEntities;
-
+
/// The set of preprocessed entities in this record that have been
/// loaded from external sources.
///
@@ -362,7 +362,7 @@ class Token;
/// Retrieve the loaded preprocessed entity at the given index.
PreprocessedEntity *getLoadedPreprocessedEntity(unsigned Index);
-
+
/// Determine the number of preprocessed entities that were
/// loaded (or can be loaded) from an external source.
unsigned getNumLoadedPreprocessedEntities() const {
@@ -403,7 +403,7 @@ class Token;
void *Allocate(unsigned Size, unsigned Align = 8) {
return BumpAlloc.Allocate(Size, Align);
}
-
+
/// Deallocate memory in the preprocessing record.
void Deallocate(void *Ptr) {}
@@ -518,7 +518,7 @@ class Token;
ensureSkippedRangesLoaded();
return SkippedRanges;
}
-
+
private:
friend class ASTReader;
friend class ASTWriter;
diff --git a/include/clang/Lex/Preprocessor.h b/include/clang/Lex/Preprocessor.h
index 4ec29fe8f331..e718f5b6bbd0 100644
--- a/include/clang/Lex/Preprocessor.h
+++ b/include/clang/Lex/Preprocessor.h
@@ -255,7 +255,7 @@ class Preprocessor {
/// with this preprocessor.
std::vector<CommentHandler *> CommentHandlers;
- /// True if we want to ignore EOF token and continue later on (thus
+ /// True if we want to ignore EOF token and continue later on (thus
/// avoid tearing the Lexer and etc. down).
bool IncrementalProcessing = false;
@@ -281,7 +281,7 @@ class Preprocessor {
/// for preprocessing.
SourceLocation CodeCompletionFileLoc;
- /// The source location of the \c import contextual keyword we just
+ /// The source location of the \c import contextual keyword we just
/// lexed, if any.
SourceLocation ModuleImportLoc;
@@ -294,7 +294,7 @@ class Preprocessor {
/// Whether the module import expects an identifier next. Otherwise,
/// it expects a '.' or ';'.
bool ModuleImportExpectsIdentifier = false;
-
+
/// The source location of the currently-active
/// \#pragma clang arc_cf_code_audited begin.
SourceLocation PragmaARCCFCodeAuditedLoc;
@@ -814,7 +814,7 @@ public:
/// Retrieve the preprocessor options used to initialize this
/// preprocessor.
PreprocessorOptions &getPreprocessorOpts() const { return *PPOpts; }
-
+
DiagnosticsEngine &getDiagnostics() const { return *Diags; }
void setDiagnostics(DiagnosticsEngine &D) { Diags = &D; }
@@ -852,7 +852,7 @@ public:
}
/// True if we are currently preprocessing a #if or #elif directive
- bool isParsingIfOrElifDirective() const {
+ bool isParsingIfOrElifDirective() const {
return ParsingIfOrElifDirective;
}
@@ -1439,7 +1439,7 @@ public:
void enableIncrementalProcessing(bool value = true) {
IncrementalProcessing = value;
}
-
+
/// Specify the point at which code-completion will be performed.
///
/// \param File the file in which code completion should occur. If
@@ -1630,7 +1630,7 @@ public:
}
/// Plop the specified string into a scratch buffer and set the
- /// specified token's location and length to it.
+ /// specified token's location and length to it.
///
/// If specified, the source location provides a location of the expansion
/// point of the token.
@@ -1769,7 +1769,7 @@ public:
void PoisonSEHIdentifiers(bool Poison = true); // Borland
/// Callback invoked when the lexer reads an identifier and has
- /// filled in the tokens IdentifierInfo member.
+ /// filled in the tokens IdentifierInfo member.
///
/// This callback potentially macro expands it or turns it into a named
/// token (like 'for').
@@ -1817,12 +1817,12 @@ public:
/// Retrieves the module that we're currently building, if any.
Module *getCurrentModule();
-
+
/// Allocate a new MacroInfo object with the provided SourceLocation.
MacroInfo *AllocateMacroInfo(SourceLocation L);
/// Turn the specified lexer token into a fully checked and spelled
- /// filename, e.g. as an operand of \#include.
+ /// filename, e.g. as an operand of \#include.
///
/// The caller is expected to provide a buffer that is large enough to hold
/// the spelling of the filename, but is also expected to handle the case
@@ -1846,7 +1846,7 @@ public:
bool *IsMapped, bool SkipCache = false);
/// Get the DirectoryLookup structure used to find the current
- /// FileEntry, if CurLexer is non-null and if applicable.
+ /// FileEntry, if CurLexer is non-null and if applicable.
///
/// This allows us to implement \#include_next and find directory-specific
/// properties.
@@ -1856,7 +1856,7 @@ public:
bool isInPrimaryFile() const;
/// Handle cases where the \#include name is expanded
- /// from a macro as multiple tokens, which need to be glued together.
+ /// from a macro as multiple tokens, which need to be glued together.
///
/// This occurs for code like:
/// \code
@@ -1939,7 +1939,7 @@ private:
/// - # (stringization) is followed by a macro parameter
/// \param MacroNameTok - Token that represents the macro name
/// \param ImmediatelyAfterHeaderGuard - Macro follows an #ifdef header guard
- ///
+ ///
/// Either returns a pointer to a MacroInfo object OR emits a diagnostic and
/// returns a nullptr if an invalid sequence of tokens is encountered.
MacroInfo *ReadOptionalMacroParameterListAndBody(
diff --git a/include/clang/Lex/PreprocessorLexer.h b/include/clang/Lex/PreprocessorLexer.h
index bb02725b116f..b619f192f530 100644
--- a/include/clang/Lex/PreprocessorLexer.h
+++ b/include/clang/Lex/PreprocessorLexer.h
@@ -169,12 +169,12 @@ public:
using conditional_iterator =
SmallVectorImpl<PPConditionalInfo>::const_iterator;
- conditional_iterator conditional_begin() const {
- return ConditionalStack.begin();
+ conditional_iterator conditional_begin() const {
+ return ConditionalStack.begin();
}
- conditional_iterator conditional_end() const {
- return ConditionalStack.end();
+ conditional_iterator conditional_end() const {
+ return ConditionalStack.end();
}
void setConditionalLevels(ArrayRef<PPConditionalInfo> CL) {
diff --git a/include/clang/Lex/PreprocessorOptions.h b/include/clang/Lex/PreprocessorOptions.h
index 3d7e5ab4a8dc..5134aeaa6a29 100644
--- a/include/clang/Lex/PreprocessorOptions.h
+++ b/include/clang/Lex/PreprocessorOptions.h
@@ -13,7 +13,7 @@
#include "clang/Basic/LLVM.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/StringSet.h"
-#include <memory>
+#include <memory>
#include <set>
#include <string>
#include <utility>
@@ -27,7 +27,7 @@ class MemoryBuffer;
namespace clang {
-/// Enumerate the kinds of standard library that
+/// Enumerate the kinds of standard library that
enum ObjCXXARCStandardLibraryKind {
ARCXX_nolib,
@@ -37,7 +37,7 @@ enum ObjCXXARCStandardLibraryKind {
/// libstdc++
ARCXX_libstdcxx
};
-
+
/// PreprocessorOptions - This class is used for passing the various options
/// used in preprocessor initialization to InitializePreprocessor().
class PreprocessorOptions {
@@ -136,15 +136,15 @@ public:
/// the buffers associated with remapped files.
///
/// This flag defaults to false; it can be set true only through direct
- /// manipulation of the compiler invocation object, in cases where the
+ /// manipulation of the compiler invocation object, in cases where the
/// compiler invocation and its buffers will be reused.
bool RetainRemappedFileBuffers = false;
-
+
/// The Objective-C++ ARC standard library that we should support,
/// by providing appropriate definitions to retrofit the standard library
/// with support for lifetime-qualified pointers.
ObjCXXARCStandardLibraryKind ObjCXXARCStandardLibrary = ARCXX_nolib;
-
+
/// Records the set of modules
class FailedModulesSet {
llvm::StringSet<> Failed;
@@ -158,7 +158,7 @@ public:
Failed.insert(module);
}
};
-
+
/// The set of modules that failed to build.
///
/// This pointer will be shared among all of the compiler instances created
@@ -185,7 +185,7 @@ public:
RemappedFiles.clear();
RemappedFileBuffers.clear();
}
-
+
/// Reset any options that are not considered when building a
/// module.
void resetNonModularOptions() {
diff --git a/include/clang/Lex/Token.h b/include/clang/Lex/Token.h
index 633e1d15697b..85bef728197d 100644
--- a/include/clang/Lex/Token.h
+++ b/include/clang/Lex/Token.h
@@ -73,7 +73,7 @@ public:
enum TokenFlags {
StartOfLine = 0x01, // At start of line or only after whitespace
// (considering the line after macro expansion).
- LeadingSpace = 0x02, // Whitespace exists before this token (considering
+ LeadingSpace = 0x02, // Whitespace exists before this token (considering
// whitespace after macro expansion).
DisableExpand = 0x04, // This identifier may never be macro expanded.
NeedsCleaning = 0x08, // Contained an escaped newline or trigraph.
diff --git a/include/clang/Lex/TokenConcatenation.h b/include/clang/Lex/TokenConcatenation.h
index a2d98b0d473a..60c182b509a4 100644
--- a/include/clang/Lex/TokenConcatenation.h
+++ b/include/clang/Lex/TokenConcatenation.h
@@ -58,8 +58,8 @@ namespace clang {
public:
TokenConcatenation(Preprocessor &PP);
- bool AvoidConcat(const Token &PrevPrevTok,
- const Token &PrevTok,
+ bool AvoidConcat(const Token &PrevPrevTok,
+ const Token &PrevTok,
const Token &Tok) const;
private:
diff --git a/include/clang/Lex/TokenLexer.h b/include/clang/Lex/TokenLexer.h
index e616d497eec6..98935ad9c4fa 100644
--- a/include/clang/Lex/TokenLexer.h
+++ b/include/clang/Lex/TokenLexer.h
@@ -65,7 +65,7 @@ class TokenLexer {
/// Source location pointing at the source location entry chunk that
/// was reserved for the current macro expansion.
SourceLocation MacroExpansionStart;
-
+
/// The offset of the macro expansion in the
/// "source location address space".
unsigned MacroStartSLocOffset;
diff --git a/include/clang/Lex/VariadicMacroSupport.h b/include/clang/Lex/VariadicMacroSupport.h
index 55202ffc34d7..3a7a955953f4 100644
--- a/include/clang/Lex/VariadicMacroSupport.h
+++ b/include/clang/Lex/VariadicMacroSupport.h
@@ -71,10 +71,10 @@ namespace clang {
class VAOptDefinitionContext {
/// Contains all the locations of so far unmatched lparens.
SmallVector<SourceLocation, 8> UnmatchedOpeningParens;
-
+
const IdentifierInfo *const Ident__VA_OPT__;
-
-
+
+
public:
VAOptDefinitionContext(Preprocessor &PP)
: Ident__VA_OPT__(PP.Ident__VA_OPT__) {}
@@ -86,12 +86,12 @@ namespace clang {
/// Returns true if we have seen the __VA_OPT__ and '(' but before having
/// seen the matching ')'.
bool isInVAOpt() const { return UnmatchedOpeningParens.size(); }
-
+
/// Call this function as soon as you see __VA_OPT__ and '('.
void sawVAOptFollowedByOpeningParens(const SourceLocation LParenLoc) {
assert(!isInVAOpt() && "Must NOT be within VAOPT context to call this");
UnmatchedOpeningParens.push_back(LParenLoc);
-
+
}
SourceLocation getUnmatchedOpeningParenLoc() const {
@@ -107,13 +107,13 @@ namespace clang {
UnmatchedOpeningParens.pop_back();
return !UnmatchedOpeningParens.size();
}
-
+
/// Call this function each time an lparen is seen.
void sawOpeningParen(SourceLocation LParenLoc) {
assert(isInVAOpt() && "Must be within VAOPT context to call this");
UnmatchedOpeningParens.push_back(LParenLoc);
}
-
+
};
/// A class for tracking whether we're inside a VA_OPT during a
@@ -133,11 +133,11 @@ namespace clang {
int NumOfTokensPriorToVAOpt = -1;
unsigned LeadingSpaceForStringifiedToken : 1;
-
+
unsigned StringifyBefore : 1;
unsigned CharifyBefore : 1;
-
-
+
+
bool hasStringifyBefore() const {
assert(!isReset() &&
"Must only be called if the state has not been reset");
@@ -169,14 +169,14 @@ namespace clang {
void sawHashOrHashAtBefore(const bool HasLeadingSpace,
const bool IsHashAt) {
-
+
StringifyBefore = !IsHashAt;
CharifyBefore = IsHashAt;
LeadingSpaceForStringifiedToken = HasLeadingSpace;
}
-
-
+
+
bool hasCharifyBefore() const {
assert(!isReset() &&
"Must only be called if the state has not been reset");
@@ -185,13 +185,13 @@ namespace clang {
bool hasStringifyOrCharifyBefore() const {
return hasStringifyBefore() || hasCharifyBefore();
}
-
+
unsigned int getNumberOfTokensPriorToVAOpt() const {
assert(!isReset() &&
"Must only be called if the state has not been reset");
return NumOfTokensPriorToVAOpt;
}
-
+
bool getLeadingSpaceForStringifiedToken() const {
assert(hasStringifyBefore() &&
"Must only be called if this has been marked for stringification");
@@ -219,7 +219,7 @@ namespace clang {
using VAOptDefinitionContext::isInVAOpt;
using VAOptDefinitionContext::sawClosingParen;
using VAOptDefinitionContext::sawOpeningParen;
-
+
};
} // end namespace clang
diff --git a/include/clang/Parse/ParseAST.h b/include/clang/Parse/ParseAST.h
index 34b04060346f..f6e78ac2ca56 100644
--- a/include/clang/Parse/ParseAST.h
+++ b/include/clang/Parse/ParseAST.h
@@ -42,7 +42,7 @@ namespace clang {
CodeCompleteConsumer *CompletionConsumer = nullptr,
bool SkipFunctionBodies = false);
- /// Parse the main file known to the preprocessor, producing an
+ /// Parse the main file known to the preprocessor, producing an
/// abstract syntax tree.
void ParseAST(Sema &S, bool PrintStats = false,
bool SkipFunctionBodies = false);
diff --git a/include/clang/Parse/Parser.h b/include/clang/Parse/Parser.h
index d7b83803af20..69bf88a371db 100644
--- a/include/clang/Parse/Parser.h
+++ b/include/clang/Parse/Parser.h
@@ -132,7 +132,7 @@ class Parser : public CodeCompletionHandler {
/// Identifier for "unavailable".
IdentifierInfo *Ident_unavailable;
-
+
/// Identifier for "message".
IdentifierInfo *Ident_message;
@@ -1196,7 +1196,7 @@ private:
/// method will be stored so that they can be reintroduced into
/// scope at the appropriate times.
SmallVector<LateParsedDefaultArgument, 8> DefaultArgs;
-
+
/// The set of tokens that make up an exception-specification that
/// has not yet been parsed.
CachedTokens *ExceptionSpecTokens;
@@ -1225,7 +1225,7 @@ private:
/// C++ class, its method declarations that contain parts that won't be
/// parsed until after the definition is completed (C++ [class.mem]p2),
/// the method declarations and possibly attached inline definitions
- /// will be stored here with the tokens that will be parsed to create those
+ /// will be stored here with the tokens that will be parsed to create those
/// entities.
typedef SmallVector<LateParsedDeclaration*,2> LateParsedDeclarationsContainer;
@@ -1653,6 +1653,7 @@ private:
/// ParenParseOption - Control what ParseParenExpression will parse.
enum ParenParseOption {
SimpleExpr, // Only parse '(' expression ')'
+ FoldExpr, // Also allow fold-expression <anything>
CompoundStmt, // Also allow '(' compound-statement ')'
CompoundLiteral, // Also allow '(' type-name ')' '{' ... '}'
CastExpr // Also allow '(' type-name ')' <anything>
@@ -1673,7 +1674,7 @@ private:
ExprResult ParseStringLiteralExpression(bool AllowUserDefinedLiteral = false);
ExprResult ParseGenericSelectionExpression();
-
+
ExprResult ParseObjCBoolLiteral();
ExprResult ParseFoldExpression(ExprResult LHS, BalancedDelimiterTracker &T);
@@ -1835,7 +1836,7 @@ private:
SourceLocation LBracloc, SourceLocation SuperLoc,
ParsedType ReceiverType, Expr *ReceiverExpr);
bool ParseObjCXXMessageReceiver(bool &IsExpr, void *&TypeOrExpr);
-
+
//===--------------------------------------------------------------------===//
// C99 6.8: Statements and Blocks.
@@ -2064,7 +2065,7 @@ private:
bool ParseImplicitInt(DeclSpec &DS, CXXScopeSpec *SS,
const ParsedTemplateInfo &TemplateInfo,
- AccessSpecifier AS, DeclSpecContext DSC,
+ AccessSpecifier AS, DeclSpecContext DSC,
ParsedAttributesWithRange &Attrs);
DeclSpecContext
getDeclSpecContextFromDeclaratorContext(DeclaratorContext Context);
@@ -2192,7 +2193,7 @@ private:
/// isCXXFunctionDeclarator - Disambiguates between a function declarator or
/// a constructor-style initializer, when parsing declaration statements.
/// Returns true for function declarator and false for constructor-style
- /// initializer. Sets 'IsAmbiguous' to true to indicate that this declaration
+ /// initializer. Sets 'IsAmbiguous' to true to indicate that this declaration
/// might be a constructor-style initializer.
/// If during the disambiguation process a parsing error is encountered,
/// the function returns true to let the declaration parsing code handle it.
@@ -2319,7 +2320,7 @@ private:
void stripTypeAttributesOffDeclSpec(ParsedAttributesWithRange &Attrs,
DeclSpec &DS, Sema::TagUseKind TUK);
-
+
// FixItLoc = possible correct location for the attributes
void ProhibitAttributes(ParsedAttributesWithRange &Attrs,
SourceLocation FixItLoc = SourceLocation()) {
@@ -2689,7 +2690,7 @@ private:
void ParseClassSpecifier(tok::TokenKind TagTokKind, SourceLocation TagLoc,
DeclSpec &DS, const ParsedTemplateInfo &TemplateInfo,
AccessSpecifier AS, bool EnteringContext,
- DeclSpecContext DSC,
+ DeclSpecContext DSC,
ParsedAttributesWithRange &Attributes);
void SkipCXXMemberSpecification(SourceLocation StartLoc,
SourceLocation AttrFixitLoc,
@@ -2943,7 +2944,7 @@ private:
//===--------------------------------------------------------------------===//
// C++11/G++: Type Traits [Type-Traits.html in the GCC manual]
ExprResult ParseTypeTrait();
-
+
//===--------------------------------------------------------------------===//
// Embarcadero: Arary and Expression Traits
ExprResult ParseArrayTypeTrait();
diff --git a/include/clang/Parse/RAIIObjectsForParser.h b/include/clang/Parse/RAIIObjectsForParser.h
index f45d6434833e..ba5e5fe3c8fb 100644
--- a/include/clang/Parse/RAIIObjectsForParser.h
+++ b/include/clang/Parse/RAIIObjectsForParser.h
@@ -49,7 +49,7 @@ namespace clang {
bool Active;
public:
- /// Begin suppressing access-like checks
+ /// Begin suppressing access-like checks
SuppressAccessChecks(Parser &P, bool activate = true)
: S(P.getActions()), DiagnosticPool(nullptr) {
if (activate) {
@@ -264,7 +264,7 @@ namespace clang {
Diags.DecrementAllExtensionsSilenced();
}
};
-
+
/// ColonProtectionRAIIObject - This sets the Parser::ColonIsSacred bool and
/// restores it when destroyed. This says that "foo:" should not be
/// considered a possible typo for "foo::" for error recovery purposes.
@@ -276,18 +276,18 @@ namespace clang {
: P(p), OldVal(P.ColonIsSacred) {
P.ColonIsSacred = Value;
}
-
+
/// restore - This can be used to restore the state early, before the dtor
/// is run.
void restore() {
P.ColonIsSacred = OldVal;
}
-
+
~ColonProtectionRAIIObject() {
restore();
}
};
-
+
/// RAII object that makes '>' behave either as an operator
/// or as the closing angle bracket for a template argument list.
class GreaterThanIsOperatorScope {
@@ -298,28 +298,28 @@ namespace clang {
: GreaterThanIsOperator(GTIO), OldGreaterThanIsOperator(GTIO) {
GreaterThanIsOperator = Val;
}
-
+
~GreaterThanIsOperatorScope() {
GreaterThanIsOperator = OldGreaterThanIsOperator;
}
};
-
+
class InMessageExpressionRAIIObject {
bool &InMessageExpression;
bool OldValue;
-
+
public:
InMessageExpressionRAIIObject(Parser &P, bool Value)
- : InMessageExpression(P.InMessageExpression),
+ : InMessageExpression(P.InMessageExpression),
OldValue(P.InMessageExpression) {
InMessageExpression = Value;
}
-
+
~InMessageExpressionRAIIObject() {
InMessageExpression = OldValue;
}
};
-
+
/// RAII object that makes sure paren/bracket/brace count is correct
/// after declaration/statement parsing, even when there's a parsing error.
class ParenBraceBracketBalancer {
@@ -329,7 +329,7 @@ namespace clang {
ParenBraceBracketBalancer(Parser &p)
: P(p), ParenCount(p.ParenCount), BracketCount(p.BracketCount),
BraceCount(p.BraceCount) { }
-
+
~ParenBraceBracketBalancer() {
P.AngleBrackets.clear(P);
P.ParenCount = ParenCount;
@@ -369,7 +369,7 @@ namespace clang {
tok::TokenKind Kind, Close, FinalToken;
SourceLocation (Parser::*Consumer)();
SourceLocation LOpen, LClose;
-
+
unsigned short &getDepth() {
switch (Kind) {
case tok::l_brace: return P.BraceCount;
@@ -378,10 +378,10 @@ namespace clang {
default: llvm_unreachable("Wrong token kind");
}
}
-
+
bool diagnoseOverflow();
bool diagnoseMissingClose();
-
+
public:
BalancedDelimiterTracker(Parser& p, tok::TokenKind k,
tok::TokenKind FinalToken = tok::semi)
@@ -391,34 +391,34 @@ namespace clang {
switch (Kind) {
default: llvm_unreachable("Unexpected balanced token");
case tok::l_brace:
- Close = tok::r_brace;
+ Close = tok::r_brace;
Consumer = &Parser::ConsumeBrace;
break;
case tok::l_paren:
- Close = tok::r_paren;
+ Close = tok::r_paren;
Consumer = &Parser::ConsumeParen;
break;
-
+
case tok::l_square:
- Close = tok::r_square;
+ Close = tok::r_square;
Consumer = &Parser::ConsumeBracket;
break;
- }
+ }
}
-
+
SourceLocation getOpenLocation() const { return LOpen; }
SourceLocation getCloseLocation() const { return LClose; }
SourceRange getRange() const { return SourceRange(LOpen, LClose); }
-
+
bool consumeOpen() {
if (!P.Tok.is(Kind))
return true;
-
+
if (getDepth() < P.getLangOpts().BracketDepth) {
LOpen = (P.*Consumer)();
return false;
}
-
+
return diagnoseOverflow();
}
@@ -436,7 +436,7 @@ namespace clang {
LClose = (P.*Consumer)();
return false;
}
-
+
return diagnoseMissingClose();
}
void skipToEnd();
diff --git a/include/clang/Sema/DeclSpec.h b/include/clang/Sema/DeclSpec.h
index 83d5ab2cff85..2e70203c6cc0 100644
--- a/include/clang/Sema/DeclSpec.h
+++ b/include/clang/Sema/DeclSpec.h
@@ -61,7 +61,7 @@ namespace clang {
///
/// The actual scope is described by getScopeRep().
class CXXScopeSpec {
- SourceRange Range;
+ SourceRange Range;
NestedNameSpecifierLocBuilder Builder;
public:
@@ -73,8 +73,8 @@ public:
SourceLocation getEndLoc() const { return Range.getEnd(); }
/// Retrieve the representation of the nested-name-specifier.
- NestedNameSpecifier *getScopeRep() const {
- return Builder.getRepresentation();
+ NestedNameSpecifier *getScopeRep() const {
+ return Builder.getRepresentation();
}
/// Extend the current nested-name-specifier by another
@@ -91,7 +91,7 @@ public:
void Extend(ASTContext &Context, SourceLocation TemplateKWLoc, TypeLoc TL,
SourceLocation ColonColonLoc);
- /// Extend the current nested-name-specifier by another
+ /// Extend the current nested-name-specifier by another
/// nested-name-specifier component of the form 'identifier::'.
///
/// \param Context The AST context in which this nested-name-specifier
@@ -105,7 +105,7 @@ public:
void Extend(ASTContext &Context, IdentifierInfo *Identifier,
SourceLocation IdentifierLoc, SourceLocation ColonColonLoc);
- /// Extend the current nested-name-specifier by another
+ /// Extend the current nested-name-specifier by another
/// nested-name-specifier component of the form 'namespace::'.
///
/// \param Context The AST context in which this nested-name-specifier
@@ -119,7 +119,7 @@ public:
void Extend(ASTContext &Context, NamespaceDecl *Namespace,
SourceLocation NamespaceLoc, SourceLocation ColonColonLoc);
- /// Extend the current nested-name-specifier by another
+ /// Extend the current nested-name-specifier by another
/// nested-name-specifier component of the form 'namespace-alias::'.
///
/// \param Context The AST context in which this nested-name-specifier
@@ -127,7 +127,7 @@ public:
///
/// \param Alias The namespace alias.
///
- /// \param AliasLoc The location of the namespace alias
+ /// \param AliasLoc The location of the namespace alias
/// name.
///
/// \param ColonColonLoc The location of the trailing '::'.
@@ -137,7 +137,7 @@ public:
/// Turn this (empty) nested-name-specifier into the global
/// nested-name-specifier '::'.
void MakeGlobal(ASTContext &Context, SourceLocation ColonColonLoc);
-
+
/// Turns this (empty) nested-name-specifier into '__super'
/// nested-name-specifier.
///
@@ -160,13 +160,13 @@ public:
/// FIXME: This routine should be used very, very rarely, in cases where we
/// need to synthesize a nested-name-specifier. Most code should instead use
/// \c Adopt() with a proper \c NestedNameSpecifierLoc.
- void MakeTrivial(ASTContext &Context, NestedNameSpecifier *Qualifier,
+ void MakeTrivial(ASTContext &Context, NestedNameSpecifier *Qualifier,
SourceRange R);
-
- /// Adopt an existing nested-name-specifier (with source-range
+
+ /// Adopt an existing nested-name-specifier (with source-range
/// information).
void Adopt(NestedNameSpecifierLoc Other);
-
+
/// Retrieve a nested-name-specifier with location information, copied
/// into the given AST context.
///
@@ -196,14 +196,14 @@ public:
bool isValid() const { return isNotEmpty() && getScopeRep() != nullptr; }
/// Indicate that this nested-name-specifier is invalid.
- void SetInvalid(SourceRange R) {
+ void SetInvalid(SourceRange R) {
assert(R.isValid() && "Must have a valid source range");
if (Range.getBegin().isInvalid())
Range.setBegin(R.getBegin());
Range.setEnd(R.getEnd());
Builder.Clear();
}
-
+
/// Deprecated. Some call sites intend isNotEmpty() while others intend
/// isValid().
bool isSet() const { return getScopeRep() != nullptr; }
@@ -215,8 +215,8 @@ public:
/// Retrieve the data associated with the source-location information.
char *location_data() const { return Builder.getBuffer().first; }
-
- /// Retrieve the size of the data associated with source-location
+
+ /// Retrieve the size of the data associated with source-location
/// information.
unsigned location_size() const { return Builder.getBuffer().second; }
};
@@ -254,7 +254,7 @@ public:
static const TSW TSW_short = clang::TSW_short;
static const TSW TSW_long = clang::TSW_long;
static const TSW TSW_longlong = clang::TSW_longlong;
-
+
enum TSC {
TSC_unspecified,
TSC_imaginary,
@@ -709,7 +709,7 @@ public:
bool isModulePrivateSpecified() const { return ModulePrivateLoc.isValid(); }
SourceLocation getModulePrivateSpecLoc() const { return ModulePrivateLoc; }
-
+
bool isConstexprSpecified() const { return Constexpr_specified; }
SourceLocation getConstexprSpecLoc() const { return ConstexprLoc; }
@@ -916,7 +916,7 @@ enum class UnqualifiedIdKind {
IK_DeductionGuideName
};
-/// Represents a C++ unqualified-id that has been parsed.
+/// Represents a C++ unqualified-id that has been parsed.
class UnqualifiedId {
private:
UnqualifiedId(const UnqualifiedId &Other) = delete;
@@ -931,8 +931,8 @@ public:
OverloadedOperatorKind Operator;
/// The source locations of the individual tokens that name
- /// the operator, e.g., the "new", "[", and "]" tokens in
- /// operator new [].
+ /// the operator, e.g., the "new", "[", and "]" tokens in
+ /// operator new [].
///
/// Different operators have different numbers of tokens in their name,
/// up to three. Any remaining source locations in this array will be
@@ -946,44 +946,44 @@ public:
/// When Kind == IK_Identifier, the parsed identifier, or when
/// Kind == IK_UserLiteralId, the identifier suffix.
IdentifierInfo *Identifier;
-
+
/// When Kind == IK_OperatorFunctionId, the overloaded operator
/// that we parsed.
struct OFI OperatorFunctionId;
-
- /// When Kind == IK_ConversionFunctionId, the type that the
+
+ /// When Kind == IK_ConversionFunctionId, the type that the
/// conversion function names.
UnionParsedType ConversionFunctionId;
/// When Kind == IK_ConstructorName, the class-name of the type
/// whose constructor is being referenced.
UnionParsedType ConstructorName;
-
+
/// When Kind == IK_DestructorName, the type referred to by the
/// class-name.
UnionParsedType DestructorName;
/// When Kind == IK_DeductionGuideName, the parsed template-name.
UnionParsedTemplateTy TemplateName;
-
+
/// When Kind == IK_TemplateId or IK_ConstructorTemplateId,
/// the template-id annotation that contains the template name and
/// template arguments.
TemplateIdAnnotation *TemplateId;
};
-
+
/// The location of the first token that describes this unqualified-id,
/// which will be the location of the identifier, "operator" keyword,
/// tilde (for a destructor), or the template name of a template-id.
SourceLocation StartLocation;
-
+
/// The location of the last token that describes this unqualified-id.
SourceLocation EndLocation;
UnqualifiedId()
: Kind(UnqualifiedIdKind::IK_Identifier), Identifier(nullptr) {}
- /// Clear out this unqualified-id, setting it to default (invalid)
+ /// Clear out this unqualified-id, setting it to default (invalid)
/// state.
void clear() {
Kind = UnqualifiedIdKind::IK_Identifier;
@@ -991,17 +991,17 @@ public:
StartLocation = SourceLocation();
EndLocation = SourceLocation();
}
-
+
/// Determine whether this unqualified-id refers to a valid name.
bool isValid() const { return StartLocation.isValid(); }
/// Determine whether this unqualified-id refers to an invalid name.
bool isInvalid() const { return !isValid(); }
-
+
/// Determine what kind of name we have.
UnqualifiedIdKind getKind() const { return Kind; }
- void setKind(UnqualifiedIdKind kind) { Kind = kind; }
-
+ void setKind(UnqualifiedIdKind kind) { Kind = kind; }
+
/// Specify that this unqualified-id was parsed as an identifier.
///
/// \param Id the parsed identifier.
@@ -1011,8 +1011,8 @@ public:
Identifier = const_cast<IdentifierInfo *>(Id);
StartLocation = EndLocation = IdLoc;
}
-
- /// Specify that this unqualified-id was parsed as an
+
+ /// Specify that this unqualified-id was parsed as an
/// operator-function-id.
///
/// \param OperatorLoc the location of the 'operator' keyword.
@@ -1021,11 +1021,11 @@ public:
///
/// \param SymbolLocations the locations of the individual operator symbols
/// in the operator.
- void setOperatorFunctionId(SourceLocation OperatorLoc,
+ void setOperatorFunctionId(SourceLocation OperatorLoc,
OverloadedOperatorKind Op,
SourceLocation SymbolLocations[3]);
-
- /// Specify that this unqualified-id was parsed as a
+
+ /// Specify that this unqualified-id was parsed as a
/// conversion-function-id.
///
/// \param OperatorLoc the location of the 'operator' keyword.
@@ -1033,7 +1033,7 @@ public:
/// \param Ty the type to which this conversion function is converting.
///
/// \param EndLoc the location of the last token that makes up the type name.
- void setConversionFunctionId(SourceLocation OperatorLoc,
+ void setConversionFunctionId(SourceLocation OperatorLoc,
ParsedType Ty,
SourceLocation EndLoc) {
Kind = UnqualifiedIdKind::IK_ConversionFunctionId;
@@ -1057,7 +1057,7 @@ public:
StartLocation = OpLoc;
EndLocation = IdLoc;
}
-
+
/// Specify that this unqualified-id was parsed as a constructor name.
///
/// \param ClassType the class type referred to by the constructor name.
@@ -1065,7 +1065,7 @@ public:
/// \param ClassNameLoc the location of the class name.
///
/// \param EndLoc the location of the last token that makes up the type name.
- void setConstructorName(ParsedType ClassType,
+ void setConstructorName(ParsedType ClassType,
SourceLocation ClassNameLoc,
SourceLocation EndLoc) {
Kind = UnqualifiedIdKind::IK_ConstructorName;
@@ -1096,7 +1096,7 @@ public:
EndLocation = EndLoc;
DestructorName = ClassType;
}
-
+
/// Specify that this unqualified-id was parsed as a template-id.
///
/// \param TemplateId the template-id annotation that describes the parsed
@@ -1115,10 +1115,10 @@ public:
TemplateName = Template;
StartLocation = EndLocation = TemplateLoc;
}
-
+
/// Return the source range that covers this unqualified-id.
- SourceRange getSourceRange() const LLVM_READONLY {
- return SourceRange(StartLocation, EndLocation);
+ SourceRange getSourceRange() const LLVM_READONLY {
+ return SourceRange(StartLocation, EndLocation);
}
SourceLocation getLocStart() const LLVM_READONLY { return StartLocation; }
SourceLocation getLocEnd() const LLVM_READONLY { return EndLocation; }
@@ -1326,7 +1326,7 @@ struct DeclaratorChunk {
/// Pointer to the expression in the noexcept-specifier of this
/// function, if it has one.
Expr *NoexceptExpr;
-
+
/// Pointer to the cached tokens for an exception-specification
/// that has not yet been parsed.
CachedTokens *ExceptionSpecTokens;
@@ -1426,7 +1426,7 @@ struct DeclaratorChunk {
return SourceLocation::getFromRawEncoding(MutableLoc);
}
- /// Determine whether this function declaration contains a
+ /// Determine whether this function declaration contains a
/// ref-qualifier.
bool hasRefQualifier() const { return getRefQualifierLoc().isValid(); }
@@ -1746,7 +1746,7 @@ enum class DeclaratorContext {
/// Instances of this class should be a transient object that lives on the
/// stack, not objects that are allocated in large quantities on the heap.
class Declarator {
-
+
private:
const DeclSpec &DS;
CXXScopeSpec SS;
@@ -1771,7 +1771,7 @@ private:
/// GroupingParens - Set by Parser::ParseParenDeclarator().
unsigned GroupingParens : 1;
- /// FunctionDefinition - Is this Declarator for a function or member
+ /// FunctionDefinition - Is this Declarator for a function or member
/// definition and, if so, what kind?
///
/// Actually a FunctionDefinitionKind.
@@ -1785,7 +1785,7 @@ private:
/// Indicates whether this is an Objective-C instance variable.
unsigned ObjCIvar : 1;
-
+
/// Indicates whether this is an Objective-C 'weak' property.
unsigned ObjCWeakProperty : 1;
@@ -1817,7 +1817,7 @@ private:
/// If provided, the source location of the ellipsis used to describe
/// this declarator as a parameter pack.
SourceLocation EllipsisLoc;
-
+
friend struct DeclaratorChunk;
public:
@@ -1858,7 +1858,7 @@ public:
const DecompositionDeclarator &getDecompositionDeclarator() const {
return BindingGroup;
}
-
+
DeclaratorContext getContext() const { return Context; }
bool isPrototypeContext() const {
@@ -2107,10