From 706b4fc47bbc608932d3b491ae19a3b9cde9497b Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Fri, 17 Jan 2020 20:45:01 +0000 Subject: [PATCH] Vendor import of llvm-project master e26a78e70, the last commit before the llvmorg-11-init tag, from which release/10.x was branched. --- clang/include/clang-c/BuildSystem.h | 11 +- clang/include/clang-c/CXCompilationDatabase.h | 12 +- clang/include/clang-c/CXErrorCode.h | 10 +- clang/include/clang-c/CXString.h | 10 +- clang/include/clang-c/Documentation.h | 17 +- clang/include/clang-c/ExternC.h | 39 + clang/include/clang-c/FatalErrorHandler.h | 11 +- clang/include/clang-c/Index.h | 23 +- clang/include/clang-c/Platform.h | 11 +- clang/include/clang/AST/ASTConcept.h | 177 + clang/include/clang/AST/ASTConsumer.h | 5 + clang/include/clang/AST/ASTContext.h | 95 +- clang/include/clang/AST/ASTFwd.h | 4 + clang/include/clang/AST/ASTImporter.h | 8 +- clang/include/clang/AST/ASTLambda.h | 11 + clang/include/clang/AST/ASTNodeTraverser.h | 58 +- clang/include/clang/AST/ASTTypeTraits.h | 8 +- clang/include/clang/AST/AbstractBasicReader.h | 263 ++ clang/include/clang/AST/AbstractBasicWriter.h | 243 + clang/include/clang/AST/AbstractTypeReader.h | 31 + clang/include/clang/AST/AbstractTypeWriter.h | 32 + clang/include/clang/AST/Attr.h | 136 +- clang/include/clang/AST/CXXInheritance.h | 24 + clang/include/clang/AST/Comment.h | 8 +- clang/include/clang/AST/CommentCommands.td | 13 +- .../include/clang/AST/ComparisonCategories.h | 44 +- clang/include/clang/AST/Decl.h | 176 +- clang/include/clang/AST/DeclBase.h | 13 +- clang/include/clang/AST/DeclCXX.h | 167 +- clang/include/clang/AST/DeclObjC.h | 32 +- clang/include/clang/AST/DeclTemplate.h | 221 +- clang/include/clang/AST/DeclarationName.h | 10 +- clang/include/clang/AST/Expr.h | 76 +- clang/include/clang/AST/ExprCXX.h | 199 +- clang/include/clang/AST/ExprObjC.h | 2 +- clang/include/clang/AST/ExternalASTSource.h | 11 +- clang/include/clang/AST/JSONNodeDumper.h | 11 +- clang/include/clang/AST/OpenMPClause.h | 147 +- clang/include/clang/AST/PrettyPrinter.h | 21 +- clang/include/clang/AST/PropertiesBase.td | 495 ++ clang/include/clang/AST/RecursiveASTVisitor.h | 67 +- clang/include/clang/AST/Stmt.h | 4 + clang/include/clang/AST/StmtDataCollectors.td | 2 +- clang/include/clang/AST/StmtOpenMP.h | 612 ++- clang/include/clang/AST/TemplateName.h | 8 +- clang/include/clang/AST/TextNodeDumper.h | 2 + clang/include/clang/AST/Type.h | 138 +- clang/include/clang/AST/TypeLoc.h | 26 +- clang/include/clang/AST/TypeProperties.td | 815 ++++ clang/include/clang/AST/UnresolvedSet.h | 5 + .../clang/ASTMatchers/ASTMatchFinder.h | 27 + clang/include/clang/ASTMatchers/ASTMatchers.h | 210 +- .../clang/ASTMatchers/ASTMatchersInternal.h | 103 +- .../clang/ASTMatchers/Dynamic/Parser.h | 24 +- clang/include/clang/Analysis/CFG.h | 2 + clang/include/clang/Basic/ASTNode.td | 8 + clang/include/clang/Basic/AddressSpaces.h | 10 + clang/include/clang/Basic/Attr.td | 269 +- clang/include/clang/Basic/AttrDocs.td | 414 +- clang/include/clang/Basic/Builtins.def | 37 +- clang/include/clang/Basic/Builtins.h | 4 +- clang/include/clang/Basic/BuiltinsAArch64.def | 2 + clang/include/clang/Basic/BuiltinsARM.def | 13 + .../clang/Basic/BuiltinsWebAssembly.def | 5 + clang/include/clang/Basic/BuiltinsX86.def | 50 +- clang/include/clang/Basic/CodeGenOptions.def | 17 +- clang/include/clang/Basic/CodeGenOptions.h | 12 +- clang/include/clang/Basic/CommentNodes.td | 40 +- clang/include/clang/Basic/DebugInfoOptions.h | 47 +- clang/include/clang/Basic/DeclNodes.td | 187 +- clang/include/clang/Basic/Diagnostic.h | 12 +- .../include/clang/Basic/DiagnosticASTKinds.td | 14 + .../clang/Basic/DiagnosticCommentKinds.td | 4 +- .../clang/Basic/DiagnosticCommonKinds.td | 10 +- .../clang/Basic/DiagnosticDriverKinds.td | 9 +- clang/include/clang/Basic/DiagnosticGroups.td | 56 +- .../clang/Basic/DiagnosticParseKinds.td | 29 +- .../clang/Basic/DiagnosticSemaKinds.td | 420 +- .../Basic/DiagnosticSerializationKinds.td | 2 + clang/include/clang/Basic/FileManager.h | 11 +- clang/include/clang/Basic/IdentifierTable.h | 13 + clang/include/clang/Basic/LangOptions.def | 11 +- clang/include/clang/Basic/LangOptions.h | 36 +- clang/include/clang/Basic/ObjCRuntime.h | 14 + clang/include/clang/Basic/OpenMPKinds.def | 175 +- clang/include/clang/Basic/OpenMPKinds.h | 72 +- clang/include/clang/Basic/PartialDiagnostic.h | 1 - .../clang/Basic/SanitizerSpecialCaseList.h | 7 +- clang/include/clang/Basic/Sanitizers.h | 9 +- clang/include/clang/Basic/SourceLocation.h | 16 + clang/include/clang/Basic/SourceManager.h | 5 + clang/include/clang/Basic/Specifiers.h | 9 + clang/include/clang/Basic/StmtNodes.td | 444 +- clang/include/clang/Basic/TargetCXXABI.h | 32 +- clang/include/clang/Basic/TargetInfo.h | 35 +- clang/include/clang/Basic/TokenKinds.def | 6 +- clang/include/clang/Basic/TypeNodes.td | 116 +- clang/include/clang/Basic/arm_fp16.td | 162 +- clang/include/clang/Basic/arm_mve.td | 1004 ++++ clang/include/clang/Basic/arm_mve_defs.td | 516 +++ clang/include/clang/Basic/arm_neon.td | 1443 +++--- clang/include/clang/Basic/arm_neon_incl.td | 70 +- clang/include/clang/CodeGen/CGFunctionInfo.h | 12 +- clang/include/clang/Driver/CC1Options.td | 6 +- clang/include/clang/Driver/Distro.h | 6 +- clang/include/clang/Driver/Driver.h | 21 +- clang/include/clang/Driver/Job.h | 20 +- clang/include/clang/Driver/OptionUtils.h | 58 + clang/include/clang/Driver/Options.td | 106 +- clang/include/clang/Driver/SanitizerArgs.h | 4 +- clang/include/clang/Driver/ToolChain.h | 6 + clang/include/clang/Driver/Types.h | 3 + clang/include/clang/Format/Format.h | 157 +- .../include/clang/Frontend/CompilerInstance.h | 32 +- .../include/clang/Frontend/FrontendOptions.h | 7 +- .../clang/Frontend/MultiplexConsumer.h | 1 + .../clang/Frontend/PrecompiledPreamble.h | 8 - clang/include/clang/Frontend/Utils.h | 38 +- clang/include/clang/Index/IndexDataConsumer.h | 18 +- clang/include/clang/Lex/ModuleLoader.h | 32 +- clang/include/clang/Lex/ModuleMap.h | 20 +- clang/include/clang/Lex/Preprocessor.h | 15 +- clang/include/clang/Lex/PreprocessorOptions.h | 5 + clang/include/clang/Parse/Parser.h | 108 +- .../clang/Parse/RAIIObjectsForParser.h | 19 + .../include/clang/Sema/CodeCompleteConsumer.h | 13 +- clang/include/clang/Sema/DeclSpec.h | 28 +- clang/include/clang/Sema/ExternalSemaSource.h | 16 +- .../clang/Sema/MultiplexExternalSemaSource.h | 12 +- clang/include/clang/Sema/ObjCMethodList.h | 6 + clang/include/clang/Sema/Overload.h | 53 +- clang/include/clang/Sema/ParsedTemplate.h | 4 + clang/include/clang/Sema/Sema.h | 529 ++- clang/include/clang/Sema/SemaConcept.h | 145 + clang/include/clang/Sema/Template.h | 17 +- clang/include/clang/Sema/TemplateDeduction.h | 6 + .../include/clang/Serialization/ASTBitCodes.h | 152 +- clang/include/clang/Serialization/ASTReader.h | 482 +- .../clang/Serialization/ASTRecordReader.h | 359 ++ .../clang/Serialization/ASTRecordWriter.h | 295 ++ clang/include/clang/Serialization/ASTWriter.h | 244 - .../clang/Serialization/ContinuousRangeMap.h | 19 +- .../Serialization/{Module.h => ModuleFile.h} | 11 +- .../clang/Serialization/ModuleManager.h | 6 +- .../clang/Serialization/TypeBitCodes.def | 62 + .../clang/StaticAnalyzer/Checkers/Checkers.td | 37 + .../StaticAnalyzer/Checkers/SValExplainer.h | 1 + .../StaticAnalyzer/Core/AnalyzerOptions.def | 6 + .../Core/BugReporter/BugReporter.h | 2 +- .../StaticAnalyzer/Core/CheckerManager.h | 7 +- .../Core/PathSensitive/CheckerContext.h | 16 + .../Core/PathSensitive/ExprEngine.h | 21 +- .../Core/PathSensitive/ProgramState.h | 7 +- .../Core/PathSensitive/SubEngine.h | 7 +- .../clang/Tooling/CompilationDatabase.h | 7 + .../DependencyScanningService.h | 18 +- .../DependencyScanningTool.h | 13 +- .../DependencyScanningWorker.h | 8 +- .../DependencyScanning/ModuleDepCollector.h | 94 + .../clang/Tooling/Inclusions/HeaderIncludes.h | 3 +- .../clang/Tooling/Inclusions/IncludeStyle.h | 29 + .../clang/Tooling/Refactoring/ASTSelection.h | 1 + .../include/clang/Tooling/Syntax/BuildTree.h | 9 + .../include/clang/Tooling/Syntax/Mutations.h | 37 + clang/include/clang/Tooling/Syntax/Nodes.h | 379 +- clang/include/clang/Tooling/Syntax/Tokens.h | 26 +- clang/include/clang/Tooling/Syntax/Tree.h | 52 +- clang/include/clang/Tooling/Tooling.h | 3 +- .../clang/Tooling/Transformer/MatchConsumer.h | 47 + .../clang/Tooling/Transformer/RewriteRule.h | 41 +- .../clang/Tooling/Transformer/Stencil.h | 192 +- clang/include/clang/module.modulemap | 10 +- clang/lib/ARCMigrate/ObjCMT.cpp | 4 +- clang/lib/AST/ASTConcept.cpp | 55 + clang/lib/AST/ASTContext.cpp | 357 +- clang/lib/AST/ASTDiagnostic.cpp | 23 +- clang/lib/AST/ASTImporter.cpp | 437 +- clang/lib/AST/ASTTypeTraits.cpp | 1 + clang/lib/AST/Comment.cpp | 6 +- clang/lib/AST/CommentSema.cpp | 53 +- clang/lib/AST/ComparisonCategories.cpp | 53 +- clang/lib/AST/Decl.cpp | 170 +- clang/lib/AST/DeclBase.cpp | 1 + clang/lib/AST/DeclCXX.cpp | 181 +- clang/lib/AST/DeclObjC.cpp | 66 +- clang/lib/AST/DeclPrinter.cpp | 101 +- clang/lib/AST/DeclTemplate.cpp | 212 +- clang/lib/AST/DeclarationName.cpp | 25 +- clang/lib/AST/Expr.cpp | 117 +- clang/lib/AST/ExprCXX.cpp | 75 +- clang/lib/AST/ExprConstant.cpp | 567 ++- clang/lib/AST/ExternalASTMerger.cpp | 4 +- clang/lib/AST/ExternalASTSource.cpp | 2 + clang/lib/AST/Interp/ByteCodeStmtGen.cpp | 4 +- clang/lib/AST/Interp/Context.cpp | 64 +- clang/lib/AST/Interp/Context.h | 24 +- clang/lib/AST/Interp/Interp.h | 7 +- clang/lib/AST/ItaniumMangle.cpp | 12 +- clang/lib/AST/JSONNodeDumper.cpp | 29 +- clang/lib/AST/Mangle.cpp | 4 +- clang/lib/AST/MicrosoftCXXABI.cpp | 34 +- clang/lib/AST/MicrosoftMangle.cpp | 77 +- clang/lib/AST/NestedNameSpecifier.cpp | 6 +- clang/lib/AST/ODRHash.cpp | 5 + clang/lib/AST/OpenMPClause.cpp | 57 +- clang/lib/AST/QualTypeNames.cpp | 2 +- clang/lib/AST/RecordLayoutBuilder.cpp | 6 +- clang/lib/AST/Stmt.cpp | 6 + clang/lib/AST/StmtOpenMP.cpp | 150 + clang/lib/AST/StmtPrinter.cpp | 18 +- clang/lib/AST/StmtProfile.cpp | 18 +- clang/lib/AST/TextNodeDumper.cpp | 33 +- clang/lib/AST/Type.cpp | 19 +- clang/lib/AST/TypeLoc.cpp | 20 + clang/lib/AST/TypePrinter.cpp | 85 +- clang/lib/AST/VTableBuilder.cpp | 4 +- clang/lib/ASTMatchers/ASTMatchFinder.cpp | 106 +- clang/lib/ASTMatchers/ASTMatchersInternal.cpp | 58 +- clang/lib/ASTMatchers/Dynamic/Parser.cpp | 78 +- clang/lib/ASTMatchers/Dynamic/Registry.cpp | 6 +- clang/lib/Analysis/BodyFarm.cpp | 105 +- clang/lib/Analysis/CFG.cpp | 51 +- clang/lib/Analysis/CloneDetection.cpp | 2 +- clang/lib/Analysis/Consumed.cpp | 2 +- clang/lib/Analysis/ReachableCode.cpp | 1 + clang/lib/Analysis/ThreadSafety.cpp | 3 + clang/lib/Analysis/ThreadSafetyCommon.cpp | 3 +- clang/lib/Basic/Builtins.cpp | 3 +- clang/lib/Basic/Diagnostic.cpp | 6 +- clang/lib/Basic/FileManager.cpp | 43 +- clang/lib/Basic/OpenMPKinds.cpp | 135 +- clang/lib/Basic/SanitizerBlacklist.cpp | 4 +- clang/lib/Basic/SanitizerSpecialCaseList.cpp | 8 +- clang/lib/Basic/SourceManager.cpp | 59 +- clang/lib/Basic/Targets.cpp | 7 + clang/lib/Basic/Targets/AArch64.cpp | 63 +- clang/lib/Basic/Targets/AArch64.h | 5 + clang/lib/Basic/Targets/AMDGPU.cpp | 11 +- clang/lib/Basic/Targets/ARM.cpp | 12 + clang/lib/Basic/Targets/ARM.h | 3 +- clang/lib/Basic/Targets/BPF.h | 2 + clang/lib/Basic/Targets/Hexagon.cpp | 5 +- clang/lib/Basic/Targets/Mips.cpp | 16 +- clang/lib/Basic/Targets/Mips.h | 2 + clang/lib/Basic/Targets/NVPTX.h | 3 + clang/lib/Basic/Targets/OSTargets.cpp | 2 +- clang/lib/Basic/Targets/OSTargets.h | 2 + clang/lib/Basic/Targets/PPC.cpp | 43 +- clang/lib/Basic/Targets/PPC.h | 19 +- clang/lib/Basic/Targets/SPIR.h | 5 +- clang/lib/Basic/Targets/TCE.h | 5 +- clang/lib/Basic/Targets/X86.cpp | 38 +- clang/lib/Basic/Targets/X86.h | 44 +- clang/lib/Basic/Version.cpp | 5 - clang/lib/Basic/XRayLists.cpp | 11 +- clang/lib/CodeGen/BackendUtil.cpp | 166 +- clang/lib/CodeGen/CGAtomic.cpp | 100 +- clang/lib/CodeGen/CGBlocks.cpp | 9 +- clang/lib/CodeGen/CGBuilder.h | 22 +- clang/lib/CodeGen/CGBuiltin.cpp | 603 ++- clang/lib/CodeGen/CGCXX.cpp | 3 +- clang/lib/CodeGen/CGCXXABI.cpp | 1 + clang/lib/CodeGen/CGCall.cpp | 115 +- clang/lib/CodeGen/CGCall.h | 572 ++- clang/lib/CodeGen/CGClass.cpp | 34 +- clang/lib/CodeGen/CGDebugInfo.cpp | 329 +- clang/lib/CodeGen/CGDebugInfo.h | 39 +- clang/lib/CodeGen/CGDecl.cpp | 51 +- clang/lib/CodeGen/CGDeclCXX.cpp | 19 +- clang/lib/CodeGen/CGException.cpp | 5 +- clang/lib/CodeGen/CGExpr.cpp | 241 +- clang/lib/CodeGen/CGExprAgg.cpp | 76 +- clang/lib/CodeGen/CGExprCXX.cpp | 94 +- clang/lib/CodeGen/CGExprComplex.cpp | 15 +- clang/lib/CodeGen/CGExprConstant.cpp | 13 +- clang/lib/CodeGen/CGExprScalar.cpp | 209 +- clang/lib/CodeGen/CGLoopInfo.cpp | 29 +- clang/lib/CodeGen/CGNonTrivialStruct.cpp | 20 +- clang/lib/CodeGen/CGObjC.cpp | 147 +- clang/lib/CodeGen/CGObjCGNU.cpp | 33 +- clang/lib/CodeGen/CGObjCMac.cpp | 270 +- clang/lib/CodeGen/CGObjCRuntime.h | 21 + clang/lib/CodeGen/CGOpenCLRuntime.cpp | 4 +- clang/lib/CodeGen/CGOpenMPRuntime.cpp | 1020 +++-- clang/lib/CodeGen/CGOpenMPRuntime.h | 142 +- clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp | 74 +- clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.h | 2 +- clang/lib/CodeGen/CGStmt.cpp | 31 +- clang/lib/CodeGen/CGStmtOpenMP.cpp | 610 ++- clang/lib/CodeGen/CGVTables.cpp | 10 +- clang/lib/CodeGen/CGValue.h | 25 +- clang/lib/CodeGen/CodeGenAction.cpp | 160 +- clang/lib/CodeGen/CodeGenFunction.cpp | 134 +- clang/lib/CodeGen/CodeGenFunction.h | 40 +- clang/lib/CodeGen/CodeGenModule.cpp | 192 +- clang/lib/CodeGen/CodeGenModule.h | 43 +- clang/lib/CodeGen/CodeGenPGO.cpp | 3 +- clang/lib/CodeGen/CodeGenTBAA.cpp | 19 +- clang/lib/CodeGen/ConstantEmitter.h | 2 +- clang/lib/CodeGen/CoverageMappingGen.cpp | 29 +- clang/lib/CodeGen/CoverageMappingGen.h | 8 +- clang/lib/CodeGen/ItaniumCXXABI.cpp | 30 +- clang/lib/CodeGen/MicrosoftCXXABI.cpp | 119 +- clang/lib/CodeGen/ModuleBuilder.cpp | 4 + clang/lib/CodeGen/SanitizerMetadata.cpp | 1 + clang/lib/CodeGen/TargetInfo.cpp | 300 +- clang/lib/Driver/Distro.cpp | 23 +- clang/lib/Driver/Driver.cpp | 149 +- clang/lib/Driver/Job.cpp | 112 +- clang/lib/Driver/OptionUtils.cpp | 47 + clang/lib/Driver/SanitizerArgs.cpp | 32 +- clang/lib/Driver/ToolChain.cpp | 26 +- clang/lib/Driver/ToolChains/AIX.cpp | 159 + clang/lib/Driver/ToolChains/AIX.h | 75 + clang/lib/Driver/ToolChains/AMDGPU.h | 2 +- clang/lib/Driver/ToolChains/Arch/AArch64.cpp | 9 +- clang/lib/Driver/ToolChains/Arch/ARM.cpp | 47 +- clang/lib/Driver/ToolChains/Arch/PPC.cpp | 6 + clang/lib/Driver/ToolChains/Arch/RISCV.cpp | 203 +- clang/lib/Driver/ToolChains/Arch/RISCV.h | 2 + clang/lib/Driver/ToolChains/Arch/SystemZ.cpp | 18 +- clang/lib/Driver/ToolChains/Arch/SystemZ.h | 3 +- clang/lib/Driver/ToolChains/Arch/X86.cpp | 3 +- clang/lib/Driver/ToolChains/Clang.cpp | 866 +++- clang/lib/Driver/ToolChains/CommonArgs.cpp | 141 +- clang/lib/Driver/ToolChains/CommonArgs.h | 11 +- clang/lib/Driver/ToolChains/Cuda.cpp | 3 +- clang/lib/Driver/ToolChains/Darwin.cpp | 105 +- clang/lib/Driver/ToolChains/Darwin.h | 10 + clang/lib/Driver/ToolChains/Flang.cpp | 79 + clang/lib/Driver/ToolChains/Flang.h | 46 + clang/lib/Driver/ToolChains/FreeBSD.cpp | 38 +- clang/lib/Driver/ToolChains/FreeBSD.h | 7 + clang/lib/Driver/ToolChains/Fuchsia.cpp | 25 +- clang/lib/Driver/ToolChains/Gnu.cpp | 215 +- clang/lib/Driver/ToolChains/Gnu.h | 9 + clang/lib/Driver/ToolChains/HIP.cpp | 80 +- clang/lib/Driver/ToolChains/HIP.h | 2 +- clang/lib/Driver/ToolChains/Hexagon.cpp | 13 +- clang/lib/Driver/ToolChains/Hurd.cpp | 10 +- clang/lib/Driver/ToolChains/Hurd.h | 4 + .../lib/Driver/ToolChains/InterfaceStubs.cpp | 38 +- clang/lib/Driver/ToolChains/Linux.cpp | 76 +- clang/lib/Driver/ToolChains/Linux.h | 7 +- clang/lib/Driver/ToolChains/MSVC.cpp | 22 + clang/lib/Driver/ToolChains/MinGW.cpp | 14 +- clang/lib/Driver/ToolChains/NetBSD.cpp | 6 +- clang/lib/Driver/ToolChains/OpenBSD.cpp | 9 + clang/lib/Driver/ToolChains/OpenBSD.h | 5 + clang/lib/Driver/ToolChains/PS4CPU.h | 4 + .../lib/Driver/ToolChains/RISCVToolchain.cpp | 92 +- clang/lib/Driver/ToolChains/RISCVToolchain.h | 4 +- clang/lib/Driver/ToolChains/WebAssembly.cpp | 64 +- clang/lib/Driver/Types.cpp | 26 +- clang/lib/Driver/XRayArgs.cpp | 13 +- clang/lib/Format/BreakableToken.cpp | 27 +- clang/lib/Format/BreakableToken.h | 20 +- clang/lib/Format/Format.cpp | 84 +- clang/lib/Format/FormatToken.h | 4 +- clang/lib/Format/FormatTokenLexer.cpp | 12 + .../lib/Format/NamespaceEndCommentsFixer.cpp | 20 +- clang/lib/Format/TokenAnnotator.cpp | 140 +- clang/lib/Format/UnwrappedLineFormatter.cpp | 13 + clang/lib/Format/UnwrappedLineParser.cpp | 9 +- clang/lib/Frontend/ASTUnit.cpp | 4 +- clang/lib/Frontend/ChainedIncludesSource.cpp | 1 + clang/lib/Frontend/CompilerInstance.cpp | 627 +-- clang/lib/Frontend/CompilerInvocation.cpp | 146 +- .../CreateInvocationFromCommandLine.cpp | 5 +- clang/lib/Frontend/FrontendAction.cpp | 9 +- clang/lib/Frontend/FrontendActions.cpp | 8 +- clang/lib/Frontend/InitPreprocessor.cpp | 23 +- .../InterfaceStubFunctionsConsumer.cpp | 49 +- clang/lib/Frontend/MultiplexConsumer.cpp | 5 + clang/lib/Frontend/PrecompiledPreamble.cpp | 17 +- .../lib/Frontend/Rewrite/FrontendActions.cpp | 8 +- .../Frontend/Rewrite/RewriteModernObjC.cpp | 24 +- clang/lib/Frontend/Rewrite/RewriteObjC.cpp | 24 +- clang/lib/Frontend/TextDiagnostic.cpp | 23 +- clang/lib/Headers/altivec.h | 62 +- clang/lib/Headers/arm_acle.h | 26 + clang/lib/Headers/arm_cmse.h | 217 + clang/lib/Headers/avx512bwintrin.h | 12 +- clang/lib/Headers/avx512fintrin.h | 28 +- clang/lib/Headers/avx512vlbwintrin.h | 24 +- clang/lib/Headers/avx512vlintrin.h | 112 +- clang/lib/Headers/avxintrin.h | 10 +- clang/lib/Headers/emmintrin.h | 28 +- clang/lib/Headers/immintrin.h | 6 +- clang/lib/Headers/intrin.h | 26 +- clang/lib/Headers/mwaitxintrin.h | 4 +- clang/lib/Headers/pmmintrin.h | 2 +- clang/lib/Headers/xmmintrin.h | 14 +- clang/lib/Index/CommentToXML.cpp | 8 + clang/lib/Index/IndexDecl.cpp | 29 +- clang/lib/Index/IndexSymbol.cpp | 1 + clang/lib/Index/IndexingAction.cpp | 2 +- clang/lib/Index/IndexingContext.cpp | 22 +- clang/lib/Index/USRGeneration.cpp | 1 + .../DependencyDirectivesSourceMinimizer.cpp | 13 +- clang/lib/Lex/Lexer.cpp | 3 + clang/lib/Lex/LiteralSupport.cpp | 6 +- clang/lib/Lex/ModuleMap.cpp | 2 +- clang/lib/Lex/PPDirectives.cpp | 4 +- clang/lib/Lex/PPMacroExpansion.cpp | 52 +- clang/lib/Lex/Pragma.cpp | 4 +- clang/lib/Lex/Preprocessor.cpp | 7 +- clang/lib/Parse/ParseAST.cpp | 2 +- clang/lib/Parse/ParseCXXInlineMethods.cpp | 46 + clang/lib/Parse/ParseDecl.cpp | 151 +- clang/lib/Parse/ParseDeclCXX.cpp | 78 +- clang/lib/Parse/ParseExpr.cpp | 302 +- clang/lib/Parse/ParseExprCXX.cpp | 67 +- clang/lib/Parse/ParseObjc.cpp | 3 + clang/lib/Parse/ParseOpenMP.cpp | 429 +- clang/lib/Parse/ParsePragma.cpp | 2 +- clang/lib/Parse/ParseStmt.cpp | 112 + clang/lib/Parse/ParseStmtAsm.cpp | 46 +- clang/lib/Parse/ParseTemplate.cpp | 237 +- clang/lib/Parse/ParseTentative.cpp | 19 +- clang/lib/Parse/Parser.cpp | 20 +- clang/lib/Sema/AnalysisBasedWarnings.cpp | 2 +- clang/lib/Sema/JumpDiagnostics.cpp | 4 +- .../lib/Sema/MultiplexExternalSemaSource.cpp | 2 + clang/lib/Sema/OpenCLBuiltins.td | 813 +++- clang/lib/Sema/Sema.cpp | 22 +- clang/lib/Sema/SemaAccess.cpp | 23 +- clang/lib/Sema/SemaAttr.cpp | 8 +- clang/lib/Sema/SemaCUDA.cpp | 2 + clang/lib/Sema/SemaCast.cpp | 27 +- clang/lib/Sema/SemaChecking.cpp | 785 +++- clang/lib/Sema/SemaCodeComplete.cpp | 110 +- clang/lib/Sema/SemaConcept.cpp | 863 +++- clang/lib/Sema/SemaCoroutine.cpp | 9 +- clang/lib/Sema/SemaDecl.cpp | 403 +- clang/lib/Sema/SemaDeclAttr.cpp | 347 +- clang/lib/Sema/SemaDeclCXX.cpp | 1762 ++++++- clang/lib/Sema/SemaDeclObjC.cpp | 182 +- clang/lib/Sema/SemaExceptionSpec.cpp | 357 +- clang/lib/Sema/SemaExpr.cpp | 513 ++- clang/lib/Sema/SemaExprCXX.cpp | 573 ++- clang/lib/Sema/SemaExprMember.cpp | 12 + clang/lib/Sema/SemaExprObjC.cpp | 129 +- clang/lib/Sema/SemaInit.cpp | 212 +- clang/lib/Sema/SemaLambda.cpp | 16 +- clang/lib/Sema/SemaLookup.cpp | 41 +- clang/lib/Sema/SemaModule.cpp | 2 - clang/lib/Sema/SemaObjCProperty.cpp | 143 +- clang/lib/Sema/SemaOpenMP.cpp | 1030 ++++- clang/lib/Sema/SemaOverload.cpp | 1361 ++++-- clang/lib/Sema/SemaPseudoObject.cpp | 22 +- clang/lib/Sema/SemaStmt.cpp | 56 +- clang/lib/Sema/SemaStmtAsm.cpp | 20 +- clang/lib/Sema/SemaTemplate.cpp | 581 ++- clang/lib/Sema/SemaTemplateDeduction.cpp | 278 +- clang/lib/Sema/SemaTemplateInstantiate.cpp | 126 +- .../lib/Sema/SemaTemplateInstantiateDecl.cpp | 432 +- clang/lib/Sema/SemaTemplateVariadic.cpp | 4 + clang/lib/Sema/SemaType.cpp | 316 +- clang/lib/Sema/TreeTransform.h | 158 +- clang/lib/Serialization/ASTCommon.cpp | 1 + clang/lib/Serialization/ASTReader.cpp | 1496 ++---- clang/lib/Serialization/ASTReaderDecl.cpp | 590 +-- clang/lib/Serialization/ASTReaderStmt.cpp | 675 +-- clang/lib/Serialization/ASTWriter.cpp | 737 +-- clang/lib/Serialization/ASTWriterDecl.cpp | 102 +- clang/lib/Serialization/ASTWriterStmt.cpp | 54 +- clang/lib/Serialization/GlobalModuleIndex.cpp | 17 +- .../{Module.cpp => ModuleFile.cpp} | 8 +- clang/lib/Serialization/ModuleManager.cpp | 7 +- .../Checkers/AnalysisOrderChecker.cpp | 10 + .../Checkers/CStringChecker.cpp | 355 +- .../Checkers/CheckPlacementNew.cpp | 121 + .../Checkers/CheckSecuritySyntaxOnly.cpp | 68 + .../Checkers/DebugIteratorModeling.cpp | 196 + .../Checkers/DereferenceChecker.cpp | 2 +- .../Checkers/DirectIvarAssignment.cpp | 2 + .../Checkers/FuchsiaHandleChecker.cpp | 557 +++ .../Checkers/GenericTaintChecker.cpp | 234 +- .../Checkers/InnerPointerChecker.cpp | 6 +- .../Checkers/InvalidatedIteratorChecker.cpp | 95 + .../lib/StaticAnalyzer/Checkers/Iterator.cpp | 227 + clang/lib/StaticAnalyzer/Checkers/Iterator.h | 175 + ...eratorChecker.cpp => IteratorModeling.cpp} | 1251 +---- .../Checkers/IteratorRangeChecker.cpp | 273 ++ .../Checkers/LocalizationChecker.cpp | 5 +- .../StaticAnalyzer/Checkers/MIGChecker.cpp | 1 + .../Checkers/MacOSXAPIChecker.cpp | 3 +- .../StaticAnalyzer/Checkers/MallocChecker.cpp | 24 +- .../Checkers/MismatchedIteratorChecker.cpp | 295 ++ .../StaticAnalyzer/Checkers/MoveChecker.cpp | 3 +- .../NonnullGlobalConstantsChecker.cpp | 4 +- .../Checkers/NullabilityChecker.cpp | 5 - .../StaticAnalyzer/Checkers/StreamChecker.cpp | 451 +- clang/lib/StaticAnalyzer/Checkers/Taint.cpp | 37 +- clang/lib/StaticAnalyzer/Checkers/Taint.h | 38 +- .../Checkers/VirtualCallChecker.cpp | 3 +- .../StaticAnalyzer/Core/AnalysisManager.cpp | 3 + .../Core/BugReporterVisitors.cpp | 25 +- clang/lib/StaticAnalyzer/Core/CallEvent.cpp | 13 +- .../StaticAnalyzer/Core/CheckerManager.cpp | 22 +- clang/lib/StaticAnalyzer/Core/ExprEngine.cpp | 101 +- clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp | 6 +- .../lib/StaticAnalyzer/Core/ExprEngineCXX.cpp | 2 +- .../Core/ExprEngineCallAndReturn.cpp | 44 +- .../lib/StaticAnalyzer/Core/ProgramState.cpp | 10 +- clang/lib/StaticAnalyzer/Core/RegionStore.cpp | 3 +- .../StaticAnalyzer/Core/SarifDiagnostics.cpp | 80 +- clang/lib/StaticAnalyzer/Core/Store.cpp | 14 +- .../Frontend/AnalysisConsumer.cpp | 7 - .../Frontend/CheckerRegistry.cpp | 3 +- .../StaticAnalyzer/Frontend/ModelInjector.cpp | 1 + clang/lib/Tooling/ASTDiff/ASTDiff.cpp | 2 +- clang/lib/Tooling/ArgumentsAdjusters.cpp | 16 +- .../DependencyScanningFilesystem.cpp | 42 +- .../DependencyScanningService.cpp | 8 +- .../DependencyScanningTool.cpp | 131 +- .../DependencyScanningWorker.cpp | 30 +- .../DependencyScanning/ModuleDepCollector.cpp | 135 + ...ExpandResponseFilesCompilationDatabase.cpp | 90 + .../lib/Tooling/Inclusions/HeaderIncludes.cpp | 5 +- .../InterpolatingCompilationDatabase.cpp | 3 +- clang/lib/Tooling/JSONCompilationDatabase.cpp | 4 +- .../Refactoring/ASTSelectionRequirements.cpp | 1 + .../Refactoring/Rename/USRFindingAction.cpp | 4 +- clang/lib/Tooling/Syntax/BuildTree.cpp | 499 +- .../Tooling/Syntax/ComputeReplacements.cpp | 126 + clang/lib/Tooling/Syntax/Mutations.cpp | 98 + clang/lib/Tooling/Syntax/Nodes.cpp | 221 +- clang/lib/Tooling/Syntax/Synthesis.cpp | 45 + clang/lib/Tooling/Syntax/Tokens.cpp | 48 +- clang/lib/Tooling/Syntax/Tree.cpp | 142 +- clang/lib/Tooling/Tooling.cpp | 8 +- clang/lib/Tooling/Transformer/RewriteRule.cpp | 30 +- clang/lib/Tooling/Transformer/Stencil.cpp | 160 +- clang/tools/clang-format/ClangFormat.cpp | 83 +- clang/tools/driver/cc1_main.cpp | 15 +- clang/tools/driver/cc1as_main.cpp | 5 +- clang/tools/driver/driver.cpp | 43 +- clang/utils/TableGen/ASTTableGen.cpp | 142 + clang/utils/TableGen/ASTTableGen.h | 502 ++ clang/utils/TableGen/ClangASTNodesEmitter.cpp | 181 +- .../TableGen/ClangASTPropertiesEmitter.cpp | 867 ++++ clang/utils/TableGen/ClangAttrEmitter.cpp | 20 +- .../TableGen/ClangDiagnosticsEmitter.cpp | 6 +- .../TableGen/ClangOpenCLBuiltinEmitter.cpp | 206 +- .../utils/TableGen/ClangTypeNodesEmitter.cpp | 194 +- clang/utils/TableGen/MveEmitter.cpp | 1882 ++++++++ clang/utils/TableGen/NeonEmitter.cpp | 632 +-- clang/utils/TableGen/TableGen.cpp | 61 +- clang/utils/TableGen/TableGenBackends.h | 11 +- clang/utils/convert_arm_neon.py | 172 + .../include/fuzzer/FuzzedDataProvider.h | 6 + .../profile/InstrProfData.inc | 4 +- .../include/sanitizer/asan_interface.h | 4 + .../include/sanitizer/netbsd_syscall_hooks.h | 165 +- compiler-rt/lib/asan/asan_allocator.cpp | 28 +- compiler-rt/lib/asan/asan_interface.inc | 1 + .../lib/asan/asan_interface_internal.h | 3 + compiler-rt/lib/asan/asan_malloc_win.cpp | 3 - compiler-rt/lib/builtins/clear_cache.c | 38 +- compiler-rt/lib/builtins/cpu_model.c | 12 +- compiler-rt/lib/builtins/i386/fp_mode.c | 39 + compiler-rt/lib/builtins/ppc/fixtfti.c | 38 + compiler-rt/lib/builtins/ppc/fixunstfti.c | 14 +- compiler-rt/lib/crt/crtbegin.c | 48 +- compiler-rt/lib/fuzzer/FuzzerDefs.h | 18 +- compiler-rt/lib/fuzzer/FuzzerDriver.cpp | 7 +- .../lib/fuzzer/FuzzerExtFunctionsWeak.cpp | 2 +- .../lib/fuzzer/FuzzerExtraCounters.cpp | 2 +- compiler-rt/lib/fuzzer/FuzzerFlags.def | 3 +- compiler-rt/lib/fuzzer/FuzzerIO.cpp | 2 +- compiler-rt/lib/fuzzer/FuzzerIO.h | 2 - compiler-rt/lib/fuzzer/FuzzerIOPosix.cpp | 8 - compiler-rt/lib/fuzzer/FuzzerIOWindows.cpp | 8 - compiler-rt/lib/fuzzer/FuzzerUtil.h | 2 + compiler-rt/lib/fuzzer/FuzzerUtilDarwin.cpp | 9 + compiler-rt/lib/fuzzer/FuzzerUtilFuchsia.cpp | 77 +- compiler-rt/lib/fuzzer/FuzzerUtilLinux.cpp | 11 +- compiler-rt/lib/fuzzer/FuzzerUtilPosix.cpp | 5 +- compiler-rt/lib/fuzzer/FuzzerUtilWindows.cpp | 9 + compiler-rt/lib/gwp_asan/definitions.h | 18 +- .../lib/gwp_asan/guarded_pool_allocator.cpp | 9 +- .../lib/gwp_asan/guarded_pool_allocator.h | 10 +- compiler-rt/lib/hwasan/hwasan.h | 20 + .../lib/hwasan/hwasan_interceptors.cpp | 102 +- .../lib/hwasan/hwasan_interface_internal.h | 4 + compiler-rt/lib/hwasan/hwasan_linux.cpp | 42 +- compiler-rt/lib/hwasan/hwasan_report.cpp | 5 +- compiler-rt/lib/hwasan/hwasan_setjmp.S | 100 + .../lib/hwasan/hwasan_tag_mismatch_aarch64.S | 4 +- compiler-rt/lib/hwasan/hwasan_type_test.cpp | 25 + compiler-rt/lib/lsan/lsan_allocator.cpp | 13 +- compiler-rt/lib/msan/msan.cpp | 4 + compiler-rt/lib/msan/msan_allocator.cpp | 11 +- compiler-rt/lib/msan/msan_blacklist.txt | 3 + compiler-rt/lib/msan/msan_interceptors.cpp | 5 +- compiler-rt/lib/profile/GCDAProfiling.c | 25 +- compiler-rt/lib/profile/InstrProfiling.c | 2 +- compiler-rt/lib/profile/InstrProfiling.h | 58 +- .../lib/profile/InstrProfilingBuffer.c | 70 +- compiler-rt/lib/profile/InstrProfilingFile.c | 354 +- .../lib/profile/InstrProfilingInternal.h | 7 + compiler-rt/lib/profile/InstrProfilingMerge.c | 2 +- .../lib/profile/InstrProfilingMergeFile.c | 2 +- .../profile/InstrProfilingPlatformFuchsia.c | 2 + compiler-rt/lib/profile/InstrProfilingPort.h | 13 + .../lib/profile/InstrProfilingRuntime.cpp | 3 +- compiler-rt/lib/profile/InstrProfilingUtil.c | 9 +- compiler-rt/lib/profile/InstrProfilingUtil.h | 4 +- compiler-rt/lib/profile/InstrProfilingValue.c | 2 +- .../lib/profile/InstrProfilingWriter.c | 40 +- .../sanitizer_common/sanitizer_allocator.cpp | 2 +- .../lib/sanitizer_common/sanitizer_common.h | 2 +- .../sanitizer_common_interceptors.inc | 118 +- ...izer_common_interceptors_netbsd_compat.inc | 128 + .../sanitizer_flag_parser.cpp | 11 +- .../sanitizer_common/sanitizer_flag_parser.h | 49 + .../lib/sanitizer_common/sanitizer_flags.cpp | 10 +- .../lib/sanitizer_common/sanitizer_flags.inc | 3 + .../sanitizer_interceptors_ioctl_netbsd.inc | 12 +- .../sanitizer_internal_defs.h | 2 +- .../lib/sanitizer_common/sanitizer_linux.cpp | 12 +- .../sanitizer_linux_libcdep.cpp | 9 +- .../sanitizer_common/sanitizer_linux_s390.cpp | 2 +- .../lib/sanitizer_common/sanitizer_netbsd.cpp | 2 +- .../lib/sanitizer_common/sanitizer_platform.h | 8 +- .../sanitizer_platform_interceptors.h | 21 + .../sanitizer_platform_limits_linux.cpp | 2 +- .../sanitizer_platform_limits_netbsd.cpp | 60 + .../sanitizer_platform_limits_netbsd.h | 23 + .../sanitizer_platform_limits_posix.cpp | 10 +- .../sanitizer_platform_limits_posix.h | 18 +- .../lib/sanitizer_common/sanitizer_posix.h | 2 +- .../sanitizer_stoptheworld_netbsd_libcdep.cpp | 12 +- .../sanitizer_symbolizer_mac.cpp | 22 +- .../sanitizer_syscalls_netbsd.inc | 76 +- .../symbolizer/sanitizer_wrappers.cpp | 9 +- .../lib/scudo/standalone/allocator_config.h | 7 + .../lib/scudo/standalone/atomic_helpers.h | 34 +- compiler-rt/lib/scudo/standalone/bytemap.h | 6 + compiler-rt/lib/scudo/standalone/checksum.cpp | 4 +- compiler-rt/lib/scudo/standalone/checksum.h | 2 +- compiler-rt/lib/scudo/standalone/chunk.h | 24 +- compiler-rt/lib/scudo/standalone/combined.h | 172 +- compiler-rt/lib/scudo/standalone/common.h | 30 +- compiler-rt/lib/scudo/standalone/flags.cpp | 15 + compiler-rt/lib/scudo/standalone/flags.h | 8 + .../lib/scudo/standalone/flags_parser.cpp | 2 +- .../lib/scudo/standalone/flags_parser.h | 2 +- compiler-rt/lib/scudo/standalone/fuchsia.cpp | 4 +- .../lib/scudo/standalone/internal_defs.h | 13 +- compiler-rt/lib/scudo/standalone/list.h | 242 +- compiler-rt/lib/scudo/standalone/platform.h | 6 +- compiler-rt/lib/scudo/standalone/primary32.h | 38 +- compiler-rt/lib/scudo/standalone/primary64.h | 40 +- compiler-rt/lib/scudo/standalone/quarantine.h | 23 +- compiler-rt/lib/scudo/standalone/release.h | 14 +- compiler-rt/lib/scudo/standalone/report.cpp | 2 +- .../lib/scudo/standalone/secondary.cpp | 135 - compiler-rt/lib/scudo/standalone/secondary.h | 172 +- .../lib/scudo/standalone/size_class_map.h | 7 +- compiler-rt/lib/scudo/standalone/stats.h | 35 +- compiler-rt/lib/scudo/standalone/tsd.h | 9 +- .../lib/scudo/standalone/tsd_exclusive.h | 21 +- compiler-rt/lib/scudo/standalone/tsd_shared.h | 25 +- compiler-rt/lib/scudo/standalone/vector.h | 3 +- .../lib/scudo/standalone/wrappers_c.cpp | 19 +- .../lib/scudo/standalone/wrappers_c.inc | 21 +- .../scudo/standalone/wrappers_c_bionic.cpp | 30 +- .../lib/scudo/standalone/wrappers_c_checks.h | 10 +- .../lib/scudo/standalone/wrappers_cpp.cpp | 3 +- compiler-rt/lib/tsan/rtl/tsan_mman.cpp | 15 +- .../lib/tsan/rtl/tsan_platform_mac.cpp | 7 +- libcxx/CREDITS.TXT | 4 + libcxx/include/__bit_reference | 26 +- libcxx/include/__config | 47 +- libcxx/include/__debug | 1 - libcxx/include/__functional_03 | 8 +- libcxx/include/__hash_table | 26 +- libcxx/include/__mutex_base | 9 - libcxx/include/__split_buffer | 40 +- libcxx/include/__string | 180 +- libcxx/include/__threading_support | 241 +- libcxx/include/__tree | 17 +- libcxx/include/algorithm | 84 +- libcxx/include/bit | 4 +- libcxx/include/chrono | 10 +- libcxx/include/cstdlib | 2 +- libcxx/include/ctime | 6 +- libcxx/include/deque | 88 +- libcxx/include/experimental/functional | 78 +- libcxx/include/experimental/iterator | 12 +- libcxx/include/experimental/propagate_const | 1 - libcxx/include/experimental/type_traits | 6 +- libcxx/include/ext/hash_map | 9 +- libcxx/include/filesystem | 6 +- libcxx/include/forward_list | 24 +- libcxx/include/future | 16 +- libcxx/include/iterator | 98 +- libcxx/include/list | 20 +- libcxx/include/math.h | 4 + libcxx/include/memory | 161 +- libcxx/include/mutex | 2 +- libcxx/include/numeric | 19 +- libcxx/include/queue | 2 +- libcxx/include/random | 47 +- libcxx/include/regex | 40 +- libcxx/include/span | 72 +- libcxx/include/string | 174 +- libcxx/include/thread | 1 + libcxx/include/tuple | 24 +- libcxx/include/type_traits | 18 +- libcxx/include/valarray | 26 +- libcxx/include/vector | 136 +- libcxx/include/version | 2 + libcxx/src/algorithm.cpp | 2 +- libcxx/src/chrono.cpp | 4 +- libcxx/src/condition_variable.cpp | 2 +- libcxx/src/debug.cpp | 2 +- libcxx/src/experimental/memory_resource.cpp | 2 +- libcxx/src/filesystem/operations.cpp | 4 +- libcxx/src/locale.cpp | 4 +- libcxx/src/memory.cpp | 2 +- libcxx/src/mutex.cpp | 2 +- libcxx/src/mutex_destructor.cpp | 1 - libcxx/src/regex.cpp | 2 + libcxx/src/shared_mutex.cpp | 2 +- libcxx/src/thread.cpp | 4 +- libunwind/include/__libunwind_config.h | 11 + libunwind/include/libunwind.h | 71 + libunwind/src/AddressSpace.hpp | 8 +- libunwind/src/DwarfInstructions.hpp | 9 +- libunwind/src/RWMutex.hpp | 2 +- libunwind/src/Registers.hpp | 265 ++ libunwind/src/UnwindCursor.hpp | 20 +- libunwind/src/UnwindLevel1-gcc-ext.c | 9 +- libunwind/src/UnwindRegistersRestore.S | 81 + libunwind/src/UnwindRegistersSave.S | 80 + libunwind/src/config.h | 3 +- libunwind/src/libunwind.cpp | 2 + lld/COFF/Chunks.h | 6 +- lld/COFF/Config.h | 4 + lld/COFF/DebugTypes.cpp | 17 +- lld/COFF/Driver.cpp | 56 +- lld/COFF/DriverUtils.cpp | 10 +- lld/COFF/InputFiles.cpp | 16 +- lld/COFF/InputFiles.h | 16 +- lld/COFF/MinGW.h | 1 + lld/COFF/Options.td | 8 +- lld/COFF/PDB.cpp | 97 +- lld/COFF/SymbolTable.cpp | 17 +- lld/COFF/Symbols.h | 1 + lld/COFF/Writer.cpp | 12 +- lld/Common/ErrorHandler.cpp | 42 +- lld/Common/Filesystem.cpp | 2 +- lld/ELF/AArch64ErrataFix.cpp | 8 +- lld/ELF/ARMErrataFix.cpp | 8 +- lld/ELF/Arch/AArch64.cpp | 39 +- lld/ELF/Arch/ARM.cpp | 26 +- lld/ELF/Arch/Hexagon.cpp | 47 +- lld/ELF/Arch/Mips.cpp | 27 +- lld/ELF/Arch/PPC.cpp | 20 +- lld/ELF/Arch/PPC64.cpp | 35 +- lld/ELF/Arch/RISCV.cpp | 49 +- lld/ELF/Arch/SPARCV9.cpp | 11 +- lld/ELF/Arch/X86.cpp | 121 +- lld/ELF/Arch/X86_64.cpp | 109 +- lld/ELF/CallGraphSort.cpp | 8 +- lld/ELF/Config.h | 11 +- lld/ELF/Driver.cpp | 114 +- lld/ELF/DriverUtils.cpp | 16 +- lld/ELF/ICF.cpp | 15 +- lld/ELF/InputFiles.cpp | 70 +- lld/ELF/InputFiles.h | 3 +- lld/ELF/InputSection.cpp | 23 +- lld/ELF/InputSection.h | 4 + lld/ELF/LTO.cpp | 7 +- lld/ELF/LinkerScript.cpp | 4 +- lld/ELF/LinkerScript.h | 2 +- lld/ELF/MapFile.cpp | 4 +- lld/ELF/MarkLive.cpp | 25 +- lld/ELF/Options.td | 26 +- lld/ELF/OutputSections.cpp | 37 +- lld/ELF/Relocations.cpp | 180 +- lld/ELF/Relocations.h | 18 +- lld/ELF/SymbolTable.cpp | 2 +- lld/ELF/SymbolTable.h | 16 +- lld/ELF/Symbols.cpp | 75 +- lld/ELF/Symbols.h | 38 +- lld/ELF/SyntheticSections.cpp | 241 +- lld/ELF/SyntheticSections.h | 68 +- lld/ELF/Target.cpp | 21 +- lld/ELF/Target.h | 20 +- lld/ELF/Thunks.cpp | 117 +- lld/ELF/Thunks.h | 12 +- lld/ELF/Writer.cpp | 94 +- lld/docs/Driver.rst | 4 +- lld/docs/NewLLD.rst | 2 +- lld/docs/WebAssembly.rst | 26 +- lld/docs/conf.py | 2 +- lld/docs/index.rst | 2 +- lld/docs/ld.lld.1 | 33 +- lld/docs/windows_support.rst | 2 +- lld/include/lld/Common/Driver.h | 12 +- lld/include/lld/Common/ErrorHandler.h | 14 +- lld/include/lld/Common/LLVM.h | 3 + lld/include/lld/Core/Atom.h | 2 +- lld/include/lld/Core/Error.h | 4 +- lld/include/lld/Core/Instrumentation.h | 2 +- lld/include/lld/Core/Reference.h | 2 +- lld/include/lld/Core/UndefinedAtom.h | 2 +- .../lld/ReaderWriter/MachOLinkingContext.h | 2 +- lld/lib/Core/Resolver.cpp | 11 +- lld/lib/Core/SymbolTable.cpp | 18 +- lld/lib/Driver/DarwinLdDriver.cpp | 31 +- .../ReaderWriter/MachO/CompactUnwindPass.cpp | 2 +- lld/lib/ReaderWriter/MachO/File.h | 2 +- lld/lib/ReaderWriter/MachO/GOTPass.cpp | 2 +- lld/lib/ReaderWriter/MachO/LayoutPass.cpp | 4 +- .../MachO/MachOLinkingContext.cpp | 2 +- .../MachO/MachONormalizedFileBinaryWriter.cpp | 4 +- .../MachO/MachONormalizedFileFromAtoms.cpp | 2 +- .../MachO/MachONormalizedFileToAtoms.cpp | 14 +- .../ReaderWriter/YAML/ReaderWriterYAML.cpp | 4 +- lld/tools/lld/lld.cpp | 12 +- lldb/docs/lldb.1 | 154 - lldb/docs/man/lldb.rst | 323 ++ lldb/include/lldb/API/SBBreakpoint.h | 3 + lldb/include/lldb/API/SBBreakpointLocation.h | 7 +- lldb/include/lldb/API/SBBreakpointName.h | 7 +- lldb/include/lldb/API/SBReproducer.h | 3 + lldb/include/lldb/API/SBStructuredData.h | 3 + lldb/include/lldb/API/SBValue.h | 2 - lldb/include/lldb/Breakpoint/Breakpoint.h | 20 +- lldb/include/lldb/Breakpoint/BreakpointID.h | 2 +- lldb/include/lldb/Breakpoint/BreakpointList.h | 8 +- .../lldb/Breakpoint/BreakpointLocation.h | 5 +- .../Breakpoint/BreakpointLocationCollection.h | 12 +- .../lldb/Breakpoint/BreakpointLocationList.h | 12 +- .../lldb/Breakpoint/BreakpointOptions.h | 30 +- .../lldb/Breakpoint/BreakpointResolver.h | 5 +- lldb/include/lldb/Breakpoint/BreakpointSite.h | 11 +- lldb/include/lldb/Breakpoint/Watchpoint.h | 5 - lldb/include/lldb/Breakpoint/WatchpointList.h | 2 +- .../lldb/Breakpoint/WatchpointOptions.h | 3 +- lldb/include/lldb/Core/Address.h | 84 +- lldb/include/lldb/Core/AddressRange.h | 5 +- lldb/include/lldb/Core/ClangForward.h | 1 - lldb/include/lldb/Core/Debugger.h | 7 +- lldb/include/lldb/Core/Disassembler.h | 7 +- lldb/include/lldb/Core/FormatEntity.h | 1 + lldb/include/lldb/Core/Highlighter.h | 3 +- lldb/include/lldb/Core/IOHandler.h | 49 +- lldb/include/lldb/Core/IOHandlerCursesGUI.h | 40 + lldb/include/lldb/Core/Mangled.h | 15 +- lldb/include/lldb/Core/Module.h | 19 +- lldb/include/lldb/Core/ModuleChild.h | 11 +- lldb/include/lldb/Core/ModuleList.h | 59 +- lldb/include/lldb/Core/ModuleSpec.h | 28 +- lldb/include/lldb/Core/PropertiesBase.td | 2 + lldb/include/lldb/Core/STLUtils.h | 74 - lldb/include/lldb/Core/SearchFilter.h | 23 +- lldb/include/lldb/Core/SourceManager.h | 2 - lldb/include/lldb/Core/StreamFile.h | 6 - lldb/include/lldb/Core/ThreadSafeDenseMap.h | 2 +- lldb/include/lldb/Core/ThreadSafeSTLMap.h | 128 - lldb/include/lldb/Core/ThreadSafeSTLVector.h | 72 - lldb/include/lldb/Core/ValueObject.h | 18 +- .../lldb/Core/ValueObjectSyntheticFilter.h | 15 +- .../lldb/DataFormatters/DataVisualization.h | 6 - .../include/lldb/DataFormatters/FormatCache.h | 57 +- .../lldb/DataFormatters/FormatClasses.h | 2 - .../lldb/DataFormatters/FormatManager.h | 34 +- .../lldb/DataFormatters/FormattersContainer.h | 1 - .../lldb/DataFormatters/LanguageCategory.h | 28 +- .../lldb/DataFormatters/TypeCategory.h | 68 +- .../lldb/DataFormatters/TypeCategoryMap.h | 9 +- .../lldb/DataFormatters/TypeValidator.h | 201 - .../lldb/DataFormatters/ValueObjectPrinter.h | 7 - .../include/lldb/Expression/DWARFExpression.h | 76 +- lldb/include/lldb/Expression/Expression.h | 28 +- .../lldb/Expression/ExpressionParser.h | 13 +- .../lldb/Expression/ExpressionSourceCode.h | 1 + .../lldb/Expression/ExpressionVariable.h | 4 +- lldb/include/lldb/Expression/FunctionCaller.h | 25 +- .../include/lldb/Expression/IRExecutionUnit.h | 25 +- .../lldb/Expression/LLVMUserExpression.h | 14 +- lldb/include/lldb/Expression/REPL.h | 2 +- lldb/include/lldb/Expression/UserExpression.h | 28 +- .../include/lldb/Expression/UtilityFunction.h | 21 +- lldb/include/lldb/Host/Config.h.cmake | 23 +- lldb/include/lldb/Host/Editline.h | 17 +- lldb/include/lldb/Host/File.h | 6 +- lldb/include/lldb/Host/HostInfoBase.h | 11 +- lldb/include/lldb/Host/HostProcess.h | 1 - lldb/include/lldb/Host/PseudoTerminal.h | 20 +- lldb/include/lldb/Host/SocketAddress.h | 2 - lldb/include/lldb/Host/Terminal.h | 2 +- lldb/include/lldb/Host/XML.h | 6 +- .../lldb/Interpreter/CommandInterpreter.h | 13 +- lldb/include/lldb/Interpreter/CommandObject.h | 8 +- .../lldb/Interpreter/CommandReturnObject.h | 1 - .../OptionGroupPythonClassWithDict.h | 20 +- lldb/include/lldb/Interpreter/OptionValue.h | 20 +- .../lldb/Interpreter/OptionValueProperties.h | 3 +- lldb/include/lldb/Interpreter/Options.h | 4 +- lldb/include/lldb/Interpreter/Property.h | 3 +- .../lldb/Interpreter/ScriptInterpreter.h | 37 +- lldb/include/lldb/Symbol/Block.h | 26 +- lldb/include/lldb/Symbol/ClangASTContext.h | 299 +- lldb/include/lldb/Symbol/ClangASTImporter.h | 109 +- ...alASTSourceCommon.h => ClangASTMetadata.h} | 51 +- .../Symbol/ClangExternalASTSourceCallbacks.h | 108 +- lldb/include/lldb/Symbol/ClangUtil.h | 10 + lldb/include/lldb/Symbol/CompileUnit.h | 53 +- lldb/include/lldb/Symbol/CompilerDecl.h | 24 +- .../include/lldb/Symbol/CompilerDeclContext.h | 32 +- lldb/include/lldb/Symbol/CompilerType.h | 53 +- lldb/include/lldb/Symbol/DebugMacros.h | 8 +- lldb/include/lldb/Symbol/Declaration.h | 16 +- lldb/include/lldb/Symbol/Function.h | 108 +- lldb/include/lldb/Symbol/LineEntry.h | 17 +- lldb/include/lldb/Symbol/LineTable.h | 14 +- lldb/include/lldb/Symbol/ObjectFile.h | 17 +- lldb/include/lldb/Symbol/Symbol.h | 4 +- lldb/include/lldb/Symbol/SymbolContext.h | 31 +- lldb/include/lldb/Symbol/SymbolFile.h | 55 +- lldb/include/lldb/Symbol/Symtab.h | 32 +- lldb/include/lldb/Symbol/Type.h | 42 +- lldb/include/lldb/Symbol/TypeSystem.h | 68 +- lldb/include/lldb/Symbol/VariableList.h | 10 +- lldb/include/lldb/Target/ABI.h | 11 +- lldb/include/lldb/Target/Language.h | 3 - lldb/include/lldb/Target/MemoryRegionInfo.h | 48 +- lldb/include/lldb/Target/Platform.h | 7 +- lldb/include/lldb/Target/Process.h | 35 +- lldb/include/lldb/Target/Queue.h | 5 +- lldb/include/lldb/Target/StackFrame.h | 14 +- lldb/include/lldb/Target/Target.h | 37 +- lldb/include/lldb/Target/TargetList.h | 6 +- lldb/include/lldb/Target/Thread.h | 16 +- lldb/include/lldb/Target/ThreadPlanStepOut.h | 1 + .../include/lldb/Target/ThreadPlanStepRange.h | 6 + lldb/include/lldb/Utility/ArchSpec.h | 11 +- lldb/include/lldb/Utility/Args.h | 29 - lldb/include/lldb/Utility/Baton.h | 13 +- lldb/include/lldb/Utility/Broadcaster.h | 1 - lldb/include/lldb/Utility/Connection.h | 2 +- lldb/include/lldb/Utility/ConstString.h | 20 +- lldb/include/lldb/Utility/DataEncoder.h | 171 +- lldb/include/lldb/Utility/DataExtractor.h | 7 +- lldb/include/lldb/Utility/FileSpec.h | 31 +- lldb/include/lldb/Utility/Flags.h | 11 - lldb/include/lldb/Utility/GDBRemote.h | 43 +- lldb/include/lldb/Utility/Log.h | 2 +- lldb/include/lldb/Utility/RangeMap.h | 35 +- lldb/include/lldb/Utility/Reproducer.h | 107 +- lldb/include/lldb/Utility/Scalar.h | 1 - lldb/include/lldb/Utility/Status.h | 2 - lldb/include/lldb/Utility/Stream.h | 188 +- .../lldb/Utility/StringExtractorGDBRemote.h | 5 - lldb/include/lldb/Utility/VMRange.h | 7 +- lldb/include/lldb/lldb-enumerations.h | 10 +- lldb/include/lldb/lldb-forward.h | 2 - lldb/include/lldb/lldb-private-interfaces.h | 2 - lldb/source/API/SBBreakpoint.cpp | 32 +- lldb/source/API/SBBreakpointLocation.cpp | 31 +- lldb/source/API/SBBreakpointName.cpp | 35 +- lldb/source/API/SBCompileUnit.cpp | 4 +- lldb/source/API/SBDebugger.cpp | 54 +- lldb/source/API/SBEvent.cpp | 2 +- lldb/source/API/SBFile.cpp | 11 +- lldb/source/API/SBFileSpec.cpp | 2 +- lldb/source/API/SBFrame.cpp | 4 +- lldb/source/API/SBHostOS.cpp | 7 +- lldb/source/API/SBModule.cpp | 18 +- lldb/source/API/SBReproducer.cpp | 40 +- lldb/source/API/SBTarget.cpp | 35 +- lldb/source/API/SBThread.cpp | 9 +- lldb/source/API/SBType.cpp | 6 +- lldb/source/API/SBValue.cpp | 20 - lldb/source/API/SystemInitializerFull.cpp | 18 +- lldb/source/Breakpoint/Breakpoint.cpp | 3 +- lldb/source/Breakpoint/BreakpointList.cpp | 18 +- lldb/source/Breakpoint/BreakpointLocation.cpp | 4 +- lldb/source/Breakpoint/BreakpointOptions.cpp | 37 +- .../BreakpointResolverFileRegex.cpp | 2 +- lldb/source/Breakpoint/WatchpointOptions.cpp | 28 +- lldb/source/Commands/CommandCompletions.cpp | 21 +- lldb/source/Commands/CommandObjectApropos.cpp | 1 - .../Commands/CommandObjectBreakpoint.cpp | 307 +- .../source/Commands/CommandObjectBreakpoint.h | 29 +- .../CommandObjectBreakpointCommand.cpp | 105 +- .../Commands/CommandObjectBreakpointCommand.h | 6 - .../source/Commands/CommandObjectCommands.cpp | 53 +- lldb/source/Commands/CommandObjectCommands.h | 2 - .../Commands/CommandObjectDisassemble.cpp | 8 +- .../Commands/CommandObjectExpression.cpp | 114 +- .../source/Commands/CommandObjectExpression.h | 1 - lldb/source/Commands/CommandObjectFrame.cpp | 114 +- lldb/source/Commands/CommandObjectFrame.h | 1 - lldb/source/Commands/CommandObjectGUI.cpp | 5 +- lldb/source/Commands/CommandObjectHelp.cpp | 16 +- .../source/Commands/CommandObjectLanguage.cpp | 4 - lldb/source/Commands/CommandObjectLanguage.h | 3 - lldb/source/Commands/CommandObjectLog.cpp | 10 - lldb/source/Commands/CommandObjectLog.h | 2 - lldb/source/Commands/CommandObjectMemory.cpp | 36 +- .../Commands/CommandObjectMultiword.cpp | 1 - .../source/Commands/CommandObjectPlatform.cpp | 7 +- lldb/source/Commands/CommandObjectPlatform.h | 1 - lldb/source/Commands/CommandObjectPlugin.cpp | 1 - lldb/source/Commands/CommandObjectPlugin.h | 3 - lldb/source/Commands/CommandObjectProcess.cpp | 11 +- .../source/Commands/CommandObjectRegister.cpp | 2 - .../Commands/CommandObjectReproducer.cpp | 178 +- .../source/Commands/CommandObjectReproducer.h | 1 - .../source/Commands/CommandObjectSettings.cpp | 31 +- lldb/source/Commands/CommandObjectSettings.h | 2 - lldb/source/Commands/CommandObjectSource.cpp | 82 +- lldb/source/Commands/CommandObjectSource.h | 2 - lldb/source/Commands/CommandObjectStats.cpp | 5 +- lldb/source/Commands/CommandObjectStats.h | 1 - lldb/source/Commands/CommandObjectTarget.cpp | 489 +- lldb/source/Commands/CommandObjectTarget.h | 1 - lldb/source/Commands/CommandObjectThread.cpp | 81 +- lldb/source/Commands/CommandObjectType.cpp | 69 +- lldb/source/Commands/CommandObjectType.h | 4 - lldb/source/Commands/CommandObjectVersion.cpp | 1 - .../Commands/CommandObjectWatchpoint.cpp | 87 +- .../source/Commands/CommandObjectWatchpoint.h | 2 - .../CommandObjectWatchpointCommand.cpp | 51 +- .../Commands/CommandObjectWatchpointCommand.h | 4 - lldb/source/Commands/Options.td | 22 +- lldb/source/Core/Address.cpp | 25 +- lldb/source/Core/AddressRange.cpp | 6 +- lldb/source/Core/AddressResolverFileLine.cpp | 7 +- lldb/source/Core/Debugger.cpp | 22 +- lldb/source/Core/Disassembler.cpp | 11 +- lldb/source/Core/DumpDataExtractor.cpp | 7 +- lldb/source/Core/FileLineResolver.cpp | 4 +- lldb/source/Core/FileSpecList.cpp | 2 +- lldb/source/Core/FormatEntity.cpp | 50 +- lldb/source/Core/IOHandler.cpp | 4051 +--------------- lldb/source/Core/IOHandlerCursesGUI.cpp | 4067 +++++++++++++++++ lldb/source/Core/Mangled.cpp | 38 +- lldb/source/Core/Module.cpp | 54 +- lldb/source/Core/ModuleList.cpp | 7 +- lldb/source/Core/PluginManager.cpp | 2 +- lldb/source/Core/SearchFilter.cpp | 374 +- lldb/source/Core/Section.cpp | 31 +- lldb/source/Core/SourceManager.cpp | 18 +- lldb/source/Core/StreamFile.cpp | 17 - lldb/source/Core/Value.cpp | 15 +- lldb/source/Core/ValueObject.cpp | 121 +- .../Core/ValueObjectSyntheticFilter.cpp | 49 +- lldb/source/Core/ValueObjectVariable.cpp | 45 - .../DataFormatters/DataVisualization.cpp | 14 +- lldb/source/DataFormatters/FormatCache.cpp | 176 +- lldb/source/DataFormatters/FormatClasses.cpp | 3 +- lldb/source/DataFormatters/FormatManager.cpp | 397 +- .../DataFormatters/LanguageCategory.cpp | 186 +- lldb/source/DataFormatters/TypeCategory.cpp | 123 +- .../source/DataFormatters/TypeCategoryMap.cpp | 157 +- lldb/source/DataFormatters/TypeValidator.cpp | 53 - .../DataFormatters/ValueObjectPrinter.cpp | 38 - lldb/source/Expression/DWARFExpression.cpp | 421 +- lldb/source/Expression/Expression.cpp | 10 +- lldb/source/Expression/FunctionCaller.cpp | 6 +- lldb/source/Expression/IRExecutionUnit.cpp | 67 +- lldb/source/Expression/IRInterpreter.cpp | 166 +- lldb/source/Expression/IRMemoryMap.cpp | 12 +- lldb/source/Expression/LLVMUserExpression.cpp | 338 +- lldb/source/Expression/REPL.cpp | 2 + lldb/source/Expression/UserExpression.cpp | 19 +- lldb/source/Expression/UtilityFunction.cpp | 11 +- lldb/source/Host/common/Editline.cpp | 111 +- lldb/source/Host/common/File.cpp | 2 +- lldb/source/Host/common/Host.cpp | 19 +- lldb/source/Host/common/HostInfoBase.cpp | 95 +- lldb/source/Host/common/MainLoop.cpp | 1 + .../Host/common/NativeProcessProtocol.cpp | 4 +- lldb/source/Host/common/PseudoTerminal.cpp | 4 +- lldb/source/Host/common/Socket.cpp | 4 +- lldb/source/Host/common/SocketAddress.cpp | 6 - lldb/source/Host/common/TCPSocket.cpp | 12 +- lldb/source/Host/common/Terminal.cpp | 32 +- lldb/source/Host/common/UDPSocket.cpp | 2 +- lldb/source/Host/common/XML.cpp | 59 +- lldb/source/Host/netbsd/Host.cpp | 1 + .../posix/ConnectionFileDescriptorPosix.cpp | 4 +- .../{FileSystem.cpp => FileSystemPosix.cpp} | 0 lldb/source/Host/posix/PipePosix.cpp | 9 +- .../source/Interpreter/CommandInterpreter.cpp | 52 +- .../Interpreter/CommandObjectScript.cpp | 19 +- lldb/source/Interpreter/OptionArgParser.cpp | 2 + .../OptionGroupPythonClassWithDict.cpp | 62 +- .../OptionGroupValueObjectDisplay.cpp | 2 +- .../Interpreter/OptionValueFileSpecList.cpp | 2 +- .../Interpreter/OptionValueProperties.cpp | 4 +- lldb/source/Interpreter/Property.cpp | 5 +- lldb/source/Interpreter/ScriptInterpreter.cpp | 43 +- .../ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp | 2 + .../Disassembler/llvm/DisassemblerLLVMC.cpp | 12 +- .../ExpressionParser/Clang/ASTDumper.cpp | 104 - .../ExpressionParser/Clang/ASTDumper.h | 40 - .../Clang/ASTResultSynthesizer.cpp | 20 +- .../Clang/ASTResultSynthesizer.h | 9 +- .../Clang/ASTStructExtractor.cpp | 6 +- .../Clang/ASTStructExtractor.h | 2 - .../ExpressionParser/Clang/ClangASTSource.cpp | 403 +- .../ExpressionParser/Clang/ClangASTSource.h | 118 +- .../Clang/ClangDeclVendor.cpp | 14 +- .../ExpressionParser/Clang/ClangDeclVendor.h | 15 +- .../Clang/ClangExpressionDeclMap.cpp | 1692 ++++--- .../Clang/ClangExpressionDeclMap.h | 188 +- .../Clang/ClangExpressionParser.cpp | 41 +- .../Clang/ClangExpressionParser.h | 13 +- .../Clang/ClangExpressionSourceCode.cpp | 10 +- .../Clang/ClangExpressionVariable.h | 3 - .../Clang/ClangFunctionCaller.cpp | 10 +- .../Clang/ClangFunctionCaller.h | 20 +- .../Clang/ClangModulesDeclVendor.cpp | 20 +- .../Clang/ClangPersistentVariables.cpp | 38 +- .../Clang/ClangPersistentVariables.h | 12 +- .../Clang/ClangUserExpression.cpp | 57 +- .../Clang/ClangUserExpression.h | 11 +- .../Clang/ClangUtilityFunction.cpp | 10 +- .../Clang/ClangUtilityFunction.h | 9 +- .../ExpressionParser/Clang/IRDynamicChecks.h | 4 - .../ExpressionParser/Clang/IRForTarget.cpp | 2 +- .../ExpressionParser/Clang/IRForTarget.h | 74 +- .../Instruction/ARM/EmulateInstructionARM.cpp | 8 +- .../MIPS/EmulateInstructionMIPS.cpp | 23 +- .../MIPS64/EmulateInstructionMIPS64.cpp | 13 +- .../MainThreadCheckerRuntime.cpp | 14 +- .../UBSan/UBSanRuntime.cpp | 2 +- .../Language/CPlusPlus/CPlusPlusLanguage.cpp | 152 +- .../Language/CPlusPlus/CPlusPlusLanguage.h | 2 +- .../Plugins/Language/CPlusPlus/LibCxx.cpp | 11 +- .../Plugins/Language/CPlusPlus/LibCxxMap.cpp | 2 + .../Language/ClangCommon/ClangHighlighter.cpp | 19 + lldb/source/Plugins/Language/ObjC/Cocoa.cpp | 58 +- lldb/source/Plugins/Language/ObjC/NSArray.cpp | 58 +- .../Plugins/Language/ObjC/NSDictionary.cpp | 2 +- lldb/source/Plugins/Language/ObjC/NSError.cpp | 12 +- .../Plugins/Language/ObjC/NSException.cpp | 26 +- .../Plugins/Language/ObjC/NSIndexPath.cpp | 5 +- .../source/Plugins/Language/ObjC/NSString.cpp | 2 +- .../Plugins/Language/ObjC/ObjCLanguage.cpp | 3 +- .../CPlusPlus/CPPLanguageRuntime.cpp | 203 +- .../CPlusPlus/CPPLanguageRuntime.h | 8 + .../ItaniumABI/ItaniumABILanguageRuntime.cpp | 8 +- .../AppleObjCClassDescriptorV2.cpp | 12 + .../AppleObjCRuntime/AppleObjCDeclVendor.cpp | 155 +- .../AppleObjCRuntime/AppleObjCDeclVendor.h | 4 +- .../AppleObjCRuntime/AppleObjCRuntime.cpp | 16 +- .../AppleObjCRuntime/AppleObjCRuntimeV2.cpp | 56 +- .../AppleObjCRuntime/AppleObjCRuntimeV2.h | 2 - .../AppleObjCTrampolineHandler.cpp | 15 +- .../AppleObjCTypeEncodingParser.cpp | 69 +- .../AppleObjCTypeEncodingParser.h | 20 +- .../ObjC/ObjCLanguageRuntime.cpp | 16 - .../ObjC/ObjCLanguageRuntime.h | 7 +- .../RenderScriptRuntime.cpp | 5 +- .../RenderScriptx86ABIFixups.cpp | 2 +- .../ObjectFile/Breakpad/BreakpadRecords.cpp | 2 +- .../Plugins/ObjectFile/ELF/ObjectFileELF.cpp | 9 +- .../Python/OperatingSystemPython.cpp | 17 +- .../Python/OperatingSystemPython.h | 6 +- .../Platform/FreeBSD/PlatformFreeBSD.cpp | 4 +- .../Platform/NetBSD/PlatformNetBSD.cpp | 4 +- .../Platform/OpenBSD/PlatformOpenBSD.cpp | 4 +- .../Plugins/Platform/POSIX/PlatformPOSIX.cpp | 24 +- .../Process/NetBSD/NativeProcessNetBSD.cpp | 339 +- .../Process/NetBSD/NativeProcessNetBSD.h | 3 + .../NetBSD/NativeRegisterContextNetBSD.cpp | 2 + .../NetBSD/NativeRegisterContextNetBSD.h | 7 +- .../NativeRegisterContextNetBSD_x86_64.cpp | 138 +- .../NativeRegisterContextNetBSD_x86_64.h | 7 +- .../Process/NetBSD/NativeThreadNetBSD.cpp | 108 +- .../Process/NetBSD/NativeThreadNetBSD.h | 13 +- .../Plugins/Process/POSIX/CrashReason.cpp | 8 +- .../Process/Utility/InferiorCallPOSIX.cpp | 2 +- .../Utility/RegisterContextDarwin_arm.cpp | 11 +- .../Utility/RegisterContextDarwin_arm64.cpp | 6 - .../Utility/RegisterContextDarwin_i386.cpp | 6 - .../Utility/RegisterContextDarwin_x86_64.cpp | 6 - .../Process/Utility/RegisterInfos_x86_64.h | 7 +- .../Process/Utility/lldb-x86-register-enums.h | 5 +- .../gdb-remote/GDBRemoteCommunication.cpp | 10 +- .../gdb-remote/GDBRemoteCommunication.h | 6 +- .../GDBRemoteCommunicationClient.cpp | 31 +- .../gdb-remote/GDBRemoteCommunicationClient.h | 6 +- .../GDBRemoteCommunicationHistory.cpp | 8 +- .../GDBRemoteCommunicationHistory.h | 8 +- .../GDBRemoteCommunicationReplayServer.cpp | 15 +- .../GDBRemoteCommunicationServerCommon.cpp | 4 +- .../GDBRemoteCommunicationServerLLGS.cpp | 14 +- .../gdb-remote/GDBRemoteRegisterContext.cpp | 23 +- .../gdb-remote/GDBRemoteRegisterContext.h | 3 +- .../Process/gdb-remote/ProcessGDBRemote.cpp | 106 +- .../Process/gdb-remote/ProcessGDBRemote.h | 1 + .../gdb-remote/ProcessGDBRemoteProperties.td | 4 + .../Process/gdb-remote/ThreadGDBRemote.cpp | 9 +- .../Process/minidump/MinidumpParser.cpp | 73 +- .../Plugins/Process/minidump/MinidumpParser.h | 10 +- .../Process/minidump/ProcessMinidump.cpp | 79 +- .../Process/minidump/ProcessMinidump.h | 3 + .../Plugins/ScriptInterpreter/Lua/Lua.cpp | 59 + .../Plugins/ScriptInterpreter/Lua/Lua.h | 48 + .../Lua/ScriptInterpreterLua.cpp | 157 + .../Lua/ScriptInterpreterLua.h | 61 + .../Python/PythonDataObjects.cpp | 110 +- .../Python/PythonDataObjects.h | 44 +- .../Python/PythonReadline.cpp | 88 + .../ScriptInterpreter/Python/PythonReadline.h | 28 + .../Python/ScriptInterpreterPython.cpp | 190 +- .../Python/ScriptInterpreterPython.h | 16 +- .../Python/ScriptInterpreterPythonImpl.h | 28 +- .../ScriptInterpreter/Python/lldb-python.h | 8 +- .../Breakpad/SymbolFileBreakpad.cpp | 9 +- .../SymbolFile/Breakpad/SymbolFileBreakpad.h | 12 + .../SymbolFile/DWARF/DWARFASTParserClang.cpp | 3284 +++++++------ .../SymbolFile/DWARF/DWARFASTParserClang.h | 69 +- .../SymbolFile/DWARF/DWARFCompileUnit.h | 4 +- .../Plugins/SymbolFile/DWARF/DWARFContext.cpp | 14 +- .../Plugins/SymbolFile/DWARF/DWARFContext.h | 8 +- .../Plugins/SymbolFile/DWARF/DWARFDIE.cpp | 33 - .../Plugins/SymbolFile/DWARF/DWARFDIE.h | 4 - .../Plugins/SymbolFile/DWARF/DWARFDebugInfo.h | 6 - .../SymbolFile/DWARF/DWARFDebugInfoEntry.cpp | 42 +- .../SymbolFile/DWARF/DWARFDebugInfoEntry.h | 10 +- .../SymbolFile/DWARF/DWARFDebugRanges.cpp | 167 +- .../SymbolFile/DWARF/DWARFDebugRanges.h | 38 +- .../SymbolFile/DWARF/DWARFDeclContext.h | 2 +- .../SymbolFile/DWARF/DWARFFormValue.cpp | 107 +- .../Plugins/SymbolFile/DWARF/DWARFTypeUnit.h | 4 +- .../Plugins/SymbolFile/DWARF/DWARFUnit.cpp | 204 +- .../Plugins/SymbolFile/DWARF/DWARFUnit.h | 49 +- .../SymbolFile/DWARF/ManualDWARFIndex.cpp | 2 - .../SymbolFile/DWARF/SymbolFileDWARF.cpp | 487 +- .../SymbolFile/DWARF/SymbolFileDWARF.h | 39 +- .../DWARF/SymbolFileDWARFDebugMap.cpp | 33 +- .../DWARF/SymbolFileDWARFDebugMap.h | 28 +- .../SymbolFile/DWARF/SymbolFileDWARFDwo.cpp | 7 +- .../SymbolFile/DWARF/SymbolFileDWARFDwo.h | 20 +- .../DWARF/SymbolFileDWARFDwoDwp.cpp | 2 + .../SymbolFile/DWARF/SymbolFileDWARFDwoDwp.h | 10 + .../SymbolFile/NativePDB/PdbAstBuilder.cpp | 25 +- .../NativePDB/SymbolFileNativePDB.cpp | 42 +- .../NativePDB/SymbolFileNativePDB.h | 12 + .../NativePDB/UdtRecordCompleter.cpp | 2 +- .../Plugins/SymbolFile/PDB/PDBASTParser.cpp | 77 +- .../Plugins/SymbolFile/PDB/SymbolFilePDB.cpp | 25 +- .../Plugins/SymbolFile/PDB/SymbolFilePDB.h | 12 + .../SymbolFile/Symtab/SymbolFileSymtab.cpp | 2 + .../SymbolFile/Symtab/SymbolFileSymtab.h | 11 + .../SymbolVendor/ELF/SymbolVendorELF.cpp | 19 +- lldb/source/Symbol/Block.cpp | 19 +- lldb/source/Symbol/ClangASTContext.cpp | 3298 +++++-------- lldb/source/Symbol/ClangASTImporter.cpp | 240 +- lldb/source/Symbol/ClangASTMetadata.cpp | 35 + .../ClangExternalASTSourceCallbacks.cpp | 70 +- .../Symbol/ClangExternalASTSourceCommon.cpp | 99 - lldb/source/Symbol/ClangUtil.cpp | 25 + lldb/source/Symbol/CompileUnit.cpp | 233 +- lldb/source/Symbol/CompilerDecl.cpp | 4 - lldb/source/Symbol/CompilerDeclContext.cpp | 23 +- lldb/source/Symbol/CompilerType.cpp | 179 +- lldb/source/Symbol/Declaration.cpp | 9 +- lldb/source/Symbol/FuncUnwinders.cpp | 2 + lldb/source/Symbol/Function.cpp | 106 +- lldb/source/Symbol/LineEntry.cpp | 2 +- lldb/source/Symbol/LineTable.cpp | 8 +- lldb/source/Symbol/LocateSymbolFile.cpp | 6 +- lldb/source/Symbol/LocateSymbolFileMacOSX.cpp | 2 +- lldb/source/Symbol/ObjectFile.cpp | 3 + lldb/source/Symbol/Symbol.cpp | 5 +- lldb/source/Symbol/SymbolContext.cpp | 43 +- lldb/source/Symbol/SymbolFile.cpp | 6 +- lldb/source/Symbol/Symtab.cpp | 39 +- lldb/source/Symbol/Type.cpp | 80 +- lldb/source/Symbol/TypeSystem.cpp | 6 +- lldb/source/Symbol/Variable.cpp | 32 +- lldb/source/Target/ABI.cpp | 37 +- lldb/source/Target/Language.cpp | 5 - lldb/source/Target/LanguageRuntime.cpp | 4 +- lldb/source/Target/MemoryRegionInfo.cpp | 40 + lldb/source/Target/Platform.cpp | 2 +- lldb/source/Target/Process.cpp | 22 +- lldb/source/Target/StackFrame.cpp | 9 +- lldb/source/Target/StackFrameList.cpp | 25 +- lldb/source/Target/StackFrameRecognizer.cpp | 2 +- lldb/source/Target/Target.cpp | 179 +- lldb/source/Target/TargetList.cpp | 9 +- lldb/source/Target/TargetProperties.td | 3 - lldb/source/Target/ThreadPlanRunToAddress.cpp | 6 +- lldb/source/Target/ThreadPlanStepInRange.cpp | 8 +- .../Target/ThreadPlanStepInstruction.cpp | 16 +- lldb/source/Target/ThreadPlanStepOut.cpp | 26 +- .../source/Target/ThreadPlanStepOverRange.cpp | 4 +- lldb/source/Target/ThreadPlanStepRange.cpp | 22 +- lldb/source/Target/ThreadPlanStepThrough.cpp | 4 +- lldb/source/Target/ThreadPlanTracer.cpp | 9 +- lldb/source/Utility/ArchSpec.cpp | 41 +- lldb/source/Utility/Baton.cpp | 5 +- lldb/source/Utility/Broadcaster.cpp | 4 - lldb/source/Utility/ConstString.cpp | 1 - lldb/source/Utility/DataBufferLLVM.cpp | 3 - lldb/source/Utility/DataEncoder.cpp | 52 +- lldb/source/Utility/DataExtractor.cpp | 58 +- lldb/source/Utility/Environment.cpp | 4 +- lldb/source/Utility/FileSpec.cpp | 57 +- lldb/source/Utility/GDBRemote.cpp | 73 +- lldb/source/Utility/LLDBAssert.cpp | 6 +- .../Utility/PPC64LE_ehframe_Registers.h | 193 - lldb/source/Utility/ProcessInfo.cpp | 8 +- lldb/source/Utility/RegisterValue.cpp | 34 +- lldb/source/Utility/Reproducer.cpp | 66 +- lldb/source/Utility/Scalar.cpp | 23 +- lldb/source/Utility/Status.cpp | 21 +- lldb/source/Utility/Stream.cpp | 82 +- lldb/source/Utility/StreamString.cpp | 2 +- lldb/source/Utility/StructuredData.cpp | 8 +- lldb/source/Utility/VMRange.cpp | 7 +- lldb/tools/driver/Driver.cpp | 61 +- lldb/tools/driver/Options.td | 6 +- lldb/tools/lldb-server/lldb-gdbserver.cpp | 5 +- lldb/tools/lldb-server/lldb-server.cpp | 2 +- .../utils/TableGen/LLDBPropertyDefEmitter.cpp | 15 + llvm/include/llvm-c/Analysis.h | 9 +- llvm/include/llvm-c/BitReader.h | 9 +- llvm/include/llvm-c/BitWriter.h | 9 +- llvm/include/llvm-c/Comdat.h | 9 +- llvm/include/llvm-c/Core.h | 13 +- llvm/include/llvm-c/DebugInfo.h | 17 +- llvm/include/llvm-c/Disassembler.h | 9 +- llvm/include/llvm-c/Error.h | 10 +- llvm/include/llvm-c/ErrorHandling.h | 10 +- llvm/include/llvm-c/ExecutionEngine.h | 9 +- llvm/include/llvm-c/ExternC.h | 39 + llvm/include/llvm-c/IRReader.h | 9 +- llvm/include/llvm-c/Initialization.h | 9 +- llvm/include/llvm-c/LinkTimeOptimizer.h | 10 +- llvm/include/llvm-c/Linker.h | 9 +- llvm/include/llvm-c/Object.h | 9 +- llvm/include/llvm-c/OrcBindings.h | 9 +- llvm/include/llvm-c/Remarks.h | 8 +- llvm/include/llvm-c/Support.h | 9 +- llvm/include/llvm-c/Target.h | 9 +- llvm/include/llvm-c/TargetMachine.h | 10 +- .../llvm-c/Transforms/AggressiveInstCombine.h | 9 +- llvm/include/llvm-c/Transforms/Coroutines.h | 17 +- llvm/include/llvm-c/Transforms/IPO.h | 9 +- llvm/include/llvm-c/Transforms/InstCombine.h | 9 +- .../llvm-c/Transforms/PassManagerBuilder.h | 9 +- llvm/include/llvm-c/Transforms/Scalar.h | 9 +- llvm/include/llvm-c/Transforms/Utils.h | 9 +- llvm/include/llvm-c/Transforms/Vectorize.h | 9 +- llvm/include/llvm-c/Types.h | 9 +- llvm/include/llvm-c/lto.h | 25 +- llvm/include/llvm/ADT/APFloat.h | 19 +- llvm/include/llvm/ADT/APInt.h | 71 +- llvm/include/llvm/ADT/ArrayRef.h | 10 + llvm/include/llvm/ADT/BitVector.h | 32 +- llvm/include/llvm/ADT/DenseMap.h | 16 +- llvm/include/llvm/ADT/DirectedGraph.h | 3 + llvm/include/llvm/ADT/EnumeratedArray.h | 48 + llvm/include/llvm/ADT/FloatingPointMode.h | 62 + llvm/include/llvm/ADT/FoldingSet.h | 10 +- llvm/include/llvm/ADT/Hashing.h | 7 +- llvm/include/llvm/ADT/ImmutableSet.h | 3 +- llvm/include/llvm/ADT/Optional.h | 16 + llvm/include/llvm/ADT/PointerUnion.h | 12 +- llvm/include/llvm/ADT/SCCIterator.h | 5 +- llvm/include/llvm/ADT/STLExtras.h | 55 +- llvm/include/llvm/ADT/SmallPtrSet.h | 26 + llvm/include/llvm/ADT/SmallSet.h | 25 + llvm/include/llvm/ADT/SmallVector.h | 11 + llvm/include/llvm/ADT/Statistic.h | 2 +- llvm/include/llvm/ADT/StringRef.h | 11 +- llvm/include/llvm/ADT/Triple.h | 21 +- llvm/include/llvm/ADT/Twine.h | 4 +- llvm/include/llvm/ADT/iterator.h | 5 + llvm/include/llvm/ADT/iterator_range.h | 5 - llvm/include/llvm/Analysis/AliasAnalysis.h | 9 +- llvm/include/llvm/Analysis/AliasSetTracker.h | 4 +- .../llvm/Analysis/BranchProbabilityInfo.h | 14 +- llvm/include/llvm/Analysis/DDG.h | 97 +- .../llvm/Analysis/DependenceAnalysis.h | 11 +- .../llvm/Analysis/DependenceGraphBuilder.h | 61 +- llvm/include/llvm/Analysis/GlobalsModRef.h | 3 + llvm/include/llvm/Analysis/GuardUtils.h | 10 + .../llvm/Analysis/InstructionSimplify.h | 4 + .../include/llvm/Analysis/IntervalPartition.h | 4 +- llvm/include/llvm/Analysis/LazyValueInfo.h | 4 +- .../llvm/Analysis/LegacyDivergenceAnalysis.h | 8 +- .../llvm/Analysis/LoopAccessAnalysis.h | 18 +- llvm/include/llvm/Analysis/LoopInfo.h | 17 +- llvm/include/llvm/Analysis/LoopInfoImpl.h | 6 +- llvm/include/llvm/Analysis/LoopPass.h | 4 +- llvm/include/llvm/Analysis/MemorySSA.h | 9 +- llvm/include/llvm/Analysis/MustExecute.h | 55 +- llvm/include/llvm/Analysis/PhiValues.h | 2 +- llvm/include/llvm/Analysis/PostDominators.h | 11 +- llvm/include/llvm/Analysis/PtrUseVisitor.h | 4 +- llvm/include/llvm/Analysis/ScalarEvolution.h | 69 +- .../include/llvm/Analysis/TargetLibraryInfo.h | 102 +- .../llvm/Analysis/TargetTransformInfo.h | 122 +- .../llvm/Analysis/TargetTransformInfoImpl.h | 34 +- llvm/include/llvm/Analysis/Utils/Local.h | 27 +- llvm/include/llvm/Analysis/ValueTracking.h | 14 +- llvm/include/llvm/Analysis/VecFuncs.def | 11 +- llvm/include/llvm/Analysis/VectorUtils.h | 64 +- llvm/include/llvm/BinaryFormat/COFF.h | 10 +- llvm/include/llvm/BinaryFormat/Dwarf.def | 5 +- llvm/include/llvm/BinaryFormat/Dwarf.h | 4 +- llvm/include/llvm/BinaryFormat/ELF.h | 5 +- .../llvm/BinaryFormat/MinidumpConstants.def | 31 +- llvm/include/llvm/BinaryFormat/Wasm.h | 2 + llvm/include/llvm/BinaryFormat/XCOFF.h | 3 + llvm/include/llvm/Bitcode/BitcodeWriter.h | 6 + llvm/include/llvm/Bitcode/LLVMBitCodes.h | 1 + llvm/include/llvm/Bitstream/BitstreamReader.h | 2 +- llvm/include/llvm/CodeGen/AsmPrinter.h | 15 +- llvm/include/llvm/CodeGen/BasicTTIImpl.h | 32 +- llvm/include/llvm/CodeGen/CommandFlags.inc | 107 +- llvm/include/llvm/CodeGen/DFAPacketizer.h | 45 +- llvm/include/llvm/CodeGen/DIE.h | 2 +- llvm/include/llvm/CodeGen/FastISel.h | 5 + llvm/include/llvm/CodeGen/FaultMaps.h | 3 +- .../llvm/CodeGen/FunctionLoweringInfo.h | 2 +- .../include/llvm/CodeGen/GlobalISel/CSEInfo.h | 4 +- .../llvm/CodeGen/GlobalISel/CallLowering.h | 2 +- .../llvm/CodeGen/GlobalISel/CombinerHelper.h | 21 +- .../llvm/CodeGen/GlobalISel/GISelKnownBits.h | 4 + .../llvm/CodeGen/GlobalISel/IRTranslator.h | 3 + .../CodeGen/GlobalISel/InstructionSelector.h | 15 +- .../GlobalISel/InstructionSelectorImpl.h | 38 +- .../GlobalISel/LegalizationArtifactCombiner.h | 253 +- .../llvm/CodeGen/GlobalISel/Legalizer.h | 15 +- .../llvm/CodeGen/GlobalISel/LegalizerHelper.h | 4 + .../llvm/CodeGen/GlobalISel/LegalizerInfo.h | 12 +- .../llvm/CodeGen/GlobalISel/Localizer.h | 5 + .../CodeGen/GlobalISel/MachineIRBuilder.h | 46 +- .../CodeGen/GlobalISel/RegisterBankInfo.h | 5 +- llvm/include/llvm/CodeGen/GlobalISel/Utils.h | 5 - llvm/include/llvm/CodeGen/ISDOpcodes.h | 45 +- llvm/include/llvm/CodeGen/LiveInterval.h | 27 +- llvm/include/llvm/CodeGen/LiveIntervalUnion.h | 1 + llvm/include/llvm/CodeGen/LiveIntervals.h | 2 +- llvm/include/llvm/CodeGen/LivePhysRegs.h | 3 + llvm/include/llvm/CodeGen/LiveRegUnits.h | 13 + llvm/include/llvm/CodeGen/LiveStacks.h | 1 + llvm/include/llvm/CodeGen/LiveVariables.h | 1 + llvm/include/llvm/CodeGen/LowLevelType.h | 9 + llvm/include/llvm/CodeGen/MIRFormatter.h | 83 + .../include/llvm/CodeGen/MIRParser/MIParser.h | 4 + .../llvm/CodeGen/MIRParser/MIRParser.h | 14 +- .../llvm/CodeGen/MachineBlockFrequencyInfo.h | 3 + .../CodeGen/MachineBranchProbabilityInfo.h | 5 +- .../llvm/CodeGen/MachineCombinerPattern.h | 45 + llvm/include/llvm/CodeGen/MachineDominators.h | 5 + llvm/include/llvm/CodeGen/MachineFrameInfo.h | 2 +- llvm/include/llvm/CodeGen/MachineFunction.h | 54 +- llvm/include/llvm/CodeGen/MachineInstr.h | 67 +- .../llvm/CodeGen/MachineInstrBuilder.h | 2 +- .../include/llvm/CodeGen/MachineInstrBundle.h | 257 +- llvm/include/llvm/CodeGen/MachineLoopInfo.h | 8 +- llvm/include/llvm/CodeGen/MachineLoopUtils.h | 5 + llvm/include/llvm/CodeGen/MachineMemOperand.h | 2 +- llvm/include/llvm/CodeGen/MachineOperand.h | 19 +- .../MachineOptimizationRemarkEmitter.h | 4 + llvm/include/llvm/CodeGen/MachineOutliner.h | 12 +- llvm/include/llvm/CodeGen/MachinePipeliner.h | 1 + llvm/include/llvm/CodeGen/MachineScheduler.h | 19 +- llvm/include/llvm/CodeGen/MachineSizeOpts.h | 39 + llvm/include/llvm/CodeGen/ModuloSchedule.h | 17 + .../llvm/CodeGen/NonRelocatableStringpool.h | 83 + llvm/include/llvm/CodeGen/ParallelCG.h | 2 +- llvm/include/llvm/CodeGen/Passes.h | 12 + llvm/include/llvm/CodeGen/PseudoSourceValue.h | 2 + .../llvm/CodeGen/ReachingDefAnalysis.h | 44 +- llvm/include/llvm/CodeGen/RegisterUsageInfo.h | 1 + llvm/include/llvm/CodeGen/SelectionDAG.h | 87 +- llvm/include/llvm/CodeGen/SelectionDAGISel.h | 14 +- llvm/include/llvm/CodeGen/SelectionDAGNodes.h | 120 +- llvm/include/llvm/CodeGen/SlotIndexes.h | 9 +- llvm/include/llvm/CodeGen/StackMaps.h | 24 +- llvm/include/llvm/CodeGen/StackProtector.h | 4 +- .../llvm/CodeGen/SwitchLoweringUtils.h | 5 +- llvm/include/llvm/CodeGen/TailDuplicator.h | 6 + llvm/include/llvm/CodeGen/TargetCallingConv.h | 8 +- .../llvm/CodeGen/TargetFrameLowering.h | 13 + llvm/include/llvm/CodeGen/TargetInstrInfo.h | 88 +- llvm/include/llvm/CodeGen/TargetLowering.h | 298 +- .../CodeGen/TargetLoweringObjectFileImpl.h | 9 + llvm/include/llvm/CodeGen/TargetSchedule.h | 8 +- .../llvm/CodeGen/TargetSubtargetInfo.h | 4 + llvm/include/llvm/CodeGen/ValueTypes.h | 30 +- llvm/include/llvm/DWARFLinker/DWARFLinker.h | 198 + .../llvm/DWARFLinker/DWARFLinkerCompileUnit.h | 330 ++ .../llvm/DWARFLinker/DWARFLinkerDeclContext.h | 169 + .../CodeView/GlobalTypeTableBuilder.h | 2 +- .../llvm/DebugInfo/CodeView/SymbolRecord.h | 28 +- .../llvm/DebugInfo/CodeView/TypeRecord.h | 52 +- .../DebugInfo/CodeView/TypeRecordHelpers.h | 35 +- .../llvm/DebugInfo/DWARF/DWARFAddressRange.h | 18 +- .../llvm/DebugInfo/DWARF/DWARFContext.h | 10 +- .../llvm/DebugInfo/DWARF/DWARFDataExtractor.h | 2 - .../llvm/DebugInfo/DWARF/DWARFDebugAranges.h | 8 +- .../llvm/DebugInfo/DWARF/DWARFDebugLine.h | 17 +- .../llvm/DebugInfo/DWARF/DWARFDebugLoc.h | 157 +- .../llvm/DebugInfo/DWARF/DWARFDebugMacro.h | 4 +- .../llvm/DebugInfo/DWARF/DWARFDebugRnglists.h | 6 + llvm/include/llvm/DebugInfo/DWARF/DWARFDie.h | 5 + .../DebugInfo/DWARF/DWARFLocationExpression.h | 49 + .../llvm/DebugInfo/DWARF/DWARFObject.h | 2 + llvm/include/llvm/DebugInfo/DWARF/DWARFUnit.h | 44 +- .../llvm/DebugInfo/GSYM/FunctionInfo.h | 31 +- .../include/llvm/DebugInfo/GSYM/GsymCreator.h | 6 +- llvm/include/llvm/DebugInfo/GSYM/GsymReader.h | 56 +- llvm/include/llvm/DebugInfo/GSYM/InlineInfo.h | 49 + llvm/include/llvm/DebugInfo/GSYM/LineTable.h | 21 +- .../llvm/DebugInfo/GSYM/LookupResult.h | 61 + llvm/include/llvm/DebugInfo/GSYM/Range.h | 18 + .../PDB/Native/DbiModuleDescriptor.h | 6 +- .../llvm/DebugInfo/PDB/Native/DbiModuleList.h | 1 + .../llvm/DebugInfo/PDB/Native/HashTable.h | 1 + .../llvm/DebugInfo/Symbolize/Symbolize.h | 5 + llvm/include/llvm/Demangle/ItaniumDemangle.h | 82 +- .../llvm/Demangle/MicrosoftDemangleNodes.h | 4 +- llvm/include/llvm/Demangle/Utility.h | 8 +- .../llvm/ExecutionEngine/JITLink/JITLink.h | 427 +- llvm/include/llvm/ExecutionEngine/JITSymbol.h | 18 + llvm/include/llvm/ExecutionEngine/Orc/Core.h | 399 +- .../llvm/ExecutionEngine/Orc/DebugUtils.h | 58 + .../llvm/ExecutionEngine/Orc/ExecutionUtils.h | 28 +- .../ExecutionEngine/Orc/IndirectionUtils.h | 2 +- .../Orc/JITTargetMachineBuilder.h | 23 + llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h | 4 + .../ExecutionEngine/Orc/ObjectLinkingLayer.h | 4 +- .../Orc/ObjectTransformLayer.h | 6 +- .../llvm/ExecutionEngine/Orc/OrcABISupport.h | 76 +- .../llvm/ExecutionEngine/Orc/OrcError.h | 2 + .../Orc/OrcRemoteTargetRPCAPI.h | 4 +- .../Orc/{ => RPC}/RPCSerialization.h | 4 +- .../ExecutionEngine/Orc/{ => RPC}/RPCUtils.h | 2 +- .../Orc/{ => RPC}/RawByteChannel.h | 4 +- .../Orc/RTDyldObjectLinkingLayer.h | 2 + .../llvm/ExecutionEngine/Orc/Speculation.h | 35 +- .../llvm/Frontend/OpenMP/OMPConstants.h | 109 + .../llvm/Frontend/OpenMP/OMPIRBuilder.h | 250 + .../include/llvm/Frontend/OpenMP/OMPKinds.def | 289 ++ llvm/include/llvm/IR/Argument.h | 5 + llvm/include/llvm/IR/Attributes.td | 1 + llvm/include/llvm/IR/AutoUpgrade.h | 5 + llvm/include/llvm/IR/CallSite.h | 35 +- llvm/include/llvm/IR/CallingConv.h | 6 + llvm/include/llvm/IR/Constant.h | 18 +- llvm/include/llvm/IR/ConstantRange.h | 30 + llvm/include/llvm/IR/Constants.h | 9 +- llvm/include/llvm/IR/ConstrainedOps.def | 86 + llvm/include/llvm/IR/DIBuilder.h | 18 +- llvm/include/llvm/IR/DebugInfoFlags.def | 7 +- llvm/include/llvm/IR/DebugInfoMetadata.h | 125 +- llvm/include/llvm/IR/Dominators.h | 4 +- llvm/include/llvm/IR/FPEnv.h | 70 + llvm/include/llvm/IR/Function.h | 10 +- llvm/include/llvm/IR/GlobalValue.h | 2 +- llvm/include/llvm/IR/IRBuilder.h | 343 +- llvm/include/llvm/IR/IRPrintingPasses.h | 6 - llvm/include/llvm/IR/InstVisitor.h | 1 + llvm/include/llvm/IR/InstrTypes.h | 34 +- llvm/include/llvm/IR/Instruction.def | 3 +- llvm/include/llvm/IR/Instruction.h | 2 +- llvm/include/llvm/IR/Instructions.h | 71 +- llvm/include/llvm/IR/IntrinsicInst.h | 126 +- llvm/include/llvm/IR/Intrinsics.h | 11 +- llvm/include/llvm/IR/Intrinsics.td | 92 +- llvm/include/llvm/IR/IntrinsicsAArch64.td | 854 +++- llvm/include/llvm/IR/IntrinsicsAMDGPU.td | 2 +- llvm/include/llvm/IR/IntrinsicsARM.td | 350 +- llvm/include/llvm/IR/IntrinsicsNVVM.td | 57 +- llvm/include/llvm/IR/IntrinsicsRISCV.td | 90 +- llvm/include/llvm/IR/IntrinsicsWebAssembly.td | 9 + llvm/include/llvm/IR/LLVMContext.h | 10 +- llvm/include/llvm/IR/LegacyPassManager.h | 2 +- llvm/include/llvm/IR/LegacyPassManagers.h | 5 - llvm/include/llvm/IR/Metadata.h | 29 +- llvm/include/llvm/IR/Module.h | 39 +- llvm/include/llvm/IR/ModuleSummaryIndex.h | 51 +- llvm/include/llvm/IR/NoFolder.h | 2 +- llvm/include/llvm/IR/Operator.h | 9 +- llvm/include/llvm/IR/PassManager.h | 15 +- llvm/include/llvm/IR/PatternMatch.h | 67 +- llvm/include/llvm/IR/RemarkStreamer.h | 2 + llvm/include/llvm/IR/RuntimeLibcalls.def | 6 +- llvm/include/llvm/IR/ValueHandle.h | 20 + llvm/include/llvm/InitializePasses.h | 9 +- llvm/include/llvm/LTO/Config.h | 15 +- llvm/include/llvm/LTO/LTO.h | 7 +- llvm/include/llvm/LTO/LTOBackend.h | 6 +- .../llvm/LTO/legacy/LTOCodeGenerator.h | 10 +- llvm/include/llvm/LinkAllPasses.h | 3 +- llvm/include/llvm/MC/MCAsmBackend.h | 49 +- llvm/include/llvm/MC/MCAsmInfo.h | 9 + llvm/include/llvm/MC/MCAsmInfoELF.h | 4 - llvm/include/llvm/MC/MCAsmInfoXCOFF.h | 6 +- llvm/include/llvm/MC/MCAssembler.h | 5 +- llvm/include/llvm/MC/MCCodeEmitter.h | 6 + llvm/include/llvm/MC/MCCodePadder.h | 241 - .../llvm/MC/MCDisassembler/MCDisassembler.h | 4 - llvm/include/llvm/MC/MCDwarf.h | 2 +- llvm/include/llvm/MC/MCELFStreamer.h | 5 +- llvm/include/llvm/MC/MCFragment.h | 255 +- llvm/include/llvm/MC/MCInst.h | 5 +- llvm/include/llvm/MC/MCInstPrinter.h | 53 +- llvm/include/llvm/MC/MCInstrDesc.h | 24 +- llvm/include/llvm/MC/MCMachObjectWriter.h | 4 +- llvm/include/llvm/MC/MCObjectFileInfo.h | 185 +- llvm/include/llvm/MC/MCObjectStreamer.h | 28 +- llvm/include/llvm/MC/MCParser/AsmCond.h | 2 - .../llvm/MC/MCParser/MCParsedAsmOperand.h | 8 +- .../llvm/MC/MCParser/MCTargetAsmParser.h | 50 +- llvm/include/llvm/MC/MCRegisterInfo.h | 110 + llvm/include/llvm/MC/MCSection.h | 34 +- llvm/include/llvm/MC/MCSectionXCOFF.h | 14 +- llvm/include/llvm/MC/MCStreamer.h | 25 +- llvm/include/llvm/MC/MCSymbol.h | 10 +- llvm/include/llvm/MC/MCSymbolWasm.h | 6 + llvm/include/llvm/MC/MCSymbolXCOFF.h | 14 + llvm/include/llvm/MC/MCTargetOptions.h | 1 - .../llvm/MC/MCTargetOptionsCommandFlags.inc | 3 - llvm/include/llvm/MC/MCXCOFFStreamer.h | 3 +- llvm/include/llvm/Object/ELF.h | 22 +- llvm/include/llvm/Object/ELFObjectFile.h | 2 + llvm/include/llvm/Object/MachO.h | 2 +- llvm/include/llvm/Object/ObjectFile.h | 2 + llvm/include/llvm/Object/Wasm.h | 1 + llvm/include/llvm/Object/XCOFFObjectFile.h | 27 +- llvm/include/llvm/ObjectYAML/DWARFYAML.h | 2 - llvm/include/llvm/ObjectYAML/ELFYAML.h | 260 +- llvm/include/llvm/ObjectYAML/YAML.h | 3 +- llvm/include/llvm/Pass.h | 53 - llvm/include/llvm/Passes/PassBuilder.h | 17 +- .../ProfileData/Coverage/CoverageMapping.h | 2 +- llvm/include/llvm/ProfileData/InstrProf.h | 2 +- .../llvm/ProfileData/InstrProfData.inc | 6 +- llvm/include/llvm/ProfileData/SampleProf.h | 5 +- .../llvm/ProfileData/SampleProfReader.h | 9 + .../llvm/ProfileData/SampleProfWriter.h | 4 +- llvm/include/llvm/Remarks/Remark.h | 36 +- llvm/include/llvm/Remarks/RemarkFormat.h | 3 + llvm/include/llvm/Remarks/RemarkLinker.h | 100 + .../llvm/Support/AArch64TargetParser.def | 22 +- .../llvm/Support/AArch64TargetParser.h | 9 + llvm/include/llvm/Support/AMDGPUMetadata.h | 1 + llvm/include/llvm/Support/ARMTargetParser.def | 2 - llvm/include/llvm/Support/Allocator.h | 2 +- llvm/include/llvm/Support/Automaton.h | 12 +- llvm/include/llvm/Support/BinaryStreamArray.h | 11 +- .../include/llvm/Support/BinaryStreamReader.h | 4 +- llvm/include/llvm/Support/BinaryStreamRef.h | 6 +- llvm/include/llvm/Support/CodeGen.h | 9 + llvm/include/llvm/Support/CommandLine.h | 126 +- llvm/include/llvm/Support/Compiler.h | 26 +- .../llvm/Support/CrashRecoveryContext.h | 16 +- llvm/include/llvm/Support/DataExtractor.h | 7 +- llvm/include/llvm/Support/Error.h | 16 +- llvm/include/llvm/Support/FileCheck.h | 1 + llvm/include/llvm/Support/FileCollector.h | 6 +- llvm/include/llvm/Support/FileOutputBuffer.h | 4 + llvm/include/llvm/Support/FormatVariadic.h | 2 +- llvm/include/llvm/Support/GenericDomTree.h | 4 +- llvm/include/llvm/Support/InitLLVM.h | 11 +- llvm/include/llvm/Support/JSON.h | 7 +- llvm/include/llvm/Support/KnownBits.h | 15 + llvm/include/llvm/Support/LineIterator.h | 10 +- llvm/include/llvm/Support/LockFileManager.h | 4 +- llvm/include/llvm/Support/LowLevelTypeImpl.h | 2 + llvm/include/llvm/Support/MachineValueType.h | 98 +- llvm/include/llvm/Support/MathExtras.h | 5 + llvm/include/llvm/Support/Memory.h | 11 + llvm/include/llvm/Support/Options.h | 119 - llvm/include/llvm/Support/Path.h | 43 +- llvm/include/llvm/Support/Signals.h | 34 +- llvm/include/llvm/Support/SourceMgr.h | 8 +- llvm/include/llvm/Support/SpecialCaseList.h | 8 +- llvm/include/llvm/Support/TargetOpcodes.def | 13 +- llvm/include/llvm/Support/TargetRegistry.h | 17 +- llvm/include/llvm/Support/Threading.h | 30 +- llvm/include/llvm/Support/TimeProfiler.h | 7 +- llvm/include/llvm/Support/Timer.h | 21 +- llvm/include/llvm/Support/TypeSize.h | 5 + llvm/include/llvm/Support/VersionTuple.h | 7 + llvm/include/llvm/Support/VirtualFileSystem.h | 26 +- llvm/include/llvm/Support/YAMLTraits.h | 7 +- llvm/include/llvm/Support/raw_ostream.h | 29 +- llvm/include/llvm/TableGen/Record.h | 10 +- llvm/include/llvm/Target/GenericOpcodes.td | 30 +- .../include/llvm/Target/GlobalISel/Combine.td | 49 +- .../Target/GlobalISel/SelectionDAGCompat.td | 4 + llvm/include/llvm/Target/GlobalISel/Target.td | 8 +- llvm/include/llvm/Target/Target.td | 7 +- llvm/include/llvm/Target/TargetCallingConv.td | 5 + llvm/include/llvm/Target/TargetMachine.h | 9 - llvm/include/llvm/Target/TargetOptions.h | 12 +- .../include/llvm/Target/TargetSelectionDAG.td | 36 +- llvm/include/llvm/Transforms/CFGuard.h | 26 + llvm/include/llvm/Transforms/Coroutines.h | 8 +- llvm/include/llvm/Transforms/IPO/Attributor.h | 971 +++- .../llvm/Transforms/IPO/FunctionImport.h | 2 +- .../llvm/Transforms/IPO/MergeFunctions.h | 32 + .../llvm/Transforms/IPO/WholeProgramDevirt.h | 2 +- .../llvm/Transforms/InstCombine/InstCombine.h | 17 +- .../InstCombine/InstCombineWorklist.h | 7 +- llvm/include/llvm/Transforms/Scalar.h | 17 +- .../llvm/Transforms/Scalar/ConstantHoisting.h | 2 +- llvm/include/llvm/Transforms/Scalar/GVN.h | 27 +- .../llvm/Transforms/Scalar/JumpThreading.h | 12 +- llvm/include/llvm/Transforms/Scalar/LICM.h | 1 + .../Transforms/Scalar/LoopUnrollAndJamPass.h | 7 +- .../llvm/Transforms/Scalar/LoopUnrollPass.h | 1 + .../Transforms/Scalar/LowerMatrixIntrinsics.h | 24 + llvm/include/llvm/Transforms/Utils.h | 7 + .../llvm/Transforms/Utils/BasicBlockUtils.h | 4 + .../llvm/Transforms/Utils/CodeMoverUtils.h | 56 + .../llvm/Transforms/Utils}/Debugify.h | 10 +- .../Transforms/Utils/FunctionImportUtils.h | 13 +- .../llvm/Transforms/Utils/GuardUtils.h | 19 +- .../llvm/Transforms/Utils/InjectTLIMappings.h | 37 + llvm/include/llvm/Transforms/Utils/Local.h | 4 + .../include/llvm/Transforms/Utils/LoopUtils.h | 5 +- .../llvm/Transforms/Utils/ModuleUtils.h | 8 + .../llvm/Transforms/Utils/SimplifyLibCalls.h | 1 + llvm/include/llvm/Transforms/Utils/SizeOpts.h | 87 +- .../Transforms/Utils/UnifyFunctionExitNodes.h | 4 +- llvm/include/llvm/Transforms/Vectorize.h | 1 - .../llvm/Transforms/Vectorize/LoopVectorize.h | 1 + .../llvm/Transforms/Vectorize/SLPVectorizer.h | 3 +- llvm/include/llvm/XRay/FDRRecords.h | 6 +- llvm/include/llvm/module.modulemap | 31 +- llvm/lib/Analysis/AliasAnalysis.cpp | 15 + llvm/lib/Analysis/AliasAnalysisEvaluator.cpp | 1 + llvm/lib/Analysis/AliasSetTracker.cpp | 1 + llvm/lib/Analysis/AssumptionCache.cpp | 1 + llvm/lib/Analysis/BasicAliasAnalysis.cpp | 8 +- llvm/lib/Analysis/BlockFrequencyInfo.cpp | 1 + llvm/lib/Analysis/BranchProbabilityInfo.cpp | 142 +- llvm/lib/Analysis/CFGPrinter.cpp | 2 + llvm/lib/Analysis/CFLAndersAliasAnalysis.cpp | 1 + llvm/lib/Analysis/CFLSteensAliasAnalysis.cpp | 1 + llvm/lib/Analysis/CallGraph.cpp | 3 +- llvm/lib/Analysis/CallPrinter.cpp | 1 + llvm/lib/Analysis/ConstantFolding.cpp | 22 +- llvm/lib/Analysis/CostModel.cpp | 1 + llvm/lib/Analysis/DDG.cpp | 112 +- llvm/lib/Analysis/Delinearization.cpp | 1 + llvm/lib/Analysis/DemandedBits.cpp | 1 + llvm/lib/Analysis/DependenceAnalysis.cpp | 86 +- llvm/lib/Analysis/DependenceGraphBuilder.cpp | 179 + llvm/lib/Analysis/DomPrinter.cpp | 1 + llvm/lib/Analysis/DomTreeUpdater.cpp | 4 +- llvm/lib/Analysis/DominanceFrontier.cpp | 1 + llvm/lib/Analysis/GlobalsModRef.cpp | 20 +- llvm/lib/Analysis/GuardUtils.cpp | 77 +- llvm/lib/Analysis/IVDescriptors.cpp | 52 +- llvm/lib/Analysis/IVUsers.cpp | 1 + .../IndirectCallPromotionAnalysis.cpp | 1 + llvm/lib/Analysis/InlineCost.cpp | 910 ++-- llvm/lib/Analysis/InstCount.cpp | 1 + .../InstructionPrecedenceTracking.cpp | 1 + llvm/lib/Analysis/InstructionSimplify.cpp | 221 +- llvm/lib/Analysis/IntervalPartition.cpp | 5 + llvm/lib/Analysis/LazyBlockFrequencyInfo.cpp | 1 + .../Analysis/LazyBranchProbabilityInfo.cpp | 1 + llvm/lib/Analysis/LazyValueInfo.cpp | 65 +- .../lib/Analysis/LegacyDivergenceAnalysis.cpp | 7 +- llvm/lib/Analysis/Lint.cpp | 1 + llvm/lib/Analysis/Loads.cpp | 9 +- llvm/lib/Analysis/LoopAccessAnalysis.cpp | 5 + llvm/lib/Analysis/LoopCacheAnalysis.cpp | 10 +- llvm/lib/Analysis/LoopInfo.cpp | 13 +- llvm/lib/Analysis/LoopPass.cpp | 7 +- llvm/lib/Analysis/MemDepPrinter.cpp | 1 + llvm/lib/Analysis/MemDerefPrinter.cpp | 1 + llvm/lib/Analysis/MemoryBuiltins.cpp | 11 +- .../lib/Analysis/MemoryDependenceAnalysis.cpp | 3 +- llvm/lib/Analysis/MemoryLocation.cpp | 1 + llvm/lib/Analysis/MemorySSA.cpp | 103 +- llvm/lib/Analysis/MemorySSAUpdater.cpp | 8 +- llvm/lib/Analysis/ModuleDebugInfoPrinter.cpp | 1 + llvm/lib/Analysis/ModuleSummaryAnalysis.cpp | 9 +- llvm/lib/Analysis/MustExecute.cpp | 198 +- .../Analysis/OptimizationRemarkEmitter.cpp | 1 + llvm/lib/Analysis/PhiValues.cpp | 63 +- llvm/lib/Analysis/PostDominators.cpp | 29 + llvm/lib/Analysis/ProfileSummaryInfo.cpp | 2 + llvm/lib/Analysis/RegionInfo.cpp | 1 + llvm/lib/Analysis/RegionPrinter.cpp | 1 + llvm/lib/Analysis/ScalarEvolution.cpp | 287 +- .../Analysis/ScalarEvolutionAliasAnalysis.cpp | 1 + llvm/lib/Analysis/ScalarEvolutionExpander.cpp | 4 +- llvm/lib/Analysis/ScopedNoAliasAA.cpp | 1 + llvm/lib/Analysis/StackSafetyAnalysis.cpp | 2 + llvm/lib/Analysis/TargetLibraryInfo.cpp | 49 +- llvm/lib/Analysis/TargetTransformInfo.cpp | 64 +- llvm/lib/Analysis/TypeBasedAliasAnalysis.cpp | 18 +- llvm/lib/Analysis/VFABIDemangling.cpp | 38 +- llvm/lib/Analysis/ValueTracking.cpp | 223 +- llvm/lib/Analysis/VectorUtils.cpp | 67 + llvm/lib/AsmParser/LLLexer.cpp | 5 + llvm/lib/AsmParser/LLParser.cpp | 51 +- llvm/lib/AsmParser/LLParser.h | 1 + llvm/lib/AsmParser/LLToken.h | 5 + .../BinaryFormat/AMDGPUMetadataVerifier.cpp | 1 + llvm/lib/BinaryFormat/Dwarf.cpp | 15 + llvm/lib/BinaryFormat/XCOFF.cpp | 34 + llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 49 +- llvm/lib/Bitcode/Reader/MetadataLoader.cpp | 2 +- llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | 145 +- llvm/lib/Bitcode/Writer/BitcodeWriterPass.cpp | 1 + llvm/lib/Bitstream/Reader/BitstreamReader.cpp | 38 +- llvm/lib/CodeGen/Analysis.cpp | 27 +- llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 144 +- .../AsmPrinter/AsmPrinterInlineAsm.cpp | 72 +- llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp | 32 +- llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.h | 2 +- llvm/lib/CodeGen/AsmPrinter/DIE.cpp | 10 +- .../AsmPrinter/DbgEntityHistoryCalculator.cpp | 4 +- llvm/lib/CodeGen/AsmPrinter/DebugLocEntry.h | 38 +- .../lib/CodeGen/AsmPrinter/DebugLocStream.cpp | 2 + llvm/lib/CodeGen/AsmPrinter/DebugLocStream.h | 8 +- .../CodeGen/AsmPrinter/DwarfCFIException.cpp | 3 + .../CodeGen/AsmPrinter/DwarfCompileUnit.cpp | 52 +- .../lib/CodeGen/AsmPrinter/DwarfCompileUnit.h | 5 +- llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 357 +- llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h | 14 + .../CodeGen/AsmPrinter/DwarfExpression.cpp | 32 +- llvm/lib/CodeGen/AsmPrinter/DwarfExpression.h | 4 + llvm/lib/CodeGen/AsmPrinter/DwarfFile.cpp | 2 +- llvm/lib/CodeGen/AsmPrinter/DwarfFile.h | 13 +- llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp | 28 +- llvm/lib/CodeGen/AsmPrinter/WinCFGuard.cpp | 61 +- llvm/lib/CodeGen/AsmPrinter/WinCFGuard.h | 9 +- llvm/lib/CodeGen/AtomicExpandPass.cpp | 3 +- llvm/lib/CodeGen/BranchFolding.cpp | 174 +- llvm/lib/CodeGen/BranchFolding.h | 4 + llvm/lib/CodeGen/BranchRelaxation.cpp | 1 + llvm/lib/CodeGen/BreakFalseDeps.cpp | 4 +- llvm/lib/CodeGen/CFGuardLongjmp.cpp | 120 + llvm/lib/CodeGen/CFIInstrInserter.cpp | 4 +- llvm/lib/CodeGen/CodeGen.cpp | 2 + llvm/lib/CodeGen/CodeGenPrepare.cpp | 246 +- llvm/lib/CodeGen/CriticalAntiDepBreaker.cpp | 16 +- llvm/lib/CodeGen/DFAPacketizer.cpp | 62 +- .../CodeGen/DeadMachineInstructionElim.cpp | 10 + llvm/lib/CodeGen/DwarfEHPrepare.cpp | 3 +- llvm/lib/CodeGen/EarlyIfConversion.cpp | 11 +- llvm/lib/CodeGen/EdgeBundles.cpp | 1 + llvm/lib/CodeGen/ExpandMemCmp.cpp | 44 +- llvm/lib/CodeGen/ExpandPostRAPseudos.cpp | 1 + llvm/lib/CodeGen/ExpandReductions.cpp | 46 +- llvm/lib/CodeGen/FEntryInserter.cpp | 1 + llvm/lib/CodeGen/FaultMaps.cpp | 4 +- llvm/lib/CodeGen/FinalizeISel.cpp | 1 + llvm/lib/CodeGen/FuncletLayout.cpp | 1 + llvm/lib/CodeGen/GCMetadata.cpp | 3 +- llvm/lib/CodeGen/GCRootLowering.cpp | 1 + llvm/lib/CodeGen/GlobalISel/CSEInfo.cpp | 7 +- llvm/lib/CodeGen/GlobalISel/CallLowering.cpp | 6 +- .../lib/CodeGen/GlobalISel/CombinerHelper.cpp | 172 +- .../lib/CodeGen/GlobalISel/GISelKnownBits.cpp | 74 +- llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp | 70 +- .../GlobalISel/InstructionSelector.cpp | 2 +- llvm/lib/CodeGen/GlobalISel/Legalizer.cpp | 131 +- .../CodeGen/GlobalISel/LegalizerHelper.cpp | 248 +- llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp | 16 +- llvm/lib/CodeGen/GlobalISel/Localizer.cpp | 13 +- .../CodeGen/GlobalISel/MachineIRBuilder.cpp | 19 +- llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp | 15 +- .../CodeGen/GlobalISel/RegisterBankInfo.cpp | 22 +- llvm/lib/CodeGen/GlobalISel/Utils.cpp | 17 - llvm/lib/CodeGen/GlobalMerge.cpp | 1 + llvm/lib/CodeGen/HardwareLoops.cpp | 125 +- llvm/lib/CodeGen/IfConversion.cpp | 11 +- llvm/lib/CodeGen/ImplicitNullChecks.cpp | 5 +- llvm/lib/CodeGen/IndirectBrExpandPass.cpp | 1 + llvm/lib/CodeGen/InlineSpiller.cpp | 19 +- llvm/lib/CodeGen/InterleavedAccessPass.cpp | 1 + .../CodeGen/InterleavedLoadCombinePass.cpp | 3 +- llvm/lib/CodeGen/IntrinsicLowering.cpp | 36 - llvm/lib/CodeGen/LLVMTargetMachine.cpp | 4 +- .../CodeGen/LazyMachineBlockFrequencyInfo.cpp | 1 + llvm/lib/CodeGen/LiveDebugValues.cpp | 661 ++- llvm/lib/CodeGen/LiveDebugVariables.cpp | 226 +- llvm/lib/CodeGen/LiveInterval.cpp | 19 +- llvm/lib/CodeGen/LiveIntervals.cpp | 23 +- llvm/lib/CodeGen/LivePhysRegs.cpp | 30 +- llvm/lib/CodeGen/LiveRangeShrink.cpp | 1 + llvm/lib/CodeGen/LiveRegMatrix.cpp | 1 + llvm/lib/CodeGen/LiveRegUnits.cpp | 45 +- llvm/lib/CodeGen/LocalStackSlotAllocation.cpp | 1 + llvm/lib/CodeGen/LowLevelType.cpp | 29 +- llvm/lib/CodeGen/LowerEmuTLS.cpp | 1 + llvm/lib/CodeGen/MIRCanonicalizerPass.cpp | 63 +- llvm/lib/CodeGen/MIRNamerPass.cpp | 6 +- llvm/lib/CodeGen/MIRParser/MILexer.cpp | 10 +- llvm/lib/CodeGen/MIRParser/MILexer.h | 4 +- llvm/lib/CodeGen/MIRParser/MIParser.cpp | 326 +- llvm/lib/CodeGen/MIRParser/MIRParser.cpp | 45 +- llvm/lib/CodeGen/MIRPrinter.cpp | 35 +- llvm/lib/CodeGen/MIRPrintingPass.cpp | 2 +- llvm/lib/CodeGen/MIRVRegNamerUtils.cpp | 436 +- llvm/lib/CodeGen/MIRVRegNamerUtils.h | 98 +- llvm/lib/CodeGen/MachineBasicBlock.cpp | 11 +- .../lib/CodeGen/MachineBlockFrequencyInfo.cpp | 8 + llvm/lib/CodeGen/MachineBlockPlacement.cpp | 84 +- .../CodeGen/MachineBranchProbabilityInfo.cpp | 8 + llvm/lib/CodeGen/MachineCSE.cpp | 1 + llvm/lib/CodeGen/MachineCombiner.cpp | 24 +- llvm/lib/CodeGen/MachineCopyPropagation.cpp | 236 +- llvm/lib/CodeGen/MachineDominanceFrontier.cpp | 1 + llvm/lib/CodeGen/MachineDominators.cpp | 7 +- llvm/lib/CodeGen/MachineFrameInfo.cpp | 8 +- llvm/lib/CodeGen/MachineFunction.cpp | 51 +- .../CodeGen/MachineFunctionPrinterPass.cpp | 1 + llvm/lib/CodeGen/MachineInstr.cpp | 167 +- llvm/lib/CodeGen/MachineInstrBundle.cpp | 31 +- llvm/lib/CodeGen/MachineLICM.cpp | 63 + llvm/lib/CodeGen/MachineLoopInfo.cpp | 12 +- llvm/lib/CodeGen/MachineLoopUtils.cpp | 12 + llvm/lib/CodeGen/MachineModuleInfo.cpp | 14 +- llvm/lib/CodeGen/MachineOperand.cpp | 67 +- .../MachineOptimizationRemarkEmitter.cpp | 1 + llvm/lib/CodeGen/MachineOutliner.cpp | 144 +- llvm/lib/CodeGen/MachinePipeliner.cpp | 5 +- llvm/lib/CodeGen/MachinePostDominators.cpp | 1 + llvm/lib/CodeGen/MachineRegionInfo.cpp | 1 + llvm/lib/CodeGen/MachineScheduler.cpp | 68 +- llvm/lib/CodeGen/MachineSink.cpp | 208 +- llvm/lib/CodeGen/MachineSizeOpts.cpp | 122 + llvm/lib/CodeGen/MachineTraceMetrics.cpp | 1 + llvm/lib/CodeGen/MachineVerifier.cpp | 93 +- llvm/lib/CodeGen/MacroFusion.cpp | 27 +- llvm/lib/CodeGen/ModuloSchedule.cpp | 217 +- llvm/lib/CodeGen/NonRelocatableStringpool.cpp | 54 + llvm/lib/CodeGen/OptimizePHIs.cpp | 1 + llvm/lib/CodeGen/ParallelCG.cpp | 4 +- llvm/lib/CodeGen/PatchableFunction.cpp | 10 + llvm/lib/CodeGen/PeepholeOptimizer.cpp | 1 + llvm/lib/CodeGen/PostRAHazardRecognizer.cpp | 1 + llvm/lib/CodeGen/PostRASchedulerList.cpp | 3 +- llvm/lib/CodeGen/PreISelIntrinsicLowering.cpp | 29 +- llvm/lib/CodeGen/ProcessImplicitDefs.cpp | 1 + llvm/lib/CodeGen/PrologEpilogInserter.cpp | 1 + llvm/lib/CodeGen/ReachingDefAnalysis.cpp | 141 +- llvm/lib/CodeGen/RegAllocFast.cpp | 141 +- llvm/lib/CodeGen/RegAllocGreedy.cpp | 11 +- llvm/lib/CodeGen/RegUsageInfoCollector.cpp | 4 +- llvm/lib/CodeGen/RegisterClassInfo.cpp | 3 +- llvm/lib/CodeGen/RegisterCoalescer.cpp | 227 +- llvm/lib/CodeGen/RegisterScavenging.cpp | 5 +- llvm/lib/CodeGen/RenameIndependentSubregs.cpp | 1 + llvm/lib/CodeGen/ResetMachineFunctionPass.cpp | 3 +- llvm/lib/CodeGen/SafeStack.cpp | 7 +- llvm/lib/CodeGen/ScalarizeMaskedMemIntrin.cpp | 15 +- llvm/lib/CodeGen/ScheduleDAGInstrs.cpp | 7 +- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 904 ++-- llvm/lib/CodeGen/SelectionDAG/FastISel.cpp | 20 +- .../SelectionDAG/FunctionLoweringInfo.cpp | 9 +- .../lib/CodeGen/SelectionDAG/InstrEmitter.cpp | 4 +- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 770 ++-- .../SelectionDAG/LegalizeFloatTypes.cpp | 1386 +++--- .../SelectionDAG/LegalizeIntegerTypes.cpp | 462 +- .../CodeGen/SelectionDAG/LegalizeTypes.cpp | 65 +- llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h | 35 +- .../SelectionDAG/LegalizeTypesGeneric.cpp | 9 +- .../SelectionDAG/LegalizeVectorOps.cpp | 1026 +++-- .../SelectionDAG/LegalizeVectorTypes.cpp | 488 +- .../SelectionDAG/ScheduleDAGSDNodes.cpp | 8 +- .../lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 438 +- .../SelectionDAG/SelectionDAGBuilder.cpp | 704 +-- .../SelectionDAG/SelectionDAGBuilder.h | 27 +- .../SelectionDAG/SelectionDAGDumper.cpp | 20 + .../CodeGen/SelectionDAG/SelectionDAGISel.cpp | 209 +- .../SelectionDAG/StatepointLowering.cpp | 3 +- .../CodeGen/SelectionDAG/TargetLowering.cpp | 585 ++- llvm/lib/CodeGen/ShadowStackGCLowering.cpp | 1 + llvm/lib/CodeGen/ShrinkWrap.cpp | 1 + llvm/lib/CodeGen/SjLjEHPrepare.cpp | 9 +- llvm/lib/CodeGen/SlotIndexes.cpp | 11 + llvm/lib/CodeGen/SpillPlacement.cpp | 1 + llvm/lib/CodeGen/StackColoring.cpp | 3 +- llvm/lib/CodeGen/StackMapLivenessAnalysis.cpp | 1 + llvm/lib/CodeGen/StackMaps.cpp | 24 +- llvm/lib/CodeGen/StackProtector.cpp | 5 + llvm/lib/CodeGen/StackSlotColoring.cpp | 1 + llvm/lib/CodeGen/SwitchLoweringUtils.cpp | 8 +- llvm/lib/CodeGen/TailDuplication.cpp | 16 +- llvm/lib/CodeGen/TailDuplicator.cpp | 17 +- llvm/lib/CodeGen/TargetFrameLoweringImpl.cpp | 13 + llvm/lib/CodeGen/TargetInstrInfo.cpp | 78 +- llvm/lib/CodeGen/TargetLoweringBase.cpp | 84 +- .../CodeGen/TargetLoweringObjectFileImpl.cpp | 61 +- llvm/lib/CodeGen/TargetOptionsImpl.cpp | 14 +- llvm/lib/CodeGen/TargetPassConfig.cpp | 11 +- llvm/lib/CodeGen/TargetSubtargetInfo.cpp | 4 + .../lib/CodeGen/TwoAddressInstructionPass.cpp | 2 +- .../TypePromotion.cpp} | 494 +- llvm/lib/CodeGen/UnreachableBlockElim.cpp | 1 + llvm/lib/CodeGen/ValueTypes.cpp | 136 +- llvm/lib/CodeGen/WasmEHPrepare.cpp | 2 + llvm/lib/CodeGen/WinEHPrepare.cpp | 4 +- llvm/lib/CodeGen/XRayInstrumentation.cpp | 1 + llvm/lib/DWARFLinker/DWARFLinker.cpp | 17 + .../DWARFLinker/DWARFLinkerCompileUnit.cpp | 144 + .../DWARFLinker/DWARFLinkerDeclContext.cpp | 209 + .../CodeView/SymbolRecordHelpers.cpp | 2 +- .../DebugInfo/CodeView/TypeStreamMerger.cpp | 16 +- .../DebugInfo/DWARF/DWARFAcceleratorTable.cpp | 6 +- .../lib/DebugInfo/DWARF/DWARFAddressRange.cpp | 8 +- llvm/lib/DebugInfo/DWARF/DWARFContext.cpp | 154 +- .../lib/DebugInfo/DWARF/DWARFDebugAranges.cpp | 4 +- llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp | 121 +- llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp | 528 ++- llvm/lib/DebugInfo/DWARF/DWARFDebugMacro.cpp | 76 +- .../DebugInfo/DWARF/DWARFDebugRnglists.cpp | 13 +- llvm/lib/DebugInfo/DWARF/DWARFDie.cpp | 100 +- llvm/lib/DebugInfo/DWARF/DWARFExpression.cpp | 2 + llvm/lib/DebugInfo/DWARF/DWARFFormValue.cpp | 7 +- .../DWARF/DWARFLocationExpression.cpp | 19 + llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp | 163 +- llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp | 80 +- llvm/lib/DebugInfo/GSYM/FunctionInfo.cpp | 106 +- llvm/lib/DebugInfo/GSYM/GsymReader.cpp | 22 +- llvm/lib/DebugInfo/GSYM/InlineInfo.cpp | 110 +- llvm/lib/DebugInfo/GSYM/LineTable.cpp | 12 +- llvm/lib/DebugInfo/GSYM/LookupResult.cpp | 69 + llvm/lib/DebugInfo/GSYM/Range.cpp | 12 + .../PDB/Native/DbiModuleDescriptor.cpp | 7 - llvm/lib/DebugInfo/Symbolize/DIPrinter.cpp | 15 +- llvm/lib/DebugInfo/Symbolize/Symbolize.cpp | 94 + llvm/lib/Demangle/ItaniumDemangle.cpp | 8 - .../ExecutionEngineBindings.cpp | 6 +- .../JITLink/EHFrameSupport.cpp | 833 ++-- .../JITLink/EHFrameSupportImpl.h | 98 +- llvm/lib/ExecutionEngine/JITLink/JITLink.cpp | 93 +- .../JITLink/JITLinkGeneric.cpp | 32 +- .../ExecutionEngine/JITLink/JITLinkGeneric.h | 2 +- .../JITLink/MachOLinkGraphBuilder.cpp | 10 +- .../JITLink/MachOLinkGraphBuilder.h | 68 - .../ExecutionEngine/JITLink/MachO_arm64.cpp | 14 +- .../ExecutionEngine/JITLink/MachO_x86_64.cpp | 27 +- .../Orc/CompileOnDemandLayer.cpp | 31 +- llvm/lib/ExecutionEngine/Orc/CompileUtils.cpp | 3 +- llvm/lib/ExecutionEngine/Orc/Core.cpp | 643 +-- llvm/lib/ExecutionEngine/Orc/DebugUtils.cpp | 68 + .../ExecutionEngine/Orc/ExecutionUtils.cpp | 112 +- .../ExecutionEngine/Orc/IndirectionUtils.cpp | 7 +- .../Orc/JITTargetMachineBuilder.cpp | 4 +- llvm/lib/ExecutionEngine/Orc/LLJIT.cpp | 36 +- .../lib/ExecutionEngine/Orc/LazyReexports.cpp | 6 +- llvm/lib/ExecutionEngine/Orc/Legacy.cpp | 3 +- .../Orc/ObjectLinkingLayer.cpp | 35 +- .../Orc/ObjectTransformLayer.cpp | 16 +- .../Orc/RTDyldObjectLinkingLayer.cpp | 19 +- .../{Orc => OrcError}/OrcError.cpp | 2 + .../RPCUtils.cpp => OrcError/RPCError.cpp} | 11 +- .../PerfJITEvents/PerfJITEventListener.cpp | 1 + .../RuntimeDyld/RuntimeDyldCOFF.cpp | 3 + .../RuntimeDyld/RuntimeDyldChecker.cpp | 2 +- .../Targets/RuntimeDyldCOFFAArch64.h | 365 ++ llvm/lib/ExecutionEngine/TargetSelect.cpp | 7 - llvm/lib/Frontend/OpenMP/OMPConstants.cpp | 87 + llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp | 632 +++ llvm/lib/IR/AbstractCallSite.cpp | 19 + llvm/lib/IR/AsmWriter.cpp | 65 +- llvm/lib/IR/Attributes.cpp | 36 +- llvm/lib/IR/AutoUpgrade.cpp | 77 +- llvm/lib/IR/ConstantFold.cpp | 60 +- llvm/lib/IR/ConstantRange.cpp | 150 +- llvm/lib/IR/Constants.cpp | 96 +- llvm/lib/IR/ConstantsContext.h | 2 +- llvm/lib/IR/Core.cpp | 22 +- llvm/lib/IR/DIBuilder.cpp | 31 +- llvm/lib/IR/DataLayout.cpp | 4 +- llvm/lib/IR/DebugInfo.cpp | 13 +- llvm/lib/IR/DebugInfoMetadata.cpp | 56 +- llvm/lib/IR/Dominators.cpp | 6 + llvm/lib/IR/FPEnv.cpp | 78 + llvm/lib/IR/Function.cpp | 30 +- llvm/lib/IR/IRBuilder.cpp | 66 +- llvm/lib/IR/IRPrintingPasses.cpp | 38 +- llvm/lib/IR/Instruction.cpp | 1 + llvm/lib/IR/Instructions.cpp | 67 +- llvm/lib/IR/IntrinsicInst.cpp | 131 +- llvm/lib/IR/LLVMContext.cpp | 5 + llvm/lib/IR/LLVMContextImpl.h | 12 +- llvm/lib/IR/LegacyPassManager.cpp | 280 +- llvm/lib/IR/Metadata.cpp | 5 +- llvm/lib/IR/Module.cpp | 16 + llvm/lib/IR/ModuleSummaryIndex.cpp | 56 +- llvm/lib/IR/Pass.cpp | 45 - llvm/lib/IR/RemarkStreamer.cpp | 33 + llvm/lib/IR/SafepointIRVerifier.cpp | 9 +- llvm/lib/IR/TypeFinder.cpp | 2 +- llvm/lib/IR/User.cpp | 4 +- llvm/lib/IR/Value.cpp | 3 +- llvm/lib/IR/Verifier.cpp | 213 +- llvm/lib/LTO/LTO.cpp | 50 +- llvm/lib/LTO/LTOBackend.cpp | 75 +- llvm/lib/LTO/LTOCodeGenerator.cpp | 11 +- llvm/lib/LTO/SummaryBasedOptimizations.cpp | 1 + llvm/lib/LTO/ThinLTOCodeGenerator.cpp | 12 +- llvm/lib/Linker/IRMover.cpp | 31 +- llvm/lib/MC/ELFObjectWriter.cpp | 26 +- llvm/lib/MC/MCAsmBackend.cpp | 26 +- llvm/lib/MC/MCAsmInfo.cpp | 2 +- llvm/lib/MC/MCAsmInfoELF.cpp | 2 - llvm/lib/MC/MCAsmInfoXCOFF.cpp | 9 +- llvm/lib/MC/MCAsmStreamer.cpp | 19 +- llvm/lib/MC/MCAssembler.cpp | 104 +- llvm/lib/MC/MCCodePadder.cpp | 370 -- llvm/lib/MC/MCContext.cpp | 7 +- llvm/lib/MC/MCDisassembler/Disassembler.cpp | 11 +- llvm/lib/MC/MCDisassembler/MCDisassembler.cpp | 15 +- llvm/lib/MC/MCDwarf.cpp | 3 +- llvm/lib/MC/MCELFStreamer.cpp | 9 +- llvm/lib/MC/MCExpr.cpp | 2 +- llvm/lib/MC/MCFragment.cpp | 56 +- llvm/lib/MC/MCInstPrinter.cpp | 90 + llvm/lib/MC/MCObjectFileInfo.cpp | 38 +- llvm/lib/MC/MCObjectStreamer.cpp | 130 +- llvm/lib/MC/MCParser/AsmParser.cpp | 90 +- llvm/lib/MC/MCParser/COFFAsmParser.cpp | 2 +- llvm/lib/MC/MCSection.cpp | 38 +- llvm/lib/MC/MCSectionXCOFF.cpp | 28 +- llvm/lib/MC/MCStreamer.cpp | 10 +- llvm/lib/MC/MCSymbolELF.cpp | 4 - llvm/lib/MC/MCTargetOptions.cpp | 4 +- llvm/lib/MC/MCValue.cpp | 5 +- llvm/lib/MC/MCXCOFFStreamer.cpp | 11 +- llvm/lib/MC/WasmObjectWriter.cpp | 12 +- llvm/lib/MC/XCOFFObjectWriter.cpp | 370 +- .../lib/MCA/HardwareUnits/ResourceManager.cpp | 2 +- llvm/lib/MCA/InstrBuilder.cpp | 2 +- llvm/lib/MCA/Stages/InstructionTables.cpp | 3 +- llvm/lib/Object/ELF.cpp | 2 +- llvm/lib/Object/MachOObjectFile.cpp | 8 +- llvm/lib/Object/ModuleSymbolTable.cpp | 4 +- llvm/lib/Object/ObjectFile.cpp | 7 + llvm/lib/Object/RelocationResolver.cpp | 10 +- llvm/lib/Object/WasmObjectFile.cpp | 17 +- llvm/lib/Object/XCOFFObjectFile.cpp | 54 +- llvm/lib/ObjectYAML/COFFEmitter.cpp | 13 +- .../ObjectYAML/CodeViewYAMLDebugSections.cpp | 2 +- llvm/lib/ObjectYAML/DWARFEmitter.cpp | 5 +- llvm/lib/ObjectYAML/ELFEmitter.cpp | 559 ++- llvm/lib/ObjectYAML/ELFYAML.cpp | 254 +- llvm/lib/ObjectYAML/MachOEmitter.cpp | 3 +- llvm/lib/ObjectYAML/MinidumpYAML.cpp | 1 + llvm/lib/ObjectYAML/YAML.cpp | 12 +- llvm/lib/Passes/PassBuilder.cpp | 72 +- llvm/lib/Passes/PassRegistry.def | 6 +- llvm/lib/ProfileData/GCOV.cpp | 2 +- llvm/lib/ProfileData/InstrProfReader.cpp | 8 +- llvm/lib/Remarks/BitstreamRemarkParser.cpp | 37 +- llvm/lib/Remarks/BitstreamRemarkParser.h | 9 +- llvm/lib/Remarks/RemarkFormat.cpp | 15 + llvm/lib/Remarks/RemarkLinker.cpp | 126 + llvm/lib/Support/AArch64TargetParser.cpp | 48 + llvm/lib/Support/AMDGPUMetadata.cpp | 1 + llvm/lib/Support/APFloat.cpp | 184 +- llvm/lib/Support/APInt.cpp | 79 +- llvm/lib/Support/ARMAttributeParser.cpp | 18 +- llvm/lib/Support/ARMTargetParser.cpp | 2 - llvm/lib/Support/BinaryStreamReader.cpp | 8 +- llvm/lib/Support/CRC.cpp | 2 +- llvm/lib/Support/CommandLine.cpp | 209 +- llvm/lib/Support/Compression.cpp | 4 +- llvm/lib/Support/CrashRecoveryContext.cpp | 73 +- llvm/lib/Support/DebugCounter.cpp | 1 - llvm/lib/Support/Error.cpp | 5 +- llvm/lib/Support/FileCheck.cpp | 272 +- llvm/lib/Support/FileCheckImpl.h | 175 +- llvm/lib/Support/FileOutputBuffer.cpp | 5 +- llvm/lib/Support/Host.cpp | 63 +- llvm/lib/Support/InitLLVM.cpp | 6 +- .../Support/ItaniumManglingCanonicalizer.cpp | 39 +- llvm/lib/Support/KnownBits.cpp | 4 +- llvm/lib/Support/LockFileManager.cpp | 6 +- llvm/lib/Support/Options.cpp | 32 - llvm/lib/Support/Parallel.cpp | 82 +- llvm/lib/Support/Path.cpp | 41 +- llvm/lib/Support/SHA1.cpp | 54 +- llvm/lib/Support/Signals.cpp | 4 +- llvm/lib/Support/SpecialCaseList.cpp | 14 +- llvm/lib/Support/Statistic.cpp | 14 +- llvm/lib/Support/StringRef.cpp | 19 +- llvm/lib/Support/TargetParser.cpp | 8 +- llvm/lib/Support/Threading.cpp | 51 +- llvm/lib/Support/TimeProfiler.cpp | 34 +- llvm/lib/Support/Timer.cpp | 11 +- llvm/lib/Support/Triple.cpp | 280 +- llvm/lib/Support/Unix/Memory.inc | 6 +- llvm/lib/Support/Unix/Path.inc | 47 +- llvm/lib/Support/Unix/Signals.inc | 50 +- llvm/lib/Support/Unix/Threading.inc | 65 +- llvm/lib/Support/Unix/Unix.h | 9 + llvm/lib/Support/VirtualFileSystem.cpp | 52 +- llvm/lib/Support/Windows/Memory.inc | 8 +- llvm/lib/Support/Windows/Process.inc | 7 - llvm/lib/Support/Windows/Program.inc | 2 +- llvm/lib/Support/Windows/Signals.inc | 63 +- llvm/lib/Support/Windows/Threading.inc | 50 +- llvm/lib/Support/Windows/WindowsSupport.h | 8 + llvm/lib/Support/YAMLParser.cpp | 64 +- llvm/lib/Support/YAMLTraits.cpp | 3 +- llvm/lib/Support/raw_ostream.cpp | 12 +- llvm/lib/TableGen/Main.cpp | 2 +- llvm/lib/TableGen/Record.cpp | 57 +- llvm/lib/TableGen/TGLexer.cpp | 16 +- llvm/lib/TableGen/TGLexer.h | 26 +- llvm/lib/TableGen/TGParser.cpp | 258 +- llvm/lib/TableGen/TGParser.h | 74 +- llvm/lib/Target/AArch64/AArch64.td | 123 +- llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp | 87 +- .../Target/AArch64/AArch64CallLowering.cpp | 10 +- .../Target/AArch64/AArch64CallingConvention.h | 3 + .../AArch64/AArch64CallingConvention.td | 29 +- .../AArch64/AArch64CompressJumpTables.cpp | 13 +- .../AArch64/AArch64ConditionOptimizer.cpp | 1 + .../AArch64/AArch64ConditionalCompares.cpp | 4 +- .../AArch64/AArch64ExpandPseudoInsts.cpp | 14 +- .../Target/AArch64/AArch64FalkorHWPFFix.cpp | 1 + llvm/lib/Target/AArch64/AArch64FastISel.cpp | 22 +- .../Target/AArch64/AArch64FrameLowering.cpp | 420 +- .../lib/Target/AArch64/AArch64FrameLowering.h | 11 +- .../Target/AArch64/AArch64ISelDAGToDAG.cpp | 201 +- .../Target/AArch64/AArch64ISelLowering.cpp | 1217 ++++- llvm/lib/Target/AArch64/AArch64ISelLowering.h | 58 +- .../lib/Target/AArch64/AArch64InstrAtomics.td | 6 +- .../lib/Target/AArch64/AArch64InstrFormats.td | 165 +- llvm/lib/Target/AArch64/AArch64InstrInfo.cpp | 1037 ++++- llvm/lib/Target/AArch64/AArch64InstrInfo.h | 28 +- llvm/lib/Target/AArch64/AArch64InstrInfo.td | 255 +- .../AArch64/AArch64InstructionSelector.cpp | 381 +- .../Target/AArch64/AArch64LegalizerInfo.cpp | 11 +- .../AArch64/AArch64LoadStoreOptimizer.cpp | 433 +- .../AArch64/AArch64MachineFunctionInfo.h | 87 +- .../AArch64/AArch64PreLegalizerCombiner.cpp | 23 +- .../Target/AArch64/AArch64PromoteConstant.cpp | 1 + .../AArch64/AArch64RegisterBankInfo.cpp | 7 +- .../Target/AArch64/AArch64RegisterBankInfo.h | 4 +- .../Target/AArch64/AArch64RegisterInfo.cpp | 10 +- .../lib/Target/AArch64/AArch64RegisterInfo.td | 38 +- .../lib/Target/AArch64/AArch64SVEInstrInfo.td | 1165 +++-- .../Target/AArch64/AArch64SchedExynosM1.td | 850 ---- .../Target/AArch64/AArch64SchedExynosM3.td | 20 +- .../Target/AArch64/AArch64SchedExynosM4.td | 32 +- .../Target/AArch64/AArch64SchedExynosM5.td | 1012 ++++ .../Target/AArch64/AArch64SchedPredExynos.td | 14 +- .../Target/AArch64/AArch64SchedPredicates.td | 80 +- .../AArch64/AArch64SchedThunderX2T99.td | 19 - llvm/lib/Target/AArch64/AArch64StackOffset.h | 12 +- .../Target/AArch64/AArch64StackTagging.cpp | 1 + .../AArch64/AArch64StackTaggingPreRA.cpp | 36 +- llvm/lib/Target/AArch64/AArch64Subtarget.cpp | 16 +- llvm/lib/Target/AArch64/AArch64Subtarget.h | 9 +- .../Target/AArch64/AArch64SystemOperands.td | 2 +- .../Target/AArch64/AArch64TargetMachine.cpp | 35 +- .../AArch64/AArch64TargetTransformInfo.cpp | 26 +- .../AArch64/AArch64TargetTransformInfo.h | 35 +- .../AArch64/AsmParser/AArch64AsmParser.cpp | 16 +- .../Disassembler/AArch64Disassembler.cpp | 3 +- .../Disassembler/AArch64Disassembler.h | 3 +- .../MCTargetDesc/AArch64AsmBackend.cpp | 18 +- .../MCTargetDesc/AArch64InstPrinter.cpp | 21 +- .../AArch64/MCTargetDesc/AArch64InstPrinter.h | 16 +- .../MCTargetDesc/AArch64MCCodeEmitter.cpp | 8 +- .../MCTargetDesc/AArch64MCTargetDesc.cpp | 5 +- llvm/lib/Target/AArch64/SVEInstrFormats.td | 1261 ++++- .../AArch64/TargetInfo/AArch64TargetInfo.cpp | 2 +- .../Target/AArch64/Utils/AArch64BaseInfo.h | 19 +- llvm/lib/Target/AMDGPU/AMDGPU.h | 5 + .../Target/AMDGPU/AMDGPUAlwaysInlinePass.cpp | 2 +- .../AMDGPU/AMDGPUAnnotateUniformValues.cpp | 1 + llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp | 25 +- .../Target/AMDGPU/AMDGPUAtomicOptimizer.cpp | 1 + llvm/lib/Target/AMDGPU/AMDGPUCallLowering.cpp | 25 +- .../Target/AMDGPU/AMDGPUCodeGenPrepare.cpp | 8 +- llvm/lib/Target/AMDGPU/AMDGPUGISel.td | 22 +- .../AMDGPU/AMDGPUGenRegisterBankInfo.def | 144 +- .../Target/AMDGPU/AMDGPUGlobalISelUtils.cpp | 45 + .../lib/Target/AMDGPU/AMDGPUGlobalISelUtils.h | 29 + .../AMDGPU/AMDGPUHSAMetadataStreamer.cpp | 14 +- llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp | 38 +- llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp | 103 +- llvm/lib/Target/AMDGPU/AMDGPUISelLowering.h | 3 +- llvm/lib/Target/AMDGPU/AMDGPUInline.cpp | 8 +- llvm/lib/Target/AMDGPU/AMDGPUInstrInfo.td | 24 +- .../AMDGPU/AMDGPUInstructionSelector.cpp | 571 ++- .../Target/AMDGPU/AMDGPUInstructionSelector.h | 37 +- llvm/lib/Target/AMDGPU/AMDGPUInstructions.td | 252 +- .../lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp | 425 +- llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.h | 9 + llvm/lib/Target/AMDGPU/AMDGPULibCalls.cpp | 19 +- llvm/lib/Target/AMDGPU/AMDGPUMCInstLower.cpp | 2 +- .../AMDGPU/AMDGPUMachineCFGStructurizer.cpp | 5 +- .../Target/AMDGPU/AMDGPUMachineFunction.cpp | 1 + .../lib/Target/AMDGPU/AMDGPUMachineFunction.h | 8 + .../AMDGPU/AMDGPUPrintfRuntimeBinding.cpp | 10 + .../lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp | 32 +- .../Target/AMDGPU/AMDGPURegisterBankInfo.cpp | 677 ++- .../Target/AMDGPU/AMDGPURegisterBankInfo.h | 15 +- llvm/lib/Target/AMDGPU/AMDGPURegisterBanks.td | 6 +- .../AMDGPU/AMDGPURewriteOutArguments.cpp | 3 +- .../Target/AMDGPU/AMDGPUSearchableTables.td | 141 + llvm/lib/Target/AMDGPU/AMDGPUSubtarget.cpp | 61 +- llvm/lib/Target/AMDGPU/AMDGPUSubtarget.h | 23 +- .../lib/Target/AMDGPU/AMDGPUTargetMachine.cpp | 9 +- .../AMDGPU/AMDGPUTargetTransformInfo.cpp | 210 +- .../Target/AMDGPU/AMDGPUTargetTransformInfo.h | 31 +- .../AMDGPU/AMDGPUUnifyDivergentExitNodes.cpp | 3 +- .../lib/Target/AMDGPU/AMDGPUUnifyMetadata.cpp | 4 +- .../Target/AMDGPU/AMDILCFGStructurizer.cpp | 3 +- .../AMDGPU/AsmParser/AMDGPUAsmParser.cpp | 46 +- llvm/lib/Target/AMDGPU/BUFInstructions.td | 4 +- llvm/lib/Target/AMDGPU/DSInstructions.td | 10 +- .../Disassembler/AMDGPUDisassembler.cpp | 14 +- .../AMDGPU/Disassembler/AMDGPUDisassembler.h | 2 +- llvm/lib/Target/AMDGPU/FLATInstructions.td | 111 +- llvm/lib/Target/AMDGPU/GCNDPPCombine.cpp | 18 +- .../lib/Target/AMDGPU/GCNHazardRecognizer.cpp | 4 +- llvm/lib/Target/AMDGPU/GCNNSAReassign.cpp | 1 + llvm/lib/Target/AMDGPU/GCNRegBankReassign.cpp | 3 +- llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp | 13 +- .../AMDGPU/MCTargetDesc/AMDGPUInstPrinter.cpp | 14 +- .../AMDGPU/MCTargetDesc/AMDGPUInstPrinter.h | 14 +- .../AMDGPU/MCTargetDesc/AMDGPUMCAsmInfo.cpp | 4 +- .../AMDGPU/MCTargetDesc/AMDGPUMCAsmInfo.h | 2 +- .../MCTargetDesc/AMDGPUMCTargetDesc.cpp | 2 +- .../MCTargetDesc/AMDGPUTargetStreamer.cpp | 1 + llvm/lib/Target/AMDGPU/MIMGInstructions.td | 10 +- llvm/lib/Target/AMDGPU/R600AsmPrinter.cpp | 2 +- llvm/lib/Target/AMDGPU/R600ISelLowering.cpp | 48 +- llvm/lib/Target/AMDGPU/R600InstrInfo.cpp | 6 +- llvm/lib/Target/AMDGPU/R600InstrInfo.h | 2 +- llvm/lib/Target/AMDGPU/R600Instructions.td | 25 +- .../Target/AMDGPU/SIAnnotateControlFlow.cpp | 1 + llvm/lib/Target/AMDGPU/SIFixSGPRCopies.cpp | 3 +- llvm/lib/Target/AMDGPU/SIFoldOperands.cpp | 235 +- .../lib/Target/AMDGPU/SIFormMemoryClauses.cpp | 3 +- llvm/lib/Target/AMDGPU/SIFrameLowering.cpp | 10 +- llvm/lib/Target/AMDGPU/SIISelLowering.cpp | 265 +- llvm/lib/Target/AMDGPU/SIISelLowering.h | 21 +- llvm/lib/Target/AMDGPU/SIInsertSkips.cpp | 5 +- llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp | 70 +- llvm/lib/Target/AMDGPU/SIInstrInfo.cpp | 170 +- llvm/lib/Target/AMDGPU/SIInstrInfo.h | 25 +- llvm/lib/Target/AMDGPU/SIInstrInfo.td | 132 +- llvm/lib/Target/AMDGPU/SIInstructions.td | 135 +- .../Target/AMDGPU/SILoadStoreOptimizer.cpp | 705 ++- llvm/lib/Target/AMDGPU/SILowerControlFlow.cpp | 17 +- llvm/lib/Target/AMDGPU/SILowerI1Copies.cpp | 216 +- llvm/lib/Target/AMDGPU/SILowerSGPRSpills.cpp | 1 + .../Target/AMDGPU/SIMachineFunctionInfo.cpp | 1 - .../lib/Target/AMDGPU/SIMachineFunctionInfo.h | 19 +- llvm/lib/Target/AMDGPU/SIMachineScheduler.cpp | 14 +- llvm/lib/Target/AMDGPU/SIMachineScheduler.h | 1 - .../Target/AMDGPU/SIOptimizeExecMasking.cpp | 21 +- .../AMDGPU/SIOptimizeExecMaskingPreRA.cpp | 3 +- llvm/lib/Target/AMDGPU/SIPeepholeSDWA.cpp | 5 +- .../Target/AMDGPU/SIPreAllocateWWMRegs.cpp | 9 +- llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp | 49 +- llvm/lib/Target/AMDGPU/SIRegisterInfo.h | 5 + llvm/lib/Target/AMDGPU/SIRegisterInfo.td | 16 +- .../AMDGPU/SIRemoveShortExecBranches.cpp | 158 + .../Target/AMDGPU/SIShrinkInstructions.cpp | 4 +- llvm/lib/Target/AMDGPU/SIWholeQuadMode.cpp | 30 +- llvm/lib/Target/AMDGPU/SMInstructions.td | 10 +- llvm/lib/Target/AMDGPU/SOPInstructions.td | 23 +- .../AMDGPU/TargetInfo/AMDGPUTargetInfo.cpp | 2 +- .../Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp | 42 +- llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h | 61 +- llvm/lib/Target/AMDGPU/VOP1Instructions.td | 87 +- llvm/lib/Target/AMDGPU/VOP2Instructions.td | 43 +- llvm/lib/Target/AMDGPU/VOP3Instructions.td | 42 +- llvm/lib/Target/AMDGPU/VOP3PInstructions.td | 4 +- llvm/lib/Target/AMDGPU/VOPCInstructions.td | 4 +- llvm/lib/Target/ARC/ARCAsmPrinter.cpp | 2 +- llvm/lib/Target/ARC/ARCBranchFinalize.cpp | 1 + llvm/lib/Target/ARC/ARCISelLowering.cpp | 2 +- llvm/lib/Target/ARC/ARCInstrInfo.cpp | 4 +- llvm/lib/Target/ARC/ARCInstrInfo.h | 2 +- llvm/lib/Target/ARC/ARCOptAddrMode.cpp | 3 +- llvm/lib/Target/ARC/ARCRegisterInfo.cpp | 2 +- llvm/lib/Target/ARC/ARCTargetMachine.cpp | 2 +- .../ARC/Disassembler/ARCDisassembler.cpp | 4 +- .../ARC/MCTargetDesc/ARCInstPrinter.cpp | 7 +- .../Target/ARC/MCTargetDesc/ARCInstPrinter.h | 6 +- .../ARC/MCTargetDesc/ARCMCTargetDesc.cpp | 5 +- .../Target/ARC/TargetInfo/ARCTargetInfo.cpp | 2 +- llvm/lib/Target/ARM/A15SDOptimizer.cpp | 3 +- llvm/lib/Target/ARM/ARM.h | 4 +- llvm/lib/Target/ARM/ARM.td | 32 +- llvm/lib/Target/ARM/ARMAsmPrinter.cpp | 12 +- llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp | 89 +- llvm/lib/Target/ARM/ARMBaseInstrInfo.h | 128 +- llvm/lib/Target/ARM/ARMBaseRegisterInfo.cpp | 9 +- llvm/lib/Target/ARM/ARMCallLowering.cpp | 2 +- llvm/lib/Target/ARM/ARMCallingConv.cpp | 46 +- llvm/lib/Target/ARM/ARMCallingConv.h | 3 + llvm/lib/Target/ARM/ARMCallingConv.td | 35 +- llvm/lib/Target/ARM/ARMConstantIslandPass.cpp | 20 +- llvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp | 21 +- llvm/lib/Target/ARM/ARMFastISel.cpp | 10 +- llvm/lib/Target/ARM/ARMFrameLowering.cpp | 12 +- llvm/lib/Target/ARM/ARMFrameLowering.h | 2 + llvm/lib/Target/ARM/ARMHazardRecognizer.h | 7 +- llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp | 611 ++- llvm/lib/Target/ARM/ARMISelLowering.cpp | 727 ++- llvm/lib/Target/ARM/ARMISelLowering.h | 26 +- llvm/lib/Target/ARM/ARMInstrInfo.td | 61 +- llvm/lib/Target/ARM/ARMInstrMVE.td | 2779 +++++++---- llvm/lib/Target/ARM/ARMInstrNEON.td | 169 +- llvm/lib/Target/ARM/ARMInstrThumb2.td | 228 +- llvm/lib/Target/ARM/ARMInstrVFP.td | 31 +- .../lib/Target/ARM/ARMInstructionSelector.cpp | 18 +- llvm/lib/Target/ARM/ARMLegalizerInfo.cpp | 10 +- llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp | 27 +- llvm/lib/Target/ARM/ARMLowOverheadLoops.cpp | 972 +++- llvm/lib/Target/ARM/ARMParallelDSP.cpp | 15 +- llvm/lib/Target/ARM/ARMPredicates.td | 8 +- llvm/lib/Target/ARM/ARMRegisterBankInfo.cpp | 7 +- llvm/lib/Target/ARM/ARMRegisterBankInfo.h | 4 +- llvm/lib/Target/ARM/ARMSubtarget.cpp | 17 +- llvm/lib/Target/ARM/ARMSubtarget.h | 20 +- llvm/lib/Target/ARM/ARMTargetMachine.cpp | 33 +- llvm/lib/Target/ARM/ARMTargetMachine.h | 2 + .../lib/Target/ARM/ARMTargetTransformInfo.cpp | 333 +- llvm/lib/Target/ARM/ARMTargetTransformInfo.h | 36 +- .../lib/Target/ARM/AsmParser/ARMAsmParser.cpp | 105 +- .../ARM/Disassembler/ARMDisassembler.cpp | 95 +- .../ARM/MCTargetDesc/ARMELFObjectWriter.cpp | 7 +- .../ARM/MCTargetDesc/ARMELFStreamer.cpp | 29 +- .../ARM/MCTargetDesc/ARMInstPrinter.cpp | 11 +- .../Target/ARM/MCTargetDesc/ARMInstPrinter.h | 8 +- .../ARM/MCTargetDesc/ARMMCTargetDesc.cpp | 8 +- .../ARM/MCTargetDesc/ARMUnwindOpAsm.cpp | 2 +- .../Target/ARM/MCTargetDesc/ARMUnwindOpAsm.h | 2 +- .../Target/ARM/MVEGatherScatterLowering.cpp | 301 ++ llvm/lib/Target/ARM/MVETailPredication.cpp | 169 +- llvm/lib/Target/ARM/MVEVPTBlockPass.cpp | 161 +- .../Target/ARM/TargetInfo/ARMTargetInfo.cpp | 2 +- llvm/lib/Target/ARM/Thumb1InstrInfo.cpp | 4 +- llvm/lib/Target/ARM/Thumb1InstrInfo.h | 2 +- llvm/lib/Target/ARM/Thumb2InstrInfo.cpp | 121 +- llvm/lib/Target/ARM/Thumb2InstrInfo.h | 2 +- llvm/lib/Target/ARM/Utils/ARMBaseInfo.h | 53 + llvm/lib/Target/AVR/AVRAsmPrinter.cpp | 2 +- llvm/lib/Target/AVR/AVRExpandPseudoInsts.cpp | 91 + llvm/lib/Target/AVR/AVRISelLowering.cpp | 9 +- llvm/lib/Target/AVR/AVRISelLowering.h | 2 +- llvm/lib/Target/AVR/AVRInstrFormats.td | 4 +- llvm/lib/Target/AVR/AVRInstrInfo.cpp | 4 +- llvm/lib/Target/AVR/AVRInstrInfo.h | 2 +- llvm/lib/Target/AVR/AVRInstrInfo.td | 14 +- llvm/lib/Target/AVR/AVRTargetMachine.cpp | 2 +- .../lib/Target/AVR/AsmParser/AVRAsmParser.cpp | 2 +- .../AVR/Disassembler/AVRDisassembler.cpp | 4 +- .../AVR/MCTargetDesc/AVRInstPrinter.cpp | 7 +- .../Target/AVR/MCTargetDesc/AVRInstPrinter.h | 6 +- .../Target/AVR/MCTargetDesc/AVRMCAsmInfo.cpp | 2 +- .../Target/AVR/MCTargetDesc/AVRMCAsmInfo.h | 2 +- .../AVR/MCTargetDesc/AVRMCCodeEmitter.cpp | 8 +- .../AVR/MCTargetDesc/AVRMCTargetDesc.cpp | 2 +- .../Target/AVR/TargetInfo/AVRTargetInfo.cpp | 2 +- .../lib/Target/BPF/AsmParser/BPFAsmParser.cpp | 2 +- .../Target/BPF/BPFAbstractMemberAccess.cpp | 84 +- llvm/lib/Target/BPF/BPFAsmPrinter.cpp | 2 +- llvm/lib/Target/BPF/BPFISelDAGToDAG.cpp | 1 + llvm/lib/Target/BPF/BPFInstrInfo.cpp | 4 +- llvm/lib/Target/BPF/BPFInstrInfo.h | 2 +- llvm/lib/Target/BPF/BPFInstrInfo.td | 19 + llvm/lib/Target/BPF/BPFMIPeephole.cpp | 103 +- .../lib/Target/BPF/BPFMISimplifyPatchable.cpp | 163 +- llvm/lib/Target/BPF/BPFSubtarget.cpp | 1 + llvm/lib/Target/BPF/BPFTargetMachine.cpp | 2 +- llvm/lib/Target/BPF/BTF.h | 10 +- llvm/lib/Target/BPF/BTFDebug.cpp | 157 +- llvm/lib/Target/BPF/BTFDebug.h | 19 +- .../BPF/Disassembler/BPFDisassembler.cpp | 4 +- .../BPF/MCTargetDesc/BPFInstPrinter.cpp | 7 +- .../Target/BPF/MCTargetDesc/BPFInstPrinter.h | 6 +- .../Target/BPF/MCTargetDesc/BPFMCAsmInfo.h | 2 +- .../BPF/MCTargetDesc/BPFMCTargetDesc.cpp | 2 +- .../Target/BPF/TargetInfo/BPFTargetInfo.cpp | 2 +- .../Hexagon/AsmParser/HexagonAsmParser.cpp | 4 +- llvm/lib/Target/Hexagon/BitTracker.cpp | 2 +- .../Disassembler/HexagonDisassembler.cpp | 17 +- llvm/lib/Target/Hexagon/HexagonAsmPrinter.cpp | 2 +- .../lib/Target/Hexagon/HexagonBitSimplify.cpp | 1 + llvm/lib/Target/Hexagon/HexagonCommonGEP.cpp | 9 +- .../Target/Hexagon/HexagonConstExtenders.cpp | 11 +- .../Hexagon/HexagonConstPropagation.cpp | 16 +- .../Target/Hexagon/HexagonDepMapAsm2Intrin.td | 2 +- .../lib/Target/Hexagon/HexagonEarlyIfConv.cpp | 5 +- .../Target/Hexagon/HexagonExpandCondsets.cpp | 3 +- .../Target/Hexagon/HexagonFrameLowering.cpp | 96 +- llvm/lib/Target/Hexagon/HexagonGenExtract.cpp | 2 + llvm/lib/Target/Hexagon/HexagonGenInsert.cpp | 5 + llvm/lib/Target/Hexagon/HexagonGenMux.cpp | 10 +- .../Target/Hexagon/HexagonGenPredicate.cpp | 1 + .../Target/Hexagon/HexagonHardwareLoops.cpp | 1 + .../Target/Hexagon/HexagonISelDAGToDAG.cpp | 21 +- llvm/lib/Target/Hexagon/HexagonISelDAGToDAG.h | 4 + .../Target/Hexagon/HexagonISelDAGToDAGHVX.cpp | 1 + .../Target/Hexagon/HexagonISelLowering.cpp | 89 +- llvm/lib/Target/Hexagon/HexagonISelLowering.h | 5 +- .../Target/Hexagon/HexagonISelLoweringHVX.cpp | 7 + llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp | 179 +- llvm/lib/Target/Hexagon/HexagonInstrInfo.h | 2 +- llvm/lib/Target/Hexagon/HexagonIntrinsics.td | 3 - .../Hexagon/HexagonLoopIdiomRecognition.cpp | 20 +- .../Target/Hexagon/HexagonNewValueJump.cpp | 1 + .../lib/Target/Hexagon/HexagonOptAddrMode.cpp | 1 + .../Hexagon/HexagonOptimizeSZextends.cpp | 1 + llvm/lib/Target/Hexagon/HexagonPatterns.td | 4 +- llvm/lib/Target/Hexagon/HexagonPseudo.td | 20 +- llvm/lib/Target/Hexagon/HexagonRDFOpt.cpp | 1 + .../Target/Hexagon/HexagonRegisterInfo.cpp | 5 + .../lib/Target/Hexagon/HexagonRegisterInfo.td | 2 +- .../lib/Target/Hexagon/HexagonSplitDouble.cpp | 2 +- .../Target/Hexagon/HexagonStoreWidening.cpp | 7 +- .../Target/Hexagon/HexagonTargetMachine.cpp | 2 +- .../Hexagon/HexagonTargetTransformInfo.cpp | 42 +- .../Hexagon/HexagonTargetTransformInfo.h | 19 +- llvm/lib/Target/Hexagon/HexagonVExtract.cpp | 44 +- .../Target/Hexagon/HexagonVLIWPacketizer.cpp | 9 +- .../Hexagon/HexagonVectorLoopCarriedReuse.cpp | 4 +- .../MCTargetDesc/HexagonAsmBackend.cpp | 2 +- .../MCTargetDesc/HexagonInstPrinter.cpp | 11 +- .../Hexagon/MCTargetDesc/HexagonInstPrinter.h | 6 +- .../MCTargetDesc/HexagonMCCompound.cpp | 10 +- .../MCTargetDesc/HexagonMCTargetDesc.cpp | 12 +- llvm/lib/Target/Hexagon/RDFLiveness.cpp | 10 +- .../Hexagon/TargetInfo/HexagonTargetInfo.cpp | 2 +- .../Target/Lanai/AsmParser/LanaiAsmParser.cpp | 2 +- .../Lanai/Disassembler/LanaiDisassembler.cpp | 9 +- .../Lanai/Disassembler/LanaiDisassembler.h | 3 +- llvm/lib/Target/Lanai/LanaiAsmPrinter.cpp | 2 +- llvm/lib/Target/Lanai/LanaiISelLowering.cpp | 2 +- llvm/lib/Target/Lanai/LanaiISelLowering.h | 2 +- llvm/lib/Target/Lanai/LanaiInstrInfo.cpp | 10 +- llvm/lib/Target/Lanai/LanaiInstrInfo.h | 4 +- llvm/lib/Target/Lanai/LanaiTargetMachine.cpp | 2 +- .../Target/Lanai/LanaiTargetTransformInfo.h | 9 +- .../Lanai/MCTargetDesc/LanaiInstPrinter.cpp | 7 +- .../Lanai/MCTargetDesc/LanaiInstPrinter.h | 6 +- .../Lanai/MCTargetDesc/LanaiMCAsmInfo.cpp | 3 +- .../Lanai/MCTargetDesc/LanaiMCAsmInfo.h | 3 +- .../Lanai/MCTargetDesc/LanaiMCTargetDesc.cpp | 2 +- .../Lanai/TargetInfo/LanaiTargetInfo.cpp | 2 +- .../MSP430/AsmParser/MSP430AsmParser.cpp | 2 +- .../Disassembler/MSP430Disassembler.cpp | 16 +- .../MSP430/MCTargetDesc/MSP430InstPrinter.cpp | 7 +- .../MSP430/MCTargetDesc/MSP430InstPrinter.h | 6 +- .../MSP430/MCTargetDesc/MSP430MCAsmInfo.cpp | 3 +- .../MSP430/MCTargetDesc/MSP430MCAsmInfo.h | 2 +- .../MCTargetDesc/MSP430MCTargetDesc.cpp | 2 +- llvm/lib/Target/MSP430/MSP430AsmPrinter.cpp | 2 +- llvm/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp | 23 +- llvm/lib/Target/MSP430/MSP430ISelLowering.cpp | 20 +- llvm/lib/Target/MSP430/MSP430ISelLowering.h | 3 +- llvm/lib/Target/MSP430/MSP430InstrInfo.cpp | 4 +- llvm/lib/Target/MSP430/MSP430InstrInfo.h | 2 +- .../Target/MSP430/MSP430MachineFunctionInfo.h | 10 +- llvm/lib/Target/MSP430/MSP430Subtarget.h | 4 +- .../lib/Target/MSP430/MSP430TargetMachine.cpp | 2 +- .../MSP430/TargetInfo/MSP430TargetInfo.cpp | 2 +- .../Target/Mips/AsmParser/MipsAsmParser.cpp | 441 +- .../Mips/Disassembler/MipsDisassembler.cpp | 42 +- .../Mips/MCTargetDesc/MipsABIFlagsSection.h | 4 +- .../Target/Mips/MCTargetDesc/MipsABIInfo.cpp | 1 + .../Mips/MCTargetDesc/MipsAsmBackend.cpp | 6 +- .../Target/Mips/MCTargetDesc/MipsBaseInfo.h | 12 +- .../Mips/MCTargetDesc/MipsInstPrinter.cpp | 7 +- .../Mips/MCTargetDesc/MipsInstPrinter.h | 6 +- .../Mips/MCTargetDesc/MipsMCAsmInfo.cpp | 18 +- .../Target/Mips/MCTargetDesc/MipsMCAsmInfo.h | 3 +- .../Mips/MCTargetDesc/MipsMCCodeEmitter.cpp | 15 +- .../Target/Mips/MCTargetDesc/MipsMCExpr.cpp | 3 +- .../Mips/MCTargetDesc/MipsMCTargetDesc.cpp | 9 +- .../Mips/MCTargetDesc/MipsNaClELFStreamer.cpp | 4 +- .../Mips/MCTargetDesc/MipsOptionRecord.cpp | 24 +- .../Mips/MCTargetDesc/MipsTargetStreamer.cpp | 35 - .../Target/Mips/MicroMips32r6InstrFormats.td | 17 +- .../lib/Target/Mips/MicroMips32r6InstrInfo.td | 22 +- llvm/lib/Target/Mips/MicroMipsInstrFPU.td | 3 +- llvm/lib/Target/Mips/MicroMipsInstrInfo.td | 9 +- llvm/lib/Target/Mips/Mips.td | 17 +- llvm/lib/Target/Mips/Mips16ISelLowering.cpp | 3 - llvm/lib/Target/Mips/Mips16InstrInfo.cpp | 23 +- llvm/lib/Target/Mips/Mips16InstrInfo.h | 9 +- llvm/lib/Target/Mips/Mips16InstrInfo.td | 8 +- llvm/lib/Target/Mips/Mips32r6InstrInfo.td | 10 +- llvm/lib/Target/Mips/Mips64InstrInfo.td | 43 +- llvm/lib/Target/Mips/Mips64r6InstrInfo.td | 7 +- llvm/lib/Target/Mips/MipsAsmPrinter.cpp | 12 +- llvm/lib/Target/Mips/MipsCallLowering.cpp | 5 +- llvm/lib/Target/Mips/MipsCallingConv.td | 3 +- llvm/lib/Target/Mips/MipsCondMov.td | 16 +- .../Target/Mips/MipsConstantIslandPass.cpp | 10 +- llvm/lib/Target/Mips/MipsDSPInstrInfo.td | 11 +- llvm/lib/Target/Mips/MipsDelaySlotFiller.cpp | 72 +- llvm/lib/Target/Mips/MipsExpandPseudo.cpp | 230 +- llvm/lib/Target/Mips/MipsISelDAGToDAG.cpp | 1 - llvm/lib/Target/Mips/MipsISelLowering.cpp | 220 +- llvm/lib/Target/Mips/MipsISelLowering.h | 2 +- llvm/lib/Target/Mips/MipsInstrFPU.td | 48 +- llvm/lib/Target/Mips/MipsInstrFormats.td | 19 +- llvm/lib/Target/Mips/MipsInstrInfo.cpp | 4 +- llvm/lib/Target/Mips/MipsInstrInfo.td | 194 +- .../Target/Mips/MipsInstructionSelector.cpp | 156 +- llvm/lib/Target/Mips/MipsLegalizerInfo.cpp | 113 +- llvm/lib/Target/Mips/MipsMCInstLower.cpp | 8 +- llvm/lib/Target/Mips/MipsMCInstLower.h | 4 +- llvm/lib/Target/Mips/MipsMSAInstrInfo.td | 1 + .../Target/Mips/MipsPreLegalizerCombiner.cpp | 1 + llvm/lib/Target/Mips/MipsRegisterBankInfo.cpp | 27 +- llvm/lib/Target/Mips/MipsRegisterBankInfo.h | 4 +- llvm/lib/Target/Mips/MipsSEISelDAGToDAG.cpp | 22 +- llvm/lib/Target/Mips/MipsSEISelLowering.cpp | 1 + llvm/lib/Target/Mips/MipsSEInstrInfo.cpp | 27 +- llvm/lib/Target/Mips/MipsSEInstrInfo.h | 10 +- llvm/lib/Target/Mips/MipsScheduleGeneric.td | 12 +- llvm/lib/Target/Mips/MipsScheduleP5600.td | 6 +- llvm/lib/Target/Mips/MipsSubtarget.cpp | 25 +- llvm/lib/Target/Mips/MipsSubtarget.h | 4 + llvm/lib/Target/Mips/MipsTargetMachine.cpp | 7 +- llvm/lib/Target/Mips/MipsTargetStreamer.h | 4 - .../Target/Mips/TargetInfo/MipsTargetInfo.cpp | 2 +- .../NVPTX/MCTargetDesc/NVPTXInstPrinter.cpp | 7 +- .../NVPTX/MCTargetDesc/NVPTXInstPrinter.h | 6 +- .../NVPTX/MCTargetDesc/NVPTXMCAsmInfo.cpp | 3 +- .../NVPTX/MCTargetDesc/NVPTXMCAsmInfo.h | 3 +- .../NVPTX/MCTargetDesc/NVPTXMCTargetDesc.cpp | 2 +- llvm/lib/Target/NVPTX/ManagedStringPool.h | 2 +- llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp | 2 +- llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp | 9 +- llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.h | 2 +- llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp | 1 + llvm/lib/Target/NVPTX/NVPTXISelLowering.h | 5 +- llvm/lib/Target/NVPTX/NVPTXImageOptimizer.cpp | 1 + llvm/lib/Target/NVPTX/NVPTXInstrInfo.cpp | 4 +- llvm/lib/Target/NVPTX/NVPTXInstrInfo.h | 2 +- llvm/lib/Target/NVPTX/NVPTXIntrinsics.td | 42 +- llvm/lib/Target/NVPTX/NVPTXLowerAlloca.cpp | 3 +- llvm/lib/Target/NVPTX/NVPTXTargetMachine.cpp | 2 +- .../Target/NVPTX/NVPTXTargetTransformInfo.cpp | 4 +- .../Target/NVPTX/NVPTXTargetTransformInfo.h | 3 +- llvm/lib/Target/NVPTX/NVVMIntrRange.cpp | 2 + llvm/lib/Target/NVPTX/NVVMReflect.cpp | 1 + .../NVPTX/TargetInfo/NVPTXTargetInfo.cpp | 2 +- .../Target/PowerPC/AsmParser/PPCAsmParser.cpp | 90 +- .../PowerPC/Disassembler/PPCDisassembler.cpp | 6 +- .../PowerPC/MCTargetDesc/PPCInstPrinter.cpp | 8 +- .../PowerPC/MCTargetDesc/PPCInstPrinter.h | 6 +- .../PowerPC/MCTargetDesc/PPCMCAsmInfo.cpp | 28 +- .../PowerPC/MCTargetDesc/PPCMCAsmInfo.h | 7 - .../PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp | 23 +- .../PowerPC/MCTargetDesc/PPCMCTargetDesc.h | 24 + llvm/lib/Target/PowerPC/P9InstrResources.td | 229 +- llvm/lib/Target/PowerPC/PPC.h | 11 +- llvm/lib/Target/PowerPC/PPC.td | 175 +- llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp | 356 +- .../Target/PowerPC/PPCBranchCoalescing.cpp | 1 + llvm/lib/Target/PowerPC/PPCCTRLoops.cpp | 4 +- llvm/lib/Target/PowerPC/PPCFrameLowering.cpp | 7 +- .../Target/PowerPC/PPCHazardRecognizers.cpp | 4 +- llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp | 401 +- llvm/lib/Target/PowerPC/PPCISelLowering.cpp | 1355 ++++-- llvm/lib/Target/PowerPC/PPCISelLowering.h | 936 ++-- llvm/lib/Target/PowerPC/PPCInstr64Bit.td | 78 +- llvm/lib/Target/PowerPC/PPCInstrAltivec.td | 121 +- llvm/lib/Target/PowerPC/PPCInstrFormats.td | 61 +- llvm/lib/Target/PowerPC/PPCInstrHTM.td | 16 +- llvm/lib/Target/PowerPC/PPCInstrInfo.cpp | 549 ++- llvm/lib/Target/PowerPC/PPCInstrInfo.h | 14 +- llvm/lib/Target/PowerPC/PPCInstrInfo.td | 383 +- llvm/lib/Target/PowerPC/PPCInstrVSX.td | 190 +- ...reIncPrep.cpp => PPCLoopInstrFormPrep.cpp} | 439 +- .../Target/PowerPC/PPCLowerMASSVEntries.cpp | 164 + llvm/lib/Target/PowerPC/PPCMIPeephole.cpp | 380 +- .../Target/PowerPC/PPCMachineFunctionInfo.h | 2 +- .../lib/Target/PowerPC/PPCPreEmitPeephole.cpp | 25 +- .../Target/PowerPC/PPCReduceCRLogicals.cpp | 13 +- llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp | 35 +- llvm/lib/Target/PowerPC/PPCRegisterInfo.h | 9 + llvm/lib/Target/PowerPC/PPCSubtarget.cpp | 7 +- llvm/lib/Target/PowerPC/PPCSubtarget.h | 45 +- llvm/lib/Target/PowerPC/PPCTLSDynamicCall.cpp | 1 + llvm/lib/Target/PowerPC/PPCTargetMachine.cpp | 20 +- .../Target/PowerPC/PPCTargetTransformInfo.cpp | 96 +- .../Target/PowerPC/PPCTargetTransformInfo.h | 17 +- llvm/lib/Target/PowerPC/PPCVSXFMAMutate.cpp | 1 + .../PowerPC/TargetInfo/PowerPCTargetInfo.cpp | 2 +- .../Target/RISCV/AsmParser/RISCVAsmParser.cpp | 61 +- .../RISCV/Disassembler/RISCVDisassembler.cpp | 4 +- .../RISCV/MCTargetDesc/RISCVAsmBackend.cpp | 10 +- .../MCTargetDesc/RISCVELFObjectWriter.cpp | 13 +- .../RISCV/MCTargetDesc/RISCVInstPrinter.cpp | 7 +- .../RISCV/MCTargetDesc/RISCVInstPrinter.h | 8 +- .../Target/RISCV/MCTargetDesc/RISCVMCExpr.cpp | 6 +- .../RISCV/MCTargetDesc/RISCVMCTargetDesc.cpp | 5 +- llvm/lib/Target/RISCV/RISCV.td | 29 +- llvm/lib/Target/RISCV/RISCVAsmPrinter.cpp | 16 +- .../Target/RISCV/RISCVExpandPseudoInsts.cpp | 6 +- llvm/lib/Target/RISCV/RISCVFrameLowering.cpp | 132 +- llvm/lib/Target/RISCV/RISCVFrameLowering.h | 2 + llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp | 3 +- llvm/lib/Target/RISCV/RISCVISelLowering.cpp | 91 +- llvm/lib/Target/RISCV/RISCVISelLowering.h | 13 + llvm/lib/Target/RISCV/RISCVInstrInfo.cpp | 259 +- llvm/lib/Target/RISCV/RISCVInstrInfo.h | 46 +- llvm/lib/Target/RISCV/RISCVInstrInfo.td | 23 +- llvm/lib/Target/RISCV/RISCVInstrInfoA.td | 2 +- llvm/lib/Target/RISCV/RISCVInstrInfoD.td | 3 + llvm/lib/Target/RISCV/RISCVRegisterInfo.cpp | 18 +- llvm/lib/Target/RISCV/RISCVRegisterInfo.h | 2 + llvm/lib/Target/RISCV/RISCVSubtarget.cpp | 1 + llvm/lib/Target/RISCV/RISCVSubtarget.h | 5 + llvm/lib/Target/RISCV/RISCVTargetMachine.cpp | 33 +- llvm/lib/Target/RISCV/RISCVTargetMachine.h | 10 +- .../Target/RISCV/RISCVTargetTransformInfo.cpp | 6 +- .../Target/RISCV/RISCVTargetTransformInfo.h | 6 +- .../RISCV/TargetInfo/RISCVTargetInfo.cpp | 2 +- llvm/lib/Target/RISCV/Utils/RISCVBaseInfo.cpp | 17 +- llvm/lib/Target/RISCV/Utils/RISCVBaseInfo.h | 36 +- .../Target/Sparc/AsmParser/SparcAsmParser.cpp | 2 +- llvm/lib/Target/Sparc/DelaySlotFiller.cpp | 2 +- .../Sparc/Disassembler/SparcDisassembler.cpp | 4 +- llvm/lib/Target/Sparc/LeonPasses.h | 2 +- .../Sparc/MCTargetDesc/SparcInstPrinter.cpp | 7 +- .../Sparc/MCTargetDesc/SparcInstPrinter.h | 8 +- .../Sparc/MCTargetDesc/SparcMCTargetDesc.cpp | 8 +- llvm/lib/Target/Sparc/SparcAsmPrinter.cpp | 2 +- llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp | 3 +- llvm/lib/Target/Sparc/SparcISelLowering.cpp | 2 +- llvm/lib/Target/Sparc/SparcISelLowering.h | 2 +- llvm/lib/Target/Sparc/SparcInstr64Bit.td | 2 - llvm/lib/Target/Sparc/SparcInstrInfo.cpp | 4 +- llvm/lib/Target/Sparc/SparcInstrInfo.h | 2 +- llvm/lib/Target/Sparc/SparcInstrInfo.td | 5 +- llvm/lib/Target/Sparc/SparcTargetMachine.cpp | 2 +- .../Sparc/TargetInfo/SparcTargetInfo.cpp | 2 +- .../SystemZ/AsmParser/SystemZAsmParser.cpp | 24 +- .../Disassembler/SystemZDisassembler.cpp | 4 +- .../MCTargetDesc/SystemZInstPrinter.cpp | 16 +- .../SystemZ/MCTargetDesc/SystemZInstPrinter.h | 6 +- .../MCTargetDesc/SystemZMCTargetDesc.cpp | 5 +- llvm/lib/Target/SystemZ/SystemZ.h | 2 +- llvm/lib/Target/SystemZ/SystemZAsmPrinter.cpp | 31 +- llvm/lib/Target/SystemZ/SystemZCallingConv.h | 7 + llvm/lib/Target/SystemZ/SystemZCallingConv.td | 27 + .../lib/Target/SystemZ/SystemZElimCompare.cpp | 169 +- .../Target/SystemZ/SystemZFrameLowering.cpp | 264 +- .../lib/Target/SystemZ/SystemZFrameLowering.h | 11 +- .../Target/SystemZ/SystemZISelDAGToDAG.cpp | 14 +- .../Target/SystemZ/SystemZISelLowering.cpp | 377 +- llvm/lib/Target/SystemZ/SystemZISelLowering.h | 31 +- llvm/lib/Target/SystemZ/SystemZInstrFP.td | 60 +- .../lib/Target/SystemZ/SystemZInstrFormats.td | 30 +- llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp | 58 +- llvm/lib/Target/SystemZ/SystemZInstrInfo.h | 9 +- llvm/lib/Target/SystemZ/SystemZInstrInfo.td | 19 +- llvm/lib/Target/SystemZ/SystemZInstrVector.td | 52 +- llvm/lib/Target/SystemZ/SystemZLongBranch.cpp | 2 +- .../SystemZ/SystemZMachineFunctionInfo.h | 48 +- llvm/lib/Target/SystemZ/SystemZOperands.td | 22 +- llvm/lib/Target/SystemZ/SystemZOperators.td | 40 + llvm/lib/Target/SystemZ/SystemZPatterns.td | 4 +- .../Target/SystemZ/SystemZRegisterInfo.cpp | 96 +- .../lib/Target/SystemZ/SystemZShortenInst.cpp | 38 +- llvm/lib/Target/SystemZ/SystemZTDC.cpp | 1 + .../Target/SystemZ/SystemZTargetMachine.cpp | 2 +- .../SystemZ/SystemZTargetTransformInfo.cpp | 21 +- .../SystemZ/SystemZTargetTransformInfo.h | 11 +- .../SystemZ/TargetInfo/SystemZTargetInfo.cpp | 2 +- llvm/lib/Target/TargetMachine.cpp | 19 +- llvm/lib/Target/TargetMachineC.cpp | 6 +- .../Target/VE/InstPrinter/VEInstPrinter.cpp | 118 + .../lib/Target/VE/InstPrinter/VEInstPrinter.h | 49 + .../Target/VE/MCTargetDesc/VEMCAsmInfo.cpp | 40 + llvm/lib/Target/VE/MCTargetDesc/VEMCAsmInfo.h | 31 + .../Target/VE/MCTargetDesc/VEMCTargetDesc.cpp | 106 + .../Target/VE/MCTargetDesc/VEMCTargetDesc.h | 53 + .../VE/MCTargetDesc/VETargetStreamer.cpp | 44 + .../Target/VE/MCTargetDesc/VETargetStreamer.h | 47 + .../lib/Target/VE/TargetInfo/VETargetInfo.cpp | 23 + llvm/lib/Target/VE/VE.h | 109 + llvm/lib/Target/VE/VE.td | 56 + llvm/lib/Target/VE/VEAsmPrinter.cpp | 78 + llvm/lib/Target/VE/VECallingConv.td | 19 + llvm/lib/Target/VE/VEFrameLowering.cpp | 325 ++ llvm/lib/Target/VE/VEFrameLowering.h | 81 + llvm/lib/Target/VE/VEISelDAGToDAG.cpp | 70 + llvm/lib/Target/VE/VEISelLowering.cpp | 137 + llvm/lib/Target/VE/VEISelLowering.h | 62 + llvm/lib/Target/VE/VEInstrFormats.td | 75 + llvm/lib/Target/VE/VEInstrInfo.cpp | 133 + llvm/lib/Target/VE/VEInstrInfo.h | 48 + llvm/lib/Target/VE/VEInstrInfo.td | 288 ++ llvm/lib/Target/VE/VEMCInstLower.cpp | 69 + llvm/lib/Target/VE/VERegisterInfo.cpp | 133 + llvm/lib/Target/VE/VERegisterInfo.h | 49 + llvm/lib/Target/VE/VERegisterInfo.td | 37 + llvm/lib/Target/VE/VESubtarget.cpp | 99 + llvm/lib/Target/VE/VESubtarget.h | 73 + llvm/lib/Target/VE/VETargetMachine.cpp | 108 + llvm/lib/Target/VE/VETargetMachine.h | 57 + llvm/lib/Target/VE/VETargetTransformInfo.h | 50 + .../AsmParser/WebAssemblyAsmParser.cpp | 38 +- .../Disassembler/WebAssemblyDisassembler.cpp | 9 +- .../MCTargetDesc/WebAssemblyInstPrinter.cpp | 7 +- .../MCTargetDesc/WebAssemblyInstPrinter.h | 6 +- .../MCTargetDesc/WebAssemblyMCAsmInfo.cpp | 3 +- .../MCTargetDesc/WebAssemblyMCAsmInfo.h | 3 +- .../MCTargetDesc/WebAssemblyMCTargetDesc.cpp | 7 +- .../WebAssemblyTargetStreamer.cpp | 6 + .../MCTargetDesc/WebAssemblyTargetStreamer.h | 7 + .../TargetInfo/WebAssemblyTargetInfo.cpp | 2 +- llvm/lib/Target/WebAssembly/WebAssembly.h | 4 + .../WebAssembly/WebAssemblyAsmPrinter.cpp | 14 +- .../WebAssemblyDebugValueManager.cpp | 8 + .../WebAssemblyDebugValueManager.h | 1 + .../WebAssembly/WebAssemblyExceptionInfo.cpp | 1 + .../WebAssembly/WebAssemblyExplicitLocals.cpp | 6 + .../lib/Target/WebAssembly/WebAssemblyISD.def | 4 +- .../WebAssembly/WebAssemblyISelDAGToDAG.cpp | 7 +- .../WebAssembly/WebAssemblyISelLowering.cpp | 47 +- .../WebAssembly/WebAssemblyISelLowering.h | 9 + .../WebAssembly/WebAssemblyInstrFloat.td | 7 - .../WebAssembly/WebAssemblyInstrInfo.cpp | 14 +- .../Target/WebAssembly/WebAssemblyInstrInfo.h | 6 +- .../WebAssembly/WebAssemblyInstrSIMD.td | 59 +- .../WebAssemblyLowerEmscriptenEHSjLj.cpp | 5 +- .../WebAssemblyRuntimeLibcallSignatures.cpp | 6 - .../WebAssembly/WebAssemblyTargetMachine.cpp | 2 +- .../WebAssemblyTargetTransformInfo.cpp | 3 +- .../WebAssemblyTargetTransformInfo.h | 3 +- .../lib/Target/X86/AsmParser/X86AsmParser.cpp | 224 +- llvm/lib/Target/X86/AsmParser/X86Operand.h | 27 +- .../X86/Disassembler/X86Disassembler.cpp | 1670 ++++++- .../Disassembler/X86DisassemblerDecoder.cpp | 1938 -------- .../X86/Disassembler/X86DisassemblerDecoder.h | 69 +- .../X86/MCTargetDesc/X86ATTInstPrinter.cpp | 7 +- .../X86/MCTargetDesc/X86ATTInstPrinter.h | 6 +- .../Target/X86/MCTargetDesc/X86AsmBackend.cpp | 465 +- .../lib/Target/X86/MCTargetDesc/X86BaseInfo.h | 294 +- .../X86/MCTargetDesc/X86IntelInstPrinter.cpp | 8 +- .../X86/MCTargetDesc/X86IntelInstPrinter.h | 6 +- .../X86/MCTargetDesc/X86MCCodeEmitter.cpp | 1055 +++-- .../X86/MCTargetDesc/X86MCTargetDesc.cpp | 14 +- .../Target/X86/TargetInfo/X86TargetInfo.cpp | 2 +- llvm/lib/Target/X86/X86.h | 12 + llvm/lib/Target/X86/X86.td | 131 +- llvm/lib/Target/X86/X86AsmPrinter.cpp | 50 +- llvm/lib/Target/X86/X86AsmPrinter.h | 6 +- .../X86/X86AvoidStoreForwardingBlocks.cpp | 9 +- .../Target/X86/X86CallFrameOptimization.cpp | 12 +- llvm/lib/Target/X86/X86CallLowering.cpp | 2 +- llvm/lib/Target/X86/X86CallingConv.td | 35 +- llvm/lib/Target/X86/X86CmovConversion.cpp | 7 +- llvm/lib/Target/X86/X86CondBrFolding.cpp | 2 - llvm/lib/Target/X86/X86DomainReassignment.cpp | 6 +- llvm/lib/Target/X86/X86EvexToVex.cpp | 2 +- llvm/lib/Target/X86/X86ExpandPseudo.cpp | 10 +- llvm/lib/Target/X86/X86FastISel.cpp | 2 + llvm/lib/Target/X86/X86FixupBWInsts.cpp | 24 +- llvm/lib/Target/X86/X86FixupLEAs.cpp | 7 +- llvm/lib/Target/X86/X86FixupSetCC.cpp | 50 +- llvm/lib/Target/X86/X86FlagsCopyLowering.cpp | 92 +- llvm/lib/Target/X86/X86FloatingPoint.cpp | 48 +- llvm/lib/Target/X86/X86FrameLowering.cpp | 32 +- llvm/lib/Target/X86/X86ISelDAGToDAG.cpp | 179 +- llvm/lib/Target/X86/X86ISelLowering.cpp | 4006 ++++++++++------ llvm/lib/Target/X86/X86ISelLowering.h | 65 +- .../Target/X86/X86IndirectBranchTracking.cpp | 6 +- llvm/lib/Target/X86/X86InstrAVX512.td | 705 ++- llvm/lib/Target/X86/X86InstrControl.td | 23 +- llvm/lib/Target/X86/X86InstrFMA.td | 35 +- llvm/lib/Target/X86/X86InstrFPStack.td | 141 +- llvm/lib/Target/X86/X86InstrFormats.td | 6 +- llvm/lib/Target/X86/X86InstrFragmentsSIMD.td | 96 +- llvm/lib/Target/X86/X86InstrInfo.cpp | 175 +- llvm/lib/Target/X86/X86InstrInfo.h | 14 +- llvm/lib/Target/X86/X86InstrInfo.td | 61 +- llvm/lib/Target/X86/X86InstrMMX.td | 10 +- llvm/lib/Target/X86/X86InstrSSE.td | 560 +-- llvm/lib/Target/X86/X86InstrTSX.td | 2 +- .../lib/Target/X86/X86InstructionSelector.cpp | 87 +- llvm/lib/Target/X86/X86IntrinsicsInfo.h | 1 + llvm/lib/Target/X86/X86LegalizerInfo.cpp | 8 +- llvm/lib/Target/X86/X86MCInstLower.cpp | 166 +- llvm/lib/Target/X86/X86MacroFusion.cpp | 183 +- llvm/lib/Target/X86/X86OptimizeLEAs.cpp | 24 +- llvm/lib/Target/X86/X86PadShortFunction.cpp | 20 + llvm/lib/Target/X86/X86PfmCounters.td | 16 +- llvm/lib/Target/X86/X86RegisterBankInfo.cpp | 5 +- llvm/lib/Target/X86/X86RegisterBankInfo.h | 4 +- llvm/lib/Target/X86/X86RegisterInfo.cpp | 34 +- llvm/lib/Target/X86/X86RegisterInfo.td | 5 + llvm/lib/Target/X86/X86RetpolineThunks.cpp | 12 +- llvm/lib/Target/X86/X86ScheduleAtom.td | 3 +- llvm/lib/Target/X86/X86ScheduleSLM.td | 30 +- llvm/lib/Target/X86/X86ScheduleZnver2.td | 1548 +++++++ .../X86/X86SpeculativeLoadHardening.cpp | 12 +- llvm/lib/Target/X86/X86Subtarget.cpp | 14 +- llvm/lib/Target/X86/X86Subtarget.h | 36 +- llvm/lib/Target/X86/X86TargetMachine.cpp | 20 +- .../lib/Target/X86/X86TargetTransformInfo.cpp | 146 +- llvm/lib/Target/X86/X86TargetTransformInfo.h | 22 +- llvm/lib/Target/X86/X86VZeroUpper.cpp | 2 +- llvm/lib/Target/X86/X86WinAllocaExpander.cpp | 16 +- llvm/lib/Target/X86/X86WinEHState.cpp | 10 +- .../XCore/Disassembler/XCoreDisassembler.cpp | 10 +- .../XCore/MCTargetDesc/XCoreInstPrinter.cpp | 7 +- .../XCore/MCTargetDesc/XCoreInstPrinter.h | 6 +- .../XCore/MCTargetDesc/XCoreMCTargetDesc.cpp | 5 +- .../XCore/TargetInfo/XCoreTargetInfo.cpp | 2 +- llvm/lib/Target/XCore/XCoreAsmPrinter.cpp | 2 +- llvm/lib/Target/XCore/XCoreISelDAGToDAG.cpp | 1 + llvm/lib/Target/XCore/XCoreISelLowering.cpp | 1 + llvm/lib/Target/XCore/XCoreInstrInfo.cpp | 4 +- llvm/lib/Target/XCore/XCoreInstrInfo.h | 2 +- .../Target/XCore/XCoreLowerThreadLocal.cpp | 1 + llvm/lib/Target/XCore/XCoreRegisterInfo.cpp | 2 +- llvm/lib/Target/XCore/XCoreTargetMachine.cpp | 2 +- .../AggressiveInstCombine.cpp | 1 + llvm/lib/Transforms/CFGuard/CFGuard.cpp | 305 ++ .../lib/Transforms/Coroutines/CoroCleanup.cpp | 12 +- llvm/lib/Transforms/Coroutines/CoroEarly.cpp | 16 +- llvm/lib/Transforms/Coroutines/CoroElide.cpp | 17 +- llvm/lib/Transforms/Coroutines/CoroInternal.h | 11 +- llvm/lib/Transforms/Coroutines/CoroSplit.cpp | 55 +- llvm/lib/Transforms/Coroutines/Coroutines.cpp | 39 +- llvm/lib/Transforms/IPO/AlwaysInliner.cpp | 1 + llvm/lib/Transforms/IPO/ArgumentPromotion.cpp | 6 +- llvm/lib/Transforms/IPO/Attributor.cpp | 2829 ++++++++++-- llvm/lib/Transforms/IPO/BarrierNoopPass.cpp | 1 + llvm/lib/Transforms/IPO/BlockExtractor.cpp | 1 + .../Transforms/IPO/CalledValuePropagation.cpp | 2 + llvm/lib/Transforms/IPO/ConstantMerge.cpp | 1 + llvm/lib/Transforms/IPO/CrossDSOCFI.cpp | 1 + .../IPO/DeadArgumentElimination.cpp | 1 + llvm/lib/Transforms/IPO/ElimAvailExtern.cpp | 1 + .../lib/Transforms/IPO/ForceFunctionAttrs.cpp | 2 + llvm/lib/Transforms/IPO/FunctionAttrs.cpp | 1 + llvm/lib/Transforms/IPO/FunctionImport.cpp | 119 +- llvm/lib/Transforms/IPO/GlobalDCE.cpp | 2 + llvm/lib/Transforms/IPO/GlobalOpt.cpp | 155 +- llvm/lib/Transforms/IPO/GlobalSplit.cpp | 1 + llvm/lib/Transforms/IPO/HotColdSplitting.cpp | 12 +- .../Transforms/IPO/IPConstantPropagation.cpp | 3 +- llvm/lib/Transforms/IPO/IPO.cpp | 2 +- .../lib/Transforms/IPO/InferFunctionAttrs.cpp | 1 + llvm/lib/Transforms/IPO/InlineSimple.cpp | 1 + llvm/lib/Transforms/IPO/Internalize.cpp | 1 + llvm/lib/Transforms/IPO/LoopExtractor.cpp | 1 + llvm/lib/Transforms/IPO/LowerTypeTests.cpp | 3 +- llvm/lib/Transforms/IPO/MergeFunctions.cpp | 74 +- llvm/lib/Transforms/IPO/PartialInlining.cpp | 3 +- .../lib/Transforms/IPO/PassManagerBuilder.cpp | 58 +- llvm/lib/Transforms/IPO/PruneEH.cpp | 3 +- llvm/lib/Transforms/IPO/SCCP.cpp | 1 + llvm/lib/Transforms/IPO/SampleProfile.cpp | 168 +- .../Transforms/IPO/StripDeadPrototypes.cpp | 1 + llvm/lib/Transforms/IPO/StripSymbols.cpp | 3 +- .../Transforms/IPO/ThinLTOBitcodeWriter.cpp | 1 + .../lib/Transforms/IPO/WholeProgramDevirt.cpp | 57 +- .../InstCombine/InstCombineAddSub.cpp | 121 +- .../InstCombine/InstCombineAndOrXor.cpp | 17 + .../InstCombine/InstCombineCalls.cpp | 175 +- .../InstCombine/InstCombineCasts.cpp | 249 +- .../InstCombine/InstCombineCompares.cpp | 70 +- .../InstCombine/InstCombineInternal.h | 9 +- .../InstCombineLoadStoreAlloca.cpp | 50 +- .../InstCombine/InstCombineMulDivRem.cpp | 14 +- .../Transforms/InstCombine/InstCombinePHI.cpp | 12 +- .../InstCombine/InstCombineSelect.cpp | 181 +- .../InstCombine/InstCombineShifts.cpp | 104 +- .../InstCombineSimplifyDemanded.cpp | 99 +- .../InstCombine/InstCombineVectorOps.cpp | 95 +- .../InstCombine/InstructionCombining.cpp | 203 +- .../Instrumentation/AddressSanitizer.cpp | 16 +- .../Instrumentation/BoundsChecking.cpp | 1 + .../ControlHeightReduction.cpp | 8 +- .../Instrumentation/DataFlowSanitizer.cpp | 8 +- .../Instrumentation/GCOVProfiling.cpp | 12 +- .../Instrumentation/HWAddressSanitizer.cpp | 61 +- .../Instrumentation/IndirectCallPromotion.cpp | 1 + .../Instrumentation/InstrOrderFile.cpp | 3 +- .../Instrumentation/InstrProfiling.cpp | 1 + .../Instrumentation/MemorySanitizer.cpp | 221 +- .../Instrumentation/PGOInstrumentation.cpp | 3 +- .../Instrumentation/PGOMemOPSizeOpt.cpp | 1 + .../Instrumentation/PoisonChecking.cpp | 3 +- .../Instrumentation/SanitizerCoverage.cpp | 1 + .../Instrumentation/ThreadSanitizer.cpp | 3 +- llvm/lib/Transforms/ObjCARC/ObjCARCAPElim.cpp | 1 + .../Transforms/ObjCARC/ObjCARCContract.cpp | 2 + llvm/lib/Transforms/ObjCARC/ObjCARCExpand.cpp | 1 + llvm/lib/Transforms/ObjCARC/ObjCARCOpts.cpp | 726 +-- .../ObjCARC/ProvenanceAnalysisEvaluator.cpp | 1 + llvm/lib/Transforms/Scalar/ADCE.cpp | 1 + .../Scalar/AlignmentFromAssumptions.cpp | 1 + llvm/lib/Transforms/Scalar/BDCE.cpp | 5 +- .../Transforms/Scalar/CallSiteSplitting.cpp | 4 +- .../Transforms/Scalar/ConstantHoisting.cpp | 33 +- llvm/lib/Transforms/Scalar/ConstantProp.cpp | 1 + .../Scalar/CorrelatedValuePropagation.cpp | 10 +- llvm/lib/Transforms/Scalar/DCE.cpp | 41 +- .../Scalar/DeadStoreElimination.cpp | 78 +- llvm/lib/Transforms/Scalar/DivRemPairs.cpp | 1 + llvm/lib/Transforms/Scalar/EarlyCSE.cpp | 7 +- llvm/lib/Transforms/Scalar/FlattenCFGPass.cpp | 1 + llvm/lib/Transforms/Scalar/Float2Int.cpp | 2 + llvm/lib/Transforms/Scalar/GVN.cpp | 95 +- llvm/lib/Transforms/Scalar/GVNHoist.cpp | 10 +- llvm/lib/Transforms/Scalar/GVNSink.cpp | 3 +- llvm/lib/Transforms/Scalar/GuardWidening.cpp | 99 +- llvm/lib/Transforms/Scalar/IndVarSimplify.cpp | 50 +- .../Scalar/InductiveRangeCheckElimination.cpp | 1 + .../Transforms/Scalar/InferAddressSpaces.cpp | 14 +- .../Transforms/Scalar/InstSimplifyPass.cpp | 1 + llvm/lib/Transforms/Scalar/JumpThreading.cpp | 329 +- llvm/lib/Transforms/Scalar/LICM.cpp | 87 +- .../Transforms/Scalar/LoopDataPrefetch.cpp | 1 + llvm/lib/Transforms/Scalar/LoopDeletion.cpp | 1 + llvm/lib/Transforms/Scalar/LoopDistribute.cpp | 1 + llvm/lib/Transforms/Scalar/LoopFuse.cpp | 87 +- .../Transforms/Scalar/LoopIdiomRecognize.cpp | 927 +--- .../Transforms/Scalar/LoopInstSimplify.cpp | 4 +- .../lib/Transforms/Scalar/LoopInterchange.cpp | 138 +- .../Transforms/Scalar/LoopLoadElimination.cpp | 6 +- .../lib/Transforms/Scalar/LoopPredication.cpp | 253 +- llvm/lib/Transforms/Scalar/LoopRerollPass.cpp | 3 +- llvm/lib/Transforms/Scalar/LoopRotation.cpp | 2 + .../lib/Transforms/Scalar/LoopSimplifyCFG.cpp | 5 + llvm/lib/Transforms/Scalar/LoopSink.cpp | 3 +- .../Transforms/Scalar/LoopStrengthReduce.cpp | 5 +- .../Scalar/LoopUnrollAndJamPass.cpp | 103 +- llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp | 4 +- llvm/lib/Transforms/Scalar/LoopUnswitch.cpp | 3 +- .../Transforms/Scalar/LoopVersioningLICM.cpp | 1 + llvm/lib/Transforms/Scalar/LowerAtomic.cpp | 1 + .../Scalar/LowerConstantIntrinsics.cpp | 1 + .../Scalar/LowerExpectIntrinsic.cpp | 1 + .../Transforms/Scalar/LowerGuardIntrinsic.cpp | 3 +- .../Scalar/LowerMatrixIntrinsics.cpp | 894 ++++ .../Scalar/LowerWidenableCondition.cpp | 1 + .../Transforms/Scalar/MakeGuardsExplicit.cpp | 23 +- .../lib/Transforms/Scalar/MemCpyOptimizer.cpp | 68 +- llvm/lib/Transforms/Scalar/MergeICmps.cpp | 1 + .../Scalar/MergedLoadStoreMotion.cpp | 1 + .../lib/Transforms/Scalar/NaryReassociate.cpp | 3 +- llvm/lib/Transforms/Scalar/NewGVN.cpp | 21 +- .../Scalar/PartiallyInlineLibCalls.cpp | 1 + .../lib/Transforms/Scalar/PlaceSafepoints.cpp | 1 + llvm/lib/Transforms/Scalar/Reassociate.cpp | 7 +- llvm/lib/Transforms/Scalar/Reg2Mem.cpp | 3 +- .../Scalar/RewriteStatepointsForGC.cpp | 1 + llvm/lib/Transforms/Scalar/SCCP.cpp | 5 +- llvm/lib/Transforms/Scalar/SROA.cpp | 134 +- llvm/lib/Transforms/Scalar/Scalar.cpp | 2 + llvm/lib/Transforms/Scalar/Scalarizer.cpp | 37 +- .../Scalar/SeparateConstOffsetFromGEP.cpp | 3 +- .../Transforms/Scalar/SimpleLoopUnswitch.cpp | 33 +- .../lib/Transforms/Scalar/SimplifyCFGPass.cpp | 3 +- llvm/lib/Transforms/Scalar/Sink.cpp | 3 +- .../Transforms/Scalar/SpeculateAroundPHIs.cpp | 8 +- .../Scalar/SpeculativeExecution.cpp | 1 + .../Scalar/StraightLineStrengthReduce.cpp | 3 +- llvm/lib/Transforms/Scalar/StructurizeCFG.cpp | 2 + .../Scalar/TailRecursionElimination.cpp | 1 + .../Scalar/WarnMissedTransforms.cpp | 1 + .../Transforms/Utils/AddDiscriminators.cpp | 3 +- llvm/lib/Transforms/Utils/BasicBlockUtils.cpp | 144 +- .../Transforms/Utils/BreakCriticalEdges.cpp | 1 + .../Transforms/Utils/CanonicalizeAliases.cpp | 2 +- llvm/lib/Transforms/Utils/CodeExtractor.cpp | 2 +- llvm/lib/Transforms/Utils/CodeMoverUtils.cpp | 189 + .../opt => lib/Transforms/Utils}/Debugify.cpp | 32 +- .../Utils/EntryExitInstrumenter.cpp | 1 + .../Transforms/Utils/FunctionImportUtils.cpp | 88 +- llvm/lib/Transforms/Utils/GuardUtils.cpp | 67 +- .../Transforms/Utils/InjectTLIMappings.cpp | 186 + llvm/lib/Transforms/Utils/InlineFunction.cpp | 78 +- .../lib/Transforms/Utils/InstructionNamer.cpp | 1 + llvm/lib/Transforms/Utils/LCSSA.cpp | 19 +- .../Transforms/Utils/LibCallsShrinkWrap.cpp | 1 + llvm/lib/Transforms/Utils/Local.cpp | 99 +- .../Transforms/Utils/LoopRotationUtils.cpp | 19 +- llvm/lib/Transforms/Utils/LoopSimplify.cpp | 1 + llvm/lib/Transforms/Utils/LoopUnroll.cpp | 3 +- .../lib/Transforms/Utils/LoopUnrollAndJam.cpp | 5 +- llvm/lib/Transforms/Utils/LoopUnrollPeel.cpp | 56 +- .../Transforms/Utils/LoopUnrollRuntime.cpp | 5 +- llvm/lib/Transforms/Utils/LoopUtils.cpp | 30 +- llvm/lib/Transforms/Utils/LoopVersioning.cpp | 2 + llvm/lib/Transforms/Utils/LowerInvoke.cpp | 1 + llvm/lib/Transforms/Utils/LowerSwitch.cpp | 1 + llvm/lib/Transforms/Utils/Mem2Reg.cpp | 1 + llvm/lib/Transforms/Utils/MetaRenamer.cpp | 1 + llvm/lib/Transforms/Utils/MisExpect.cpp | 1 + llvm/lib/Transforms/Utils/ModuleUtils.cpp | 29 + llvm/lib/Transforms/Utils/NameAnonGlobals.cpp | 2 +- llvm/lib/Transforms/Utils/PredicateInfo.cpp | 1 + llvm/lib/Transforms/Utils/SimplifyCFG.cpp | 73 +- .../lib/Transforms/Utils/SimplifyLibCalls.cpp | 119 +- llvm/lib/Transforms/Utils/SizeOpts.cpp | 86 +- .../lib/Transforms/Utils/StripGCRelocates.cpp | 1 + .../Utils/StripNonLineTableDebugInfo.cpp | 1 + llvm/lib/Transforms/Utils/SymbolRewriter.cpp | 1 + .../Utils/UnifyFunctionExitNodes.cpp | 6 + llvm/lib/Transforms/Utils/Utils.cpp | 1 + .../Vectorize/LoadStoreVectorizer.cpp | 5 +- .../Vectorize/LoopVectorizationLegality.cpp | 14 +- .../Vectorize/LoopVectorizationPlanner.h | 11 +- .../Transforms/Vectorize/LoopVectorize.cpp | 1005 ++-- .../Transforms/Vectorize/SLPVectorizer.cpp | 969 ++-- .../Transforms/Vectorize/VPRecipeBuilder.h | 44 +- llvm/lib/Transforms/Vectorize/VPlan.cpp | 61 +- llvm/lib/Transforms/Vectorize/VPlan.h | 473 +- ...HCFGTransforms.cpp => VPlanTransforms.cpp} | 14 +- ...PlanHCFGTransforms.h => VPlanTransforms.h} | 12 +- llvm/lib/Transforms/Vectorize/VPlanValue.h | 2 +- .../Transforms/Vectorize/VPlanVerifier.cpp | 1 + llvm/lib/XRay/InstrumentationMap.cpp | 22 +- llvm/tools/bugpoint/CrashDebugger.cpp | 163 +- llvm/tools/bugpoint/bugpoint.cpp | 21 +- llvm/tools/llc/llc.cpp | 28 +- llvm/tools/lli/RemoteJITUtils.h | 2 +- llvm/tools/lli/lli.cpp | 29 +- llvm/tools/llvm-ar/llvm-ar.cpp | 116 +- .../tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp | 5 +- llvm/tools/llvm-cov/CodeCoverage.cpp | 5 +- llvm/tools/llvm-cov/CoverageExporterJson.cpp | 16 +- llvm/tools/llvm-cxxfilt/llvm-cxxfilt.cpp | 32 +- llvm/tools/llvm-diff/DifferenceEngine.cpp | 9 + llvm/tools/llvm-dis/llvm-dis.cpp | 100 +- llvm/tools/llvm-dwarfdump/Statistics.cpp | 153 +- llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp | 2 +- llvm/tools/llvm-lto2/llvm-lto2.cpp | 2 + llvm/tools/llvm-mc/Disassembler.cpp | 9 +- llvm/tools/llvm-mc/Disassembler.h | 3 +- llvm/tools/llvm-mc/llvm-mc.cpp | 5 +- .../llvm-mca/Views/BottleneckAnalysis.cpp | 2 +- .../llvm-mca/Views/DispatchStatistics.cpp | 3 +- .../llvm-mca/Views/InstructionInfoView.cpp | 2 +- .../llvm-mca/Views/ResourcePressureView.cpp | 2 +- .../Views/RetireControlUnitStatistics.cpp | 2 +- .../llvm-mca/Views/SchedulerStatistics.cpp | 2 +- llvm/tools/llvm-mca/Views/SummaryView.cpp | 2 +- llvm/tools/llvm-mca/Views/TimelineView.cpp | 4 +- llvm/tools/llvm-mca/llvm-mca.cpp | 6 +- llvm/tools/llvm-nm/llvm-nm.cpp | 13 +- llvm/tools/llvm-objcopy/COFF/COFFObjcopy.cpp | 13 +- llvm/tools/llvm-objcopy/COFF/Object.h | 6 +- llvm/tools/llvm-objcopy/COFF/Reader.cpp | 4 +- llvm/tools/llvm-objcopy/COFF/Writer.cpp | 22 +- llvm/tools/llvm-objcopy/CommonOpts.td | 8 +- llvm/tools/llvm-objcopy/CopyConfig.cpp | 89 + llvm/tools/llvm-objcopy/CopyConfig.h | 12 +- llvm/tools/llvm-objcopy/ELF/ELFObjcopy.cpp | 29 +- llvm/tools/llvm-objcopy/ELF/Object.cpp | 207 +- llvm/tools/llvm-objcopy/ELF/Object.h | 82 +- .../tools/llvm-objcopy/InstallNameToolOpts.td | 22 + .../llvm-objcopy/MachO/MachOLayoutBuilder.cpp | 11 +- .../tools/llvm-objcopy/MachO/MachOObjcopy.cpp | 200 +- llvm/tools/llvm-objcopy/MachO/MachOReader.cpp | 40 +- llvm/tools/llvm-objcopy/MachO/MachOWriter.cpp | 19 +- llvm/tools/llvm-objcopy/MachO/Object.cpp | 64 + llvm/tools/llvm-objcopy/MachO/Object.h | 82 +- llvm/tools/llvm-objcopy/llvm-objcopy.cpp | 20 +- llvm/tools/llvm-objdump/ELFDump.cpp | 12 +- llvm/tools/llvm-objdump/MachODump.cpp | 37 +- llvm/tools/llvm-objdump/llvm-objdump.cpp | 56 +- llvm/tools/llvm-pdbutil/DumpOutputStyle.cpp | 2 +- llvm/tools/llvm-pdbutil/InputFile.h | 2 +- llvm/tools/llvm-readobj/ARMWinEHPrinter.cpp | 8 +- llvm/tools/llvm-readobj/ELFDumper.cpp | 1391 +++--- llvm/tools/llvm-readobj/ObjDumper.cpp | 2 +- llvm/tools/llvm-readobj/ObjDumper.h | 1 + llvm/tools/llvm-readobj/Win64EHDumper.cpp | 54 +- llvm/tools/llvm-readobj/XCOFFDumper.cpp | 13 +- llvm/tools/llvm-readobj/llvm-readobj.cpp | 9 +- llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp | 5 +- .../tools/llvm-symbolizer/llvm-symbolizer.cpp | 24 +- llvm/tools/llvm-xray/xray-account.cpp | 23 +- llvm/tools/llvm-xray/xray-converter.cpp | 15 +- llvm/tools/llvm-xray/xray-extract.cpp | 6 +- llvm/tools/llvm-xray/xray-graph-diff.cpp | 43 +- llvm/tools/llvm-xray/xray-graph.cpp | 23 +- llvm/tools/llvm-xray/xray-stacks.cpp | 9 +- llvm/tools/opt/NewPMDriver.cpp | 16 +- llvm/tools/opt/PassPrinters.cpp | 38 - llvm/tools/opt/PassPrinters.h | 4 - llvm/tools/opt/opt.cpp | 72 +- llvm/utils/TableGen/AsmMatcherEmitter.cpp | 2 +- llvm/utils/TableGen/AsmWriterEmitter.cpp | 276 +- llvm/utils/TableGen/AsmWriterInst.h | 2 +- llvm/utils/TableGen/CodeEmitterGen.cpp | 2 +- llvm/utils/TableGen/CodeGenDAGPatterns.cpp | 80 +- llvm/utils/TableGen/CodeGenDAGPatterns.h | 16 +- llvm/utils/TableGen/CodeGenInstruction.cpp | 23 +- llvm/utils/TableGen/CodeGenInstruction.h | 24 +- llvm/utils/TableGen/CodeGenIntrinsics.h | 4 +- llvm/utils/TableGen/CodeGenRegisters.h | 8 +- llvm/utils/TableGen/CodeGenTarget.cpp | 21 +- llvm/utils/TableGen/CodeGenTarget.h | 4 +- llvm/utils/TableGen/DAGISelMatcherGen.cpp | 1 - llvm/utils/TableGen/DFAPacketizerEmitter.cpp | 474 +- .../utils/TableGen/FixedLenDecoderEmitter.cpp | 3 +- llvm/utils/TableGen/GICombinerEmitter.cpp | 575 ++- llvm/utils/TableGen/GlobalISel/GIMatchDag.cpp | 138 + llvm/utils/TableGen/GlobalISel/GIMatchDag.h | 243 + .../TableGen/GlobalISel/GIMatchDagEdge.cpp | 38 + .../TableGen/GlobalISel/GIMatchDagEdge.h | 70 + .../TableGen/GlobalISel/GIMatchDagInstr.cpp | 48 + .../TableGen/GlobalISel/GIMatchDagInstr.h | 115 + .../GlobalISel/GIMatchDagOperands.cpp | 153 + .../TableGen/GlobalISel/GIMatchDagOperands.h | 133 + .../GlobalISel/GIMatchDagPredicate.cpp | 69 + .../TableGen/GlobalISel/GIMatchDagPredicate.h | 141 + .../GIMatchDagPredicateDependencyEdge.cpp | 37 + .../GIMatchDagPredicateDependencyEdge.h | 60 + .../utils/TableGen/GlobalISel/GIMatchTree.cpp | 777 ++++ llvm/utils/TableGen/GlobalISel/GIMatchTree.h | 629 +++ llvm/utils/TableGen/GlobalISelEmitter.cpp | 184 +- llvm/utils/TableGen/InstrDocsEmitter.cpp | 1 + llvm/utils/TableGen/InstrInfoEmitter.cpp | 6 + llvm/utils/TableGen/IntrinsicEmitter.cpp | 142 +- llvm/utils/TableGen/OptEmitter.cpp | 84 + llvm/utils/TableGen/OptEmitter.h | 16 + llvm/utils/TableGen/OptParserEmitter.cpp | 75 +- llvm/utils/TableGen/OptRSTEmitter.cpp | 86 + .../TableGen/RISCVCompressInstEmitter.cpp | 218 +- llvm/utils/TableGen/RegisterInfoEmitter.cpp | 2 +- .../utils/TableGen/SearchableTableEmitter.cpp | 4 +- llvm/utils/TableGen/SequenceToOffsetTable.h | 4 +- llvm/utils/TableGen/TableGen.cpp | 20 +- llvm/utils/TableGen/TableGenBackends.h | 7 +- llvm/utils/TableGen/X86DisassemblerTables.cpp | 84 +- llvm/utils/TableGen/X86FoldTablesEmitter.cpp | 6 +- llvm/utils/TableGen/X86RecognizableInstr.cpp | 82 +- openmp/CREDITS.txt | 4 + openmp/runtime/src/extractExternal.cpp | 2 +- openmp/runtime/src/i18n/en_US.txt | 4 +- openmp/runtime/src/include/omp_lib.f.var | 2 +- openmp/runtime/src/kmp.h | 13 +- openmp/runtime/src/kmp_affinity.cpp | 10 +- openmp/runtime/src/kmp_alloc.cpp | 2 +- openmp/runtime/src/kmp_atomic.cpp | 6 +- openmp/runtime/src/kmp_barrier.cpp | 14 +- openmp/runtime/src/kmp_csupport.cpp | 23 +- openmp/runtime/src/kmp_dispatch.cpp | 21 +- openmp/runtime/src/kmp_dispatch_hier.h | 2 +- openmp/runtime/src/kmp_ftn_entry.h | 4 +- openmp/runtime/src/kmp_gsupport.cpp | 6 +- openmp/runtime/src/kmp_itt.inl | 8 +- openmp/runtime/src/kmp_lock.h | 2 +- openmp/runtime/src/kmp_os.h | 2 +- openmp/runtime/src/kmp_platform.h | 18 +- openmp/runtime/src/kmp_runtime.cpp | 12 +- openmp/runtime/src/kmp_settings.cpp | 6 +- openmp/runtime/src/kmp_stats.cpp | 2 +- openmp/runtime/src/kmp_str.cpp | 2 +- openmp/runtime/src/kmp_taskdeps.cpp | 10 +- openmp/runtime/src/kmp_tasking.cpp | 21 +- openmp/runtime/src/kmp_wrapper_getpid.h | 2 + openmp/runtime/src/kmp_wrapper_malloc.h | 2 +- openmp/runtime/src/ompt-event-specific.h | 2 +- openmp/runtime/src/ompt-general.cpp | 16 + openmp/runtime/src/ompt-specific.h | 26 + .../src/thirdparty/ittnotify/ittnotify.h | 12 +- .../thirdparty/ittnotify/ittnotify_static.cpp | 2 +- .../thirdparty/ittnotify/legacy/ittnotify.h | 4 +- openmp/runtime/src/z_Linux_asm.S | 14 +- openmp/runtime/src/z_Linux_util.cpp | 39 +- openmp/runtime/src/z_Windows_NT_util.cpp | 2 +- 3297 files changed, 150294 insertions(+), 74513 deletions(-) create mode 100644 clang/include/clang-c/ExternC.h create mode 100644 clang/include/clang/AST/ASTConcept.h create mode 100644 clang/include/clang/AST/AbstractBasicReader.h create mode 100644 clang/include/clang/AST/AbstractBasicWriter.h create mode 100644 clang/include/clang/AST/AbstractTypeReader.h create mode 100644 clang/include/clang/AST/AbstractTypeWriter.h create mode 100644 clang/include/clang/AST/PropertiesBase.td create mode 100644 clang/include/clang/AST/TypeProperties.td create mode 100644 clang/include/clang/Basic/ASTNode.td create mode 100644 clang/include/clang/Basic/arm_mve.td create mode 100644 clang/include/clang/Basic/arm_mve_defs.td create mode 100644 clang/include/clang/Driver/OptionUtils.h create mode 100644 clang/include/clang/Sema/SemaConcept.h create mode 100644 clang/include/clang/Serialization/ASTRecordReader.h create mode 100644 clang/include/clang/Serialization/ASTRecordWriter.h rename clang/include/clang/Serialization/{Module.h => ModuleFile.h} (98%) create mode 100644 clang/include/clang/Serialization/TypeBitCodes.def create mode 100644 clang/include/clang/Tooling/DependencyScanning/ModuleDepCollector.h create mode 100644 clang/include/clang/Tooling/Syntax/Mutations.h create mode 100644 clang/lib/AST/ASTConcept.cpp create mode 100644 clang/lib/Driver/OptionUtils.cpp create mode 100644 clang/lib/Driver/ToolChains/AIX.cpp create mode 100644 clang/lib/Driver/ToolChains/AIX.h create mode 100644 clang/lib/Driver/ToolChains/Flang.cpp create mode 100644 clang/lib/Driver/ToolChains/Flang.h create mode 100644 clang/lib/Headers/arm_cmse.h rename clang/lib/Serialization/{Module.cpp => ModuleFile.cpp} (94%) create mode 100644 clang/lib/StaticAnalyzer/Checkers/CheckPlacementNew.cpp create mode 100644 clang/lib/StaticAnalyzer/Checkers/DebugIteratorModeling.cpp create mode 100644 clang/lib/StaticAnalyzer/Checkers/FuchsiaHandleChecker.cpp create mode 100644 clang/lib/StaticAnalyzer/Checkers/InvalidatedIteratorChecker.cpp create mode 100644 clang/lib/StaticAnalyzer/Checkers/Iterator.cpp create mode 100644 clang/lib/StaticAnalyzer/Checkers/Iterator.h rename clang/lib/StaticAnalyzer/Checkers/{IteratorChecker.cpp => IteratorModeling.cpp} (59%) create mode 100644 clang/lib/StaticAnalyzer/Checkers/IteratorRangeChecker.cpp create mode 100644 clang/lib/StaticAnalyzer/Checkers/MismatchedIteratorChecker.cpp create mode 100644 clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp create mode 100644 clang/lib/Tooling/ExpandResponseFilesCompilationDatabase.cpp create mode 100644 clang/lib/Tooling/Syntax/ComputeReplacements.cpp create mode 100644 clang/lib/Tooling/Syntax/Mutations.cpp create mode 100644 clang/lib/Tooling/Syntax/Synthesis.cpp create mode 100644 clang/utils/TableGen/ASTTableGen.cpp create mode 100644 clang/utils/TableGen/ASTTableGen.h create mode 100644 clang/utils/TableGen/ClangASTPropertiesEmitter.cpp create mode 100644 clang/utils/TableGen/MveEmitter.cpp create mode 100644 clang/utils/convert_arm_neon.py rename compiler-rt/{lib => include}/profile/InstrProfData.inc (99%) create mode 100644 compiler-rt/lib/builtins/i386/fp_mode.c create mode 100644 compiler-rt/lib/builtins/ppc/fixtfti.c create mode 100644 compiler-rt/lib/hwasan/hwasan_setjmp.S create mode 100644 compiler-rt/lib/hwasan/hwasan_type_test.cpp create mode 100644 compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_netbsd_compat.inc delete mode 100644 compiler-rt/lib/scudo/standalone/secondary.cpp delete mode 100644 lldb/docs/lldb.1 create mode 100644 lldb/docs/man/lldb.rst create mode 100644 lldb/include/lldb/Core/IOHandlerCursesGUI.h delete mode 100644 lldb/include/lldb/Core/STLUtils.h delete mode 100644 lldb/include/lldb/Core/ThreadSafeSTLMap.h delete mode 100644 lldb/include/lldb/Core/ThreadSafeSTLVector.h delete mode 100644 lldb/include/lldb/DataFormatters/TypeValidator.h rename lldb/include/lldb/Symbol/{ClangExternalASTSourceCommon.h => ClangASTMetadata.h} (55%) create mode 100644 lldb/source/Core/IOHandlerCursesGUI.cpp delete mode 100644 lldb/source/DataFormatters/TypeValidator.cpp rename lldb/source/Host/posix/{FileSystem.cpp => FileSystemPosix.cpp} (100%) delete mode 100644 lldb/source/Plugins/ExpressionParser/Clang/ASTDumper.cpp delete mode 100644 lldb/source/Plugins/ExpressionParser/Clang/ASTDumper.h create mode 100644 lldb/source/Plugins/ScriptInterpreter/Lua/Lua.cpp create mode 100644 lldb/source/Plugins/ScriptInterpreter/Lua/Lua.h create mode 100644 lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.cpp create mode 100644 lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.h create mode 100644 lldb/source/Plugins/ScriptInterpreter/Python/PythonReadline.cpp create mode 100644 lldb/source/Plugins/ScriptInterpreter/Python/PythonReadline.h create mode 100644 lldb/source/Symbol/ClangASTMetadata.cpp delete mode 100644 lldb/source/Symbol/ClangExternalASTSourceCommon.cpp create mode 100644 lldb/source/Target/MemoryRegionInfo.cpp delete mode 100644 lldb/source/Utility/PPC64LE_ehframe_Registers.h create mode 100644 llvm/include/llvm-c/ExternC.h create mode 100644 llvm/include/llvm/ADT/EnumeratedArray.h create mode 100644 llvm/include/llvm/ADT/FloatingPointMode.h create mode 100644 llvm/include/llvm/CodeGen/MIRFormatter.h create mode 100644 llvm/include/llvm/CodeGen/MachineSizeOpts.h create mode 100644 llvm/include/llvm/CodeGen/NonRelocatableStringpool.h create mode 100644 llvm/include/llvm/DWARFLinker/DWARFLinker.h create mode 100644 llvm/include/llvm/DWARFLinker/DWARFLinkerCompileUnit.h create mode 100644 llvm/include/llvm/DWARFLinker/DWARFLinkerDeclContext.h create mode 100644 llvm/include/llvm/DebugInfo/DWARF/DWARFLocationExpression.h create mode 100644 llvm/include/llvm/DebugInfo/GSYM/LookupResult.h create mode 100644 llvm/include/llvm/ExecutionEngine/Orc/DebugUtils.h rename llvm/include/llvm/ExecutionEngine/Orc/{ => RPC}/RPCSerialization.h (99%) rename llvm/include/llvm/ExecutionEngine/Orc/{ => RPC}/RPCUtils.h (99%) rename llvm/include/llvm/ExecutionEngine/Orc/{ => RPC}/RawByteChannel.h (97%) create mode 100644 llvm/include/llvm/Frontend/OpenMP/OMPConstants.h create mode 100644 llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h create mode 100644 llvm/include/llvm/Frontend/OpenMP/OMPKinds.def create mode 100644 llvm/include/llvm/IR/ConstrainedOps.def create mode 100644 llvm/include/llvm/IR/FPEnv.h delete mode 100644 llvm/include/llvm/MC/MCCodePadder.h create mode 100644 llvm/include/llvm/Remarks/RemarkLinker.h delete mode 100644 llvm/include/llvm/Support/Options.h create mode 100644 llvm/include/llvm/Transforms/CFGuard.h create mode 100644 llvm/include/llvm/Transforms/IPO/MergeFunctions.h create mode 100644 llvm/include/llvm/Transforms/Scalar/LowerMatrixIntrinsics.h create mode 100644 llvm/include/llvm/Transforms/Utils/CodeMoverUtils.h rename llvm/{tools/opt => include/llvm/Transforms/Utils}/Debugify.h (89%) create mode 100644 llvm/include/llvm/Transforms/Utils/InjectTLIMappings.h create mode 100644 llvm/lib/BinaryFormat/XCOFF.cpp create mode 100644 llvm/lib/CodeGen/CFGuardLongjmp.cpp create mode 100644 llvm/lib/CodeGen/MachineSizeOpts.cpp create mode 100644 llvm/lib/CodeGen/NonRelocatableStringpool.cpp rename llvm/lib/{Target/ARM/ARMCodeGenPrepare.cpp => CodeGen/TypePromotion.cpp} (69%) create mode 100644 llvm/lib/DWARFLinker/DWARFLinker.cpp create mode 100644 llvm/lib/DWARFLinker/DWARFLinkerCompileUnit.cpp create mode 100644 llvm/lib/DWARFLinker/DWARFLinkerDeclContext.cpp create mode 100644 llvm/lib/DebugInfo/DWARF/DWARFLocationExpression.cpp create mode 100644 llvm/lib/DebugInfo/GSYM/LookupResult.cpp create mode 100644 llvm/lib/ExecutionEngine/Orc/DebugUtils.cpp rename llvm/lib/ExecutionEngine/{Orc => OrcError}/OrcError.cpp (99%) rename llvm/lib/ExecutionEngine/{Orc/RPCUtils.cpp => OrcError/RPCError.cpp} (84%) create mode 100644 llvm/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldCOFFAArch64.h create mode 100644 llvm/lib/Frontend/OpenMP/OMPConstants.cpp create mode 100644 llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp create mode 100644 llvm/lib/IR/FPEnv.cpp delete mode 100644 llvm/lib/MC/MCCodePadder.cpp create mode 100644 llvm/lib/Remarks/RemarkLinker.cpp delete mode 100644 llvm/lib/Support/Options.cpp delete mode 100644 llvm/lib/Target/AArch64/AArch64SchedExynosM1.td create mode 100644 llvm/lib/Target/AArch64/AArch64SchedExynosM5.td create mode 100644 llvm/lib/Target/AMDGPU/AMDGPUGlobalISelUtils.cpp create mode 100644 llvm/lib/Target/AMDGPU/AMDGPUGlobalISelUtils.h create mode 100644 llvm/lib/Target/AMDGPU/SIRemoveShortExecBranches.cpp create mode 100644 llvm/lib/Target/ARM/MVEGatherScatterLowering.cpp rename llvm/lib/Target/PowerPC/{PPCLoopPreIncPrep.cpp => PPCLoopInstrFormPrep.cpp} (53%) create mode 100644 llvm/lib/Target/PowerPC/PPCLowerMASSVEntries.cpp create mode 100644 llvm/lib/Target/VE/InstPrinter/VEInstPrinter.cpp create mode 100644 llvm/lib/Target/VE/InstPrinter/VEInstPrinter.h create mode 100644 llvm/lib/Target/VE/MCTargetDesc/VEMCAsmInfo.cpp create mode 100644 llvm/lib/Target/VE/MCTargetDesc/VEMCAsmInfo.h create mode 100644 llvm/lib/Target/VE/MCTargetDesc/VEMCTargetDesc.cpp create mode 100644 llvm/lib/Target/VE/MCTargetDesc/VEMCTargetDesc.h create mode 100644 llvm/lib/Target/VE/MCTargetDesc/VETargetStreamer.cpp create mode 100644 llvm/lib/Target/VE/MCTargetDesc/VETargetStreamer.h create mode 100644 llvm/lib/Target/VE/TargetInfo/VETargetInfo.cpp create mode 100644 llvm/lib/Target/VE/VE.h create mode 100644 llvm/lib/Target/VE/VE.td create mode 100644 llvm/lib/Target/VE/VEAsmPrinter.cpp create mode 100644 llvm/lib/Target/VE/VECallingConv.td create mode 100644 llvm/lib/Target/VE/VEFrameLowering.cpp create mode 100644 llvm/lib/Target/VE/VEFrameLowering.h create mode 100644 llvm/lib/Target/VE/VEISelDAGToDAG.cpp create mode 100644 llvm/lib/Target/VE/VEISelLowering.cpp create mode 100644 llvm/lib/Target/VE/VEISelLowering.h create mode 100644 llvm/lib/Target/VE/VEInstrFormats.td create mode 100644 llvm/lib/Target/VE/VEInstrInfo.cpp create mode 100644 llvm/lib/Target/VE/VEInstrInfo.h create mode 100644 llvm/lib/Target/VE/VEInstrInfo.td create mode 100644 llvm/lib/Target/VE/VEMCInstLower.cpp create mode 100644 llvm/lib/Target/VE/VERegisterInfo.cpp create mode 100644 llvm/lib/Target/VE/VERegisterInfo.h create mode 100644 llvm/lib/Target/VE/VERegisterInfo.td create mode 100644 llvm/lib/Target/VE/VESubtarget.cpp create mode 100644 llvm/lib/Target/VE/VESubtarget.h create mode 100644 llvm/lib/Target/VE/VETargetMachine.cpp create mode 100644 llvm/lib/Target/VE/VETargetMachine.h create mode 100644 llvm/lib/Target/VE/VETargetTransformInfo.h delete mode 100644 llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.cpp create mode 100644 llvm/lib/Target/X86/X86ScheduleZnver2.td create mode 100644 llvm/lib/Transforms/CFGuard/CFGuard.cpp create mode 100644 llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp create mode 100644 llvm/lib/Transforms/Utils/CodeMoverUtils.cpp rename llvm/{tools/opt => lib/Transforms/Utils}/Debugify.cpp (93%) create mode 100644 llvm/lib/Transforms/Utils/InjectTLIMappings.cpp rename llvm/lib/Transforms/Vectorize/{VPlanHCFGTransforms.cpp => VPlanTransforms.cpp} (86%) rename llvm/lib/Transforms/Vectorize/{VPlanHCFGTransforms.h => VPlanTransforms.h} (74%) create mode 100644 llvm/tools/llvm-objcopy/InstallNameToolOpts.td create mode 100644 llvm/utils/TableGen/GlobalISel/GIMatchDag.cpp create mode 100644 llvm/utils/TableGen/GlobalISel/GIMatchDag.h create mode 100644 llvm/utils/TableGen/GlobalISel/GIMatchDagEdge.cpp create mode 100644 llvm/utils/TableGen/GlobalISel/GIMatchDagEdge.h create mode 100644 llvm/utils/TableGen/GlobalISel/GIMatchDagInstr.cpp create mode 100644 llvm/utils/TableGen/GlobalISel/GIMatchDagInstr.h create mode 100644 llvm/utils/TableGen/GlobalISel/GIMatchDagOperands.cpp create mode 100644 llvm/utils/TableGen/GlobalISel/GIMatchDagOperands.h create mode 100644 llvm/utils/TableGen/GlobalISel/GIMatchDagPredicate.cpp create mode 100644 llvm/utils/TableGen/GlobalISel/GIMatchDagPredicate.h create mode 100644 llvm/utils/TableGen/GlobalISel/GIMatchDagPredicateDependencyEdge.cpp create mode 100644 llvm/utils/TableGen/GlobalISel/GIMatchDagPredicateDependencyEdge.h create mode 100644 llvm/utils/TableGen/GlobalISel/GIMatchTree.cpp create mode 100644 llvm/utils/TableGen/GlobalISel/GIMatchTree.h create mode 100644 llvm/utils/TableGen/OptEmitter.cpp create mode 100644 llvm/utils/TableGen/OptEmitter.h create mode 100644 llvm/utils/TableGen/OptRSTEmitter.cpp diff --git a/clang/include/clang-c/BuildSystem.h b/clang/include/clang-c/BuildSystem.h index 8f26a8611719..4e9f6dee0279 100644 --- a/clang/include/clang-c/BuildSystem.h +++ b/clang/include/clang-c/BuildSystem.h @@ -14,13 +14,12 @@ #ifndef LLVM_CLANG_C_BUILDSYSTEM_H #define LLVM_CLANG_C_BUILDSYSTEM_H -#include "clang-c/Platform.h" #include "clang-c/CXErrorCode.h" #include "clang-c/CXString.h" +#include "clang-c/ExternC.h" +#include "clang-c/Platform.h" -#ifdef __cplusplus -extern "C" { -#endif +LLVM_CLANG_C_EXTERN_C_BEGIN /** * \defgroup BUILD_SYSTEM Build system utilities @@ -148,9 +147,7 @@ CINDEX_LINKAGE void clang_ModuleMapDescriptor_dispose(CXModuleMapDescriptor); * @} */ -#ifdef __cplusplus -} -#endif +LLVM_CLANG_C_EXTERN_C_END #endif /* CLANG_C_BUILD_SYSTEM_H */ diff --git a/clang/include/clang-c/CXCompilationDatabase.h b/clang/include/clang-c/CXCompilationDatabase.h index 2669c1a792c1..2b336e5464a2 100644 --- a/clang/include/clang-c/CXCompilationDatabase.h +++ b/clang/include/clang-c/CXCompilationDatabase.h @@ -15,12 +15,11 @@ #ifndef LLVM_CLANG_C_CXCOMPILATIONDATABASE_H #define LLVM_CLANG_C_CXCOMPILATIONDATABASE_H -#include "clang-c/Platform.h" #include "clang-c/CXString.h" +#include "clang-c/ExternC.h" +#include "clang-c/Platform.h" -#ifdef __cplusplus -extern "C" { -#endif +LLVM_CLANG_C_EXTERN_C_BEGIN /** \defgroup COMPILATIONDB CompilationDatabase functions * \ingroup CINDEX @@ -169,8 +168,7 @@ clang_CompileCommand_getMappedSourceContent(CXCompileCommand, unsigned I); * @} */ -#ifdef __cplusplus -} -#endif +LLVM_CLANG_C_EXTERN_C_END + #endif diff --git a/clang/include/clang-c/CXErrorCode.h b/clang/include/clang-c/CXErrorCode.h index fed195ec1f33..b3a0b9d66d5f 100644 --- a/clang/include/clang-c/CXErrorCode.h +++ b/clang/include/clang-c/CXErrorCode.h @@ -14,11 +14,10 @@ #ifndef LLVM_CLANG_C_CXERRORCODE_H #define LLVM_CLANG_C_CXERRORCODE_H +#include "clang-c/ExternC.h" #include "clang-c/Platform.h" -#ifdef __cplusplus -extern "C" { -#endif +LLVM_CLANG_C_EXTERN_C_BEGIN /** * Error codes returned by libclang routines. @@ -57,8 +56,7 @@ enum CXErrorCode { CXError_ASTReadError = 4 }; -#ifdef __cplusplus -} -#endif +LLVM_CLANG_C_EXTERN_C_END + #endif diff --git a/clang/include/clang-c/CXString.h b/clang/include/clang-c/CXString.h index 1eb3442ccb24..f117010c71a4 100644 --- a/clang/include/clang-c/CXString.h +++ b/clang/include/clang-c/CXString.h @@ -14,11 +14,10 @@ #ifndef LLVM_CLANG_C_CXSTRING_H #define LLVM_CLANG_C_CXSTRING_H +#include "clang-c/ExternC.h" #include "clang-c/Platform.h" -#ifdef __cplusplus -extern "C" { -#endif +LLVM_CLANG_C_EXTERN_C_BEGIN /** * \defgroup CINDEX_STRING String manipulation routines @@ -64,8 +63,7 @@ CINDEX_LINKAGE void clang_disposeStringSet(CXStringSet *set); * @} */ -#ifdef __cplusplus -} -#endif +LLVM_CLANG_C_EXTERN_C_END + #endif diff --git a/clang/include/clang-c/Documentation.h b/clang/include/clang-c/Documentation.h index 4af8c93a367e..5bece2cb6758 100644 --- a/clang/include/clang-c/Documentation.h +++ b/clang/include/clang-c/Documentation.h @@ -15,11 +15,10 @@ #ifndef LLVM_CLANG_C_DOCUMENTATION_H #define LLVM_CLANG_C_DOCUMENTATION_H +#include "clang-c/ExternC.h" #include "clang-c/Index.h" -#ifdef __cplusplus -extern "C" { -#endif +LLVM_CLANG_C_EXTERN_C_BEGIN /** * \defgroup CINDEX_COMMENT Comment introspection @@ -182,7 +181,12 @@ enum CXCommentInlineCommandRenderKind { * Command argument should be rendered emphasized (typically italic * font). */ - CXCommentInlineCommandRenderKind_Emphasized + CXCommentInlineCommandRenderKind_Emphasized, + + /** + * Command argument should not be rendered (since it only defines an anchor). + */ + CXCommentInlineCommandRenderKind_Anchor }; /** @@ -545,10 +549,7 @@ CINDEX_LINKAGE CXString clang_FullComment_getAsXML(CXComment Comment); * @} */ - -#ifdef __cplusplus -} -#endif +LLVM_CLANG_C_EXTERN_C_END #endif /* CLANG_C_DOCUMENTATION_H */ diff --git a/clang/include/clang-c/ExternC.h b/clang/include/clang-c/ExternC.h new file mode 100644 index 000000000000..384f24d47b0b --- /dev/null +++ b/clang/include/clang-c/ExternC.h @@ -0,0 +1,39 @@ +/*===- clang-c/ExternC.h - Wrapper for 'extern "C"' ---------------*- C -*-===*\ +|* *| +|* Part of the LLVM Project, under the Apache License v2.0 with LLVM *| +|* Exceptions. *| +|* See https://llvm.org/LICENSE.txt for license information. *| +|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception *| +|* *| +|*===----------------------------------------------------------------------===*| +|* *| +|* This file defines an 'extern "C"' wrapper. *| +|* *| +\*===----------------------------------------------------------------------===*/ + +#ifndef LLVM_CLANG_C_EXTERN_C_H +#define LLVM_CLANG_C_EXTERN_C_H + +#ifdef __clang__ +#define LLVM_CLANG_C_STRICT_PROTOTYPES_BEGIN \ + _Pragma("clang diagnostic push") \ + _Pragma("clang diagnostic error \"-Wstrict-prototypes\"") +#define LLVM_CLANG_C_STRICT_PROTOTYPES_END _Pragma("clang diagnostic pop") +#else +#define LLVM_CLANG_C_STRICT_PROTOTYPES_BEGIN +#define LLVM_CLANG_C_STRICT_PROTOTYPES_END +#endif + +#ifdef __cplusplus +#define LLVM_CLANG_C_EXTERN_C_BEGIN \ + extern "C" { \ + LLVM_CLANG_C_STRICT_PROTOTYPES_BEGIN +#define LLVM_CLANG_C_EXTERN_C_END \ + LLVM_CLANG_C_STRICT_PROTOTYPES_END \ + } +#else +#define LLVM_CLANG_C_EXTERN_C_BEGIN LLVM_CLANG_C_STRICT_PROTOTYPES_BEGIN +#define LLVM_CLANG_C_EXTERN_C_END LLVM_CLANG_C_STRICT_PROTOTYPES_END +#endif + +#endif diff --git a/clang/include/clang-c/FatalErrorHandler.h b/clang/include/clang-c/FatalErrorHandler.h index ce8ff2cae735..22f34fa815cc 100644 --- a/clang/include/clang-c/FatalErrorHandler.h +++ b/clang/include/clang-c/FatalErrorHandler.h @@ -10,9 +10,9 @@ #ifndef LLVM_CLANG_C_FATAL_ERROR_HANDLER_H #define LLVM_CLANG_C_FATAL_ERROR_HANDLER_H -#ifdef __cplusplus -extern "C" { -#endif +#include "clang-c/ExternC.h" + +LLVM_CLANG_C_EXTERN_C_BEGIN /** * Installs error handler that prints error message to stderr and calls abort(). @@ -27,7 +27,6 @@ void clang_install_aborting_llvm_fatal_error_handler(void); */ void clang_uninstall_llvm_fatal_error_handler(void); -#ifdef __cplusplus -} -#endif +LLVM_CLANG_C_EXTERN_C_END + #endif diff --git a/clang/include/clang-c/Index.h b/clang/include/clang-c/Index.h index 226893505437..b653995ebbd0 100644 --- a/clang/include/clang-c/Index.h +++ b/clang/include/clang-c/Index.h @@ -18,10 +18,11 @@ #include -#include "clang-c/Platform.h" +#include "clang-c/BuildSystem.h" #include "clang-c/CXErrorCode.h" #include "clang-c/CXString.h" -#include "clang-c/BuildSystem.h" +#include "clang-c/ExternC.h" +#include "clang-c/Platform.h" /** * The version constants for the libclang API. @@ -51,9 +52,7 @@ CINDEX_VERSION_MAJOR, \ CINDEX_VERSION_MINOR) -#ifdef __cplusplus -extern "C" { -#endif +LLVM_CLANG_C_EXTERN_C_BEGIN /** \defgroup CINDEX libclang: C Interface to Clang * @@ -2567,8 +2566,15 @@ enum CXCursorKind { */ CXCursor_OMPMasterTaskLoopSimdDirective = 283, + /** OpenMP parallel master taskloop simd directive. + */ + CXCursor_OMPParallelMasterTaskLoopSimdDirective = 284, - CXCursor_LastStmt = CXCursor_OMPMasterTaskLoopSimdDirective, + /** OpenMP parallel master directive. + */ + CXCursor_OMPParallelMasterDirective = 285, + + CXCursor_LastStmt = CXCursor_OMPParallelMasterDirective, /** * Cursor that represents the translation unit itself. @@ -6771,7 +6777,6 @@ CINDEX_LINKAGE unsigned clang_Type_visitFields(CXType T, * @} */ -#ifdef __cplusplus -} -#endif +LLVM_CLANG_C_EXTERN_C_END + #endif diff --git a/clang/include/clang-c/Platform.h b/clang/include/clang-c/Platform.h index 5284b533253d..3bb66bb0df48 100644 --- a/clang/include/clang-c/Platform.h +++ b/clang/include/clang-c/Platform.h @@ -14,9 +14,9 @@ #ifndef LLVM_CLANG_C_PLATFORM_H #define LLVM_CLANG_C_PLATFORM_H -#ifdef __cplusplus -extern "C" { -#endif +#include "clang-c/ExternC.h" + +LLVM_CLANG_C_EXTERN_C_BEGIN /* MSVC DLL import/export. */ #ifdef _MSC_VER @@ -39,7 +39,6 @@ extern "C" { #endif #endif -#ifdef __cplusplus -} -#endif +LLVM_CLANG_C_EXTERN_C_END + #endif diff --git a/clang/include/clang/AST/ASTConcept.h b/clang/include/clang/AST/ASTConcept.h new file mode 100644 index 000000000000..896d857d8c96 --- /dev/null +++ b/clang/include/clang/AST/ASTConcept.h @@ -0,0 +1,177 @@ +//===--- ASTConcept.h - Concepts Related AST Data Structures ----*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +/// +/// \file +/// \brief This file provides AST data structures related to concepts. +/// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_CLANG_AST_ASTCONCEPT_H +#define LLVM_CLANG_AST_ASTCONCEPT_H +#include "clang/AST/Expr.h" +#include "clang/Basic/SourceLocation.h" +#include "llvm/ADT/PointerUnion.h" +#include "llvm/ADT/SmallVector.h" +#include +#include +namespace clang { +class ConceptDecl; + +/// \brief The result of a constraint satisfaction check, containing the +/// necessary information to diagnose an unsatisfied constraint. +struct ConstraintSatisfaction { + using SubstitutionDiagnostic = std::pair; + using Detail = llvm::PointerUnion; + + bool IsSatisfied = false; + + /// \brief Pairs of unsatisfied atomic constraint expressions along with the + /// substituted constraint expr, if the template arguments could be + /// substituted into them, or a diagnostic if substitution resulted in an + /// invalid expression. + llvm::SmallVector, 4> Details; + + // This can leak if used in an AST node, use ASTConstraintSatisfaction + // instead. + void *operator new(size_t bytes, ASTContext &C) = delete; +}; + +/// Pairs of unsatisfied atomic constraint expressions along with the +/// substituted constraint expr, if the template arguments could be +/// substituted into them, or a diagnostic if substitution resulted in +/// an invalid expression. +using UnsatisfiedConstraintRecord = + std::pair *>>; + +/// \brief The result of a constraint satisfaction check, containing the +/// necessary information to diagnose an unsatisfied constraint. +/// +/// This is safe to store in an AST node, as opposed to ConstraintSatisfaction. +struct ASTConstraintSatisfaction final : + llvm::TrailingObjects { + std::size_t NumRecords; + bool IsSatisfied : 1; + + const UnsatisfiedConstraintRecord *begin() const { + return getTrailingObjects(); + } + + const UnsatisfiedConstraintRecord *end() const { + return getTrailingObjects() + NumRecords; + } + + ASTConstraintSatisfaction(const ASTContext &C, + const ConstraintSatisfaction &Satisfaction); + + static ASTConstraintSatisfaction * + Create(const ASTContext &C, const ConstraintSatisfaction &Satisfaction); +}; + +/// \brief Common data class for constructs that reference concepts with +/// template arguments. +class ConceptReference { +protected: + // \brief The optional nested name specifier used when naming the concept. + NestedNameSpecifierLoc NestedNameSpec; + + /// \brief The location of the template keyword, if specified when naming the + /// concept. + SourceLocation TemplateKWLoc; + + /// \brief The concept name used. + DeclarationNameInfo ConceptName; + + /// \brief The declaration found by name lookup when the expression was + /// created. + /// Can differ from NamedConcept when, for example, the concept was found + /// through a UsingShadowDecl. + NamedDecl *FoundDecl; + + /// \brief The concept named. + ConceptDecl *NamedConcept; + + /// \brief The template argument list source info used to specialize the + /// concept. + const ASTTemplateArgumentListInfo *ArgsAsWritten; + +public: + + ConceptReference(NestedNameSpecifierLoc NNS, SourceLocation TemplateKWLoc, + DeclarationNameInfo ConceptNameInfo, NamedDecl *FoundDecl, + ConceptDecl *NamedConcept, + const ASTTemplateArgumentListInfo *ArgsAsWritten) : + NestedNameSpec(NNS), TemplateKWLoc(TemplateKWLoc), + ConceptName(ConceptNameInfo), FoundDecl(FoundDecl), + NamedConcept(NamedConcept), ArgsAsWritten(ArgsAsWritten) {} + + ConceptReference() : NestedNameSpec(), TemplateKWLoc(), ConceptName(), + FoundDecl(nullptr), NamedConcept(nullptr), ArgsAsWritten(nullptr) {} + + const NestedNameSpecifierLoc &getNestedNameSpecifierLoc() const { + return NestedNameSpec; + } + + const DeclarationNameInfo &getConceptNameInfo() const { return ConceptName; } + + SourceLocation getConceptNameLoc() const { + return getConceptNameInfo().getLoc(); + } + + SourceLocation getTemplateKWLoc() const { return TemplateKWLoc; } + + NamedDecl *getFoundDecl() const { + return FoundDecl; + } + + ConceptDecl *getNamedConcept() const { + return NamedConcept; + } + + const ASTTemplateArgumentListInfo *getTemplateArgsAsWritten() const { + return ArgsAsWritten; + } + + /// \brief Whether or not template arguments were explicitly specified in the + /// concept reference (they might not be in type constraints, for example) + bool hasExplicitTemplateArgs() const { + return ArgsAsWritten != nullptr; + } +}; + +class TypeConstraint : public ConceptReference { + /// \brief The immediately-declared constraint expression introduced by this + /// type-constraint. + Expr *ImmediatelyDeclaredConstraint = nullptr; + +public: + TypeConstraint(NestedNameSpecifierLoc NNS, + DeclarationNameInfo ConceptNameInfo, NamedDecl *FoundDecl, + ConceptDecl *NamedConcept, + const ASTTemplateArgumentListInfo *ArgsAsWritten, + Expr *ImmediatelyDeclaredConstraint) : + ConceptReference(NNS, /*TemplateKWLoc=*/SourceLocation(), ConceptNameInfo, + FoundDecl, NamedConcept, ArgsAsWritten), + ImmediatelyDeclaredConstraint(ImmediatelyDeclaredConstraint) {} + + /// \brief Get the immediately-declared constraint expression introduced by + /// this type-constraint, that is - the constraint expression that is added to + /// the associated constraints of the enclosing declaration in practice. + Expr *getImmediatelyDeclaredConstraint() const { + return ImmediatelyDeclaredConstraint; + } + + void print(llvm::raw_ostream &OS, PrintingPolicy Policy) const; +}; + +} // clang + +#endif // LLVM_CLANG_AST_ASTCONCEPT_H \ No newline at end of file diff --git a/clang/include/clang/AST/ASTConsumer.h b/clang/include/clang/AST/ASTConsumer.h index dc216a89c205..ecdd8e873e1e 100644 --- a/clang/include/clang/AST/ASTConsumer.h +++ b/clang/include/clang/AST/ASTConsumer.h @@ -102,6 +102,11 @@ class ASTConsumer { /// modified by the introduction of an implicit zero initializer. virtual void CompleteTentativeDefinition(VarDecl *D) {} + /// CompleteExternalDeclaration - Callback invoked at the end of a translation + /// unit to notify the consumer that the given external declaration should be + /// completed. + virtual void CompleteExternalDeclaration(VarDecl *D) {} + /// Callback invoked when an MSInheritanceAttr has been attached to a /// CXXRecordDecl. virtual void AssignInheritanceModel(CXXRecordDecl *RD) {} diff --git a/clang/include/clang/AST/ASTContext.h b/clang/include/clang/AST/ASTContext.h index 5e2f4031d96c..fb269cef1ce8 100644 --- a/clang/include/clang/AST/ASTContext.h +++ b/clang/include/clang/AST/ASTContext.h @@ -22,7 +22,6 @@ #include "clang/AST/Decl.h" #include "clang/AST/DeclBase.h" #include "clang/AST/DeclarationName.h" -#include "clang/AST/Expr.h" #include "clang/AST/ExternalASTSource.h" #include "clang/AST/NestedNameSpecifier.h" #include "clang/AST/PrettyPrinter.h" @@ -96,6 +95,7 @@ class CXXRecordDecl; class DiagnosticsEngine; class Expr; class FixedPointSemantics; +class GlobalDecl; class MangleContext; class MangleNumberingContext; class MaterializeTemporaryExpr; @@ -113,9 +113,11 @@ class ObjCPropertyDecl; class ObjCPropertyImplDecl; class ObjCProtocolDecl; class ObjCTypeParamDecl; +struct ParsedTargetAttr; class Preprocessor; class Stmt; class StoredDeclsMap; +class TargetAttr; class TemplateDecl; class TemplateParameterList; class TemplateTemplateParmDecl; @@ -124,6 +126,7 @@ class UnresolvedSetIterator; class UsingShadowDecl; class VarTemplateDecl; class VTableContextBase; +struct BlockVarCopyInit; namespace Builtin { @@ -145,6 +148,10 @@ class Context; } // namespace interp +namespace serialization { +template class AbstractTypeReader; +} // namespace serialization + struct TypeInfo { uint64_t Width = 0; unsigned Align = 0; @@ -158,22 +165,6 @@ struct TypeInfo { /// Holds long-lived AST nodes (such as types and decls) that can be /// referred to throughout the semantic analysis of a file. class ASTContext : public RefCountedBase { -public: - /// Copy initialization expr of a __block variable and a boolean flag that - /// indicates whether the expression can throw. - struct BlockVarCopyInit { - BlockVarCopyInit() = default; - BlockVarCopyInit(Expr *CopyExpr, bool CanThrow) - : ExprAndFlag(CopyExpr, CanThrow) {} - void setExprAndFlag(Expr *CopyExpr, bool CanThrow) { - ExprAndFlag.setPointerAndInt(CopyExpr, CanThrow); - } - Expr *getCopyExpr() const { return ExprAndFlag.getPointer(); } - bool canThrow() const { return ExprAndFlag.getInt(); } - llvm::PointerIntPair ExprAndFlag; - }; - -private: friend class NestedNameSpecifier; mutable SmallVector Types; @@ -272,12 +263,6 @@ class ASTContext : public RefCountedBase { /// Mapping from __block VarDecls to BlockVarCopyInit. llvm::DenseMap BlockVarCopyInits; - /// Mapping from materialized temporaries with static storage duration - /// that appear in constant initializers to their evaluated values. These are - /// allocated in a std::map because their address must be stable. - llvm::DenseMap - MaterializedTemporaryValues; - /// Used to cleanups APValues stored in the AST. mutable llvm::SmallVector APValueCleanups; @@ -298,12 +283,16 @@ class ASTContext : public RefCountedBase { TemplateTemplateParmDecl *getParam() const { return Parm; } - void Profile(llvm::FoldingSetNodeID &ID) { Profile(ID, Parm); } + void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &C) { + Profile(ID, C, Parm); + } static void Profile(llvm::FoldingSetNodeID &ID, + const ASTContext &C, TemplateTemplateParmDecl *Parm); }; - mutable llvm::FoldingSet + mutable llvm::ContextualFoldingSet CanonTemplateTemplateParms; TemplateTemplateParmDecl * @@ -435,6 +424,7 @@ class ASTContext : public RefCountedBase { friend class ASTDeclReader; friend class ASTReader; friend class ASTWriter; + template friend class serialization::AbstractTypeReader; friend class CXXRecordDecl; /// A mapping to contain the template or declaration that @@ -575,7 +565,17 @@ class ASTContext : public RefCountedBase { clang::PrintingPolicy PrintingPolicy; std::unique_ptr InterpContext; + ast_type_traits::TraversalKind Traversal = ast_type_traits::TK_AsIs; + public: + ast_type_traits::TraversalKind getTraversalKind() const { return Traversal; } + void setTraversalKind(ast_type_traits::TraversalKind TK) { Traversal = TK; } + + const Expr *traverseIgnored(const Expr *E) const; + Expr *traverseIgnored(Expr *E) const; + ast_type_traits::DynTypedNode + traverseIgnored(const ast_type_traits::DynTypedNode &N) const; + IdentifierTable &Idents; SelectorTable &Selectors; Builtin::Context &BuiltinInfo; @@ -1162,6 +1162,10 @@ class ASTContext : public RefCountedBase { /// attribute. QualType getObjCGCQualType(QualType T, Qualifiers::GC gcAttr) const; + /// Remove the existing address space on the type if it is a pointer size + /// address space and return the type with qualifiers intact. + QualType removePtrSizeAddrSpace(QualType T) const; + /// Return the uniqued reference to the type for a \c restrict /// qualified type. /// @@ -1216,6 +1220,15 @@ class ASTContext : public RefCountedBase { const FunctionProtoType::ExceptionSpecInfo &ESI, bool AsWritten = false); + /// Get a function type and produce the equivalent function type where + /// pointer size address spaces in the return type and parameter tyeps are + /// replaced with the default address space. + QualType getFunctionTypeWithoutPtrSizes(QualType T); + + /// Determine whether two function types are the same, ignoring pointer sizes + /// in the return type and parameter types. + bool hasSameFunctionTypeIgnoringPtrSizes(QualType T, QualType U); + /// Return the uniqued reference to the type for a complex /// number with the specified element type. QualType getComplexType(QualType T) const; @@ -2827,16 +2840,20 @@ class ASTContext : public RefCountedBase { /// index of the parameter when it exceeds the size of the normal bitfield. unsigned getParameterIndex(const ParmVarDecl *D) const; - /// Get the storage for the constant value of a materialized temporary - /// of static storage duration. - APValue *getMaterializedTemporaryValue(const MaterializeTemporaryExpr *E, - bool MayCreate); - /// Return a string representing the human readable name for the specified /// function declaration or file name. Used by SourceLocExpr and /// PredefinedExpr to cache evaluated results. StringLiteral *getPredefinedStringLiteralFromCache(StringRef Key) const; + /// Parses the target attributes passed in, and returns only the ones that are + /// valid feature names. + ParsedTargetAttr filterFunctionTargetAttrs(const TargetAttr *TD) const; + + void getFunctionFeatureMap(llvm::StringMap &FeatureMap, + const FunctionDecl *) const; + void getFunctionFeatureMap(llvm::StringMap &FeatureMap, + GlobalDecl GD) const; + //===--------------------------------------------------------------------===// // Statistics //===--------------------------------------------------------------------===// @@ -3007,7 +3024,7 @@ OPT_LIST(V) std::vector TraversalScope; class ParentMap; - std::unique_ptr Parents; + std::map> Parents; std::unique_ptr VTContext; @@ -3051,6 +3068,22 @@ inline Selector GetUnarySelector(StringRef name, ASTContext &Ctx) { return Ctx.Selectors.getSelector(1, &II); } +class TraversalKindScope { + ASTContext &Ctx; + ast_type_traits::TraversalKind TK = ast_type_traits::TK_AsIs; + +public: + TraversalKindScope(ASTContext &Ctx, + llvm::Optional ScopeTK) + : Ctx(Ctx) { + TK = Ctx.getTraversalKind(); + if (ScopeTK) + Ctx.setTraversalKind(*ScopeTK); + } + + ~TraversalKindScope() { Ctx.setTraversalKind(TK); } +}; + } // namespace clang // operator new and delete aren't allowed inside namespaces. diff --git a/clang/include/clang/AST/ASTFwd.h b/clang/include/clang/AST/ASTFwd.h index 25c321485443..5a891817b336 100644 --- a/clang/include/clang/AST/ASTFwd.h +++ b/clang/include/clang/AST/ASTFwd.h @@ -26,6 +26,10 @@ class Type; #define TYPE(DERIVED, BASE) class DERIVED##Type; #include "clang/AST/TypeNodes.inc" class CXXCtorInitializer; +class OMPClause; +#define OPENMP_CLAUSE(KIND, CLASSNAME) class CLASSNAME; +#include "clang/Basic/OpenMPKinds.def" + } // end namespace clang diff --git a/clang/include/clang/AST/ASTImporter.h b/clang/include/clang/AST/ASTImporter.h index c82dcab35db5..490b34bf95e8 100644 --- a/clang/include/clang/AST/ASTImporter.h +++ b/clang/include/clang/AST/ASTImporter.h @@ -60,8 +60,12 @@ class TypeSourceInfo; static char ID; - ImportError() : Error(Unknown) { } - ImportError(const ImportError &Other) : Error(Other.Error) { } + ImportError() : Error(Unknown) {} + ImportError(const ImportError &Other) : Error(Other.Error) {} + ImportError &operator=(const ImportError &Other) { + Error = Other.Error; + return *this; + } ImportError(ErrorKind Error) : Error(Error) { } std::string toString() const; diff --git a/clang/include/clang/AST/ASTLambda.h b/clang/include/clang/AST/ASTLambda.h index c1153168e41b..6fd82d6af490 100644 --- a/clang/include/clang/AST/ASTLambda.h +++ b/clang/include/clang/AST/ASTLambda.h @@ -64,6 +64,17 @@ inline bool isGenericLambdaCallOperatorSpecialization(DeclContext *DC) { dyn_cast(DC)); } +inline bool isGenericLambdaCallOperatorOrStaticInvokerSpecialization( + DeclContext *DC) { + CXXMethodDecl *MD = dyn_cast(DC); + if (!MD) return false; + const CXXRecordDecl *LambdaClass = MD->getParent(); + if (LambdaClass && LambdaClass->isGenericLambda()) + return (isLambdaCallOperator(MD) || MD->isLambdaStaticInvoker()) && + MD->isFunctionTemplateSpecialization(); + return false; +} + // This returns the parent DeclContext ensuring that the correct // parent DeclContext is returned for Lambdas diff --git a/clang/include/clang/AST/ASTNodeTraverser.h b/clang/include/clang/AST/ASTNodeTraverser.h index 0bb2aad553fb..e0ebb020e697 100644 --- a/clang/include/clang/AST/ASTNodeTraverser.h +++ b/clang/include/clang/AST/ASTNodeTraverser.h @@ -65,6 +65,9 @@ class ASTNodeTraverser /// not already been loaded. bool Deserialize = false; + ast_type_traits::TraversalKind Traversal = + ast_type_traits::TraversalKind::TK_AsIs; + NodeDelegateType &getNodeDelegate() { return getDerived().doGetNodeDelegate(); } @@ -74,6 +77,8 @@ class ASTNodeTraverser void setDeserialize(bool D) { Deserialize = D; } bool getDeserialize() const { return Deserialize; } + void SetTraversalKind(ast_type_traits::TraversalKind TK) { Traversal = TK; } + void Visit(const Decl *D) { getNodeDelegate().AddChild([=] { getNodeDelegate().Visit(D); @@ -97,8 +102,23 @@ class ASTNodeTraverser }); } - void Visit(const Stmt *S, StringRef Label = {}) { + void Visit(const Stmt *Node, StringRef Label = {}) { getNodeDelegate().AddChild(Label, [=] { + const Stmt *S = Node; + + if (auto *E = dyn_cast_or_null(S)) { + switch (Traversal) { + case ast_type_traits::TK_AsIs: + break; + case ast_type_traits::TK_IgnoreImplicitCastsAndParentheses: + S = E->IgnoreParenImpCasts(); + break; + case ast_type_traits::TK_IgnoreUnlessSpelledInSource: + S = E->IgnoreUnlessSpelledInSource(); + break; + } + } + getNodeDelegate().Visit(S); if (!S) { @@ -108,9 +128,12 @@ class ASTNodeTraverser ConstStmtVisitor::Visit(S); // Some statements have custom mechanisms for dumping their children. - if (isa(S) || isa(S)) { + if (isa(S) || isa(S)) + return; + + if (isa(S) && + Traversal == ast_type_traits::TK_IgnoreUnlessSpelledInSource) return; - } for (const Stmt *SubStmt : S->children()) Visit(SubStmt); @@ -361,6 +384,9 @@ class ASTNodeTraverser for (const auto *Parameter : D->parameters()) Visit(Parameter); + if (const Expr *TRC = D->getTrailingRequiresClause()) + Visit(TRC); + if (const auto *C = dyn_cast(D)) for (const auto *I : C->inits()) Visit(I); @@ -511,6 +537,10 @@ class ASTNodeTraverser } void VisitTemplateTypeParmDecl(const TemplateTypeParmDecl *D) { + if (const auto *TC = D->getTypeConstraint()) + if (TC->hasExplicitTemplateArgs()) + for (const auto &ArgLoc : TC->getTemplateArgsAsWritten()->arguments()) + dumpTemplateArgumentLoc(ArgLoc); if (D->hasDefaultArgument()) Visit(D->getDefaultArgument(), SourceRange(), D->getDefaultArgStorage().getInheritedFrom(), @@ -518,6 +548,8 @@ class ASTNodeTraverser } void VisitNonTypeTemplateParmDecl(const NonTypeTemplateParmDecl *D) { + if (const auto *TC = D->getPlaceholderTypeConstraint()) + Visit(TC->getImmediatelyDeclaredConstraint()); if (D->hasDefaultArgument()) Visit(D->getDefaultArgument(), SourceRange(), D->getDefaultArgStorage().getInheritedFrom(), @@ -620,13 +652,29 @@ class ASTNodeTraverser Visit(E->getControllingExpr()); Visit(E->getControllingExpr()->getType()); // FIXME: remove - for (const auto &Assoc : E->associations()) { + for (const auto Assoc : E->associations()) { Visit(Assoc); } } void VisitLambdaExpr(const LambdaExpr *Node) { - Visit(Node->getLambdaClass()); + if (Traversal == ast_type_traits::TK_IgnoreUnlessSpelledInSource) { + for (unsigned I = 0, N = Node->capture_size(); I != N; ++I) { + const auto *C = Node->capture_begin() + I; + if (!C->isExplicit()) + continue; + if (Node->isInitCapture(C)) + Visit(C->getCapturedVar()); + else + Visit(Node->capture_init_begin()[I]); + } + dumpTemplateParameters(Node->getTemplateParameterList()); + for (const auto *P : Node->getCallOperator()->parameters()) + Visit(P); + Visit(Node->getBody()); + } else { + return Visit(Node->getLambdaClass()); + } } void VisitSizeOfPackExpr(const SizeOfPackExpr *Node) { diff --git a/clang/include/clang/AST/ASTTypeTraits.h b/clang/include/clang/AST/ASTTypeTraits.h index dd4ead2f0c2b..1a12281d039d 100644 --- a/clang/include/clang/AST/ASTTypeTraits.h +++ b/clang/include/clang/AST/ASTTypeTraits.h @@ -16,10 +16,7 @@ #define LLVM_CLANG_AST_ASTTYPETRAITS_H #include "clang/AST/ASTFwd.h" -#include "clang/AST/Decl.h" #include "clang/AST/NestedNameSpecifier.h" -#include "clang/AST/OpenMPClause.h" -#include "clang/AST/Stmt.h" #include "clang/AST/TemplateBase.h" #include "clang/AST/TypeLoc.h" #include "clang/Basic/LLVM.h" @@ -46,7 +43,10 @@ enum TraversalKind { /// Will not traverse implicit casts and parentheses. /// Corresponds to Expr::IgnoreParenImpCasts() - TK_IgnoreImplicitCastsAndParentheses + TK_IgnoreImplicitCastsAndParentheses, + + /// Ignore AST nodes not written in the source + TK_IgnoreUnlessSpelledInSource }; /// Kind identifier. diff --git a/clang/include/clang/AST/AbstractBasicReader.h b/clang/include/clang/AST/AbstractBasicReader.h new file mode 100644 index 000000000000..d7b3a9da88ec --- /dev/null +++ b/clang/include/clang/AST/AbstractBasicReader.h @@ -0,0 +1,263 @@ +//==--- AbstractBasiceReader.h - Abstract basic value deserialization -----===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef CLANG_AST_ABSTRACTBASICREADER_H +#define CLANG_AST_ABSTRACTBASICREADER_H + +#include "clang/AST/DeclTemplate.h" + +namespace clang { +namespace serialization { + +template +inline T makeNullableFromOptional(const Optional &value) { + return (value ? *value : T()); +} + +template +inline T *makePointerFromOptional(Optional value) { + return (value ? *value : nullptr); +} + +// PropertyReader is a class concept that requires the following method: +// BasicReader find(llvm::StringRef propertyName); +// where BasicReader is some class conforming to the BasicReader concept. +// An abstract AST-node reader is created with a PropertyReader and +// performs a sequence of calls like so: +// propertyReader.find(propertyName).read##TypeName() +// to read the properties of the node it is deserializing. + +// BasicReader is a class concept that requires methods like: +// ValueType read##TypeName(); +// where TypeName is the name of a PropertyType node from PropertiesBase.td +// and ValueType is the corresponding C++ type name. The read method may +// require one or more buffer arguments. +// +// In addition to the concrete type names, BasicReader is expected to +// implement these methods: +// +// template +// void writeEnum(T value); +// +// Reads an enum value from the current property. EnumType will always +// be an enum type. Only necessary if the BasicReader doesn't provide +// type-specific readers for all the enum types. +// +// template +// Optional writeOptional(); +// +// Reads an optional value from the current property. +// +// template +// ArrayRef readArray(llvm::SmallVectorImpl &buffer); +// +// Reads an array of values from the current property. +// +// PropertyReader readObject(); +// +// Reads an object from the current property; the returned property +// reader will be subjected to a sequence of property reads and then +// discarded before any other properties are reader from the "outer" +// property reader (which need not be the same type). The sub-reader +// will be used as if with the following code: +// +// { +// auto &&widget = W.find("widget").readObject(); +// auto kind = widget.find("kind").readWidgetKind(); +// auto declaration = widget.find("declaration").readDeclRef(); +// return Widget(kind, declaration); +// } + +// ReadDispatcher does type-based forwarding to one of the read methods +// on the BasicReader passed in: +// +// template +// struct ReadDispatcher { +// template +// static ValueType read(BasicReader &R, BufferTypes &&...); +// }; + +// BasicReaderBase provides convenience implementations of the read methods +// for EnumPropertyType and SubclassPropertyType types that just defer to +// the "underlying" implementations (for UInt32 and the base class, +// respectively). +// +// template +// class BasicReaderBase { +// protected: +// BasicReaderBase(ASTContext &ctx); +// Impl &asImpl(); +// public: +// ASTContext &getASTContext(); +// ... +// }; + +// The actual classes are auto-generated; see ClangASTPropertiesEmitter.cpp. +#include "clang/AST/AbstractBasicReader.inc" + +/// DataStreamBasicReader provides convenience implementations for many +/// BasicReader methods based on the assumption that the +/// ultimate reader implementation is based on a variable-length stream +/// of unstructured data (like Clang's module files). It is designed +/// to pair with DataStreamBasicWriter. +/// +/// This class can also act as a PropertyReader, implementing find("...") +/// by simply forwarding to itself. +/// +/// Unimplemented methods: +/// readBool +/// readUInt32 +/// readUInt64 +/// readIdentifier +/// readSelector +/// readSourceLocation +/// readQualType +/// readStmtRef +/// readDeclRef +template +class DataStreamBasicReader : public BasicReaderBase { +protected: + using BasicReaderBase::asImpl; + DataStreamBasicReader(ASTContext &ctx) : BasicReaderBase(ctx) {} + +public: + using BasicReaderBase::getASTContext; + + /// Implement property-find by ignoring it. We rely on properties being + /// serialized and deserialized in a reliable order instead. + Impl &find(const char *propertyName) { + return asImpl(); + } + + template + T readEnum() { + return T(asImpl().readUInt32()); + } + + // Implement object reading by forwarding to this, collapsing the + // structure into a single data stream. + Impl &readObject() { return asImpl(); } + + template + llvm::ArrayRef readArray(llvm::SmallVectorImpl &buffer) { + assert(buffer.empty()); + + uint32_t size = asImpl().readUInt32(); + buffer.reserve(size); + + for (uint32_t i = 0; i != size; ++i) { + buffer.push_back(ReadDispatcher::read(asImpl())); + } + return buffer; + } + + template + llvm::Optional readOptional(Args &&...args) { + return UnpackOptionalValue::unpack( + ReadDispatcher::read(asImpl(), std::forward(args)...)); + } + + llvm::APSInt readAPSInt() { + bool isUnsigned = asImpl().readBool(); + llvm::APInt value = asImpl().readAPInt(); + return llvm::APSInt(std::move(value), isUnsigned); + } + + llvm::APInt readAPInt() { + unsigned bitWidth = asImpl().readUInt32(); + unsigned numWords = llvm::APInt::getNumWords(bitWidth); + llvm::SmallVector data; + for (uint32_t i = 0; i != numWords; ++i) + data.push_back(asImpl().readUInt64()); + return llvm::APInt(bitWidth, numWords, &data[0]); + } + + Qualifiers readQualifiers() { + static_assert(sizeof(Qualifiers().getAsOpaqueValue()) <= sizeof(uint32_t), + "update this if the value size changes"); + uint32_t value = asImpl().readUInt32(); + return Qualifiers::fromOpaqueValue(value); + } + + FunctionProtoType::ExceptionSpecInfo + readExceptionSpecInfo(llvm::SmallVectorImpl &buffer) { + FunctionProtoType::ExceptionSpecInfo esi; + esi.Type = ExceptionSpecificationType(asImpl().readUInt32()); + if (esi.Type == EST_Dynamic) { + esi.Exceptions = asImpl().template readArray(buffer); + } else if (isComputedNoexcept(esi.Type)) { + esi.NoexceptExpr = asImpl().readExprRef(); + } else if (esi.Type == EST_Uninstantiated) { + esi.SourceDecl = asImpl().readFunctionDeclRef(); + esi.SourceTemplate = asImpl().readFunctionDeclRef(); + } else if (esi.Type == EST_Unevaluated) { + esi.SourceDecl = asImpl().readFunctionDeclRef(); + } + return esi; + } + + FunctionProtoType::ExtParameterInfo readExtParameterInfo() { + static_assert(sizeof(FunctionProtoType::ExtParameterInfo().getOpaqueValue()) + <= sizeof(uint32_t), + "opaque value doesn't fit into uint32_t"); + uint32_t value = asImpl().readUInt32(); + return FunctionProtoType::ExtParameterInfo::getFromOpaqueValue(value); + } + + NestedNameSpecifier *readNestedNameSpecifier() { + auto &ctx = getASTContext(); + + // We build this up iteratively. + NestedNameSpecifier *cur = nullptr; + + uint32_t depth = asImpl().readUInt32(); + for (uint32_t i = 0; i != depth; ++i) { + auto kind = asImpl().readNestedNameSpecifierKind(); + switch (kind) { + case NestedNameSpecifier::Identifier: + cur = NestedNameSpecifier::Create(ctx, cur, + asImpl().readIdentifier()); + continue; + + case NestedNameSpecifier::Namespace: + cur = NestedNameSpecifier::Create(ctx, cur, + asImpl().readNamespaceDeclRef()); + continue; + + case NestedNameSpecifier::NamespaceAlias: + cur = NestedNameSpecifier::Create(ctx, cur, + asImpl().readNamespaceAliasDeclRef()); + continue; + + case NestedNameSpecifier::TypeSpec: + case NestedNameSpecifier::TypeSpecWithTemplate: + cur = NestedNameSpecifier::Create(ctx, cur, + kind == NestedNameSpecifier::TypeSpecWithTemplate, + asImpl().readQualType().getTypePtr()); + continue; + + case NestedNameSpecifier::Global: + cur = NestedNameSpecifier::GlobalSpecifier(ctx); + continue; + + case NestedNameSpecifier::Super: + cur = NestedNameSpecifier::SuperSpecifier(ctx, + asImpl().readCXXRecordDeclRef()); + continue; + } + llvm_unreachable("bad nested name specifier kind"); + } + + return cur; + } +}; + +} // end namespace serialization +} // end namespace clang + +#endif diff --git a/clang/include/clang/AST/AbstractBasicWriter.h b/clang/include/clang/AST/AbstractBasicWriter.h new file mode 100644 index 000000000000..0a6730c86bbf --- /dev/null +++ b/clang/include/clang/AST/AbstractBasicWriter.h @@ -0,0 +1,243 @@ +//==--- AbstractBasicWriter.h - Abstract basic value serialization --------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef CLANG_AST_ABSTRACTBASICWRITER_H +#define CLANG_AST_ABSTRACTBASICWRITER_H + +#include "clang/AST/DeclTemplate.h" + +namespace clang { +namespace serialization { + +template +inline llvm::Optional makeOptionalFromNullable(const T &value) { + return (value.isNull() + ? llvm::Optional() + : llvm::Optional(value)); +} + +template +inline llvm::Optional makeOptionalFromPointer(T *value) { + return (value ? llvm::Optional(value) : llvm::Optional()); +} + +// PropertyWriter is a class concept that requires the following method: +// BasicWriter find(llvm::StringRef propertyName); +// where BasicWriter is some class conforming to the BasicWriter concept. +// An abstract AST-node writer is created with a PropertyWriter and +// performs a sequence of calls like so: +// propertyWriter.find(propertyName).write##TypeName(value) +// to write the properties of the node it is serializing. + +// BasicWriter is a class concept that requires methods like: +// void write##TypeName(ValueType value); +// where TypeName is the name of a PropertyType node from PropertiesBase.td +// and ValueType is the corresponding C++ type name. +// +// In addition to the concrete property types, BasicWriter is expected +// to implement these methods: +// +// template +// void writeEnum(T value); +// +// Writes an enum value as the current property. EnumType will always +// be an enum type. Only necessary if the BasicWriter doesn't provide +// type-specific writers for all the enum types. +// +// template +// void writeOptional(Optional value); +// +// Writes an optional value as the current property. +// +// template +// void writeArray(ArrayRef value); +// +// Writes an array of values as the current property. +// +// PropertyWriter writeObject(); +// +// Writes an object as the current property; the returned property +// writer will be subjected to a sequence of property writes and then +// discarded before any other properties are written to the "outer" +// property writer (which need not be the same type). The sub-writer +// will be used as if with the following code: +// +// { +// auto &&widget = W.find("widget").writeObject(); +// widget.find("kind").writeWidgetKind(...); +// widget.find("declaration").writeDeclRef(...); +// } + +// WriteDispatcher is a template which does type-based forwarding to one +// of the write methods of the BasicWriter passed in: +// +// template +// struct WriteDispatcher { +// template +// static void write(BasicWriter &W, ValueType value); +// }; + +// BasicWriterBase provides convenience implementations of the write +// methods for EnumPropertyType and SubclassPropertyType types that just +// defer to the "underlying" implementations (for UInt32 and the base class, +// respectively). +// +// template +// class BasicWriterBase { +// protected: +// Impl &asImpl(); +// public: +// ... +// }; + +// The actual classes are auto-generated; see ClangASTPropertiesEmitter.cpp. +#include "clang/AST/AbstractBasicWriter.inc" + +/// DataStreamBasicWriter provides convenience implementations for many +/// BasicWriter methods based on the assumption that the +/// ultimate writer implementation is based on a variable-length stream +/// of unstructured data (like Clang's module files). It is designed +/// to pair with DataStreamBasicReader. +/// +/// This class can also act as a PropertyWriter, implementing find("...") +/// by simply forwarding to itself. +/// +/// Unimplemented methods: +/// writeBool +/// writeUInt32 +/// writeUInt64 +/// writeIdentifier +/// writeSelector +/// writeSourceLocation +/// writeQualType +/// writeStmtRef +/// writeDeclRef +template +class DataStreamBasicWriter : public BasicWriterBase { +protected: + using BasicWriterBase::asImpl; + +public: + /// Implement property-find by ignoring it. We rely on properties being + /// serialized and deserialized in a reliable order instead. + Impl &find(const char *propertyName) { + return asImpl(); + } + + // Implement object writing by forwarding to this, collapsing the + // structure into a single data stream. + Impl &writeObject() { return asImpl(); } + + template + void writeEnum(T value) { + asImpl().writeUInt32(uint32_t(value)); + } + + template + void writeArray(llvm::ArrayRef array) { + asImpl().writeUInt32(array.size()); + for (const T &elt : array) { + WriteDispatcher::write(asImpl(), elt); + } + } + + template + void writeOptional(llvm::Optional value) { + WriteDispatcher::write(asImpl(), PackOptionalValue::pack(value)); + } + + void writeAPSInt(const llvm::APSInt &value) { + asImpl().writeBool(value.isUnsigned()); + asImpl().writeAPInt(value); + } + + void writeAPInt(const llvm::APInt &value) { + asImpl().writeUInt32(value.getBitWidth()); + const uint64_t *words = value.getRawData(); + for (size_t i = 0, e = value.getNumWords(); i != e; ++i) + asImpl().writeUInt64(words[i]); + } + + void writeQualifiers(Qualifiers value) { + static_assert(sizeof(value.getAsOpaqueValue()) <= sizeof(uint32_t), + "update this if the value size changes"); + asImpl().writeUInt32(value.getAsOpaqueValue()); + } + + void writeExceptionSpecInfo( + const FunctionProtoType::ExceptionSpecInfo &esi) { + asImpl().writeUInt32(uint32_t(esi.Type)); + if (esi.Type == EST_Dynamic) { + asImpl().writeArray(esi.Exceptions); + } else if (isComputedNoexcept(esi.Type)) { + asImpl().writeExprRef(esi.NoexceptExpr); + } else if (esi.Type == EST_Uninstantiated) { + asImpl().writeDeclRef(esi.SourceDecl); + asImpl().writeDeclRef(esi.SourceTemplate); + } else if (esi.Type == EST_Unevaluated) { + asImpl().writeDeclRef(esi.SourceDecl); + } + } + + void writeExtParameterInfo(FunctionProtoType::ExtParameterInfo epi) { + static_assert(sizeof(epi.getOpaqueValue()) <= sizeof(uint32_t), + "opaque value doesn't fit into uint32_t"); + asImpl().writeUInt32(epi.getOpaqueValue()); + } + + void writeNestedNameSpecifier(NestedNameSpecifier *NNS) { + // Nested name specifiers usually aren't too long. I think that 8 would + // typically accommodate the vast majority. + SmallVector nestedNames; + + // Push each of the NNS's onto a stack for serialization in reverse order. + while (NNS) { + nestedNames.push_back(NNS); + NNS = NNS->getPrefix(); + } + + asImpl().writeUInt32(nestedNames.size()); + while (!nestedNames.empty()) { + NNS = nestedNames.pop_back_val(); + NestedNameSpecifier::SpecifierKind kind = NNS->getKind(); + asImpl().writeNestedNameSpecifierKind(kind); + switch (kind) { + case NestedNameSpecifier::Identifier: + asImpl().writeIdentifier(NNS->getAsIdentifier()); + continue; + + case NestedNameSpecifier::Namespace: + asImpl().writeNamespaceDeclRef(NNS->getAsNamespace()); + continue; + + case NestedNameSpecifier::NamespaceAlias: + asImpl().writeNamespaceAliasDeclRef(NNS->getAsNamespaceAlias()); + continue; + + case NestedNameSpecifier::TypeSpec: + case NestedNameSpecifier::TypeSpecWithTemplate: + asImpl().writeQualType(QualType(NNS->getAsType(), 0)); + continue; + + case NestedNameSpecifier::Global: + // Don't need to write an associated value. + continue; + + case NestedNameSpecifier::Super: + asImpl().writeDeclRef(NNS->getAsRecordDecl()); + continue; + } + llvm_unreachable("bad nested name specifier kind"); + } + } +}; + +} // end namespace serialization +} // end namespace clang + +#endif diff --git a/clang/include/clang/AST/AbstractTypeReader.h b/clang/include/clang/AST/AbstractTypeReader.h new file mode 100644 index 000000000000..9fea7b26f678 --- /dev/null +++ b/clang/include/clang/AST/AbstractTypeReader.h @@ -0,0 +1,31 @@ +//==--- AbstractTypeReader.h - Abstract deserialization for types ---------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef CLANG_AST_ABSTRACTTYPEREADER_H +#define CLANG_AST_ABSTRACTTYPEREADER_H + +#include "clang/AST/Type.h" +#include "clang/AST/AbstractBasicReader.h" + +namespace clang { +namespace serialization { + +// template +// class AbstractTypeReader { +// public: +// AbstractTypeReader(PropertyReader &W); +// QualType read(Type::TypeClass kind); +// }; +// +// The actual class is auto-generated; see ClangASTPropertiesEmitter.cpp. +#include "clang/AST/AbstractTypeReader.inc" + +} // end namespace serialization +} // end namespace clang + +#endif diff --git a/clang/include/clang/AST/AbstractTypeWriter.h b/clang/include/clang/AST/AbstractTypeWriter.h new file mode 100644 index 000000000000..a63cb0be099d --- /dev/null +++ b/clang/include/clang/AST/AbstractTypeWriter.h @@ -0,0 +1,32 @@ +//==--- AbstractTypeWriter.h - Abstract serialization for types -----------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef CLANG_AST_ABSTRACTTYPEWRITER_H +#define CLANG_AST_ABSTRACTTYPEWRITER_H + +#include "clang/AST/Type.h" +#include "clang/AST/AbstractBasicWriter.h" +#include "clang/AST/DeclObjC.h" + +namespace clang { +namespace serialization { + +// template +// class AbstractTypeWriter { +// public: +// AbstractTypeWriter(PropertyWriter &W); +// void write(QualType type); +// }; +// +// The actual class is auto-generated; see ClangASTPropertiesEmitter.cpp. +#include "clang/AST/AbstractTypeWriter.inc" + +} // end namespace serialization +} // end namespace clang + +#endif diff --git a/clang/include/clang/AST/Attr.h b/clang/include/clang/AST/Attr.h index d315dde6ed45..bbaa46363d97 100644 --- a/clang/include/clang/AST/Attr.h +++ b/clang/include/clang/AST/Attr.h @@ -32,83 +32,83 @@ #include namespace clang { - class ASTContext; - class AttributeCommonInfo; - class IdentifierInfo; - class ObjCInterfaceDecl; - class Expr; - class QualType; - class FunctionDecl; - class TypeSourceInfo; +class ASTContext; +class AttributeCommonInfo; +class IdentifierInfo; +class ObjCInterfaceDecl; +class Expr; +class QualType; +class FunctionDecl; +class TypeSourceInfo; /// Attr - This represents one attribute. - class Attr : public AttributeCommonInfo { - private: - unsigned AttrKind : 16; +class Attr : public AttributeCommonInfo { +private: + unsigned AttrKind : 16; - protected: - /// An index into the spelling list of an - /// attribute defined in Attr.td file. - unsigned Inherited : 1; - unsigned IsPackExpansion : 1; - unsigned Implicit : 1; - // FIXME: These are properties of the attribute kind, not state for this - // instance of the attribute. - unsigned IsLateParsed : 1; - unsigned InheritEvenIfAlreadyPresent : 1; +protected: + /// An index into the spelling list of an + /// attribute defined in Attr.td file. + unsigned Inherited : 1; + unsigned IsPackExpansion : 1; + unsigned Implicit : 1; + // FIXME: These are properties of the attribute kind, not state for this + // instance of the attribute. + unsigned IsLateParsed : 1; + unsigned InheritEvenIfAlreadyPresent : 1; - void *operator new(size_t bytes) noexcept { - llvm_unreachable("Attrs cannot be allocated with regular 'new'."); - } - void operator delete(void *data) noexcept { - llvm_unreachable("Attrs cannot be released with regular 'delete'."); - } + void *operator new(size_t bytes) noexcept { + llvm_unreachable("Attrs cannot be allocated with regular 'new'."); + } + void operator delete(void *data) noexcept { + llvm_unreachable("Attrs cannot be released with regular 'delete'."); + } - public: - // Forward so that the regular new and delete do not hide global ones. - void *operator new(size_t Bytes, ASTContext &C, - size_t Alignment = 8) noexcept { - return ::operator new(Bytes, C, Alignment); - } - void operator delete(void *Ptr, ASTContext &C, size_t Alignment) noexcept { - return ::operator delete(Ptr, C, Alignment); - } +public: + // Forward so that the regular new and delete do not hide global ones. + void *operator new(size_t Bytes, ASTContext &C, + size_t Alignment = 8) noexcept { + return ::operator new(Bytes, C, Alignment); + } + void operator delete(void *Ptr, ASTContext &C, size_t Alignment) noexcept { + return ::operator delete(Ptr, C, Alignment); + } - protected: - Attr(ASTContext &Context, const AttributeCommonInfo &CommonInfo, - attr::Kind AK, bool IsLateParsed) - : AttributeCommonInfo(CommonInfo), AttrKind(AK), Inherited(false), - IsPackExpansion(false), Implicit(false), IsLateParsed(IsLateParsed), - InheritEvenIfAlreadyPresent(false) {} +protected: + Attr(ASTContext &Context, const AttributeCommonInfo &CommonInfo, + attr::Kind AK, bool IsLateParsed) + : AttributeCommonInfo(CommonInfo), AttrKind(AK), Inherited(false), + IsPackExpansion(false), Implicit(false), IsLateParsed(IsLateParsed), + InheritEvenIfAlreadyPresent(false) {} - public: - attr::Kind getKind() const { return static_cast(AttrKind); } +public: + attr::Kind getKind() const { return static_cast(AttrKind); } - unsigned getSpellingListIndex() const { - return getAttributeSpellingListIndex(); - } - const char *getSpelling() const; + unsigned getSpellingListIndex() const { + return getAttributeSpellingListIndex(); + } + const char *getSpelling() const; - SourceLocation getLocation() const { return getRange().getBegin(); } + SourceLocation getLocation() const { return getRange().getBegin(); } - bool isInherited() const { return Inherited; } + bool isInherited() const { return Inherited; } - /// Returns true if the attribute has been implicitly created instead - /// of explicitly written by the user. - bool isImplicit() const { return Implicit; } - void setImplicit(bool I) { Implicit = I; } + /// Returns true if the attribute has been implicitly created instead + /// of explicitly written by the user. + bool isImplicit() const { return Implicit; } + void setImplicit(bool I) { Implicit = I; } - void setPackExpansion(bool PE) { IsPackExpansion = PE; } - bool isPackExpansion() const { return IsPackExpansion; } + void setPackExpansion(bool PE) { IsPackExpansion = PE; } + bool isPackExpansion() const { return IsPackExpansion; } - // Clone this attribute. - Attr *clone(ASTContext &C) const; + // Clone this attribute. + Attr *clone(ASTContext &C) const; - bool isLateParsed() const { return IsLateParsed; } + bool isLateParsed() const { return IsLateParsed; } - // Pretty print this attribute. - void printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const; - }; + // Pretty print this attribute. + void printPretty(raw_ostream &OS, const PrintingPolicy &Policy) const; +}; class TypeAttr : public Attr { protected: @@ -329,6 +329,18 @@ class ParamIdx { static_assert(sizeof(ParamIdx) == sizeof(ParamIdx::SerialType), "ParamIdx does not fit its serialization type"); +/// Contains information gathered from parsing the contents of TargetAttr. +struct ParsedTargetAttr { + std::vector Features; + StringRef Architecture; + StringRef BranchProtection; + bool DuplicateArchitecture = false; + bool operator ==(const ParsedTargetAttr &Other) const { + return DuplicateArchitecture == Other.DuplicateArchitecture && + Architecture == Other.Architecture && Features == Other.Features; + } +}; + #include "clang/AST/Attrs.inc" inline const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB, diff --git a/clang/include/clang/AST/CXXInheritance.h b/clang/include/clang/AST/CXXInheritance.h index bb2ad9c64d3b..f223c1f2f4f0 100644 --- a/clang/include/clang/AST/CXXInheritance.h +++ b/clang/include/clang/AST/CXXInheritance.h @@ -372,6 +372,30 @@ class CXXFinalOverriderMap class CXXIndirectPrimaryBaseSet : public llvm::SmallSet {}; +inline bool +inheritanceModelHasVBPtrOffsetField(MSInheritanceModel Inheritance) { + return Inheritance == MSInheritanceModel::Unspecified; +} + +// Only member pointers to functions need a this adjustment, since it can be +// combined with the field offset for data pointers. +inline bool inheritanceModelHasNVOffsetField(bool IsMemberFunction, + MSInheritanceModel Inheritance) { + return IsMemberFunction && Inheritance >= MSInheritanceModel::Multiple; +} + +inline bool +inheritanceModelHasVBTableOffsetField(MSInheritanceModel Inheritance) { + return Inheritance >= MSInheritanceModel::Virtual; +} + +inline bool inheritanceModelHasOnlyOneField(bool IsMemberFunction, + MSInheritanceModel Inheritance) { + if (IsMemberFunction) + return Inheritance <= MSInheritanceModel::Single; + return Inheritance <= MSInheritanceModel::Multiple; +} + } // namespace clang #endif // LLVM_CLANG_AST_CXXINHERITANCE_H diff --git a/clang/include/clang/AST/Comment.h b/clang/include/clang/AST/Comment.h index 2c284a271bb7..cd9c1ce2bce0 100644 --- a/clang/include/clang/AST/Comment.h +++ b/clang/include/clang/AST/Comment.h @@ -94,10 +94,11 @@ class Comment { unsigned : NumInlineContentCommentBits; - unsigned RenderKind : 2; + unsigned RenderKind : 3; + unsigned CommandID : CommandInfo::NumCommandIDBits; }; - enum { NumInlineCommandCommentBits = NumInlineContentCommentBits + 2 + + enum { NumInlineCommandCommentBits = NumInlineContentCommentBits + 3 + CommandInfo::NumCommandIDBits }; class HTMLTagCommentBitfields { @@ -310,7 +311,8 @@ class InlineCommandComment : public InlineContentComment { RenderNormal, RenderBold, RenderMonospaced, - RenderEmphasized + RenderEmphasized, + RenderAnchor }; protected: diff --git a/clang/include/clang/AST/CommentCommands.td b/clang/include/clang/AST/CommentCommands.td index 3b0d1603d407..d387df7ce570 100644 --- a/clang/include/clang/AST/CommentCommands.td +++ b/clang/include/clang/AST/CommentCommands.td @@ -81,12 +81,13 @@ class RecordLikeDeclarationVerbatimLineCommand : // InlineCommand //===----------------------------------------------------------------------===// -def B : InlineCommand<"b">; -def C : InlineCommand<"c">; -def P : InlineCommand<"p">; -def A : InlineCommand<"a">; -def E : InlineCommand<"e">; -def Em : InlineCommand<"em">; +def B : InlineCommand<"b">; +def C : InlineCommand<"c">; +def P : InlineCommand<"p">; +def A : InlineCommand<"a">; +def E : InlineCommand<"e">; +def Em : InlineCommand<"em">; +def Anchor : InlineCommand<"anchor">; //===----------------------------------------------------------------------===// // BlockCommand diff --git a/clang/include/clang/AST/ComparisonCategories.h b/clang/include/clang/AST/ComparisonCategories.h index 9d591cc81495..70a78964b8a0 100644 --- a/clang/include/clang/AST/ComparisonCategories.h +++ b/clang/include/clang/AST/ComparisonCategories.h @@ -41,23 +41,30 @@ class NamespaceDecl; /// partial_ordering, weak_ordering, and strong_ordering are collectively /// termed the comparison category types. enum class ComparisonCategoryType : unsigned char { - WeakEquality, - StrongEquality, PartialOrdering, WeakOrdering, StrongOrdering, - First = WeakEquality, + First = PartialOrdering, Last = StrongOrdering }; +/// Determine the common comparison type, as defined in C++2a +/// [class.spaceship]p4. +inline ComparisonCategoryType commonComparisonType(ComparisonCategoryType A, + ComparisonCategoryType B) { + return A < B ? A : B; +} + +/// Get the comparison category that should be used when comparing values of +/// type \c T. +Optional getComparisonCategoryForBuiltinCmp(QualType T); + /// An enumeration representing the possible results of a three-way /// comparison. These values map onto instances of comparison category types /// defined in the standard library. e.g. 'std::strong_ordering::less'. enum class ComparisonCategoryResult : unsigned char { Equal, Equivalent, - Nonequivalent, - Nonequal, Less, Greater, Unordered, @@ -125,21 +132,11 @@ class ComparisonCategoryInfo { return Info; } - /// True iff the comparison category is an equality comparison. - bool isEquality() const { return !isOrdered(); } - - /// True iff the comparison category is a relational comparison. - bool isOrdered() const { - using CCK = ComparisonCategoryType; - return Kind == CCK::PartialOrdering || Kind == CCK::WeakOrdering || - Kind == CCK::StrongOrdering; - } - /// True iff the comparison is "strong". i.e. it checks equality and /// not equivalence. bool isStrong() const { using CCK = ComparisonCategoryType; - return Kind == CCK::StrongEquality || Kind == CCK::StrongOrdering; + return Kind == CCK::StrongOrdering; } /// True iff the comparison is not totally ordered. @@ -153,28 +150,18 @@ class ComparisonCategoryInfo { /// weak equivalence if needed. ComparisonCategoryResult makeWeakResult(ComparisonCategoryResult Res) const { using CCR = ComparisonCategoryResult; - if (!isStrong()) { - if (Res == CCR::Equal) - return CCR::Equivalent; - if (Res == CCR::Nonequal) - return CCR::Nonequivalent; - } + if (!isStrong() && Res == CCR::Equal) + return CCR::Equivalent; return Res; } const ValueInfo *getEqualOrEquiv() const { return getValueInfo(makeWeakResult(ComparisonCategoryResult::Equal)); } - const ValueInfo *getNonequalOrNonequiv() const { - assert(isEquality()); - return getValueInfo(makeWeakResult(ComparisonCategoryResult::Nonequal)); - } const ValueInfo *getLess() const { - assert(isOrdered()); return getValueInfo(ComparisonCategoryResult::Less); } const ValueInfo *getGreater() const { - assert(isOrdered()); return getValueInfo(ComparisonCategoryResult::Greater); } const ValueInfo *getUnordered() const { @@ -221,7 +208,6 @@ class ComparisonCategories { return const_cast(This.lookupInfo(Kind)); } -private: const ComparisonCategoryInfo *lookupInfoForType(QualType Ty) const; private: diff --git a/clang/include/clang/AST/Decl.h b/clang/include/clang/AST/Decl.h index ce674e09c44d..43c6c7b85db4 100644 --- a/clang/include/clang/AST/Decl.h +++ b/clang/include/clang/AST/Decl.h @@ -15,6 +15,7 @@ #include "clang/AST/APValue.h" #include "clang/AST/ASTContextAllocate.h" +#include "clang/AST/DeclAccessPair.h" #include "clang/AST/DeclBase.h" #include "clang/AST/DeclarationName.h" #include "clang/AST/ExternalASTSource.h" @@ -59,6 +60,7 @@ class EnumDecl; class Expr; class FunctionTemplateDecl; class FunctionTemplateSpecializationInfo; +class FunctionTypeLoc; class LabelStmt; class MemberSpecializationInfo; class Module; @@ -76,33 +78,6 @@ class TypeLoc; class UnresolvedSetImpl; class VarTemplateDecl; -/// A container of type source information. -/// -/// A client can read the relevant info using TypeLoc wrappers, e.g: -/// @code -/// TypeLoc TL = TypeSourceInfo->getTypeLoc(); -/// TL.getBeginLoc().print(OS, SrcMgr); -/// @endcode -class alignas(8) TypeSourceInfo { - // Contains a memory block after the class, used for type source information, - // allocated by ASTContext. - friend class ASTContext; - - QualType Ty; - - TypeSourceInfo(QualType ty) : Ty(ty) {} - -public: - /// Return the type wrapped by this type source info. - QualType getType() const { return Ty; } - - /// 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; } -}; - /// The top declaration context. class TranslationUnitDecl : public Decl, public DeclContext { ASTContext &Ctx; @@ -694,10 +669,12 @@ struct QualifierInfo { /// Represents a ValueDecl that came out of a declarator. /// Contains type source information through TypeSourceInfo. class DeclaratorDecl : public ValueDecl { - // A struct representing both a TInfo and a syntactic qualifier, - // to be used for the (uncommon) case of out-of-line declarations. + // A struct representing a TInfo, a trailing requires-clause and a syntactic + // qualifier, to be used for the (uncommon) case of out-of-line declarations + // and constrained function decls. struct ExtInfo : public QualifierInfo { TypeSourceInfo *TInfo; + Expr *TrailingRequiresClause = nullptr; }; llvm::PointerUnion DeclInfo; @@ -764,6 +741,21 @@ class DeclaratorDecl : public ValueDecl { void setQualifierInfo(NestedNameSpecifierLoc QualifierLoc); + /// \brief Get the constraint-expression introduced by the trailing + /// requires-clause in the function/member declaration, or null if no + /// requires-clause was provided. + Expr *getTrailingRequiresClause() { + return hasExtInfo() ? getExtInfo()->TrailingRequiresClause + : nullptr; + } + + const Expr *getTrailingRequiresClause() const { + return hasExtInfo() ? getExtInfo()->TrailingRequiresClause + : nullptr; + } + + void setTrailingRequiresClause(Expr *TrailingRequiresClause); + unsigned getNumTemplateParameterLists() const { return hasExtInfo() ? getExtInfo()->NumTemplParamLists : 0; } @@ -777,6 +769,7 @@ class DeclaratorDecl : public ValueDecl { ArrayRef TPLists); SourceLocation getTypeSpecStartLoc() const; + SourceLocation getTypeSpecEndLoc() const; // Implement isa/cast/dyncast/etc. static bool classof(const Decl *D) { return classofKind(D->getKind()); } @@ -898,6 +891,8 @@ class VarDecl : public DeclaratorDecl, public Redeclarable { DAK_Normal }; + enum { NumScopeDepthOrObjCQualsBits = 7 }; + class ParmVarDeclBitfields { friend class ASTDeclReader; friend class ParmVarDecl; @@ -924,7 +919,7 @@ class VarDecl : public DeclaratorDecl, public Redeclarable { /// Otherwise, the number of function parameter scopes enclosing /// the function parameter scope in which this parameter was /// declared. - unsigned ScopeDepthOrObjCQuals : 7; + unsigned ScopeDepthOrObjCQuals : NumScopeDepthOrObjCQualsBits; /// The number of parameters preceding this parameter in the /// function parameter scope in which it was declared. @@ -1524,8 +1519,8 @@ class VarDecl : public DeclaratorDecl, public Redeclarable { /// need not have a usable destructor at all. bool isNoDestroy(const ASTContext &) const; - /// Do we need to emit an exit-time destructor for this variable, and if so, - /// what kind? + /// Would the destruction of this variable have any effect, and if so, what + /// kind? QualType::DestructionKind needsDestruction(const ASTContext &Ctx) const; // Implement isa/cast/dyncast/etc. @@ -1649,6 +1644,10 @@ class ParmVarDecl : public VarDecl { return ParmVarDeclBits.ScopeDepthOrObjCQuals; } + static constexpr unsigned getMaxFunctionScopeDepth() { + return (1u << NumScopeDepthOrObjCQualsBits) - 1; + } + /// Returns the index of this parameter in its prototype or method scope. unsigned getFunctionScopeIndex() const { return getParameterIndex(); @@ -1805,13 +1804,37 @@ class FunctionDecl : public DeclaratorDecl, TK_DependentFunctionTemplateSpecialization }; + /// Stashed information about a defaulted function definition whose body has + /// not yet been lazily generated. + class DefaultedFunctionInfo final + : llvm::TrailingObjects { + friend TrailingObjects; + unsigned NumLookups; + + public: + static DefaultedFunctionInfo *Create(ASTContext &Context, + ArrayRef Lookups); + /// Get the unqualified lookup results that should be used in this + /// defaulted function definition. + ArrayRef getUnqualifiedLookups() const { + return {getTrailingObjects(), NumLookups}; + } + }; + private: /// A new[]'d array of pointers to VarDecls for the formal /// parameters of this function. This is null if a prototype or if there are /// no formals. ParmVarDecl **ParamInfo = nullptr; - LazyDeclStmtPtr Body; + /// The active member of this union is determined by + /// FunctionDeclBits.HasDefaultedFunctionInfo. + union { + /// The body of the function. + LazyDeclStmtPtr Body; + /// Information about a future defaulted function definition. + DefaultedFunctionInfo *DefaultedInfo; + }; unsigned ODRHash; @@ -1836,10 +1859,10 @@ class FunctionDecl : public DeclaratorDecl, /// FunctionTemplateSpecializationInfo, which contains information about /// the template being specialized and the template arguments involved in /// that specialization. - llvm::PointerUnion4 + llvm::PointerUnion TemplateOrSpecialization; /// Provides source/type location info for the declaration name embedded in @@ -1897,7 +1920,8 @@ class FunctionDecl : public DeclaratorDecl, FunctionDecl(Kind DK, ASTContext &C, DeclContext *DC, SourceLocation StartLoc, const DeclarationNameInfo &NameInfo, QualType T, TypeSourceInfo *TInfo, StorageClass S, bool isInlineSpecified, - ConstexprSpecKind ConstexprKind); + ConstexprSpecKind ConstexprKind, + Expr *TrailingRequiresClause = nullptr); using redeclarable_base = Redeclarable; @@ -1932,11 +1956,12 @@ class FunctionDecl : public DeclaratorDecl, SourceLocation NLoc, DeclarationName N, QualType T, TypeSourceInfo *TInfo, StorageClass SC, bool isInlineSpecified = false, bool hasWrittenPrototype = true, - ConstexprSpecKind ConstexprKind = CSK_unspecified) { + ConstexprSpecKind ConstexprKind = CSK_unspecified, + Expr *TrailingRequiresClause = nullptr) { DeclarationNameInfo NameInfo(N, NLoc); return FunctionDecl::Create(C, DC, StartLoc, NameInfo, T, TInfo, SC, isInlineSpecified, hasWrittenPrototype, - ConstexprKind); + ConstexprKind, TrailingRequiresClause); } static FunctionDecl *Create(ASTContext &C, DeclContext *DC, @@ -1944,7 +1969,8 @@ class FunctionDecl : public DeclaratorDecl, const DeclarationNameInfo &NameInfo, QualType T, TypeSourceInfo *TInfo, StorageClass SC, bool isInlineSpecified, bool hasWrittenPrototype, - ConstexprSpecKind ConstexprKind); + ConstexprSpecKind ConstexprKind, + Expr *TrailingRequiresClause); static FunctionDecl *CreateDeserialized(ASTContext &C, unsigned ID); @@ -1957,6 +1983,14 @@ class FunctionDecl : public DeclaratorDecl, void setRangeEnd(SourceLocation E) { EndRangeLoc = E; } + /// Returns the location of the ellipsis of a variadic function. + SourceLocation getEllipsisLoc() const { + const auto *FPT = getType()->getAs(); + if (FPT && FPT->isVariadic()) + return FPT->getEllipsisLoc(); + return SourceLocation(); + } + SourceRange getSourceRange() const override LLVM_READONLY; // Function definitions. @@ -2030,18 +2064,30 @@ class FunctionDecl : public DeclaratorDecl, /// /// This does not determine whether the function has been defined (e.g., in a /// previous definition); for that information, use isDefined. + /// + /// Note: the function declaration does not become a definition until the + /// parser reaches the definition, if called before, this function will return + /// `false`. bool isThisDeclarationADefinition() const { - return isDeletedAsWritten() || isDefaulted() || Body || hasSkippedBody() || - isLateTemplateParsed() || willHaveBody() || hasDefiningAttr(); + return isDeletedAsWritten() || isDefaulted() || + doesThisDeclarationHaveABody() || hasSkippedBody() || + willHaveBody() || hasDefiningAttr(); } /// Returns whether this specific declaration of the function has a body. bool doesThisDeclarationHaveABody() const { - return Body || isLateTemplateParsed(); + return (!FunctionDeclBits.HasDefaultedFunctionInfo && Body) || + isLateTemplateParsed(); } void setBody(Stmt *B); - void setLazyBody(uint64_t Offset) { Body = Offset; } + void setLazyBody(uint64_t Offset) { + FunctionDeclBits.HasDefaultedFunctionInfo = false; + Body = LazyDeclStmtPtr(Offset); + } + + void setDefaultedFunctionInfo(DefaultedFunctionInfo *Info); + DefaultedFunctionInfo *getDefaultedFunctionInfo() const; /// Whether this function is variadic. bool isVariadic() const; @@ -2096,6 +2142,16 @@ class FunctionDecl : public DeclaratorDecl, FunctionDeclBits.IsExplicitlyDefaulted = ED; } + /// True if this method is user-declared and was not + /// deleted or defaulted on its first declaration. + bool isUserProvided() const { + auto *DeclAsWritten = this; + if (FunctionDecl *Pattern = getTemplateInstantiationPattern()) + DeclAsWritten = Pattern; + return !(DeclAsWritten->isDeleted() || + DeclAsWritten->getCanonicalDecl()->isDefaulted()); + } + /// Whether falling off this function implicitly returns null/zero. /// If a more specific implicit return value is required, front-ends /// should synthesize the appropriate return statements. @@ -2177,6 +2233,10 @@ class FunctionDecl : public DeclaratorDecl, bool usesSEHTry() const { return FunctionDeclBits.UsesSEHTry; } void setUsesSEHTry(bool UST) { FunctionDeclBits.UsesSEHTry = UST; } + /// Indicates the function uses Floating Point constrained intrinsics + bool usesFPIntrin() const { return FunctionDeclBits.UsesFPIntrin; } + void setUsesFPIntrin(bool Val) { FunctionDeclBits.UsesFPIntrin = Val; } + /// Whether this function has been deleted. /// /// A function that is "deleted" (via the C++0x "= delete" syntax) @@ -2249,6 +2309,9 @@ class FunctionDecl : public DeclaratorDecl, /// true through IsAligned. bool isReplaceableGlobalAllocationFunction(bool *IsAligned = nullptr) const; + /// Determine if this function provides an inline implementation of a builtin. + bool isInlineBuiltinDeclaration() const; + /// Determine whether this is a destroying operator delete. bool isDestroyingOperatorDelete() const; @@ -2312,6 +2375,17 @@ class FunctionDecl : public DeclaratorDecl, /// the target functionality. bool isTargetMultiVersion() const; + /// \brief Get the associated-constraints of this function declaration. + /// Currently, this will either be a vector of size 1 containing the + /// trailing-requires-clause or an empty vector. + /// + /// Use this instead of getTrailingRequiresClause for concepts APIs that + /// accept an ArrayRef of constraint expressions. + void getAssociatedConstraints(SmallVectorImpl &AC) const { + if (auto *TRC = getTrailingRequiresClause()) + AC.push_back(TRC); + } + void setPreviousDeclaration(FunctionDecl * PrevDecl); FunctionDecl *getCanonicalDecl() override; @@ -2362,6 +2436,12 @@ class FunctionDecl : public DeclaratorDecl, /// parameters have default arguments (in C++). unsigned getMinRequiredArguments() const; + /// Find the source location information for how the type of this function + /// was written. May be absent (for example if the function was declared via + /// a typedef) and may contain a different type from that of the function + /// (for example if the function type was adjusted by an attribute). + FunctionTypeLoc getFunctionTypeLoc() const; + QualType getReturnType() const { return getType()->castAs()->getReturnType(); } @@ -2371,6 +2451,12 @@ class FunctionDecl : public DeclaratorDecl, /// limited representation in the AST. SourceRange getReturnTypeSourceRange() const; + /// Attempt to compute an informative source range covering the + /// function parameters, including the ellipsis of a variadic function. + /// The source range excludes the parentheses, and is invalid if there are + /// no parameters and no ellipsis. + SourceRange getParametersSourceRange() const; + /// Get the declared return type, which may differ from the actual return /// type if the return type is deduced. QualType getDeclaredReturnType() const { diff --git a/clang/include/clang/AST/DeclBase.h b/clang/include/clang/AST/DeclBase.h index 01c2f1809771..91c372585b07 100644 --- a/clang/include/clang/AST/DeclBase.h +++ b/clang/include/clang/AST/DeclBase.h @@ -1501,10 +1501,9 @@ class DeclContext { /// constructor or a destructor. uint64_t IsTrivialForCall : 1; - /// Used by CXXMethodDecl uint64_t IsDefaulted : 1; - /// Used by CXXMethodDecl uint64_t IsExplicitlyDefaulted : 1; + uint64_t HasDefaultedFunctionInfo : 1; uint64_t HasImplicitReturnZero : 1; uint64_t IsLateTemplateParsed : 1; @@ -1534,10 +1533,13 @@ class DeclContext { /// Store the ODRHash after first calculation. uint64_t HasODRHash : 1; + + /// Indicates if the function uses Floating Point Constrained Intrinsics + uint64_t UsesFPIntrin : 1; }; /// Number of non-inherited bits in FunctionDeclBitfields. - enum { NumFunctionDeclBits = 25 }; + enum { NumFunctionDeclBits = 27 }; /// Stores the bits used by CXXConstructorDecl. If modified /// NumCXXConstructorDeclBits and the accessor @@ -1554,7 +1556,7 @@ class DeclContext { /// exactly 64 bits and thus the width of NumCtorInitializers /// will need to be shrunk if some bit is added to NumDeclContextBitfields, /// NumFunctionDeclBitfields or CXXConstructorDeclBitfields. - uint64_t NumCtorInitializers : 23; + uint64_t NumCtorInitializers : 21; uint64_t IsInheritingConstructor : 1; /// Whether this constructor has a trail-allocated explicit specifier. @@ -1590,6 +1592,9 @@ class DeclContext { /// True if this method is the getter or setter for an explicit property. uint64_t IsPropertyAccessor : 1; + /// True if this method is a synthesized property accessor stub. + uint64_t IsSynthesizedAccessorStub : 1; + /// Method has a definition. uint64_t IsDefined : 1; diff --git a/clang/include/clang/AST/DeclCXX.h b/clang/include/clang/AST/DeclCXX.h index 66212f72b787..b716ea453a5a 100644 --- a/clang/include/clang/AST/DeclCXX.h +++ b/clang/include/clang/AST/DeclCXX.h @@ -17,7 +17,6 @@ #include "clang/AST/ASTContext.h" #include "clang/AST/ASTUnresolvedSet.h" -#include "clang/AST/Attr.h" #include "clang/AST/Decl.h" #include "clang/AST/DeclBase.h" #include "clang/AST/DeclarationName.h" @@ -42,7 +41,6 @@ #include "llvm/ADT/PointerUnion.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/iterator_range.h" -#include "llvm/BinaryFormat/Dwarf.h" #include "llvm/Support/Casting.h" #include "llvm/Support/Compiler.h" #include "llvm/Support/PointerLikeTypeTraits.h" @@ -1048,7 +1046,8 @@ class CXXRecordDecl : public RecordDecl { /// Get all conversion functions visible in current class, /// including conversion function templates. - llvm::iterator_range getVisibleConversionFunctions(); + llvm::iterator_range + getVisibleConversionFunctions() const; /// Determine whether this class is an aggregate (C++ [dcl.init.aggr]), /// which is a class with no user-declared constructors, no private @@ -1737,10 +1736,10 @@ class CXXRecordDecl : public RecordDecl { } /// Returns the inheritance model used for this record. - MSInheritanceAttr::Spelling getMSInheritanceModel() const; + MSInheritanceModel getMSInheritanceModel() const; /// Calculate what the inheritance model would be for this class. - MSInheritanceAttr::Spelling calculateInheritanceModel() const; + MSInheritanceModel calculateInheritanceModel() const; /// In the Microsoft C++ ABI, use zero for the field offset of a null data /// member pointer if we can guarantee that zero is not a valid field offset, @@ -1748,15 +1747,11 @@ class CXXRecordDecl : public RecordDecl { /// vfptr at offset zero, so we can use zero for null. If there are multiple /// fields, we can use zero even if it is a valid field offset because /// null-ness testing will check the other fields. - bool nullFieldOffsetIsZero() const { - return !MSInheritanceAttr::hasOnlyOneField(/*IsMemberFunction=*/false, - getMSInheritanceModel()) || - (hasDefinition() && isPolymorphic()); - } + bool nullFieldOffsetIsZero() const; /// Controls when vtordisps will be emitted if this record is used as a /// virtual base. - MSVtorDispAttr::Mode getMSVtorDispMode() const; + MSVtorDispMode getMSVtorDispMode() const; /// Determine whether this lambda expression was known to be dependent /// at the time it was created, even if its context does not appear to be @@ -1788,7 +1783,7 @@ class CXXRecordDecl : public RecordDecl { }; /// Store information needed for an explicit specifier. -/// used by CXXDeductionGuideDecl, CXXConstructorDecl and CXXConversionDecl. +/// Used by CXXDeductionGuideDecl, CXXConstructorDecl and CXXConversionDecl. class ExplicitSpecifier { llvm::PointerIntPair ExplicitSpec{ nullptr, ExplicitSpecKind::ResolvedFalse}; @@ -1801,20 +1796,22 @@ class ExplicitSpecifier { const Expr *getExpr() const { return ExplicitSpec.getPointer(); } Expr *getExpr() { return ExplicitSpec.getPointer(); } - /// Return true if the ExplicitSpecifier isn't defaulted. + /// Determine if the declaration had an explicit specifier of any kind. bool isSpecified() const { return ExplicitSpec.getInt() != ExplicitSpecKind::ResolvedFalse || ExplicitSpec.getPointer(); } - /// Check for Equivalence of explicit specifiers. - /// Return True if the explicit specifier are equivalent false otherwise. + /// Check for equivalence of explicit specifiers. + /// \return true if the explicit specifier are equivalent, false otherwise. bool isEquivalent(const ExplicitSpecifier Other) const; - /// Return true if the explicit specifier is already resolved to be explicit. + /// Determine whether this specifier is known to correspond to an explicit + /// declaration. Returns false if the specifier is absent or has an + /// expression that is value-dependent or evaluates to false. bool isExplicit() const { return ExplicitSpec.getInt() == ExplicitSpecKind::ResolvedTrue; } - /// Return true if the ExplicitSpecifier isn't valid. + /// Determine if the explicit specifier is invalid. /// This state occurs after a substitution failures. bool isInvalid() const { return ExplicitSpec.getInt() == ExplicitSpecKind::Unresolved && @@ -1822,9 +1819,7 @@ class ExplicitSpecifier { } void setKind(ExplicitSpecKind Kind) { ExplicitSpec.setInt(Kind); } void setExpr(Expr *E) { ExplicitSpec.setPointer(E); } - // getFromDecl - retrieve the explicit specifier in the given declaration. - // if the given declaration has no explicit. the returned explicit specifier - // is defaulted. .isSpecified() will be false. + // Retrieve the explicit specifier in the given declaration, if any. static ExplicitSpecifier getFromDecl(FunctionDecl *Function); static const ExplicitSpecifier getFromDecl(const FunctionDecl *Function) { return getFromDecl(const_cast(Function)); @@ -1910,9 +1905,10 @@ class CXXMethodDecl : public FunctionDecl { SourceLocation StartLoc, const DeclarationNameInfo &NameInfo, QualType T, TypeSourceInfo *TInfo, StorageClass SC, bool isInline, ConstexprSpecKind ConstexprKind, - SourceLocation EndLocation) + SourceLocation EndLocation, + Expr *TrailingRequiresClause = nullptr) : FunctionDecl(DK, C, RD, StartLoc, NameInfo, T, TInfo, SC, isInline, - ConstexprKind) { + ConstexprKind, TrailingRequiresClause) { if (EndLocation.isValid()) setRangeEnd(EndLocation); } @@ -1923,7 +1919,8 @@ class CXXMethodDecl : public FunctionDecl { const DeclarationNameInfo &NameInfo, QualType T, TypeSourceInfo *TInfo, StorageClass SC, bool isInline, ConstexprSpecKind ConstexprKind, - SourceLocation EndLocation); + SourceLocation EndLocation, + Expr *TrailingRequiresClause = nullptr); static CXXMethodDecl *CreateDeserialized(ASTContext &C, unsigned ID); @@ -2001,16 +1998,6 @@ class CXXMethodDecl : public FunctionDecl { return const_cast(this)->getMostRecentDecl(); } - /// True if this method is user-declared and was not - /// deleted or defaulted on its first declaration. - bool isUserProvided() const { - auto *DeclAsWritten = this; - if (auto *Pattern = getTemplateInstantiationPattern()) - DeclAsWritten = cast(Pattern); - return !(DeclAsWritten->isDeleted() || - DeclAsWritten->getCanonicalDecl()->isDefaulted()); - } - void addOverriddenMethod(const CXXMethodDecl *MD); using method_iterator = const CXXMethodDecl *const *; @@ -2138,8 +2125,8 @@ class CXXCtorInitializer final { /// Either the base class name/delegating constructor type (stored as /// a TypeSourceInfo*), an normal field (FieldDecl), or an anonymous field /// (IndirectFieldDecl*) being initialized. - llvm::PointerUnion3 - Initializee; + llvm::PointerUnion + Initializee; /// The source location for the field name or, for a base initializer /// pack expansion, the location of the ellipsis. @@ -2378,7 +2365,8 @@ class CXXConstructorDecl final const DeclarationNameInfo &NameInfo, QualType T, TypeSourceInfo *TInfo, ExplicitSpecifier ES, bool isInline, bool isImplicitlyDeclared, ConstexprSpecKind ConstexprKind, - InheritedConstructor Inherited); + InheritedConstructor Inherited, + Expr *TrailingRequiresClause); void anchor() override; @@ -2431,7 +2419,8 @@ class CXXConstructorDecl final const DeclarationNameInfo &NameInfo, QualType T, TypeSourceInfo *TInfo, ExplicitSpecifier ES, bool isInline, bool isImplicitlyDeclared, ConstexprSpecKind ConstexprKind, - InheritedConstructor Inherited = InheritedConstructor()); + InheritedConstructor Inherited = InheritedConstructor(), + Expr *TrailingRequiresClause = nullptr); ExplicitSpecifier getExplicitSpecifier() { return getCanonicalDecl()->getExplicitSpecifierInternal(); @@ -2638,9 +2627,11 @@ class CXXDestructorDecl : public CXXMethodDecl { CXXDestructorDecl(ASTContext &C, CXXRecordDecl *RD, SourceLocation StartLoc, const DeclarationNameInfo &NameInfo, QualType T, TypeSourceInfo *TInfo, bool isInline, - bool isImplicitlyDeclared, ConstexprSpecKind ConstexprKind) + bool isImplicitlyDeclared, ConstexprSpecKind ConstexprKind, + Expr *TrailingRequiresClause = nullptr) : CXXMethodDecl(CXXDestructor, C, RD, StartLoc, NameInfo, T, TInfo, - SC_None, isInline, ConstexprKind, SourceLocation()) { + SC_None, isInline, ConstexprKind, SourceLocation(), + TrailingRequiresClause) { setImplicit(isImplicitlyDeclared); } @@ -2652,7 +2643,8 @@ class CXXDestructorDecl : public CXXMethodDecl { const DeclarationNameInfo &NameInfo, QualType T, TypeSourceInfo *TInfo, bool isInline, bool isImplicitlyDeclared, - ConstexprSpecKind ConstexprKind); + ConstexprSpecKind ConstexprKind, + Expr *TrailingRequiresClause = nullptr); static CXXDestructorDecl *CreateDeserialized(ASTContext & C, unsigned ID); void setOperatorDelete(FunctionDecl *OD, Expr *ThisArg); @@ -2691,9 +2683,11 @@ class CXXConversionDecl : public CXXMethodDecl { CXXConversionDecl(ASTContext &C, CXXRecordDecl *RD, SourceLocation StartLoc, const DeclarationNameInfo &NameInfo, QualType T, TypeSourceInfo *TInfo, bool isInline, ExplicitSpecifier ES, - ConstexprSpecKind ConstexprKind, SourceLocation EndLocation) + ConstexprSpecKind ConstexprKind, SourceLocation EndLocation, + Expr *TrailingRequiresClause = nullptr) : CXXMethodDecl(CXXConversion, C, RD, StartLoc, NameInfo, T, TInfo, - SC_None, isInline, ConstexprKind, EndLocation), + SC_None, isInline, ConstexprKind, EndLocation, + TrailingRequiresClause), ExplicitSpec(ES) {} void anchor() override; @@ -2709,7 +2703,7 @@ class CXXConversionDecl : public CXXMethodDecl { Create(ASTContext &C, CXXRecordDecl *RD, SourceLocation StartLoc, const DeclarationNameInfo &NameInfo, QualType T, TypeSourceInfo *TInfo, bool isInline, ExplicitSpecifier ES, ConstexprSpecKind ConstexprKind, - SourceLocation EndLocation); + SourceLocation EndLocation, Expr *TrailingRequiresClause = nullptr); static CXXConversionDecl *CreateDeserialized(ASTContext &C, unsigned ID); ExplicitSpecifier getExplicitSpecifier() { @@ -2758,15 +2752,8 @@ class LinkageSpecDecl : public Decl, public DeclContext { /// Represents the language in a linkage specification. /// /// The values are part of the serialization ABI for - /// ASTs and cannot be changed without altering that ABI. To help - /// ensure a stable ABI for this, we choose the DW_LANG_ encodings - /// from the dwarf standard. - enum LanguageIDs { - lang_c = llvm::dwarf::DW_LANG_C, - lang_cxx = llvm::dwarf::DW_LANG_C_plus_plus, - lang_cxx_11 = llvm::dwarf::DW_LANG_C_plus_plus_11, - lang_cxx_14 = llvm::dwarf::DW_LANG_C_plus_plus_14 - }; + /// ASTs and cannot be changed without altering that ABI. + enum LanguageIDs { lang_c = 1, lang_cxx = 2 }; private: /// The source location for the extern keyword. @@ -3052,6 +3039,82 @@ class NamespaceAliasDecl : public NamedDecl, static bool classofKind(Kind K) { return K == NamespaceAlias; } }; +/// Implicit declaration of a temporary that was materialized by +/// a MaterializeTemporaryExpr and lifetime-extended by a declaration +class LifetimeExtendedTemporaryDecl final + : public Decl, + public Mergeable { + friend class MaterializeTemporaryExpr; + friend class ASTDeclReader; + + Stmt *ExprWithTemporary = nullptr; + + /// The declaration which lifetime-extended this reference, if any. + /// Either a VarDecl, or (for a ctor-initializer) a FieldDecl. + ValueDecl *ExtendingDecl = nullptr; + unsigned ManglingNumber; + + mutable APValue *Value = nullptr; + + virtual void anchor(); + + LifetimeExtendedTemporaryDecl(Expr *Temp, ValueDecl *EDecl, unsigned Mangling) + : Decl(Decl::LifetimeExtendedTemporary, EDecl->getDeclContext(), + EDecl->getLocation()), + ExprWithTemporary(Temp), ExtendingDecl(EDecl), + ManglingNumber(Mangling) {} + + LifetimeExtendedTemporaryDecl(EmptyShell) + : Decl(Decl::LifetimeExtendedTemporary, EmptyShell{}) {} + +public: + static LifetimeExtendedTemporaryDecl *Create(Expr *Temp, ValueDecl *EDec, + unsigned Mangling) { + return new (EDec->getASTContext(), EDec->getDeclContext()) + LifetimeExtendedTemporaryDecl(Temp, EDec, Mangling); + } + static LifetimeExtendedTemporaryDecl *CreateDeserialized(ASTContext &C, + unsigned ID) { + return new (C, ID) LifetimeExtendedTemporaryDecl(EmptyShell{}); + } + + ValueDecl *getExtendingDecl() { return ExtendingDecl; } + const ValueDecl *getExtendingDecl() const { return ExtendingDecl; } + + /// Retrieve the storage duration for the materialized temporary. + StorageDuration getStorageDuration() const; + + /// Retrieve the expression to which the temporary materialization conversion + /// was applied. This isn't necessarily the initializer of the temporary due + /// to the C++98 delayed materialization rules, but + /// skipRValueSubobjectAdjustments can be used to find said initializer within + /// the subexpression. + Expr *getTemporaryExpr() { return cast(ExprWithTemporary); } + const Expr *getTemporaryExpr() const { return cast(ExprWithTemporary); } + + unsigned getManglingNumber() const { return ManglingNumber; } + + /// Get the storage for the constant value of a materialized temporary + /// of static storage duration. + APValue *getOrCreateValue(bool MayCreate) const; + + APValue *getValue() const { return Value; } + + // Iterators + Stmt::child_range childrenExpr() { + return Stmt::child_range(&ExprWithTemporary, &ExprWithTemporary + 1); + } + + Stmt::const_child_range childrenExpr() const { + return Stmt::const_child_range(&ExprWithTemporary, &ExprWithTemporary + 1); + } + + static bool classof(const Decl *D) { return classofKind(D->getKind()); } + static bool classofKind(Kind K) { + return K == Decl::LifetimeExtendedTemporary; + } +}; + /// Represents a shadow declaration introduced into a scope by a /// (resolved) using declaration. /// diff --git a/clang/include/clang/AST/DeclObjC.h b/clang/include/clang/AST/DeclObjC.h index 8d85ac36d861..b98aef6b499d 100644 --- a/clang/include/clang/AST/DeclObjC.h +++ b/clang/include/clang/AST/DeclObjC.h @@ -172,6 +172,7 @@ class ObjCMethodDecl : public NamedDecl, public DeclContext { Selector SelInfo, QualType T, TypeSourceInfo *ReturnTInfo, DeclContext *contextDecl, bool isInstance = true, bool isVariadic = false, bool isPropertyAccessor = false, + bool isSynthesizedAccessorStub = false, bool isImplicitlyDeclared = false, bool isDefined = false, ImplementationControl impControl = None, bool HasRelatedResultType = false); @@ -232,6 +233,7 @@ class ObjCMethodDecl : public NamedDecl, public DeclContext { Selector SelInfo, QualType T, TypeSourceInfo *ReturnTInfo, DeclContext *contextDecl, bool isInstance = true, bool isVariadic = false, bool isPropertyAccessor = false, + bool isSynthesizedAccessorStub = false, bool isImplicitlyDeclared = false, bool isDefined = false, ImplementationControl impControl = None, bool HasRelatedResultType = false); @@ -408,7 +410,7 @@ class ObjCMethodDecl : public NamedDecl, public DeclContext { /// \return the type for \c self and set \arg selfIsPseudoStrong and /// \arg selfIsConsumed accordingly. QualType getSelfType(ASTContext &Context, const ObjCInterfaceDecl *OID, - bool &selfIsPseudoStrong, bool &selfIsConsumed); + bool &selfIsPseudoStrong, bool &selfIsConsumed) const; ImplicitParamDecl * getSelfDecl() const { return SelfDecl; } void setSelfDecl(ImplicitParamDecl *SD) { SelfDecl = SD; } @@ -436,6 +438,14 @@ class ObjCMethodDecl : public NamedDecl, public DeclContext { ObjCMethodDeclBits.IsPropertyAccessor = isAccessor; } + bool isSynthesizedAccessorStub() const { + return ObjCMethodDeclBits.IsSynthesizedAccessorStub; + } + + void setSynthesizedAccessorStub(bool isSynthesizedAccessorStub) { + ObjCMethodDeclBits.IsSynthesizedAccessorStub = isSynthesizedAccessorStub; + } + bool isDefined() const { return ObjCMethodDeclBits.IsDefined; } void setDefined(bool isDefined) { ObjCMethodDeclBits.IsDefined = isDefined; } @@ -466,6 +476,9 @@ class ObjCMethodDecl : public NamedDecl, public DeclContext { ObjCMethodDeclBits.HasSkippedBody = Skipped; } + /// True if the method is tagged as objc_direct + bool isDirectMethod() const; + /// Returns the property associated with this method's selector. /// /// Note that even if this particular method is not marked as a property @@ -747,13 +760,14 @@ class ObjCPropertyDecl : public NamedDecl { /// property attribute rather than a type qualifier. OBJC_PR_nullability = 0x1000, OBJC_PR_null_resettable = 0x2000, - OBJC_PR_class = 0x4000 + OBJC_PR_class = 0x4000, + OBJC_PR_direct = 0x8000 // Adding a property should change NumPropertyAttrsBits }; enum { /// Number of bits fitting all the property attributes. - NumPropertyAttrsBits = 15 + NumPropertyAttrsBits = 16 }; enum SetterKind { Assign, Retain, Copy, Weak }; @@ -876,6 +890,7 @@ class ObjCPropertyDecl : public NamedDecl { bool isInstanceProperty() const { return !isClassProperty(); } bool isClassProperty() const { return PropertyAttributes & OBJC_PR_class; } + bool isDirectProperty() const { return PropertyAttributes & OBJC_PR_direct; } ObjCPropertyQueryKind getQueryKind() const { return isClassProperty() ? ObjCPropertyQueryKind::OBJC_PR_query_class : @@ -2779,6 +2794,11 @@ class ObjCPropertyImplDecl : public Decl { /// Null for \@dynamic. Required for \@synthesize. ObjCIvarDecl *PropertyIvarDecl; + /// The getter's definition, which has an empty body if synthesized. + ObjCMethodDecl *GetterMethodDecl = nullptr; + /// The getter's definition, which has an empty body if synthesized. + ObjCMethodDecl *SetterMethodDecl = nullptr; + /// Null for \@dynamic. Non-null if property must be copy-constructed in /// getter. Expr *GetterCXXConstructor = nullptr; @@ -2845,6 +2865,12 @@ class ObjCPropertyImplDecl : public Decl { return IvarLoc.isValid() && IvarLoc != getLocation(); } + ObjCMethodDecl *getGetterMethodDecl() const { return GetterMethodDecl; } + void setGetterMethodDecl(ObjCMethodDecl *MD) { GetterMethodDecl = MD; } + + ObjCMethodDecl *getSetterMethodDecl() const { return SetterMethodDecl; } + void setSetterMethodDecl(ObjCMethodDecl *MD) { SetterMethodDecl = MD; } + Expr *getGetterCXXConstructor() const { return GetterCXXConstructor; } diff --git a/clang/include/clang/AST/DeclTemplate.h b/clang/include/clang/AST/DeclTemplate.h index ec14adc7de97..7a55d04a0f35 100644 --- a/clang/include/clang/AST/DeclTemplate.h +++ b/clang/include/clang/AST/DeclTemplate.h @@ -14,6 +14,7 @@ #ifndef LLVM_CLANG_AST_DECLTEMPLATE_H #define LLVM_CLANG_AST_DECLTEMPLATE_H +#include "clang/AST/ASTConcept.h" #include "clang/AST/Decl.h" #include "clang/AST/DeclBase.h" #include "clang/AST/DeclCXX.h" @@ -51,14 +52,15 @@ class NonTypeTemplateParmDecl; class TemplateDecl; class TemplateTemplateParmDecl; class TemplateTypeParmDecl; +class ConceptDecl; class UnresolvedSetImpl; class VarTemplateDecl; class VarTemplatePartialSpecializationDecl; /// Stores a template parameter of any kind. using TemplateParameter = - llvm::PointerUnion3; + llvm::PointerUnion; NamedDecl *getAsNamedDecl(TemplateParameter P); @@ -81,20 +83,24 @@ class TemplateParameterList final /// pack. unsigned ContainsUnexpandedParameterPack : 1; - /// Whether this template parameter list has an associated requires-clause + /// Whether this template parameter list has a requires clause. unsigned HasRequiresClause : 1; + /// Whether any of the template parameters has constrained-parameter + /// constraint-expression. + unsigned HasConstrainedParameters : 1; + protected: - TemplateParameterList(SourceLocation TemplateLoc, SourceLocation LAngleLoc, - ArrayRef Params, SourceLocation RAngleLoc, - Expr *RequiresClause); + TemplateParameterList(const ASTContext& C, SourceLocation TemplateLoc, + SourceLocation LAngleLoc, ArrayRef Params, + SourceLocation RAngleLoc, Expr *RequiresClause); size_t numTrailingObjects(OverloadToken) const { return NumParams; } size_t numTrailingObjects(OverloadToken) const { - return HasRequiresClause; + return HasRequiresClause ? 1 : 0; } public: @@ -158,14 +164,22 @@ class TemplateParameterList final return ContainsUnexpandedParameterPack; } + /// Determine whether this template parameter list contains a parameter pack. + bool hasParameterPack() const { + for (const NamedDecl *P : asArray()) + if (P->isParameterPack()) + return true; + return false; + } + /// The constraint-expression of the associated requires-clause. Expr *getRequiresClause() { - return HasRequiresClause ? *getTrailingObjects() : nullptr; + return HasRequiresClause ? getTrailingObjects()[0] : nullptr; } /// The constraint-expression of the associated requires-clause. const Expr *getRequiresClause() const { - return HasRequiresClause ? *getTrailingObjects() : nullptr; + return HasRequiresClause ? getTrailingObjects()[0] : nullptr; } /// \brief All associated constraints derived from this template parameter @@ -208,15 +222,16 @@ class FixedSizeTemplateParameterListStorage >::type storage; public: - FixedSizeTemplateParameterListStorage(SourceLocation TemplateLoc, + FixedSizeTemplateParameterListStorage(const ASTContext &C, + SourceLocation TemplateLoc, SourceLocation LAngleLoc, ArrayRef Params, SourceLocation RAngleLoc, Expr *RequiresClause) : FixedSizeStorageOwner( (assert(N == Params.size()), - assert(HasRequiresClause == static_cast(RequiresClause)), - new (static_cast(&storage)) TemplateParameterList( + assert(HasRequiresClause == (RequiresClause != nullptr)), + new (static_cast(&storage)) TemplateParameterList(C, TemplateLoc, LAngleLoc, Params, RAngleLoc, RequiresClause))) {} }; @@ -309,7 +324,7 @@ class DefaultArgStorage { static_assert(sizeof(Chain) == sizeof(void *) * 2, "non-pointer argument type?"); - llvm::PointerUnion3 ValueOrInherited; + llvm::PointerUnion ValueOrInherited; static ParmDecl *getParmOwningDefaultArg(ParmDecl *Parm) { const DefaultArgStorage &Storage = Parm->getDefaultArgStorage(); @@ -793,9 +808,10 @@ class RedeclarableTemplateDecl : public TemplateDecl, void loadLazySpecializationsImpl() const; - template typename SpecEntryTraits::DeclType* + template + typename SpecEntryTraits::DeclType* findSpecializationImpl(llvm::FoldingSetVector &Specs, - ArrayRef Args, void *&InsertPos); + void *&InsertPos, ProfileArguments &&...ProfileArgs); template void addSpecializationImpl(llvm::FoldingSetVector &Specs, @@ -1147,9 +1163,12 @@ class TemplateParmPosition { /// \code /// template class vector; /// \endcode -class TemplateTypeParmDecl : public TypeDecl { +class TemplateTypeParmDecl final : public TypeDecl, + private llvm::TrailingObjects { /// Sema creates these on the stack during auto type deduction. friend class Sema; + friend TrailingObjects; + friend class ASTDeclReader; /// Whether this template type parameter was declaration with /// the 'typename' keyword. @@ -1157,6 +1176,22 @@ class TemplateTypeParmDecl : public TypeDecl { /// If false, it was declared with the 'class' keyword. bool Typename : 1; + /// Whether this template type parameter has a type-constraint construct. + bool HasTypeConstraint : 1; + + /// Whether the type constraint has been initialized. This can be false if the + /// constraint was not initialized yet or if there was an error forming the + /// type constriant. + bool TypeConstraintInitialized : 1; + + /// Whether this non-type template parameter is an "expanded" + /// parameter pack, meaning that its type is a pack expansion and we + /// already know the set of types that expansion expands to. + bool ExpandedParameterPack : 1; + + /// The number of type parameters in an expanded parameter pack. + unsigned NumExpanded = 0; + /// The default template argument, if any. using DefArgStorage = DefaultArgStorage; @@ -1164,8 +1199,12 @@ class TemplateTypeParmDecl : public TypeDecl { TemplateTypeParmDecl(DeclContext *DC, SourceLocation KeyLoc, SourceLocation IdLoc, IdentifierInfo *Id, - bool Typename) - : TypeDecl(TemplateTypeParm, DC, IdLoc, Id, KeyLoc), Typename(Typename) {} + bool Typename, bool HasTypeConstraint, + Optional NumExpanded) + : TypeDecl(TemplateTypeParm, DC, IdLoc, Id, KeyLoc), Typename(Typename), + HasTypeConstraint(HasTypeConstraint), TypeConstraintInitialized(false), + ExpandedParameterPack(NumExpanded), + NumExpanded(NumExpanded ? *NumExpanded : 0) {} public: static TemplateTypeParmDecl *Create(const ASTContext &C, DeclContext *DC, @@ -1173,15 +1212,24 @@ class TemplateTypeParmDecl : public TypeDecl { SourceLocation NameLoc, unsigned D, unsigned P, IdentifierInfo *Id, bool Typename, - bool ParameterPack); + bool ParameterPack, + bool HasTypeConstraint = false, + Optional NumExpanded = None); + static TemplateTypeParmDecl *CreateDeserialized(const ASTContext &C, unsigned ID); + static TemplateTypeParmDecl *CreateDeserialized(const ASTContext &C, + unsigned ID, + bool HasTypeConstraint); /// Whether this template type parameter was declared with /// the 'typename' keyword. /// - /// If not, it was declared with the 'class' keyword. - bool wasDeclaredWithTypename() const { return Typename; } + /// If not, it was either declared with the 'class' keyword or with a + /// type-constraint (see hasTypeConstraint()). + bool wasDeclaredWithTypename() const { + return Typename && !HasTypeConstraint; + } const DefArgStorage &getDefaultArgStorage() const { return DefaultArgument; } @@ -1238,6 +1286,78 @@ class TemplateTypeParmDecl : public TypeDecl { /// Returns whether this is a parameter pack. bool isParameterPack() const; + /// Whether this parameter pack is a pack expansion. + /// + /// A template type template parameter pack can be a pack expansion if its + /// type-constraint contains an unexpanded parameter pack. + bool isPackExpansion() const { + if (!isParameterPack()) + return false; + if (const TypeConstraint *TC = getTypeConstraint()) + if (TC->hasExplicitTemplateArgs()) + for (const auto &ArgLoc : TC->getTemplateArgsAsWritten()->arguments()) + if (ArgLoc.getArgument().containsUnexpandedParameterPack()) + return true; + return false; + } + + /// Whether this parameter is a template type parameter pack that has a known + /// list of different type-constraints at different positions. + /// + /// A parameter pack is an expanded parameter pack when the original + /// parameter pack's type-constraint was itself a pack expansion, and that + /// expansion has already been expanded. For example, given: + /// + /// \code + /// template + /// struct X { + /// template ...Convertibles> + /// struct Y { /* ... */ }; + /// }; + /// \endcode + /// + /// The parameter pack \c Convertibles has (convertible_to && ...) as + /// its type-constraint. When \c Types is supplied with template arguments by + /// instantiating \c X, the instantiation of \c Convertibles becomes an + /// expanded parameter pack. For example, instantiating + /// \c X results in \c Convertibles being an expanded + /// parameter pack of size 2 (use getNumExpansionTypes() to get this number). + bool isExpandedParameterPack() const { return ExpandedParameterPack; } + + /// Retrieves the number of parameters in an expanded parameter pack. + unsigned getNumExpansionParameters() const { + assert(ExpandedParameterPack && "Not an expansion parameter pack"); + return NumExpanded; + } + + /// Returns the type constraint associated with this template parameter (if + /// any). + const TypeConstraint *getTypeConstraint() const { + return TypeConstraintInitialized ? getTrailingObjects() : + nullptr; + } + + void setTypeConstraint(NestedNameSpecifierLoc NNS, + DeclarationNameInfo NameInfo, NamedDecl *FoundDecl, + ConceptDecl *CD, + const ASTTemplateArgumentListInfo *ArgsAsWritten, + Expr *ImmediatelyDeclaredConstraint); + + /// Determine whether this template parameter has a type-constraint. + bool hasTypeConstraint() const { + return HasTypeConstraint; + } + + /// \brief Get the associated-constraints of this template parameter. + /// This will either be the immediately-introduced constraint or empty. + /// + /// Use this instead of getConstraintExpression for concepts APIs that + /// accept an ArrayRef of constraint expressions. + void getAssociatedConstraints(llvm::SmallVectorImpl &AC) const { + if (HasTypeConstraint) + AC.push_back(getTypeConstraint()->getImmediatelyDeclaredConstraint()); + } + SourceRange getSourceRange() const override LLVM_READONLY; // Implement isa/cast/dyncast/etc. @@ -1423,6 +1543,33 @@ class NonTypeTemplateParmDecl final return TypesAndInfos[I].second; } + /// Return the type-constraint in the placeholder type of this non-type + /// template parameter (if any). + TypeConstraint *getPlaceholderTypeConstraint() const { + // TODO: Concepts: Implement once we have actual placeholders with type + // constraints. + return nullptr; + } + + /// Determine whether this non-type template parameter's type has a + /// placeholder with a type-constraint. + bool hasPlaceholderTypeConstraint() const { + // TODO: Concepts: Implement once we have actual placeholders with type + // constraints. + return false; + } + + /// \brief Get the associated-constraints of this template parameter. + /// This will either be a vector of size 1 containing the immediately-declared + /// constraint introduced by the placeholder type, or an empty vector. + /// + /// Use this instead of getPlaceholderImmediatelyDeclaredConstraint for + /// concepts APIs that accept an ArrayRef of constraint expressions. + void getAssociatedConstraints(llvm::SmallVectorImpl &AC) const { + if (TypeConstraint *TC = getPlaceholderTypeConstraint()) + AC.push_back(TC->getImmediatelyDeclaredConstraint()); + } + // Implement isa/cast/dyncast/etc. static bool classof(const Decl *D) { return classofKind(D->getKind()); } static bool classofKind(Kind K) { return K == NonTypeTemplateParm; } @@ -1557,8 +1704,8 @@ class TemplateTemplateParmDecl final /// Retrieve the default argument, if any. const TemplateArgumentLoc &getDefaultArgument() const { - static const TemplateArgumentLoc None; - return DefaultArgument.isSet() ? *DefaultArgument.get() : None; + static const TemplateArgumentLoc NoneLoc; + return DefaultArgument.isSet() ? *DefaultArgument.get() : NoneLoc; } /// Retrieve the location of the default argument, if any. @@ -2056,7 +2203,14 @@ class ClassTemplatePartialSpecializationDecl ->getInjectedSpecializationType(); } - // FIXME: Add Profile support! + void Profile(llvm::FoldingSetNodeID &ID) const { + Profile(ID, getTemplateArgs().asArray(), getTemplateParameters(), + getASTContext()); + } + + static void + Profile(llvm::FoldingSetNodeID &ID, ArrayRef TemplateArgs, + TemplateParameterList *TPL, ASTContext &Context); static bool classof(const Decl *D) { return classofKind(D->getKind()); } @@ -2180,7 +2334,8 @@ class ClassTemplateDecl : public RedeclarableTemplateDecl { /// Return the partial specialization with the provided arguments if it /// exists, otherwise return the insertion point. ClassTemplatePartialSpecializationDecl * - findPartialSpecialization(ArrayRef Args, void *&InsertPos); + findPartialSpecialization(ArrayRef Args, + TemplateParameterList *TPL, void *&InsertPos); /// Insert the specified partial specialization knowing that it is not /// already in. InsertPos must be obtained from findPartialSpecialization. @@ -2880,6 +3035,15 @@ class VarTemplatePartialSpecializationDecl return First->InstantiatedFromMember.setInt(true); } + void Profile(llvm::FoldingSetNodeID &ID) const { + Profile(ID, getTemplateArgs().asArray(), getTemplateParameters(), + getASTContext()); + } + + static void + Profile(llvm::FoldingSetNodeID &ID, ArrayRef TemplateArgs, + TemplateParameterList *TPL, ASTContext &Context); + static bool classof(const Decl *D) { return classofKind(D->getKind()); } static bool classofKind(Kind K) { @@ -2998,7 +3162,8 @@ class VarTemplateDecl : public RedeclarableTemplateDecl { /// Return the partial specialization with the provided arguments if it /// exists, otherwise return the insertion point. VarTemplatePartialSpecializationDecl * - findPartialSpecialization(ArrayRef Args, void *&InsertPos); + findPartialSpecialization(ArrayRef Args, + TemplateParameterList *TPL, void *&InsertPos); /// Insert the specified partial specialization knowing that it is not /// already in. InsertPos must be obtained from findPartialSpecialization. @@ -3067,6 +3232,10 @@ class ConceptDecl : public TemplateDecl, public Mergeable { ConstraintExpr->getEndLoc()); } + bool isTypeConcept() const { + return isa(getTemplateParameters()->getParam(0)); + } + // Implement isa/cast/dyncast/etc. static bool classof(const Decl *D) { return classofKind(D->getKind()); } static bool classofKind(Kind K) { return K == Concept; } diff --git a/clang/include/clang/AST/DeclarationName.h b/clang/include/clang/AST/DeclarationName.h index 90449147637d..82f6868e3a7e 100644 --- a/clang/include/clang/AST/DeclarationName.h +++ b/clang/include/clang/AST/DeclarationName.h @@ -528,7 +528,7 @@ class DeclarationName { static int compare(DeclarationName LHS, DeclarationName RHS); - void print(raw_ostream &OS, const PrintingPolicy &Policy); + void print(raw_ostream &OS, const PrintingPolicy &Policy) const; void dump() const; }; @@ -792,7 +792,7 @@ struct DeclarationNameInfo { std::string getAsString() const; /// printName - Print the human-readable name to a stream. - void printName(raw_ostream &OS) const; + void printName(raw_ostream &OS, PrintingPolicy Policy) const; /// getBeginLoc - Retrieve the location of the first token. SourceLocation getBeginLoc() const { return NameLoc; } @@ -829,11 +829,7 @@ inline const PartialDiagnostic &operator<<(const PartialDiagnostic &PD, return PD; } -inline raw_ostream &operator<<(raw_ostream &OS, - DeclarationNameInfo DNInfo) { - DNInfo.printName(OS); - return OS; -} +raw_ostream &operator<<(raw_ostream &OS, DeclarationNameInfo DNInfo); } // namespace clang diff --git a/clang/include/clang/AST/Expr.h b/clang/include/clang/AST/Expr.h index ffa7d4db96a4..16956c27a114 100644 --- a/clang/include/clang/AST/Expr.h +++ b/clang/include/clang/AST/Expr.h @@ -494,7 +494,13 @@ class Expr : public ValueStmt { /// that is known to return 0 or 1. This happens for _Bool/bool expressions /// but also int expressions which are produced by things like comparisons in /// C. - bool isKnownToHaveBooleanValue() const; + /// + /// \param Semantic If true, only return true for expressions that are known + /// to be semantically boolean, which might not be true even for expressions + /// that are known to evaluate to 0/1. For instance, reading an unsigned + /// bit-field with width '1' will evaluate to 0/1, but doesn't necessarily + /// semantically correspond to a bool. + bool isKnownToHaveBooleanValue(bool Semantic = true) const; /// isIntegerConstantExpr - Return true if this expression is a valid integer /// constant expression, and, if so, return its value in Result. If not a @@ -756,6 +762,15 @@ class Expr : public ValueStmt { /// member expression. static QualType findBoundMemberType(const Expr *expr); + /// Skip past any invisble AST nodes which might surround this + /// statement, such as ExprWithCleanups or ImplicitCastExpr nodes, + /// but also injected CXXMemberExpr and CXXConstructExpr which represent + /// implicit conversions. + Expr *IgnoreUnlessSpelledInSource(); + const Expr *IgnoreUnlessSpelledInSource() const { + return const_cast(this)->IgnoreUnlessSpelledInSource(); + } + /// Skip past any implicit casts which might surround this expression until /// reaching a fixed point. Skips: /// * ImplicitCastExpr @@ -786,6 +801,16 @@ class Expr : public ValueStmt { return const_cast(this)->IgnoreImplicit(); } + /// Skip past any implicit AST nodes which might surround this expression + /// until reaching a fixed point. Same as IgnoreImplicit, except that it + /// also skips over implicit calls to constructors and conversion functions. + /// + /// FIXME: Should IgnoreImplicit do this? + Expr *IgnoreImplicitAsWritten() LLVM_READONLY; + const Expr *IgnoreImplicitAsWritten() const { + return const_cast(this)->IgnoreImplicitAsWritten(); + } + /// Skip past any parentheses which might surround this expression until /// reaching a fixed point. Skips: /// * ParenExpr @@ -3711,22 +3736,25 @@ class ConditionalOperator : public AbstractConditionalOperator { friend class ASTStmtReader; public: ConditionalOperator(Expr *cond, SourceLocation QLoc, Expr *lhs, - SourceLocation CLoc, Expr *rhs, - QualType t, ExprValueKind VK, ExprObjectKind OK) - : AbstractConditionalOperator(ConditionalOperatorClass, t, VK, OK, - // FIXME: the type of the conditional operator doesn't - // depend on the type of the conditional, but the standard - // seems to imply that it could. File a bug! - (lhs->isTypeDependent() || rhs->isTypeDependent()), - (cond->isValueDependent() || lhs->isValueDependent() || - rhs->isValueDependent()), - (cond->isInstantiationDependent() || - lhs->isInstantiationDependent() || - rhs->isInstantiationDependent()), - (cond->containsUnexpandedParameterPack() || - lhs->containsUnexpandedParameterPack() || - rhs->containsUnexpandedParameterPack()), - QLoc, CLoc) { + SourceLocation CLoc, Expr *rhs, QualType t, + ExprValueKind VK, ExprObjectKind OK) + : AbstractConditionalOperator( + ConditionalOperatorClass, t, VK, OK, + // The type of the conditional operator depends on the type + // of the conditional to support the GCC vector conditional + // extension. Additionally, [temp.dep.expr] does specify state that + // this should be dependent on ALL sub expressions. + (cond->isTypeDependent() || lhs->isTypeDependent() || + rhs->isTypeDependent()), + (cond->isValueDependent() || lhs->isValueDependent() || + rhs->isValueDependent()), + (cond->isInstantiationDependent() || + lhs->isInstantiationDependent() || + rhs->isInstantiationDependent()), + (cond->containsUnexpandedParameterPack() || + lhs->containsUnexpandedParameterPack() || + rhs->containsUnexpandedParameterPack()), + QLoc, CLoc) { SubExprs[COND] = cond; SubExprs[LHS] = lhs; SubExprs[RHS] = rhs; @@ -5594,6 +5622,20 @@ class BlockExpr : public Expr { } }; +/// Copy initialization expr of a __block variable and a boolean flag that +/// indicates whether the expression can throw. +struct BlockVarCopyInit { + BlockVarCopyInit() = default; + BlockVarCopyInit(Expr *CopyExpr, bool CanThrow) + : ExprAndFlag(CopyExpr, CanThrow) {} + void setExprAndFlag(Expr *CopyExpr, bool CanThrow) { + ExprAndFlag.setPointerAndInt(CopyExpr, CanThrow); + } + Expr *getCopyExpr() const { return ExprAndFlag.getPointer(); } + bool canThrow() const { return ExprAndFlag.getInt(); } + llvm::PointerIntPair ExprAndFlag; +}; + /// AsTypeExpr - Clang builtin function __builtin_astype [OpenCL 6.2.4.2] /// This AST node provides support for reinterpreting a type to another /// type of the same size. diff --git a/clang/include/clang/AST/ExprCXX.h b/clang/include/clang/AST/ExprCXX.h index 2152e108c7cb..2c29409e0ca5 100644 --- a/clang/include/clang/AST/ExprCXX.h +++ b/clang/include/clang/AST/ExprCXX.h @@ -14,6 +14,7 @@ #ifndef LLVM_CLANG_AST_EXPRCXX_H #define LLVM_CLANG_AST_EXPRCXX_H +#include "clang/AST/ASTConcept.h" #include "clang/AST/Decl.h" #include "clang/AST/DeclBase.h" #include "clang/AST/DeclCXX.h" @@ -4421,70 +4422,66 @@ class MaterializeTemporaryExpr : public Expr { friend class ASTStmtReader; friend class ASTStmtWriter; - struct ExtraState { - /// The temporary-generating expression whose value will be - /// materialized. - Stmt *Temporary; - - /// The declaration which lifetime-extended this reference, if any. - /// Either a VarDecl, or (for a ctor-initializer) a FieldDecl. - const ValueDecl *ExtendingDecl; - - unsigned ManglingNumber; - }; - llvm::PointerUnion State; + llvm::PointerUnion State; public: MaterializeTemporaryExpr(QualType T, Expr *Temporary, - bool BoundToLvalueReference) - : Expr(MaterializeTemporaryExprClass, T, - BoundToLvalueReference? VK_LValue : VK_XValue, OK_Ordinary, - Temporary->isTypeDependent(), Temporary->isValueDependent(), - Temporary->isInstantiationDependent(), - Temporary->containsUnexpandedParameterPack()), - State(Temporary) {} + bool BoundToLvalueReference, + LifetimeExtendedTemporaryDecl *MTD = nullptr); MaterializeTemporaryExpr(EmptyShell Empty) : Expr(MaterializeTemporaryExprClass, Empty) {} - Stmt *getTemporary() const { - return State.is() ? State.get() - : State.get()->Temporary; - } - /// Retrieve the temporary-generating subexpression whose value will /// be materialized into a glvalue. - Expr *GetTemporaryExpr() const { return static_cast(getTemporary()); } + Expr *getSubExpr() const { + return cast( + State.is() + ? State.get() + : State.get()->getTemporaryExpr()); + } /// Retrieve the storage duration for the materialized temporary. StorageDuration getStorageDuration() const { - const ValueDecl *ExtendingDecl = getExtendingDecl(); - if (!ExtendingDecl) - return SD_FullExpression; - // FIXME: This is not necessarily correct for a temporary materialized - // within a default initializer. - if (isa(ExtendingDecl)) - return SD_Automatic; - // FIXME: This only works because storage class specifiers are not allowed - // on decomposition declarations. - if (isa(ExtendingDecl)) - return ExtendingDecl->getDeclContext()->isFunctionOrMethod() - ? SD_Automatic - : SD_Static; - return cast(ExtendingDecl)->getStorageDuration(); + return State.is() ? SD_FullExpression + : State.get() + ->getStorageDuration(); + } + + /// Get the storage for the constant value of a materialized temporary + /// of static storage duration. + APValue *getOrCreateValue(bool MayCreate) const { + assert(State.is() && + "the temporary has not been lifetime extended"); + return State.get()->getOrCreateValue( + MayCreate); + } + + LifetimeExtendedTemporaryDecl *getLifetimeExtendedTemporaryDecl() { + return State.dyn_cast(); + } + const LifetimeExtendedTemporaryDecl * + getLifetimeExtendedTemporaryDecl() const { + return State.dyn_cast(); } /// Get the declaration which triggered the lifetime-extension of this /// temporary, if any. - const ValueDecl *getExtendingDecl() const { + ValueDecl *getExtendingDecl() { return State.is() ? nullptr - : State.get()->ExtendingDecl; + : State.get() + ->getExtendingDecl(); + } + const ValueDecl *getExtendingDecl() const { + return const_cast(this)->getExtendingDecl(); } - void setExtendingDecl(const ValueDecl *ExtendedBy, unsigned ManglingNumber); + void setExtendingDecl(ValueDecl *ExtendedBy, unsigned ManglingNumber); unsigned getManglingNumber() const { - return State.is() ? 0 : State.get()->ManglingNumber; + return State.is() ? 0 + : State.get() + ->getManglingNumber(); } /// Determine whether this materialized temporary is bound to an @@ -4494,11 +4491,11 @@ class MaterializeTemporaryExpr : public Expr { } SourceLocation getBeginLoc() const LLVM_READONLY { - return getTemporary()->getBeginLoc(); + return getSubExpr()->getBeginLoc(); } SourceLocation getEndLoc() const LLVM_READONLY { - return getTemporary()->getEndLoc(); + return getSubExpr()->getEndLoc(); } static bool classof(const Stmt *T) { @@ -4507,20 +4504,18 @@ class MaterializeTemporaryExpr : public Expr { // Iterators child_range children() { - if (State.is()) - return child_range(State.getAddrOfPtr1(), State.getAddrOfPtr1() + 1); - - auto ES = State.get(); - return child_range(&ES->Temporary, &ES->Temporary + 1); + return State.is() + ? child_range(State.getAddrOfPtr1(), State.getAddrOfPtr1() + 1) + : State.get()->childrenExpr(); } const_child_range children() const { - if (State.is()) - return const_child_range(State.getAddrOfPtr1(), - State.getAddrOfPtr1() + 1); - - auto ES = State.get(); - return const_child_range(&ES->Temporary, &ES->Temporary + 1); + return State.is() + ? const_child_range(State.getAddrOfPtr1(), + State.getAddrOfPtr1() + 1) + : const_cast( + State.get()) + ->childrenExpr(); } }; @@ -4846,107 +4841,81 @@ class BuiltinBitCastExpr final /// /// According to C++2a [expr.prim.id]p3 an id-expression that denotes the /// specialization of a concept results in a prvalue of type bool. -class ConceptSpecializationExpr final : public Expr, +class ConceptSpecializationExpr final : public Expr, public ConceptReference, private llvm::TrailingObjects { friend class ASTStmtReader; friend TrailingObjects; +public: + using SubstitutionDiagnostic = std::pair; - // \brief The optional nested name specifier used when naming the concept. - NestedNameSpecifierLoc NestedNameSpec; - - /// \brief The location of the template keyword, if specified when naming the - /// concept. - SourceLocation TemplateKWLoc; - - /// \brief The location of the concept name in the expression. - SourceLocation ConceptNameLoc; - - /// \brief The declaration found by name lookup when the expression was - /// created. - /// Can differ from NamedConcept when, for example, the concept was found - /// through a UsingShadowDecl. - NamedDecl *FoundDecl; - - /// \brief The concept named, and whether or not the concept with the given - /// arguments was satisfied when the expression was created. - /// If any of the template arguments are dependent (this expr would then be - /// isValueDependent()), this bit is to be ignored. - llvm::PointerIntPair NamedConcept; - - /// \brief The template argument list source info used to specialize the - /// concept. - const ASTTemplateArgumentListInfo *ArgsAsWritten = nullptr; - +protected: /// \brief The number of template arguments in the tail-allocated list of /// converted template arguments. unsigned NumTemplateArgs; - ConceptSpecializationExpr(ASTContext &C, NestedNameSpecifierLoc NNS, + /// \brief Information about the satisfaction of the named concept with the + /// given arguments. If this expression is value dependent, this is to be + /// ignored. + ASTConstraintSatisfaction *Satisfaction; + + ConceptSpecializationExpr(const ASTContext &C, NestedNameSpecifierLoc NNS, SourceLocation TemplateKWLoc, - SourceLocation ConceptNameLoc, NamedDecl *FoundDecl, - ConceptDecl *NamedConcept, + DeclarationNameInfo ConceptNameInfo, + NamedDecl *FoundDecl, ConceptDecl *NamedConcept, const ASTTemplateArgumentListInfo *ArgsAsWritten, ArrayRef ConvertedArgs, - Optional IsSatisfied); + const ConstraintSatisfaction *Satisfaction); ConceptSpecializationExpr(EmptyShell Empty, unsigned NumTemplateArgs); public: static ConceptSpecializationExpr * - Create(ASTContext &C, NestedNameSpecifierLoc NNS, - SourceLocation TemplateKWLoc, SourceLocation ConceptNameLoc, + Create(const ASTContext &C, NestedNameSpecifierLoc NNS, + SourceLocation TemplateKWLoc, DeclarationNameInfo ConceptNameInfo, NamedDecl *FoundDecl, ConceptDecl *NamedConcept, const ASTTemplateArgumentListInfo *ArgsAsWritten, - ArrayRef ConvertedArgs, Optional IsSatisfied); + ArrayRef ConvertedArgs, + const ConstraintSatisfaction *Satisfaction); static ConceptSpecializationExpr * Create(ASTContext &C, EmptyShell Empty, unsigned NumTemplateArgs); - const NestedNameSpecifierLoc &getNestedNameSpecifierLoc() const { - return NestedNameSpec; - } - - NamedDecl *getFoundDecl() const { - return FoundDecl; - } - - ConceptDecl *getNamedConcept() const { - return NamedConcept.getPointer(); - } - ArrayRef getTemplateArguments() const { return ArrayRef(getTrailingObjects(), NumTemplateArgs); } - const ASTTemplateArgumentListInfo *getTemplateArgsAsWritten() const { - return ArgsAsWritten; - } - /// \brief Set new template arguments for this concept specialization. - void setTemplateArguments(const ASTTemplateArgumentListInfo *ArgsAsWritten, - ArrayRef Converted); + void setTemplateArguments(ArrayRef Converted); /// \brief Whether or not the concept with the given arguments was satisfied - /// when the expression was created. This method assumes that the expression - /// is not dependent! + /// when the expression was created. + /// The expression must not be dependent. bool isSatisfied() const { assert(!isValueDependent() && "isSatisfied called on a dependent ConceptSpecializationExpr"); - return NamedConcept.getInt(); + return Satisfaction->IsSatisfied; } - SourceLocation getConceptNameLoc() const { return ConceptNameLoc; } - - SourceLocation getTemplateKWLoc() const { return TemplateKWLoc; } + /// \brief Get elaborated satisfaction info about the template arguments' + /// satisfaction of the named concept. + /// The expression must not be dependent. + const ASTConstraintSatisfaction &getSatisfaction() const { + assert(!isValueDependent() + && "getSatisfaction called on dependent ConceptSpecializationExpr"); + return *Satisfaction; + } static bool classof(const Stmt *T) { return T->getStmtClass() == ConceptSpecializationExprClass; } - SourceLocation getBeginLoc() const LLVM_READONLY { return ConceptNameLoc; } + SourceLocation getBeginLoc() const LLVM_READONLY { + return ConceptName.getBeginLoc(); + } + SourceLocation getEndLoc() const LLVM_READONLY { return ArgsAsWritten->RAngleLoc; } diff --git a/clang/include/clang/AST/ExprObjC.h b/clang/include/clang/AST/ExprObjC.h index dbb2b2ff7099..d76b3a26b1f9 100644 --- a/clang/include/clang/AST/ExprObjC.h +++ b/clang/include/clang/AST/ExprObjC.h @@ -642,7 +642,7 @@ class ObjCPropertyRefExpr : public Expr { /// the location of the 'super' keyword. When it's an interface, /// this is that interface. SourceLocation ReceiverLoc; - llvm::PointerUnion3 Receiver; + llvm::PointerUnion Receiver; public: ObjCPropertyRefExpr(ObjCPropertyDecl *PD, QualType t, diff --git a/clang/include/clang/AST/ExternalASTSource.h b/clang/include/clang/AST/ExternalASTSource.h index 304633668bd1..899ac3f66937 100644 --- a/clang/include/clang/AST/ExternalASTSource.h +++ b/clang/include/clang/AST/ExternalASTSource.h @@ -66,9 +66,8 @@ class ExternalASTSource : public RefCountedBase { /// whenever we might have added new redeclarations for existing decls. uint32_t CurrentGeneration = 0; - /// Whether this AST source also provides information for - /// semantic analysis. - bool SemaSource = false; + /// LLVM-style RTTI. + static char ID; public: ExternalASTSource() = default; @@ -325,6 +324,12 @@ class ExternalASTSource : public RefCountedBase { virtual void getMemoryBufferSizes(MemoryBufferSizes &sizes) const; + /// LLVM-style RTTI. + /// \{ + virtual bool isA(const void *ClassID) const { return ClassID == &ID; } + static bool classof(const ExternalASTSource *S) { return S->isA(&ID); } + /// \} + protected: static DeclContextLookupResult SetExternalVisibleDeclsForName(const DeclContext *DC, diff --git a/clang/include/clang/AST/JSONNodeDumper.h b/clang/include/clang/AST/JSONNodeDumper.h index 5f34440b8b56..4023e023e9d5 100644 --- a/clang/include/clang/AST/JSONNodeDumper.h +++ b/clang/include/clang/AST/JSONNodeDumper.h @@ -16,12 +16,13 @@ #define LLVM_CLANG_AST_JSONNODEDUMPER_H #include "clang/AST/ASTContext.h" -#include "clang/AST/ASTNodeTraverser.h" #include "clang/AST/ASTDumperUtils.h" +#include "clang/AST/ASTNodeTraverser.h" #include "clang/AST/AttrVisitor.h" #include "clang/AST/CommentCommandTraits.h" #include "clang/AST/CommentVisitor.h" #include "clang/AST/ExprCXX.h" +#include "clang/AST/Mangle.h" #include "llvm/Support/JSON.h" namespace clang { @@ -122,9 +123,10 @@ class JSONNodeDumper const SourceManager &SM; ASTContext& Ctx; + ASTNameGenerator ASTNameGen; PrintingPolicy PrintPolicy; const comments::CommandTraits *Traits; - StringRef LastLocFilename; + StringRef LastLocFilename, LastLocPresumedFilename; unsigned LastLocLine, LastLocPresumedLine; using InnerAttrVisitor = ConstAttrVisitor; @@ -182,8 +184,9 @@ class JSONNodeDumper JSONNodeDumper(raw_ostream &OS, const SourceManager &SrcMgr, ASTContext &Ctx, const PrintingPolicy &PrintPolicy, const comments::CommandTraits *Traits) - : NodeStreamer(OS), SM(SrcMgr), Ctx(Ctx), PrintPolicy(PrintPolicy), - Traits(Traits), LastLocLine(0), LastLocPresumedLine(0) {} + : NodeStreamer(OS), SM(SrcMgr), Ctx(Ctx), ASTNameGen(Ctx), + PrintPolicy(PrintPolicy), Traits(Traits), LastLocLine(0), + LastLocPresumedLine(0) {} void Visit(const Attr *A); void Visit(const Stmt *Node); diff --git a/clang/include/clang/AST/OpenMPClause.h b/clang/include/clang/AST/OpenMPClause.h index b2a2035dcb3c..26f8389f9cfa 100644 --- a/clang/include/clang/AST/OpenMPClause.h +++ b/clang/include/clang/AST/OpenMPClause.h @@ -30,6 +30,7 @@ #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/iterator.h" #include "llvm/ADT/iterator_range.h" +#include "llvm/Frontend/OpenMP/OMPConstants.h" #include "llvm/Support/Casting.h" #include "llvm/Support/Compiler.h" #include "llvm/Support/TrailingObjects.h" @@ -111,7 +112,7 @@ class OMPClauseWithPreInit { Stmt *PreInit = nullptr; /// Region that captures the associated stmt. - OpenMPDirectiveKind CaptureRegion = OMPD_unknown; + OpenMPDirectiveKind CaptureRegion = llvm::omp::OMPD_unknown; protected: OMPClauseWithPreInit(const OMPClause *This) { @@ -119,7 +120,9 @@ class OMPClauseWithPreInit { } /// Set pre-initialization statement for the clause. - void setPreInitStmt(Stmt *S, OpenMPDirectiveKind ThisRegion = OMPD_unknown) { + void + setPreInitStmt(Stmt *S, + OpenMPDirectiveKind ThisRegion = llvm::omp::OMPD_unknown) { PreInit = S; CaptureRegion = ThisRegion; } @@ -432,7 +435,7 @@ class OMPIfClause : public OMPClause, public OMPClauseWithPreInit { SourceLocation ColonLoc; /// Directive name modifier for the clause. - OpenMPDirectiveKind NameModifier = OMPD_unknown; + OpenMPDirectiveKind NameModifier = llvm::omp::OMPD_unknown; /// Name modifier location. SourceLocation NameModifierLoc; @@ -943,7 +946,7 @@ class OMPProcBindClause : public OMPClause { SourceLocation LParenLoc; /// A kind of the 'proc_bind' clause. - OpenMPProcBindClauseKind Kind = OMPC_PROC_BIND_unknown; + llvm::omp::ProcBindKind Kind = llvm::omp::OMP_PROC_BIND_unknown; /// Start location of the kind in source code. SourceLocation KindKwLoc; @@ -951,7 +954,7 @@ class OMPProcBindClause : public OMPClause { /// Set kind of the clause. /// /// \param K Kind of clause. - void setProcBindKind(OpenMPProcBindClauseKind K) { Kind = K; } + void setProcBindKind(llvm::omp::ProcBindKind K) { Kind = K; } /// Set clause kind location. /// @@ -967,7 +970,7 @@ class OMPProcBindClause : public OMPClause { /// \param StartLoc Starting location of the clause. /// \param LParenLoc Location of '('. /// \param EndLoc Ending location of the clause. - OMPProcBindClause(OpenMPProcBindClauseKind A, SourceLocation ALoc, + OMPProcBindClause(llvm::omp::ProcBindKind A, SourceLocation ALoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc) : OMPClause(OMPC_proc_bind, StartLoc, EndLoc), LParenLoc(LParenLoc), @@ -984,7 +987,7 @@ class OMPProcBindClause : public OMPClause { SourceLocation getLParenLoc() const { return LParenLoc; } /// Returns kind of the clause. - OpenMPProcBindClauseKind getProcBindKind() const { return Kind; } + llvm::omp::ProcBindKind getProcBindKind() const { return Kind; } /// Returns location of clause kind. SourceLocation getProcBindKindKwLoc() const { return KindKwLoc; } @@ -2150,6 +2153,13 @@ class OMPLastprivateClause final friend OMPVarListClause; friend TrailingObjects; + /// Optional lastprivate kind, e.g. 'conditional', if specified by user. + OpenMPLastprivateModifier LPKind; + /// Optional location of the lasptrivate kind, if specified by user. + SourceLocation LPKindLoc; + /// Optional colon location, if specified by user. + SourceLocation ColonLoc; + /// Build clause with number of variables \a N. /// /// \param StartLoc Starting location of the clause. @@ -2157,10 +2167,13 @@ class OMPLastprivateClause final /// \param EndLoc Ending location of the clause. /// \param N Number of the variables in the clause. OMPLastprivateClause(SourceLocation StartLoc, SourceLocation LParenLoc, - SourceLocation EndLoc, unsigned N) + SourceLocation EndLoc, OpenMPLastprivateModifier LPKind, + SourceLocation LPKindLoc, SourceLocation ColonLoc, + unsigned N) : OMPVarListClause(OMPC_lastprivate, StartLoc, LParenLoc, EndLoc, N), - OMPClauseWithPostUpdate(this) {} + OMPClauseWithPostUpdate(this), LPKind(LPKind), LPKindLoc(LPKindLoc), + ColonLoc(ColonLoc) {} /// Build an empty clause. /// @@ -2221,6 +2234,13 @@ class OMPLastprivateClause final return llvm::makeArrayRef(getDestinationExprs().end(), varlist_size()); } + /// Sets lastprivate kind. + void setKind(OpenMPLastprivateModifier Kind) { LPKind = Kind; } + /// Sets location of the lastprivate kind. + void setKindLoc(SourceLocation Loc) { LPKindLoc = Loc; } + /// Sets colon symbol location. + void setColonLoc(SourceLocation Loc) { ColonLoc = Loc; } + public: /// Creates clause with a list of variables \a VL. /// @@ -2242,6 +2262,9 @@ class OMPLastprivateClause final /// \endcode /// Required for proper codegen of final assignment performed by the /// lastprivate clause. + /// \param LPKind Lastprivate kind, e.g. 'conditional'. + /// \param LPKindLoc Location of the lastprivate kind. + /// \param ColonLoc Location of the ':' symbol if lastprivate kind is used. /// \param PreInit Statement that must be executed before entering the OpenMP /// region with this clause. /// \param PostUpdate Expression that must be executed after exit from the @@ -2250,7 +2273,8 @@ class OMPLastprivateClause final Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc, ArrayRef VL, ArrayRef SrcExprs, ArrayRef DstExprs, ArrayRef AssignmentOps, - Stmt *PreInit, Expr *PostUpdate); + OpenMPLastprivateModifier LPKind, SourceLocation LPKindLoc, + SourceLocation ColonLoc, Stmt *PreInit, Expr *PostUpdate); /// Creates an empty clause with the place for \a N variables. /// @@ -2258,6 +2282,13 @@ class OMPLastprivateClause final /// \param N The number of variables. static OMPLastprivateClause *CreateEmpty(const ASTContext &C, unsigned N); + /// Lastprivate kind. + OpenMPLastprivateModifier getKind() const { return LPKind; } + /// Returns the location of the lastprivate kind. + SourceLocation getKindLoc() const { return LPKindLoc; } + /// Returns the location of the ':' symbol, if any. + SourceLocation getColonLoc() const { return ColonLoc; } + using helper_expr_iterator = MutableArrayRef::iterator; using helper_expr_const_iterator = ArrayRef::iterator; using helper_expr_range = llvm::iterator_range; @@ -6240,6 +6271,102 @@ class OMPIsDevicePtrClause final } }; +/// This represents clause 'nontemporal' in the '#pragma omp ...' directives. +/// +/// \code +/// #pragma omp simd nontemporal(a) +/// \endcode +/// In this example directive '#pragma omp simd' has clause 'nontemporal' for +/// the variable 'a'. +class OMPNontemporalClause final + : public OMPVarListClause, + private llvm::TrailingObjects { + friend class OMPClauseReader; + friend OMPVarListClause; + friend TrailingObjects; + + /// Build clause with number of variables \a N. + /// + /// \param StartLoc Starting location of the clause. + /// \param LParenLoc Location of '('. + /// \param EndLoc Ending location of the clause. + /// \param N Number of the variables in the clause. + OMPNontemporalClause(SourceLocation StartLoc, SourceLocation LParenLoc, + SourceLocation EndLoc, unsigned N) + : OMPVarListClause(OMPC_nontemporal, StartLoc, + LParenLoc, EndLoc, N) {} + + /// Build an empty clause. + /// + /// \param N Number of variables. + explicit OMPNontemporalClause(unsigned N) + : OMPVarListClause( + OMPC_nontemporal, SourceLocation(), SourceLocation(), + SourceLocation(), N) {} + + /// Get the list of privatied copies if the member expression was captured by + /// one of the privatization clauses. + MutableArrayRef getPrivateRefs() { + return MutableArrayRef(varlist_end(), varlist_size()); + } + ArrayRef getPrivateRefs() const { + return llvm::makeArrayRef(varlist_end(), varlist_size()); + } + +public: + /// Creates clause with a list of variables \a VL. + /// + /// \param C AST context. + /// \param StartLoc Starting location of the clause. + /// \param LParenLoc Location of '('. + /// \param EndLoc Ending location of the clause. + /// \param VL List of references to the variables. + static OMPNontemporalClause * + Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, + SourceLocation EndLoc, ArrayRef VL); + + /// Creates an empty clause with the place for \a N variables. + /// + /// \param C AST context. + /// \param N The number of variables. + static OMPNontemporalClause *CreateEmpty(const ASTContext &C, unsigned N); + + /// Sets the list of references to private copies created in private clauses. + /// \param VL List of references. + void setPrivateRefs(ArrayRef VL); + + child_range children() { + return child_range(reinterpret_cast(varlist_begin()), + reinterpret_cast(varlist_end())); + } + + const_child_range children() const { + auto Children = const_cast(this)->children(); + return const_child_range(Children.begin(), Children.end()); + } + + child_range private_refs() { + return child_range(reinterpret_cast(getPrivateRefs().begin()), + reinterpret_cast(getPrivateRefs().end())); + } + + const_child_range private_refs() const { + auto Children = const_cast(this)->private_refs(); + return const_child_range(Children.begin(), Children.end()); + } + + child_range used_children() { + return child_range(child_iterator(), child_iterator()); + } + const_child_range used_children() const { + return const_child_range(const_child_iterator(), const_child_iterator()); + } + + static bool classof(const OMPClause *T) { + return T->getClauseKind() == OMPC_nontemporal; + } +}; + /// This class implements a simple visitor for OMPClause /// subclasses. template class Ptr, typename RetTy> diff --git a/clang/include/clang/AST/PrettyPrinter.h b/clang/include/clang/AST/PrettyPrinter.h index 0cd62ba373dc..80eec6a5a8be 100644 --- a/clang/include/clang/AST/PrettyPrinter.h +++ b/clang/include/clang/AST/PrettyPrinter.h @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// // -// This file defines the PrinterHelper interface. +// This file defines helper types for AST pretty-printing. // //===----------------------------------------------------------------------===// @@ -29,6 +29,16 @@ class PrinterHelper { virtual bool handledStmt(Stmt* E, raw_ostream& OS) = 0; }; +/// Callbacks to use to customize the behavior of the pretty-printer. +class PrintingCallbacks { +protected: + ~PrintingCallbacks() = default; + +public: + /// Remap a path to a form suitable for printing. + virtual std::string remapPath(StringRef Path) const { return Path; } +}; + /// Describes how types, statements, expressions, and declarations should be /// printed. /// @@ -50,7 +60,7 @@ struct PrintingPolicy { MSWChar(LO.MicrosoftExt && !LO.WChar), IncludeNewlines(true), MSVCFormatting(false), ConstantsAsWritten(false), SuppressImplicitBase(false), FullyQualifiedName(false), - RemapFilePaths(false), PrintCanonicalTypes(false) {} + PrintCanonicalTypes(false) {} /// Adjust this printing policy for cases where it's known that we're /// printing C++ code (for instance, if AST dumping reaches a C++-only @@ -224,14 +234,11 @@ struct PrintingPolicy { /// This is the opposite of SuppressScope and thus overrules it. unsigned FullyQualifiedName : 1; - /// Whether to apply -fdebug-prefix-map to any file paths. - unsigned RemapFilePaths : 1; - /// Whether to print types as written or canonically. unsigned PrintCanonicalTypes : 1; - /// When RemapFilePaths is true, this function performs the action. - std::function remapPath; + /// Callbacks to use to allow the behavior of printing to be customized. + const PrintingCallbacks *Callbacks = nullptr; }; } // end namespace clang diff --git a/clang/include/clang/AST/PropertiesBase.td b/clang/include/clang/AST/PropertiesBase.td new file mode 100644 index 000000000000..9aacdb9fee36 --- /dev/null +++ b/clang/include/clang/AST/PropertiesBase.td @@ -0,0 +1,495 @@ +//==--- PropertiesBase.td - Baseline definitions for AST properties -------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +class HasProperties; + +/// The type of the property. +class PropertyType { + /// The C++ type name for the type. + string CXXName = !if(!ne(typeName, ""), typeName, NAME); + + /// Whether the C++ type should generally be passed around by reference. + bit PassByReference = 0; + + /// Whether `const` should be prepended to the type when writing. + bit ConstWhenWriting = 0; + + /// Given a value of type Optional bound as 'value', yield a + /// CXXName that can be serialized into a DataStreamTypeWriter. + string PackOptional = ""; + + /// Given a value of type CXXName bound as 'value' that was deserialized + /// by a DataStreamTypeReader, yield an Optional. + string UnpackOptional = ""; + + /// A list of types for which buffeers must be passed to the read + /// operations. + list BufferElementTypes = []; +} + +/// Property types that correspond to specific C++ enums. +class EnumPropertyType : PropertyType {} + +/// Property types that correspond to a specific C++ class. +/// Supports optional values by using the null representation. +class RefPropertyType : PropertyType { + let PackOptional = + "value ? *value : nullptr"; + let UnpackOptional = + "value ? llvm::Optional<" # CXXName # ">(value) : llvm::None"; +} + +/// Property types that correspond to a specific subclass of another type. +class SubclassPropertyType + : RefPropertyType { + PropertyType Base = base; + string SubclassName = className; + let ConstWhenWriting = base.ConstWhenWriting; +} + +/// Property types that support optional values by using their +/// default value. +class DefaultValuePropertyType : PropertyType { + let PackOptional = + "value ? *value : " # CXXName # "()"; + let UnpackOptional = + "value.isNull() ? llvm::None : llvm::Optional<" # CXXName # ">(value)"; +} + +/// Property types that correspond to integer types and support optional +/// values by shifting the value over by 1. +class CountPropertyType : PropertyType { + let PackOptional = + "value ? *value + 1 : 0"; + let UnpackOptional = + "value ? llvm::Optional<" # CXXName # ">(value - 1) : llvm::None"; +} + +def APInt : PropertyType<"llvm::APInt"> { let PassByReference = 1; } +def APSInt : PropertyType<"llvm::APSInt"> { let PassByReference = 1; } +def ArraySizeModifier : EnumPropertyType<"ArrayType::ArraySizeModifier">; +def AttrKind : EnumPropertyType<"attr::Kind">; +def AutoTypeKeyword : EnumPropertyType; +def Bool : PropertyType<"bool">; +def BuiltinTypeKind : EnumPropertyType<"BuiltinType::Kind">; +def CallingConv : EnumPropertyType; +def DeclarationName : PropertyType; +def DeclarationNameKind : EnumPropertyType<"DeclarationName::NameKind">; +def DeclRef : RefPropertyType<"Decl"> { let ConstWhenWriting = 1; } + def CXXRecordDeclRef : + SubclassPropertyType<"CXXRecordDecl", DeclRef>; + def FunctionDeclRef : + SubclassPropertyType<"FunctionDecl", DeclRef>; + def NamedDeclRef : + SubclassPropertyType<"NamedDecl", DeclRef>; + def NamespaceDeclRef : + SubclassPropertyType<"NamespaceDecl", DeclRef>; + def NamespaceAliasDeclRef : + SubclassPropertyType<"NamespaceAliasDecl", DeclRef>; + def ObjCProtocolDeclRef : + SubclassPropertyType<"ObjCProtocolDecl", DeclRef>; + def ObjCTypeParamDeclRef : + SubclassPropertyType<"ObjCTypeParamDecl", DeclRef>; + def TagDeclRef : + SubclassPropertyType<"TagDecl", DeclRef>; + def TemplateDeclRef : + SubclassPropertyType<"TemplateDecl", DeclRef>; + def TemplateTypeParmDeclRef : + SubclassPropertyType<"TemplateTypeParmDecl", DeclRef>; + def TemplateTemplateParmDeclRef : + SubclassPropertyType<"TemplateTemplateParmDecl", DeclRef>; + def ValueDeclRef : + SubclassPropertyType<"ValueDecl", DeclRef>; +def ElaboratedTypeKeyword : EnumPropertyType; +def ExtParameterInfo : PropertyType<"FunctionProtoType::ExtParameterInfo">; +def Identifier : RefPropertyType<"IdentifierInfo"> { let ConstWhenWriting = 1; } +def NestedNameSpecifier : PropertyType<"NestedNameSpecifier *">; +def NestedNameSpecifierKind : + EnumPropertyType<"NestedNameSpecifier::SpecifierKind">; +def OverloadedOperatorKind : EnumPropertyType; +def Qualifiers : PropertyType; +def QualType : DefaultValuePropertyType; +def RefQualifierKind : EnumPropertyType; +def Selector : PropertyType; +def SourceLocation : PropertyType; +def StmtRef : RefPropertyType<"Stmt"> { let ConstWhenWriting = 1; } + def ExprRef : SubclassPropertyType<"Expr", StmtRef>; +def TemplateArgument : PropertyType; +def TemplateArgumentKind : EnumPropertyType<"TemplateArgument::ArgKind">; +def TemplateName : DefaultValuePropertyType; +def TemplateNameKind : EnumPropertyType<"TemplateName::NameKind">; +def UInt32 : CountPropertyType<"uint32_t">; +def UInt64 : CountPropertyType<"uint64_t">; +def UnaryTypeTransformKind : EnumPropertyType<"UnaryTransformType::UTTKind">; +def VectorKind : EnumPropertyType<"VectorType::VectorKind">; + +def ExceptionSpecInfo : PropertyType<"FunctionProtoType::ExceptionSpecInfo"> { + let BufferElementTypes = [ QualType ]; +} + +/// Arrays. The corresponding C++ type is ArrayRef of the corresponding +/// C++ type of the element. +class Array : PropertyType { + PropertyType Element = element; + let BufferElementTypes = [ element ]; +} + +/// llvm::Optional. The corresponding C++ type is generally just the +/// corresponding C++ type of the element. +/// +/// Optional may restrict the range of the operand for some +/// serialization clients. +class Optional : PropertyType { + PropertyType Element = element; + let PassByReference = element.PassByReference; +} + +/// A property of an AST node. +class Property { + HasProperties Class; + string Name = name; + PropertyType Type = type; + + /// A function for reading the property, expressed in terms of a variable + /// "node". + code Read; + + /// Code specifying when this property is available. Can be defined + /// in terms of other properties, in which case this property must be + /// read/written after those properties. Using this will make the + /// value Optional when deserializing. + /// + /// FIXME: the emitter doesn't yet force dependent properties to be + /// read/written later; this only works if the properties used in the + /// condition happen to be written first. + code Conditional = ""; +} + +/// A rule for declaring helper variables when read properties from a +/// value of this type. Note that this means that this code is actually +/// run when *writing* values of this type; however, naming this +/// `ReadHelper` makes the connection to the `Read` operations on the +/// properties much clearer. +class ReadHelper { + HasProperties Class; + + /// Code which will be run when writing objects of this type before + /// writing any of the properties, specified in terms of a variable + /// `node`. + code Code = _code; +} + +/// A rule for creating objects of this type. +class Creator { + HasProperties Class; + + /// A function for creating values of this kind, expressed in terms of a + /// variable `ctx` of type `ASTContext &`. Must also refer to all of the + /// properties by name. + code Create = create; +} + +/// A rule which overrides some of the normal rules. +class Override { + HasProperties Class; + + /// Properties from base classes that should be ignored. + list IgnoredProperties = []; +} + +/// A description of how to break a type into cases. Providing this and +/// an exhaustive list of the cases will cause AbstractBasic{Reader,Writer} +/// to be generated with a default implementation of how to read the +/// type. +/// +/// Creator rules for the cases can additionally access a variable +/// `kind` of the KindType. +class PropertyTypeKind { + /// The type for which this describes cases. + PropertyType Type = type; + + /// The type of this type's kind enum. + PropertyType KindType = kindType; + + /// The property name to use for the kind. + string KindPropertyName = "kind"; + + /// An expression which reads the kind from a value, expressed in terms + /// of a variable `node`. + string Read = readCode; +} + +/// One of the options for representing a particular type. +class PropertyTypeCase : HasProperties { + /// The type of which this is a case. + PropertyType Type = type; + + /// The name of the case (a value of the type's kind enum). + string Name = name; +} + +// Type cases for DeclarationName. +def : PropertyTypeKind; +let Class = PropertyTypeCase in { + def : Property<"identifier", Identifier> { + let Read = [{ node.getAsIdentifierInfo() }]; + } + def : Creator<[{ + return DeclarationName(identifier); + }]>; +} +foreach count = ["Zero", "One", "Multi"] in { + let Class = PropertyTypeCase in { + def : Property<"selector", Selector> { + let Read = [{ node.getObjCSelector() }]; + } + def : Creator<[{ + return DeclarationName(selector); + }]>; + } +} +foreach kind = ["Constructor", "Destructor", "ConversionFunction"] in { + let Class = PropertyTypeCase in { + def : Property<"type", QualType> { + let Read = [{ node.getCXXNameType() }]; + } + def : Creator<[{ + return ctx.DeclarationNames.getCXX}]#kind#[{Name( + ctx.getCanonicalType(type)); + }]>; + } +} +let Class = PropertyTypeCase in { + def : Property<"declaration", TemplateDeclRef> { + let Read = [{ node.getCXXDeductionGuideTemplate() }]; + } + def : Creator<[{ + return ctx.DeclarationNames.getCXXDeductionGuideName(declaration); + }]>; +} +let Class = PropertyTypeCase in { + def : Property<"operatorKind", OverloadedOperatorKind> { + let Read = [{ node.getCXXOverloadedOperator() }]; + } + def : Creator<[{ + return ctx.DeclarationNames.getCXXOperatorName(operatorKind); + }]>; +} +let Class = PropertyTypeCase in { + def : Property<"identifier", Identifier> { + let Read = [{ node.getCXXLiteralIdentifier() }]; + } + def : Creator<[{ + return ctx.DeclarationNames.getCXXLiteralOperatorName(identifier); + }]>; +} +let Class = PropertyTypeCase in { + def : Creator<[{ + return DeclarationName::getUsingDirectiveName(); + }]>; +} + +// Type cases for TemplateName. +def : PropertyTypeKind; +let Class = PropertyTypeCase in { + def : Property<"declaration", TemplateDeclRef> { + let Read = [{ node.getAsTemplateDecl() }]; + } + def : Creator<[{ + return TemplateName(declaration); + }]>; +} +let Class = PropertyTypeCase in { + def : Property<"overloads", Array> { + let Read = [{ node.getAsOverloadedTemplate()->decls() }]; + } + def : Creator<[{ + // Copy into an UnresolvedSet to satisfy the interface. + UnresolvedSet<8> overloadSet; + for (auto overload : overloads) { + overloadSet.addDecl(overload); + } + + return ctx.getOverloadedTemplateName(overloadSet.begin(), + overloadSet.end()); + }]>; +} +let Class = PropertyTypeCase in { + def : Property<"name", DeclarationName> { + let Read = [{ node.getAsAssumedTemplateName()->getDeclName() }]; + } + def : Creator<[{ + return ctx.getAssumedTemplateName(name); + }]>; +} +let Class = PropertyTypeCase in { + def : ReadHelper<[{ + auto qtn = node.getAsQualifiedTemplateName(); + }]>; + def : Property<"qualifier", NestedNameSpecifier> { + let Read = [{ qtn->getQualifier() }]; + } + def : Property<"hasTemplateKeyword", Bool> { + let Read = [{ qtn->hasTemplateKeyword() }]; + } + def : Property<"declaration", TemplateDeclRef> { + let Read = [{ qtn->getTemplateDecl() }]; + } + def : Creator<[{ + return ctx.getQualifiedTemplateName(qualifier, hasTemplateKeyword, + declaration); + }]>; +} +let Class = PropertyTypeCase in { + def : ReadHelper<[{ + auto dtn = node.getAsDependentTemplateName(); + }]>; + def : Property<"qualifier", NestedNameSpecifier> { + let Read = [{ dtn->getQualifier() }]; + } + def : Property<"identifier", Optional> { + let Read = [{ makeOptionalFromPointer( + dtn->isIdentifier() + ? dtn->getIdentifier() + : nullptr) }]; + } + def : Property<"operatorKind", OverloadedOperatorKind> { + let Conditional = [{ !identifier }]; + let Read = [{ dtn->getOperator() }]; + } + def : Creator<[{ + if (identifier) { + return ctx.getDependentTemplateName(qualifier, *identifier); + } else { + return ctx.getDependentTemplateName(qualifier, *operatorKind); + } + }]>; +} +let Class = PropertyTypeCase in { + def : ReadHelper<[{ + auto parm = node.getAsSubstTemplateTemplateParm(); + }]>; + def : Property<"parameter", TemplateTemplateParmDeclRef> { + let Read = [{ parm->getParameter() }]; + } + def : Property<"replacement", TemplateName> { + let Read = [{ parm->getReplacement() }]; + } + def : Creator<[{ + return ctx.getSubstTemplateTemplateParm(parameter, replacement); + }]>; +} +let Class = PropertyTypeCase in { + def : ReadHelper<[{ + auto parm = node.getAsSubstTemplateTemplateParmPack(); + }]>; + def : Property<"parameterPack", TemplateTemplateParmDeclRef> { + let Read = [{ parm->getParameterPack() }]; + } + def : Property<"argumentPack", TemplateArgument> { + let Read = [{ parm->getArgumentPack() }]; + } + def : Creator<[{ + return ctx.getSubstTemplateTemplateParmPack(parameterPack, argumentPack); + }]>; +} + +// Type cases for TemplateArgument. +def : PropertyTypeKind; +let Class = PropertyTypeCase in { + def : Creator<[{ + return TemplateArgument(); + }]>; +} +let Class = PropertyTypeCase in { + def : Property<"type", QualType> { + let Read = [{ node.getAsType() }]; + } + def : Creator<[{ + return TemplateArgument(type); + }]>; +} +let Class = PropertyTypeCase in { + def : Property<"declaration", ValueDeclRef> { + let Read = [{ node.getAsDecl() }]; + } + def : Property<"parameterType", QualType> { + let Read = [{ node.getParamTypeForDecl() }]; + } + def : Creator<[{ + return TemplateArgument(declaration, parameterType); + }]>; +} +let Class = PropertyTypeCase in { + def : Property<"type", QualType> { + let Read = [{ node.getNullPtrType() }]; + } + def : Creator<[{ + return TemplateArgument(type, /*nullptr*/ true); + }]>; +} +let Class = PropertyTypeCase in { + def : Property<"value", APSInt> { + let Read = [{ node.getAsIntegral() }]; + } + def : Property<"type", QualType> { + let Read = [{ node.getIntegralType() }]; + } + def : Creator<[{ + return TemplateArgument(ctx, value, type); + }]>; +} +let Class = PropertyTypeCase in { + def : Property<"name", TemplateName> { + let Read = [{ node.getAsTemplateOrTemplatePattern() }]; + } + def : Creator<[{ + return TemplateArgument(name); + }]>; +} +let Class = PropertyTypeCase in { + def : Property<"name", TemplateName> { + let Read = [{ node.getAsTemplateOrTemplatePattern() }]; + } + def : Property<"numExpansions", Optional> { + let Read = [{ + // Translate unsigned -> uint32_t just in case. + node.getNumTemplateExpansions().map( + [](unsigned i) { return uint32_t(i); }) + }]; + } + def : Creator<[{ + auto numExpansionsUnsigned = + numExpansions.map([](uint32_t i) { return unsigned(i); }); + return TemplateArgument(name, numExpansionsUnsigned); + }]>; +} +let Class = PropertyTypeCase in { + def : Property<"expression", ExprRef> { + let Read = [{ node.getAsExpr() }]; + } + def : Creator<[{ + return TemplateArgument(expression); + }]>; +} +let Class = PropertyTypeCase in { + def : Property<"elements", Array> { + let Read = [{ node.pack_elements() }]; + } + def : Creator<[{ + // Copy the pack into the ASTContext. + TemplateArgument *ctxElements = new (ctx) TemplateArgument[elements.size()]; + for (size_t i = 0, e = elements.size(); i != e; ++i) + ctxElements[i] = elements[i]; + return TemplateArgument(llvm::makeArrayRef(ctxElements, elements.size())); + }]>; +} diff --git a/clang/include/clang/AST/RecursiveASTVisitor.h b/clang/include/clang/AST/RecursiveASTVisitor.h index 5b58eab95d60..f8ab8e451d8c 100644 --- a/clang/include/clang/AST/RecursiveASTVisitor.h +++ b/clang/include/clang/AST/RecursiveASTVisitor.h @@ -304,6 +304,11 @@ template class RecursiveASTVisitor { bool TraverseSynOrSemInitListExpr(InitListExpr *S, DataRecursionQueue *Queue = nullptr); + /// Recursively visit a reference to a concept with potential arguments. + /// + /// \returns false if the visitation was terminated early, true otherwise. + bool TraverseConceptReference(const ConceptReference &C); + // ---- Methods on Attrs ---- // Visit an attribute. @@ -1162,11 +1167,13 @@ DEF_TRAVERSE_TYPELOC(LValueReferenceType, DEF_TRAVERSE_TYPELOC(RValueReferenceType, { TRY_TO(TraverseTypeLoc(TL.getPointeeLoc())); }) -// FIXME: location of base class? // We traverse this in the type case as well, but how is it not reached through // the pointee type? DEF_TRAVERSE_TYPELOC(MemberPointerType, { - TRY_TO(TraverseType(QualType(TL.getTypePtr()->getClass(), 0))); + if (auto *TSI = TL.getClassTInfo()) + TRY_TO(TraverseTypeLoc(TSI->getTypeLoc())); + else + TRY_TO(TraverseType(QualType(TL.getTypePtr()->getClass(), 0))); TRY_TO(TraverseTypeLoc(TL.getPointeeLoc())); }) @@ -1435,6 +1442,10 @@ DEF_TRAVERSE_DECL(CapturedDecl, { DEF_TRAVERSE_DECL(EmptyDecl, {}) +DEF_TRAVERSE_DECL(LifetimeExtendedTemporaryDecl, { + TRY_TO(TraverseStmt(D->getTemporaryExpr())); +}) + DEF_TRAVERSE_DECL(FileScopeAsmDecl, { TRY_TO(TraverseStmt(D->getAsmString())); }) @@ -1767,9 +1778,8 @@ DEF_TRAVERSE_DECL(TemplateTemplateParmDecl, { // D is the "T" in something like // template