From 145449b1e420787bb99721a429341fa6be3adfb6 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 3 Jul 2022 16:10:23 +0200 Subject: Vendor import of llvm-project main llvmorg-15-init-15358-g53dc0f107877. --- clang/include/clang-c/Index.h | 68 +- clang/include/clang/APINotes/Types.h | 34 +- clang/include/clang/AST/ASTContext.h | 51 +- clang/include/clang/AST/ASTFwd.h | 1 + clang/include/clang/AST/ASTImportError.h | 51 + clang/include/clang/AST/ASTImporter.h | 36 +- clang/include/clang/AST/ASTImporterSharedState.h | 18 +- clang/include/clang/AST/ASTLambda.h | 5 +- clang/include/clang/AST/ASTNodeTraverser.h | 7 + clang/include/clang/AST/ASTTypeTraits.h | 8 +- clang/include/clang/AST/AbstractBasicReader.h | 2 +- clang/include/clang/AST/AbstractTypeReader.h | 3 +- clang/include/clang/AST/CharUnits.h | 6 + clang/include/clang/AST/Comment.h | 21 +- clang/include/clang/AST/CommentCommands.td | 62 +- clang/include/clang/AST/CommentParser.h | 5 +- clang/include/clang/AST/CommentSema.h | 8 +- clang/include/clang/AST/ComputeDependence.h | 8 +- clang/include/clang/AST/Decl.h | 64 +- clang/include/clang/AST/DeclBase.h | 48 +- clang/include/clang/AST/DeclCXX.h | 89 +- clang/include/clang/AST/DeclObjC.h | 12 +- clang/include/clang/AST/DeclTemplate.h | 48 +- clang/include/clang/AST/DeclarationName.h | 29 +- clang/include/clang/AST/DependenceFlags.h | 24 +- clang/include/clang/AST/Expr.h | 33 +- clang/include/clang/AST/ExprCXX.h | 83 +- clang/include/clang/AST/ExprConcepts.h | 2 + clang/include/clang/AST/JSONNodeDumper.h | 2 + clang/include/clang/AST/Mangle.h | 35 +- clang/include/clang/AST/NestedNameSpecifier.h | 2 +- clang/include/clang/AST/OpenMPClause.h | 163 +- clang/include/clang/AST/ParentMapContext.h | 18 +- clang/include/clang/AST/PrettyPrinter.h | 11 +- clang/include/clang/AST/PropertiesBase.td | 17 +- clang/include/clang/AST/Randstruct.h | 35 + clang/include/clang/AST/RawCommentList.h | 15 + clang/include/clang/AST/RecursiveASTVisitor.h | 242 +- clang/include/clang/AST/Stmt.h | 59 +- clang/include/clang/AST/StmtCXX.h | 14 +- clang/include/clang/AST/StmtOpenMP.h | 744 +- clang/include/clang/AST/TemplateBase.h | 7 + clang/include/clang/AST/TemplateName.h | 50 +- clang/include/clang/AST/TextNodeDumper.h | 3 + clang/include/clang/AST/Type.h | 141 +- clang/include/clang/AST/TypeLoc.h | 41 + clang/include/clang/AST/TypeProperties.td | 15 +- clang/include/clang/ASTMatchers/ASTMatchers.h | 101 +- .../clang/ASTMatchers/ASTMatchersInternal.h | 37 +- .../clang/ASTMatchers/Dynamic/VariantValue.h | 2 +- .../clang/Analysis/Analyses/CalledOnceCheck.h | 2 +- .../clang/Analysis/Analyses/ExprMutationAnalyzer.h | 2 + .../include/clang/Analysis/Analyses/ThreadSafety.h | 9 +- .../clang/Analysis/Analyses/ThreadSafetyCommon.h | 47 +- clang/include/clang/Analysis/AnalysisDeclContext.h | 6 +- clang/include/clang/Analysis/CloneDetection.h | 8 +- clang/include/clang/Analysis/ConstructionContext.h | 3 +- .../Analysis/FlowSensitive/DataflowAnalysis.h | 43 +- .../FlowSensitive/DataflowAnalysisContext.h | 224 +- .../Analysis/FlowSensitive/DataflowEnvironment.h | 126 +- .../clang/Analysis/FlowSensitive/MatchSwitch.h | 151 + .../FlowSensitive/Models/ChromiumCheckModel.h | 39 + .../Models/UncheckedOptionalAccessModel.h | 85 + .../clang/Analysis/FlowSensitive/NoopLattice.h | 41 + .../include/clang/Analysis/FlowSensitive/Solver.h | 56 + .../clang/Analysis/FlowSensitive/StorageLocation.h | 10 +- .../clang/Analysis/FlowSensitive/Transfer.h | 15 +- .../FlowSensitive/TypeErasedDataflowAnalysis.h | 16 +- clang/include/clang/Analysis/FlowSensitive/Value.h | 175 +- .../Analysis/FlowSensitive/WatchedLiteralsSolver.h | 37 + clang/include/clang/Analysis/PathDiagnostic.h | 8 +- clang/include/clang/Basic/Attr.td | 234 +- clang/include/clang/Basic/AttrDocs.td | 341 +- clang/include/clang/Basic/AttrSubjectMatchRules.h | 3 + clang/include/clang/Basic/AttributeCommonInfo.h | 23 +- clang/include/clang/Basic/Attributes.h | 22 +- clang/include/clang/Basic/Builtins.def | 88 +- clang/include/clang/Basic/Builtins.h | 65 +- clang/include/clang/Basic/BuiltinsAArch64.def | 12 + clang/include/clang/Basic/BuiltinsAMDGPU.def | 48 + clang/include/clang/Basic/BuiltinsARM.def | 3 + clang/include/clang/Basic/BuiltinsNVPTX.def | 127 +- clang/include/clang/Basic/BuiltinsPPC.def | 38 +- clang/include/clang/Basic/BuiltinsRISCV.def | 61 +- clang/include/clang/Basic/BuiltinsVE.def | 32 + clang/include/clang/Basic/BuiltinsVEVL.gen.def | 1257 ++ clang/include/clang/Basic/BuiltinsWebAssembly.def | 13 +- clang/include/clang/Basic/BuiltinsX86.def | 32 +- clang/include/clang/Basic/BuiltinsX86_64.def | 1 - clang/include/clang/Basic/CharInfo.h | 43 +- clang/include/clang/Basic/CodeGenOptions.def | 17 +- clang/include/clang/Basic/CodeGenOptions.h | 9 +- clang/include/clang/Basic/Cuda.h | 9 + clang/include/clang/Basic/DarwinSDKInfo.h | 3 +- clang/include/clang/Basic/DeclNodes.td | 1 + clang/include/clang/Basic/Diagnostic.h | 29 +- clang/include/clang/Basic/DiagnosticASTKinds.td | 6 +- clang/include/clang/Basic/DiagnosticCategories.h | 3 +- .../include/clang/Basic/DiagnosticCommentKinds.td | 4 +- clang/include/clang/Basic/DiagnosticCommonKinds.td | 16 +- .../include/clang/Basic/DiagnosticCrossTUKinds.td | 4 +- clang/include/clang/Basic/DiagnosticDriverKinds.td | 95 +- .../include/clang/Basic/DiagnosticFrontendKinds.td | 9 + clang/include/clang/Basic/DiagnosticGroups.td | 45 +- clang/include/clang/Basic/DiagnosticIDs.h | 13 +- clang/include/clang/Basic/DiagnosticLexKinds.td | 52 +- clang/include/clang/Basic/DiagnosticParseKinds.td | 42 +- clang/include/clang/Basic/DiagnosticSemaKinds.td | 296 +- .../clang/Basic/DiagnosticSerializationKinds.td | 100 +- clang/include/clang/Basic/DirectoryEntry.h | 31 +- clang/include/clang/Basic/FPOptions.def | 8 +- clang/include/clang/Basic/Features.def | 12 +- clang/include/clang/Basic/FileEntry.h | 18 +- clang/include/clang/Basic/FileManager.h | 12 +- clang/include/clang/Basic/Lambda.h | 2 +- clang/include/clang/Basic/LangOptions.def | 36 +- clang/include/clang/Basic/LangOptions.h | 213 +- clang/include/clang/Basic/LangStandard.h | 15 +- clang/include/clang/Basic/LangStandards.def | 37 +- clang/include/clang/Basic/Module.h | 68 +- clang/include/clang/Basic/OpenCLOptions.h | 9 - clang/include/clang/Basic/OpenMPKinds.def | 3 + clang/include/clang/Basic/Sanitizers.def | 5 +- clang/include/clang/Basic/SourceLocation.h | 6 +- clang/include/clang/Basic/SourceManager.h | 52 +- clang/include/clang/Basic/Specifiers.h | 4 +- clang/include/clang/Basic/StmtNodes.td | 9 + clang/include/clang/Basic/TargetBuiltins.h | 7 +- clang/include/clang/Basic/TargetInfo.h | 79 +- clang/include/clang/Basic/TargetOptions.h | 24 +- clang/include/clang/Basic/TokenKinds.def | 48 +- clang/include/clang/Basic/TokenKinds.h | 3 + clang/include/clang/Basic/TypeNodes.td | 1 + clang/include/clang/Basic/arm_sve.td | 32 +- clang/include/clang/Basic/riscv_vector.td | 538 +- clang/include/clang/CodeGen/CGFunctionInfo.h | 14 + clang/include/clang/CrossTU/CrossTranslationUnit.h | 18 +- clang/include/clang/Driver/Action.h | 42 +- clang/include/clang/Driver/Compilation.h | 21 +- clang/include/clang/Driver/Distro.h | 6 +- clang/include/clang/Driver/Driver.h | 97 +- clang/include/clang/Driver/Options.h | 3 +- clang/include/clang/Driver/Options.td | 655 +- clang/include/clang/Driver/SanitizerArgs.h | 19 + clang/include/clang/Driver/ToolChain.h | 31 +- clang/include/clang/Driver/Types.def | 12 +- clang/include/clang/Driver/Types.h | 6 +- clang/include/clang/ExtractAPI/API.h | 728 + clang/include/clang/ExtractAPI/AvailabilityInfo.h | 78 + .../clang/ExtractAPI/DeclarationFragments.h | 287 + clang/include/clang/ExtractAPI/FrontendActions.h | 69 + .../ExtractAPI/Serialization/SerializerBase.h | 63 + .../Serialization/SymbolGraphSerializer.h | 178 + clang/include/clang/Format/Format.h | 686 +- clang/include/clang/Frontend/ASTUnit.h | 4 +- clang/include/clang/Frontend/CompilerInvocation.h | 13 - clang/include/clang/Frontend/FrontendActions.h | 15 +- clang/include/clang/Frontend/FrontendOptions.h | 49 +- clang/include/clang/Frontend/MultiplexConsumer.h | 2 + clang/include/clang/Frontend/PrecompiledPreamble.h | 79 +- .../clang/Frontend/PreprocessorOutputOptions.h | 2 + clang/include/clang/Frontend/Utils.h | 60 +- clang/include/clang/Index/IndexSymbol.h | 2 + clang/include/clang/Index/IndexingOptions.h | 4 +- clang/include/clang/Interpreter/Interpreter.h | 5 + .../clang/Lex/DependencyDirectivesScanner.h | 136 + .../Lex/DependencyDirectivesSourceMinimizer.h | 115 - clang/include/clang/Lex/DirectoryLookup.h | 4 + clang/include/clang/Lex/HeaderSearch.h | 173 +- clang/include/clang/Lex/HeaderSearchOptions.h | 12 +- clang/include/clang/Lex/Lexer.h | 61 +- clang/include/clang/Lex/LiteralSupport.h | 16 +- clang/include/clang/Lex/MacroInfo.h | 48 +- clang/include/clang/Lex/ModuleMap.h | 19 +- clang/include/clang/Lex/PPCallbacks.h | 62 +- clang/include/clang/Lex/PreprocessingRecord.h | 13 +- clang/include/clang/Lex/Preprocessor.h | 172 +- ...cessorExcludedConditionalDirectiveSkipMapping.h | 30 - clang/include/clang/Lex/PreprocessorLexer.h | 21 +- clang/include/clang/Lex/PreprocessorOptions.h | 23 +- clang/include/clang/Lex/Token.h | 5 +- clang/include/clang/Parse/Parser.h | 327 +- clang/include/clang/Parse/RAIIObjectsForParser.h | 15 +- clang/include/clang/Sema/CodeCompleteConsumer.h | 5 +- clang/include/clang/Sema/DeclSpec.h | 73 +- clang/include/clang/Sema/Lookup.h | 46 +- clang/include/clang/Sema/ParsedAttr.h | 106 +- clang/include/clang/Sema/ParsedTemplate.h | 6 +- clang/include/clang/Sema/Scope.h | 28 +- clang/include/clang/Sema/ScopeInfo.h | 7 +- clang/include/clang/Sema/Sema.h | 595 +- clang/include/clang/Sema/Template.h | 2 +- clang/include/clang/Sema/Weak.h | 39 +- clang/include/clang/Serialization/ASTBitCodes.h | 20 +- clang/include/clang/Serialization/ASTReader.h | 37 +- .../include/clang/Serialization/ASTRecordReader.h | 18 +- .../include/clang/Serialization/ASTRecordWriter.h | 16 +- clang/include/clang/Serialization/ASTWriter.h | 15 +- .../clang/Serialization/SourceLocationEncoding.h | 163 + clang/include/clang/Serialization/TypeBitCodes.def | 1 + .../clang/StaticAnalyzer/Checkers/CheckerBase.td | 9 +- .../clang/StaticAnalyzer/Checkers/Checkers.td | 124 +- .../clang/StaticAnalyzer/Checkers/SValExplainer.h | 8 +- .../include/clang/StaticAnalyzer/Checkers/Taint.h | 106 + .../include/clang/StaticAnalyzer/Core/Analyses.def | 8 - .../clang/StaticAnalyzer/Core/AnalyzerOptions.def | 41 +- .../clang/StaticAnalyzer/Core/AnalyzerOptions.h | 41 +- .../Core/BugReporter/BugReporterVisitors.h | 2 +- clang/include/clang/StaticAnalyzer/Core/Checker.h | 12 - .../StaticAnalyzer/Core/PathSensitive/APSIntType.h | 4 +- .../Core/PathSensitive/BasicValueFactory.h | 14 +- .../Core/PathSensitive/CallDescription.h | 81 +- .../StaticAnalyzer/Core/PathSensitive/CallEvent.h | 15 +- .../Core/PathSensitive/CheckerContext.h | 1 + .../Core/PathSensitive/ConstraintManager.h | 118 +- .../StaticAnalyzer/Core/PathSensitive/CoreEngine.h | 8 +- .../Core/PathSensitive/DynamicType.h | 1 + .../Core/PathSensitive/ExplodedGraph.h | 6 +- .../StaticAnalyzer/Core/PathSensitive/ExprEngine.h | 39 +- .../StaticAnalyzer/Core/PathSensitive/MemRegion.h | 61 +- .../Core/PathSensitive/ProgramState.h | 54 +- .../Core/PathSensitive/ProgramStateTrait.h | 108 +- .../Core/PathSensitive/RangedConstraintManager.h | 43 + .../Core/PathSensitive/SMTConstraintManager.h | 6 +- .../StaticAnalyzer/Core/PathSensitive/SMTConv.h | 22 + .../Core/PathSensitive/SValBuilder.h | 62 +- .../StaticAnalyzer/Core/PathSensitive/SVals.h | 255 +- .../Core/PathSensitive/SimpleConstraintManager.h | 21 +- .../StaticAnalyzer/Core/PathSensitive/Store.h | 2 - .../StaticAnalyzer/Core/PathSensitive/SymExpr.h | 1 + .../Core/PathSensitive/SymbolManager.h | 106 +- .../StaticAnalyzer/Core/PathSensitive/Symbols.def | 2 + clang/include/clang/Support/RISCVVIntrinsicUtils.h | 354 + clang/include/clang/Testing/CommandLineArgs.h | 2 + clang/include/clang/Testing/TestAST.h | 95 + .../DependencyScanningFilesystem.h | 125 +- .../DependencyScanning/DependencyScanningService.h | 17 +- .../DependencyScanning/DependencyScanningTool.h | 29 +- .../DependencyScanning/DependencyScanningWorker.h | 2 - .../DependencyScanning/ModuleDepCollector.h | 36 +- clang/include/clang/Tooling/DiagnosticsYaml.h | 3 +- .../clang/Tooling/Inclusions/CSymbolMap.inc | 945 + .../clang/Tooling/Inclusions/HeaderIncludes.h | 4 +- .../clang/Tooling/Inclusions/StandardLibrary.h | 141 + .../clang/Tooling/Inclusions/StdSymbolMap.inc | 1538 ++ .../clang/Tooling/Refactoring/AtomicChange.h | 2 + .../clang/Tooling/Transformer/RewriteRule.h | 148 +- .../include/clang/Tooling/Transformer/SourceCode.h | 4 + .../clang/Tooling/Transformer/Transformer.h | 191 +- clang/include/clang/module.modulemap | 2 + clang/lib/ARCMigrate/Transforms.cpp | 2 +- clang/lib/AST/APValue.cpp | 83 +- clang/lib/AST/ASTContext.cpp | 264 +- clang/lib/AST/ASTDiagnostic.cpp | 18 +- clang/lib/AST/ASTImporter.cpp | 321 +- clang/lib/AST/ASTStructuralEquivalence.cpp | 150 +- clang/lib/AST/ASTTypeTraits.cpp | 6 + clang/lib/AST/AttrImpl.cpp | 6 +- clang/lib/AST/CommentParser.cpp | 47 +- clang/lib/AST/CommentSema.cpp | 48 +- clang/lib/AST/ComputeDependence.cpp | 151 +- clang/lib/AST/Decl.cpp | 109 +- clang/lib/AST/DeclBase.cpp | 9 +- clang/lib/AST/DeclCXX.cpp | 153 +- clang/lib/AST/DeclObjC.cpp | 11 +- clang/lib/AST/DeclPrinter.cpp | 13 +- clang/lib/AST/DeclTemplate.cpp | 39 +- clang/lib/AST/Expr.cpp | 248 +- clang/lib/AST/ExprCXX.cpp | 12 +- clang/lib/AST/ExprClassification.cpp | 13 +- clang/lib/AST/ExprConstant.cpp | 189 +- clang/lib/AST/FormatString.cpp | 4 +- clang/lib/AST/Interp/ByteCodeExprGen.h | 4 +- clang/lib/AST/Interp/Function.cpp | 3 +- clang/lib/AST/ItaniumMangle.cpp | 578 +- clang/lib/AST/JSONNodeDumper.cpp | 15 + clang/lib/AST/Mangle.cpp | 6 +- clang/lib/AST/MicrosoftCXXABI.cpp | 15 + clang/lib/AST/MicrosoftMangle.cpp | 30 +- clang/lib/AST/ODRHash.cpp | 1 + clang/lib/AST/OSLog.cpp | 2 +- clang/lib/AST/OpenMPClause.cpp | 89 +- clang/lib/AST/ParentMapContext.cpp | 14 +- clang/lib/AST/QualTypeNames.cpp | 8 +- clang/lib/AST/Randstruct.cpp | 231 + clang/lib/AST/RawCommentList.cpp | 65 +- clang/lib/AST/RecordLayoutBuilder.cpp | 16 +- clang/lib/AST/Stmt.cpp | 27 +- clang/lib/AST/StmtCXX.cpp | 1 - clang/lib/AST/StmtOpenMP.cpp | 405 +- clang/lib/AST/StmtPrinter.cpp | 185 +- clang/lib/AST/StmtProfile.cpp | 61 +- clang/lib/AST/TemplateBase.cpp | 44 +- clang/lib/AST/TemplateName.cpp | 55 +- clang/lib/AST/TextNodeDumper.cpp | 24 + clang/lib/AST/Type.cpp | 65 +- clang/lib/AST/TypeLoc.cpp | 8 + clang/lib/AST/TypePrinter.cpp | 66 +- clang/lib/AST/VTableBuilder.cpp | 10 +- clang/lib/ASTMatchers/ASTMatchFinder.cpp | 222 +- clang/lib/ASTMatchers/ASTMatchersInternal.cpp | 1 + clang/lib/ASTMatchers/Dynamic/Marshallers.cpp | 2 +- clang/lib/ASTMatchers/Dynamic/Marshallers.h | 10 +- clang/lib/ASTMatchers/Dynamic/Parser.cpp | 8 +- clang/lib/ASTMatchers/Dynamic/Registry.cpp | 7 +- clang/lib/Analysis/AnalysisDeclContext.cpp | 2 +- clang/lib/Analysis/BodyFarm.cpp | 57 +- clang/lib/Analysis/CFG.cpp | 122 +- clang/lib/Analysis/CalledOnceCheck.cpp | 4 +- clang/lib/Analysis/ExprMutationAnalyzer.cpp | 20 +- .../Analysis/FlowSensitive/ControlFlowContext.cpp | 4 +- .../FlowSensitive/DataflowAnalysisContext.cpp | 340 + .../Analysis/FlowSensitive/DataflowEnvironment.cpp | 309 +- .../FlowSensitive/Models/ChromiumCheckModel.cpp | 67 + .../Models/UncheckedOptionalAccessModel.cpp | 753 + clang/lib/Analysis/FlowSensitive/Transfer.cpp | 299 +- .../FlowSensitive/TypeErasedDataflowAnalysis.cpp | 203 +- .../FlowSensitive/WatchedLiteralsSolver.cpp | 600 + clang/lib/Analysis/PathDiagnostic.cpp | 8 +- clang/lib/Analysis/ReachableCode.cpp | 4 +- clang/lib/Analysis/RetainSummaryManager.cpp | 2 +- clang/lib/Analysis/ThreadSafety.cpp | 306 +- clang/lib/Analysis/ThreadSafetyCommon.cpp | 37 +- clang/lib/Analysis/UninitializedValues.cpp | 4 +- clang/lib/Basic/Attributes.cpp | 10 +- clang/lib/Basic/BuiltinTargetFeatures.h | 95 + clang/lib/Basic/Builtins.cpp | 74 +- clang/lib/Basic/Cuda.cpp | 9 +- clang/lib/Basic/Diagnostic.cpp | 92 +- clang/lib/Basic/DiagnosticIDs.cpp | 42 +- clang/lib/Basic/FileManager.cpp | 191 +- clang/lib/Basic/IdentifierTable.cpp | 8 +- clang/lib/Basic/LangOptions.cpp | 132 +- clang/lib/Basic/LangStandards.cpp | 45 + clang/lib/Basic/Module.cpp | 5 +- clang/lib/Basic/OpenCLOptions.cpp | 12 +- clang/lib/Basic/OpenMPKinds.cpp | 64 +- clang/lib/Basic/SourceManager.cpp | 22 +- clang/lib/Basic/TargetID.cpp | 6 +- clang/lib/Basic/TargetInfo.cpp | 30 +- clang/lib/Basic/Targets.cpp | 18 + clang/lib/Basic/Targets/AArch64.cpp | 30 +- clang/lib/Basic/Targets/AArch64.h | 2 - clang/lib/Basic/Targets/AMDGPU.cpp | 40 +- clang/lib/Basic/Targets/AMDGPU.h | 7 +- clang/lib/Basic/Targets/ARM.cpp | 1 + clang/lib/Basic/Targets/AVR.cpp | 597 +- clang/lib/Basic/Targets/AVR.h | 12 +- clang/lib/Basic/Targets/CSKY.cpp | 314 + clang/lib/Basic/Targets/CSKY.h | 107 + clang/lib/Basic/Targets/DirectX.cpp | 22 + clang/lib/Basic/Targets/DirectX.h | 93 + clang/lib/Basic/Targets/NVPTX.cpp | 8 +- clang/lib/Basic/Targets/OSTargets.cpp | 52 +- clang/lib/Basic/Targets/OSTargets.h | 62 +- clang/lib/Basic/Targets/PPC.cpp | 35 +- clang/lib/Basic/Targets/PPC.h | 16 +- clang/lib/Basic/Targets/RISCV.cpp | 16 +- clang/lib/Basic/Targets/RISCV.h | 4 + clang/lib/Basic/Targets/SPIR.h | 10 +- clang/lib/Basic/Targets/SystemZ.cpp | 13 +- clang/lib/Basic/Targets/SystemZ.h | 24 + clang/lib/Basic/Targets/VE.cpp | 9 +- clang/lib/Basic/Targets/WebAssembly.cpp | 19 +- clang/lib/Basic/Targets/WebAssembly.h | 1 + clang/lib/Basic/Targets/X86.cpp | 25 +- clang/lib/Basic/Targets/X86.h | 25 +- clang/lib/Basic/TokenKinds.cpp | 9 + clang/lib/CodeGen/ABIInfo.h | 1 + clang/lib/CodeGen/Address.h | 5 - clang/lib/CodeGen/BackendUtil.cpp | 631 +- clang/lib/CodeGen/CGAtomic.cpp | 27 +- clang/lib/CodeGen/CGBlocks.cpp | 80 +- clang/lib/CodeGen/CGBuilder.h | 75 +- clang/lib/CodeGen/CGBuiltin.cpp | 2069 +- clang/lib/CodeGen/CGCUDANV.cpp | 86 +- clang/lib/CodeGen/CGCUDARuntime.h | 13 + clang/lib/CodeGen/CGCXXABI.cpp | 3 +- clang/lib/CodeGen/CGCXXABI.h | 5 +- clang/lib/CodeGen/CGCall.cpp | 240 +- clang/lib/CodeGen/CGClass.cpp | 246 +- clang/lib/CodeGen/CGCleanup.cpp | 30 +- clang/lib/CodeGen/CGCoroutine.cpp | 107 +- clang/lib/CodeGen/CGDebugInfo.cpp | 501 +- clang/lib/CodeGen/CGDebugInfo.h | 44 +- clang/lib/CodeGen/CGDecl.cpp | 73 +- clang/lib/CodeGen/CGDeclCXX.cpp | 14 +- clang/lib/CodeGen/CGException.cpp | 5 +- clang/lib/CodeGen/CGExpr.cpp | 417 +- clang/lib/CodeGen/CGExprCXX.cpp | 24 +- clang/lib/CodeGen/CGExprConstant.cpp | 47 +- clang/lib/CodeGen/CGExprScalar.cpp | 104 +- clang/lib/CodeGen/CGHLSLRuntime.cpp | 52 + clang/lib/CodeGen/CGHLSLRuntime.h | 38 + clang/lib/CodeGen/CGNonTrivialStruct.cpp | 14 +- clang/lib/CodeGen/CGObjC.cpp | 64 +- clang/lib/CodeGen/CGObjCGNU.cpp | 84 +- clang/lib/CodeGen/CGObjCMac.cpp | 69 +- clang/lib/CodeGen/CGObjCRuntime.cpp | 2 +- clang/lib/CodeGen/CGOpenCLRuntime.cpp | 51 +- clang/lib/CodeGen/CGOpenCLRuntime.h | 6 +- clang/lib/CodeGen/CGOpenMPRuntime.cpp | 1030 +- clang/lib/CodeGen/CGOpenMPRuntime.h | 29 +- clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp | 173 +- clang/lib/CodeGen/CGRecordLayout.h | 6 + clang/lib/CodeGen/CGStmt.cpp | 70 +- clang/lib/CodeGen/CGStmtOpenMP.cpp | 1003 +- clang/lib/CodeGen/CGVTT.cpp | 4 +- clang/lib/CodeGen/CGVTables.cpp | 26 +- clang/lib/CodeGen/CodeGenAction.cpp | 38 +- clang/lib/CodeGen/CodeGenFunction.cpp | 198 +- clang/lib/CodeGen/CodeGenFunction.h | 176 +- clang/lib/CodeGen/CodeGenModule.cpp | 689 +- clang/lib/CodeGen/CodeGenModule.h | 120 +- clang/lib/CodeGen/CodeGenPGO.cpp | 2 +- clang/lib/CodeGen/CodeGenTypes.cpp | 59 +- clang/lib/CodeGen/CodeGenTypes.h | 5 +- clang/lib/CodeGen/ConstantInitBuilder.cpp | 2 +- clang/lib/CodeGen/CoverageMappingGen.cpp | 52 +- clang/lib/CodeGen/CoverageMappingGen.h | 20 +- clang/lib/CodeGen/ItaniumCXXABI.cpp | 34 +- clang/lib/CodeGen/MacroPPCallbacks.cpp | 2 +- clang/lib/CodeGen/MacroPPCallbacks.h | 6 +- clang/lib/CodeGen/MicrosoftCXXABI.cpp | 25 +- clang/lib/CodeGen/ModuleBuilder.cpp | 12 + .../CodeGen/ObjectFilePCHContainerOperations.cpp | 4 + clang/lib/CodeGen/SanitizerMetadata.cpp | 121 +- clang/lib/CodeGen/SanitizerMetadata.h | 21 +- clang/lib/CodeGen/TargetInfo.cpp | 595 +- clang/lib/CodeGen/TargetInfo.h | 2 +- clang/lib/CrossTU/CrossTranslationUnit.cpp | 114 +- clang/lib/DirectoryWatcher/DirectoryScanner.cpp | 2 +- clang/lib/Driver/Action.cpp | 30 +- clang/lib/Driver/Compilation.cpp | 11 +- clang/lib/Driver/Distro.cpp | 3 + clang/lib/Driver/Driver.cpp | 814 +- clang/lib/Driver/SanitizerArgs.cpp | 116 +- clang/lib/Driver/ToolChain.cpp | 53 +- clang/lib/Driver/ToolChains/AIX.cpp | 11 +- clang/lib/Driver/ToolChains/AMDGPU.cpp | 71 +- clang/lib/Driver/ToolChains/AMDGPU.h | 3 +- clang/lib/Driver/ToolChains/AMDGPUOpenMP.cpp | 20 +- clang/lib/Driver/ToolChains/AVR.cpp | 154 +- clang/lib/Driver/ToolChains/AVR.h | 17 +- clang/lib/Driver/ToolChains/Ananas.cpp | 14 +- clang/lib/Driver/ToolChains/Arch/AArch64.cpp | 177 +- clang/lib/Driver/ToolChains/Arch/AArch64.h | 1 - clang/lib/Driver/ToolChains/Arch/ARM.cpp | 54 +- clang/lib/Driver/ToolChains/Arch/ARM.h | 1 - clang/lib/Driver/ToolChains/Arch/CSKY.cpp | 170 + clang/lib/Driver/ToolChains/Arch/CSKY.h | 47 + clang/lib/Driver/ToolChains/Arch/RISCV.cpp | 2 +- clang/lib/Driver/ToolChains/Arch/VE.h | 2 +- clang/lib/Driver/ToolChains/Arch/X86.cpp | 26 +- clang/lib/Driver/ToolChains/CSKYToolChain.cpp | 204 + clang/lib/Driver/ToolChains/CSKYToolChain.h | 63 + clang/lib/Driver/ToolChains/Clang.cpp | 952 +- clang/lib/Driver/ToolChains/Clang.h | 13 + clang/lib/Driver/ToolChains/CommonArgs.cpp | 229 +- clang/lib/Driver/ToolChains/CommonArgs.h | 20 +- clang/lib/Driver/ToolChains/Cuda.cpp | 99 +- clang/lib/Driver/ToolChains/Cuda.h | 4 + clang/lib/Driver/ToolChains/Darwin.cpp | 404 +- clang/lib/Driver/ToolChains/Darwin.h | 31 +- clang/lib/Driver/ToolChains/DragonFly.cpp | 9 +- clang/lib/Driver/ToolChains/Flang.cpp | 55 +- clang/lib/Driver/ToolChains/FreeBSD.cpp | 2 + clang/lib/Driver/ToolChains/Fuchsia.cpp | 26 +- clang/lib/Driver/ToolChains/Fuchsia.h | 25 +- clang/lib/Driver/ToolChains/Gnu.cpp | 221 +- clang/lib/Driver/ToolChains/HIPAMD.cpp | 60 +- clang/lib/Driver/ToolChains/HIPAMD.h | 4 + clang/lib/Driver/ToolChains/HIPUtility.cpp | 12 +- clang/lib/Driver/ToolChains/HLSL.cpp | 183 + clang/lib/Driver/ToolChains/HLSL.h | 40 + clang/lib/Driver/ToolChains/Hexagon.cpp | 41 +- clang/lib/Driver/ToolChains/Hexagon.h | 3 - clang/lib/Driver/ToolChains/Lanai.h | 2 - clang/lib/Driver/ToolChains/Linux.cpp | 111 +- clang/lib/Driver/ToolChains/Linux.h | 2 + clang/lib/Driver/ToolChains/MSP430.cpp | 2 +- clang/lib/Driver/ToolChains/MSVC.cpp | 819 +- clang/lib/Driver/ToolChains/MSVC.h | 31 +- clang/lib/Driver/ToolChains/MSVCSetupApi.h | 523 - clang/lib/Driver/ToolChains/MinGW.cpp | 16 +- clang/lib/Driver/ToolChains/MinGW.h | 2 + clang/lib/Driver/ToolChains/Minix.cpp | 9 +- clang/lib/Driver/ToolChains/NetBSD.cpp | 9 +- clang/lib/Driver/ToolChains/OpenBSD.cpp | 49 +- clang/lib/Driver/ToolChains/OpenBSD.h | 2 + clang/lib/Driver/ToolChains/PPCLinux.cpp | 6 +- clang/lib/Driver/ToolChains/PS4CPU.cpp | 188 +- clang/lib/Driver/ToolChains/PS4CPU.h | 115 +- clang/lib/Driver/ToolChains/RISCVToolchain.cpp | 7 + clang/lib/Driver/ToolChains/RISCVToolchain.h | 1 - clang/lib/Driver/ToolChains/ROCm.h | 38 +- clang/lib/Driver/ToolChains/SPIRV.h | 3 +- clang/lib/Driver/ToolChains/Solaris.cpp | 33 +- clang/lib/Driver/ToolChains/VEToolchain.h | 1 - clang/lib/Driver/ToolChains/WebAssembly.cpp | 110 +- clang/lib/Driver/ToolChains/WebAssembly.h | 9 + clang/lib/Driver/ToolChains/ZOS.h | 2 + clang/lib/Driver/Types.cpp | 41 +- clang/lib/Edit/RewriteObjCFoundationAPI.cpp | 6 +- clang/lib/ExtractAPI/API.cpp | 233 + clang/lib/ExtractAPI/DeclarationFragments.cpp | 799 + clang/lib/ExtractAPI/ExtractAPIConsumer.cpp | 974 + .../ExtractAPI/Serialization/SerializerBase.cpp | 19 + .../Serialization/SymbolGraphSerializer.cpp | 708 + .../ExtractAPI/TypedefUnderlyingTypeResolver.cpp | 79 + .../lib/ExtractAPI/TypedefUnderlyingTypeResolver.h | 46 + clang/lib/Format/AffectedRangeManager.cpp | 6 +- clang/lib/Format/BreakableToken.cpp | 117 +- clang/lib/Format/ContinuationIndenter.cpp | 844 +- clang/lib/Format/ContinuationIndenter.h | 6 - clang/lib/Format/DefinitionBlockSeparator.cpp | 77 +- clang/lib/Format/Format.cpp | 456 +- clang/lib/Format/FormatToken.cpp | 32 +- clang/lib/Format/FormatToken.h | 626 +- clang/lib/Format/FormatTokenLexer.cpp | 277 +- clang/lib/Format/FormatTokenLexer.h | 7 + clang/lib/Format/MacroExpander.cpp | 3 +- clang/lib/Format/NamespaceEndCommentsFixer.cpp | 119 +- clang/lib/Format/QualifierAlignmentFixer.cpp | 145 +- clang/lib/Format/SortJavaScriptImports.cpp | 26 +- clang/lib/Format/TokenAnalyzer.cpp | 3 +- clang/lib/Format/TokenAnnotator.cpp | 1631 +- clang/lib/Format/TokenAnnotator.h | 37 +- clang/lib/Format/UnwrappedLineFormatter.cpp | 450 +- clang/lib/Format/UnwrappedLineParser.cpp | 1552 +- clang/lib/Format/UnwrappedLineParser.h | 42 +- clang/lib/Format/WhitespaceManager.cpp | 277 +- clang/lib/Format/WhitespaceManager.h | 20 +- clang/lib/Frontend/ASTUnit.cpp | 16 +- clang/lib/Frontend/CompilerInstance.cpp | 23 +- clang/lib/Frontend/CompilerInvocation.cpp | 534 +- .../Frontend/CreateInvocationFromCommandLine.cpp | 29 +- clang/lib/Frontend/DependencyFile.cpp | 35 +- clang/lib/Frontend/DependencyGraph.cpp | 26 +- clang/lib/Frontend/ExtractAPIConsumer.cpp | 32 - clang/lib/Frontend/FrontendAction.cpp | 81 +- clang/lib/Frontend/FrontendActions.cpp | 137 +- clang/lib/Frontend/FrontendOptions.cpp | 2 +- clang/lib/Frontend/InitPreprocessor.cpp | 70 +- clang/lib/Frontend/LogDiagnosticPrinter.cpp | 6 +- clang/lib/Frontend/ModuleDependencyCollector.cpp | 6 +- clang/lib/Frontend/MultiplexConsumer.cpp | 6 + clang/lib/Frontend/PrecompiledPreamble.cpp | 353 +- clang/lib/Frontend/PrintPreprocessedOutput.cpp | 44 +- clang/lib/Frontend/Rewrite/InclusionRewriter.cpp | 8 +- clang/lib/Frontend/Rewrite/RewriteModernObjC.cpp | 20 +- clang/lib/Frontend/Rewrite/RewriteObjC.cpp | 2 +- clang/lib/Frontend/TextDiagnostic.cpp | 3 +- .../lib/FrontendTool/ExecuteCompilerInvocation.cpp | 3 + clang/lib/Headers/__clang_cuda_intrinsics.h | 6 +- clang/lib/Headers/__wmmintrin_pclmul.h | 20 +- clang/lib/Headers/altivec.h | 735 +- clang/lib/Headers/amxintrin.h | 2 - clang/lib/Headers/avx2intrin.h | 16 +- clang/lib/Headers/avx512bwintrin.h | 24 +- clang/lib/Headers/avx512fintrin.h | 149 +- clang/lib/Headers/avx512vlbf16intrin.h | 2 +- clang/lib/Headers/avx512vlbwintrin.h | 16 +- clang/lib/Headers/avx512vlintrin.h | 176 +- clang/lib/Headers/avx512vlvnniintrin.h | 32 +- clang/lib/Headers/avxintrin.h | 95 +- clang/lib/Headers/avxvnniintrin.h | 32 +- clang/lib/Headers/bmiintrin.h | 8 +- clang/lib/Headers/cetintrin.h | 18 +- clang/lib/Headers/emmintrin.h | 1318 +- clang/lib/Headers/f16cintrin.h | 6 +- clang/lib/Headers/hlsl.h | 15 + clang/lib/Headers/hlsl/hlsl_basic_types.h | 64 + clang/lib/Headers/hlsl/hlsl_intrinsics.h | 15 + clang/lib/Headers/hresetintrin.h | 4 +- clang/lib/Headers/ia32intrin.h | 22 +- clang/lib/Headers/immintrin.h | 30 +- clang/lib/Headers/intrin.h | 33 +- clang/lib/Headers/keylockerintrin.h | 44 +- clang/lib/Headers/mm_malloc.h | 6 +- clang/lib/Headers/opencl-c-base.h | 12 + clang/lib/Headers/opencl-c.h | 13826 ++++++------ clang/lib/Headers/pmmintrin.h | 2 +- clang/lib/Headers/ppc_wrappers/bmi2intrin.h | 134 + clang/lib/Headers/ppc_wrappers/bmiintrin.h | 165 + clang/lib/Headers/ppc_wrappers/emmintrin.h | 2918 ++- clang/lib/Headers/ppc_wrappers/immintrin.h | 27 + clang/lib/Headers/ppc_wrappers/mm_malloc.h | 26 +- clang/lib/Headers/ppc_wrappers/mmintrin.h | 769 +- clang/lib/Headers/ppc_wrappers/nmmintrin.h | 26 + clang/lib/Headers/ppc_wrappers/pmmintrin.h | 147 +- clang/lib/Headers/ppc_wrappers/smmintrin.h | 580 +- clang/lib/Headers/ppc_wrappers/tmmintrin.h | 642 +- clang/lib/Headers/ppc_wrappers/x86gprintrin.h | 17 + clang/lib/Headers/ppc_wrappers/x86intrin.h | 28 + clang/lib/Headers/ppc_wrappers/xmmintrin.h | 2064 +- clang/lib/Headers/rdseedintrin.h | 6 +- clang/lib/Headers/rtmintrin.h | 2 +- clang/lib/Headers/smmintrin.h | 491 +- clang/lib/Headers/stdbool.h | 15 +- clang/lib/Headers/stddef.h | 2 +- clang/lib/Headers/stdnoreturn.h | 13 + clang/lib/Headers/uintrintrin.h | 16 +- clang/lib/Headers/unwind.h | 13 +- clang/lib/Headers/velintrin.h | 71 + clang/lib/Headers/velintrin_approx.h | 120 + clang/lib/Headers/velintrin_gen.h | 1257 ++ clang/lib/Headers/wasm_simd128.h | 4 +- clang/lib/Headers/xmmintrin.h | 12 +- clang/lib/Index/IndexBody.cpp | 22 +- clang/lib/Index/IndexDecl.cpp | 68 +- clang/lib/Index/IndexSymbol.cpp | 5 + clang/lib/Index/IndexTypeSourceInfo.cpp | 10 + clang/lib/Index/IndexingContext.cpp | 10 +- clang/lib/Index/USRGeneration.cpp | 31 +- clang/lib/Interpreter/IncrementalExecutor.cpp | 30 +- clang/lib/Interpreter/IncrementalExecutor.h | 15 +- clang/lib/Interpreter/IncrementalParser.cpp | 56 +- clang/lib/Interpreter/IncrementalParser.h | 4 + clang/lib/Interpreter/Interpreter.cpp | 36 +- clang/lib/Lex/DependencyDirectivesScanner.cpp | 862 + .../Lex/DependencyDirectivesSourceMinimizer.cpp | 982 - clang/lib/Lex/HeaderSearch.cpp | 237 +- clang/lib/Lex/InitHeaderSearch.cpp | 13 +- clang/lib/Lex/Lexer.cpp | 381 +- clang/lib/Lex/LiteralSupport.cpp | 241 +- clang/lib/Lex/MacroInfo.cpp | 34 +- clang/lib/Lex/ModuleMap.cpp | 48 +- clang/lib/Lex/PPDirectives.cpp | 445 +- clang/lib/Lex/PPExpressions.cpp | 19 +- clang/lib/Lex/PPLexerChange.cpp | 109 +- clang/lib/Lex/PPMacroExpansion.cpp | 127 +- clang/lib/Lex/Pragma.cpp | 102 +- clang/lib/Lex/PreprocessingRecord.cpp | 7 +- clang/lib/Lex/Preprocessor.cpp | 38 +- clang/lib/Lex/PreprocessorLexer.cpp | 5 +- clang/lib/Lex/TokenLexer.cpp | 2 +- clang/lib/Parse/ParseAST.cpp | 8 +- clang/lib/Parse/ParseCXXInlineMethods.cpp | 13 +- clang/lib/Parse/ParseDecl.cpp | 508 +- clang/lib/Parse/ParseDeclCXX.cpp | 245 +- clang/lib/Parse/ParseExpr.cpp | 112 +- clang/lib/Parse/ParseExprCXX.cpp | 48 +- clang/lib/Parse/ParseHLSL.cpp | 42 + clang/lib/Parse/ParseObjc.cpp | 63 +- clang/lib/Parse/ParseOpenMP.cpp | 164 +- clang/lib/Parse/ParsePragma.cpp | 343 +- clang/lib/Parse/ParseStmt.cpp | 181 +- clang/lib/Parse/ParseTemplate.cpp | 54 +- clang/lib/Parse/Parser.cpp | 328 +- clang/lib/Sema/AnalysisBasedWarnings.cpp | 9 +- clang/lib/Sema/CodeCompleteConsumer.cpp | 12 +- clang/lib/Sema/IdentifierResolver.cpp | 6 +- clang/lib/Sema/OpenCLBuiltins.td | 500 +- clang/lib/Sema/ParsedAttr.cpp | 64 + clang/lib/Sema/Sema.cpp | 68 +- clang/lib/Sema/SemaAccess.cpp | 35 +- clang/lib/Sema/SemaAttr.cpp | 265 +- clang/lib/Sema/SemaAvailability.cpp | 2 +- clang/lib/Sema/SemaCUDA.cpp | 51 +- clang/lib/Sema/SemaCXXScopeSpec.cpp | 15 +- clang/lib/Sema/SemaCast.cpp | 21 +- clang/lib/Sema/SemaChecking.cpp | 749 +- clang/lib/Sema/SemaCodeComplete.cpp | 36 +- clang/lib/Sema/SemaConcept.cpp | 89 +- clang/lib/Sema/SemaCoroutine.cpp | 323 +- clang/lib/Sema/SemaDecl.cpp | 954 +- clang/lib/Sema/SemaDeclAttr.cpp | 574 +- clang/lib/Sema/SemaDeclCXX.cpp | 297 +- clang/lib/Sema/SemaDeclObjC.cpp | 53 +- clang/lib/Sema/SemaExceptionSpec.cpp | 17 +- clang/lib/Sema/SemaExpr.cpp | 1044 +- clang/lib/Sema/SemaExprCXX.cpp | 272 +- clang/lib/Sema/SemaExprMember.cpp | 30 +- clang/lib/Sema/SemaExprObjC.cpp | 8 +- clang/lib/Sema/SemaInit.cpp | 97 +- clang/lib/Sema/SemaLambda.cpp | 35 +- clang/lib/Sema/SemaLookup.cpp | 426 +- clang/lib/Sema/SemaModule.cpp | 327 +- clang/lib/Sema/SemaOpenMP.cpp | 2381 ++- clang/lib/Sema/SemaOverload.cpp | 488 +- clang/lib/Sema/SemaStmt.cpp | 51 +- clang/lib/Sema/SemaStmtAsm.cpp | 27 +- clang/lib/Sema/SemaStmtAttr.cpp | 78 +- clang/lib/Sema/SemaTemplate.cpp | 119 +- clang/lib/Sema/SemaTemplateDeduction.cpp | 51 +- clang/lib/Sema/SemaTemplateInstantiate.cpp | 99 +- clang/lib/Sema/SemaTemplateInstantiateDecl.cpp | 198 +- clang/lib/Sema/SemaTemplateVariadic.cpp | 28 +- clang/lib/Sema/SemaType.cpp | 400 +- clang/lib/Sema/TreeTransform.h | 297 +- clang/lib/Serialization/ASTCommon.cpp | 5 +- clang/lib/Serialization/ASTReader.cpp | 1212 +- clang/lib/Serialization/ASTReaderDecl.cpp | 102 +- clang/lib/Serialization/ASTReaderStmt.cpp | 156 +- clang/lib/Serialization/ASTWriter.cpp | 461 +- clang/lib/Serialization/ASTWriterDecl.cpp | 74 +- clang/lib/Serialization/ASTWriterStmt.cpp | 67 +- clang/lib/Serialization/GlobalModuleIndex.cpp | 2 +- .../StaticAnalyzer/Checkers/ArrayBoundChecker.cpp | 4 +- .../Checkers/ArrayBoundCheckerV2.cpp | 19 +- .../Checkers/BasicObjCFoundationChecks.cpp | 12 +- .../Checkers/BoolAssignmentChecker.cpp | 16 +- .../lib/StaticAnalyzer/Checkers/CStringChecker.cpp | 80 +- .../Checkers/CallAndMessageChecker.cpp | 2 +- .../StaticAnalyzer/Checkers/CastValueChecker.cpp | 14 +- .../StaticAnalyzer/Checkers/CheckObjCDealloc.cpp | 4 +- .../Checkers/CheckObjCInstMethSignature.cpp | 8 +- .../Checkers/CheckSecuritySyntaxOnly.cpp | 30 +- clang/lib/StaticAnalyzer/Checkers/CloneChecker.cpp | 2 +- .../StaticAnalyzer/Checkers/DeadStoresChecker.cpp | 7 +- .../StaticAnalyzer/Checkers/DereferenceChecker.cpp | 51 +- .../lib/StaticAnalyzer/Checkers/DivZeroChecker.cpp | 2 +- .../Checkers/DynamicTypePropagation.cpp | 5 +- clang/lib/StaticAnalyzer/Checkers/ErrnoChecker.cpp | 249 + .../lib/StaticAnalyzer/Checkers/ErrnoModeling.cpp | 288 + clang/lib/StaticAnalyzer/Checkers/ErrnoModeling.h | 78 + .../StaticAnalyzer/Checkers/ErrnoTesterChecker.cpp | 184 + .../Checkers/ExprInspectionChecker.cpp | 23 +- .../Checkers/FuchsiaHandleChecker.cpp | 6 +- clang/lib/StaticAnalyzer/Checkers/GTestChecker.cpp | 19 +- .../Checkers/GenericTaintChecker.cpp | 185 +- .../Checkers/InnerPointerChecker.cpp | 15 +- clang/lib/StaticAnalyzer/Checkers/Iterator.cpp | 4 +- clang/lib/StaticAnalyzer/Checkers/Iterator.h | 8 +- .../StaticAnalyzer/Checkers/IteratorModeling.cpp | 8 +- .../Checkers/IvarInvalidationChecker.cpp | 4 +- .../Checkers/LLVMConventionsChecker.cpp | 2 +- .../Checkers/LocalizationChecker.cpp | 8 +- .../Checkers/MPI-Checker/MPIChecker.cpp | 2 +- .../lib/StaticAnalyzer/Checkers/MallocChecker.cpp | 150 +- .../Checkers/MallocSizeofChecker.cpp | 6 +- .../Checkers/MmapWriteExecChecker.cpp | 4 +- clang/lib/StaticAnalyzer/Checkers/MoveChecker.cpp | 1 - .../lib/StaticAnalyzer/Checkers/NSErrorChecker.cpp | 6 +- .../Checkers/NonNullParamChecker.cpp | 6 +- .../StaticAnalyzer/Checkers/NullabilityChecker.cpp | 6 +- .../Checkers/NumberObjectConversionChecker.cpp | 2 +- .../StaticAnalyzer/Checkers/ObjCAtSyncChecker.cpp | 2 +- .../Checkers/ObjCAutoreleaseWriteChecker.cpp | 6 +- .../Checkers/ObjCContainersASTChecker.cpp | 6 +- .../Checkers/ObjCContainersChecker.cpp | 7 +- .../Checkers/ObjCSelfInitChecker.cpp | 22 +- .../lib/StaticAnalyzer/Checkers/PaddingChecker.cpp | 6 +- .../StaticAnalyzer/Checkers/PthreadLockChecker.cpp | 2 +- .../RetainCountChecker/RetainCountChecker.cpp | 5 +- .../RetainCountChecker/RetainCountDiagnostics.cpp | 9 +- .../Checkers/ReturnPointerRangeChecker.cpp | 4 +- .../Checkers/STLAlgorithmModeling.cpp | 4 +- .../Checkers/SimpleStreamChecker.cpp | 14 - .../StaticAnalyzer/Checkers/SmartPtrModeling.cpp | 34 +- .../Checkers/StackAddrEscapeChecker.cpp | 2 +- .../Checkers/StdLibraryFunctionsChecker.cpp | 679 +- .../lib/StaticAnalyzer/Checkers/StreamChecker.cpp | 30 +- .../lib/StaticAnalyzer/Checkers/StringChecker.cpp | 2 +- clang/lib/StaticAnalyzer/Checkers/Taint.cpp | 6 +- clang/lib/StaticAnalyzer/Checkers/Taint.h | 106 - .../StaticAnalyzer/Checkers/TaintTesterChecker.cpp | 21 +- .../Checkers/TrustReturnsNonnullChecker.cpp | 60 + .../StaticAnalyzer/Checkers/UndefResultChecker.cpp | 9 +- .../UninitializedObjectChecker.cpp | 2 +- .../UninitializedObject/UninitializedPointee.cpp | 8 +- .../lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp | 8 +- .../lib/StaticAnalyzer/Checkers/VLASizeChecker.cpp | 7 +- .../lib/StaticAnalyzer/Checkers/ValistChecker.cpp | 4 +- .../Checkers/cert/InvalidPtrChecker.cpp | 16 +- clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp | 17 +- clang/lib/StaticAnalyzer/Core/BugReporter.cpp | 2 +- .../StaticAnalyzer/Core/BugReporterVisitors.cpp | 78 +- clang/lib/StaticAnalyzer/Core/CallDescription.cpp | 44 +- clang/lib/StaticAnalyzer/Core/CallEvent.cpp | 34 +- clang/lib/StaticAnalyzer/Core/CheckerContext.cpp | 29 +- .../lib/StaticAnalyzer/Core/ConstraintManager.cpp | 80 + clang/lib/StaticAnalyzer/Core/CoreEngine.cpp | 71 +- clang/lib/StaticAnalyzer/Core/DynamicType.cpp | 8 +- clang/lib/StaticAnalyzer/Core/Environment.cpp | 2 +- clang/lib/StaticAnalyzer/Core/ExprEngine.cpp | 253 +- clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp | 21 +- clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp | 24 +- .../Core/ExprEngineCallAndReturn.cpp | 73 +- clang/lib/StaticAnalyzer/Core/LoopUnrolling.cpp | 4 +- clang/lib/StaticAnalyzer/Core/MemRegion.cpp | 51 +- clang/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp | 2 +- clang/lib/StaticAnalyzer/Core/ProgramState.cpp | 37 +- .../StaticAnalyzer/Core/RangeConstraintManager.cpp | 243 +- .../Core/RangedConstraintManager.cpp | 71 +- clang/lib/StaticAnalyzer/Core/RegionStore.cpp | 152 +- clang/lib/StaticAnalyzer/Core/SValBuilder.cpp | 93 +- clang/lib/StaticAnalyzer/Core/SVals.cpp | 67 +- clang/lib/StaticAnalyzer/Core/SarifDiagnostics.cpp | 15 +- .../Core/SimpleConstraintManager.cpp | 14 +- .../lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp | 173 +- clang/lib/StaticAnalyzer/Core/Store.cpp | 8 +- clang/lib/StaticAnalyzer/Core/SymbolManager.cpp | 43 +- clang/lib/StaticAnalyzer/Core/TextDiagnostics.cpp | 2 +- clang/lib/StaticAnalyzer/Core/WorkList.cpp | 16 +- .../StaticAnalyzer/Frontend/AnalysisConsumer.cpp | 63 +- .../StaticAnalyzer/Frontend/AnalyzerHelpFlags.cpp | 5 +- .../StaticAnalyzer/Frontend/CheckerRegistry.cpp | 4 +- clang/lib/Support/RISCVVIntrinsicUtils.cpp | 955 + clang/lib/Testing/CommandLineArgs.cpp | 42 + clang/lib/Testing/TestAST.cpp | 162 + clang/lib/Tooling/Core/Replacement.cpp | 4 +- .../DependencyScanningFilesystem.cpp | 124 +- .../DependencyScanningService.cpp | 4 +- .../DependencyScanning/DependencyScanningTool.cpp | 55 +- .../DependencyScanningWorker.cpp | 112 +- .../DependencyScanning/ModuleDepCollector.cpp | 129 +- clang/lib/Tooling/Inclusions/HeaderIncludes.cpp | 3 +- clang/lib/Tooling/Inclusions/StandardLibrary.cpp | 165 + .../Tooling/InterpolatingCompilationDatabase.cpp | 2 +- .../Refactoring/Rename/USRFindingAction.cpp | 6 +- clang/lib/Tooling/Syntax/BuildTree.cpp | 4 +- clang/lib/Tooling/Transformer/RewriteRule.cpp | 53 +- clang/lib/Tooling/Transformer/Stencil.cpp | 2 +- clang/lib/Tooling/Transformer/Transformer.cpp | 58 +- clang/tools/clang-format/ClangFormat.cpp | 56 +- clang/tools/clang-repl/ClangRepl.cpp | 30 +- clang/tools/driver/cc1_main.cpp | 3 +- clang/tools/driver/cc1as_main.cpp | 28 +- clang/tools/driver/driver.cpp | 64 +- clang/utils/TableGen/ClangAttrEmitter.cpp | 437 +- clang/utils/TableGen/ClangDiagnosticsEmitter.cpp | 16 +- clang/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp | 108 +- clang/utils/TableGen/ClangOptionDocEmitter.cpp | 28 +- clang/utils/TableGen/ClangSACheckersEmitter.cpp | 41 +- clang/utils/TableGen/MveEmitter.cpp | 19 +- clang/utils/TableGen/NeonEmitter.cpp | 23 +- clang/utils/TableGen/RISCVVEmitter.cpp | 1069 +- compiler-rt/include/orc/c_api.h | 205 + compiler-rt/include/profile/InstrProfData.inc | 4 +- compiler-rt/include/profile/MIBEntryDef.inc | 47 + compiler-rt/include/profile/MemProfData.inc | 139 +- compiler-rt/lib/asan/asan_allocator.cpp | 17 +- compiler-rt/lib/asan/asan_errors.cpp | 4 +- compiler-rt/lib/asan/asan_errors.h | 6 +- compiler-rt/lib/asan/asan_fake_stack.cpp | 2 - compiler-rt/lib/asan/asan_flags.cpp | 2 +- compiler-rt/lib/asan/asan_flags.inc | 11 +- compiler-rt/lib/asan/asan_fuchsia.cpp | 21 +- compiler-rt/lib/asan/asan_globals.cpp | 29 +- compiler-rt/lib/asan/asan_interceptors.cpp | 12 +- compiler-rt/lib/asan/asan_interceptors.h | 4 +- compiler-rt/lib/asan/asan_interface_internal.h | 5 +- compiler-rt/lib/asan/asan_internal.h | 38 +- compiler-rt/lib/asan/asan_linux.cpp | 30 +- compiler-rt/lib/asan/asan_mac.cpp | 4 +- compiler-rt/lib/asan/asan_malloc_mac.cpp | 2 +- compiler-rt/lib/asan/asan_mapping.h | 6 +- compiler-rt/lib/asan/asan_new_delete.cpp | 12 +- compiler-rt/lib/asan/asan_poisoning.cpp | 4 +- compiler-rt/lib/asan/asan_posix.cpp | 47 +- compiler-rt/lib/asan/asan_report.cpp | 6 +- compiler-rt/lib/asan/asan_rtl.cpp | 38 +- compiler-rt/lib/asan/asan_rtl_static.cpp | 21 + compiler-rt/lib/asan/asan_rtl_x86_64.S | 10 +- compiler-rt/lib/asan/asan_thread.cpp | 4 +- compiler-rt/lib/asan/asan_win.cpp | 38 +- compiler-rt/lib/builtins/aarch64/fp_mode.c | 4 +- compiler-rt/lib/builtins/arm/fp_mode.c | 4 +- compiler-rt/lib/builtins/arm/sync-ops.h | 22 +- compiler-rt/lib/builtins/atomic.c | 5 + compiler-rt/lib/builtins/avr/divmodhi4.S | 57 + compiler-rt/lib/builtins/avr/divmodqi4.S | 44 + compiler-rt/lib/builtins/avr/exit.S | 18 + compiler-rt/lib/builtins/avr/mulhi3.S | 71 + compiler-rt/lib/builtins/avr/mulqi3.S | 53 + compiler-rt/lib/builtins/avr/udivmodhi4.S | 49 + compiler-rt/lib/builtins/avr/udivmodqi4.S | 39 + compiler-rt/lib/builtins/clear_cache.c | 9 +- compiler-rt/lib/builtins/cpu_model.c | 43 +- compiler-rt/lib/builtins/emutls.c | 12 +- compiler-rt/lib/builtins/fp_compare_impl.inc | 3 + compiler-rt/lib/builtins/fp_mode.c | 4 +- compiler-rt/lib/builtins/fp_trunc.h | 6 + compiler-rt/lib/builtins/gcc_personality_v0.c | 2 +- compiler-rt/lib/builtins/i386/fp_mode.c | 4 +- compiler-rt/lib/builtins/int_endianness.h | 2 +- compiler-rt/lib/builtins/os_version_check.c | 4 +- compiler-rt/lib/builtins/truncdfbf2.c | 13 + compiler-rt/lib/builtins/truncsfbf2.c | 13 + compiler-rt/lib/crt/crtbegin.c | 4 +- compiler-rt/lib/dfsan/dfsan.cpp | 27 +- compiler-rt/lib/dfsan/dfsan.h | 6 + compiler-rt/lib/dfsan/dfsan_custom.cpp | 213 +- compiler-rt/lib/dfsan/dfsan_thread.cpp | 28 +- compiler-rt/lib/dfsan/dfsan_thread.h | 4 +- compiler-rt/lib/fuzzer/FuzzerInternal.h | 5 +- compiler-rt/lib/fuzzer/FuzzerLoop.cpp | 24 +- compiler-rt/lib/fuzzer/FuzzerTracePC.cpp | 9 +- compiler-rt/lib/hwasan/hwasan.cpp | 1 + compiler-rt/lib/hwasan/hwasan.h | 15 - compiler-rt/lib/hwasan/hwasan_allocator.cpp | 4 +- compiler-rt/lib/hwasan/hwasan_fuchsia.cpp | 20 +- compiler-rt/lib/hwasan/hwasan_new_delete.cpp | 63 +- compiler-rt/lib/hwasan/hwasan_preinit.cpp | 23 + compiler-rt/lib/interception/interception.h | 18 +- compiler-rt/lib/interception/interception_mac.cpp | 4 +- compiler-rt/lib/interception/interception_mac.h | 4 +- .../lib/interception/interception_type_test.cpp | 4 +- compiler-rt/lib/interception/interception_win.cpp | 2 +- compiler-rt/lib/lsan/lsan.cpp | 9 +- compiler-rt/lib/lsan/lsan.h | 1 + compiler-rt/lib/lsan/lsan_allocator.cpp | 16 +- compiler-rt/lib/lsan/lsan_allocator.h | 10 +- compiler-rt/lib/lsan/lsan_common.cpp | 25 +- compiler-rt/lib/lsan/lsan_common.h | 4 +- compiler-rt/lib/lsan/lsan_common_fuchsia.cpp | 9 + compiler-rt/lib/lsan/lsan_common_mac.cpp | 4 +- compiler-rt/lib/lsan/lsan_fuchsia.cpp | 7 + compiler-rt/lib/lsan/lsan_interceptors.cpp | 10 +- compiler-rt/lib/lsan/lsan_mac.cpp | 4 +- compiler-rt/lib/lsan/lsan_malloc_mac.cpp | 4 +- compiler-rt/lib/lsan/lsan_posix.cpp | 5 + compiler-rt/lib/memprof/memprof_allocator.cpp | 55 +- compiler-rt/lib/memprof/memprof_internal.h | 15 - compiler-rt/lib/memprof/memprof_rtl.cpp | 2 + compiler-rt/lib/memprof/tests/rawprofile.cpp | 4 +- compiler-rt/lib/msan/msan.cpp | 33 +- compiler-rt/lib/msan/msan.h | 26 +- compiler-rt/lib/msan/msan_allocator.cpp | 7 +- compiler-rt/lib/msan/msan_flags.inc | 2 +- compiler-rt/lib/msan/msan_interceptors.cpp | 43 +- compiler-rt/lib/orc/adt.h | 19 +- compiler-rt/lib/orc/c_api.h | 208 - compiler-rt/lib/orc/common.h | 2 +- compiler-rt/lib/orc/dlfcn_wrapper.cpp | 52 + compiler-rt/lib/orc/elfnix_platform.cpp | 47 +- compiler-rt/lib/orc/elfnix_platform.h | 2 +- compiler-rt/lib/orc/executor_address.h | 11 + compiler-rt/lib/orc/macho_ehframe_registration.cpp | 2 +- compiler-rt/lib/orc/macho_platform.cpp | 914 +- compiler-rt/lib/orc/macho_platform.h | 59 - compiler-rt/lib/orc/wrapper_function_utils.h | 2 +- compiler-rt/lib/profile/GCDAProfiling.c | 14 +- compiler-rt/lib/profile/InstrProfiling.c | 2 +- compiler-rt/lib/profile/InstrProfilingFile.c | 18 +- compiler-rt/lib/profile/InstrProfilingInternal.c | 2 +- compiler-rt/lib/profile/InstrProfilingMerge.c | 2 +- .../lib/profile/InstrProfilingPlatformFuchsia.c | 2 +- .../lib/profile/InstrProfilingPlatformLinux.c | 44 +- .../lib/profile/InstrProfilingPlatformOther.c | 4 +- compiler-rt/lib/profile/InstrProfilingUtil.c | 6 +- compiler-rt/lib/profile/InstrProfilingValue.c | 4 +- compiler-rt/lib/safestack/safestack_platform.h | 2 +- .../sanitizer_allocator_report.cpp | 3 +- .../lib/sanitizer_common/sanitizer_atomic_clang.h | 4 +- .../sanitizer_chained_origin_depot.cpp | 2 + .../sanitizer_chained_origin_depot.h | 1 + .../lib/sanitizer_common/sanitizer_common.cpp | 50 +- .../lib/sanitizer_common/sanitizer_common.h | 35 +- .../sanitizer_common_interceptors.inc | 251 +- .../sanitizer_common_interceptors_ioctl.inc | 10 +- .../sanitizer_common/sanitizer_common_libcdep.cpp | 5 + .../sanitizer_common/sanitizer_common_nolibc.cpp | 2 +- .../sanitizer_coverage_fuchsia.cpp | 1 + .../sanitizer_coverage_libcdep_new.cpp | 20 +- compiler-rt/lib/sanitizer_common/sanitizer_errno.h | 2 +- .../lib/sanitizer_common/sanitizer_file.cpp | 9 +- compiler-rt/lib/sanitizer_common/sanitizer_file.h | 2 +- .../lib/sanitizer_common/sanitizer_flags.inc | 6 +- .../lib/sanitizer_common/sanitizer_fuchsia.cpp | 54 +- .../sanitizer_interface_internal.h | 178 +- .../lib/sanitizer_common/sanitizer_internal_defs.h | 11 +- .../lib/sanitizer_common/sanitizer_libignore.cpp | 4 +- .../lib/sanitizer_common/sanitizer_linux.cpp | 202 +- compiler-rt/lib/sanitizer_common/sanitizer_linux.h | 1 + .../sanitizer_common/sanitizer_linux_libcdep.cpp | 39 +- compiler-rt/lib/sanitizer_common/sanitizer_mac.cpp | 37 +- compiler-rt/lib/sanitizer_common/sanitizer_mac.h | 10 +- .../lib/sanitizer_common/sanitizer_mac_libcdep.cpp | 4 +- .../lib/sanitizer_common/sanitizer_malloc_mac.inc | 2 +- compiler-rt/lib/sanitizer_common/sanitizer_mutex.h | 16 +- .../lib/sanitizer_common/sanitizer_openbsd.cpp | 0 .../lib/sanitizer_common/sanitizer_platform.h | 93 +- .../sanitizer_platform_interceptors.h | 14 +- .../sanitizer_platform_limits_freebsd.cpp | 4 + .../sanitizer_platform_limits_freebsd.h | 37 + .../sanitizer_platform_limits_linux.cpp | 6 - .../sanitizer_platform_limits_posix.cpp | 53 +- .../sanitizer_platform_limits_posix.h | 59 +- .../lib/sanitizer_common/sanitizer_posix.cpp | 7 +- .../sanitizer_common/sanitizer_posix_libcdep.cpp | 4 +- .../lib/sanitizer_common/sanitizer_procmaps.h | 2 +- .../sanitizer_common/sanitizer_procmaps_mac.cpp | 80 +- .../lib/sanitizer_common/sanitizer_ring_buffer.h | 13 +- .../lib/sanitizer_common/sanitizer_stackdepot.cpp | 14 +- .../lib/sanitizer_common/sanitizer_stacktrace.cpp | 11 +- .../lib/sanitizer_common/sanitizer_stacktrace.h | 9 +- .../sanitizer_stacktrace_libcdep.cpp | 13 +- .../sanitizer_stoptheworld_mac.cpp | 4 +- .../sanitizer_symbolizer_internal.h | 6 +- .../sanitizer_symbolizer_libcdep.cpp | 59 +- .../sanitizer_common/sanitizer_symbolizer_mac.cpp | 4 +- .../sanitizer_common/sanitizer_symbolizer_mac.h | 4 +- .../sanitizer_symbolizer_posix_libcdep.cpp | 36 +- .../sanitizer_symbolizer_report.cpp | 6 +- .../sanitizer_common/sanitizer_syscall_generic.inc | 5 +- .../sanitizer_unwind_linux_libcdep.cpp | 2 +- compiler-rt/lib/sanitizer_common/sanitizer_win.cpp | 22 +- .../symbolizer/sanitizer_symbolize.cpp | 3 +- .../symbolizer/sanitizer_wrappers.cpp | 11 +- .../symbolizer/scripts/ar_to_bc.sh | 39 - .../symbolizer/scripts/build_symbolizer.sh | 40 +- .../symbolizer/scripts/global_symbols.txt | 4 + compiler-rt/lib/scudo/scudo_allocator.cpp | 4 +- compiler-rt/lib/scudo/scudo_crc32.cpp | 4 +- compiler-rt/lib/scudo/scudo_crc32.h | 12 +- compiler-rt/lib/scudo/standalone/checksum.cpp | 1 + compiler-rt/lib/scudo/standalone/checksum.h | 9 +- compiler-rt/lib/scudo/standalone/chunk.h | 5 +- compiler-rt/lib/scudo/standalone/combined.h | 4 +- compiler-rt/lib/scudo/standalone/crc32_hw.cpp | 5 +- compiler-rt/lib/scudo/standalone/fuchsia.cpp | 3 + compiler-rt/lib/scudo/standalone/fuchsia.h | 3 +- compiler-rt/lib/scudo/standalone/memtag.h | 34 +- compiler-rt/lib/scudo/standalone/platform.h | 2 +- compiler-rt/lib/scudo/standalone/primary64.h | 4 +- compiler-rt/lib/scudo/standalone/secondary.h | 20 +- compiler-rt/lib/scudo/standalone/size_class_map.h | 2 +- compiler-rt/lib/scudo/standalone/tsd_exclusive.h | 4 +- compiler-rt/lib/scudo/standalone/wrappers_c.cpp | 2 - compiler-rt/lib/scudo/standalone/wrappers_c.h | 5 + .../lib/scudo/standalone/wrappers_c_checks.h | 7 +- compiler-rt/lib/scudo/standalone/wrappers_cpp.cpp | 18 +- compiler-rt/lib/tsan/go/test.c | 2 +- compiler-rt/lib/tsan/rtl-old/tsan_dispatch_defs.h | 2 +- compiler-rt/lib/tsan/rtl-old/tsan_flags.cpp | 2 +- compiler-rt/lib/tsan/rtl-old/tsan_flags.inc | 4 +- .../tsan/rtl-old/tsan_interceptors_libdispatch.cpp | 4 +- .../lib/tsan/rtl-old/tsan_interceptors_mac.cpp | 4 +- .../lib/tsan/rtl-old/tsan_interceptors_posix.cpp | 78 +- compiler-rt/lib/tsan/rtl-old/tsan_malloc_mac.cpp | 2 +- compiler-rt/lib/tsan/rtl-old/tsan_mman.cpp | 14 - compiler-rt/lib/tsan/rtl-old/tsan_platform.h | 2 +- compiler-rt/lib/tsan/rtl-old/tsan_platform_mac.cpp | 4 +- compiler-rt/lib/tsan/rtl-old/tsan_report.cpp | 2 +- compiler-rt/lib/tsan/rtl-old/tsan_rtl.cpp | 2 +- compiler-rt/lib/tsan/rtl-old/tsan_rtl.h | 6 +- compiler-rt/lib/tsan/rtl-old/tsan_shadow.h | 1 + compiler-rt/lib/tsan/rtl/tsan_defs.h | 1 + compiler-rt/lib/tsan/rtl/tsan_dispatch_defs.h | 2 +- compiler-rt/lib/tsan/rtl/tsan_fd.cpp | 86 +- compiler-rt/lib/tsan/rtl/tsan_fd.h | 1 + compiler-rt/lib/tsan/rtl/tsan_flags.cpp | 2 +- compiler-rt/lib/tsan/rtl/tsan_flags.inc | 7 +- compiler-rt/lib/tsan/rtl/tsan_interceptors.h | 8 + .../lib/tsan/rtl/tsan_interceptors_libdispatch.cpp | 4 +- compiler-rt/lib/tsan/rtl/tsan_interceptors_mac.cpp | 4 +- .../lib/tsan/rtl/tsan_interceptors_posix.cpp | 167 +- compiler-rt/lib/tsan/rtl/tsan_malloc_mac.cpp | 2 +- compiler-rt/lib/tsan/rtl/tsan_mman.cpp | 14 - compiler-rt/lib/tsan/rtl/tsan_platform.h | 2 +- compiler-rt/lib/tsan/rtl/tsan_platform_linux.cpp | 6 +- compiler-rt/lib/tsan/rtl/tsan_platform_mac.cpp | 4 +- compiler-rt/lib/tsan/rtl/tsan_report.cpp | 5 +- compiler-rt/lib/tsan/rtl/tsan_report.h | 1 + compiler-rt/lib/tsan/rtl/tsan_rtl.cpp | 7 +- compiler-rt/lib/tsan/rtl/tsan_rtl.h | 5 +- compiler-rt/lib/tsan/rtl/tsan_rtl_access.cpp | 8 +- compiler-rt/lib/tsan/rtl/tsan_rtl_mutex.cpp | 3 +- compiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp | 14 + compiler-rt/lib/tsan/rtl/tsan_rtl_s390x.S | 2 + compiler-rt/lib/tsan/rtl/tsan_rtl_thread.cpp | 2 +- compiler-rt/lib/tsan/rtl/tsan_shadow.h | 11 +- compiler-rt/lib/ubsan/ubsan_diag.cpp | 12 +- compiler-rt/lib/ubsan/ubsan_init.cpp | 7 +- compiler-rt/lib/ubsan/ubsan_value.cpp | 2 +- compiler-rt/lib/xray/xray_basic_logging.cpp | 2 +- compiler-rt/lib/xray/xray_init.cpp | 2 +- compiler-rt/lib/xray/xray_powerpc64.inc | 15 + compiler-rt/lib/xray/xray_x86_64.cpp | 6 +- libcxx/include/__algorithm/adjacent_find.h | 2 +- libcxx/include/__algorithm/all_of.h | 2 +- libcxx/include/__algorithm/any_of.h | 2 +- libcxx/include/__algorithm/binary_search.h | 20 +- libcxx/include/__algorithm/clamp.h | 4 +- libcxx/include/__algorithm/comp.h | 2 +- libcxx/include/__algorithm/comp_ref_type.h | 33 +- libcxx/include/__algorithm/copy.h | 107 +- libcxx/include/__algorithm/copy_backward.h | 66 +- libcxx/include/__algorithm/copy_if.h | 2 +- libcxx/include/__algorithm/copy_n.h | 2 +- libcxx/include/__algorithm/count.h | 2 +- libcxx/include/__algorithm/count_if.h | 2 +- libcxx/include/__algorithm/equal.h | 2 +- libcxx/include/__algorithm/equal_range.h | 12 +- libcxx/include/__algorithm/fill.h | 2 +- libcxx/include/__algorithm/fill_n.h | 2 +- libcxx/include/__algorithm/find.h | 2 +- libcxx/include/__algorithm/find_end.h | 2 +- libcxx/include/__algorithm/find_first_of.h | 2 +- libcxx/include/__algorithm/find_if.h | 2 +- libcxx/include/__algorithm/find_if_not.h | 2 +- libcxx/include/__algorithm/for_each.h | 2 +- libcxx/include/__algorithm/for_each_n.h | 2 +- libcxx/include/__algorithm/generate.h | 2 +- libcxx/include/__algorithm/generate_n.h | 2 +- libcxx/include/__algorithm/half_positive.h | 2 +- libcxx/include/__algorithm/in_found_result.h | 49 + libcxx/include/__algorithm/in_fun_result.h | 49 + libcxx/include/__algorithm/in_in_out_result.h | 36 +- libcxx/include/__algorithm/in_in_result.h | 30 +- libcxx/include/__algorithm/in_out_out_result.h | 54 + libcxx/include/__algorithm/in_out_result.h | 29 +- libcxx/include/__algorithm/includes.h | 2 +- libcxx/include/__algorithm/inplace_merge.h | 10 +- libcxx/include/__algorithm/is_heap.h | 2 +- libcxx/include/__algorithm/is_heap_until.h | 2 +- libcxx/include/__algorithm/is_partitioned.h | 2 +- libcxx/include/__algorithm/is_permutation.h | 2 +- libcxx/include/__algorithm/is_sorted.h | 2 +- libcxx/include/__algorithm/is_sorted_until.h | 2 +- libcxx/include/__algorithm/iter_swap.h | 2 +- libcxx/include/__algorithm/iterator_operations.h | 47 + .../include/__algorithm/lexicographical_compare.h | 2 +- libcxx/include/__algorithm/lower_bound.h | 69 +- libcxx/include/__algorithm/make_heap.h | 2 +- libcxx/include/__algorithm/make_projected.h | 51 + libcxx/include/__algorithm/max.h | 2 +- libcxx/include/__algorithm/max_element.h | 2 +- libcxx/include/__algorithm/merge.h | 2 +- libcxx/include/__algorithm/min.h | 2 +- libcxx/include/__algorithm/min_element.h | 2 +- libcxx/include/__algorithm/min_max_result.h | 56 + libcxx/include/__algorithm/minmax.h | 52 +- libcxx/include/__algorithm/minmax_element.h | 122 +- libcxx/include/__algorithm/mismatch.h | 4 +- libcxx/include/__algorithm/move.h | 119 +- libcxx/include/__algorithm/move_backward.h | 4 +- libcxx/include/__algorithm/next_permutation.h | 2 +- libcxx/include/__algorithm/none_of.h | 2 +- libcxx/include/__algorithm/nth_element.h | 3 +- libcxx/include/__algorithm/partial_sort.h | 3 +- libcxx/include/__algorithm/partial_sort_copy.h | 2 +- libcxx/include/__algorithm/partition.h | 2 +- libcxx/include/__algorithm/partition_copy.h | 4 +- libcxx/include/__algorithm/partition_point.h | 6 +- libcxx/include/__algorithm/pop_heap.h | 20 +- libcxx/include/__algorithm/prev_permutation.h | 2 +- libcxx/include/__algorithm/push_heap.h | 2 +- libcxx/include/__algorithm/ranges_adjacent_find.h | 78 + libcxx/include/__algorithm/ranges_all_of.h | 68 + libcxx/include/__algorithm/ranges_any_of.h | 68 + libcxx/include/__algorithm/ranges_binary_search.h | 63 + libcxx/include/__algorithm/ranges_copy.h | 65 + libcxx/include/__algorithm/ranges_copy_backward.h | 67 + libcxx/include/__algorithm/ranges_copy_if.h | 81 + libcxx/include/__algorithm/ranges_copy_n.h | 76 + libcxx/include/__algorithm/ranges_count.h | 62 + libcxx/include/__algorithm/ranges_count_if.h | 72 + libcxx/include/__algorithm/ranges_equal.h | 115 + libcxx/include/__algorithm/ranges_fill.h | 59 + libcxx/include/__algorithm/ranges_fill_n.h | 48 + libcxx/include/__algorithm/ranges_find.h | 63 + libcxx/include/__algorithm/ranges_find_first_of.h | 101 + libcxx/include/__algorithm/ranges_find_if.h | 71 + libcxx/include/__algorithm/ranges_find_if_not.h | 63 + libcxx/include/__algorithm/ranges_for_each.h | 78 + libcxx/include/__algorithm/ranges_for_each_n.h | 67 + libcxx/include/__algorithm/ranges_is_partitioned.h | 81 + libcxx/include/__algorithm/ranges_is_sorted.h | 61 + .../include/__algorithm/ranges_is_sorted_until.h | 76 + .../__algorithm/ranges_lexicographical_compare.h | 98 + libcxx/include/__algorithm/ranges_lower_bound.h | 66 + libcxx/include/__algorithm/ranges_max.h | 93 + libcxx/include/__algorithm/ranges_max_element.h | 61 + libcxx/include/__algorithm/ranges_min.h | 89 + libcxx/include/__algorithm/ranges_min_element.h | 73 + libcxx/include/__algorithm/ranges_minmax.h | 133 + libcxx/include/__algorithm/ranges_minmax_element.h | 72 + libcxx/include/__algorithm/ranges_mismatch.h | 85 + libcxx/include/__algorithm/ranges_move.h | 83 + libcxx/include/__algorithm/ranges_move_backward.h | 75 + libcxx/include/__algorithm/ranges_none_of.h | 68 + libcxx/include/__algorithm/ranges_replace.h | 74 + libcxx/include/__algorithm/ranges_replace_if.h | 77 + libcxx/include/__algorithm/ranges_reverse.h | 83 + libcxx/include/__algorithm/ranges_sort.h | 78 + libcxx/include/__algorithm/ranges_stable_sort.h | 78 + libcxx/include/__algorithm/ranges_swap_ranges.h | 69 + libcxx/include/__algorithm/ranges_transform.h | 170 + libcxx/include/__algorithm/ranges_upper_bound.h | 75 + libcxx/include/__algorithm/remove.h | 2 +- libcxx/include/__algorithm/remove_copy.h | 2 +- libcxx/include/__algorithm/remove_copy_if.h | 2 +- libcxx/include/__algorithm/remove_if.h | 4 +- libcxx/include/__algorithm/replace.h | 2 +- libcxx/include/__algorithm/replace_copy.h | 2 +- libcxx/include/__algorithm/replace_copy_if.h | 2 +- libcxx/include/__algorithm/replace_if.h | 2 +- libcxx/include/__algorithm/reverse.h | 2 +- libcxx/include/__algorithm/reverse_copy.h | 2 +- libcxx/include/__algorithm/rotate.h | 5 +- libcxx/include/__algorithm/rotate_copy.h | 2 +- libcxx/include/__algorithm/sample.h | 8 +- libcxx/include/__algorithm/search.h | 4 +- libcxx/include/__algorithm/search_n.h | 2 +- libcxx/include/__algorithm/set_difference.h | 2 +- libcxx/include/__algorithm/set_intersection.h | 2 +- .../include/__algorithm/set_symmetric_difference.h | 2 +- libcxx/include/__algorithm/set_union.h | 2 +- libcxx/include/__algorithm/shift_left.h | 2 +- libcxx/include/__algorithm/shift_right.h | 2 +- libcxx/include/__algorithm/shuffle.h | 3 +- libcxx/include/__algorithm/sift_down.h | 35 +- libcxx/include/__algorithm/sort.h | 918 +- libcxx/include/__algorithm/sort_heap.h | 2 +- libcxx/include/__algorithm/stable_partition.h | 10 +- libcxx/include/__algorithm/stable_sort.h | 51 +- libcxx/include/__algorithm/swap_ranges.h | 3 +- libcxx/include/__algorithm/transform.h | 2 +- libcxx/include/__algorithm/unique.h | 2 +- libcxx/include/__algorithm/unique_copy.h | 3 +- libcxx/include/__algorithm/unwrap_iter.h | 34 +- libcxx/include/__algorithm/upper_bound.h | 6 +- libcxx/include/__assert | 66 + libcxx/include/__availability | 89 +- libcxx/include/__bit/bit_cast.h | 16 +- libcxx/include/__bit/byteswap.h | 4 +- libcxx/include/__bit_reference | 34 +- libcxx/include/__bits | 2 +- libcxx/include/__bsd_locale_defaults.h | 8 +- libcxx/include/__bsd_locale_fallbacks.h | 8 +- libcxx/include/__charconv/chars_format.h | 2 +- libcxx/include/__charconv/from_chars_result.h | 2 +- libcxx/include/__charconv/tables.h | 130 + libcxx/include/__charconv/to_chars_base_10.h | 127 + libcxx/include/__charconv/to_chars_result.h | 2 +- libcxx/include/__chrono/calendar.h | 1236 +- libcxx/include/__chrono/convert_to_timespec.h | 2 +- libcxx/include/__chrono/day.h | 99 + libcxx/include/__chrono/duration.h | 4 +- libcxx/include/__chrono/file_clock.h | 2 +- libcxx/include/__chrono/hh_mm_ss.h | 112 + libcxx/include/__chrono/high_resolution_clock.h | 2 +- libcxx/include/__chrono/literals.h | 49 + libcxx/include/__chrono/month.h | 118 + libcxx/include/__chrono/month_weekday.h | 106 + libcxx/include/__chrono/monthday.h | 160 + libcxx/include/__chrono/steady_clock.h | 2 +- libcxx/include/__chrono/system_clock.h | 2 +- libcxx/include/__chrono/time_point.h | 2 +- libcxx/include/__chrono/weekday.h | 185 + libcxx/include/__chrono/year.h | 114 + libcxx/include/__chrono/year_month.h | 114 + libcxx/include/__chrono/year_month_day.h | 323 + libcxx/include/__chrono/year_month_weekday.h | 255 + .../include/__compare/common_comparison_category.h | 2 +- .../__compare/compare_partial_order_fallback.h | 6 +- .../__compare/compare_strong_order_fallback.h | 6 +- libcxx/include/__compare/compare_three_way.h | 6 +- .../include/__compare/compare_three_way_result.h | 2 +- .../__compare/compare_weak_order_fallback.h | 6 +- libcxx/include/__compare/is_eq.h | 2 +- libcxx/include/__compare/ordering.h | 2 +- libcxx/include/__compare/partial_order.h | 6 +- libcxx/include/__compare/strong_order.h | 6 +- libcxx/include/__compare/synth_three_way.h | 8 +- libcxx/include/__compare/three_way_comparable.h | 6 +- libcxx/include/__compare/weak_order.h | 6 +- libcxx/include/__concepts/arithmetic.h | 6 +- libcxx/include/__concepts/assignable.h | 6 +- libcxx/include/__concepts/boolean_testable.h | 6 +- libcxx/include/__concepts/class_or_enum.h | 7 +- libcxx/include/__concepts/common_reference_with.h | 6 +- libcxx/include/__concepts/common_with.h | 6 +- libcxx/include/__concepts/constructible.h | 6 +- libcxx/include/__concepts/convertible_to.h | 6 +- libcxx/include/__concepts/copyable.h | 6 +- libcxx/include/__concepts/derived_from.h | 6 +- libcxx/include/__concepts/destructible.h | 6 +- libcxx/include/__concepts/different_from.h | 6 +- libcxx/include/__concepts/equality_comparable.h | 6 +- libcxx/include/__concepts/invocable.h | 6 +- libcxx/include/__concepts/movable.h | 6 +- libcxx/include/__concepts/predicate.h | 6 +- libcxx/include/__concepts/regular.h | 6 +- libcxx/include/__concepts/relation.h | 6 +- libcxx/include/__concepts/same_as.h | 6 +- libcxx/include/__concepts/semiregular.h | 6 +- libcxx/include/__concepts/swappable.h | 6 +- libcxx/include/__concepts/totally_ordered.h | 6 +- libcxx/include/__config | 1912 +- libcxx/include/__coroutine/coroutine_handle.h | 4 +- libcxx/include/__coroutine/coroutine_traits.h | 2 +- libcxx/include/__coroutine/noop_coroutine_handle.h | 4 +- libcxx/include/__coroutine/trivial_awaitables.h | 2 +- libcxx/include/__debug | 157 +- libcxx/include/__errc | 2 +- libcxx/include/__filesystem/copy_options.h | 4 + libcxx/include/__filesystem/directory_entry.h | 23 +- libcxx/include/__filesystem/directory_iterator.h | 39 +- libcxx/include/__filesystem/directory_options.h | 4 + libcxx/include/__filesystem/file_status.h | 4 + libcxx/include/__filesystem/file_time_type.h | 7 +- libcxx/include/__filesystem/file_type.h | 4 + libcxx/include/__filesystem/filesystem_error.h | 4 + libcxx/include/__filesystem/operations.h | 198 +- libcxx/include/__filesystem/path.h | 228 +- libcxx/include/__filesystem/path_iterator.h | 6 +- libcxx/include/__filesystem/perm_options.h | 4 + libcxx/include/__filesystem/perms.h | 4 + .../__filesystem/recursive_directory_iterator.h | 8 +- libcxx/include/__filesystem/space_info.h | 4 + libcxx/include/__filesystem/u8path.h | 12 + libcxx/include/__format/buffer.h | 369 + libcxx/include/__format/concepts.h | 53 + libcxx/include/__format/enable_insertable.h | 35 + libcxx/include/__format/format_arg.h | 317 +- libcxx/include/__format/format_arg_store.h | 253 + libcxx/include/__format/format_args.h | 58 +- libcxx/include/__format/format_context.h | 34 +- libcxx/include/__format/format_error.h | 2 +- libcxx/include/__format/format_fwd.h | 25 +- libcxx/include/__format/format_parse_context.h | 10 +- libcxx/include/__format/format_string.h | 12 +- libcxx/include/__format/format_to_n_result.h | 7 - libcxx/include/__format/formatter.h | 25 +- libcxx/include/__format/formatter_bool.h | 134 +- libcxx/include/__format/formatter_char.h | 100 +- libcxx/include/__format/formatter_floating_point.h | 17 +- libcxx/include/__format/formatter_integer.h | 163 +- libcxx/include/__format/formatter_integral.h | 612 +- libcxx/include/__format/formatter_output.h | 304 + libcxx/include/__format/formatter_pointer.h | 62 +- libcxx/include/__format/formatter_string.h | 119 +- libcxx/include/__format/parser_std_format_spec.h | 649 +- libcxx/include/__functional/binary_function.h | 27 +- libcxx/include/__functional/binary_negate.h | 8 +- libcxx/include/__functional/bind.h | 15 +- libcxx/include/__functional/bind_back.h | 13 +- libcxx/include/__functional/bind_front.h | 4 +- libcxx/include/__functional/binder1st.h | 5 +- libcxx/include/__functional/binder2nd.h | 5 +- libcxx/include/__functional/boyer_moore_searcher.h | 313 + libcxx/include/__functional/compose.h | 2 +- libcxx/include/__functional/default_searcher.h | 4 +- libcxx/include/__functional/function.h | 21 +- libcxx/include/__functional/hash.h | 231 +- libcxx/include/__functional/identity.h | 13 +- libcxx/include/__functional/invoke.h | 541 +- libcxx/include/__functional/is_transparent.h | 2 +- libcxx/include/__functional/mem_fn.h | 114 +- libcxx/include/__functional/mem_fun_ref.h | 18 +- libcxx/include/__functional/not_fn.h | 5 +- libcxx/include/__functional/operations.h | 208 +- libcxx/include/__functional/perfect_forward.h | 105 +- .../__functional/pointer_to_binary_function.h | 4 +- .../__functional/pointer_to_unary_function.h | 4 +- libcxx/include/__functional/ranges_operations.h | 10 +- libcxx/include/__functional/reference_wrapper.h | 116 +- libcxx/include/__functional/unary_function.h | 26 +- libcxx/include/__functional/unary_negate.h | 4 +- libcxx/include/__functional/unwrap_ref.h | 2 +- libcxx/include/__functional/weak_result_type.h | 304 +- libcxx/include/__functional_base | 32 - libcxx/include/__fwd/span.h | 37 + libcxx/include/__fwd/string_view.h | 37 + libcxx/include/__hash_table | 199 +- libcxx/include/__ios/fpos.h | 79 + libcxx/include/__iterator/access.h | 2 +- libcxx/include/__iterator/advance.h | 54 +- libcxx/include/__iterator/back_insert_iterator.h | 4 +- libcxx/include/__iterator/bounded_iter.h | 229 + libcxx/include/__iterator/common_iterator.h | 39 +- libcxx/include/__iterator/concepts.h | 24 +- libcxx/include/__iterator/counted_iterator.h | 10 +- libcxx/include/__iterator/data.h | 2 +- libcxx/include/__iterator/default_sentinel.h | 6 +- libcxx/include/__iterator/distance.h | 6 +- libcxx/include/__iterator/empty.h | 2 +- libcxx/include/__iterator/erase_if_container.h | 2 +- libcxx/include/__iterator/front_insert_iterator.h | 2 +- libcxx/include/__iterator/incrementable_traits.h | 6 +- libcxx/include/__iterator/indirectly_comparable.h | 8 +- libcxx/include/__iterator/insert_iterator.h | 4 +- libcxx/include/__iterator/istream_iterator.h | 15 +- libcxx/include/__iterator/istreambuf_iterator.h | 18 +- libcxx/include/__iterator/iter_move.h | 74 +- libcxx/include/__iterator/iter_swap.h | 7 +- libcxx/include/__iterator/iterator.h | 2 +- libcxx/include/__iterator/iterator_traits.h | 67 +- libcxx/include/__iterator/mergeable.h | 41 + libcxx/include/__iterator/move_iterator.h | 175 +- libcxx/include/__iterator/move_sentinel.h | 57 + libcxx/include/__iterator/next.h | 18 +- libcxx/include/__iterator/ostream_iterator.h | 3 +- libcxx/include/__iterator/ostreambuf_iterator.h | 3 +- libcxx/include/__iterator/permutable.h | 35 + libcxx/include/__iterator/prev.h | 13 +- libcxx/include/__iterator/projected.h | 6 +- libcxx/include/__iterator/readable_traits.h | 6 +- libcxx/include/__iterator/reverse_access.h | 8 +- libcxx/include/__iterator/reverse_iterator.h | 175 +- libcxx/include/__iterator/size.h | 7 +- libcxx/include/__iterator/sortable.h | 37 + libcxx/include/__iterator/unreachable_sentinel.h | 6 +- libcxx/include/__iterator/wrap_iter.h | 16 +- libcxx/include/__libcpp_version | 1 - libcxx/include/__locale | 27 +- libcxx/include/__mbstate_t.h | 2 +- libcxx/include/__memory/addressof.h | 2 +- libcxx/include/__memory/allocate_at_least.h | 61 + libcxx/include/__memory/allocation_guard.h | 4 +- libcxx/include/__memory/allocator.h | 25 +- libcxx/include/__memory/allocator_arg_t.h | 4 +- libcxx/include/__memory/allocator_traits.h | 2 +- libcxx/include/__memory/assume_aligned.h | 46 + libcxx/include/__memory/auto_ptr.h | 7 +- libcxx/include/__memory/compressed_pair.h | 157 +- libcxx/include/__memory/concepts.h | 8 +- libcxx/include/__memory/construct_at.h | 30 +- libcxx/include/__memory/pointer_traits.h | 9 +- libcxx/include/__memory/ranges_construct_at.h | 6 +- .../__memory/ranges_uninitialized_algorithms.h | 8 +- libcxx/include/__memory/raw_storage_iterator.h | 7 +- libcxx/include/__memory/shared_ptr.h | 277 +- libcxx/include/__memory/temporary_buffer.h | 10 +- libcxx/include/__memory/uninitialized_algorithms.h | 153 +- libcxx/include/__memory/unique_ptr.h | 27 +- libcxx/include/__memory/uses_allocator.h | 9 +- libcxx/include/__mutex_base | 7 +- libcxx/include/__node_handle | 4 +- libcxx/include/__nullptr | 61 - libcxx/include/__numeric/accumulate.h | 2 +- libcxx/include/__numeric/gcd_lcm.h | 2 +- libcxx/include/__numeric/inner_product.h | 2 +- libcxx/include/__random/bernoulli_distribution.h | 4 +- libcxx/include/__random/binomial_distribution.h | 5 +- libcxx/include/__random/cauchy_distribution.h | 4 +- libcxx/include/__random/chi_squared_distribution.h | 2 +- libcxx/include/__random/clamp_to_integral.h | 2 +- libcxx/include/__random/default_random_engine.h | 2 +- libcxx/include/__random/discard_block_engine.h | 2 +- libcxx/include/__random/discrete_distribution.h | 5 +- libcxx/include/__random/exponential_distribution.h | 4 +- .../include/__random/extreme_value_distribution.h | 4 +- libcxx/include/__random/fisher_f_distribution.h | 4 +- libcxx/include/__random/gamma_distribution.h | 4 +- libcxx/include/__random/generate_canonical.h | 2 +- libcxx/include/__random/geometric_distribution.h | 4 +- libcxx/include/__random/independent_bits_engine.h | 2 +- libcxx/include/__random/is_seed_sequence.h | 2 +- libcxx/include/__random/is_valid.h | 58 + libcxx/include/__random/knuth_b.h | 2 +- .../include/__random/linear_congruential_engine.h | 6 +- libcxx/include/__random/log2.h | 2 +- libcxx/include/__random/lognormal_distribution.h | 2 +- libcxx/include/__random/mersenne_twister_engine.h | 2 +- .../__random/negative_binomial_distribution.h | 5 +- libcxx/include/__random/normal_distribution.h | 4 +- .../__random/piecewise_constant_distribution.h | 4 +- .../__random/piecewise_linear_distribution.h | 4 +- libcxx/include/__random/poisson_distribution.h | 5 +- libcxx/include/__random/random_device.h | 12 +- libcxx/include/__random/ranlux.h | 2 +- libcxx/include/__random/seed_seq.h | 76 +- libcxx/include/__random/shuffle_order_engine.h | 2 +- libcxx/include/__random/student_t_distribution.h | 4 +- .../include/__random/subtract_with_carry_engine.h | 2 +- libcxx/include/__random/uniform_int_distribution.h | 7 +- .../__random/uniform_random_bit_generator.h | 6 +- .../include/__random/uniform_real_distribution.h | 4 +- libcxx/include/__random/weibull_distribution.h | 2 +- libcxx/include/__ranges/access.h | 26 +- libcxx/include/__ranges/all.h | 25 +- libcxx/include/__ranges/common_view.h | 22 +- libcxx/include/__ranges/concepts.h | 14 +- libcxx/include/__ranges/copyable_box.h | 36 +- libcxx/include/__ranges/counted.h | 22 +- libcxx/include/__ranges/dangling.h | 6 +- libcxx/include/__ranges/data.h | 10 +- libcxx/include/__ranges/drop_view.h | 201 +- libcxx/include/__ranges/empty.h | 6 +- libcxx/include/__ranges/empty_view.h | 13 +- libcxx/include/__ranges/enable_borrowed_range.h | 9 +- libcxx/include/__ranges/enable_view.h | 6 +- libcxx/include/__ranges/filter_view.h | 259 + libcxx/include/__ranges/iota_view.h | 116 +- libcxx/include/__ranges/join_view.h | 60 +- libcxx/include/__ranges/lazy_split_view.h | 465 + libcxx/include/__ranges/non_propagating_cache.h | 12 +- libcxx/include/__ranges/owning_view.h | 12 +- libcxx/include/__ranges/range_adaptor.h | 12 +- libcxx/include/__ranges/rbegin.h | 130 + libcxx/include/__ranges/ref_view.h | 8 +- libcxx/include/__ranges/rend.h | 134 + libcxx/include/__ranges/reverse_view.h | 48 +- libcxx/include/__ranges/single_view.h | 34 +- libcxx/include/__ranges/size.h | 161 +- libcxx/include/__ranges/subrange.h | 37 +- libcxx/include/__ranges/take_view.h | 396 +- libcxx/include/__ranges/transform_view.h | 42 +- libcxx/include/__ranges/view_interface.h | 45 +- libcxx/include/__ranges/views.h | 35 + libcxx/include/__ranges/zip_view.h | 511 + libcxx/include/__split_buffer | 42 +- libcxx/include/__std_stream | 2 +- libcxx/include/__string | 1175 -- libcxx/include/__string/char_traits.h | 929 + libcxx/include/__string/extern_template_lists.h | 131 + libcxx/include/__thread/poll_with_backoff.h | 8 +- libcxx/include/__thread/timed_backoff_policy.h | 6 +- libcxx/include/__threading_support | 67 +- libcxx/include/__tree | 44 +- libcxx/include/__tuple | 7 +- libcxx/include/__type_traits/add_const.h | 30 + libcxx/include/__type_traits/add_cv.h | 30 + .../include/__type_traits/add_lvalue_reference.h | 33 + libcxx/include/__type_traits/add_pointer.h | 41 + .../include/__type_traits/add_rvalue_reference.h | 33 + libcxx/include/__type_traits/add_volatile.h | 30 + libcxx/include/__type_traits/alignment_of.h | 32 + libcxx/include/__type_traits/apply_cv.h | 76 + libcxx/include/__type_traits/conditional.h | 53 + libcxx/include/__type_traits/conjunction.h | 57 + libcxx/include/__type_traits/decay.h | 65 + libcxx/include/__type_traits/disjunction.h | 53 + libcxx/include/__type_traits/enable_if.h | 31 + libcxx/include/__type_traits/extent.h | 55 + .../has_unique_object_representation.h | 36 + .../include/__type_traits/has_virtual_destructor.h | 40 + libcxx/include/__type_traits/integral_constant.h | 50 + libcxx/include/__type_traits/is_abstract.h | 31 + libcxx/include/__type_traits/is_aggregate.h | 33 + libcxx/include/__type_traits/is_arithmetic.h | 34 + libcxx/include/__type_traits/is_array.h | 52 + libcxx/include/__type_traits/is_assignable.h | 66 + libcxx/include/__type_traits/is_base_of.h | 32 + libcxx/include/__type_traits/is_bounded_array.h | 38 + libcxx/include/__type_traits/is_callable.h | 32 + libcxx/include/__type_traits/is_class.h | 33 + libcxx/include/__type_traits/is_compound.h | 46 + libcxx/include/__type_traits/is_const.h | 45 + .../include/__type_traits/is_constant_evaluated.h | 32 + libcxx/include/__type_traits/is_constructible.h | 33 + libcxx/include/__type_traits/is_convertible.h | 108 + libcxx/include/__type_traits/is_copy_assignable.h | 35 + .../include/__type_traits/is_copy_constructible.h | 36 + libcxx/include/__type_traits/is_core_convertible.h | 36 + .../__type_traits/is_default_constructible.h | 34 + libcxx/include/__type_traits/is_destructible.h | 102 + libcxx/include/__type_traits/is_empty.h | 32 + libcxx/include/__type_traits/is_enum.h | 32 + libcxx/include/__type_traits/is_final.h | 36 + libcxx/include/__type_traits/is_floating_point.h | 37 + libcxx/include/__type_traits/is_function.h | 43 + libcxx/include/__type_traits/is_fundamental.h | 49 + libcxx/include/__type_traits/is_integral.h | 72 + libcxx/include/__type_traits/is_literal_type.h | 34 + .../__type_traits/is_member_function_pointer.h | 64 + .../__type_traits/is_member_object_pointer.h | 46 + libcxx/include/__type_traits/is_member_pointer.h | 45 + libcxx/include/__type_traits/is_move_assignable.h | 36 + .../include/__type_traits/is_move_constructible.h | 35 + .../include/__type_traits/is_nothrow_assignable.h | 59 + .../__type_traits/is_nothrow_constructible.h | 75 + .../__type_traits/is_nothrow_copy_assignable.h | 35 + .../__type_traits/is_nothrow_copy_constructible.h | 35 + .../is_nothrow_default_constructible.h | 33 + .../__type_traits/is_nothrow_destructible.h | 90 + .../__type_traits/is_nothrow_move_assignable.h | 36 + .../__type_traits/is_nothrow_move_constructible.h | 34 + libcxx/include/__type_traits/is_null_pointer.h | 41 + libcxx/include/__type_traits/is_object.h | 52 + libcxx/include/__type_traits/is_pod.h | 43 + libcxx/include/__type_traits/is_pointer.h | 57 + libcxx/include/__type_traits/is_polymorphic.h | 32 + libcxx/include/__type_traits/is_reference.h | 70 + .../include/__type_traits/is_reference_wrapper.h | 31 + libcxx/include/__type_traits/is_referenceable.h | 33 + libcxx/include/__type_traits/is_same.h | 44 + libcxx/include/__type_traits/is_scalar.h | 61 + libcxx/include/__type_traits/is_scoped_enum.h | 42 + libcxx/include/__type_traits/is_signed.h | 55 + libcxx/include/__type_traits/is_standard_layout.h | 36 + libcxx/include/__type_traits/is_trivial.h | 37 + .../__type_traits/is_trivially_assignable.h | 33 + .../__type_traits/is_trivially_constructible.h | 34 + .../__type_traits/is_trivially_copy_assignable.h | 35 + .../is_trivially_copy_constructible.h | 34 + .../include/__type_traits/is_trivially_copyable.h | 32 + .../is_trivially_default_constructible.h | 33 + .../__type_traits/is_trivially_destructible.h | 52 + .../__type_traits/is_trivially_move_assignable.h | 36 + .../is_trivially_move_constructible.h | 34 + libcxx/include/__type_traits/is_unbounded_array.h | 37 + libcxx/include/__type_traits/is_union.h | 32 + libcxx/include/__type_traits/is_unsigned.h | 58 + libcxx/include/__type_traits/is_void.h | 45 + libcxx/include/__type_traits/is_volatile.h | 45 + libcxx/include/__type_traits/negation.h | 33 + libcxx/include/__type_traits/rank.h | 36 + libcxx/include/__type_traits/remove_all_extents.h | 34 + libcxx/include/__type_traits/remove_const.h | 28 + libcxx/include/__type_traits/remove_cv.h | 30 + libcxx/include/__type_traits/remove_extent.h | 34 + libcxx/include/__type_traits/remove_pointer.h | 32 + libcxx/include/__type_traits/remove_reference.h | 31 + libcxx/include/__type_traits/remove_volatile.h | 28 + libcxx/include/__type_traits/type_identity.h | 33 + libcxx/include/__type_traits/underlying_type.h | 41 + libcxx/include/__type_traits/void_t.h | 29 + libcxx/include/__undef_macros | 21 +- libcxx/include/__utility/as_const.h | 2 +- libcxx/include/__utility/auto_cast.h | 2 +- libcxx/include/__utility/cmp.h | 11 +- libcxx/include/__utility/declval.h | 2 +- libcxx/include/__utility/exchange.h | 2 +- libcxx/include/__utility/forward.h | 5 +- libcxx/include/__utility/in_place.h | 2 +- libcxx/include/__utility/integer_sequence.h | 2 +- libcxx/include/__utility/move.h | 7 +- libcxx/include/__utility/pair.h | 26 +- libcxx/include/__utility/piecewise_construct.h | 2 +- libcxx/include/__utility/priority_tag.h | 2 +- libcxx/include/__utility/rel_ops.h | 2 +- libcxx/include/__utility/swap.h | 2 +- libcxx/include/__utility/to_underlying.h | 2 +- libcxx/include/__utility/transaction.h | 2 +- libcxx/include/__utility/unreachable.h | 38 + libcxx/include/__variant/monostate.h | 2 +- libcxx/include/algorithm | 571 +- libcxx/include/any | 14 +- libcxx/include/array | 53 +- libcxx/include/atomic | 31 +- libcxx/include/barrier | 48 +- libcxx/include/bit | 306 +- libcxx/include/bitset | 26 +- libcxx/include/cassert | 3 +- libcxx/include/ccomplex | 5 +- libcxx/include/cctype | 3 +- libcxx/include/cerrno | 3 +- libcxx/include/cfenv | 3 +- libcxx/include/cfloat | 3 +- libcxx/include/charconv | 344 +- libcxx/include/chrono | 14 +- libcxx/include/cinttypes | 3 +- libcxx/include/ciso646 | 3 +- libcxx/include/climits | 3 +- libcxx/include/clocale | 3 +- libcxx/include/cmath | 3 +- libcxx/include/codecvt | 33 +- libcxx/include/compare | 3 +- libcxx/include/complex | 3 +- libcxx/include/complex.h | 2 +- libcxx/include/concepts | 3 +- libcxx/include/condition_variable | 3 +- libcxx/include/coroutine | 10 +- libcxx/include/csetjmp | 3 +- libcxx/include/csignal | 8 +- libcxx/include/cstdarg | 3 +- libcxx/include/cstdbool | 3 +- libcxx/include/cstddef | 49 +- libcxx/include/cstdint | 3 +- libcxx/include/cstdio | 3 +- libcxx/include/cstdlib | 15 +- libcxx/include/cstring | 3 +- libcxx/include/ctgmath | 3 +- libcxx/include/ctime | 21 +- libcxx/include/ctype.h | 2 +- libcxx/include/cuchar | 61 + libcxx/include/cwchar | 3 +- libcxx/include/cwctype | 3 +- libcxx/include/deque | 59 +- libcxx/include/errno.h | 2 +- libcxx/include/exception | 17 +- libcxx/include/execution | 3 +- libcxx/include/experimental/__config | 15 +- libcxx/include/experimental/__memory | 3 +- libcxx/include/experimental/algorithm | 3 +- libcxx/include/experimental/coroutine | 15 +- libcxx/include/experimental/deque | 4 +- libcxx/include/experimental/filesystem | 256 - libcxx/include/experimental/forward_list | 4 +- libcxx/include/experimental/functional | 75 +- libcxx/include/experimental/iterator | 4 +- libcxx/include/experimental/list | 4 +- libcxx/include/experimental/map | 4 +- libcxx/include/experimental/memory_resource | 6 +- libcxx/include/experimental/propagate_const | 10 +- libcxx/include/experimental/regex | 4 +- libcxx/include/experimental/set | 4 +- libcxx/include/experimental/simd | 16 +- libcxx/include/experimental/string | 4 +- libcxx/include/experimental/type_traits | 3 +- libcxx/include/experimental/unordered_map | 12 +- libcxx/include/experimental/unordered_set | 4 +- libcxx/include/experimental/utility | 3 +- libcxx/include/experimental/vector | 4 +- libcxx/include/ext/__hash | 26 +- libcxx/include/ext/hash_map | 8 +- libcxx/include/ext/hash_set | 8 +- libcxx/include/fenv.h | 2 +- libcxx/include/filesystem | 10 +- libcxx/include/float.h | 2 +- libcxx/include/format | 522 +- libcxx/include/forward_list | 40 +- libcxx/include/fstream | 44 +- libcxx/include/functional | 19 +- libcxx/include/future | 60 +- libcxx/include/initializer_list | 3 +- libcxx/include/inttypes.h | 2 +- libcxx/include/iomanip | 175 +- libcxx/include/ios | 18 +- libcxx/include/iosfwd | 5 +- libcxx/include/iostream | 7 +- libcxx/include/istream | 12 +- libcxx/include/iterator | 161 +- libcxx/include/latch | 11 +- libcxx/include/limits | 16 +- libcxx/include/limits.h | 2 +- libcxx/include/list | 228 +- libcxx/include/locale | 140 +- libcxx/include/locale.h | 4 +- libcxx/include/map | 65 +- libcxx/include/math.h | 88 +- libcxx/include/memory | 57 +- libcxx/include/module.modulemap | 1090 - libcxx/include/module.modulemap.in | 1322 ++ libcxx/include/mutex | 8 +- libcxx/include/new | 14 +- libcxx/include/numbers | 7 +- libcxx/include/numeric | 10 +- libcxx/include/optional | 61 +- libcxx/include/ostream | 12 +- libcxx/include/queue | 18 +- libcxx/include/random | 13 +- libcxx/include/ranges | 100 +- libcxx/include/ratio | 15 +- libcxx/include/regex | 37 +- libcxx/include/scoped_allocator | 3 +- libcxx/include/semaphore | 7 +- libcxx/include/set | 37 +- libcxx/include/setjmp.h | 2 +- libcxx/include/shared_mutex | 9 +- libcxx/include/span | 255 +- libcxx/include/sstream | 12 +- libcxx/include/stack | 11 +- libcxx/include/stdatomic.h | 235 + libcxx/include/stdbool.h | 3 +- libcxx/include/stddef.h | 11 +- libcxx/include/stdexcept | 3 +- libcxx/include/stdint.h | 2 +- libcxx/include/stdio.h | 4 +- libcxx/include/stdlib.h | 4 +- libcxx/include/streambuf | 11 +- libcxx/include/string | 2105 +- libcxx/include/string.h | 2 +- libcxx/include/string_view | 81 +- libcxx/include/strstream | 9 +- libcxx/include/system_error | 20 +- libcxx/include/tgmath.h | 2 +- libcxx/include/thread | 30 +- libcxx/include/tuple | 472 +- libcxx/include/type_traits | 3938 +--- libcxx/include/typeindex | 16 +- libcxx/include/typeinfo | 3 +- libcxx/include/uchar.h | 52 + libcxx/include/unordered_map | 65 +- libcxx/include/unordered_set | 125 +- libcxx/include/utility | 20 +- libcxx/include/valarray | 122 +- libcxx/include/variant | 47 +- libcxx/include/vector | 452 +- libcxx/include/version | 62 +- libcxx/include/wchar.h | 4 +- libcxx/include/wctype.h | 2 +- libcxx/src/algorithm.cpp | 4 +- libcxx/src/any.cpp | 2 +- libcxx/src/assert.cpp | 22 + libcxx/src/barrier.cpp | 2 +- libcxx/src/bind.cpp | 2 +- libcxx/src/charconv.cpp | 128 +- libcxx/src/chrono.cpp | 6 +- libcxx/src/condition_variable.cpp | 16 +- libcxx/src/condition_variable_destructor.cpp | 4 +- libcxx/src/debug.cpp | 45 +- libcxx/src/exception.cpp | 6 +- libcxx/src/experimental/memory_resource.cpp | 18 +- .../src/experimental/memory_resource_init_helper.h | 2 +- libcxx/src/filesystem/directory_iterator.cpp | 25 +- libcxx/src/filesystem/filesystem_common.h | 50 +- libcxx/src/filesystem/int128_builtins.cpp | 4 +- libcxx/src/filesystem/operations.cpp | 82 +- libcxx/src/filesystem/posix_compat.h | 3 +- libcxx/src/format.cpp | 2 +- libcxx/src/functional.cpp | 2 +- libcxx/src/future.cpp | 22 +- libcxx/src/hash.cpp | 14 +- libcxx/src/include/atomic_support.h | 4 +- libcxx/src/include/config_elast.h | 2 + libcxx/src/include/ryu/common.h | 1 + libcxx/src/include/ryu/d2fixed.h | 4 +- libcxx/src/include/ryu/d2fixed_full_table.h | 2 +- libcxx/src/include/ryu/d2s.h | 2 +- libcxx/src/include/ryu/d2s_full_table.h | 2 +- libcxx/src/include/ryu/d2s_intrinsics.h | 5 +- libcxx/src/include/ryu/digit_table.h | 25 +- libcxx/src/include/ryu/f2s.h | 2 +- libcxx/src/include/ryu/ryu.h | 27 +- libcxx/src/include/to_chars_floating_point.h | 23 +- libcxx/src/ios.cpp | 24 +- libcxx/src/ios.instantiations.cpp | 15 +- libcxx/src/iostream.cpp | 8 +- libcxx/src/legacy_debug_handler.cpp | 54 + libcxx/src/legacy_pointer_safety.cpp | 2 +- libcxx/src/locale.cpp | 78 +- libcxx/src/memory.cpp | 52 +- libcxx/src/mutex.cpp | 25 +- libcxx/src/mutex_destructor.cpp | 10 +- libcxx/src/new.cpp | 2 +- libcxx/src/optional.cpp | 4 +- libcxx/src/random.cpp | 8 +- libcxx/src/random_shuffle.cpp | 15 +- libcxx/src/regex.cpp | 6 +- libcxx/src/ryu/d2fixed.cpp | 9 +- libcxx/src/ryu/d2s.cpp | 5 +- libcxx/src/ryu/f2s.cpp | 5 +- libcxx/src/shared_mutex.cpp | 7 +- libcxx/src/stdexcept.cpp | 9 +- libcxx/src/string.cpp | 331 +- libcxx/src/strstream.cpp | 21 +- libcxx/src/support/ibm/xlocale_zos.cpp | 17 +- libcxx/src/support/runtime/exception_fallback.ipp | 6 +- .../src/support/runtime/new_handler_fallback.ipp | 2 +- libcxx/src/system_error.cpp | 23 +- libcxx/src/thread.cpp | 22 +- libcxx/src/typeinfo.cpp | 3 +- libcxx/src/utility.cpp | 2 +- libcxx/src/valarray.cpp | 2 +- libcxx/src/variant.cpp | 2 +- libcxx/src/vector.cpp | 19 +- libunwind/include/__libunwind_config.h | 19 +- libunwind/include/libunwind.h | 47 +- libunwind/include/unwind.h | 2 +- libunwind/src/AddressSpace.hpp | 23 +- libunwind/src/DwarfInstructions.hpp | 47 +- libunwind/src/DwarfParser.hpp | 27 +- libunwind/src/EHHeaderParser.hpp | 3 +- libunwind/src/Registers.hpp | 532 +- libunwind/src/Unwind-EHABI.cpp | 9 +- libunwind/src/Unwind-seh.cpp | 6 +- libunwind/src/UnwindCursor.hpp | 743 +- libunwind/src/UnwindLevel1-gcc-ext.c | 7 +- libunwind/src/UnwindLevel1.c | 8 +- libunwind/src/UnwindRegistersRestore.S | 246 +- libunwind/src/UnwindRegistersSave.S | 116 +- libunwind/src/Unwind_AIXExtras.cpp | 63 + libunwind/src/assembly.h | 51 +- libunwind/src/cet_unwind.h | 2 +- libunwind/src/config.h | 24 +- libunwind/src/libunwind.cpp | 14 + libunwind/src/libunwind_ext.h | 4 + lld/COFF/Config.h | 3 +- lld/COFF/DebugTypes.cpp | 21 +- lld/COFF/Driver.cpp | 159 +- lld/COFF/Driver.h | 16 + lld/COFF/ICF.cpp | 4 +- lld/COFF/LLDMapFile.cpp | 2 +- lld/COFF/LTO.cpp | 1 - lld/COFF/MapFile.cpp | 2 +- lld/COFF/Options.td | 17 +- lld/COFF/PDB.cpp | 2 + lld/COFF/SymbolTable.cpp | 1 + lld/COFF/Writer.cpp | 12 +- lld/Common/CommonLinkerContext.cpp | 8 +- lld/Common/ErrorHandler.cpp | 15 + lld/Common/TargetOptionsCommandFlags.cpp | 1 + lld/ELF/AArch64ErrataFix.cpp | 11 +- lld/ELF/AArch64ErrataFix.h | 4 +- lld/ELF/ARMErrataFix.cpp | 12 +- lld/ELF/ARMErrataFix.h | 1 - lld/ELF/Arch/AArch64.cpp | 23 +- lld/ELF/Arch/AMDGPU.cpp | 25 +- lld/ELF/Arch/ARM.cpp | 12 +- lld/ELF/Arch/AVR.cpp | 8 +- lld/ELF/Arch/Hexagon.cpp | 5 +- lld/ELF/Arch/MSP430.cpp | 3 +- lld/ELF/Arch/Mips.cpp | 3 +- lld/ELF/Arch/MipsArchTree.cpp | 3 +- lld/ELF/Arch/PPC.cpp | 15 + lld/ELF/Arch/PPC64.cpp | 31 +- lld/ELF/Arch/RISCV.cpp | 6 +- lld/ELF/Arch/SPARCV9.cpp | 1 - lld/ELF/Arch/X86.cpp | 1 - lld/ELF/Arch/X86_64.cpp | 7 +- lld/ELF/CallGraphSort.cpp | 5 +- lld/ELF/Config.h | 65 +- lld/ELF/DWARF.cpp | 2 +- lld/ELF/Driver.cpp | 516 +- lld/ELF/Driver.h | 9 +- lld/ELF/DriverUtils.cpp | 4 +- lld/ELF/EhFrame.cpp | 6 +- lld/ELF/ICF.cpp | 18 +- lld/ELF/InputFiles.cpp | 430 +- lld/ELF/InputFiles.h | 54 +- lld/ELF/InputSection.cpp | 127 +- lld/ELF/InputSection.h | 39 +- lld/ELF/LTO.cpp | 48 +- lld/ELF/LinkerScript.cpp | 131 +- lld/ELF/LinkerScript.h | 14 +- lld/ELF/MapFile.cpp | 49 +- lld/ELF/MapFile.h | 2 - lld/ELF/MarkLive.cpp | 13 +- lld/ELF/Options.td | 45 +- lld/ELF/OutputSections.cpp | 78 +- lld/ELF/OutputSections.h | 27 +- lld/ELF/Relocations.cpp | 136 +- lld/ELF/Relocations.h | 4 +- lld/ELF/ScriptLexer.cpp | 16 +- lld/ELF/ScriptLexer.h | 3 +- lld/ELF/ScriptParser.cpp | 252 +- lld/ELF/ScriptParser.h | 2 +- lld/ELF/SymbolTable.cpp | 31 +- lld/ELF/SymbolTable.h | 7 +- lld/ELF/Symbols.cpp | 270 +- lld/ELF/Symbols.h | 266 +- lld/ELF/SyntheticSections.cpp | 123 +- lld/ELF/SyntheticSections.h | 30 +- lld/ELF/Target.h | 1 + lld/ELF/Thunks.cpp | 2 +- lld/ELF/Writer.cpp | 270 +- lld/ELF/Writer.h | 3 - lld/MachO/Arch/ARM.cpp | 4 +- lld/MachO/Arch/ARM64.cpp | 322 +- lld/MachO/Arch/ARM64Common.cpp | 41 +- lld/MachO/Arch/ARM64Common.h | 59 +- lld/MachO/Arch/ARM64_32.cpp | 8 +- lld/MachO/Arch/X86_64.cpp | 15 +- lld/MachO/ConcatOutputSection.cpp | 109 +- lld/MachO/ConcatOutputSection.h | 43 +- lld/MachO/Config.h | 41 +- lld/MachO/Driver.cpp | 316 +- lld/MachO/Driver.h | 3 +- lld/MachO/DriverUtils.cpp | 13 +- lld/MachO/Dwarf.cpp | 11 +- lld/MachO/Dwarf.h | 5 + lld/MachO/EhFrame.cpp | 140 + lld/MachO/EhFrame.h | 120 + lld/MachO/ExportTrie.cpp | 7 +- lld/MachO/ExportTrie.h | 1 + lld/MachO/ICF.cpp | 202 +- lld/MachO/ICF.h | 4 + lld/MachO/InputFiles.cpp | 774 +- lld/MachO/InputFiles.h | 66 +- lld/MachO/InputSection.cpp | 160 +- lld/MachO/InputSection.h | 105 +- lld/MachO/LTO.cpp | 22 +- lld/MachO/MapFile.cpp | 25 +- lld/MachO/MarkLive.cpp | 295 +- lld/MachO/ObjC.cpp | 2 +- lld/MachO/Options.td | 26 +- lld/MachO/OutputSection.cpp | 4 +- lld/MachO/Relocations.cpp | 67 +- lld/MachO/Relocations.h | 31 +- lld/MachO/SectionPriorities.cpp | 108 +- lld/MachO/SectionPriorities.h | 91 +- lld/MachO/SymbolTable.cpp | 173 +- lld/MachO/SymbolTable.h | 7 +- lld/MachO/Symbols.cpp | 23 +- lld/MachO/Symbols.h | 29 +- lld/MachO/SyntheticSections.cpp | 290 +- lld/MachO/SyntheticSections.h | 32 +- lld/MachO/Target.h | 13 +- lld/MachO/UnwindInfoSection.cpp | 248 +- lld/MachO/UnwindInfoSection.h | 6 +- lld/MachO/Writer.cpp | 73 +- lld/MachO/ld64-vs-lld.rst | 20 +- lld/docs/ELF/linker_script.rst | 30 +- lld/docs/ReleaseNotes.rst | 43 +- lld/docs/WebAssembly.rst | 15 + lld/docs/index.rst | 9 - lld/docs/ld.lld.1 | 10 +- lld/include/lld/Common/CommonLinkerContext.h | 4 - lld/include/lld/Common/Driver.h | 2 +- lld/include/lld/Common/ErrorHandler.h | 21 +- lld/include/lld/Core/AbsoluteAtom.h | 42 - lld/include/lld/Core/ArchiveLibraryFile.h | 46 - lld/include/lld/Core/Atom.h | 130 - lld/include/lld/Core/DefinedAtom.h | 373 - lld/include/lld/Core/Error.h | 67 - lld/include/lld/Core/File.h | 276 - lld/include/lld/Core/Instrumentation.h | 131 - lld/include/lld/Core/LinkingContext.h | 257 - lld/include/lld/Core/Node.h | 74 - lld/include/lld/Core/Pass.h | 42 - lld/include/lld/Core/PassManager.h | 47 - lld/include/lld/Core/Reader.h | 154 - lld/include/lld/Core/Reference.h | 117 - lld/include/lld/Core/Resolver.h | 105 - lld/include/lld/Core/SharedLibraryAtom.h | 52 - lld/include/lld/Core/SharedLibraryFile.h | 69 - lld/include/lld/Core/Simple.h | 270 - lld/include/lld/Core/SymbolTable.h | 95 - lld/include/lld/Core/UndefinedAtom.h | 67 - lld/include/lld/Core/Writer.h | 46 - lld/tools/lld/lld.cpp | 4 +- lldb/bindings/interface/SBCommandInterpreter.i | 3 + lldb/bindings/interface/SBCompileUnit.i | 16 + lldb/bindings/interface/SBDebugger.i | 21 + lldb/bindings/interface/SBProcess.i | 3 + lldb/bindings/interface/SBTarget.i | 3 + lldb/bindings/interface/SBType.i | 12 + lldb/bindings/macros.swig | 4 +- lldb/bindings/python/createPythonInit.py | 8 + lldb/bindings/python/python-extensions.swig | 1 + lldb/docs/python_api_enums.rst | 1 + lldb/include/lldb/API/SBCommandInterpreter.h | 4 + lldb/include/lldb/API/SBCompileUnit.h | 3 + lldb/include/lldb/API/SBDebugger.h | 23 +- lldb/include/lldb/API/SBFileSpec.h | 1 + lldb/include/lldb/API/SBProcess.h | 16 +- lldb/include/lldb/API/SBTarget.h | 2 + lldb/include/lldb/API/SBTrace.h | 6 +- lldb/include/lldb/API/SBType.h | 2 + lldb/include/lldb/Breakpoint/Breakpoint.h | 6 +- lldb/include/lldb/Breakpoint/BreakpointOptions.h | 2 +- lldb/include/lldb/Breakpoint/WatchpointOptions.h | 2 +- lldb/include/lldb/Core/Address.h | 13 +- lldb/include/lldb/Core/Communication.h | 4 +- lldb/include/lldb/Core/DataFileCache.h | 31 +- lldb/include/lldb/Core/Debugger.h | 122 +- lldb/include/lldb/Core/DebuggerEvents.h | 87 + lldb/include/lldb/Core/Declaration.h | 2 +- lldb/include/lldb/Core/Disassembler.h | 4 +- lldb/include/lldb/Core/IOHandler.h | 20 +- lldb/include/lldb/Core/LoadedModuleInfoList.h | 2 +- lldb/include/lldb/Core/Mangled.h | 11 +- lldb/include/lldb/Core/Module.h | 13 +- lldb/include/lldb/Core/ModuleList.h | 2 + lldb/include/lldb/Core/ModuleSpec.h | 17 +- lldb/include/lldb/Core/PluginManager.h | 24 +- lldb/include/lldb/Core/RichManglingContext.h | 29 +- lldb/include/lldb/Core/StreamAsynchronousIO.h | 2 +- lldb/include/lldb/Core/StructuredDataImpl.h | 2 +- lldb/include/lldb/Core/Value.h | 8 +- lldb/include/lldb/Core/ValueObject.h | 4 +- lldb/include/lldb/Core/ValueObjectDynamicValue.h | 2 +- lldb/include/lldb/Core/dwarf.h | 7 +- .../lldb/DataFormatters/DumpValueObjectOptions.h | 3 +- lldb/include/lldb/DataFormatters/FormatClasses.h | 2 +- lldb/include/lldb/DataFormatters/TypeCategoryMap.h | 9 +- .../lldb/DataFormatters/ValueObjectPrinter.h | 2 + lldb/include/lldb/Expression/DWARFExpression.h | 18 +- lldb/include/lldb/Host/Config.h.cmake | 2 + lldb/include/lldb/Host/Debug.h | 8 +- lldb/include/lldb/Host/Editline.h | 17 +- lldb/include/lldb/Host/File.h | 4 +- lldb/include/lldb/Host/FileSystem.h | 41 +- lldb/include/lldb/Host/Host.h | 62 +- lldb/include/lldb/Host/HostNativeProcessBase.h | 4 +- lldb/include/lldb/Host/HostProcess.h | 4 +- lldb/include/lldb/Host/MainLoop.h | 7 + lldb/include/lldb/Host/MainLoopBase.h | 7 + lldb/include/lldb/Host/ProcessLaunchInfo.h | 15 +- lldb/include/lldb/Host/ThreadLauncher.h | 13 +- .../lldb/Host/common/NativeProcessProtocol.h | 23 +- .../lldb/Host/common/NativeRegisterContext.h | 2 +- lldb/include/lldb/Host/posix/HostProcessPosix.h | 4 +- lldb/include/lldb/Interpreter/CommandInterpreter.h | 65 +- lldb/include/lldb/Interpreter/CommandObject.h | 26 +- .../lldb/Interpreter/CommandObjectMultiword.h | 8 +- .../include/lldb/Interpreter/CommandReturnObject.h | 3 + .../lldb/Interpreter/OptionGroupMemoryTag.h | 44 + .../Interpreter/OptionGroupValueObjectDisplay.h | 3 +- lldb/include/lldb/Interpreter/OptionValue.h | 1 - .../lldb/Interpreter/OptionValueDictionary.h | 6 +- .../lldb/Interpreter/OptionValueProperties.h | 4 + lldb/include/lldb/Interpreter/OptionValueString.h | 5 + lldb/include/lldb/Interpreter/Options.h | 2 +- lldb/include/lldb/Interpreter/ScriptedInterface.h | 6 +- .../lldb/Interpreter/ScriptedProcessInterface.h | 3 +- lldb/include/lldb/Symbol/CompactUnwindInfo.h | 9 +- lldb/include/lldb/Symbol/DWARFCallFrameInfo.h | 3 +- lldb/include/lldb/Symbol/LineTable.h | 4 +- lldb/include/lldb/Symbol/LocateSymbolFile.h | 2 + lldb/include/lldb/Symbol/ObjectFile.h | 9 +- lldb/include/lldb/Symbol/SymbolFile.h | 145 +- lldb/include/lldb/Symbol/SymbolFileOnDemand.h | 235 + lldb/include/lldb/Symbol/Type.h | 8 +- lldb/include/lldb/Symbol/Variable.h | 4 +- lldb/include/lldb/Target/ABI.h | 14 + lldb/include/lldb/Target/DynamicLoader.h | 4 + lldb/include/lldb/Target/Language.h | 11 + lldb/include/lldb/Target/LanguageRuntime.h | 2 +- lldb/include/lldb/Target/MemoryRegionInfo.h | 20 +- lldb/include/lldb/Target/MemoryTagManager.h | 2 +- lldb/include/lldb/Target/Platform.h | 79 +- lldb/include/lldb/Target/Process.h | 99 +- lldb/include/lldb/Target/ProcessStructReader.h | 2 +- lldb/include/lldb/Target/RegisterCheckpoint.h | 6 +- lldb/include/lldb/Target/RegisterContext.h | 2 +- lldb/include/lldb/Target/RegisterContextUnwind.h | 5 +- lldb/include/lldb/Target/SectionLoadHistory.h | 2 +- lldb/include/lldb/Target/SectionLoadList.h | 2 +- lldb/include/lldb/Target/StackFrameList.h | 3 + lldb/include/lldb/Target/StackID.h | 4 +- lldb/include/lldb/Target/Statistics.h | 9 + lldb/include/lldb/Target/SystemRuntime.h | 2 +- lldb/include/lldb/Target/Target.h | 75 +- lldb/include/lldb/Target/Thread.h | 7 +- lldb/include/lldb/Target/ThreadPlanStack.h | 6 + lldb/include/lldb/Target/Trace.h | 330 +- lldb/include/lldb/Target/TraceCursor.h | 256 +- lldb/include/lldb/Target/TraceDumper.h | 120 + lldb/include/lldb/Target/TraceInstructionDumper.h | 77 - lldb/include/lldb/Target/UnixSignals.h | 5 + lldb/include/lldb/Target/UnwindLLDB.h | 2 +- lldb/include/lldb/Utility/AnsiTerminal.h | 99 +- lldb/include/lldb/Utility/ArchSpec.h | 11 + lldb/include/lldb/Utility/DataBuffer.h | 104 +- lldb/include/lldb/Utility/DataBufferHeap.h | 28 +- lldb/include/lldb/Utility/DataBufferLLVM.h | 53 +- lldb/include/lldb/Utility/Event.h | 4 +- lldb/include/lldb/Utility/GDBRemote.h | 2 +- lldb/include/lldb/Utility/Instrumentation.h | 2 - lldb/include/lldb/Utility/LLDBLog.h | 61 + lldb/include/lldb/Utility/Log.h | 105 +- lldb/include/lldb/Utility/Logging.h | 97 - lldb/include/lldb/Utility/ProcessInfo.h | 4 +- lldb/include/lldb/Utility/RangeMap.h | 50 +- lldb/include/lldb/Utility/Reproducer.h | 14 - lldb/include/lldb/Utility/ReproducerProvider.h | 32 +- lldb/include/lldb/Utility/StreamCallback.h | 35 - .../lldb/Utility/StringExtractorGDBRemote.h | 7 +- lldb/include/lldb/Utility/StructuredData.h | 8 +- lldb/include/lldb/Utility/TraceGDBRemotePackets.h | 39 +- .../lldb/Utility/TraceIntelPTGDBRemotePackets.h | 88 +- lldb/include/lldb/Version/Version.inc.in | 2 +- lldb/include/lldb/lldb-enumerations.h | 28 + lldb/include/lldb/lldb-forward.h | 2 + lldb/include/lldb/lldb-private-enumerations.h | 8 + lldb/include/lldb/lldb-private-interfaces.h | 8 +- lldb/include/lldb/lldb-types.h | 1 + lldb/source/API/SBBroadcaster.cpp | 2 +- lldb/source/API/SBCommandInterpreter.cpp | 31 +- lldb/source/API/SBCompileUnit.cpp | 14 + lldb/source/API/SBDebugger.cpp | 99 +- lldb/source/API/SBFrame.cpp | 9 +- lldb/source/API/SBHostOS.cpp | 4 +- lldb/source/API/SBListener.cpp | 7 +- lldb/source/API/SBMemoryRegionInfo.cpp | 8 +- lldb/source/API/SBMemoryRegionInfoList.cpp | 3 +- lldb/source/API/SBModule.cpp | 4 +- lldb/source/API/SBPlatform.cpp | 17 +- lldb/source/API/SBProcess.cpp | 12 +- lldb/source/API/SBQueue.cpp | 7 +- lldb/source/API/SBReproducer.cpp | 15 +- lldb/source/API/SBStream.cpp | 3 +- lldb/source/API/SBTarget.cpp | 19 +- lldb/source/API/SBTrace.cpp | 17 + lldb/source/API/SBType.cpp | 8 + lldb/source/API/SBValue.cpp | 6 +- lldb/source/API/SBValueList.cpp | 4 +- lldb/source/Breakpoint/Breakpoint.cpp | 44 +- lldb/source/Breakpoint/BreakpointID.cpp | 2 +- lldb/source/Breakpoint/BreakpointIDList.cpp | 12 +- lldb/source/Breakpoint/BreakpointList.cpp | 3 +- lldb/source/Breakpoint/BreakpointLocation.cpp | 10 +- .../Breakpoint/BreakpointLocationCollection.cpp | 10 +- lldb/source/Breakpoint/BreakpointLocationList.cpp | 3 +- lldb/source/Breakpoint/BreakpointOptions.cpp | 22 +- lldb/source/Breakpoint/BreakpointResolver.cpp | 17 +- .../Breakpoint/BreakpointResolverAddress.cpp | 10 +- .../Breakpoint/BreakpointResolverFileLine.cpp | 13 +- lldb/source/Breakpoint/BreakpointResolverName.cpp | 10 +- lldb/source/Breakpoint/BreakpointSite.cpp | 6 +- lldb/source/Breakpoint/BreakpointSiteList.cpp | 2 +- .../source/Breakpoint/StoppointCallbackContext.cpp | 2 +- lldb/source/Breakpoint/Watchpoint.cpp | 12 +- lldb/source/Breakpoint/WatchpointList.cpp | 2 +- lldb/source/Breakpoint/WatchpointOptions.cpp | 6 +- lldb/source/Commands/CommandObjectBreakpoint.cpp | 111 +- .../Commands/CommandObjectBreakpointCommand.cpp | 4 +- lldb/source/Commands/CommandObjectCommands.cpp | 63 +- lldb/source/Commands/CommandObjectDisassemble.cpp | 47 +- lldb/source/Commands/CommandObjectExpression.cpp | 5 +- lldb/source/Commands/CommandObjectFrame.cpp | 27 +- lldb/source/Commands/CommandObjectGUI.cpp | 26 +- lldb/source/Commands/CommandObjectHelp.h | 2 +- lldb/source/Commands/CommandObjectLog.cpp | 184 +- lldb/source/Commands/CommandObjectMemory.cpp | 286 +- lldb/source/Commands/CommandObjectMemoryTag.cpp | 4 +- lldb/source/Commands/CommandObjectMultiword.cpp | 16 +- lldb/source/Commands/CommandObjectPlatform.cpp | 196 +- lldb/source/Commands/CommandObjectProcess.cpp | 407 +- lldb/source/Commands/CommandObjectQuit.cpp | 5 +- lldb/source/Commands/CommandObjectRegexCommand.cpp | 70 +- lldb/source/Commands/CommandObjectRegexCommand.h | 5 + lldb/source/Commands/CommandObjectReproducer.cpp | 131 +- lldb/source/Commands/CommandObjectScript.h | 2 +- lldb/source/Commands/CommandObjectSettings.cpp | 18 +- lldb/source/Commands/CommandObjectSource.cpp | 30 +- lldb/source/Commands/CommandObjectTarget.cpp | 180 +- lldb/source/Commands/CommandObjectThread.cpp | 326 +- lldb/source/Commands/CommandObjectThreadUtil.cpp | 15 +- lldb/source/Commands/CommandObjectThreadUtil.h | 4 +- lldb/source/Commands/CommandObjectTrace.cpp | 59 +- lldb/source/Commands/CommandObjectType.cpp | 45 +- lldb/source/Commands/CommandObjectVersion.cpp | 8 +- lldb/source/Commands/CommandObjectWatchpoint.cpp | 10 +- .../Commands/CommandObjectWatchpointCommand.cpp | 2 +- lldb/source/Commands/Options.td | 108 +- lldb/source/Core/Address.cpp | 61 +- lldb/source/Core/AddressResolverFileLine.cpp | 8 +- lldb/source/Core/Communication.cpp | 64 +- lldb/source/Core/CoreProperties.td | 32 +- lldb/source/Core/DataFileCache.cpp | 64 +- lldb/source/Core/Debugger.cpp | 357 +- lldb/source/Core/DebuggerEvents.cpp | 81 + lldb/source/Core/DumpDataExtractor.cpp | 4 +- lldb/source/Core/DynamicLoader.cpp | 70 +- lldb/source/Core/FileSpecList.cpp | 1 - lldb/source/Core/FormatEntity.cpp | 13 +- lldb/source/Core/IOHandler.cpp | 51 +- lldb/source/Core/IOHandlerCursesGUI.cpp | 246 +- lldb/source/Core/Mangled.cpp | 33 +- lldb/source/Core/Module.cpp | 143 +- lldb/source/Core/ModuleList.cpp | 13 +- lldb/source/Core/PluginManager.cpp | 48 +- lldb/source/Core/RichManglingContext.cpp | 58 +- lldb/source/Core/Section.cpp | 24 +- lldb/source/Core/SourceLocationSpec.cpp | 2 +- lldb/source/Core/SourceManager.cpp | 23 +- lldb/source/Core/StreamAsynchronousIO.cpp | 5 +- lldb/source/Core/StreamFile.cpp | 3 +- lldb/source/Core/Value.cpp | 14 +- lldb/source/Core/ValueObject.cpp | 34 +- lldb/source/Core/ValueObjectChild.cpp | 2 +- lldb/source/Core/ValueObjectDynamicValue.cpp | 4 +- lldb/source/Core/ValueObjectRegister.cpp | 38 +- lldb/source/Core/ValueObjectSyntheticFilter.cpp | 8 +- .../DataFormatters/DumpValueObjectOptions.cpp | 3 +- lldb/source/DataFormatters/FormatManager.cpp | 17 +- lldb/source/DataFormatters/StringPrinter.cpp | 4 +- lldb/source/DataFormatters/TypeCategoryMap.cpp | 4 +- lldb/source/DataFormatters/TypeFormat.cpp | 3 +- lldb/source/DataFormatters/ValueObjectPrinter.cpp | 17 +- lldb/source/DataFormatters/VectorType.cpp | 9 +- lldb/source/Expression/DWARFExpression.cpp | 264 +- lldb/source/Expression/ExpressionVariable.cpp | 3 +- lldb/source/Expression/FunctionCaller.cpp | 12 +- lldb/source/Expression/IRExecutionUnit.cpp | 48 +- lldb/source/Expression/IRInterpreter.cpp | 68 +- lldb/source/Expression/IRMemoryMap.cpp | 13 +- lldb/source/Expression/LLVMUserExpression.cpp | 6 +- lldb/source/Expression/Materializer.cpp | 67 +- lldb/source/Expression/REPL.cpp | 1 + lldb/source/Expression/UserExpression.cpp | 24 +- lldb/source/Host/common/Editline.cpp | 31 +- lldb/source/Host/common/File.cpp | 27 +- lldb/source/Host/common/FileSystem.cpp | 121 +- lldb/source/Host/common/Host.cpp | 222 +- lldb/source/Host/common/HostInfoBase.cpp | 41 +- lldb/source/Host/common/HostNativeThreadBase.cpp | 17 +- lldb/source/Host/common/HostProcess.cpp | 11 +- lldb/source/Host/common/MainLoop.cpp | 8 + .../Host/common/MonitoringProcessLauncher.cpp | 6 +- lldb/source/Host/common/NativeProcessProtocol.cpp | 33 +- lldb/source/Host/common/NativeRegisterContext.cpp | 7 +- lldb/source/Host/common/ProcessLaunchInfo.cpp | 28 +- lldb/source/Host/common/PseudoTerminal.cpp | 40 +- lldb/source/Host/common/Socket.cpp | 11 +- lldb/source/Host/common/TCPSocket.cpp | 7 +- lldb/source/Host/common/ThreadLauncher.cpp | 18 +- lldb/source/Host/common/UDPSocket.cpp | 3 +- lldb/source/Host/netbsd/HostNetBSD.cpp | 11 +- .../Host/posix/ConnectionFileDescriptorPosix.cpp | 33 +- lldb/source/Host/posix/FileSystemPosix.cpp | 2 - lldb/source/Host/posix/HostProcessPosix.cpp | 30 +- .../Initialization/SystemInitializerCommon.cpp | 37 +- lldb/source/Interpreter/CommandInterpreter.cpp | 117 +- lldb/source/Interpreter/CommandObject.cpp | 18 +- lldb/source/Interpreter/CommandReturnObject.cpp | 8 +- lldb/source/Interpreter/InterpreterProperties.td | 4 + lldb/source/Interpreter/OptionGroupMemoryTag.cpp | 60 + lldb/source/Interpreter/OptionGroupPlatform.cpp | 27 +- .../Interpreter/OptionGroupValueObjectDisplay.cpp | 12 +- lldb/source/Interpreter/OptionValueDictionary.cpp | 25 +- .../Interpreter/OptionValueFileColonLine.cpp | 5 +- lldb/source/Interpreter/OptionValueFileSpec.cpp | 4 +- lldb/source/Interpreter/OptionValueProperties.cpp | 11 + lldb/source/Interpreter/Options.cpp | 192 +- lldb/source/Interpreter/Property.cpp | 7 +- lldb/source/Interpreter/ScriptInterpreter.cpp | 8 +- lldb/source/Interpreter/embedded_interpreter.py | 73 +- lldb/source/Plugins/ABI/AArch64/ABIAArch64.cpp | 5 +- lldb/source/Plugins/ABI/AArch64/ABIAArch64.h | 4 +- .../source/Plugins/ABI/AArch64/ABIMacOSX_arm64.cpp | 10 +- lldb/source/Plugins/ABI/AArch64/ABISysV_arm64.cpp | 30 +- lldb/source/Plugins/ABI/ARC/ABISysV_arc.cpp | 6 +- lldb/source/Plugins/ABI/ARM/ABISysV_arm.cpp | 2 +- lldb/source/Plugins/ABI/Mips/ABISysV_mips.cpp | 5 +- lldb/source/Plugins/ABI/Mips/ABISysV_mips64.cpp | 7 +- lldb/source/Plugins/ABI/PowerPC/ABISysV_ppc.cpp | 5 +- lldb/source/Plugins/ABI/PowerPC/ABISysV_ppc64.cpp | 12 +- lldb/source/Plugins/ABI/SystemZ/ABISysV_s390x.cpp | 3 +- lldb/source/Plugins/ABI/X86/ABISysV_x86_64.cpp | 5 +- lldb/source/Plugins/ABI/X86/ABIWindows_x86_64.cpp | 5 +- lldb/source/Plugins/ABI/X86/ABIX86.cpp | 2 +- .../Plugins/Architecture/Mips/ArchitectureMips.cpp | 3 +- .../Disassembler/LLVMC/DisassemblerLLVMC.cpp | 40 +- .../Hexagon-DYLD/DynamicLoaderHexagonDYLD.cpp | 13 +- .../DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp | 24 +- .../POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp | 109 +- .../POSIX-DYLD/DynamicLoaderPOSIXDYLD.h | 5 + .../Windows-DYLD/DynamicLoaderWindowsDYLD.cpp | 45 +- .../wasm-DYLD/DynamicLoaderWasmDYLD.cpp | 19 +- .../wasm-DYLD/DynamicLoaderWasmDYLD.h | 5 + .../Clang/ASTResultSynthesizer.cpp | 15 +- .../ExpressionParser/Clang/ClangASTImporter.cpp | 31 +- .../ExpressionParser/Clang/ClangASTSource.cpp | 33 +- .../ExpressionParser/Clang/ClangDeclVendor.h | 2 +- .../Clang/ClangExpressionDeclMap.cpp | 57 +- .../Clang/ClangExpressionParser.cpp | 9 +- .../Clang/ClangExpressionSourceCode.cpp | 5 +- .../ExpressionParser/Clang/ClangFunctionCaller.cpp | 3 +- .../Plugins/ExpressionParser/Clang/ClangHost.cpp | 7 +- .../Clang/ClangModulesDeclVendor.cpp | 20 +- .../ExpressionParser/Clang/ClangUserExpression.cpp | 15 +- .../ExpressionParser/Clang/CxxModuleHandler.cpp | 3 +- .../ExpressionParser/Clang/IRDynamicChecks.cpp | 14 +- .../ExpressionParser/Clang/IRDynamicChecks.h | 2 +- .../Plugins/ExpressionParser/Clang/IRForTarget.cpp | 117 +- .../ExpressionParser/Clang/NameSearchContext.cpp | 3 +- .../Instruction/ARM/EmulateInstructionARM.cpp | 56 +- .../Instruction/MIPS/EmulateInstructionMIPS.cpp | 137 +- .../Instruction/MIPS/EmulateInstructionMIPS.h | 2 +- .../MIPS64/EmulateInstructionMIPS64.cpp | 142 +- .../Instruction/MIPS64/EmulateInstructionMIPS64.h | 2 +- .../Instruction/PPC64/EmulateInstructionPPC64.cpp | 14 +- .../ASan/InstrumentationRuntimeASan.cpp | 10 +- .../TSan/InstrumentationRuntimeTSan.cpp | 8 +- .../UBSan/InstrumentationRuntimeUBSan.cpp | 8 +- lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp | 7 +- .../Plugins/Language/CPlusPlus/BlockPointer.cpp | 6 +- .../Language/CPlusPlus/CPlusPlusLanguage.cpp | 55 +- .../Plugins/Language/CPlusPlus/CPlusPlusLanguage.h | 5 + lldb/source/Plugins/Language/CPlusPlus/LibCxx.cpp | 116 +- lldb/source/Plugins/Language/CPlusPlus/LibCxx.h | 8 + .../Plugins/Language/CPlusPlus/LibCxxAtomic.cpp | 4 +- .../Language/CPlusPlus/LibCxxInitializerList.cpp | 17 +- .../Plugins/Language/CPlusPlus/LibCxxList.cpp | 6 +- .../Plugins/Language/CPlusPlus/LibCxxMap.cpp | 50 +- .../Plugins/Language/CPlusPlus/LibCxxSpan.cpp | 151 + .../Language/CPlusPlus/LibCxxUnorderedMap.cpp | 10 +- .../Plugins/Language/CPlusPlus/LibCxxVector.cpp | 17 +- .../Plugins/Language/CPlusPlus/LibStdcpp.cpp | 6 +- lldb/source/Plugins/Language/ObjC/CF.cpp | 10 +- lldb/source/Plugins/Language/ObjC/Cocoa.cpp | 13 +- lldb/source/Plugins/Language/ObjC/NSArray.cpp | 16 +- lldb/source/Plugins/Language/ObjC/NSDictionary.cpp | 64 +- lldb/source/Plugins/Language/ObjC/NSError.cpp | 4 +- lldb/source/Plugins/Language/ObjC/NSException.cpp | 16 +- lldb/source/Plugins/Language/ObjC/NSIndexPath.cpp | 16 +- lldb/source/Plugins/Language/ObjC/NSSet.cpp | 28 +- .../CPlusPlus/CPPLanguageRuntime.cpp | 40 +- .../LanguageRuntime/CPlusPlus/CPPLanguageRuntime.h | 2 +- .../ItaniumABI/ItaniumABILanguageRuntime.cpp | 4 +- .../AppleObjCClassDescriptorV2.cpp | 6 +- .../ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp | 25 +- .../ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp | 7 +- .../ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp | 7 +- .../ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp | 346 +- .../ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h | 51 +- .../AppleObjCTrampolineHandler.cpp | 529 +- .../AppleObjCRuntime/AppleObjCTrampolineHandler.h | 22 +- .../AppleThreadPlanStepThroughObjCTrampoline.cpp | 42 +- .../AppleThreadPlanStepThroughObjCTrampoline.h | 10 +- .../LanguageRuntime/ObjC/ObjCLanguageRuntime.cpp | 28 +- .../LanguageRuntime/ObjC/ObjCLanguageRuntime.h | 54 +- .../RenderScriptExpressionOpts.cpp | 4 +- .../RenderScriptExpressionOpts.h | 1 + .../RenderScriptRuntime/RenderScriptRuntime.cpp | 141 +- .../RenderScriptScriptGroup.cpp | 5 +- .../RenderScriptx86ABIFixups.cpp | 48 +- .../MemoryHistory/asan/MemoryHistoryASan.cpp | 10 +- .../ObjectFile/Breakpad/ObjectFileBreakpad.cpp | 4 +- .../ObjectFile/Breakpad/ObjectFileBreakpad.h | 4 +- lldb/source/Plugins/ObjectFile/ELF/ELFHeader.cpp | 3 + .../Plugins/ObjectFile/ELF/ObjectFileELF.cpp | 132 +- lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h | 12 +- .../Plugins/ObjectFile/JIT/ObjectFileJIT.cpp | 4 +- lldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.h | 4 +- .../ObjectFile/Minidump/ObjectFileMinidump.cpp | 4 +- .../ObjectFile/Minidump/ObjectFileMinidump.h | 4 +- .../Plugins/ObjectFile/PDB/ObjectFilePDB.cpp | 4 +- lldb/source/Plugins/ObjectFile/PDB/ObjectFilePDB.h | 4 +- .../Plugins/ObjectFile/wasm/ObjectFileWasm.cpp | 15 +- .../Plugins/ObjectFile/wasm/ObjectFileWasm.h | 8 +- .../Python/OperatingSystemPython.cpp | 9 +- .../Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp | 8 +- .../Plugins/Platform/FreeBSD/PlatformFreeBSD.h | 3 +- .../Plugins/Platform/NetBSD/PlatformNetBSD.cpp | 8 +- .../Plugins/Platform/NetBSD/PlatformNetBSD.h | 3 +- .../Plugins/Platform/OpenBSD/PlatformOpenBSD.cpp | 8 +- .../Plugins/Platform/OpenBSD/PlatformOpenBSD.h | 3 +- .../Plugins/Platform/POSIX/PlatformPOSIX.cpp | 110 +- .../Plugins/Platform/QemuUser/PlatformQemuUser.cpp | 19 +- .../Plugins/Platform/QemuUser/PlatformQemuUser.h | 5 +- .../gdb-server/PlatformRemoteGDBServer.cpp | 27 +- .../Platform/gdb-server/PlatformRemoteGDBServer.h | 3 +- .../Process/FreeBSD/NativeProcessFreeBSD.cpp | 4 + .../FreeBSD/NativeRegisterContextFreeBSD_arm.cpp | 4 +- .../FreeBSD/NativeRegisterContextFreeBSD_arm.h | 2 +- .../FreeBSD/NativeRegisterContextFreeBSD_arm64.cpp | 4 +- .../FreeBSD/NativeRegisterContextFreeBSD_arm64.h | 2 +- .../NativeRegisterContextFreeBSD_mips64.cpp | 4 +- .../FreeBSD/NativeRegisterContextFreeBSD_mips64.h | 2 +- .../NativeRegisterContextFreeBSD_powerpc.cpp | 4 +- .../FreeBSD/NativeRegisterContextFreeBSD_powerpc.h | 2 +- .../NativeRegisterContextFreeBSD_x86_64.cpp | 4 +- .../FreeBSD/NativeRegisterContextFreeBSD_x86_64.h | 2 +- .../Process/FreeBSD/NativeThreadFreeBSD.cpp | 15 +- .../NetBSD/NativeRegisterContextNetBSD_x86_64.cpp | 4 +- .../NetBSD/NativeRegisterContextNetBSD_x86_64.h | 2 +- .../Plugins/Process/NetBSD/NativeThreadNetBSD.cpp | 15 +- .../Plugins/Process/POSIX/NativeProcessELF.cpp | 9 +- .../Plugins/Process/POSIX/NativeProcessELF.h | 2 + .../source/Plugins/Process/POSIX/ProcessPOSIXLog.h | 6 +- .../Plugins/Process/Utility/HistoryThread.cpp | 5 +- .../Plugins/Process/Utility/LinuxProcMaps.cpp | 10 +- .../Utility/NativeRegisterContextDBReg_arm64.cpp | 27 +- .../Utility/NativeRegisterContextDBReg_x86.cpp | 5 +- .../Process/Utility/RegisterContextDarwin_arm.cpp | 2 +- .../Process/Utility/RegisterContextDarwin_arm.h | 2 +- .../Utility/RegisterContextDarwin_arm64.cpp | 2 +- .../Process/Utility/RegisterContextDarwin_arm64.h | 2 +- .../Process/Utility/RegisterContextDarwin_i386.cpp | 2 +- .../Process/Utility/RegisterContextDarwin_i386.h | 2 +- .../Utility/RegisterContextDarwin_x86_64.cpp | 2 +- .../Process/Utility/RegisterContextDarwin_x86_64.h | 2 +- .../Process/Utility/RegisterContextDummy.cpp | 3 +- .../Plugins/Process/Utility/RegisterContextDummy.h | 2 +- .../Process/Utility/RegisterContextHistory.cpp | 2 +- .../Process/Utility/RegisterContextHistory.h | 2 +- .../Process/Utility/RegisterContextMach_arm.h | 2 +- .../Process/Utility/RegisterContextMach_i386.h | 2 +- .../Process/Utility/RegisterContextMach_x86_64.h | 2 +- .../Process/Utility/RegisterContextMemory.cpp | 11 +- .../Process/Utility/RegisterContextMemory.h | 3 +- .../Utility/RegisterContextThreadMemory.cpp | 2 +- .../Process/Utility/RegisterContextThreadMemory.h | 2 +- .../Process/Utility/RegisterInfoPOSIX_arm64.cpp | 6 + .../Plugins/Process/Utility/RegisterInfos_arm64.h | 5 - .../Plugins/Process/elf-core/ProcessElfCore.cpp | 13 +- .../Plugins/Process/elf-core/ProcessElfCore.h | 8 +- .../elf-core/RegisterContextPOSIXCore_arm.cpp | 2 +- .../elf-core/RegisterContextPOSIXCore_arm.h | 2 +- .../elf-core/RegisterContextPOSIXCore_arm64.cpp | 2 +- .../elf-core/RegisterContextPOSIXCore_arm64.h | 2 +- .../elf-core/RegisterContextPOSIXCore_mips64.cpp | 2 +- .../elf-core/RegisterContextPOSIXCore_mips64.h | 2 +- .../elf-core/RegisterContextPOSIXCore_powerpc.cpp | 2 +- .../elf-core/RegisterContextPOSIXCore_powerpc.h | 2 +- .../elf-core/RegisterContextPOSIXCore_s390x.cpp | 2 +- .../elf-core/RegisterContextPOSIXCore_s390x.h | 2 +- .../elf-core/RegisterContextPOSIXCore_x86_64.cpp | 2 +- .../elf-core/RegisterContextPOSIXCore_x86_64.h | 2 +- .../Plugins/Process/elf-core/ThreadElfCore.cpp | 3 +- .../Process/gdb-remote/GDBRemoteClientBase.cpp | 2 +- .../Process/gdb-remote/GDBRemoteCommunication.cpp | 38 +- .../Process/gdb-remote/GDBRemoteCommunication.h | 5 +- .../gdb-remote/GDBRemoteCommunicationClient.cpp | 27 +- .../GDBRemoteCommunicationServerCommon.cpp | 5 +- .../GDBRemoteCommunicationServerCommon.h | 1 - .../GDBRemoteCommunicationServerLLGS.cpp | 703 +- .../gdb-remote/GDBRemoteCommunicationServerLLGS.h | 47 +- .../GDBRemoteCommunicationServerPlatform.cpp | 21 +- .../GDBRemoteCommunicationServerPlatform.h | 2 +- .../gdb-remote/GDBRemoteRegisterContext.cpp | 12 +- .../Process/gdb-remote/GDBRemoteRegisterContext.h | 2 +- .../Process/gdb-remote/ProcessGDBRemote.cpp | 311 +- .../Plugins/Process/gdb-remote/ProcessGDBRemote.h | 16 +- .../Process/gdb-remote/ProcessGDBRemoteLog.h | 2 + .../Plugins/Process/minidump/MinidumpParser.cpp | 31 +- .../Plugins/Process/minidump/ProcessMinidump.cpp | 17 +- .../Plugins/Process/minidump/ProcessMinidump.h | 6 +- .../minidump/RegisterContextMinidump_x86_32.cpp | 2 +- .../minidump/RegisterContextMinidump_x86_64.cpp | 2 +- .../Plugins/Process/scripted/ScriptedProcess.cpp | 163 +- .../Plugins/Process/scripted/ScriptedProcess.h | 9 +- .../Plugins/Process/scripted/ScriptedThread.cpp | 102 +- .../Plugins/Process/scripted/ScriptedThread.h | 2 + lldb/source/Plugins/REPL/Clang/ClangREPL.cpp | 2 +- .../ScriptInterpreter/Lua/ScriptInterpreterLua.cpp | 1 - .../ScriptInterpreter/Python/PythonDataObjects.cpp | 162 +- .../ScriptInterpreter/Python/PythonDataObjects.h | 15 +- .../ScriptInterpreter/Python/PythonReadline.cpp | 25 +- .../Python/ScriptInterpreterPython.cpp | 44 +- .../Python/ScriptedProcessPythonInterface.cpp | 19 +- .../Python/ScriptedProcessPythonInterface.h | 2 +- .../Python/ScriptedPythonInterface.cpp | 9 +- .../Python/ScriptedPythonInterface.h | 7 +- .../Python/ScriptedThreadPythonInterface.cpp | 10 +- .../DarwinLog/StructuredDataDarwinLog.cpp | 33 +- .../SymbolFile/Breakpad/SymbolFileBreakpad.cpp | 34 +- .../SymbolFile/Breakpad/SymbolFileBreakpad.h | 6 +- .../Plugins/SymbolFile/DWARF/AppleDWARFIndex.cpp | 1 + lldb/source/Plugins/SymbolFile/DWARF/DIERef.h | 2 +- .../Plugins/SymbolFile/DWARF/DWARFASTParser.cpp | 115 + .../Plugins/SymbolFile/DWARF/DWARFASTParser.h | 3 + .../SymbolFile/DWARF/DWARFASTParserClang.cpp | 408 +- .../DWARF/DWARFAbbreviationDeclaration.cpp | 4 +- .../Plugins/SymbolFile/DWARF/DWARFAttribute.cpp | 2 + lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp | 1 + .../Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp | 1 - .../Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp | 1 - .../SymbolFile/DWARF/DWARFDebugInfoEntry.cpp | 2 +- .../Plugins/SymbolFile/DWARF/DWARFDebugMacro.cpp | 1 + .../Plugins/SymbolFile/DWARF/DWARFDebugMacro.h | 6 +- .../Plugins/SymbolFile/DWARF/DWARFDeclContext.cpp | 2 + .../Plugins/SymbolFile/DWARF/DWARFFormValue.cpp | 1 + .../source/Plugins/SymbolFile/DWARF/DWARFIndex.cpp | 3 +- lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp | 42 +- lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h | 8 +- .../SymbolFile/DWARF/DebugNamesDWARFIndex.cpp | 5 +- .../Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp | 2 + .../Plugins/SymbolFile/DWARF/LogChannelDWARF.h | 2 + .../Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp | 30 +- lldb/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp | 13 +- .../Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp | 96 +- .../Plugins/SymbolFile/DWARF/SymbolFileDWARF.h | 5 +- .../SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp | 64 +- .../SymbolFile/DWARF/SymbolFileDWARFDebugMap.h | 9 +- .../SymbolFile/DWARF/UniqueDWARFASTType.cpp | 2 + .../NativePDB/CodeViewRegisterMapping.cpp | 194 + .../SymbolFile/NativePDB/CompileUnitIndex.cpp | 2 +- .../NativePDB/DWARFLocationExpression.cpp | 27 + .../SymbolFile/NativePDB/DWARFLocationExpression.h | 6 + .../Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp | 334 +- .../Plugins/SymbolFile/NativePDB/PdbAstBuilder.h | 10 +- .../NativePDB/PdbFPOProgramToDWARFExpression.cpp | 1 + .../Plugins/SymbolFile/NativePDB/PdbIndex.cpp | 23 +- .../source/Plugins/SymbolFile/NativePDB/PdbIndex.h | 1 - .../Plugins/SymbolFile/NativePDB/PdbUtil.cpp | 170 +- lldb/source/Plugins/SymbolFile/NativePDB/PdbUtil.h | 1 + .../SymbolFile/NativePDB/SymbolFileNativePDB.cpp | 216 +- .../SymbolFile/NativePDB/SymbolFileNativePDB.h | 6 +- .../SymbolFile/NativePDB/UdtRecordCompleter.cpp | 29 +- .../source/Plugins/SymbolFile/PDB/PDBASTParser.cpp | 25 +- .../PDB/PDBLocationToDWARFExpression.cpp | 1 + .../Plugins/SymbolFile/PDB/SymbolFilePDB.cpp | 56 +- lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h | 4 +- .../Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp | 4 +- .../Plugins/SymbolFile/Symtab/SymbolFileSymtab.h | 4 +- .../Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp | 2 +- .../SymbolVendor/PECOFF/SymbolVendorPECOFF.cpp | 137 + .../SymbolVendor/PECOFF/SymbolVendorPECOFF.h | 37 + .../Plugins/Trace/common/ThreadPostMortemTrace.cpp | 3 +- .../Plugins/Trace/common/ThreadPostMortemTrace.h | 8 +- .../Plugins/Trace/common/TraceJSONStructs.cpp | 106 - .../source/Plugins/Trace/common/TraceJSONStructs.h | 98 - .../Trace/common/TraceSessionFileParser.cpp | 172 - .../Plugins/Trace/common/TraceSessionFileParser.h | 93 - .../Plugins/Trace/common/TraceSessionSaver.cpp | 149 - .../Plugins/Trace/common/TraceSessionSaver.h | 112 - .../intel-pt/CommandObjectTraceStartIntelPT.cpp | 32 +- .../intel-pt/CommandObjectTraceStartIntelPT.h | 21 +- .../Plugins/Trace/intel-pt/DecodedThread.cpp | 245 +- lldb/source/Plugins/Trace/intel-pt/DecodedThread.h | 260 +- .../Plugins/Trace/intel-pt/IntelPTDecoder.cpp | 279 - .../source/Plugins/Trace/intel-pt/IntelPTDecoder.h | 87 - .../Plugins/Trace/intel-pt/LibiptDecoder.cpp | 380 + lldb/source/Plugins/Trace/intel-pt/LibiptDecoder.h | 100 + .../Trace/intel-pt/PerfContextSwitchDecoder.cpp | 288 + .../Trace/intel-pt/PerfContextSwitchDecoder.h | 145 + lldb/source/Plugins/Trace/intel-pt/TaskTimer.cpp | 24 + lldb/source/Plugins/Trace/intel-pt/TaskTimer.h | 80 + .../Plugins/Trace/intel-pt/ThreadDecoder.cpp | 55 + lldb/source/Plugins/Trace/intel-pt/ThreadDecoder.h | 53 + .../Plugins/Trace/intel-pt/TraceCursorIntelPT.cpp | 116 +- .../Plugins/Trace/intel-pt/TraceCursorIntelPT.h | 34 +- .../source/Plugins/Trace/intel-pt/TraceIntelPT.cpp | 410 +- lldb/source/Plugins/Trace/intel-pt/TraceIntelPT.h | 147 +- .../Trace/intel-pt/TraceIntelPTBundleLoader.cpp | 333 + .../Trace/intel-pt/TraceIntelPTBundleLoader.h | 120 + .../Trace/intel-pt/TraceIntelPTBundleSaver.cpp | 311 + .../Trace/intel-pt/TraceIntelPTBundleSaver.h | 43 + .../Plugins/Trace/intel-pt/TraceIntelPTConstants.h | 3 +- .../Trace/intel-pt/TraceIntelPTJSONStructs.cpp | 146 +- .../Trace/intel-pt/TraceIntelPTJSONStructs.h | 97 +- .../Trace/intel-pt/TraceIntelPTMultiCpuDecoder.cpp | 189 + .../Trace/intel-pt/TraceIntelPTMultiCpuDecoder.h | 89 + .../Plugins/Trace/intel-pt/TraceIntelPTOptions.td | 24 +- .../intel-pt/TraceIntelPTSessionFileParser.cpp | 69 - .../Trace/intel-pt/TraceIntelPTSessionFileParser.h | 58 - .../Trace/intel-pt/TraceIntelPTSessionSaver.cpp | 79 - .../Trace/intel-pt/TraceIntelPTSessionSaver.h | 57 - .../Plugins/Trace/intel-pt/forward-declarations.h | 4 + .../Plugins/TraceExporter/common/TraceHTR.cpp | 17 +- .../ctf/CommandObjectThreadTraceExportCTF.cpp | 15 +- .../Plugins/TypeSystem/Clang/TypeSystemClang.cpp | 38 +- .../Plugins/TypeSystem/Clang/TypeSystemClang.h | 1 - .../InstEmulation/UnwindAssemblyInstEmulation.cpp | 31 +- lldb/source/Symbol/Block.cpp | 3 +- lldb/source/Symbol/CompactUnwindInfo.cpp | 11 +- lldb/source/Symbol/CompileUnit.cpp | 9 +- lldb/source/Symbol/DWARFCallFrameInfo.cpp | 44 +- lldb/source/Symbol/Function.cpp | 19 +- lldb/source/Symbol/LocateSymbolFile.cpp | 49 +- lldb/source/Symbol/LocateSymbolFileMacOSX.cpp | 217 +- lldb/source/Symbol/ObjectFile.cpp | 29 +- lldb/source/Symbol/PostfixExpression.cpp | 1 + lldb/source/Symbol/Symbol.cpp | 25 +- lldb/source/Symbol/SymbolContext.cpp | 36 +- lldb/source/Symbol/SymbolFile.cpp | 124 +- lldb/source/Symbol/SymbolFileOnDemand.cpp | 590 + lldb/source/Symbol/Symtab.cpp | 22 +- lldb/source/Symbol/Type.cpp | 13 +- lldb/source/Symbol/UnwindPlan.cpp | 10 +- lldb/source/Symbol/Variable.cpp | 67 +- lldb/source/Target/ABI.cpp | 3 +- lldb/source/Target/AssertFrameRecognizer.cpp | 13 +- lldb/source/Target/DynamicRegisterInfo.cpp | 3 +- lldb/source/Target/ExecutionContext.cpp | 18 +- lldb/source/Target/Language.cpp | 8 + lldb/source/Target/LanguageRuntime.cpp | 5 +- lldb/source/Target/Memory.cpp | 13 +- lldb/source/Target/ModuleCache.cpp | 3 +- lldb/source/Target/PathMappingList.cpp | 10 +- lldb/source/Target/Platform.cpp | 399 +- lldb/source/Target/Process.cpp | 504 +- lldb/source/Target/ProcessTrace.cpp | 4 + lldb/source/Target/RegisterContextUnwind.cpp | 93 +- lldb/source/Target/RemoteAwarePlatform.cpp | 84 +- lldb/source/Target/SectionLoadList.cpp | 7 +- lldb/source/Target/StackFrame.cpp | 22 +- lldb/source/Target/StackFrameList.cpp | 9 +- lldb/source/Target/Statistics.cpp | 36 +- lldb/source/Target/StopInfo.cpp | 165 +- lldb/source/Target/Target.cpp | 380 +- lldb/source/Target/TargetList.cpp | 114 +- lldb/source/Target/TargetProperties.td | 17 +- lldb/source/Target/Thread.cpp | 33 +- lldb/source/Target/ThreadList.cpp | 13 +- lldb/source/Target/ThreadPlan.cpp | 17 +- lldb/source/Target/ThreadPlanBase.cpp | 3 +- lldb/source/Target/ThreadPlanCallFunction.cpp | 14 +- .../source/Target/ThreadPlanCallUserExpression.cpp | 4 +- lldb/source/Target/ThreadPlanPython.cpp | 13 +- lldb/source/Target/ThreadPlanRunToAddress.cpp | 3 +- lldb/source/Target/ThreadPlanShouldStopHere.cpp | 7 +- lldb/source/Target/ThreadPlanStack.cpp | 4 + lldb/source/Target/ThreadPlanStepInRange.cpp | 27 +- lldb/source/Target/ThreadPlanStepInstruction.cpp | 8 +- lldb/source/Target/ThreadPlanStepOut.cpp | 7 +- .../source/Target/ThreadPlanStepOverBreakpoint.cpp | 5 +- lldb/source/Target/ThreadPlanStepOverRange.cpp | 7 +- lldb/source/Target/ThreadPlanStepRange.cpp | 15 +- lldb/source/Target/ThreadPlanStepThrough.cpp | 9 +- lldb/source/Target/ThreadPlanStepUntil.cpp | 3 +- lldb/source/Target/ThreadPlanTracer.cpp | 7 +- lldb/source/Target/Trace.cpp | 477 +- lldb/source/Target/TraceCursor.cpp | 31 +- lldb/source/Target/TraceDumper.cpp | 389 + lldb/source/Target/TraceInstructionDumper.cpp | 292 - lldb/source/Target/UnixSignals.cpp | 30 +- lldb/source/Target/UnwindLLDB.cpp | 7 +- lldb/source/Utility/ArchSpec.cpp | 58 +- lldb/source/Utility/Args.cpp | 6 +- lldb/source/Utility/Broadcaster.cpp | 18 +- lldb/source/Utility/DataBufferHeap.cpp | 20 +- lldb/source/Utility/DataBufferLLVM.cpp | 27 +- lldb/source/Utility/DataExtractor.cpp | 10 +- lldb/source/Utility/FileSpec.cpp | 5 +- lldb/source/Utility/Instrumentation.cpp | 5 +- lldb/source/Utility/LLDBLog.cpp | 82 + lldb/source/Utility/Listener.cpp | 25 +- lldb/source/Utility/Log.cpp | 131 +- lldb/source/Utility/Logging.cpp | 89 - lldb/source/Utility/ProcessInfo.cpp | 12 +- lldb/source/Utility/Reproducer.cpp | 147 - lldb/source/Utility/ReproducerProvider.cpp | 41 +- lldb/source/Utility/SelectHelper.cpp | 12 +- lldb/source/Utility/Status.cpp | 3 +- lldb/source/Utility/Stream.cpp | 11 +- lldb/source/Utility/StreamCallback.cpp | 22 - lldb/source/Utility/StringExtractor.cpp | 6 +- lldb/source/Utility/StringExtractorGDBRemote.cpp | 19 +- lldb/source/Utility/TraceGDBRemotePackets.cpp | 52 +- .../Utility/TraceIntelPTGDBRemotePackets.cpp | 109 +- lldb/source/Utility/UriParser.cpp | 2 +- lldb/source/Utility/XcodeSDK.cpp | 5 +- lldb/tools/driver/Driver.cpp | 56 +- lldb/tools/lldb-server/LLDBServerUtilities.cpp | 24 +- lldb/tools/lldb-server/lldb-gdbserver.cpp | 4 +- lldb/tools/lldb-server/lldb-platform.cpp | 7 +- llvm/include/llvm-c/Core.h | 46 +- llvm/include/llvm-c/DisassemblerTypes.h | 16 +- llvm/include/llvm-c/Object.h | 32 +- llvm/include/llvm-c/Orc.h | 110 +- llvm/include/llvm-c/TargetMachine.h | 4 +- llvm/include/llvm-c/Transforms/Coroutines.h | 56 - llvm/include/llvm-c/Transforms/IPO.h | 3 - .../include/llvm-c/Transforms/PassManagerBuilder.h | 6 - llvm/include/llvm-c/Transforms/Scalar.h | 3 - llvm/include/llvm-c/blake3.h | 79 + llvm/include/llvm/ADT/APFloat.h | 3 +- llvm/include/llvm/ADT/APInt.h | 58 +- llvm/include/llvm/ADT/AddressRanges.h | 79 + llvm/include/llvm/ADT/ArrayRef.h | 41 +- llvm/include/llvm/ADT/BitmaskEnum.h | 12 +- llvm/include/llvm/ADT/BreadthFirstIterator.h | 2 +- llvm/include/llvm/ADT/DenseMap.h | 1 + llvm/include/llvm/ADT/EpochTracker.h | 4 +- llvm/include/llvm/ADT/EquivalenceClasses.h | 3 +- llvm/include/llvm/ADT/FloatingPointMode.h | 28 +- llvm/include/llvm/ADT/FoldingSet.h | 55 +- llvm/include/llvm/ADT/GenericCycleImpl.h | 54 +- llvm/include/llvm/ADT/GenericCycleInfo.h | 18 + llvm/include/llvm/ADT/IntervalMap.h | 34 +- llvm/include/llvm/ADT/IntrusiveRefCntPtr.h | 4 +- llvm/include/llvm/ADT/Optional.h | 195 +- llvm/include/llvm/ADT/PointerIntPair.h | 10 +- llvm/include/llvm/ADT/PointerSumType.h | 5 +- llvm/include/llvm/ADT/PointerUnion.h | 74 +- llvm/include/llvm/ADT/SCCIterator.h | 11 +- llvm/include/llvm/ADT/STLExtras.h | 56 +- llvm/include/llvm/ADT/SmallVector.h | 5 +- llvm/include/llvm/ADT/Statistic.h | 38 +- llvm/include/llvm/ADT/StringRef.h | 4 + llvm/include/llvm/ADT/Triple.h | 91 +- llvm/include/llvm/ADT/edit_distance.h | 38 +- llvm/include/llvm/Analysis/AliasAnalysis.h | 12 +- .../include/llvm/Analysis/AliasAnalysisEvaluator.h | 4 +- llvm/include/llvm/Analysis/AliasSetTracker.h | 7 - llvm/include/llvm/Analysis/AssumeBundleQueries.h | 6 +- llvm/include/llvm/Analysis/BasicAliasAnalysis.h | 2 - .../include/llvm/Analysis/BlockFrequencyInfoImpl.h | 24 +- llvm/include/llvm/Analysis/BranchProbabilityInfo.h | 2 - llvm/include/llvm/Analysis/CFGPrinter.h | 4 +- llvm/include/llvm/Analysis/CFLAliasAnalysisUtils.h | 2 + .../include/llvm/Analysis/CFLAndersAliasAnalysis.h | 2 +- .../include/llvm/Analysis/CFLSteensAliasAnalysis.h | 2 - llvm/include/llvm/Analysis/CGSCCPassManager.h | 24 +- llvm/include/llvm/Analysis/CallGraph.h | 5 +- llvm/include/llvm/Analysis/CallPrinter.h | 14 + llvm/include/llvm/Analysis/CaptureTracking.h | 35 +- llvm/include/llvm/Analysis/CmpInstAnalysis.h | 37 +- llvm/include/llvm/Analysis/CodeMetrics.h | 7 +- llvm/include/llvm/Analysis/ConstantFolding.h | 36 +- llvm/include/llvm/Analysis/ConstraintSystem.h | 19 +- llvm/include/llvm/Analysis/DDG.h | 4 +- llvm/include/llvm/Analysis/DDGPrinter.h | 3 +- llvm/include/llvm/Analysis/DOTGraphTraitsPass.h | 195 +- llvm/include/llvm/Analysis/Delinearization.h | 15 +- llvm/include/llvm/Analysis/DependenceAnalysis.h | 6 +- llvm/include/llvm/Analysis/DivergenceAnalysis.h | 8 +- llvm/include/llvm/Analysis/DomPrinter.h | 118 +- llvm/include/llvm/Analysis/DomTreeUpdater.h | 43 - llvm/include/llvm/Analysis/DominanceFrontierImpl.h | 1 - llvm/include/llvm/Analysis/EHPersonalities.h | 1 - .../llvm/Analysis/FunctionPropertiesAnalysis.h | 49 +- llvm/include/llvm/Analysis/GlobalsModRef.h | 11 +- .../include/llvm/Analysis/IRSimilarityIdentifier.h | 41 +- llvm/include/llvm/Analysis/IVDescriptors.h | 52 +- llvm/include/llvm/Analysis/IVUsers.h | 2 - llvm/include/llvm/Analysis/InlineAdvisor.h | 51 +- llvm/include/llvm/Analysis/InlineCost.h | 14 +- .../include/llvm/Analysis/InlineModelFeatureMaps.h | 4 +- llvm/include/llvm/Analysis/InlineOrder.h | 99 +- llvm/include/llvm/Analysis/InstSimplifyFolder.h | 141 +- llvm/include/llvm/Analysis/InstructionSimplify.h | 94 +- llvm/include/llvm/Analysis/IntervalIterator.h | 3 +- llvm/include/llvm/Analysis/LazyCallGraph.h | 11 +- llvm/include/llvm/Analysis/LazyValueInfo.h | 3 + llvm/include/llvm/Analysis/Loads.h | 4 +- llvm/include/llvm/Analysis/LoopAccessAnalysis.h | 91 +- llvm/include/llvm/Analysis/LoopAnalysisManager.h | 1 - llvm/include/llvm/Analysis/LoopCacheAnalysis.h | 24 +- llvm/include/llvm/Analysis/LoopInfo.h | 20 +- llvm/include/llvm/Analysis/LoopInfoImpl.h | 15 +- llvm/include/llvm/Analysis/LoopPass.h | 3 +- llvm/include/llvm/Analysis/LoopUnrollAnalyzer.h | 7 +- llvm/include/llvm/Analysis/MLInlineAdvisor.h | 36 +- llvm/include/llvm/Analysis/MLModelRunner.h | 21 +- llvm/include/llvm/Analysis/MemoryBuiltins.h | 33 +- llvm/include/llvm/Analysis/MemoryLocation.h | 1 + llvm/include/llvm/Analysis/MemorySSA.h | 48 +- llvm/include/llvm/Analysis/MemorySSAUpdater.h | 3 +- .../llvm/Analysis/ModelUnderTrainingRunner.h | 7 +- .../include/llvm/Analysis/ModuleDebugInfoPrinter.h | 2 +- llvm/include/llvm/Analysis/MustExecute.h | 2 +- .../include/llvm/Analysis/NoInferenceModelRunner.h | 12 +- llvm/include/llvm/Analysis/ObjCARCUtil.h | 4 +- llvm/include/llvm/Analysis/OverflowInstAnalysis.h | 4 +- llvm/include/llvm/Analysis/PhiValues.h | 1 - llvm/include/llvm/Analysis/PostDominators.h | 5 +- llvm/include/llvm/Analysis/ProfileSummaryInfo.h | 4 +- llvm/include/llvm/Analysis/PtrUseVisitor.h | 11 +- llvm/include/llvm/Analysis/RegionInfo.h | 6 +- llvm/include/llvm/Analysis/RegionInfoImpl.h | 4 +- llvm/include/llvm/Analysis/RegionIterator.h | 2 +- llvm/include/llvm/Analysis/RegionPass.h | 3 +- llvm/include/llvm/Analysis/RegionPrinter.h | 10 + .../include/llvm/Analysis/ReleaseModeModelRunner.h | 44 +- llvm/include/llvm/Analysis/ReplayInlineAdvisor.h | 14 +- llvm/include/llvm/Analysis/ScalarEvolution.h | 137 +- .../llvm/Analysis/ScalarEvolutionAliasAnalysis.h | 7 +- .../llvm/Analysis/ScalarEvolutionExpressions.h | 9 +- .../llvm/Analysis/ScalarEvolutionNormalization.h | 2 +- llvm/include/llvm/Analysis/ScalarFuncs.def | 117 + llvm/include/llvm/Analysis/SparsePropagation.h | 1 + llvm/include/llvm/Analysis/StackLifetime.h | 3 +- .../include/llvm/Analysis/SyncDependenceAnalysis.h | 6 +- llvm/include/llvm/Analysis/SyntheticCountsUtils.h | 2 +- llvm/include/llvm/Analysis/TargetFolder.h | 162 +- llvm/include/llvm/Analysis/TargetLibraryInfo.h | 14 +- llvm/include/llvm/Analysis/TargetTransformInfo.h | 139 +- .../llvm/Analysis/TargetTransformInfoImpl.h | 78 +- llvm/include/llvm/Analysis/TensorSpec.h | 132 + llvm/include/llvm/Analysis/TypeMetadataUtils.h | 2 +- llvm/include/llvm/Analysis/Utils/TFUtils.h | 102 +- llvm/include/llvm/Analysis/ValueLattice.h | 6 +- llvm/include/llvm/Analysis/ValueTracking.h | 40 +- llvm/include/llvm/Analysis/VectorUtils.h | 30 +- llvm/include/llvm/AsmParser/LLLexer.h | 2 +- llvm/include/llvm/AsmParser/LLParser.h | 23 +- llvm/include/llvm/AsmParser/LLToken.h | 98 +- llvm/include/llvm/AsmParser/Parser.h | 4 +- llvm/include/llvm/BinaryFormat/COFF.h | 5 +- llvm/include/llvm/BinaryFormat/DXContainer.h | 131 + llvm/include/llvm/BinaryFormat/Dwarf.h | 4 + llvm/include/llvm/BinaryFormat/DynamicTags.def | 1 + llvm/include/llvm/BinaryFormat/ELF.h | 90 +- .../llvm/BinaryFormat/ELFRelocs/LoongArch.def | 62 + llvm/include/llvm/BinaryFormat/GOFF.h | 33 + llvm/include/llvm/BinaryFormat/MachO.h | 45 +- llvm/include/llvm/BinaryFormat/Magic.h | 3 + llvm/include/llvm/BinaryFormat/Swift.def | 7 + llvm/include/llvm/BinaryFormat/Wasm.h | 22 +- llvm/include/llvm/BinaryFormat/XCOFF.h | 30 + llvm/include/llvm/Bitcode/BitcodeAnalyzer.h | 3 +- llvm/include/llvm/Bitcode/BitcodeReader.h | 7 +- llvm/include/llvm/Bitcode/BitcodeWriter.h | 2 +- llvm/include/llvm/Bitcode/BitcodeWriterPass.h | 1 - llvm/include/llvm/Bitcode/LLVMBitCodes.h | 27 +- llvm/include/llvm/Bitstream/BitCodeEnums.h | 90 + llvm/include/llvm/Bitstream/BitCodes.h | 71 +- llvm/include/llvm/Bitstream/BitstreamReader.h | 50 +- llvm/include/llvm/Bitstream/BitstreamWriter.h | 21 +- llvm/include/llvm/CodeGen/AccelTable.h | 8 +- llvm/include/llvm/CodeGen/Analysis.h | 5 +- llvm/include/llvm/CodeGen/AsmPrinter.h | 36 +- .../llvm/CodeGen/BasicBlockSectionsProfileReader.h | 109 + llvm/include/llvm/CodeGen/BasicTTIImpl.h | 248 +- llvm/include/llvm/CodeGen/CFIFixup.h | 38 + llvm/include/llvm/CodeGen/CalcSpillWeights.h | 12 - llvm/include/llvm/CodeGen/CallingConvLower.h | 2 - llvm/include/llvm/CodeGen/CodeGenCommonISel.h | 8 +- llvm/include/llvm/CodeGen/CodeGenPassBuilder.h | 11 +- llvm/include/llvm/CodeGen/CommandFlags.h | 14 +- llvm/include/llvm/CodeGen/DFAPacketizer.h | 3 +- .../llvm/CodeGen/DbgEntityHistoryCalculator.h | 2 +- llvm/include/llvm/CodeGen/DwarfStringPoolEntry.h | 94 +- llvm/include/llvm/CodeGen/FastISel.h | 11 +- llvm/include/llvm/CodeGen/FaultMaps.h | 1 - llvm/include/llvm/CodeGen/FunctionLoweringInfo.h | 4 + .../llvm/CodeGen/GlobalISel/CSEMIRBuilder.h | 2 +- .../include/llvm/CodeGen/GlobalISel/CallLowering.h | 5 +- llvm/include/llvm/CodeGen/GlobalISel/Combiner.h | 1 - .../llvm/CodeGen/GlobalISel/CombinerHelper.h | 46 +- .../llvm/CodeGen/GlobalISel/GISelWorkList.h | 12 +- .../llvm/CodeGen/GlobalISel/GenericMachineInstrs.h | 32 + .../include/llvm/CodeGen/GlobalISel/IRTranslator.h | 9 +- .../llvm/CodeGen/GlobalISel/InstructionSelect.h | 4 +- .../llvm/CodeGen/GlobalISel/InstructionSelector.h | 9 +- .../CodeGen/GlobalISel/InstructionSelectorImpl.h | 5 +- .../GlobalISel/LegalizationArtifactCombiner.h | 8 +- llvm/include/llvm/CodeGen/GlobalISel/Legalizer.h | 8 +- .../llvm/CodeGen/GlobalISel/LegalizerHelper.h | 20 +- .../llvm/CodeGen/GlobalISel/LegalizerInfo.h | 38 +- .../include/llvm/CodeGen/GlobalISel/LoadStoreOpt.h | 13 +- llvm/include/llvm/CodeGen/GlobalISel/Localizer.h | 5 +- .../llvm/CodeGen/GlobalISel/MIPatternMatch.h | 42 + .../llvm/CodeGen/GlobalISel/MachineIRBuilder.h | 40 +- .../llvm/CodeGen/GlobalISel/RegBankSelect.h | 2 +- .../include/llvm/CodeGen/GlobalISel/RegisterBank.h | 98 - .../llvm/CodeGen/GlobalISel/RegisterBankInfo.h | 775 - llvm/include/llvm/CodeGen/GlobalISel/Utils.h | 61 +- llvm/include/llvm/CodeGen/ISDOpcodes.h | 77 +- llvm/include/llvm/CodeGen/IntrinsicLowering.h | 2 - .../llvm/CodeGen/LazyMachineBlockFrequencyInfo.h | 2 +- llvm/include/llvm/CodeGen/LiveInterval.h | 14 +- llvm/include/llvm/CodeGen/LiveIntervalUnion.h | 14 +- llvm/include/llvm/CodeGen/LiveIntervals.h | 2 +- llvm/include/llvm/CodeGen/LivePhysRegs.h | 2 + llvm/include/llvm/CodeGen/LiveRangeCalc.h | 1 - llvm/include/llvm/CodeGen/LiveRangeEdit.h | 10 +- llvm/include/llvm/CodeGen/LiveRegMatrix.h | 12 +- llvm/include/llvm/CodeGen/LiveStacks.h | 6 +- llvm/include/llvm/CodeGen/LiveVariables.h | 1 + llvm/include/llvm/CodeGen/MIRFSDiscriminator.h | 21 +- llvm/include/llvm/CodeGen/MIRParser/MIRParser.h | 11 +- llvm/include/llvm/CodeGen/MIRSampleProfile.h | 28 +- llvm/include/llvm/CodeGen/MIRYamlMapping.h | 19 +- llvm/include/llvm/CodeGen/MachineBasicBlock.h | 35 +- .../llvm/CodeGen/MachineBranchProbabilityInfo.h | 2 - llvm/include/llvm/CodeGen/MachineCombinerPattern.h | 4 + llvm/include/llvm/CodeGen/MachineCycleAnalysis.h | 26 +- llvm/include/llvm/CodeGen/MachineDominators.h | 5 + llvm/include/llvm/CodeGen/MachineFrameInfo.h | 34 +- llvm/include/llvm/CodeGen/MachineFunction.h | 67 +- llvm/include/llvm/CodeGen/MachineInstr.h | 45 +- llvm/include/llvm/CodeGen/MachineLoopInfo.h | 1 - llvm/include/llvm/CodeGen/MachineMemOperand.h | 3 +- llvm/include/llvm/CodeGen/MachineModuleInfo.h | 71 +- llvm/include/llvm/CodeGen/MachineOperand.h | 15 +- .../CodeGen/MachineOptimizationRemarkEmitter.h | 3 +- llvm/include/llvm/CodeGen/MachineOutliner.h | 138 +- llvm/include/llvm/CodeGen/MachinePassManager.h | 6 +- llvm/include/llvm/CodeGen/MachinePassRegistry.def | 3 +- llvm/include/llvm/CodeGen/MachinePipeliner.h | 20 +- llvm/include/llvm/CodeGen/MachineRegisterInfo.h | 33 +- llvm/include/llvm/CodeGen/MachineSSAContext.h | 10 +- llvm/include/llvm/CodeGen/MachineScheduler.h | 4 +- llvm/include/llvm/CodeGen/MachineStableHash.h | 4 + llvm/include/llvm/CodeGen/ModuloSchedule.h | 7 +- llvm/include/llvm/CodeGen/PBQP/ReductionRules.h | 2 +- llvm/include/llvm/CodeGen/Passes.h | 17 +- llvm/include/llvm/CodeGen/PseudoSourceValue.h | 19 +- llvm/include/llvm/CodeGen/RDFGraph.h | 1 - llvm/include/llvm/CodeGen/RegAllocPBQP.h | 17 +- llvm/include/llvm/CodeGen/Register.h | 2 +- llvm/include/llvm/CodeGen/RegisterBank.h | 98 + llvm/include/llvm/CodeGen/RegisterBankInfo.h | 775 + llvm/include/llvm/CodeGen/RegisterClassInfo.h | 7 +- llvm/include/llvm/CodeGen/RegisterPressure.h | 1 - llvm/include/llvm/CodeGen/RegisterScavenging.h | 20 + llvm/include/llvm/CodeGen/RegisterUsageInfo.h | 2 +- llvm/include/llvm/CodeGen/ReplaceWithVeclib.h | 4 +- llvm/include/llvm/CodeGen/ScheduleDAG.h | 2 +- llvm/include/llvm/CodeGen/ScheduleDAGInstrs.h | 2 +- llvm/include/llvm/CodeGen/SelectionDAG.h | 222 +- .../llvm/CodeGen/SelectionDAGAddressAnalysis.h | 2 +- llvm/include/llvm/CodeGen/SelectionDAGISel.h | 4 +- llvm/include/llvm/CodeGen/SelectionDAGNodes.h | 178 +- llvm/include/llvm/CodeGen/SelectionDAGTargetInfo.h | 4 +- llvm/include/llvm/CodeGen/SlotIndexes.h | 1 - llvm/include/llvm/CodeGen/StackMaps.h | 2 +- llvm/include/llvm/CodeGen/StackProtector.h | 1 - .../include/llvm/CodeGen/SwiftErrorValueTracking.h | 2 - llvm/include/llvm/CodeGen/TailDuplicator.h | 5 +- llvm/include/llvm/CodeGen/TargetCallingConv.h | 3 +- llvm/include/llvm/CodeGen/TargetFrameLowering.h | 12 + llvm/include/llvm/CodeGen/TargetInstrInfo.h | 26 +- llvm/include/llvm/CodeGen/TargetLowering.h | 284 +- .../llvm/CodeGen/TargetLoweringObjectFileImpl.h | 11 + llvm/include/llvm/CodeGen/TargetPassConfig.h | 3 + llvm/include/llvm/CodeGen/TargetRegisterInfo.h | 47 +- llvm/include/llvm/CodeGen/TargetSubtargetInfo.h | 10 +- llvm/include/llvm/CodeGen/TileShapeInfo.h | 4 +- llvm/include/llvm/CodeGen/ValueTypes.h | 7 +- llvm/include/llvm/CodeGen/ValueTypes.td | 403 +- llvm/include/llvm/DWARFLinker/DWARFLinker.h | 61 +- .../llvm/DWARFLinker/DWARFLinkerCompileUnit.h | 8 +- .../llvm/DWARFLinker/DWARFLinkerDeclContext.h | 10 +- llvm/include/llvm/DWARFLinker/DWARFStreamer.h | 3 +- llvm/include/llvm/DWP/DWPStringPool.h | 2 +- .../DebugInfo/CodeView/AppendingTypeTableBuilder.h | 2 +- .../llvm/DebugInfo/CodeView/CVSymbolVisitor.h | 10 +- .../llvm/DebugInfo/CodeView/CVTypeVisitor.h | 5 +- .../llvm/DebugInfo/CodeView/CodeViewRecordIO.h | 10 +- .../DebugInfo/CodeView/ContinuationRecordBuilder.h | 10 +- .../DebugInfo/CodeView/DebugChecksumsSubsection.h | 4 +- .../DebugInfo/CodeView/DebugCrossExSubsection.h | 3 +- .../DebugInfo/CodeView/DebugCrossImpSubsection.h | 3 +- .../DebugInfo/CodeView/DebugFrameDataSubsection.h | 6 +- .../CodeView/DebugInlineeLinesSubsection.h | 1 - .../llvm/DebugInfo/CodeView/DebugLinesSubsection.h | 3 +- .../llvm/DebugInfo/CodeView/DebugSubsection.h | 6 +- .../DebugInfo/CodeView/DebugSubsectionVisitor.h | 1 - llvm/include/llvm/DebugInfo/CodeView/EnumTables.h | 2 +- llvm/include/llvm/DebugInfo/CodeView/Formatters.h | 2 + .../DebugInfo/CodeView/GlobalTypeTableBuilder.h | 4 +- llvm/include/llvm/DebugInfo/CodeView/Line.h | 1 - .../DebugInfo/CodeView/MergingTypeTableBuilder.h | 6 +- llvm/include/llvm/DebugInfo/CodeView/RecordName.h | 7 +- .../llvm/DebugInfo/CodeView/RecordSerialization.h | 3 +- .../llvm/DebugInfo/CodeView/StringsAndChecksums.h | 6 +- .../include/llvm/DebugInfo/CodeView/SymbolDumper.h | 8 +- .../include/llvm/DebugInfo/CodeView/SymbolRecord.h | 4 +- .../llvm/DebugInfo/CodeView/SymbolSerializer.h | 4 +- .../llvm/DebugInfo/CodeView/TypeCollection.h | 2 +- .../llvm/DebugInfo/CodeView/TypeDumpVisitor.h | 10 +- llvm/include/llvm/DebugInfo/CodeView/TypeHashing.h | 6 +- llvm/include/llvm/DebugInfo/CodeView/TypeIndex.h | 2 +- .../llvm/DebugInfo/CodeView/TypeIndexDiscovery.h | 6 +- .../llvm/DebugInfo/CodeView/TypeRecordMapping.h | 5 +- .../llvm/DebugInfo/CodeView/TypeStreamMerger.h | 3 +- llvm/include/llvm/DebugInfo/DIContext.h | 10 + .../DebugInfo/DWARF/DWARFAbbreviationDeclaration.h | 4 +- .../llvm/DebugInfo/DWARF/DWARFAddressRange.h | 3 + .../llvm/DebugInfo/DWARF/DWARFCompileUnit.h | 7 +- llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h | 36 +- llvm/include/llvm/DebugInfo/DWARF/DWARFDebugAddr.h | 5 +- .../llvm/DebugInfo/DWARF/DWARFDebugArangeSet.h | 3 +- .../llvm/DebugInfo/DWARF/DWARFDebugAranges.h | 7 +- .../include/llvm/DebugInfo/DWARF/DWARFDebugFrame.h | 8 +- .../llvm/DebugInfo/DWARF/DWARFDebugInfoEntry.h | 2 +- llvm/include/llvm/DebugInfo/DWARF/DWARFDebugLine.h | 8 +- llvm/include/llvm/DebugInfo/DWARF/DWARFDebugLoc.h | 9 +- .../include/llvm/DebugInfo/DWARF/DWARFDebugMacro.h | 1 - .../llvm/DebugInfo/DWARF/DWARFDebugPubTable.h | 5 +- .../llvm/DebugInfo/DWARF/DWARFDebugRangeList.h | 6 +- .../llvm/DebugInfo/DWARF/DWARFDebugRnglists.h | 11 +- llvm/include/llvm/DebugInfo/DWARF/DWARFDie.h | 9 +- .../include/llvm/DebugInfo/DWARF/DWARFExpression.h | 5 +- llvm/include/llvm/DebugInfo/DWARF/DWARFFormValue.h | 14 +- llvm/include/llvm/DebugInfo/DWARF/DWARFGdbIndex.h | 2 +- llvm/include/llvm/DebugInfo/DWARF/DWARFListTable.h | 1 - llvm/include/llvm/DebugInfo/DWARF/DWARFRelocMap.h | 1 + .../llvm/DebugInfo/DWARF/DWARFTypePrinter.h | 67 + llvm/include/llvm/DebugInfo/DWARF/DWARFTypeUnit.h | 3 +- llvm/include/llvm/DebugInfo/DWARF/DWARFUnit.h | 30 +- llvm/include/llvm/DebugInfo/DWARF/DWARFUnitIndex.h | 21 +- llvm/include/llvm/DebugInfo/DWARF/DWARFVerifier.h | 28 +- .../include/llvm/DebugInfo/GSYM/DwarfTransformer.h | 2 +- llvm/include/llvm/DebugInfo/GSYM/ExtractRanges.h | 81 + llvm/include/llvm/DebugInfo/GSYM/FunctionInfo.h | 17 +- llvm/include/llvm/DebugInfo/GSYM/GsymCreator.h | 2 +- llvm/include/llvm/DebugInfo/GSYM/InlineInfo.h | 3 +- llvm/include/llvm/DebugInfo/GSYM/LineEntry.h | 2 +- llvm/include/llvm/DebugInfo/GSYM/LookupResult.h | 2 +- llvm/include/llvm/DebugInfo/GSYM/Range.h | 130 - llvm/include/llvm/DebugInfo/GSYM/StringTable.h | 2 +- llvm/include/llvm/DebugInfo/MSF/MSFBuilder.h | 4 +- llvm/include/llvm/DebugInfo/PDB/IPDBEnumChildren.h | 1 + .../DebugInfo/PDB/Native/DbiModuleDescriptor.h | 6 +- .../PDB/Native/DbiModuleDescriptorBuilder.h | 10 +- llvm/include/llvm/DebugInfo/PDB/Native/DbiStream.h | 14 +- .../llvm/DebugInfo/PDB/Native/DbiStreamBuilder.h | 22 +- .../include/llvm/DebugInfo/PDB/Native/EnumTables.h | 2 +- .../include/llvm/DebugInfo/PDB/Native/FormatUtil.h | 133 + .../llvm/DebugInfo/PDB/Native/GSIStreamBuilder.h | 14 +- .../llvm/DebugInfo/PDB/Native/GlobalsStream.h | 14 +- llvm/include/llvm/DebugInfo/PDB/Native/HashTable.h | 3 - .../include/llvm/DebugInfo/PDB/Native/InfoStream.h | 10 +- .../llvm/DebugInfo/PDB/Native/InfoStreamBuilder.h | 8 +- .../DebugInfo/PDB/Native/InjectedSourceStream.h | 9 +- llvm/include/llvm/DebugInfo/PDB/Native/InputFile.h | 231 + .../llvm/DebugInfo/PDB/Native/LinePrinter.h | 185 + .../llvm/DebugInfo/PDB/Native/ModuleDebugStream.h | 13 +- .../llvm/DebugInfo/PDB/Native/NamedStreamMap.h | 1 - .../llvm/DebugInfo/PDB/Native/NativeEnumGlobals.h | 2 +- .../DebugInfo/PDB/Native/NativeEnumLineNumbers.h | 5 +- .../llvm/DebugInfo/PDB/Native/NativeEnumSymbols.h | 2 +- .../llvm/DebugInfo/PDB/Native/NativeEnumTypes.h | 7 +- .../llvm/DebugInfo/PDB/Native/NativeExeSymbol.h | 5 +- .../DebugInfo/PDB/Native/NativeFunctionSymbol.h | 7 +- .../DebugInfo/PDB/Native/NativeInlineSiteSymbol.h | 6 +- .../llvm/DebugInfo/PDB/Native/NativeLineNumber.h | 4 +- .../llvm/DebugInfo/PDB/Native/NativePublicSymbol.h | 5 +- .../llvm/DebugInfo/PDB/Native/NativeSession.h | 12 +- .../llvm/DebugInfo/PDB/Native/NativeSourceFile.h | 5 +- .../DebugInfo/PDB/Native/NativeSymbolEnumerator.h | 8 +- .../llvm/DebugInfo/PDB/Native/NativeTypeEnum.h | 8 +- .../DebugInfo/PDB/Native/NativeTypeFunctionSig.h | 8 +- .../llvm/DebugInfo/PDB/Native/NativeTypePointer.h | 5 +- .../llvm/DebugInfo/PDB/Native/NativeTypeTypedef.h | 9 +- .../llvm/DebugInfo/PDB/Native/NativeTypeUDT.h | 8 +- .../llvm/DebugInfo/PDB/Native/NativeTypeVTShape.h | 6 +- llvm/include/llvm/DebugInfo/PDB/Native/PDBFile.h | 2 - .../llvm/DebugInfo/PDB/Native/PDBFileBuilder.h | 14 +- .../llvm/DebugInfo/PDB/Native/PDBStringTable.h | 6 - .../llvm/DebugInfo/PDB/Native/PublicsStream.h | 13 +- .../llvm/DebugInfo/PDB/Native/SymbolCache.h | 16 +- .../llvm/DebugInfo/PDB/Native/SymbolStream.h | 5 +- llvm/include/llvm/DebugInfo/PDB/Native/TpiStream.h | 7 +- .../llvm/DebugInfo/PDB/Native/TpiStreamBuilder.h | 15 +- llvm/include/llvm/DebugInfo/PDB/PDBContext.h | 2 + llvm/include/llvm/DebugInfo/PDB/PDBSymbol.h | 5 +- .../llvm/DebugInfo/PDB/PDBSymbolAnnotation.h | 1 - llvm/include/llvm/DebugInfo/PDB/PDBSymbolBlock.h | 2 - .../llvm/DebugInfo/PDB/PDBSymbolCompilandDetails.h | 1 - .../llvm/DebugInfo/PDB/PDBSymbolCompilandEnv.h | 1 - llvm/include/llvm/DebugInfo/PDB/PDBSymbolCustom.h | 2 - llvm/include/llvm/DebugInfo/PDB/PDBSymbolData.h | 6 +- llvm/include/llvm/DebugInfo/PDB/PDBSymbolFunc.h | 11 +- .../llvm/DebugInfo/PDB/PDBSymbolFuncDebugEnd.h | 2 - .../llvm/DebugInfo/PDB/PDBSymbolFuncDebugStart.h | 1 - llvm/include/llvm/DebugInfo/PDB/PDBSymbolLabel.h | 1 - .../llvm/DebugInfo/PDB/PDBSymbolPublicSymbol.h | 1 - llvm/include/llvm/DebugInfo/PDB/PDBSymbolThunk.h | 1 - .../llvm/DebugInfo/PDB/PDBSymbolTypeArray.h | 1 - .../llvm/DebugInfo/PDB/PDBSymbolTypeBaseClass.h | 6 +- .../llvm/DebugInfo/PDB/PDBSymbolTypeBuiltin.h | 1 - .../llvm/DebugInfo/PDB/PDBSymbolTypeCustom.h | 1 - .../llvm/DebugInfo/PDB/PDBSymbolTypeDimension.h | 1 - .../include/llvm/DebugInfo/PDB/PDBSymbolTypeEnum.h | 8 +- .../llvm/DebugInfo/PDB/PDBSymbolTypeFriend.h | 1 - .../llvm/DebugInfo/PDB/PDBSymbolTypeFunctionArg.h | 1 - .../llvm/DebugInfo/PDB/PDBSymbolTypeManaged.h | 1 - .../llvm/DebugInfo/PDB/PDBSymbolTypePointer.h | 1 - .../llvm/DebugInfo/PDB/PDBSymbolTypeTypedef.h | 1 - llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeUDT.h | 9 +- .../llvm/DebugInfo/PDB/PDBSymbolTypeVTable.h | 1 - .../llvm/DebugInfo/PDB/PDBSymbolTypeVTableShape.h | 1 - llvm/include/llvm/DebugInfo/PDB/PDBSymbolUnknown.h | 1 - .../llvm/DebugInfo/PDB/PDBSymbolUsingNamespace.h | 1 - llvm/include/llvm/DebugInfo/PDB/PDBTypes.h | 3 +- llvm/include/llvm/DebugInfo/PDB/UDTLayout.h | 1 - llvm/include/llvm/DebugInfo/Symbolize/DIFetcher.h | 51 + llvm/include/llvm/DebugInfo/Symbolize/Markup.h | 120 + .../llvm/DebugInfo/Symbolize/MarkupFilter.h | 76 + .../DebugInfo/Symbolize/SymbolizableObjectFile.h | 103 + llvm/include/llvm/DebugInfo/Symbolize/Symbolize.h | 103 +- llvm/include/llvm/Debuginfod/DIFetcher.h | 34 + llvm/include/llvm/Debuginfod/HTTPClient.h | 44 +- llvm/include/llvm/Demangle/Demangle.h | 4 +- llvm/include/llvm/Demangle/ItaniumDemangle.h | 2289 +- llvm/include/llvm/Demangle/ItaniumNodes.def | 95 + llvm/include/llvm/Demangle/Utility.h | 114 +- .../JITLink/DWARFRecordSectionSplitter.h | 35 + .../include/llvm/ExecutionEngine/JITLink/JITLink.h | 21 +- .../llvm/ExecutionEngine/JITLink/MachO_arm64.h | 27 - .../llvm/ExecutionEngine/JITLink/MemoryFlags.h | 10 +- .../include/llvm/ExecutionEngine/JITLink/aarch64.h | 339 +- llvm/include/llvm/ExecutionEngine/JITLink/riscv.h | 17 +- llvm/include/llvm/ExecutionEngine/JITLink/x86_64.h | 9 +- llvm/include/llvm/ExecutionEngine/Orc/Core.h | 21 +- llvm/include/llvm/ExecutionEngine/Orc/DebugUtils.h | 3 + .../llvm/ExecutionEngine/Orc/ELFNixPlatform.h | 3 +- .../ExecutionEngine/Orc/EPCDebugObjectRegistrar.h | 2 - .../llvm/ExecutionEngine/Orc/EPCIndirectionUtils.h | 2 +- .../ExecutionEngine/Orc/JITTargetMachineBuilder.h | 2 +- llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h | 20 +- .../llvm/ExecutionEngine/Orc/MachOPlatform.h | 146 +- .../llvm/ExecutionEngine/Orc/MemoryMapper.h | 115 + .../llvm/ExecutionEngine/Orc/OrcABISupport.h | 39 + .../ExecutionEngine/Orc/Shared/ExecutorAddress.h | 13 +- .../Orc/Shared/SimplePackedSerialization.h | 2 +- .../include/llvm/ExecutionEngine/Orc/Speculation.h | 9 +- .../llvm/ExecutionEngine/Orc/SymbolStringPool.h | 7 + llvm/include/llvm/FileCheck/FileCheck.h | 8 +- llvm/include/llvm/Frontend/OpenMP/OMP.td | 279 +- llvm/include/llvm/Frontend/OpenMP/OMPConstants.h | 129 +- llvm/include/llvm/Frontend/OpenMP/OMPContext.h | 8 +- llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h | 261 +- llvm/include/llvm/Frontend/OpenMP/OMPKinds.def | 12 +- llvm/include/llvm/FuzzMutate/FuzzerCLI.h | 27 +- llvm/include/llvm/FuzzMutate/IRMutator.h | 26 + llvm/include/llvm/FuzzMutate/OpDescriptor.h | 6 +- llvm/include/llvm/FuzzMutate/RandomIRBuilder.h | 13 +- llvm/include/llvm/IR/AbstractCallSite.h | 6 +- llvm/include/llvm/IR/Argument.h | 1 - llvm/include/llvm/IR/Assumptions.h | 4 + llvm/include/llvm/IR/Attributes.h | 51 +- llvm/include/llvm/IR/Attributes.td | 23 +- llvm/include/llvm/IR/AttributesAMDGPU.td | 14 - llvm/include/llvm/IR/AutoUpgrade.h | 16 +- llvm/include/llvm/IR/BasicBlock.h | 9 +- llvm/include/llvm/IR/CFG.h | 1 - llvm/include/llvm/IR/ConstantFold.h | 60 + llvm/include/llvm/IR/ConstantFolder.h | 178 +- llvm/include/llvm/IR/ConstantRange.h | 3 + llvm/include/llvm/IR/Constants.h | 15 +- llvm/include/llvm/IR/DIBuilder.h | 23 +- llvm/include/llvm/IR/DataLayout.h | 2 +- llvm/include/llvm/IR/DebugInfoMetadata.h | 183 +- llvm/include/llvm/IR/DerivedTypes.h | 9 +- llvm/include/llvm/IR/DiagnosticInfo.h | 20 + llvm/include/llvm/IR/Dominators.h | 4 + llvm/include/llvm/IR/FMF.h | 121 + llvm/include/llvm/IR/FPEnv.h | 19 + llvm/include/llvm/IR/FixedMetadataKinds.def | 2 + llvm/include/llvm/IR/Function.h | 23 +- llvm/include/llvm/IR/GCStrategy.h | 17 +- llvm/include/llvm/IR/GlobalIFunc.h | 5 + llvm/include/llvm/IR/GlobalObject.h | 5 +- llvm/include/llvm/IR/GlobalValue.h | 52 +- llvm/include/llvm/IR/IRBuilder.h | 303 +- llvm/include/llvm/IR/IRBuilderFolder.h | 71 +- llvm/include/llvm/IR/InlineAsm.h | 25 +- llvm/include/llvm/IR/InstVisitor.h | 3 +- llvm/include/llvm/IR/InstrTypes.h | 50 +- llvm/include/llvm/IR/Instruction.h | 1 - llvm/include/llvm/IR/Instructions.h | 57 +- llvm/include/llvm/IR/IntrinsicInst.h | 71 +- llvm/include/llvm/IR/Intrinsics.h | 14 +- llvm/include/llvm/IR/Intrinsics.td | 420 +- llvm/include/llvm/IR/IntrinsicsAArch64.td | 166 +- llvm/include/llvm/IR/IntrinsicsAMDGPU.td | 528 +- llvm/include/llvm/IR/IntrinsicsARM.td | 194 +- llvm/include/llvm/IR/IntrinsicsBPF.td | 20 +- llvm/include/llvm/IR/IntrinsicsDirectX.td | 20 + llvm/include/llvm/IR/IntrinsicsHexagon.td | 13 +- llvm/include/llvm/IR/IntrinsicsMips.td | 1342 +- llvm/include/llvm/IR/IntrinsicsNVVM.td | 1449 +- llvm/include/llvm/IR/IntrinsicsPowerPC.td | 746 +- llvm/include/llvm/IR/IntrinsicsRISCV.td | 589 +- llvm/include/llvm/IR/IntrinsicsSPIRV.td | 31 + llvm/include/llvm/IR/IntrinsicsSystemZ.td | 56 +- llvm/include/llvm/IR/IntrinsicsVE.td | 15 +- llvm/include/llvm/IR/IntrinsicsVEVL.gen.td | 2470 +-- llvm/include/llvm/IR/IntrinsicsWebAssembly.td | 22 +- llvm/include/llvm/IR/IntrinsicsX86.td | 2332 ++- llvm/include/llvm/IR/IntrinsicsXCore.td | 8 +- llvm/include/llvm/IR/LLVMContext.h | 22 +- llvm/include/llvm/IR/LegacyPassManagers.h | 8 +- llvm/include/llvm/IR/MDBuilder.h | 4 + llvm/include/llvm/IR/MatrixBuilder.h | 20 +- llvm/include/llvm/IR/Metadata.h | 158 +- llvm/include/llvm/IR/Module.h | 22 +- llvm/include/llvm/IR/NoFolder.h | 164 +- llvm/include/llvm/IR/Operator.h | 100 +- llvm/include/llvm/IR/PatternMatch.h | 116 +- llvm/include/llvm/IR/RuntimeLibcalls.def | 16 + llvm/include/llvm/IR/Statepoint.h | 5 +- llvm/include/llvm/IR/Type.h | 18 +- llvm/include/llvm/IR/User.h | 4 +- llvm/include/llvm/IR/VPIntrinsics.def | 158 +- llvm/include/llvm/IR/ValueMap.h | 6 +- llvm/include/llvm/IR/VectorBuilder.h | 99 + llvm/include/llvm/IRReader/IRReader.h | 4 +- llvm/include/llvm/InitializePasses.h | 38 +- llvm/include/llvm/InterfaceStub/ELFObjHandler.h | 11 +- llvm/include/llvm/InterfaceStub/IFSHandler.h | 6 +- llvm/include/llvm/InterfaceStub/IFSStub.h | 5 +- llvm/include/llvm/LTO/Config.h | 10 +- llvm/include/llvm/LTO/LTO.h | 13 +- llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h | 2 +- .../include/llvm/LTO/legacy/ThinLTOCodeGenerator.h | 7 - llvm/include/llvm/LinkAllPasses.h | 28 +- llvm/include/llvm/Linker/IRMover.h | 7 +- llvm/include/llvm/MC/ConstantPools.h | 3 +- llvm/include/llvm/MC/MCAsmBackend.h | 8 +- llvm/include/llvm/MC/MCAsmInfo.h | 22 + llvm/include/llvm/MC/MCAssembler.h | 19 +- llvm/include/llvm/MC/MCCodeView.h | 13 +- llvm/include/llvm/MC/MCContext.h | 1432 +- llvm/include/llvm/MC/MCDXContainerStreamer.h | 49 + llvm/include/llvm/MC/MCDXContainerWriter.h | 45 + llvm/include/llvm/MC/MCDecoderOps.h | 33 + llvm/include/llvm/MC/MCDirectives.h | 1 + .../llvm/MC/MCDisassembler/MCDisassembler.h | 28 +- .../llvm/MC/MCDisassembler/MCExternalSymbolizer.h | 5 +- llvm/include/llvm/MC/MCDisassembler/MCSymbolizer.h | 5 +- llvm/include/llvm/MC/MCDwarf.h | 11 +- llvm/include/llvm/MC/MCELFStreamer.h | 9 +- llvm/include/llvm/MC/MCFixedLenDisassembler.h | 33 - llvm/include/llvm/MC/MCFragment.h | 7 +- llvm/include/llvm/MC/MCInstrAnalysis.h | 3 + llvm/include/llvm/MC/MCInstrDesc.h | 10 +- llvm/include/llvm/MC/MCInstrInfo.h | 1 + llvm/include/llvm/MC/MCLinkerOptimizationHint.h | 2 +- llvm/include/llvm/MC/MCMachObjectWriter.h | 2 + llvm/include/llvm/MC/MCObjectFileInfo.h | 16 +- llvm/include/llvm/MC/MCObjectStreamer.h | 8 +- llvm/include/llvm/MC/MCObjectWriter.h | 12 +- llvm/include/llvm/MC/MCParser/MCAsmLexer.h | 2 - llvm/include/llvm/MC/MCParser/MCAsmParser.h | 6 +- .../llvm/MC/MCParser/MCAsmParserExtension.h | 3 +- llvm/include/llvm/MC/MCParser/MCParsedAsmOperand.h | 12 +- llvm/include/llvm/MC/MCParser/MCTargetAsmParser.h | 15 +- llvm/include/llvm/MC/MCPseudoProbe.h | 16 +- llvm/include/llvm/MC/MCRegisterInfo.h | 8 + llvm/include/llvm/MC/MCSPIRVObjectWriter.h | 40 + llvm/include/llvm/MC/MCSPIRVStreamer.h | 50 + llvm/include/llvm/MC/MCSection.h | 8 +- llvm/include/llvm/MC/MCSectionCOFF.h | 6 +- llvm/include/llvm/MC/MCSectionDXContainer.h | 38 + llvm/include/llvm/MC/MCSectionELF.h | 8 +- llvm/include/llvm/MC/MCSectionGOFF.h | 15 +- llvm/include/llvm/MC/MCSectionMachO.h | 4 +- llvm/include/llvm/MC/MCSectionSPIRV.h | 41 + llvm/include/llvm/MC/MCSectionWasm.h | 4 +- llvm/include/llvm/MC/MCSectionXCOFF.h | 29 +- llvm/include/llvm/MC/MCStreamer.h | 124 +- llvm/include/llvm/MC/MCSubtargetInfo.h | 3 +- llvm/include/llvm/MC/MCSymbol.h | 2 +- llvm/include/llvm/MC/MCSymbolWasm.h | 14 +- llvm/include/llvm/MC/MCSymbolXCOFF.h | 3 +- llvm/include/llvm/MC/MCTargetOptions.h | 21 +- llvm/include/llvm/MC/MCTargetOptionsCommandFlags.h | 3 + llvm/include/llvm/MC/MCValue.h | 1 - llvm/include/llvm/MC/MCWin64EH.h | 8 +- llvm/include/llvm/MC/MCWinCOFFStreamer.h | 20 +- llvm/include/llvm/MC/MCWinEH.h | 10 +- llvm/include/llvm/MC/MCXCOFFStreamer.h | 4 + llvm/include/llvm/MC/SectionKind.h | 7 + llvm/include/llvm/MC/StringTableBuilder.h | 1 - llvm/include/llvm/MC/SubtargetFeature.h | 3 +- llvm/include/llvm/MC/TargetRegistry.h | 56 +- llvm/include/llvm/MCA/CustomBehaviour.h | 5 + llvm/include/llvm/MCA/IncrementalSourceMgr.h | 92 + llvm/include/llvm/MCA/InstrBuilder.h | 30 + llvm/include/llvm/MCA/Instruction.h | 45 +- llvm/include/llvm/MCA/Pipeline.h | 12 +- llvm/include/llvm/MCA/SourceMgr.h | 57 +- llvm/include/llvm/MCA/Stages/EntryStage.h | 3 +- llvm/include/llvm/MCA/Stages/Stage.h | 13 + llvm/include/llvm/ObjCopy/COFF/COFFConfig.h | 27 + llvm/include/llvm/ObjCopy/COFF/COFFObjcopy.h | 36 + llvm/include/llvm/ObjCopy/CommonConfig.h | 271 + llvm/include/llvm/ObjCopy/ConfigManager.h | 50 + llvm/include/llvm/ObjCopy/ELF/ELFConfig.h | 38 + llvm/include/llvm/ObjCopy/ELF/ELFObjcopy.h | 53 + llvm/include/llvm/ObjCopy/MachO/MachOConfig.h | 46 + llvm/include/llvm/ObjCopy/MachO/MachOObjcopy.h | 45 + llvm/include/llvm/ObjCopy/MultiFormatConfig.h | 39 + llvm/include/llvm/ObjCopy/ObjCopy.h | 42 + llvm/include/llvm/ObjCopy/XCOFF/XCOFFConfig.h | 21 + llvm/include/llvm/ObjCopy/XCOFF/XCOFFObjcopy.h | 35 + llvm/include/llvm/ObjCopy/wasm/WasmConfig.h | 21 + llvm/include/llvm/ObjCopy/wasm/WasmObjcopy.h | 35 + llvm/include/llvm/Object/Archive.h | 12 +- llvm/include/llvm/Object/ArchiveWriter.h | 5 + llvm/include/llvm/Object/Binary.h | 6 +- llvm/include/llvm/Object/COFF.h | 12 +- llvm/include/llvm/Object/COFFImportFile.h | 3 +- llvm/include/llvm/Object/COFFModuleDefinition.h | 2 +- llvm/include/llvm/Object/DXContainer.h | 124 + llvm/include/llvm/Object/Decompressor.h | 6 +- llvm/include/llvm/Object/ELF.h | 2 +- llvm/include/llvm/Object/ELFObjectFile.h | 32 +- llvm/include/llvm/Object/ELFTypes.h | 12 + llvm/include/llvm/Object/Error.h | 1 + llvm/include/llvm/Object/IRObjectFile.h | 1 - llvm/include/llvm/Object/MachO.h | 130 + llvm/include/llvm/Object/MachOUniversal.h | 2 +- llvm/include/llvm/Object/MachOUniversalWriter.h | 13 +- llvm/include/llvm/Object/ObjectFile.h | 13 +- llvm/include/llvm/Object/OffloadBinary.h | 169 + llvm/include/llvm/Object/RelocationResolver.h | 15 +- llvm/include/llvm/Object/SymbolicFile.h | 8 +- llvm/include/llvm/Object/TapiFile.h | 15 +- llvm/include/llvm/Object/TapiUniversal.h | 6 +- llvm/include/llvm/Object/Wasm.h | 1 - llvm/include/llvm/Object/WindowsResource.h | 2 +- llvm/include/llvm/Object/XCOFFObjectFile.h | 15 +- llvm/include/llvm/ObjectYAML/DXContainerYAML.h | 101 + llvm/include/llvm/ObjectYAML/ELFYAML.h | 45 +- llvm/include/llvm/ObjectYAML/MachOYAML.h | 1 + llvm/include/llvm/ObjectYAML/ObjectYAML.h | 4 + llvm/include/llvm/ObjectYAML/OffloadYAML.h | 79 + llvm/include/llvm/ObjectYAML/WasmYAML.h | 22 +- llvm/include/llvm/ObjectYAML/yaml2obj.h | 11 + llvm/include/llvm/Option/ArgList.h | 14 +- llvm/include/llvm/Pass.h | 10 + llvm/include/llvm/Passes/PassBuilder.h | 43 +- .../include/llvm/Passes/StandardInstrumentations.h | 31 +- .../llvm/ProfileData/Coverage/CoverageMapping.h | 4 +- llvm/include/llvm/ProfileData/GCOV.h | 4 - llvm/include/llvm/ProfileData/InstrProf.h | 41 +- .../include/llvm/ProfileData/InstrProfCorrelator.h | 9 +- llvm/include/llvm/ProfileData/InstrProfData.inc | 4 +- llvm/include/llvm/ProfileData/InstrProfReader.h | 49 +- llvm/include/llvm/ProfileData/InstrProfWriter.h | 34 +- llvm/include/llvm/ProfileData/MIBEntryDef.inc | 47 + llvm/include/llvm/ProfileData/MemProf.h | 613 + llvm/include/llvm/ProfileData/MemProfData.inc | 143 +- llvm/include/llvm/ProfileData/RawMemProfReader.h | 127 +- llvm/include/llvm/ProfileData/SampleProf.h | 97 +- llvm/include/llvm/ProfileData/SampleProfReader.h | 17 +- llvm/include/llvm/ProfileData/SampleProfWriter.h | 4 - llvm/include/llvm/Remarks/RemarkSerializer.h | 1 - llvm/include/llvm/Support/AArch64TargetParser.def | 55 +- llvm/include/llvm/Support/AMDHSAKernelDescriptor.h | 14 +- llvm/include/llvm/Support/ARMBuildAttributes.h | 39 +- llvm/include/llvm/Support/ARMTargetParser.def | 8 +- llvm/include/llvm/Support/ARMWinEH.h | 5 +- llvm/include/llvm/Support/Alignment.h | 73 +- llvm/include/llvm/Support/Allocator.h | 7 +- llvm/include/llvm/Support/BLAKE3.h | 124 + llvm/include/llvm/Support/Base64.h | 1 + llvm/include/llvm/Support/BinaryStreamArray.h | 2 + llvm/include/llvm/Support/BinaryStreamRef.h | 6 +- llvm/include/llvm/Support/BranchProbability.h | 1 + llvm/include/llvm/Support/CSKYAttributeParser.h | 43 + llvm/include/llvm/Support/CSKYAttributes.h | 95 + llvm/include/llvm/Support/CSKYTargetParser.def | 524 + llvm/include/llvm/Support/CSKYTargetParser.h | 203 + llvm/include/llvm/Support/Casting.h | 769 +- llvm/include/llvm/Support/CodeGen.h | 36 +- llvm/include/llvm/Support/CommandLine.h | 290 +- llvm/include/llvm/Support/Compiler.h | 64 +- llvm/include/llvm/Support/Compression.h | 4 +- llvm/include/llvm/Support/ConvertUTF.h | 21 + llvm/include/llvm/Support/CrashRecoveryContext.h | 3 + llvm/include/llvm/Support/Debug.h | 4 +- llvm/include/llvm/Support/Errno.h | 1 - llvm/include/llvm/Support/Error.h | 4 +- llvm/include/llvm/Support/ErrorHandling.h | 25 +- llvm/include/llvm/Support/FileUtilities.h | 21 + llvm/include/llvm/Support/FormatProviders.h | 2 +- llvm/include/llvm/Support/FormatVariadic.h | 2 +- llvm/include/llvm/Support/HashBuilder.h | 7 +- llvm/include/llvm/Support/Host.h | 1 + llvm/include/llvm/Support/KnownBits.h | 8 +- llvm/include/llvm/Support/LowLevelTypeImpl.h | 12 + llvm/include/llvm/Support/MD5.h | 29 +- llvm/include/llvm/Support/MachineValueType.h | 439 +- llvm/include/llvm/Support/MathExtras.h | 52 +- llvm/include/llvm/Support/Parallel.h | 4 +- llvm/include/llvm/Support/Path.h | 1 - llvm/include/llvm/Support/PluginLoader.h | 6 +- llvm/include/llvm/Support/Printable.h | 8 +- llvm/include/llvm/Support/Process.h | 1 - llvm/include/llvm/Support/Program.h | 2 +- llvm/include/llvm/Support/RISCVISAInfo.h | 2 + llvm/include/llvm/Support/RWMutex.h | 4 +- llvm/include/llvm/Support/SHA1.h | 13 +- llvm/include/llvm/Support/SHA256.h | 13 +- llvm/include/llvm/Support/ScopedPrinter.h | 7 +- llvm/include/llvm/Support/Signals.h | 1 + llvm/include/llvm/Support/Signposts.h | 2 +- llvm/include/llvm/Support/SourceMgr.h | 30 + llvm/include/llvm/Support/TargetOpcodes.def | 6 + llvm/include/llvm/Support/TargetParser.h | 14 +- llvm/include/llvm/Support/ThreadPool.h | 97 +- llvm/include/llvm/Support/Threading.h | 22 +- llvm/include/llvm/Support/TrigramIndex.h | 2 +- llvm/include/llvm/Support/TypeSize.h | 19 + llvm/include/llvm/Support/Unicode.h | 42 +- llvm/include/llvm/Support/VersionTuple.h | 14 +- llvm/include/llvm/Support/VirtualFileSystem.h | 140 +- llvm/include/llvm/Support/Win64EH.h | 36 +- llvm/include/llvm/Support/WithColor.h | 18 +- .../llvm/Support/X86DisassemblerDecoderCommon.h | 2 - llvm/include/llvm/Support/X86TargetParser.def | 72 +- llvm/include/llvm/Support/YAMLParser.h | 1 - llvm/include/llvm/Support/YAMLTraits.h | 67 +- llvm/include/llvm/Support/circular_raw_ostream.h | 11 +- llvm/include/llvm/Support/raw_sha1_ostream.h | 2 +- llvm/include/llvm/TableGen/Parser.h | 34 + llvm/include/llvm/TableGen/Record.h | 305 +- llvm/include/llvm/Target/CGPassBuilderOption.h | 1 + llvm/include/llvm/Target/GenericOpcodes.td | 13 + llvm/include/llvm/Target/GlobalISel/Combine.td | 73 +- llvm/include/llvm/Target/Target.td | 54 + .../include/llvm/Target/TargetLoweringObjectFile.h | 3 +- llvm/include/llvm/Target/TargetMachine.h | 22 +- llvm/include/llvm/Target/TargetOptions.h | 33 +- llvm/include/llvm/Target/TargetSelectionDAG.td | 138 + llvm/include/llvm/Testing/Support/SupportHelpers.h | 8 +- llvm/include/llvm/TextAPI/Symbol.h | 1 - .../AggressiveInstCombine/AggressiveInstCombine.h | 4 +- llvm/include/llvm/Transforms/Coroutines.h | 37 - .../llvm/Transforms/Coroutines/CoroCleanup.h | 4 +- .../Transforms/Coroutines/CoroConditionalWrapper.h | 30 + .../include/llvm/Transforms/Coroutines/CoroEarly.h | 4 +- llvm/include/llvm/Transforms/IPO.h | 7 - llvm/include/llvm/Transforms/IPO/AlwaysInliner.h | 4 +- .../llvm/Transforms/IPO/ArgumentPromotion.h | 6 +- llvm/include/llvm/Transforms/IPO/Attributor.h | 514 +- .../llvm/Transforms/IPO/DeadArgumentElimination.h | 41 +- .../llvm/Transforms/IPO/ForceFunctionAttrs.h | 3 +- llvm/include/llvm/Transforms/IPO/FunctionAttrs.h | 17 +- llvm/include/llvm/Transforms/IPO/GlobalDCE.h | 9 +- llvm/include/llvm/Transforms/IPO/IROutliner.h | 41 +- .../llvm/Transforms/IPO/InferFunctionAttrs.h | 4 +- llvm/include/llvm/Transforms/IPO/Inliner.h | 8 +- llvm/include/llvm/Transforms/IPO/Internalize.h | 1 - llvm/include/llvm/Transforms/IPO/ModuleInliner.h | 9 +- .../llvm/Transforms/IPO/PassManagerBuilder.h | 4 - .../llvm/Transforms/IPO/ProfiledCallGraph.h | 13 +- .../llvm/Transforms/IPO/SampleContextTracker.h | 114 +- llvm/include/llvm/Transforms/IPO/SampleProfile.h | 2 +- .../llvm/Transforms/IPO/SampleProfileProbe.h | 12 +- .../llvm/Transforms/IPO/StripDeadPrototypes.h | 3 +- .../llvm/Transforms/IPO/ThinLTOBitcodeWriter.h | 3 +- .../llvm/Transforms/IPO/WholeProgramDevirt.h | 5 +- .../llvm/Transforms/InstCombine/InstCombine.h | 1 + llvm/include/llvm/Transforms/Instrumentation.h | 39 +- .../Transforms/Instrumentation/AddressSanitizer.h | 110 +- .../Instrumentation/AddressSanitizerCommon.h | 45 - .../Instrumentation/AddressSanitizerOptions.h | 5 +- .../Transforms/Instrumentation/BoundsChecking.h | 3 +- .../llvm/Transforms/Instrumentation/CGProfile.h | 2 +- .../Instrumentation/ControlHeightReduction.h | 1 - .../Transforms/Instrumentation/DataFlowSanitizer.h | 2 +- .../Instrumentation/HWAddressSanitizer.h | 12 +- .../Transforms/Instrumentation/InstrProfiling.h | 4 +- .../llvm/Transforms/Instrumentation/MemProfiler.h | 7 +- .../Transforms/Instrumentation/MemorySanitizer.h | 11 +- .../Transforms/Instrumentation/SanitizerCoverage.h | 3 +- .../Transforms/Instrumentation/ThreadSanitizer.h | 6 +- llvm/include/llvm/Transforms/Scalar.h | 22 +- llvm/include/llvm/Transforms/Scalar/BDCE.h | 3 +- .../llvm/Transforms/Scalar/CallSiteSplitting.h | 3 +- .../llvm/Transforms/Scalar/ConstantHoisting.h | 1 - llvm/include/llvm/Transforms/Scalar/DCE.h | 3 +- .../llvm/Transforms/Scalar/DFAJumpThreading.h | 3 +- llvm/include/llvm/Transforms/Scalar/Float2Int.h | 11 +- llvm/include/llvm/Transforms/Scalar/GVN.h | 5 +- .../include/llvm/Transforms/Scalar/GuardWidening.h | 5 +- .../llvm/Transforms/Scalar/IVUsersPrinter.h | 8 +- .../include/llvm/Transforms/Scalar/JumpThreading.h | 6 +- llvm/include/llvm/Transforms/Scalar/LICM.h | 60 +- .../Transforms/Scalar/LoopAccessAnalysisPrinter.h | 8 +- .../llvm/Transforms/Scalar/LoopBoundSplit.h | 4 +- .../llvm/Transforms/Scalar/LoopDataPrefetch.h | 3 +- llvm/include/llvm/Transforms/Scalar/LoopDeletion.h | 6 +- llvm/include/llvm/Transforms/Scalar/LoopFlatten.h | 4 +- .../llvm/Transforms/Scalar/LoopInterchange.h | 5 +- .../llvm/Transforms/Scalar/LoopPassManager.h | 3 +- .../llvm/Transforms/Scalar/LoopPredication.h | 5 +- llvm/include/llvm/Transforms/Scalar/LoopRotation.h | 5 +- .../llvm/Transforms/Scalar/LoopSimplifyCFG.h | 6 +- llvm/include/llvm/Transforms/Scalar/LoopSink.h | 4 +- .../llvm/Transforms/Scalar/LoopUnrollAndJamPass.h | 4 +- .../llvm/Transforms/Scalar/LoopVersioningLICM.h | 4 +- llvm/include/llvm/Transforms/Scalar/LowerAtomic.h | 35 - .../llvm/Transforms/Scalar/LowerAtomicPass.h | 30 + .../Transforms/Scalar/LowerConstantIntrinsics.h | 3 +- .../llvm/Transforms/Scalar/LowerExpectIntrinsic.h | 3 +- .../llvm/Transforms/Scalar/MemCpyOptimizer.h | 4 +- .../llvm/Transforms/Scalar/MergedLoadStoreMotion.h | 3 +- .../Transforms/Scalar/PartiallyInlineLibCalls.h | 2 +- llvm/include/llvm/Transforms/Scalar/SCCP.h | 18 +- .../Transforms/Scalar/ScalarizeMaskedMemIntrin.h | 2 +- llvm/include/llvm/Transforms/Scalar/Scalarizer.h | 21 +- .../llvm/Transforms/Scalar/SimpleLoopUnswitch.h | 9 +- llvm/include/llvm/Transforms/Scalar/Sink.h | 3 +- .../llvm/Transforms/Scalar/SpeculativeExecution.h | 2 +- .../llvm/Transforms/Scalar/TLSVariableHoist.h | 131 + .../Transforms/Scalar/TailRecursionElimination.h | 3 +- .../llvm/Transforms/Scalar/WarnMissedTransforms.h | 3 +- llvm/include/llvm/Transforms/Utils.h | 6 + .../llvm/Transforms/Utils/AssumeBundleBuilder.h | 7 +- .../llvm/Transforms/Utils/BasicBlockUtils.h | 17 +- .../llvm/Transforms/Utils/BreakCriticalEdges.h | 3 +- llvm/include/llvm/Transforms/Utils/BuildLibCalls.h | 69 +- .../llvm/Transforms/Utils/CallGraphUpdater.h | 5 +- .../llvm/Transforms/Utils/CallPromotionUtils.h | 10 + .../llvm/Transforms/Utils/CanonicalizeAliases.h | 3 +- .../Transforms/Utils/CanonicalizeFreezeInLoops.h | 2 +- llvm/include/llvm/Transforms/Utils/CodeExtractor.h | 15 +- llvm/include/llvm/Transforms/Utils/CtorUtils.h | 8 +- llvm/include/llvm/Transforms/Utils/Debugify.h | 38 +- .../llvm/Transforms/Utils/EscapeEnumerator.h | 5 +- llvm/include/llvm/Transforms/Utils/Evaluator.h | 5 +- .../llvm/Transforms/Utils/FunctionComparator.h | 2 +- llvm/include/llvm/Transforms/Utils/GlobalStatus.h | 3 + .../llvm/Transforms/Utils/InjectTLIMappings.h | 1 + llvm/include/llvm/Transforms/Utils/Local.h | 20 +- llvm/include/llvm/Transforms/Utils/LoopUtils.h | 45 +- .../include/llvm/Transforms/Utils/LoopVersioning.h | 7 +- llvm/include/llvm/Transforms/Utils/LowerAtomic.h | 37 + .../llvm/Transforms/Utils/LowerGlobalDtors.h | 28 + .../llvm/Transforms/Utils/LowerMemIntrinsics.h | 24 +- .../llvm/Transforms/Utils/MemoryTaggingSupport.h | 82 + llvm/include/llvm/Transforms/Utils/MisExpect.h | 77 + llvm/include/llvm/Transforms/Utils/ModuleUtils.h | 11 +- .../llvm/Transforms/Utils/NameAnonGlobals.h | 1 - llvm/include/llvm/Transforms/Utils/PredicateInfo.h | 2 +- .../Transforms/Utils/RelLookupTableConverter.h | 3 +- llvm/include/llvm/Transforms/Utils/SCCPSolver.h | 42 +- .../include/llvm/Transforms/Utils/SSAUpdaterImpl.h | 26 + .../llvm/Transforms/Utils/SampleProfileInference.h | 1 - .../Transforms/Utils/SampleProfileLoaderBaseImpl.h | 5 +- .../Transforms/Utils/SampleProfileLoaderBaseUtil.h | 8 +- .../Transforms/Utils/ScalarEvolutionExpander.h | 24 +- .../llvm/Transforms/Utils/SimplifyCFGOptions.h | 5 + .../include/llvm/Transforms/Utils/SimplifyIndVar.h | 7 +- .../llvm/Transforms/Utils/SimplifyLibCalls.h | 12 +- llvm/include/llvm/Transforms/Utils/SizeOpts.h | 1 - llvm/include/llvm/Transforms/Utils/SplitModule.h | 2 +- llvm/include/llvm/Transforms/Utils/UnrollLoop.h | 9 +- .../Transforms/Vectorize/LoadStoreVectorizer.h | 3 +- .../Vectorize/LoopVectorizationLegality.h | 31 +- .../llvm/Transforms/Vectorize/SLPVectorizer.h | 4 +- llvm/include/llvm/WindowsDriver/MSVCPaths.h | 107 + llvm/include/llvm/WindowsDriver/MSVCSetupApi.h | 523 + llvm/include/llvm/module.modulemap | 7 +- llvm/lib/Analysis/AliasAnalysis.cpp | 25 +- llvm/lib/Analysis/AliasAnalysisEvaluator.cpp | 110 +- llvm/lib/Analysis/AliasSetTracker.cpp | 33 +- llvm/lib/Analysis/Analysis.cpp | 16 +- llvm/lib/Analysis/AssumeBundleQueries.cpp | 4 +- llvm/lib/Analysis/AssumptionCache.cpp | 4 +- llvm/lib/Analysis/BasicAliasAnalysis.cpp | 75 +- llvm/lib/Analysis/BlockFrequencyInfo.cpp | 1 - llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp | 5 +- llvm/lib/Analysis/BranchProbabilityInfo.cpp | 17 +- llvm/lib/Analysis/CFG.cpp | 6 +- llvm/lib/Analysis/CFGPrinter.cpp | 2 +- llvm/lib/Analysis/CFLAndersAliasAnalysis.cpp | 4 +- llvm/lib/Analysis/CFLGraph.h | 4 +- llvm/lib/Analysis/CFLSteensAliasAnalysis.cpp | 14 +- llvm/lib/Analysis/CGSCCPassManager.cpp | 39 +- llvm/lib/Analysis/CallGraph.cpp | 4 +- llvm/lib/Analysis/CallGraphSCCPass.cpp | 7 +- llvm/lib/Analysis/CallPrinter.cpp | 106 +- llvm/lib/Analysis/CaptureTracking.cpp | 331 +- llvm/lib/Analysis/CmpInstAnalysis.cpp | 16 +- llvm/lib/Analysis/CodeMetrics.cpp | 15 +- llvm/lib/Analysis/ConstantFolding.cpp | 266 +- llvm/lib/Analysis/ConstraintSystem.cpp | 1 - llvm/lib/Analysis/CostModel.cpp | 4 +- llvm/lib/Analysis/CycleAnalysis.cpp | 6 +- llvm/lib/Analysis/DDG.cpp | 9 +- llvm/lib/Analysis/DDGPrinter.cpp | 4 +- llvm/lib/Analysis/Delinearization.cpp | 40 +- llvm/lib/Analysis/DemandedBits.cpp | 6 - llvm/lib/Analysis/DependenceAnalysis.cpp | 102 +- llvm/lib/Analysis/DependenceGraphBuilder.cpp | 1 + llvm/lib/Analysis/DevelopmentModeInlineAdvisor.cpp | 8 +- llvm/lib/Analysis/DivergenceAnalysis.cpp | 3 +- llvm/lib/Analysis/DomPrinter.cpp | 305 +- llvm/lib/Analysis/DomTreeUpdater.cpp | 93 +- llvm/lib/Analysis/DominanceFrontier.cpp | 1 - llvm/lib/Analysis/EHPersonalities.cpp | 6 +- llvm/lib/Analysis/FunctionPropertiesAnalysis.cpp | 233 +- llvm/lib/Analysis/GlobalsModRef.cpp | 51 +- llvm/lib/Analysis/IRSimilarityIdentifier.cpp | 96 +- llvm/lib/Analysis/IVDescriptors.cpp | 266 +- llvm/lib/Analysis/IVUsers.cpp | 6 +- .../lib/Analysis/IndirectCallPromotionAnalysis.cpp | 13 +- llvm/lib/Analysis/InlineAdvisor.cpp | 102 +- llvm/lib/Analysis/InlineCost.cpp | 178 +- llvm/lib/Analysis/InlineSizeEstimatorAnalysis.cpp | 25 +- llvm/lib/Analysis/InstructionSimplify.cpp | 1310 +- llvm/lib/Analysis/Interval.cpp | 1 - llvm/lib/Analysis/LazyCallGraph.cpp | 8 +- llvm/lib/Analysis/LazyValueInfo.cpp | 32 +- llvm/lib/Analysis/LegacyDivergenceAnalysis.cpp | 1 + llvm/lib/Analysis/Lint.cpp | 220 +- llvm/lib/Analysis/Loads.cpp | 9 +- llvm/lib/Analysis/LoopAccessAnalysis.cpp | 486 +- llvm/lib/Analysis/LoopAnalysisManager.cpp | 3 - llvm/lib/Analysis/LoopCacheAnalysis.cpp | 129 +- llvm/lib/Analysis/LoopInfo.cpp | 11 +- llvm/lib/Analysis/LoopNestAnalysis.cpp | 3 +- llvm/lib/Analysis/LoopPass.cpp | 8 +- llvm/lib/Analysis/LoopUnrollAnalyzer.cpp | 11 +- llvm/lib/Analysis/MLInlineAdvisor.cpp | 141 +- llvm/lib/Analysis/MemDepPrinter.cpp | 1 - llvm/lib/Analysis/MemDerefPrinter.cpp | 3 - llvm/lib/Analysis/MemoryBuiltins.cpp | 524 +- llvm/lib/Analysis/MemoryDependenceAnalysis.cpp | 64 +- llvm/lib/Analysis/MemoryLocation.cpp | 2 - llvm/lib/Analysis/MemorySSA.cpp | 36 +- llvm/lib/Analysis/MemorySSAUpdater.cpp | 23 +- llvm/lib/Analysis/ModelUnderTrainingRunner.cpp | 29 +- llvm/lib/Analysis/ModuleDebugInfoPrinter.cpp | 2 +- llvm/lib/Analysis/ModuleSummaryAnalysis.cpp | 15 +- llvm/lib/Analysis/MustExecute.cpp | 7 +- llvm/lib/Analysis/NoInferenceModelRunner.cpp | 16 +- llvm/lib/Analysis/ObjCARCAliasAnalysis.cpp | 2 - llvm/lib/Analysis/OptimizationRemarkEmitter.cpp | 4 +- llvm/lib/Analysis/OverflowInstAnalysis.cpp | 1 - llvm/lib/Analysis/PHITransAddr.cpp | 9 +- llvm/lib/Analysis/ProfileSummaryInfo.cpp | 13 +- llvm/lib/Analysis/PtrUseVisitor.cpp | 1 - llvm/lib/Analysis/RegionInfo.cpp | 1 + llvm/lib/Analysis/RegionPass.cpp | 8 +- llvm/lib/Analysis/RegionPrinter.cpp | 69 +- llvm/lib/Analysis/ReplayInlineAdvisor.cpp | 22 +- llvm/lib/Analysis/ScalarEvolution.cpp | 1323 +- llvm/lib/Analysis/ScalarEvolutionAliasAnalysis.cpp | 1 + llvm/lib/Analysis/ScalarEvolutionDivision.cpp | 2 - llvm/lib/Analysis/ScalarEvolutionNormalization.cpp | 1 + llvm/lib/Analysis/ScopedNoAliasAA.cpp | 1 - llvm/lib/Analysis/StackLifetime.cpp | 7 +- llvm/lib/Analysis/StackSafetyAnalysis.cpp | 5 +- llvm/lib/Analysis/StratifiedSets.h | 6 +- llvm/lib/Analysis/SyncDependenceAnalysis.cpp | 8 +- llvm/lib/Analysis/SyntheticCountsUtils.cpp | 7 +- llvm/lib/Analysis/TFUtils.cpp | 163 +- llvm/lib/Analysis/TargetLibraryInfo.cpp | 12 +- llvm/lib/Analysis/TargetTransformInfo.cpp | 70 +- llvm/lib/Analysis/TensorSpec.cpp | 144 + llvm/lib/Analysis/TypeBasedAliasAnalysis.cpp | 1 - llvm/lib/Analysis/TypeMetadataUtils.cpp | 1 - llvm/lib/Analysis/VFABIDemangling.cpp | 2 - llvm/lib/Analysis/ValueLatticeUtils.cpp | 9 +- llvm/lib/Analysis/ValueTracking.cpp | 509 +- llvm/lib/Analysis/VectorUtils.cpp | 132 +- llvm/lib/AsmParser/LLLexer.cpp | 94 +- llvm/lib/AsmParser/LLParser.cpp | 225 +- llvm/lib/AsmParser/Parser.cpp | 2 - llvm/lib/BinaryFormat/AMDGPUMetadataVerifier.cpp | 4 +- llvm/lib/BinaryFormat/COFF.cpp | 57 + llvm/lib/BinaryFormat/Magic.cpp | 14 + llvm/lib/BinaryFormat/Wasm.cpp | 29 +- llvm/lib/Bitcode/Reader/BitReader.cpp | 1 - llvm/lib/Bitcode/Reader/BitcodeAnalyzer.cpp | 16 +- llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 1774 +- llvm/lib/Bitcode/Reader/MetadataLoader.cpp | 90 +- llvm/lib/Bitcode/Reader/MetadataLoader.h | 6 +- llvm/lib/Bitcode/Reader/ValueList.cpp | 195 +- llvm/lib/Bitcode/Reader/ValueList.h | 61 +- llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | 90 +- llvm/lib/Bitcode/Writer/BitcodeWriterPass.cpp | 1 - llvm/lib/Bitcode/Writer/ValueEnumerator.cpp | 136 +- llvm/lib/Bitstream/Reader/BitstreamReader.cpp | 57 +- llvm/lib/CodeGen/Analysis.cpp | 3 - llvm/lib/CodeGen/AsmPrinter/AIXException.cpp | 19 +- llvm/lib/CodeGen/AsmPrinter/ARMException.cpp | 15 +- llvm/lib/CodeGen/AsmPrinter/AccelTable.cpp | 3 +- llvm/lib/CodeGen/AsmPrinter/AddressPool.cpp | 4 +- llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 460 +- llvm/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp | 12 +- .../lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp | 11 +- llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp | 123 +- llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.h | 70 +- llvm/lib/CodeGen/AsmPrinter/DIE.cpp | 11 +- llvm/lib/CodeGen/AsmPrinter/DIEHash.cpp | 1 - .../AsmPrinter/DbgEntityHistoryCalculator.cpp | 3 +- llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp | 1 - llvm/lib/CodeGen/AsmPrinter/DwarfCFIException.cpp | 12 +- llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | 23 +- llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h | 1 - llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 60 +- llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h | 19 +- llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp | 11 +- llvm/lib/CodeGen/AsmPrinter/DwarfFile.cpp | 4 +- llvm/lib/CodeGen/AsmPrinter/DwarfStringPool.cpp | 10 +- llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp | 28 +- llvm/lib/CodeGen/AsmPrinter/EHStreamer.cpp | 7 +- llvm/lib/CodeGen/AsmPrinter/ErlangGCPrinter.cpp | 6 +- llvm/lib/CodeGen/AsmPrinter/OcamlGCPrinter.cpp | 12 +- llvm/lib/CodeGen/AsmPrinter/PseudoProbePrinter.cpp | 2 +- llvm/lib/CodeGen/AsmPrinter/WasmException.cpp | 2 + llvm/lib/CodeGen/AsmPrinter/WasmException.h | 5 +- llvm/lib/CodeGen/AsmPrinter/WinCFGuard.cpp | 19 +- llvm/lib/CodeGen/AsmPrinter/WinException.cpp | 58 +- llvm/lib/CodeGen/AtomicExpandPass.cpp | 332 +- llvm/lib/CodeGen/BasicBlockSections.cpp | 181 +- .../CodeGen/BasicBlockSectionsProfileReader.cpp | 144 + llvm/lib/CodeGen/BranchFolding.cpp | 8 +- llvm/lib/CodeGen/BranchFolding.h | 1 - llvm/lib/CodeGen/BranchRelaxation.cpp | 1 - llvm/lib/CodeGen/BreakFalseDeps.cpp | 4 +- llvm/lib/CodeGen/CFIFixup.cpp | 225 + llvm/lib/CodeGen/CFIInstrInserter.cpp | 4 +- llvm/lib/CodeGen/CalcSpillWeights.cpp | 5 - llvm/lib/CodeGen/CallingConvLower.cpp | 16 +- llvm/lib/CodeGen/CodeGen.cpp | 4 + llvm/lib/CodeGen/CodeGenCommonISel.cpp | 34 +- llvm/lib/CodeGen/CodeGenPrepare.cpp | 192 +- llvm/lib/CodeGen/CommandFlags.cpp | 33 +- llvm/lib/CodeGen/DFAPacketizer.cpp | 2 +- llvm/lib/CodeGen/DeadMachineInstructionElim.cpp | 1 - llvm/lib/CodeGen/DetectDeadLanes.cpp | 20 +- llvm/lib/CodeGen/EHContGuardCatchret.cpp | 2 - llvm/lib/CodeGen/EarlyIfConversion.cpp | 7 +- llvm/lib/CodeGen/ExpandMemCmp.cpp | 14 +- llvm/lib/CodeGen/ExpandPostRAPseudos.cpp | 10 +- llvm/lib/CodeGen/ExpandReductions.cpp | 2 - llvm/lib/CodeGen/ExpandVectorPredication.cpp | 27 +- llvm/lib/CodeGen/FEntryInserter.cpp | 3 - llvm/lib/CodeGen/FaultMaps.cpp | 2 +- llvm/lib/CodeGen/FinalizeISel.cpp | 2 - llvm/lib/CodeGen/FixupStatepointCallerSaved.cpp | 12 +- llvm/lib/CodeGen/GCMetadata.cpp | 3 - llvm/lib/CodeGen/GCRootLowering.cpp | 5 +- llvm/lib/CodeGen/GlobalISel/CSEInfo.cpp | 5 +- llvm/lib/CodeGen/GlobalISel/CSEMIRBuilder.cpp | 45 +- llvm/lib/CodeGen/GlobalISel/CallLowering.cpp | 10 +- llvm/lib/CodeGen/GlobalISel/Combiner.cpp | 8 +- llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp | 313 +- llvm/lib/CodeGen/GlobalISel/GISelKnownBits.cpp | 41 + llvm/lib/CodeGen/GlobalISel/GlobalISel.cpp | 1 - llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp | 58 +- llvm/lib/CodeGen/GlobalISel/InlineAsmLowering.cpp | 10 +- llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp | 5 +- .../lib/CodeGen/GlobalISel/InstructionSelector.cpp | 11 +- llvm/lib/CodeGen/GlobalISel/LegalityPredicates.cpp | 7 + llvm/lib/CodeGen/GlobalISel/LegalizeMutations.cpp | 21 + llvm/lib/CodeGen/GlobalISel/Legalizer.cpp | 6 +- llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp | 150 +- llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp | 10 +- llvm/lib/CodeGen/GlobalISel/LoadStoreOpt.cpp | 7 + llvm/lib/CodeGen/GlobalISel/Localizer.cpp | 1 + llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp | 56 +- llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp | 8 +- llvm/lib/CodeGen/GlobalISel/RegisterBank.cpp | 110 - llvm/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp | 805 - llvm/lib/CodeGen/GlobalISel/Utils.cpp | 154 +- llvm/lib/CodeGen/GlobalMerge.cpp | 14 + llvm/lib/CodeGen/HardwareLoops.cpp | 3 - llvm/lib/CodeGen/IfConversion.cpp | 4 +- llvm/lib/CodeGen/IndirectBrExpandPass.cpp | 6 +- llvm/lib/CodeGen/InlineSpiller.cpp | 14 +- llvm/lib/CodeGen/InterferenceCache.h | 2 +- llvm/lib/CodeGen/InterleavedAccessPass.cpp | 2 +- llvm/lib/CodeGen/InterleavedLoadCombinePass.cpp | 22 +- llvm/lib/CodeGen/JMCInstrumenter.cpp | 233 + llvm/lib/CodeGen/LLVMTargetMachine.cpp | 38 +- llvm/lib/CodeGen/LazyMachineBlockFrequencyInfo.cpp | 3 +- .../CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp | 625 +- .../CodeGen/LiveDebugValues/InstrRefBasedImpl.h | 142 +- .../CodeGen/LiveDebugValues/LiveDebugValues.cpp | 15 +- llvm/lib/CodeGen/LiveDebugValues/LiveDebugValues.h | 11 +- .../CodeGen/LiveDebugValues/VarLocBasedImpl.cpp | 22 +- llvm/lib/CodeGen/LiveDebugVariables.cpp | 29 +- llvm/lib/CodeGen/LiveInterval.cpp | 19 +- llvm/lib/CodeGen/LiveIntervalCalc.cpp | 11 +- llvm/lib/CodeGen/LiveIntervalUnion.cpp | 15 +- llvm/lib/CodeGen/LiveIntervals.cpp | 14 +- llvm/lib/CodeGen/LiveRangeCalc.cpp | 2 - llvm/lib/CodeGen/LiveRangeEdit.cpp | 2 +- llvm/lib/CodeGen/LiveRangeShrink.cpp | 1 - llvm/lib/CodeGen/LiveRegMatrix.cpp | 17 +- llvm/lib/CodeGen/LiveStacks.cpp | 5 +- llvm/lib/CodeGen/LocalStackSlotAllocation.cpp | 19 +- llvm/lib/CodeGen/LowLevelType.cpp | 1 - llvm/lib/CodeGen/LowerEmuTLS.cpp | 1 - llvm/lib/CodeGen/MIRCanonicalizerPass.cpp | 10 +- llvm/lib/CodeGen/MIRFSDiscriminator.cpp | 7 +- llvm/lib/CodeGen/MIRNamerPass.cpp | 4 - llvm/lib/CodeGen/MIRParser/MILexer.cpp | 3 +- llvm/lib/CodeGen/MIRParser/MIParser.cpp | 74 +- llvm/lib/CodeGen/MIRParser/MIRParser.cpp | 30 +- llvm/lib/CodeGen/MIRPrinter.cpp | 32 +- llvm/lib/CodeGen/MIRSampleProfile.cpp | 8 + llvm/lib/CodeGen/MIRVRegNamerUtils.cpp | 1 - llvm/lib/CodeGen/MLRegallocEvictAdvisor.cpp | 119 +- llvm/lib/CodeGen/MachineBasicBlock.cpp | 27 +- llvm/lib/CodeGen/MachineBlockPlacement.cpp | 15 +- llvm/lib/CodeGen/MachineBranchProbabilityInfo.cpp | 2 - llvm/lib/CodeGen/MachineCSE.cpp | 6 +- llvm/lib/CodeGen/MachineCheckDebugify.cpp | 18 +- llvm/lib/CodeGen/MachineCombiner.cpp | 3 +- llvm/lib/CodeGen/MachineCopyPropagation.cpp | 426 +- llvm/lib/CodeGen/MachineCycleAnalysis.cpp | 110 +- llvm/lib/CodeGen/MachineDebugify.cpp | 3 - llvm/lib/CodeGen/MachineDominanceFrontier.cpp | 3 +- llvm/lib/CodeGen/MachineDominators.cpp | 2 + llvm/lib/CodeGen/MachineFunction.cpp | 114 +- llvm/lib/CodeGen/MachineFunctionPass.cpp | 1 + llvm/lib/CodeGen/MachineFunctionSplitter.cpp | 9 +- llvm/lib/CodeGen/MachineInstr.cpp | 49 +- llvm/lib/CodeGen/MachineInstrBundle.cpp | 5 +- llvm/lib/CodeGen/MachineLICM.cpp | 20 +- llvm/lib/CodeGen/MachineLoopInfo.cpp | 5 +- llvm/lib/CodeGen/MachineLoopUtils.cpp | 20 +- llvm/lib/CodeGen/MachineModuleInfo.cpp | 218 +- llvm/lib/CodeGen/MachineOperand.cpp | 2 - .../CodeGen/MachineOptimizationRemarkEmitter.cpp | 4 +- llvm/lib/CodeGen/MachineOutliner.cpp | 53 +- llvm/lib/CodeGen/MachinePipeliner.cpp | 133 +- llvm/lib/CodeGen/MachineRegisterInfo.cpp | 16 +- llvm/lib/CodeGen/MachineSSAContext.cpp | 2 + llvm/lib/CodeGen/MachineScheduler.cpp | 15 +- llvm/lib/CodeGen/MachineSink.cpp | 290 +- llvm/lib/CodeGen/MachineStableHash.cpp | 56 +- llvm/lib/CodeGen/MachineStripDebug.cpp | 4 +- llvm/lib/CodeGen/MachineVerifier.cpp | 86 +- llvm/lib/CodeGen/MacroFusion.cpp | 3 +- llvm/lib/CodeGen/ModuloSchedule.cpp | 88 +- llvm/lib/CodeGen/NonRelocatableStringpool.cpp | 4 +- llvm/lib/CodeGen/OptimizePHIs.cpp | 1 - llvm/lib/CodeGen/PHIElimination.cpp | 2 - llvm/lib/CodeGen/ParallelCG.cpp | 3 +- llvm/lib/CodeGen/PatchableFunction.cpp | 4 +- llvm/lib/CodeGen/PeepholeOptimizer.cpp | 16 +- llvm/lib/CodeGen/PostRAHazardRecognizer.cpp | 12 +- llvm/lib/CodeGen/PostRASchedulerList.cpp | 8 +- llvm/lib/CodeGen/PreISelIntrinsicLowering.cpp | 2 - llvm/lib/CodeGen/ProcessImplicitDefs.cpp | 11 +- llvm/lib/CodeGen/PrologEpilogInserter.cpp | 184 +- llvm/lib/CodeGen/PseudoProbeInserter.cpp | 4 +- llvm/lib/CodeGen/PseudoSourceValue.cpp | 46 +- llvm/lib/CodeGen/RDFGraph.cpp | 16 +- llvm/lib/CodeGen/RDFLiveness.cpp | 6 +- llvm/lib/CodeGen/ReachingDefAnalysis.cpp | 14 +- llvm/lib/CodeGen/RegAllocBase.cpp | 9 +- llvm/lib/CodeGen/RegAllocBase.h | 10 +- llvm/lib/CodeGen/RegAllocBasic.cpp | 33 +- llvm/lib/CodeGen/RegAllocEvictionAdvisor.cpp | 38 +- llvm/lib/CodeGen/RegAllocEvictionAdvisor.h | 48 +- llvm/lib/CodeGen/RegAllocFast.cpp | 36 +- llvm/lib/CodeGen/RegAllocGreedy.cpp | 564 +- llvm/lib/CodeGen/RegAllocGreedy.h | 187 +- llvm/lib/CodeGen/RegAllocPBQP.cpp | 1 + llvm/lib/CodeGen/RegAllocScore.cpp | 22 +- llvm/lib/CodeGen/RegAllocScore.h | 19 +- llvm/lib/CodeGen/RegUsageInfoCollector.cpp | 5 +- llvm/lib/CodeGen/RegUsageInfoPropagate.cpp | 3 +- llvm/lib/CodeGen/RegisterBank.cpp | 110 + llvm/lib/CodeGen/RegisterBankInfo.cpp | 802 + llvm/lib/CodeGen/RegisterClassInfo.cpp | 19 +- llvm/lib/CodeGen/RegisterCoalescer.cpp | 2 +- llvm/lib/CodeGen/RegisterScavenging.cpp | 2 - llvm/lib/CodeGen/RegisterUsageInfo.cpp | 2 - llvm/lib/CodeGen/RemoveRedundantDebugValues.cpp | 3 +- llvm/lib/CodeGen/RenameIndependentSubregs.cpp | 2 +- llvm/lib/CodeGen/ReplaceWithVeclib.cpp | 5 +- llvm/lib/CodeGen/SafeStack.cpp | 57 +- llvm/lib/CodeGen/SafeStackLayout.cpp | 1 - llvm/lib/CodeGen/SafeStackLayout.h | 2 +- llvm/lib/CodeGen/ScheduleDAGInstrs.cpp | 10 +- llvm/lib/CodeGen/ScheduleDAGPrinter.cpp | 5 - llvm/lib/CodeGen/SelectOptimize.cpp | 989 + llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 1973 +- llvm/lib/CodeGen/SelectionDAG/FastISel.cpp | 40 +- .../CodeGen/SelectionDAG/FunctionLoweringInfo.cpp | 28 +- llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp | 22 +- llvm/lib/CodeGen/SelectionDAG/InstrEmitter.h | 3 +- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 262 +- .../CodeGen/SelectionDAG/LegalizeFloatTypes.cpp | 24 +- .../CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp | 388 +- llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp | 92 +- llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h | 13 +- .../lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp | 46 +- .../CodeGen/SelectionDAG/LegalizeVectorTypes.cpp | 936 +- .../CodeGen/SelectionDAG/ResourcePriorityQueue.cpp | 14 +- llvm/lib/CodeGen/SelectionDAG/SDNodeDbgValue.h | 1 + llvm/lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp | 42 +- .../lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp | 19 +- .../CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp | 5 +- llvm/lib/CodeGen/SelectionDAG/ScheduleDAGVLIW.cpp | 4 - llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 860 +- .../SelectionDAG/SelectionDAGAddressAnalysis.cpp | 2 +- .../CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 491 +- .../lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h | 26 +- .../CodeGen/SelectionDAG/SelectionDAGDumper.cpp | 12 +- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 36 +- .../CodeGen/SelectionDAG/SelectionDAGPrinter.cpp | 28 +- .../CodeGen/SelectionDAG/StatepointLowering.cpp | 59 +- llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp | 888 +- llvm/lib/CodeGen/ShadowStackGCLowering.cpp | 3 +- llvm/lib/CodeGen/SjLjEHPrepare.cpp | 2 +- llvm/lib/CodeGen/SplitKit.cpp | 89 +- llvm/lib/CodeGen/SplitKit.h | 23 +- llvm/lib/CodeGen/StackColoring.cpp | 10 +- llvm/lib/CodeGen/StackMapLivenessAnalysis.cpp | 2 +- llvm/lib/CodeGen/StackMaps.cpp | 4 +- llvm/lib/CodeGen/StackProtector.cpp | 4 +- llvm/lib/CodeGen/StackSlotColoring.cpp | 1 - llvm/lib/CodeGen/TailDuplication.cpp | 4 +- llvm/lib/CodeGen/TailDuplicator.cpp | 23 +- llvm/lib/CodeGen/TargetFrameLoweringImpl.cpp | 9 +- llvm/lib/CodeGen/TargetInstrInfo.cpp | 14 +- llvm/lib/CodeGen/TargetLoweringBase.cpp | 209 +- llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | 91 +- llvm/lib/CodeGen/TargetOptionsImpl.cpp | 1 - llvm/lib/CodeGen/TargetPassConfig.cpp | 80 +- llvm/lib/CodeGen/TargetRegisterInfo.cpp | 3 +- llvm/lib/CodeGen/TargetSchedule.cpp | 1 - llvm/lib/CodeGen/TargetSubtargetInfo.cpp | 4 - llvm/lib/CodeGen/TwoAddressInstructionPass.cpp | 72 +- llvm/lib/CodeGen/TypePromotion.cpp | 137 +- llvm/lib/CodeGen/UnreachableBlockElim.cpp | 14 +- llvm/lib/CodeGen/VLIWMachineScheduler.cpp | 10 +- llvm/lib/CodeGen/ValueTypes.cpp | 15 +- llvm/lib/CodeGen/WasmEHPrepare.cpp | 12 +- llvm/lib/CodeGen/WinEHPrepare.cpp | 6 +- llvm/lib/DWARFLinker/DWARFLinker.cpp | 150 +- llvm/lib/DWARFLinker/DWARFLinkerCompileUnit.cpp | 6 +- llvm/lib/DWARFLinker/DWARFLinkerDeclContext.cpp | 1 + llvm/lib/DWARFLinker/DWARFStreamer.cpp | 49 +- llvm/lib/DWP/DWP.cpp | 17 +- .../CodeView/AppendingTypeTableBuilder.cpp | 9 +- llvm/lib/DebugInfo/CodeView/CVSymbolVisitor.cpp | 75 +- llvm/lib/DebugInfo/CodeView/CVTypeVisitor.cpp | 5 +- llvm/lib/DebugInfo/CodeView/CodeViewRecordIO.cpp | 33 +- .../CodeView/ContinuationRecordBuilder.cpp | 8 +- .../DebugInfo/CodeView/DebugCrossExSubsection.cpp | 1 + .../CodeView/DebugFrameDataSubsection.cpp | 2 + .../CodeView/DebugInlineeLinesSubsection.cpp | 1 + llvm/lib/DebugInfo/CodeView/DebugSubsection.cpp | 4 +- .../DebugInfo/CodeView/DebugSubsectionRecord.cpp | 1 - .../DebugInfo/CodeView/DebugSubsectionVisitor.cpp | 3 +- .../DebugInfo/CodeView/DebugSymbolsSubsection.cpp | 1 + llvm/lib/DebugInfo/CodeView/Formatters.cpp | 4 +- .../DebugInfo/CodeView/GlobalTypeTableBuilder.cpp | 10 +- .../CodeView/LazyRandomTypeCollection.cpp | 5 +- .../DebugInfo/CodeView/MergingTypeTableBuilder.cpp | 11 +- llvm/lib/DebugInfo/CodeView/RecordName.cpp | 6 +- .../lib/DebugInfo/CodeView/RecordSerialization.cpp | 2 +- .../DebugInfo/CodeView/SimpleTypeSerializer.cpp | 5 +- .../lib/DebugInfo/CodeView/StringsAndChecksums.cpp | 1 - llvm/lib/DebugInfo/CodeView/SymbolDumper.cpp | 4 +- .../lib/DebugInfo/CodeView/SymbolRecordHelpers.cpp | 2 +- llvm/lib/DebugInfo/CodeView/SymbolSerializer.cpp | 6 +- llvm/lib/DebugInfo/CodeView/TypeDumpVisitor.cpp | 5 +- llvm/lib/DebugInfo/CodeView/TypeHashing.cpp | 3 +- llvm/lib/DebugInfo/CodeView/TypeIndex.cpp | 1 + llvm/lib/DebugInfo/CodeView/TypeRecordMapping.cpp | 38 +- llvm/lib/DebugInfo/CodeView/TypeStreamMerger.cpp | 6 +- .../lib/DebugInfo/CodeView/TypeTableCollection.cpp | 5 +- .../DWARF/DWARFAbbreviationDeclaration.cpp | 2 +- llvm/lib/DebugInfo/DWARF/DWARFAcceleratorTable.cpp | 1 - llvm/lib/DebugInfo/DWARF/DWARFAddressRange.cpp | 2 +- llvm/lib/DebugInfo/DWARF/DWARFCompileUnit.cpp | 3 +- llvm/lib/DebugInfo/DWARF/DWARFContext.cpp | 127 +- llvm/lib/DebugInfo/DWARF/DWARFDataExtractor.cpp | 4 +- llvm/lib/DebugInfo/DWARF/DWARFDebugAddr.cpp | 1 + llvm/lib/DebugInfo/DWARF/DWARFDebugAranges.cpp | 15 +- llvm/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp | 13 +- llvm/lib/DebugInfo/DWARF/DWARFDebugInfoEntry.cpp | 3 +- llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp | 14 +- llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp | 12 +- llvm/lib/DebugInfo/DWARF/DWARFDebugMacro.cpp | 7 +- llvm/lib/DebugInfo/DWARF/DWARFDie.cpp | 648 +- llvm/lib/DebugInfo/DWARF/DWARFFormValue.cpp | 5 +- llvm/lib/DebugInfo/DWARF/DWARFGdbIndex.cpp | 2 +- llvm/lib/DebugInfo/DWARF/DWARFTypePrinter.cpp | 608 + llvm/lib/DebugInfo/DWARF/DWARFTypeUnit.cpp | 2 - llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp | 119 +- llvm/lib/DebugInfo/DWARF/DWARFUnitIndex.cpp | 1 + llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp | 70 +- llvm/lib/DebugInfo/GSYM/DwarfTransformer.cpp | 29 +- llvm/lib/DebugInfo/GSYM/ExtractRanges.cpp | 79 + llvm/lib/DebugInfo/GSYM/FunctionInfo.cpp | 14 +- llvm/lib/DebugInfo/GSYM/GsymCreator.cpp | 6 +- llvm/lib/DebugInfo/GSYM/GsymReader.cpp | 2 +- llvm/lib/DebugInfo/GSYM/InlineInfo.cpp | 16 +- llvm/lib/DebugInfo/GSYM/LookupResult.cpp | 3 +- llvm/lib/DebugInfo/GSYM/Range.cpp | 123 - llvm/lib/DebugInfo/MSF/MappedBlockStream.cpp | 1 - .../PDB/Native/DbiModuleDescriptorBuilder.cpp | 12 +- llvm/lib/DebugInfo/PDB/Native/DbiModuleList.cpp | 1 + llvm/lib/DebugInfo/PDB/Native/DbiStream.cpp | 2 - llvm/lib/DebugInfo/PDB/Native/DbiStreamBuilder.cpp | 13 +- llvm/lib/DebugInfo/PDB/Native/EnumTables.cpp | 1 + llvm/lib/DebugInfo/PDB/Native/FormatUtil.cpp | 207 + llvm/lib/DebugInfo/PDB/Native/GSIStreamBuilder.cpp | 9 +- llvm/lib/DebugInfo/PDB/Native/GlobalsStream.cpp | 3 +- llvm/lib/DebugInfo/PDB/Native/HashTable.cpp | 3 - llvm/lib/DebugInfo/PDB/Native/InfoStream.cpp | 4 +- .../lib/DebugInfo/PDB/Native/InfoStreamBuilder.cpp | 4 +- .../DebugInfo/PDB/Native/InjectedSourceStream.cpp | 2 +- llvm/lib/DebugInfo/PDB/Native/InputFile.cpp | 587 + llvm/lib/DebugInfo/PDB/Native/LinePrinter.cpp | 340 + .../lib/DebugInfo/PDB/Native/ModuleDebugStream.cpp | 7 +- llvm/lib/DebugInfo/PDB/Native/NamedStreamMap.cpp | 4 +- .../DebugInfo/PDB/Native/NativeCompilandSymbol.cpp | 2 - .../lib/DebugInfo/PDB/Native/NativeEnumGlobals.cpp | 4 +- .../PDB/Native/NativeEnumInjectedSources.cpp | 4 +- .../DebugInfo/PDB/Native/NativeEnumLineNumbers.cpp | 8 +- .../lib/DebugInfo/PDB/Native/NativeEnumModules.cpp | 5 +- .../lib/DebugInfo/PDB/Native/NativeEnumSymbols.cpp | 4 +- llvm/lib/DebugInfo/PDB/Native/NativeEnumTypes.cpp | 9 +- llvm/lib/DebugInfo/PDB/Native/NativeExeSymbol.cpp | 6 +- .../DebugInfo/PDB/Native/NativeFunctionSymbol.cpp | 10 +- .../PDB/Native/NativeInlineSiteSymbol.cpp | 68 +- llvm/lib/DebugInfo/PDB/Native/NativeLineNumber.cpp | 1 + .../DebugInfo/PDB/Native/NativePublicSymbol.cpp | 5 +- llvm/lib/DebugInfo/PDB/Native/NativeRawSymbol.cpp | 1 - llvm/lib/DebugInfo/PDB/Native/NativeSession.cpp | 26 +- llvm/lib/DebugInfo/PDB/Native/NativeSourceFile.cpp | 2 + .../PDB/Native/NativeSymbolEnumerator.cpp | 4 +- llvm/lib/DebugInfo/PDB/Native/NativeTypeArray.cpp | 9 +- .../lib/DebugInfo/PDB/Native/NativeTypeBuiltin.cpp | 3 +- llvm/lib/DebugInfo/PDB/Native/NativeTypeEnum.cpp | 20 +- .../DebugInfo/PDB/Native/NativeTypeFunctionSig.cpp | 5 +- .../lib/DebugInfo/PDB/Native/NativeTypePointer.cpp | 5 +- .../lib/DebugInfo/PDB/Native/NativeTypeTypedef.cpp | 4 +- llvm/lib/DebugInfo/PDB/Native/NativeTypeUDT.cpp | 13 +- .../lib/DebugInfo/PDB/Native/NativeTypeVTShape.cpp | 5 +- llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp | 1 - llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp | 21 +- llvm/lib/DebugInfo/PDB/Native/PDBStringTable.cpp | 1 - .../DebugInfo/PDB/Native/PDBStringTableBuilder.cpp | 7 +- llvm/lib/DebugInfo/PDB/Native/PublicsStream.cpp | 4 +- llvm/lib/DebugInfo/PDB/Native/SymbolCache.cpp | 15 +- llvm/lib/DebugInfo/PDB/Native/SymbolStream.cpp | 5 +- llvm/lib/DebugInfo/PDB/Native/TpiStreamBuilder.cpp | 6 +- llvm/lib/DebugInfo/PDB/PDB.cpp | 1 - llvm/lib/DebugInfo/PDB/PDBContext.cpp | 9 + llvm/lib/DebugInfo/PDB/PDBExtras.cpp | 2 +- llvm/lib/DebugInfo/PDB/PDBSymbol.cpp | 2 +- llvm/lib/DebugInfo/PDB/PDBSymbolAnnotation.cpp | 2 - llvm/lib/DebugInfo/PDB/PDBSymbolBlock.cpp | 3 - llvm/lib/DebugInfo/PDB/PDBSymbolCompiland.cpp | 3 +- .../DebugInfo/PDB/PDBSymbolCompilandDetails.cpp | 3 - llvm/lib/DebugInfo/PDB/PDBSymbolCompilandEnv.cpp | 4 +- llvm/lib/DebugInfo/PDB/PDBSymbolCustom.cpp | 3 - llvm/lib/DebugInfo/PDB/PDBSymbolData.cpp | 3 +- llvm/lib/DebugInfo/PDB/PDBSymbolExe.cpp | 4 +- llvm/lib/DebugInfo/PDB/PDBSymbolFunc.cpp | 2 + llvm/lib/DebugInfo/PDB/PDBSymbolFuncDebugEnd.cpp | 3 - llvm/lib/DebugInfo/PDB/PDBSymbolFuncDebugStart.cpp | 4 +- llvm/lib/DebugInfo/PDB/PDBSymbolLabel.cpp | 2 - llvm/lib/DebugInfo/PDB/PDBSymbolPublicSymbol.cpp | 4 +- llvm/lib/DebugInfo/PDB/PDBSymbolThunk.cpp | 2 - llvm/lib/DebugInfo/PDB/PDBSymbolTypeArray.cpp | 2 - llvm/lib/DebugInfo/PDB/PDBSymbolTypeBaseClass.cpp | 4 +- llvm/lib/DebugInfo/PDB/PDBSymbolTypeBuiltin.cpp | 2 - llvm/lib/DebugInfo/PDB/PDBSymbolTypeCustom.cpp | 3 - llvm/lib/DebugInfo/PDB/PDBSymbolTypeDimension.cpp | 3 - llvm/lib/DebugInfo/PDB/PDBSymbolTypeEnum.cpp | 3 +- llvm/lib/DebugInfo/PDB/PDBSymbolTypeFriend.cpp | 3 - .../lib/DebugInfo/PDB/PDBSymbolTypeFunctionArg.cpp | 2 - llvm/lib/DebugInfo/PDB/PDBSymbolTypeManaged.cpp | 3 - llvm/lib/DebugInfo/PDB/PDBSymbolTypePointer.cpp | 3 - llvm/lib/DebugInfo/PDB/PDBSymbolTypeTypedef.cpp | 2 - llvm/lib/DebugInfo/PDB/PDBSymbolTypeUDT.cpp | 10 +- llvm/lib/DebugInfo/PDB/PDBSymbolTypeVTable.cpp | 2 - .../lib/DebugInfo/PDB/PDBSymbolTypeVTableShape.cpp | 3 - llvm/lib/DebugInfo/PDB/PDBSymbolUnknown.cpp | 3 - llvm/lib/DebugInfo/PDB/PDBSymbolUsingNamespace.cpp | 3 - llvm/lib/DebugInfo/PDB/UDTLayout.cpp | 3 + llvm/lib/DebugInfo/Symbolize/DIFetcher.cpp | 57 + llvm/lib/DebugInfo/Symbolize/DIPrinter.cpp | 6 +- llvm/lib/DebugInfo/Symbolize/Markup.cpp | 202 + llvm/lib/DebugInfo/Symbolize/MarkupFilter.cpp | 143 + .../DebugInfo/Symbolize/SymbolizableObjectFile.cpp | 10 +- .../DebugInfo/Symbolize/SymbolizableObjectFile.h | 103 - llvm/lib/DebugInfo/Symbolize/Symbolize.cpp | 316 +- llvm/lib/Debuginfod/DIFetcher.cpp | 28 + llvm/lib/Debuginfod/Debuginfod.cpp | 63 +- llvm/lib/Debuginfod/HTTPClient.cpp | 88 +- llvm/lib/Demangle/Demangle.cpp | 2 +- llvm/lib/Demangle/ItaniumDemangle.cpp | 58 +- llvm/lib/Demangle/MicrosoftDemangle.cpp | 37 +- llvm/lib/Demangle/MicrosoftDemangleNodes.cpp | 4 +- llvm/lib/Demangle/RustDemangle.cpp | 58 +- .../ExecutionEngine/GDBRegistrationListener.cpp | 5 +- llvm/lib/ExecutionEngine/Interpreter/Interpreter.h | 2 +- .../JITLink/DWARFRecordSectionSplitter.cpp | 117 + .../lib/ExecutionEngine/JITLink/EHFrameSupport.cpp | 564 +- .../ExecutionEngine/JITLink/EHFrameSupportImpl.h | 53 +- .../JITLink/ELFLinkGraphBuilder.cpp | 2 +- llvm/lib/ExecutionEngine/JITLink/ELF_aarch64.cpp | 317 +- llvm/lib/ExecutionEngine/JITLink/ELF_riscv.cpp | 72 +- llvm/lib/ExecutionEngine/JITLink/ELF_x86_64.cpp | 26 +- llvm/lib/ExecutionEngine/JITLink/JITLink.cpp | 11 +- .../lib/ExecutionEngine/JITLink/JITLinkGeneric.cpp | 2 +- .../JITLink/JITLinkMemoryManager.cpp | 2 +- .../JITLink/MachOLinkGraphBuilder.cpp | 45 +- llvm/lib/ExecutionEngine/JITLink/MachO_arm64.cpp | 493 +- llvm/lib/ExecutionEngine/JITLink/MachO_x86_64.cpp | 7 +- llvm/lib/ExecutionEngine/JITLink/aarch64.cpp | 52 +- llvm/lib/ExecutionEngine/JITLink/riscv.cpp | 4 + llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp | 1 + llvm/lib/ExecutionEngine/MCJIT/MCJIT.h | 3 +- llvm/lib/ExecutionEngine/Orc/CompileUtils.cpp | 1 + llvm/lib/ExecutionEngine/Orc/Core.cpp | 76 +- .../Orc/DebugObjectManagerPlugin.cpp | 2 +- llvm/lib/ExecutionEngine/Orc/DebugUtils.cpp | 7 + .../ExecutionEngine/Orc/DebuggerSupportPlugin.cpp | 11 +- llvm/lib/ExecutionEngine/Orc/ELFNixPlatform.cpp | 88 +- .../Orc/EPCDebugObjectRegistrar.cpp | 3 +- .../ExecutionEngine/Orc/EPCIndirectionUtils.cpp | 11 +- llvm/lib/ExecutionEngine/Orc/ExecutionUtils.cpp | 8 +- .../ExecutionEngine/Orc/ExecutorProcessControl.cpp | 4 +- llvm/lib/ExecutionEngine/Orc/IRCompileLayer.cpp | 2 +- llvm/lib/ExecutionEngine/Orc/IndirectionUtils.cpp | 16 +- .../Orc/JITTargetMachineBuilder.cpp | 1 + llvm/lib/ExecutionEngine/Orc/LLJIT.cpp | 56 +- llvm/lib/ExecutionEngine/Orc/Layer.cpp | 4 +- llvm/lib/ExecutionEngine/Orc/LazyReexports.cpp | 4 + .../ExecutionEngine/Orc/LookupAndRecordAddrs.cpp | 4 +- llvm/lib/ExecutionEngine/Orc/MachOPlatform.cpp | 433 +- llvm/lib/ExecutionEngine/Orc/MemoryMapper.cpp | 152 + .../ExecutionEngine/Orc/ObjectFileInterface.cpp | 11 +- .../lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp | 14 +- llvm/lib/ExecutionEngine/Orc/OrcABISupport.cpp | 171 + llvm/lib/ExecutionEngine/Orc/OrcV2CBindings.cpp | 252 +- .../Orc/Shared/SimpleRemoteEPCUtils.cpp | 4 +- llvm/lib/ExecutionEngine/Orc/Speculation.cpp | 4 +- .../Orc/TargetProcess/SimpleRemoteEPCServer.cpp | 4 +- llvm/lib/ExecutionEngine/Orc/TaskDispatch.cpp | 2 +- .../RuntimeDyld/RTDyldMemoryManager.cpp | 8 +- .../ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp | 4 +- .../RuntimeDyld/RuntimeDyldChecker.cpp | 3 +- .../ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp | 9 +- llvm/lib/ExecutionEngine/SectionMemoryManager.cpp | 2 +- llvm/lib/FileCheck/FileCheck.cpp | 28 +- llvm/lib/Frontend/OpenMP/OMPContext.cpp | 5 +- llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp | 1143 +- llvm/lib/FuzzMutate/FuzzerCLI.cpp | 48 - llvm/lib/FuzzMutate/IRMutator.cpp | 56 +- llvm/lib/FuzzMutate/Operations.cpp | 17 +- llvm/lib/FuzzMutate/RandomIRBuilder.cpp | 16 +- llvm/lib/IR/AbstractCallSite.cpp | 1 - llvm/lib/IR/AsmWriter.cpp | 32 +- llvm/lib/IR/Assumptions.cpp | 1 + llvm/lib/IR/AttributeImpl.h | 2 + llvm/lib/IR/Attributes.cpp | 181 +- llvm/lib/IR/AutoUpgrade.cpp | 188 +- llvm/lib/IR/BasicBlock.cpp | 6 - llvm/lib/IR/BuiltinGCs.cpp | 2 +- llvm/lib/IR/ConstantFold.cpp | 36 +- llvm/lib/IR/ConstantFold.h | 57 - llvm/lib/IR/ConstantRange.cpp | 77 +- llvm/lib/IR/Constants.cpp | 132 +- llvm/lib/IR/ConstantsContext.h | 37 - llvm/lib/IR/Core.cpp | 40 +- llvm/lib/IR/DIBuilder.cpp | 22 +- llvm/lib/IR/DebugInfoMetadata.cpp | 188 +- llvm/lib/IR/DiagnosticHandler.cpp | 9 +- llvm/lib/IR/DiagnosticInfo.cpp | 11 + llvm/lib/IR/Dominators.cpp | 1 - llvm/lib/IR/FPEnv.cpp | 45 + llvm/lib/IR/Function.cpp | 123 +- llvm/lib/IR/GVMaterializer.cpp | 2 +- llvm/lib/IR/Globals.cpp | 25 +- llvm/lib/IR/IRBuilder.cpp | 178 +- llvm/lib/IR/Instruction.cpp | 5 +- llvm/lib/IR/Instructions.cpp | 60 +- llvm/lib/IR/IntrinsicInst.cpp | 107 +- llvm/lib/IR/LLVMContext.cpp | 37 +- llvm/lib/IR/LLVMContextImpl.cpp | 20 +- llvm/lib/IR/LLVMContextImpl.h | 34 +- llvm/lib/IR/LegacyPassManager.cpp | 14 +- llvm/lib/IR/MDBuilder.cpp | 8 + llvm/lib/IR/Mangler.cpp | 2 +- llvm/lib/IR/Metadata.cpp | 174 +- llvm/lib/IR/Module.cpp | 33 +- llvm/lib/IR/Pass.cpp | 10 + llvm/lib/IR/ReplaceConstant.cpp | 1 + llvm/lib/IR/SafepointIRVerifier.cpp | 11 + llvm/lib/IR/Use.cpp | 4 - llvm/lib/IR/User.cpp | 12 +- llvm/lib/IR/Value.cpp | 17 +- llvm/lib/IR/VectorBuilder.cpp | 103 + llvm/lib/IR/Verifier.cpp | 3888 ++-- llvm/lib/InterfaceStub/ELFObjHandler.cpp | 139 +- llvm/lib/InterfaceStub/IFSHandler.cpp | 48 +- llvm/lib/InterfaceStub/IFSStub.cpp | 2 +- llvm/lib/LTO/LTO.cpp | 106 +- llvm/lib/LTO/LTOBackend.cpp | 46 +- llvm/lib/LTO/LTOCodeGenerator.cpp | 6 +- llvm/lib/LTO/LTOModule.cpp | 2 +- llvm/lib/LTO/SummaryBasedOptimizations.cpp | 2 +- llvm/lib/LTO/ThinLTOCodeGenerator.cpp | 51 +- llvm/lib/LineEditor/LineEditor.cpp | 4 +- llvm/lib/Linker/IRMover.cpp | 69 +- llvm/lib/Linker/LinkModules.cpp | 13 +- llvm/lib/MC/ConstantPools.cpp | 25 +- llvm/lib/MC/ELFObjectWriter.cpp | 50 +- llvm/lib/MC/MCAsmBackend.cpp | 10 +- llvm/lib/MC/MCAsmInfo.cpp | 5 +- llvm/lib/MC/MCAsmStreamer.cpp | 204 +- llvm/lib/MC/MCAssembler.cpp | 15 +- llvm/lib/MC/MCCodeView.cpp | 7 +- llvm/lib/MC/MCContext.cpp | 90 +- llvm/lib/MC/MCDXContainerStreamer.cpp | 31 + llvm/lib/MC/MCDXContainerWriter.cpp | 143 + llvm/lib/MC/MCDisassembler/Disassembler.cpp | 1 - llvm/lib/MC/MCDisassembler/Disassembler.h | 2 +- llvm/lib/MC/MCDisassembler/MCDisassembler.cpp | 17 +- .../lib/MC/MCDisassembler/MCExternalSymbolizer.cpp | 16 +- llvm/lib/MC/MCDisassembler/MCRelocationInfo.cpp | 2 +- llvm/lib/MC/MCDwarf.cpp | 55 +- llvm/lib/MC/MCELFStreamer.cpp | 25 +- llvm/lib/MC/MCExpr.cpp | 6 +- llvm/lib/MC/MCFragment.cpp | 2 +- llvm/lib/MC/MCInstPrinter.cpp | 1 + llvm/lib/MC/MCInstrAnalysis.cpp | 7 +- llvm/lib/MC/MCInstrDesc.cpp | 1 - llvm/lib/MC/MCMachOStreamer.cpp | 33 +- llvm/lib/MC/MCNullStreamer.cpp | 18 +- llvm/lib/MC/MCObjectFileInfo.cpp | 52 +- llvm/lib/MC/MCObjectStreamer.cpp | 10 +- llvm/lib/MC/MCObjectWriter.cpp | 4 +- llvm/lib/MC/MCParser/AsmLexer.cpp | 8 +- llvm/lib/MC/MCParser/AsmParser.cpp | 83 +- llvm/lib/MC/MCParser/COFFAsmParser.cpp | 45 +- llvm/lib/MC/MCParser/COFFMasmParser.cpp | 27 +- llvm/lib/MC/MCParser/DarwinAsmParser.cpp | 19 +- llvm/lib/MC/MCParser/ELFAsmParser.cpp | 33 +- llvm/lib/MC/MCParser/GOFFAsmParser.cpp | 11 +- llvm/lib/MC/MCParser/MCAsmLexer.cpp | 1 - llvm/lib/MC/MCParser/MCAsmParser.cpp | 2 +- llvm/lib/MC/MCParser/MCAsmParserExtension.cpp | 2 + llvm/lib/MC/MCParser/MasmParser.cpp | 139 +- llvm/lib/MC/MCParser/WasmAsmParser.cpp | 15 +- llvm/lib/MC/MCParser/XCOFFAsmParser.cpp | 9 +- llvm/lib/MC/MCPseudoProbe.cpp | 176 +- llvm/lib/MC/MCRegisterInfo.cpp | 11 + llvm/lib/MC/MCSPIRVStreamer.cpp | 45 + llvm/lib/MC/MCSchedule.cpp | 4 +- llvm/lib/MC/MCSection.cpp | 2 +- llvm/lib/MC/MCSectionCOFF.cpp | 12 +- llvm/lib/MC/MCSectionDXContainer.cpp | 15 + llvm/lib/MC/MCSectionELF.cpp | 15 +- llvm/lib/MC/MCSectionMachO.cpp | 17 +- llvm/lib/MC/MCSectionWasm.cpp | 5 +- llvm/lib/MC/MCSectionXCOFF.cpp | 10 +- llvm/lib/MC/MCStreamer.cpp | 117 +- llvm/lib/MC/MCSymbol.cpp | 1 - llvm/lib/MC/MCSymbolELF.cpp | 1 - llvm/lib/MC/MCTargetOptions.cpp | 9 +- llvm/lib/MC/MCTargetOptionsCommandFlags.cpp | 19 +- llvm/lib/MC/MCWasmStreamer.cpp | 18 +- llvm/lib/MC/MCWin64EH.cpp | 1320 +- llvm/lib/MC/MCWinCOFFStreamer.cpp | 43 +- llvm/lib/MC/MCWinEH.cpp | 9 +- llvm/lib/MC/MCXCOFFStreamer.cpp | 5 + llvm/lib/MC/MachObjectWriter.cpp | 25 +- llvm/lib/MC/SPIRVObjectWriter.cpp | 76 + llvm/lib/MC/SubtargetFeature.cpp | 4 - llvm/lib/MC/TargetRegistry.cpp | 4 +- llvm/lib/MC/WasmObjectWriter.cpp | 135 +- llvm/lib/MC/WinCOFFObjectWriter.cpp | 51 +- llvm/lib/MC/XCOFFObjectWriter.cpp | 480 +- llvm/lib/MCA/CustomBehaviour.cpp | 2 +- llvm/lib/MCA/HardwareUnits/LSUnit.cpp | 32 +- llvm/lib/MCA/IncrementalSourceMgr.cpp | 51 + llvm/lib/MCA/InstrBuilder.cpp | 96 +- llvm/lib/MCA/Instruction.cpp | 12 + llvm/lib/MCA/Pipeline.cpp | 15 +- llvm/lib/MCA/Stages/DispatchStage.cpp | 6 +- llvm/lib/MCA/Stages/EntryStage.cpp | 23 +- llvm/lib/MCA/Stages/ExecuteStage.cpp | 4 +- llvm/lib/MCA/Stages/InOrderIssueStage.cpp | 11 +- llvm/lib/MCA/Stages/Stage.cpp | 1 + llvm/lib/ObjCopy/Archive.cpp | 110 + llvm/lib/ObjCopy/Archive.h | 31 + llvm/lib/ObjCopy/COFF/COFFObjcopy.cpp | 311 + llvm/lib/ObjCopy/COFF/COFFObject.cpp | 132 + llvm/lib/ObjCopy/COFF/COFFObject.h | 212 + llvm/lib/ObjCopy/COFF/COFFReader.cpp | 226 + llvm/lib/ObjCopy/COFF/COFFReader.h | 41 + llvm/lib/ObjCopy/COFF/COFFWriter.cpp | 466 + llvm/lib/ObjCopy/COFF/COFFWriter.h | 63 + llvm/lib/ObjCopy/CommonConfig.cpp | 50 + llvm/lib/ObjCopy/ConfigManager.cpp | 97 + llvm/lib/ObjCopy/ELF/ELFObjcopy.cpp | 821 + llvm/lib/ObjCopy/ELF/ELFObject.cpp | 2795 +++ llvm/lib/ObjCopy/ELF/ELFObject.h | 1108 + llvm/lib/ObjCopy/MachO/MachOLayoutBuilder.cpp | 441 + llvm/lib/ObjCopy/MachO/MachOLayoutBuilder.h | 97 + llvm/lib/ObjCopy/MachO/MachOObjcopy.cpp | 550 + llvm/lib/ObjCopy/MachO/MachOObject.cpp | 214 + llvm/lib/ObjCopy/MachO/MachOObject.h | 374 + llvm/lib/ObjCopy/MachO/MachOReader.cpp | 374 + llvm/lib/ObjCopy/MachO/MachOReader.h | 62 + llvm/lib/ObjCopy/MachO/MachOWriter.cpp | 662 + llvm/lib/ObjCopy/MachO/MachOWriter.h | 76 + llvm/lib/ObjCopy/ObjCopy.cpp | 90 + llvm/lib/ObjCopy/XCOFF/XCOFFObjcopy.cpp | 45 + llvm/lib/ObjCopy/XCOFF/XCOFFObject.h | 48 + llvm/lib/ObjCopy/XCOFF/XCOFFReader.cpp | 101 + llvm/lib/ObjCopy/XCOFF/XCOFFReader.h | 35 + llvm/lib/ObjCopy/XCOFF/XCOFFWriter.cpp | 125 + llvm/lib/ObjCopy/XCOFF/XCOFFWriter.h | 48 + llvm/lib/ObjCopy/wasm/WasmObjcopy.cpp | 160 + llvm/lib/ObjCopy/wasm/WasmObject.cpp | 34 + llvm/lib/ObjCopy/wasm/WasmObject.h | 47 + llvm/lib/ObjCopy/wasm/WasmReader.cpp | 39 + llvm/lib/ObjCopy/wasm/WasmReader.h | 31 + llvm/lib/ObjCopy/wasm/WasmWriter.cpp | 79 + llvm/lib/ObjCopy/wasm/WasmWriter.h | 49 + llvm/lib/Object/Archive.cpp | 18 +- llvm/lib/Object/ArchiveWriter.cpp | 234 +- llvm/lib/Object/Binary.cpp | 7 +- llvm/lib/Object/COFFImportFile.cpp | 4 + llvm/lib/Object/COFFModuleDefinition.cpp | 2 - llvm/lib/Object/COFFObjectFile.cpp | 161 +- llvm/lib/Object/DXContainer.cpp | 111 + llvm/lib/Object/Decompressor.cpp | 2 +- llvm/lib/Object/ELF.cpp | 29 +- llvm/lib/Object/ELFObjectFile.cpp | 87 +- llvm/lib/Object/Error.cpp | 2 + llvm/lib/Object/IRObjectFile.cpp | 16 +- llvm/lib/Object/IRSymtab.cpp | 1 - llvm/lib/Object/MachOObjectFile.cpp | 229 +- llvm/lib/Object/MachOUniversal.cpp | 6 +- llvm/lib/Object/MachOUniversalWriter.cpp | 12 +- llvm/lib/Object/ModuleSymbolTable.cpp | 3 - llvm/lib/Object/Object.cpp | 2 + llvm/lib/Object/ObjectFile.cpp | 15 +- llvm/lib/Object/OffloadBinary.cpp | 164 + llvm/lib/Object/RecordStreamer.h | 8 +- llvm/lib/Object/RelocationResolver.cpp | 45 + llvm/lib/Object/SymbolicFile.cpp | 9 +- llvm/lib/Object/TapiFile.cpp | 6 +- llvm/lib/Object/TapiUniversal.cpp | 5 +- llvm/lib/Object/WasmObjectFile.cpp | 123 +- llvm/lib/Object/WindowsResource.cpp | 2 - llvm/lib/Object/XCOFFObjectFile.cpp | 27 +- llvm/lib/ObjectYAML/COFFEmitter.cpp | 7 +- llvm/lib/ObjectYAML/COFFYAML.cpp | 3 + llvm/lib/ObjectYAML/CodeViewYAMLSymbols.cpp | 1 + llvm/lib/ObjectYAML/CodeViewYAMLTypes.cpp | 5 +- llvm/lib/ObjectYAML/DWARFEmitter.cpp | 6 +- llvm/lib/ObjectYAML/DWARFYAML.cpp | 2 +- llvm/lib/ObjectYAML/DXContainerEmitter.cpp | 190 + llvm/lib/ObjectYAML/DXContainerYAML.cpp | 61 + llvm/lib/ObjectYAML/ELFEmitter.cpp | 43 +- llvm/lib/ObjectYAML/ELFYAML.cpp | 48 +- llvm/lib/ObjectYAML/MachOEmitter.cpp | 22 +- llvm/lib/ObjectYAML/MachOYAML.cpp | 9 +- llvm/lib/ObjectYAML/MinidumpEmitter.cpp | 2 +- llvm/lib/ObjectYAML/ObjectYAML.cpp | 7 + llvm/lib/ObjectYAML/OffloadEmitter.cpp | 68 + llvm/lib/ObjectYAML/OffloadYAML.cpp | 78 + llvm/lib/ObjectYAML/WasmEmitter.cpp | 62 +- llvm/lib/ObjectYAML/WasmYAML.cpp | 69 +- llvm/lib/ObjectYAML/XCOFFEmitter.cpp | 162 +- llvm/lib/ObjectYAML/yaml2obj.cpp | 4 + llvm/lib/Option/ArgList.cpp | 7 + llvm/lib/Passes/PassBuilder.cpp | 41 +- llvm/lib/Passes/PassBuilderPipelines.cpp | 229 +- llvm/lib/Passes/PassRegistry.def | 54 +- llvm/lib/Passes/StandardInstrumentations.cpp | 84 +- llvm/lib/ProfileData/Coverage/CoverageMapping.cpp | 12 +- .../ProfileData/Coverage/CoverageMappingReader.cpp | 4 +- .../ProfileData/Coverage/CoverageMappingWriter.cpp | 8 +- llvm/lib/ProfileData/GCOV.cpp | 8 +- llvm/lib/ProfileData/InstrProf.cpp | 81 +- llvm/lib/ProfileData/InstrProfCorrelator.cpp | 11 +- llvm/lib/ProfileData/InstrProfReader.cpp | 146 +- llvm/lib/ProfileData/InstrProfWriter.cpp | 143 +- llvm/lib/ProfileData/MemProf.cpp | 110 + llvm/lib/ProfileData/ProfileSummaryBuilder.cpp | 32 +- llvm/lib/ProfileData/RawMemProfReader.cpp | 543 +- llvm/lib/ProfileData/SampleProf.cpp | 32 +- llvm/lib/ProfileData/SampleProfReader.cpp | 31 +- llvm/lib/ProfileData/SampleProfWriter.cpp | 30 +- llvm/lib/Remarks/BitstreamRemarkSerializer.cpp | 1 + llvm/lib/Remarks/RemarkLinker.cpp | 7 +- llvm/lib/Remarks/RemarkParser.cpp | 2 +- llvm/lib/Remarks/YAMLRemarkSerializer.cpp | 10 +- llvm/lib/Support/AArch64TargetParser.cpp | 64 +- llvm/lib/Support/APFixedPoint.cpp | 20 +- llvm/lib/Support/APFloat.cpp | 9 +- llvm/lib/Support/APInt.cpp | 126 +- llvm/lib/Support/ARMAttributeParser.cpp | 2 +- llvm/lib/Support/ARMWinEH.cpp | 21 +- llvm/lib/Support/AddressRanges.cpp | 59 + llvm/lib/Support/BLAKE3/LICENSE | 330 + llvm/lib/Support/BLAKE3/README.md | 296 + llvm/lib/Support/BLAKE3/blake3.c | 627 + llvm/lib/Support/BLAKE3/blake3_avx2.c | 326 + llvm/lib/Support/BLAKE3/blake3_avx2_x86-64_unix.S | 1826 ++ .../BLAKE3/blake3_avx2_x86-64_windows_gnu.S | 1817 ++ .../BLAKE3/blake3_avx2_x86-64_windows_msvc.asm | 1828 ++ llvm/lib/Support/BLAKE3/blake3_avx512.c | 1207 ++ .../lib/Support/BLAKE3/blake3_avx512_x86-64_unix.S | 2601 +++ .../BLAKE3/blake3_avx512_x86-64_windows_gnu.S | 2615 +++ .../BLAKE3/blake3_avx512_x86-64_windows_msvc.asm | 2634 +++ llvm/lib/Support/BLAKE3/blake3_dispatch.c | 277 + llvm/lib/Support/BLAKE3/blake3_impl.h | 312 + llvm/lib/Support/BLAKE3/blake3_neon.c | 356 + llvm/lib/Support/BLAKE3/blake3_portable.c | 160 + llvm/lib/Support/BLAKE3/blake3_sse2.c | 566 + llvm/lib/Support/BLAKE3/blake3_sse2_x86-64_unix.S | 2307 ++ .../BLAKE3/blake3_sse2_x86-64_windows_gnu.S | 2332 +++ .../BLAKE3/blake3_sse2_x86-64_windows_msvc.asm | 2350 +++ llvm/lib/Support/BLAKE3/blake3_sse41.c | 560 + llvm/lib/Support/BLAKE3/blake3_sse41_x86-64_unix.S | 2044 ++ .../BLAKE3/blake3_sse41_x86-64_windows_gnu.S | 2069 ++ .../BLAKE3/blake3_sse41_x86-64_windows_msvc.asm | 2089 ++ llvm/lib/Support/BinaryStreamWriter.cpp | 10 +- llvm/lib/Support/CSKYAttributeParser.cpp | 155 + llvm/lib/Support/CSKYAttributes.cpp | 33 + llvm/lib/Support/CSKYTargetParser.cpp | 181 + llvm/lib/Support/CodeGenCoverage.cpp | 2 +- llvm/lib/Support/CommandLine.cpp | 94 +- llvm/lib/Support/Compression.cpp | 12 +- llvm/lib/Support/ConvertUTFWrapper.cpp | 102 +- llvm/lib/Support/CrashRecoveryContext.cpp | 20 +- llvm/lib/Support/Debug.cpp | 2 +- llvm/lib/Support/DebugCounter.cpp | 3 +- llvm/lib/Support/DeltaAlgorithm.cpp | 3 +- llvm/lib/Support/DynamicLibrary.cpp | 7 +- llvm/lib/Support/Errno.cpp | 3 +- llvm/lib/Support/ErrorHandling.cpp | 5 +- llvm/lib/Support/FileUtilities.cpp | 66 + llvm/lib/Support/FoldingSet.cpp | 48 - llvm/lib/Support/FormatVariadic.cpp | 2 +- llvm/lib/Support/Host.cpp | 115 +- llvm/lib/Support/ItaniumManglingCanonicalizer.cpp | 14 - llvm/lib/Support/JSON.cpp | 20 +- llvm/lib/Support/KnownBits.cpp | 12 +- llvm/lib/Support/LineIterator.cpp | 2 +- llvm/lib/Support/MD5.cpp | 14 +- llvm/lib/Support/MathExtras.cpp | 2 +- llvm/lib/Support/Memory.cpp | 1 - llvm/lib/Support/MemoryBuffer.cpp | 13 +- llvm/lib/Support/NativeFormatting.cpp | 10 +- llvm/lib/Support/Parallel.cpp | 10 +- llvm/lib/Support/Path.cpp | 16 +- llvm/lib/Support/Process.cpp | 2 +- llvm/lib/Support/Program.cpp | 1 - llvm/lib/Support/RISCVISAInfo.cpp | 106 +- llvm/lib/Support/SHA1.cpp | 21 +- llvm/lib/Support/SHA256.cpp | 21 +- llvm/lib/Support/ScopedPrinter.cpp | 9 +- llvm/lib/Support/Signals.cpp | 18 +- llvm/lib/Support/Signposts.cpp | 5 +- llvm/lib/Support/SourceMgr.cpp | 16 +- llvm/lib/Support/SpecialCaseList.cpp | 2 +- llvm/lib/Support/Statistic.cpp | 6 +- llvm/lib/Support/StringMap.cpp | 76 +- llvm/lib/Support/StringRef.cpp | 7 + llvm/lib/Support/TargetParser.cpp | 27 +- llvm/lib/Support/ThreadPool.cpp | 171 +- llvm/lib/Support/TrigramIndex.cpp | 1 + llvm/lib/Support/Triple.cpp | 194 +- llvm/lib/Support/TypeSize.cpp | 5 +- llvm/lib/Support/Unicode.cpp | 452 +- llvm/lib/Support/UnicodeNameToCodepoint.cpp | 551 + .../Support/UnicodeNameToCodepointGenerated.cpp | 20911 +++++++++++++++++++ llvm/lib/Support/Unix/COM.inc | 2 +- llvm/lib/Support/Unix/Memory.inc | 1 + llvm/lib/Support/Unix/Path.inc | 24 +- llvm/lib/Support/Unix/Process.inc | 39 +- llvm/lib/Support/Unix/Signals.inc | 12 +- llvm/lib/Support/Unix/ThreadLocal.inc | 12 - llvm/lib/Support/Unix/Threading.inc | 37 +- llvm/lib/Support/VirtualFileSystem.cpp | 592 +- llvm/lib/Support/Windows/Path.inc | 2 +- llvm/lib/Support/Windows/Process.inc | 10 +- llvm/lib/Support/Windows/Program.inc | 3 +- llvm/lib/Support/Windows/Signals.inc | 54 +- llvm/lib/Support/Windows/Threading.inc | 8 +- llvm/lib/Support/WithColor.cpp | 20 +- llvm/lib/Support/YAMLParser.cpp | 71 +- llvm/lib/Support/Z3Solver.cpp | 8 +- llvm/lib/Support/raw_ostream.cpp | 4 +- llvm/lib/Support/regcomp.c | 26 +- llvm/lib/Support/regengine.inc | 39 +- llvm/lib/Support/xxhash.cpp | 1 - llvm/lib/TableGen/Error.cpp | 4 +- llvm/lib/TableGen/Parser.cpp | 39 + llvm/lib/TableGen/Record.cpp | 493 +- llvm/lib/TableGen/TGLexer.cpp | 7 +- llvm/lib/TableGen/TGLexer.h | 5 +- llvm/lib/TableGen/TGParser.cpp | 247 +- llvm/lib/TableGen/TGParser.h | 2 +- llvm/lib/Target/AArch64/AArch64.h | 3 + llvm/lib/Target/AArch64/AArch64.td | 113 +- llvm/lib/Target/AArch64/AArch64A53Fix835769.cpp | 1 + llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp | 49 +- .../lib/Target/AArch64/AArch64CallingConvention.td | 6 +- llvm/lib/Target/AArch64/AArch64CollectLOH.cpp | 6 +- llvm/lib/Target/AArch64/AArch64Combine.td | 4 +- .../Target/AArch64/AArch64ConditionalCompares.cpp | 4 +- .../Target/AArch64/AArch64ExpandPseudoInsts.cpp | 34 + llvm/lib/Target/AArch64/AArch64FalkorHWPFFix.cpp | 2 +- llvm/lib/Target/AArch64/AArch64FastISel.cpp | 11 +- llvm/lib/Target/AArch64/AArch64FrameLowering.cpp | 1098 +- llvm/lib/Target/AArch64/AArch64FrameLowering.h | 19 +- llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp | 294 +- llvm/lib/Target/AArch64/AArch64ISelLowering.cpp | 4083 ++-- llvm/lib/Target/AArch64/AArch64ISelLowering.h | 83 +- llvm/lib/Target/AArch64/AArch64InstrAtomics.td | 37 +- llvm/lib/Target/AArch64/AArch64InstrFormats.td | 257 +- llvm/lib/Target/AArch64/AArch64InstrInfo.cpp | 608 +- llvm/lib/Target/AArch64/AArch64InstrInfo.h | 56 +- llvm/lib/Target/AArch64/AArch64InstrInfo.td | 876 +- .../Target/AArch64/AArch64LoadStoreOptimizer.cpp | 201 +- llvm/lib/Target/AArch64/AArch64MIPeepholeOpt.cpp | 236 +- .../Target/AArch64/AArch64MachineFunctionInfo.cpp | 49 +- .../Target/AArch64/AArch64MachineFunctionInfo.h | 30 +- .../lib/Target/AArch64/AArch64MachineScheduler.cpp | 82 + llvm/lib/Target/AArch64/AArch64MachineScheduler.h | 33 + llvm/lib/Target/AArch64/AArch64MacroFusion.cpp | 15 +- llvm/lib/Target/AArch64/AArch64PerfectShuffle.h | 13169 ++++++------ llvm/lib/Target/AArch64/AArch64RegisterInfo.cpp | 114 +- llvm/lib/Target/AArch64/AArch64RegisterInfo.h | 5 +- llvm/lib/Target/AArch64/AArch64RegisterInfo.td | 51 +- llvm/lib/Target/AArch64/AArch64SLSHardening.cpp | 4 +- llvm/lib/Target/AArch64/AArch64SMEInstrInfo.td | 73 +- llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td | 583 +- llvm/lib/Target/AArch64/AArch64SchedA55.td | 127 +- llvm/lib/Target/AArch64/AArch64SchedA64FX.td | 12 +- llvm/lib/Target/AArch64/AArch64SchedAmpere1.td | 1136 + llvm/lib/Target/AArch64/AArch64SchedPredAmpere.td | 25 + llvm/lib/Target/AArch64/AArch64SchedPredExynos.td | 5 +- llvm/lib/Target/AArch64/AArch64SchedPredicates.td | 149 +- llvm/lib/Target/AArch64/AArch64SchedTSV110.td | 3 +- .../lib/Target/AArch64/AArch64SelectionDAGInfo.cpp | 34 +- llvm/lib/Target/AArch64/AArch64SelectionDAGInfo.h | 2 +- llvm/lib/Target/AArch64/AArch64StackTagging.cpp | 203 +- .../Target/AArch64/AArch64StackTaggingPreRA.cpp | 1 - llvm/lib/Target/AArch64/AArch64Subtarget.cpp | 37 +- llvm/lib/Target/AArch64/AArch64Subtarget.h | 365 +- llvm/lib/Target/AArch64/AArch64SystemOperands.td | 12 +- llvm/lib/Target/AArch64/AArch64TargetMachine.cpp | 36 +- llvm/lib/Target/AArch64/AArch64TargetMachine.h | 2 +- .../Target/AArch64/AArch64TargetTransformInfo.cpp | 383 +- .../Target/AArch64/AArch64TargetTransformInfo.h | 24 +- .../Target/AArch64/AsmParser/AArch64AsmParser.cpp | 134 +- .../AArch64/Disassembler/AArch64Disassembler.cpp | 580 +- .../AArch64/Disassembler/AArch64Disassembler.h | 8 +- .../Disassembler/AArch64ExternalSymbolizer.cpp | 6 +- .../Disassembler/AArch64ExternalSymbolizer.h | 3 +- .../Target/AArch64/GISel/AArch64CallLowering.cpp | 38 +- .../AArch64/GISel/AArch64InstructionSelector.cpp | 590 +- .../Target/AArch64/GISel/AArch64LegalizerInfo.cpp | 12 +- .../AArch64/GISel/AArch64PostLegalizerCombiner.cpp | 6 +- .../AArch64/GISel/AArch64PostLegalizerLowering.cpp | 2 +- .../AArch64/GISel/AArch64PostSelectOptimize.cpp | 2 +- .../AArch64/GISel/AArch64PreLegalizerCombiner.cpp | 8 +- .../AArch64/GISel/AArch64RegisterBankInfo.cpp | 9 +- .../Target/AArch64/GISel/AArch64RegisterBankInfo.h | 2 +- .../AArch64/MCTargetDesc/AArch64AsmBackend.cpp | 26 +- .../AArch64/MCTargetDesc/AArch64ELFStreamer.cpp | 1 + .../AArch64/MCTargetDesc/AArch64InstPrinter.cpp | 7 +- .../AArch64/MCTargetDesc/AArch64MCCodeEmitter.cpp | 2 +- .../Target/AArch64/MCTargetDesc/AArch64MCExpr.cpp | 1 + .../AArch64/MCTargetDesc/AArch64MCTargetDesc.cpp | 38 +- .../AArch64/MCTargetDesc/AArch64MCTargetDesc.h | 11 +- .../AArch64/MCTargetDesc/AArch64TargetStreamer.cpp | 4 +- .../MCTargetDesc/AArch64WinCOFFObjectWriter.cpp | 1 + .../MCTargetDesc/AArch64WinCOFFStreamer.cpp | 31 +- llvm/lib/Target/AArch64/SMEInstrFormats.td | 538 +- llvm/lib/Target/AArch64/SVEInstrFormats.td | 378 +- llvm/lib/Target/AArch64/SVEIntrinsicOpts.cpp | 10 +- llvm/lib/Target/AArch64/Utils/AArch64BaseInfo.h | 3 +- llvm/lib/Target/AMDGPU/AMDGPU.h | 13 +- llvm/lib/Target/AMDGPU/AMDGPU.td | 280 +- .../Target/AMDGPU/AMDGPUAnnotateUniformValues.cpp | 144 +- llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp | 95 +- llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.h | 3 + llvm/lib/Target/AMDGPU/AMDGPUAtomicOptimizer.cpp | 6 + llvm/lib/Target/AMDGPU/AMDGPUAttributes.def | 31 + llvm/lib/Target/AMDGPU/AMDGPUAttributor.cpp | 266 +- llvm/lib/Target/AMDGPU/AMDGPUCallLowering.cpp | 50 +- llvm/lib/Target/AMDGPU/AMDGPUCallingConv.td | 66 +- llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp | 2 +- llvm/lib/Target/AMDGPU/AMDGPUCombinerHelper.cpp | 3 +- llvm/lib/Target/AMDGPU/AMDGPUCtorDtorLowering.cpp | 2 +- llvm/lib/Target/AMDGPU/AMDGPUExportClustering.cpp | 2 +- .../Target/AMDGPU/AMDGPUFixFunctionBitcasts.cpp | 64 - llvm/lib/Target/AMDGPU/AMDGPUGISel.td | 29 +- llvm/lib/Target/AMDGPU/AMDGPUGlobalISelUtils.cpp | 11 + llvm/lib/Target/AMDGPU/AMDGPUGlobalISelUtils.h | 4 +- .../Target/AMDGPU/AMDGPUHSAMetadataStreamer.cpp | 91 +- llvm/lib/Target/AMDGPU/AMDGPUHSAMetadataStreamer.h | 2 +- llvm/lib/Target/AMDGPU/AMDGPUIGroupLP.cpp | 439 + llvm/lib/Target/AMDGPU/AMDGPUIGroupLP.h | 22 + llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp | 253 +- llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.h | 17 +- llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp | 401 +- llvm/lib/Target/AMDGPU/AMDGPUISelLowering.h | 11 +- llvm/lib/Target/AMDGPU/AMDGPUInsertDelayAlu.cpp | 457 + .../Target/AMDGPU/AMDGPUInstCombineIntrinsic.cpp | 78 +- llvm/lib/Target/AMDGPU/AMDGPUInstrInfo.td | 6 +- .../Target/AMDGPU/AMDGPUInstructionSelector.cpp | 770 +- llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.h | 31 +- llvm/lib/Target/AMDGPU/AMDGPUInstructions.td | 158 +- llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp | 824 +- llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.h | 17 + llvm/lib/Target/AMDGPU/AMDGPULibCalls.cpp | 11 +- llvm/lib/Target/AMDGPU/AMDGPULibFunc.h | 4 +- llvm/lib/Target/AMDGPU/AMDGPULowerIntrinsics.cpp | 4 - .../Target/AMDGPU/AMDGPULowerKernelArguments.cpp | 7 +- .../Target/AMDGPU/AMDGPULowerKernelAttributes.cpp | 38 +- .../lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp | 27 +- llvm/lib/Target/AMDGPU/AMDGPUMCInstLower.cpp | 15 +- llvm/lib/Target/AMDGPU/AMDGPUMCInstLower.h | 2 +- llvm/lib/Target/AMDGPU/AMDGPUMIRFormatter.cpp | 9 +- llvm/lib/Target/AMDGPU/AMDGPUMIRFormatter.h | 2 +- .../Target/AMDGPU/AMDGPUMachineCFGStructurizer.cpp | 2 +- llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.cpp | 50 +- llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.h | 20 +- llvm/lib/Target/AMDGPU/AMDGPUMachineModuleInfo.cpp | 1 + .../AMDGPU/AMDGPUOpenCLEnqueuedBlockLowering.cpp | 3 +- llvm/lib/Target/AMDGPU/AMDGPUPerfHintAnalysis.cpp | 18 +- .../Target/AMDGPU/AMDGPUPreLegalizerCombiner.cpp | 2 +- .../Target/AMDGPU/AMDGPUPrintfRuntimeBinding.cpp | 12 +- llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp | 215 +- .../Target/AMDGPU/AMDGPUPromoteKernelArguments.cpp | 64 +- llvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp | 663 +- llvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.h | 7 +- llvm/lib/Target/AMDGPU/AMDGPUReleaseVGPRs.cpp | 140 + .../AMDGPU/AMDGPUReplaceLDSUseWithPointer.cpp | 4 +- .../Target/AMDGPU/AMDGPUResourceUsageAnalysis.cpp | 26 +- .../Target/AMDGPU/AMDGPUResourceUsageAnalysis.h | 12 +- .../Target/AMDGPU/AMDGPURewriteOutArguments.cpp | 152 +- llvm/lib/Target/AMDGPU/AMDGPUSearchableTables.td | 168 +- llvm/lib/Target/AMDGPU/AMDGPUSetWavePriority.cpp | 166 + llvm/lib/Target/AMDGPU/AMDGPUSubtarget.cpp | 158 +- llvm/lib/Target/AMDGPU/AMDGPUSubtarget.h | 42 +- llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp | 88 +- llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.h | 6 +- .../Target/AMDGPU/AMDGPUTargetTransformInfo.cpp | 54 +- llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.h | 23 +- llvm/lib/Target/AMDGPU/AMDILCFGStructurizer.cpp | 1638 -- llvm/lib/Target/AMDGPU/AMDKernelCodeT.h | 2 +- .../Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp | 1146 +- llvm/lib/Target/AMDGPU/BUFInstructions.td | 891 +- llvm/lib/Target/AMDGPU/DSInstructions.td | 546 +- .../AMDGPU/Disassembler/AMDGPUDisassembler.cpp | 470 +- .../AMDGPU/Disassembler/AMDGPUDisassembler.h | 87 +- llvm/lib/Target/AMDGPU/EXPInstructions.td | 79 +- llvm/lib/Target/AMDGPU/FLATInstructions.td | 1038 +- llvm/lib/Target/AMDGPU/GCNDPPCombine.cpp | 18 +- llvm/lib/Target/AMDGPU/GCNHazardRecognizer.cpp | 901 +- llvm/lib/Target/AMDGPU/GCNHazardRecognizer.h | 25 + llvm/lib/Target/AMDGPU/GCNNSAReassign.cpp | 29 +- llvm/lib/Target/AMDGPU/GCNProcessors.td | 28 + llvm/lib/Target/AMDGPU/GCNRegPressure.h | 2 +- llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp | 356 +- llvm/lib/Target/AMDGPU/GCNSchedStrategy.h | 36 +- llvm/lib/Target/AMDGPU/GCNSubtarget.h | 349 +- llvm/lib/Target/AMDGPU/LDSDIRInstructions.td | 116 + .../Target/AMDGPU/MCA/AMDGPUCustomBehaviour.cpp | 6 +- llvm/lib/Target/AMDGPU/MCA/AMDGPUCustomBehaviour.h | 4 +- .../AMDGPU/MCTargetDesc/AMDGPUAsmBackend.cpp | 29 +- .../AMDGPU/MCTargetDesc/AMDGPUELFObjectWriter.cpp | 5 +- .../AMDGPU/MCTargetDesc/AMDGPUInstPrinter.cpp | 257 +- .../Target/AMDGPU/MCTargetDesc/AMDGPUInstPrinter.h | 17 +- .../AMDGPU/MCTargetDesc/AMDGPUMCCodeEmitter.h | 56 +- .../AMDGPU/MCTargetDesc/AMDGPUMCTargetDesc.cpp | 2 + .../AMDGPU/MCTargetDesc/AMDGPUMCTargetDesc.h | 2 - .../AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.cpp | 38 +- .../AMDGPU/MCTargetDesc/R600MCCodeEmitter.cpp | 4 +- .../Target/AMDGPU/MCTargetDesc/R600MCTargetDesc.h | 1 - .../Target/AMDGPU/MCTargetDesc/SIMCCodeEmitter.cpp | 165 +- llvm/lib/Target/AMDGPU/MIMGInstructions.td | 618 +- llvm/lib/Target/AMDGPU/R600.h | 2 +- llvm/lib/Target/AMDGPU/R600AsmPrinter.cpp | 4 +- llvm/lib/Target/AMDGPU/R600ClauseMergePass.cpp | 3 +- .../lib/Target/AMDGPU/R600ControlFlowFinalizer.cpp | 1 + llvm/lib/Target/AMDGPU/R600EmitClauseMarkers.cpp | 5 +- llvm/lib/Target/AMDGPU/R600ExpandSpecialInstrs.cpp | 2 + llvm/lib/Target/AMDGPU/R600FrameLowering.cpp | 1 + llvm/lib/Target/AMDGPU/R600ISelLowering.cpp | 183 +- llvm/lib/Target/AMDGPU/R600InstrInfo.cpp | 19 +- llvm/lib/Target/AMDGPU/R600InstrInfo.h | 3 - .../Target/AMDGPU/R600MachineCFGStructurizer.cpp | 1640 ++ llvm/lib/Target/AMDGPU/R600Packetizer.cpp | 2 +- llvm/lib/Target/AMDGPU/R600Subtarget.cpp | 2 - llvm/lib/Target/AMDGPU/R600Subtarget.h | 16 +- llvm/lib/Target/AMDGPU/R600TargetMachine.cpp | 4 +- llvm/lib/Target/AMDGPU/R600TargetMachine.h | 4 +- llvm/lib/Target/AMDGPU/SIAnnotateControlFlow.cpp | 58 +- llvm/lib/Target/AMDGPU/SIDefines.h | 196 +- llvm/lib/Target/AMDGPU/SIFoldOperands.cpp | 189 +- llvm/lib/Target/AMDGPU/SIFormMemoryClauses.cpp | 2 +- llvm/lib/Target/AMDGPU/SIFrameLowering.cpp | 230 +- llvm/lib/Target/AMDGPU/SIFrameLowering.h | 3 + llvm/lib/Target/AMDGPU/SIISelLowering.cpp | 1927 +- llvm/lib/Target/AMDGPU/SIISelLowering.h | 24 +- llvm/lib/Target/AMDGPU/SIInsertHardClauses.cpp | 77 +- llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp | 354 +- llvm/lib/Target/AMDGPU/SIInstrFormats.td | 83 +- llvm/lib/Target/AMDGPU/SIInstrInfo.cpp | 667 +- llvm/lib/Target/AMDGPU/SIInstrInfo.h | 68 +- llvm/lib/Target/AMDGPU/SIInstrInfo.td | 625 +- llvm/lib/Target/AMDGPU/SIInstructions.td | 244 +- llvm/lib/Target/AMDGPU/SILateBranchLowering.cpp | 12 +- llvm/lib/Target/AMDGPU/SILoadStoreOptimizer.cpp | 842 +- llvm/lib/Target/AMDGPU/SILowerControlFlow.cpp | 42 +- llvm/lib/Target/AMDGPU/SILowerI1Copies.cpp | 33 +- llvm/lib/Target/AMDGPU/SILowerSGPRSpills.cpp | 16 +- llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp | 126 +- llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h | 179 +- llvm/lib/Target/AMDGPU/SIMachineScheduler.cpp | 58 +- llvm/lib/Target/AMDGPU/SIMemoryLegalizer.cpp | 484 +- llvm/lib/Target/AMDGPU/SIModeRegister.cpp | 17 +- llvm/lib/Target/AMDGPU/SIOptimizeExecMasking.cpp | 251 +- .../Target/AMDGPU/SIOptimizeExecMaskingPreRA.cpp | 110 +- llvm/lib/Target/AMDGPU/SIOptimizeVGPRLiveRange.cpp | 125 +- llvm/lib/Target/AMDGPU/SIPeepholeSDWA.cpp | 12 +- llvm/lib/Target/AMDGPU/SIPreAllocateWWMRegs.cpp | 21 +- llvm/lib/Target/AMDGPU/SIPreEmitPeephole.cpp | 28 +- llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp | 603 +- llvm/lib/Target/AMDGPU/SIRegisterInfo.h | 28 +- llvm/lib/Target/AMDGPU/SIRegisterInfo.td | 127 +- llvm/lib/Target/AMDGPU/SISchedule.td | 65 + llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp | 435 +- llvm/lib/Target/AMDGPU/SIWholeQuadMode.cpp | 42 +- llvm/lib/Target/AMDGPU/SMInstructions.td | 410 +- llvm/lib/Target/AMDGPU/SOPInstructions.td | 425 +- llvm/lib/Target/AMDGPU/Utils/AMDGPUAsmUtils.cpp | 314 +- llvm/lib/Target/AMDGPU/Utils/AMDGPUAsmUtils.h | 56 +- llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp | 686 +- llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h | 133 +- llvm/lib/Target/AMDGPU/Utils/AMDGPULDSUtils.cpp | 144 - llvm/lib/Target/AMDGPU/Utils/AMDGPULDSUtils.h | 38 - llvm/lib/Target/AMDGPU/Utils/AMDGPUMemoryUtils.cpp | 220 + llvm/lib/Target/AMDGPU/Utils/AMDGPUMemoryUtils.h | 51 + llvm/lib/Target/AMDGPU/Utils/AMDGPUPALMetadata.cpp | 5 + llvm/lib/Target/AMDGPU/Utils/AMDGPUPALMetadata.h | 4 + llvm/lib/Target/AMDGPU/VIInstrFormats.td | 2 +- llvm/lib/Target/AMDGPU/VINTERPInstructions.td | 180 + llvm/lib/Target/AMDGPU/VOP1Instructions.td | 380 +- llvm/lib/Target/AMDGPU/VOP2Instructions.td | 626 +- llvm/lib/Target/AMDGPU/VOP3Instructions.td | 453 +- llvm/lib/Target/AMDGPU/VOP3PInstructions.td | 671 +- llvm/lib/Target/AMDGPU/VOPCInstructions.td | 873 +- llvm/lib/Target/AMDGPU/VOPDInstructions.td | 159 + llvm/lib/Target/AMDGPU/VOPInstructions.td | 658 +- llvm/lib/Target/ARC/ARCMachineFunctionInfo.cpp | 7 + llvm/lib/Target/ARC/ARCMachineFunctionInfo.h | 6 +- llvm/lib/Target/ARC/ARCOptAddrMode.cpp | 8 +- llvm/lib/Target/ARC/ARCTargetMachine.cpp | 4 +- llvm/lib/Target/ARC/ARCTargetMachine.h | 2 +- .../Target/ARC/Disassembler/ARCDisassembler.cpp | 78 +- llvm/lib/Target/ARM/A15SDOptimizer.cpp | 3 +- llvm/lib/Target/ARM/ARM.h | 2 + llvm/lib/Target/ARM/ARM.td | 163 +- llvm/lib/Target/ARM/ARMAsmPrinter.cpp | 143 +- llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp | 227 +- llvm/lib/Target/ARM/ARMBaseInstrInfo.h | 29 +- llvm/lib/Target/ARM/ARMBaseRegisterInfo.cpp | 26 +- llvm/lib/Target/ARM/ARMBaseRegisterInfo.h | 39 +- llvm/lib/Target/ARM/ARMBlockPlacement.cpp | 3 +- llvm/lib/Target/ARM/ARMCallingConv.td | 21 +- llvm/lib/Target/ARM/ARMConstantIslandPass.cpp | 2 +- llvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp | 17 +- llvm/lib/Target/ARM/ARMFastISel.cpp | 45 +- .../Target/ARM/ARMFixCortexA57AES1742098Pass.cpp | 432 + llvm/lib/Target/ARM/ARMFrameLowering.cpp | 846 +- llvm/lib/Target/ARM/ARMFrameLowering.h | 1 + llvm/lib/Target/ARM/ARMHazardRecognizer.cpp | 2 + llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp | 35 +- llvm/lib/Target/ARM/ARMISelLowering.cpp | 413 +- llvm/lib/Target/ARM/ARMISelLowering.h | 12 +- llvm/lib/Target/ARM/ARMInstrFormats.td | 26 +- llvm/lib/Target/ARM/ARMInstrInfo.td | 27 +- llvm/lib/Target/ARM/ARMInstrMVE.td | 89 +- llvm/lib/Target/ARM/ARMInstrNEON.td | 3 + llvm/lib/Target/ARM/ARMInstrThumb2.td | 7 +- llvm/lib/Target/ARM/ARMInstrVFP.td | 96 +- llvm/lib/Target/ARM/ARMInstructionSelector.cpp | 16 +- llvm/lib/Target/ARM/ARMLegalizerInfo.cpp | 1 + llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp | 12 +- llvm/lib/Target/ARM/ARMLowOverheadLoops.cpp | 4 +- llvm/lib/Target/ARM/ARMMachineFunctionInfo.cpp | 7 + llvm/lib/Target/ARM/ARMMachineFunctionInfo.h | 8 + llvm/lib/Target/ARM/ARMParallelDSP.cpp | 5 + llvm/lib/Target/ARM/ARMRegisterBankInfo.cpp | 7 +- llvm/lib/Target/ARM/ARMRegisterBankInfo.h | 2 +- llvm/lib/Target/ARM/ARMRegisterInfo.cpp | 2 +- llvm/lib/Target/ARM/ARMSLSHardening.cpp | 4 +- llvm/lib/Target/ARM/ARMSelectionDAGInfo.cpp | 9 +- llvm/lib/Target/ARM/ARMSelectionDAGInfo.h | 1 + llvm/lib/Target/ARM/ARMSubtarget.cpp | 43 +- llvm/lib/Target/ARM/ARMSubtarget.h | 476 +- llvm/lib/Target/ARM/ARMTargetMachine.cpp | 28 +- llvm/lib/Target/ARM/ARMTargetMachine.h | 2 +- llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp | 50 +- llvm/lib/Target/ARM/ARMTargetTransformInfo.h | 3 +- llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp | 317 +- .../Target/ARM/Disassembler/ARMDisassembler.cpp | 1287 +- .../lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp | 132 +- llvm/lib/Target/ARM/MCTargetDesc/ARMMCAsmInfo.cpp | 4 +- .../Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp | 2 - .../Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp | 12 - llvm/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.h | 4 +- .../ARM/MCTargetDesc/ARMMachObjectWriter.cpp | 6 +- .../Target/ARM/MCTargetDesc/ARMTargetStreamer.cpp | 29 +- .../Target/ARM/MCTargetDesc/ARMWinCOFFStreamer.cpp | 227 + llvm/lib/Target/ARM/MVEGatherScatterLowering.cpp | 57 +- llvm/lib/Target/ARM/MVELaneInterleavingPass.cpp | 7 +- .../Target/ARM/MVETPAndVPTOptimisationsPass.cpp | 14 +- llvm/lib/Target/ARM/MVEVPTBlockPass.cpp | 3 +- llvm/lib/Target/ARM/Thumb1FrameLowering.cpp | 758 +- llvm/lib/Target/ARM/Thumb2ITBlockPass.cpp | 6 +- llvm/lib/Target/ARM/Thumb2InstrInfo.cpp | 6 +- llvm/lib/Target/ARM/Thumb2SizeReduction.cpp | 32 +- llvm/lib/Target/ARM/ThumbRegisterInfo.cpp | 50 +- llvm/lib/Target/AVR/AVR.h | 4 +- llvm/lib/Target/AVR/AVRAsmPrinter.cpp | 43 + llvm/lib/Target/AVR/AVRCallingConv.td | 4 + llvm/lib/Target/AVR/AVRDevices.td | 165 +- llvm/lib/Target/AVR/AVRExpandPseudoInsts.cpp | 446 +- llvm/lib/Target/AVR/AVRFrameLowering.cpp | 123 +- llvm/lib/Target/AVR/AVRISelLowering.cpp | 160 +- llvm/lib/Target/AVR/AVRISelLowering.h | 3 + llvm/lib/Target/AVR/AVRInstrFormats.td | 4 +- llvm/lib/Target/AVR/AVRInstrInfo.cpp | 23 +- llvm/lib/Target/AVR/AVRInstrInfo.td | 97 +- llvm/lib/Target/AVR/AVRMachineFunctionInfo.h | 7 + llvm/lib/Target/AVR/AVRRegisterInfo.cpp | 34 +- llvm/lib/Target/AVR/AVRRelaxMemOperations.cpp | 144 - llvm/lib/Target/AVR/AVRSubtarget.h | 12 +- llvm/lib/Target/AVR/AVRTargetMachine.cpp | 4 +- llvm/lib/Target/AVR/AsmParser/AVRAsmParser.cpp | 17 + .../Target/AVR/Disassembler/AVRDisassembler.cpp | 200 +- .../Target/AVR/MCTargetDesc/AVRELFObjectWriter.cpp | 2 +- .../lib/Target/AVR/MCTargetDesc/AVRELFStreamer.cpp | 1 + llvm/lib/Target/AVR/MCTargetDesc/AVRInstPrinter.h | 3 + .../Target/AVR/MCTargetDesc/AVRMCCodeEmitter.cpp | 1 - llvm/lib/Target/AVR/MCTargetDesc/AVRMCExpr.h | 2 +- llvm/lib/Target/AVR/MCTargetDesc/AVRMCTargetDesc.h | 1 - llvm/lib/Target/BPF/AsmParser/BPFAsmParser.cpp | 1 + llvm/lib/Target/BPF/BPF.h | 2 + llvm/lib/Target/BPF/BPFAbstractMemberAccess.cpp | 50 +- llvm/lib/Target/BPF/BPFAdjustOpt.cpp | 10 +- llvm/lib/Target/BPF/BPFCORE.h | 2 + llvm/lib/Target/BPF/BPFISelLowering.cpp | 3 +- llvm/lib/Target/BPF/BPFInstrFormats.td | 1 + llvm/lib/Target/BPF/BPFInstrInfo.cpp | 3 +- llvm/lib/Target/BPF/BPFInstrInfo.td | 2 + llvm/lib/Target/BPF/BPFMIChecking.cpp | 1 + llvm/lib/Target/BPF/BPFMIPeephole.cpp | 7 +- llvm/lib/Target/BPF/BPFMISimplifyPatchable.cpp | 24 +- llvm/lib/Target/BPF/BPFPreserveDIType.cpp | 1 + llvm/lib/Target/BPF/BPFTargetMachine.cpp | 4 +- llvm/lib/Target/BPF/BPFTargetMachine.h | 2 +- llvm/lib/Target/BPF/BPFTargetTransformInfo.h | 9 + llvm/lib/Target/BPF/BTF.def | 1 + llvm/lib/Target/BPF/BTF.h | 10 + llvm/lib/Target/BPF/BTFDebug.cpp | 197 +- llvm/lib/Target/BPF/BTFDebug.h | 26 +- .../Target/BPF/Disassembler/BPFDisassembler.cpp | 16 +- llvm/lib/Target/BPF/MCTargetDesc/BPFAsmBackend.cpp | 5 + .../lib/Target/BPF/MCTargetDesc/BPFInstPrinter.cpp | 1 + llvm/lib/Target/BPF/MCTargetDesc/BPFMCAsmInfo.h | 2 - .../Target/BPF/MCTargetDesc/BPFMCCodeEmitter.cpp | 6 +- llvm/lib/Target/BPF/MCTargetDesc/BPFMCTargetDesc.h | 3 +- llvm/lib/Target/CSKY/AsmParser/CSKYAsmParser.cpp | 271 +- llvm/lib/Target/CSKY/CSKY.h | 2 + llvm/lib/Target/CSKY/CSKY.td | 523 + llvm/lib/Target/CSKY/CSKYAsmPrinter.cpp | 105 +- llvm/lib/Target/CSKY/CSKYAsmPrinter.h | 14 +- llvm/lib/Target/CSKY/CSKYConstantIslandPass.cpp | 6 +- llvm/lib/Target/CSKY/CSKYFrameLowering.cpp | 23 +- llvm/lib/Target/CSKY/CSKYISelDAGToDAG.cpp | 219 + llvm/lib/Target/CSKY/CSKYISelLowering.cpp | 180 +- llvm/lib/Target/CSKY/CSKYISelLowering.h | 6 + llvm/lib/Target/CSKY/CSKYInstrAlias.td | 38 + llvm/lib/Target/CSKY/CSKYInstrFormats.td | 2 +- llvm/lib/Target/CSKY/CSKYInstrInfo.cpp | 9 +- llvm/lib/Target/CSKY/CSKYInstrInfo.h | 2 +- llvm/lib/Target/CSKY/CSKYInstrInfo.td | 32 +- llvm/lib/Target/CSKY/CSKYInstrInfo16Instr.td | 131 + llvm/lib/Target/CSKY/CSKYMachineFunctionInfo.h | 11 +- llvm/lib/Target/CSKY/CSKYRegisterInfo.cpp | 20 +- llvm/lib/Target/CSKY/CSKYRegisterInfo.td | 14 +- llvm/lib/Target/CSKY/CSKYSubtarget.cpp | 33 +- llvm/lib/Target/CSKY/CSKYSubtarget.h | 102 +- llvm/lib/Target/CSKY/CSKYTargetMachine.cpp | 12 +- llvm/lib/Target/CSKY/CSKYTargetObjectFile.cpp | 25 + llvm/lib/Target/CSKY/CSKYTargetObjectFile.h | 24 + .../Target/CSKY/Disassembler/CSKYDisassembler.cpp | 553 + .../Target/CSKY/MCTargetDesc/CSKYAsmBackend.cpp | 184 +- llvm/lib/Target/CSKY/MCTargetDesc/CSKYAsmBackend.h | 13 + .../CSKY/MCTargetDesc/CSKYELFObjectWriter.cpp | 110 +- .../Target/CSKY/MCTargetDesc/CSKYELFStreamer.cpp | 335 + .../lib/Target/CSKY/MCTargetDesc/CSKYELFStreamer.h | 148 + .../Target/CSKY/MCTargetDesc/CSKYInstPrinter.cpp | 68 +- .../Target/CSKY/MCTargetDesc/CSKYMCCodeEmitter.cpp | 161 +- .../Target/CSKY/MCTargetDesc/CSKYMCCodeEmitter.h | 12 + llvm/lib/Target/CSKY/MCTargetDesc/CSKYMCExpr.cpp | 2 + .../Target/CSKY/MCTargetDesc/CSKYMCTargetDesc.cpp | 88 + .../Target/CSKY/MCTargetDesc/CSKYMCTargetDesc.h | 4 +- .../CSKY/MCTargetDesc/CSKYTargetStreamer.cpp | 143 + .../Target/CSKY/MCTargetDesc/CSKYTargetStreamer.h | 110 + llvm/lib/Target/DirectX/DXIL.td | 144 + llvm/lib/Target/DirectX/DXILConstants.h | 25 + llvm/lib/Target/DirectX/DXILOpLowering.cpp | 265 + llvm/lib/Target/DirectX/DXILPointerType.cpp | 66 + llvm/lib/Target/DirectX/DXILPointerType.h | 52 + llvm/lib/Target/DirectX/DXILPrepare.cpp | 184 + llvm/lib/Target/DirectX/DXILStubs.td | 18 + llvm/lib/Target/DirectX/DXILTranslateMetadata.cpp | 121 + .../DirectX/DXILWriter/DXILBitcodeWriter.cpp | 2963 +++ .../Target/DirectX/DXILWriter/DXILBitcodeWriter.h | 82 + .../DirectX/DXILWriter/DXILValueEnumerator.cpp | 1147 + .../DirectX/DXILWriter/DXILValueEnumerator.h | 308 + .../Target/DirectX/DXILWriter/DXILWriterPass.cpp | 100 + .../lib/Target/DirectX/DXILWriter/DXILWriterPass.h | 37 + llvm/lib/Target/DirectX/DirectX.h | 43 + llvm/lib/Target/DirectX/DirectX.td | 54 + llvm/lib/Target/DirectX/DirectXAsmPrinter.cpp | 57 + llvm/lib/Target/DirectX/DirectXFrameLowering.h | 35 + llvm/lib/Target/DirectX/DirectXInstrInfo.cpp | 20 + llvm/lib/Target/DirectX/DirectXInstrInfo.h | 30 + llvm/lib/Target/DirectX/DirectXRegisterInfo.cpp | 24 + llvm/lib/Target/DirectX/DirectXRegisterInfo.h | 28 + llvm/lib/Target/DirectX/DirectXSubtarget.cpp | 29 + llvm/lib/Target/DirectX/DirectXSubtarget.h | 56 + llvm/lib/Target/DirectX/DirectXTargetLowering.h | 31 + llvm/lib/Target/DirectX/DirectXTargetMachine.cpp | 144 + llvm/lib/Target/DirectX/DirectXTargetMachine.h | 51 + .../Target/DirectX/DirectXTargetTransformInfo.h | 39 + .../MCTargetDesc/DirectXContainerObjectWriter.cpp | 28 + .../MCTargetDesc/DirectXContainerObjectWriter.h | 24 + .../DirectX/MCTargetDesc/DirectXMCTargetDesc.cpp | 152 + .../DirectX/MCTargetDesc/DirectXMCTargetDesc.h | 29 + llvm/lib/Target/DirectX/PointerTypeAnalysis.cpp | 119 + llvm/lib/Target/DirectX/PointerTypeAnalysis.h | 43 + .../DirectX/TargetInfo/DirectXTargetInfo.cpp | 30 + .../Target/DirectX/TargetInfo/DirectXTargetInfo.h | 18 + .../Target/Hexagon/AsmParser/HexagonAsmParser.cpp | 8 +- llvm/lib/Target/Hexagon/BitTracker.cpp | 3 +- .../Hexagon/Disassembler/HexagonDisassembler.cpp | 160 +- llvm/lib/Target/Hexagon/HexagonArch.h | 31 - llvm/lib/Target/Hexagon/HexagonAsmPrinter.cpp | 8 +- llvm/lib/Target/Hexagon/HexagonBitSimplify.cpp | 84 +- .../lib/Target/Hexagon/HexagonBranchRelaxation.cpp | 5 +- llvm/lib/Target/Hexagon/HexagonCommonGEP.cpp | 7 +- llvm/lib/Target/Hexagon/HexagonConstExtenders.cpp | 12 +- .../lib/Target/Hexagon/HexagonConstPropagation.cpp | 22 +- llvm/lib/Target/Hexagon/HexagonCopyToCombine.cpp | 18 +- llvm/lib/Target/Hexagon/HexagonDepArch.h | 88 +- llvm/lib/Target/Hexagon/HexagonDepDecoders.inc | 44 +- llvm/lib/Target/Hexagon/HexagonEarlyIfConv.cpp | 4 +- llvm/lib/Target/Hexagon/HexagonExpandCondsets.cpp | 2 +- llvm/lib/Target/Hexagon/HexagonFrameLowering.cpp | 61 +- llvm/lib/Target/Hexagon/HexagonGenInsert.cpp | 51 +- llvm/lib/Target/Hexagon/HexagonHardwareLoops.cpp | 10 +- .../lib/Target/Hexagon/HexagonHazardRecognizer.cpp | 2 +- llvm/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp | 11 +- llvm/lib/Target/Hexagon/HexagonISelDAGToDAGHVX.cpp | 2 +- llvm/lib/Target/Hexagon/HexagonISelLowering.cpp | 101 +- llvm/lib/Target/Hexagon/HexagonISelLowering.h | 2 +- llvm/lib/Target/Hexagon/HexagonISelLoweringHVX.cpp | 145 +- llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp | 65 +- .../Target/Hexagon/HexagonLoopIdiomRecognition.cpp | 13 +- .../Target/Hexagon/HexagonMachineFunctionInfo.cpp | 6 + .../Target/Hexagon/HexagonMachineFunctionInfo.h | 4 + llvm/lib/Target/Hexagon/HexagonNewValueJump.cpp | 3 +- llvm/lib/Target/Hexagon/HexagonPatterns.td | 6 + llvm/lib/Target/Hexagon/HexagonPatternsHVX.td | 19 +- llvm/lib/Target/Hexagon/HexagonPeephole.cpp | 28 +- llvm/lib/Target/Hexagon/HexagonPseudo.td | 22 + llvm/lib/Target/Hexagon/HexagonRDFOpt.cpp | 2 +- llvm/lib/Target/Hexagon/HexagonRegisterInfo.cpp | 2 +- llvm/lib/Target/Hexagon/HexagonSubtarget.cpp | 58 +- llvm/lib/Target/Hexagon/HexagonSubtarget.h | 2 +- llvm/lib/Target/Hexagon/HexagonTargetMachine.cpp | 75 +- llvm/lib/Target/Hexagon/HexagonTargetMachine.h | 2 +- .../lib/Target/Hexagon/HexagonTargetObjectFile.cpp | 7 +- .../Target/Hexagon/HexagonTargetTransformInfo.cpp | 3 +- .../Target/Hexagon/HexagonTargetTransformInfo.h | 10 +- llvm/lib/Target/Hexagon/HexagonVExtract.cpp | 12 +- llvm/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp | 25 +- llvm/lib/Target/Hexagon/HexagonVectorCombine.cpp | 4 +- .../Hexagon/HexagonVectorLoopCarriedReuse.cpp | 6 +- .../Target/Hexagon/HexagonVectorLoopCarriedReuse.h | 2 +- llvm/lib/Target/Hexagon/HexagonVectorPrint.cpp | 6 +- .../Hexagon/MCTargetDesc/HexagonAsmBackend.cpp | 1 + .../Hexagon/MCTargetDesc/HexagonMCAsmInfo.cpp | 1 - .../Hexagon/MCTargetDesc/HexagonMCChecker.cpp | 5 +- .../Hexagon/MCTargetDesc/HexagonMCCodeEmitter.cpp | 1 - .../Hexagon/MCTargetDesc/HexagonMCELFStreamer.cpp | 4 +- .../Target/Hexagon/MCTargetDesc/HexagonMCExpr.cpp | 1 + .../Hexagon/MCTargetDesc/HexagonMCTargetDesc.cpp | 25 +- .../Hexagon/MCTargetDesc/HexagonMCTargetDesc.h | 1 - .../Hexagon/MCTargetDesc/HexagonShuffler.cpp | 4 +- llvm/lib/Target/Lanai/AsmParser/LanaiAsmParser.cpp | 4 +- .../Lanai/Disassembler/LanaiDisassembler.cpp | 45 +- llvm/lib/Target/Lanai/LanaiISelLowering.cpp | 6 +- llvm/lib/Target/Lanai/LanaiInstrInfo.cpp | 4 +- llvm/lib/Target/Lanai/LanaiMachineFunctionInfo.cpp | 7 + llvm/lib/Target/Lanai/LanaiMachineFunctionInfo.h | 4 + llvm/lib/Target/Lanai/LanaiTargetMachine.cpp | 4 +- llvm/lib/Target/Lanai/LanaiTargetMachine.h | 2 +- .../Target/Lanai/MCTargetDesc/LanaiInstPrinter.h | 3 +- .../Lanai/MCTargetDesc/LanaiMCCodeEmitter.cpp | 1 - .../Target/Lanai/MCTargetDesc/LanaiMCTargetDesc.h | 1 - .../LoongArch/AsmParser/LoongArchAsmParser.cpp | 556 + .../Disassembler/LoongArchDisassembler.cpp | 145 + llvm/lib/Target/LoongArch/LoongArch.h | 38 + llvm/lib/Target/LoongArch/LoongArch.td | 139 + llvm/lib/Target/LoongArch/LoongArchAsmPrinter.cpp | 48 + llvm/lib/Target/LoongArch/LoongArchAsmPrinter.h | 46 + llvm/lib/Target/LoongArch/LoongArchCallingConv.td | 23 + .../Target/LoongArch/LoongArchFloat32InstrInfo.td | 177 + .../Target/LoongArch/LoongArchFloat64InstrInfo.td | 188 + .../Target/LoongArch/LoongArchFloatInstrFormats.td | 241 + .../Target/LoongArch/LoongArchFrameLowering.cpp | 55 + llvm/lib/Target/LoongArch/LoongArchFrameLowering.h | 38 + .../lib/Target/LoongArch/LoongArchISelDAGToDAG.cpp | 132 + llvm/lib/Target/LoongArch/LoongArchISelDAGToDAG.h | 55 + .../lib/Target/LoongArch/LoongArchISelLowering.cpp | 531 + llvm/lib/Target/LoongArch/LoongArchISelLowering.h | 95 + llvm/lib/Target/LoongArch/LoongArchInstrFormats.td | 404 + llvm/lib/Target/LoongArch/LoongArchInstrInfo.cpp | 49 + llvm/lib/Target/LoongArch/LoongArchInstrInfo.h | 36 + llvm/lib/Target/LoongArch/LoongArchInstrInfo.td | 730 + llvm/lib/Target/LoongArch/LoongArchMCInstLower.cpp | 66 + .../LoongArch/LoongArchMachineFunctionInfo.h | 57 + .../lib/Target/LoongArch/LoongArchRegisterInfo.cpp | 115 + llvm/lib/Target/LoongArch/LoongArchRegisterInfo.h | 50 + llvm/lib/Target/LoongArch/LoongArchRegisterInfo.td | 161 + llvm/lib/Target/LoongArch/LoongArchSubtarget.cpp | 54 + llvm/lib/Target/LoongArch/LoongArchSubtarget.h | 89 + .../Target/LoongArch/LoongArchTargetMachine.cpp | 118 + llvm/lib/Target/LoongArch/LoongArchTargetMachine.h | 46 + .../LoongArch/MCTargetDesc/LoongArchAsmBackend.cpp | 68 + .../LoongArch/MCTargetDesc/LoongArchAsmBackend.h | 63 + .../LoongArch/MCTargetDesc/LoongArchBaseInfo.cpp | 40 + .../LoongArch/MCTargetDesc/LoongArchBaseInfo.h | 44 + .../MCTargetDesc/LoongArchELFObjectWriter.cpp | 64 + .../MCTargetDesc/LoongArchInstPrinter.cpp | 63 + .../LoongArch/MCTargetDesc/LoongArchInstPrinter.h | 49 + .../LoongArch/MCTargetDesc/LoongArchMCAsmInfo.cpp | 34 + .../LoongArch/MCTargetDesc/LoongArchMCAsmInfo.h | 30 + .../MCTargetDesc/LoongArchMCCodeEmitter.cpp | 127 + .../MCTargetDesc/LoongArchMCTargetDesc.cpp | 114 + .../LoongArch/MCTargetDesc/LoongArchMCTargetDesc.h | 54 + .../LoongArch/MCTargetDesc/LoongArchMatInt.cpp | 51 + .../LoongArch/MCTargetDesc/LoongArchMatInt.h | 30 + .../LoongArch/TargetInfo/LoongArchTargetInfo.cpp | 30 + .../LoongArch/TargetInfo/LoongArchTargetInfo.h | 21 + llvm/lib/Target/M68k/AsmParser/M68kAsmParser.cpp | 1 + .../Target/M68k/Disassembler/M68kDisassembler.cpp | 618 +- llvm/lib/Target/M68k/GISel/M68kCallLowering.cpp | 98 +- llvm/lib/Target/M68k/GISel/M68kCallLowering.h | 12 + .../lib/Target/M68k/GISel/M68kRegisterBankInfo.cpp | 4 +- llvm/lib/Target/M68k/GISel/M68kRegisterBankInfo.h | 2 +- llvm/lib/Target/M68k/M68kCollapseMOVEMPass.cpp | 2 +- llvm/lib/Target/M68k/M68kExpandPseudo.cpp | 2 +- llvm/lib/Target/M68k/M68kISelDAGToDAG.cpp | 30 +- llvm/lib/Target/M68k/M68kISelLowering.cpp | 107 +- llvm/lib/Target/M68k/M68kISelLowering.h | 2 + llvm/lib/Target/M68k/M68kInstrArithmetic.td | 717 +- llvm/lib/Target/M68k/M68kInstrBits.td | 75 +- llvm/lib/Target/M68k/M68kInstrControl.td | 166 +- llvm/lib/Target/M68k/M68kInstrData.td | 653 +- llvm/lib/Target/M68k/M68kInstrFormats.td | 136 + llvm/lib/Target/M68k/M68kInstrInfo.cpp | 53 +- llvm/lib/Target/M68k/M68kInstrInfo.td | 106 +- llvm/lib/Target/M68k/M68kInstrShiftRotate.td | 54 +- llvm/lib/Target/M68k/M68kMachineFunction.cpp | 7 + llvm/lib/Target/M68k/M68kMachineFunction.h | 9 +- llvm/lib/Target/M68k/M68kRegisterInfo.cpp | 1 + llvm/lib/Target/M68k/M68kRegisterInfo.h | 8 + llvm/lib/Target/M68k/M68kSubtarget.h | 2 +- .../Target/M68k/MCTargetDesc/M68kMCCodeEmitter.cpp | 452 +- .../Target/M68k/MCTargetDesc/M68kMCTargetDesc.h | 1 - .../Target/MSP430/AsmParser/MSP430AsmParser.cpp | 1 + .../MSP430/Disassembler/MSP430Disassembler.cpp | 14 +- .../MSP430/MCTargetDesc/MSP430AsmBackend.cpp | 2 +- .../MSP430/MCTargetDesc/MSP430ELFObjectWriter.cpp | 2 +- .../MSP430/MCTargetDesc/MSP430ELFStreamer.cpp | 3 +- .../MSP430/MCTargetDesc/MSP430MCCodeEmitter.cpp | 3 +- .../MSP430/MCTargetDesc/MSP430MCTargetDesc.h | 1 - llvm/lib/Target/MSP430/MSP430AsmPrinter.cpp | 4 +- llvm/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp | 3 +- llvm/lib/Target/MSP430/MSP430ISelLowering.cpp | 34 +- llvm/lib/Target/MSP430/MSP430InstrInfo.cpp | 3 +- .../Target/MSP430/MSP430MachineFunctionInfo.cpp | 7 + llvm/lib/Target/MSP430/MSP430MachineFunctionInfo.h | 5 + llvm/lib/Target/MSP430/MSP430TargetMachine.cpp | 6 +- llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp | 17 +- .../Target/Mips/Disassembler/MipsDisassembler.cpp | 866 +- .../Target/Mips/MCTargetDesc/MipsABIFlagsSection.h | 2 +- llvm/lib/Target/Mips/MCTargetDesc/MipsABIInfo.cpp | 2 + .../Target/Mips/MCTargetDesc/MipsAsmBackend.cpp | 13 + .../Mips/MCTargetDesc/MipsELFObjectWriter.cpp | 2 + .../Target/Mips/MCTargetDesc/MipsELFStreamer.cpp | 4 +- .../lib/Target/Mips/MCTargetDesc/MipsELFStreamer.h | 2 +- .../Target/Mips/MCTargetDesc/MipsInstPrinter.cpp | 162 +- .../lib/Target/Mips/MCTargetDesc/MipsInstPrinter.h | 50 +- .../Target/Mips/MCTargetDesc/MipsMCCodeEmitter.cpp | 2 - .../Target/Mips/MCTargetDesc/MipsMCTargetDesc.h | 2 - .../Target/Mips/MCTargetDesc/MipsOptionRecord.cpp | 8 +- .../Mips/MCTargetDesc/MipsTargetStreamer.cpp | 36 +- llvm/lib/Target/Mips/MicroMips32r6InstrInfo.td | 4 + llvm/lib/Target/Mips/MicroMipsInstrFPU.td | 28 +- llvm/lib/Target/Mips/MicroMipsInstrInfo.td | 5 + llvm/lib/Target/Mips/MicroMipsSizeReduction.cpp | 2 +- llvm/lib/Target/Mips/Mips.h | 2 + llvm/lib/Target/Mips/Mips.td | 6 + llvm/lib/Target/Mips/Mips16ISelDAGToDAG.cpp | 2 +- llvm/lib/Target/Mips/Mips16RegisterInfo.cpp | 2 +- llvm/lib/Target/Mips/Mips32r6InstrInfo.td | 2 + llvm/lib/Target/Mips/MipsAsmPrinter.cpp | 28 +- llvm/lib/Target/Mips/MipsBranchExpansion.cpp | 44 +- llvm/lib/Target/Mips/MipsCallLowering.cpp | 4 +- llvm/lib/Target/Mips/MipsCombine.td | 15 + llvm/lib/Target/Mips/MipsConstantIslandPass.cpp | 6 +- llvm/lib/Target/Mips/MipsDelaySlotFiller.cpp | 2 +- llvm/lib/Target/Mips/MipsExpandPseudo.cpp | 2 +- llvm/lib/Target/Mips/MipsFastISel.cpp | 18 +- llvm/lib/Target/Mips/MipsISelDAGToDAG.cpp | 2 +- llvm/lib/Target/Mips/MipsISelLowering.cpp | 98 +- llvm/lib/Target/Mips/MipsISelLowering.h | 10 +- llvm/lib/Target/Mips/MipsInstrInfo.cpp | 44 +- llvm/lib/Target/Mips/MipsInstrInfo.h | 13 + llvm/lib/Target/Mips/MipsInstrInfo.td | 4 + llvm/lib/Target/Mips/MipsLegalizerInfo.cpp | 4 +- llvm/lib/Target/Mips/MipsMachineFunction.cpp | 9 +- llvm/lib/Target/Mips/MipsMachineFunction.h | 5 + llvm/lib/Target/Mips/MipsModuleISelDAGToDAG.cpp | 3 +- llvm/lib/Target/Mips/MipsOptimizePICCall.cpp | 4 +- llvm/lib/Target/Mips/MipsOs16.cpp | 1 + llvm/lib/Target/Mips/MipsPostLegalizerCombiner.cpp | 148 + llvm/lib/Target/Mips/MipsPreLegalizerCombiner.cpp | 4 +- llvm/lib/Target/Mips/MipsRegisterBankInfo.cpp | 8 +- llvm/lib/Target/Mips/MipsRegisterBankInfo.h | 2 +- llvm/lib/Target/Mips/MipsSEFrameLowering.cpp | 2 +- llvm/lib/Target/Mips/MipsSEISelDAGToDAG.cpp | 36 +- llvm/lib/Target/Mips/MipsSEISelLowering.cpp | 24 +- llvm/lib/Target/Mips/MipsSERegisterInfo.cpp | 2 +- llvm/lib/Target/Mips/MipsScheduleGeneric.td | 8 +- llvm/lib/Target/Mips/MipsSubtarget.cpp | 15 +- llvm/lib/Target/Mips/MipsSubtarget.h | 11 +- llvm/lib/Target/Mips/MipsTargetMachine.cpp | 15 +- llvm/lib/Target/Mips/MipsTargetMachine.h | 2 +- llvm/lib/Target/Mips/MipsTargetStreamer.h | 2 +- llvm/lib/Target/Mips/MipsTargetTransformInfo.cpp | 17 + llvm/lib/Target/Mips/MipsTargetTransformInfo.h | 40 + .../Target/NVPTX/MCTargetDesc/NVPTXMCAsmInfo.cpp | 11 + .../NVPTX/MCTargetDesc/NVPTXTargetStreamer.cpp | 2 +- llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp | 133 +- llvm/lib/Target/NVPTX/NVPTXAsmPrinter.h | 5 +- llvm/lib/Target/NVPTX/NVPTXAtomicLower.cpp | 2 +- llvm/lib/Target/NVPTX/NVPTXGenericToNVVM.cpp | 17 +- llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp | 45 +- llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp | 520 +- llvm/lib/Target/NVPTX/NVPTXISelLowering.h | 21 + llvm/lib/Target/NVPTX/NVPTXInstrInfo.cpp | 2 +- llvm/lib/Target/NVPTX/NVPTXInstrInfo.td | 53 +- llvm/lib/Target/NVPTX/NVPTXIntrinsics.td | 352 +- llvm/lib/Target/NVPTX/NVPTXLowerAggrCopies.cpp | 3 +- llvm/lib/Target/NVPTX/NVPTXLowerArgs.cpp | 119 +- llvm/lib/Target/NVPTX/NVPTXMachineFunctionInfo.h | 7 + llvm/lib/Target/NVPTX/NVPTXReplaceImageHandles.cpp | 8 +- llvm/lib/Target/NVPTX/NVPTXSubtarget.cpp | 2 +- llvm/lib/Target/NVPTX/NVPTXTargetMachine.cpp | 4 +- llvm/lib/Target/NVPTX/NVPTXTargetMachine.h | 2 +- llvm/lib/Target/NVPTX/NVPTXTargetObjectFile.h | 2 +- llvm/lib/Target/NVPTX/NVPTXTargetTransformInfo.cpp | 65 +- llvm/lib/Target/NVPTX/NVVMReflect.cpp | 12 +- llvm/lib/Target/PowerPC/AsmParser/PPCAsmParser.cpp | 63 +- .../PowerPC/Disassembler/PPCDisassembler.cpp | 98 +- llvm/lib/Target/PowerPC/GISel/PPCCallLowering.cpp | 1 + .../Target/PowerPC/GISel/PPCRegisterBankInfo.cpp | 3 +- .../lib/Target/PowerPC/GISel/PPCRegisterBankInfo.h | 4 +- .../Target/PowerPC/MCTargetDesc/PPCAsmBackend.cpp | 2 + .../PowerPC/MCTargetDesc/PPCELFObjectWriter.cpp | 2 + .../Target/PowerPC/MCTargetDesc/PPCELFStreamer.cpp | 6 +- .../Target/PowerPC/MCTargetDesc/PPCFixupKinds.h | 4 + .../PowerPC/MCTargetDesc/PPCMCCodeEmitter.cpp | 11 +- llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCExpr.cpp | 13 +- .../Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.h | 1 - .../PowerPC/MCTargetDesc/PPCXCOFFObjectWriter.cpp | 23 +- .../PowerPC/MCTargetDesc/PPCXCOFFStreamer.cpp | 1 + llvm/lib/Target/PowerPC/P10InstrResources.td | 8 +- llvm/lib/Target/PowerPC/P9InstrResources.td | 10 +- llvm/lib/Target/PowerPC/PPC.h | 8 +- llvm/lib/Target/PowerPC/PPC.td | 12 +- llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp | 88 +- llvm/lib/Target/PowerPC/PPCBack2BackFusion.def | 2 + llvm/lib/Target/PowerPC/PPCCTRLoops.cpp | 421 +- llvm/lib/Target/PowerPC/PPCCTRLoopsVerify.cpp | 185 + llvm/lib/Target/PowerPC/PPCCallingConv.td | 22 + llvm/lib/Target/PowerPC/PPCFastISel.cpp | 2 +- llvm/lib/Target/PowerPC/PPCFrameLowering.cpp | 42 +- .../lib/Target/PowerPC/PPCGenScalarMASSEntries.cpp | 149 + llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp | 14 +- llvm/lib/Target/PowerPC/PPCISelLowering.cpp | 485 +- llvm/lib/Target/PowerPC/PPCISelLowering.h | 43 +- llvm/lib/Target/PowerPC/PPCInstr64Bit.td | 19 +- llvm/lib/Target/PowerPC/PPCInstrInfo.cpp | 91 +- llvm/lib/Target/PowerPC/PPCInstrInfo.h | 99 + llvm/lib/Target/PowerPC/PPCInstrInfo.td | 543 +- llvm/lib/Target/PowerPC/PPCInstrMMA.td | 628 + llvm/lib/Target/PowerPC/PPCInstrP10.td | 2315 ++ llvm/lib/Target/PowerPC/PPCInstrPrefix.td | 2889 --- llvm/lib/Target/PowerPC/PPCInstrVSX.td | 76 +- llvm/lib/Target/PowerPC/PPCLoopInstrFormPrep.cpp | 1 - llvm/lib/Target/PowerPC/PPCMCInstLower.cpp | 2 +- llvm/lib/Target/PowerPC/PPCMIPeephole.cpp | 3 +- llvm/lib/Target/PowerPC/PPCMachineFunctionInfo.cpp | 7 + llvm/lib/Target/PowerPC/PPCMachineFunctionInfo.h | 5 + llvm/lib/Target/PowerPC/PPCMacroFusion.cpp | 5 +- llvm/lib/Target/PowerPC/PPCPreEmitPeephole.cpp | 37 + llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp | 171 +- llvm/lib/Target/PowerPC/PPCRegisterInfo.h | 2 + llvm/lib/Target/PowerPC/PPCRegisterInfo.td | 655 +- llvm/lib/Target/PowerPC/PPCRegisterInfoMMA.td | 106 + llvm/lib/Target/PowerPC/PPCScheduleP10.td | 2 +- llvm/lib/Target/PowerPC/PPCScheduleP9.td | 3 +- llvm/lib/Target/PowerPC/PPCSubtarget.cpp | 2 + llvm/lib/Target/PowerPC/PPCSubtarget.h | 4 +- llvm/lib/Target/PowerPC/PPCTargetMachine.cpp | 34 +- llvm/lib/Target/PowerPC/PPCTargetMachine.h | 2 +- llvm/lib/Target/PowerPC/PPCTargetStreamer.h | 1 + llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp | 20 +- llvm/lib/Target/PowerPC/PPCTargetTransformInfo.h | 7 +- llvm/lib/Target/PowerPC/PPCVSXSwapRemoval.cpp | 2 + llvm/lib/Target/PowerPC/README_P9.txt | 9 +- llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp | 172 +- .../RISCV/Disassembler/RISCVDisassembler.cpp | 118 +- .../Target/RISCV/MCTargetDesc/RISCVAsmBackend.cpp | 10 +- .../Target/RISCV/MCTargetDesc/RISCVAsmBackend.h | 6 +- .../Target/RISCV/MCTargetDesc/RISCVBaseInfo.cpp | 25 +- llvm/lib/Target/RISCV/MCTargetDesc/RISCVBaseInfo.h | 57 +- .../RISCV/MCTargetDesc/RISCVELFObjectWriter.cpp | 2 +- .../Target/RISCV/MCTargetDesc/RISCVELFStreamer.cpp | 101 +- .../Target/RISCV/MCTargetDesc/RISCVELFStreamer.h | 5 + .../Target/RISCV/MCTargetDesc/RISCVInstPrinter.cpp | 10 +- .../Target/RISCV/MCTargetDesc/RISCVInstPrinter.h | 4 +- .../RISCV/MCTargetDesc/RISCVMCCodeEmitter.cpp | 8 +- llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCExpr.cpp | 1 + .../RISCV/MCTargetDesc/RISCVMCObjectFileInfo.cpp | 1 + .../RISCV/MCTargetDesc/RISCVMCTargetDesc.cpp | 6 +- .../Target/RISCV/MCTargetDesc/RISCVMCTargetDesc.h | 1 - llvm/lib/Target/RISCV/MCTargetDesc/RISCVMatInt.cpp | 179 +- llvm/lib/Target/RISCV/MCTargetDesc/RISCVMatInt.h | 10 + .../RISCV/MCTargetDesc/RISCVTargetStreamer.cpp | 16 +- .../RISCV/MCTargetDesc/RISCVTargetStreamer.h | 6 + llvm/lib/Target/RISCV/RISCV.h | 11 +- llvm/lib/Target/RISCV/RISCV.td | 108 +- llvm/lib/Target/RISCV/RISCVAsmPrinter.cpp | 21 +- llvm/lib/Target/RISCV/RISCVExpandPseudoInsts.cpp | 11 +- llvm/lib/Target/RISCV/RISCVFrameLowering.cpp | 468 +- llvm/lib/Target/RISCV/RISCVFrameLowering.h | 5 +- .../Target/RISCV/RISCVGatherScatterLowering.cpp | 26 +- llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp | 970 +- llvm/lib/Target/RISCV/RISCVISelDAGToDAG.h | 20 +- llvm/lib/Target/RISCV/RISCVISelLowering.cpp | 4026 ++-- llvm/lib/Target/RISCV/RISCVISelLowering.h | 115 +- llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp | 1772 +- llvm/lib/Target/RISCV/RISCVInstrFormats.td | 5 +- llvm/lib/Target/RISCV/RISCVInstrInfo.cpp | 206 +- llvm/lib/Target/RISCV/RISCVInstrInfo.h | 26 +- llvm/lib/Target/RISCV/RISCVInstrInfo.td | 325 +- llvm/lib/Target/RISCV/RISCVInstrInfoA.td | 30 +- llvm/lib/Target/RISCV/RISCVInstrInfoD.td | 239 +- llvm/lib/Target/RISCV/RISCVInstrInfoF.td | 327 +- llvm/lib/Target/RISCV/RISCVInstrInfoM.td | 8 +- llvm/lib/Target/RISCV/RISCVInstrInfoV.td | 57 +- llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td | 987 +- llvm/lib/Target/RISCV/RISCVInstrInfoVSDPatterns.td | 575 +- llvm/lib/Target/RISCV/RISCVInstrInfoVVLPatterns.td | 1227 +- llvm/lib/Target/RISCV/RISCVInstrInfoZb.td | 264 +- llvm/lib/Target/RISCV/RISCVInstrInfoZfh.td | 245 +- llvm/lib/Target/RISCV/RISCVInstrInfoZicbo.td | 71 + llvm/lib/Target/RISCV/RISCVMCInstLower.cpp | 13 +- llvm/lib/Target/RISCV/RISCVMachineFunctionInfo.cpp | 37 + llvm/lib/Target/RISCV/RISCVMachineFunctionInfo.h | 35 + llvm/lib/Target/RISCV/RISCVMacroFusion.cpp | 67 + llvm/lib/Target/RISCV/RISCVMacroFusion.h | 28 + llvm/lib/Target/RISCV/RISCVMakeCompressible.cpp | 382 + llvm/lib/Target/RISCV/RISCVMergeBaseOffset.cpp | 280 +- .../Target/RISCV/RISCVRedundantCopyElimination.cpp | 179 + llvm/lib/Target/RISCV/RISCVRegisterBankInfo.cpp | 7 +- llvm/lib/Target/RISCV/RISCVRegisterBankInfo.h | 2 +- llvm/lib/Target/RISCV/RISCVRegisterInfo.cpp | 15 +- llvm/lib/Target/RISCV/RISCVRegisterInfo.td | 36 + llvm/lib/Target/RISCV/RISCVSExtWRemoval.cpp | 275 +- llvm/lib/Target/RISCV/RISCVSchedRocket.td | 5 + llvm/lib/Target/RISCV/RISCVSchedSiFive7.td | 5 + llvm/lib/Target/RISCV/RISCVScheduleB.td | 206 + llvm/lib/Target/RISCV/RISCVSubtarget.cpp | 58 +- llvm/lib/Target/RISCV/RISCVSubtarget.h | 100 +- llvm/lib/Target/RISCV/RISCVTargetMachine.cpp | 84 +- llvm/lib/Target/RISCV/RISCVTargetMachine.h | 10 +- llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp | 231 +- llvm/lib/Target/RISCV/RISCVTargetTransformInfo.h | 106 +- .../Target/SPIRV/MCTargetDesc/SPIRVAsmBackend.cpp | 63 + .../Target/SPIRV/MCTargetDesc/SPIRVBaseInfo.cpp | 1072 + llvm/lib/Target/SPIRV/MCTargetDesc/SPIRVBaseInfo.h | 739 + .../Target/SPIRV/MCTargetDesc/SPIRVInstPrinter.cpp | 556 + .../Target/SPIRV/MCTargetDesc/SPIRVInstPrinter.h | 94 + .../Target/SPIRV/MCTargetDesc/SPIRVMCAsmInfo.cpp | 34 + .../lib/Target/SPIRV/MCTargetDesc/SPIRVMCAsmInfo.h | 29 + .../SPIRV/MCTargetDesc/SPIRVMCCodeEmitter.cpp | 132 + .../SPIRV/MCTargetDesc/SPIRVMCTargetDesc.cpp | 102 + .../Target/SPIRV/MCTargetDesc/SPIRVMCTargetDesc.h | 52 + .../SPIRV/MCTargetDesc/SPIRVObjectTargetWriter.cpp | 25 + .../SPIRV/MCTargetDesc/SPIRVTargetStreamer.cpp | 18 + .../SPIRV/MCTargetDesc/SPIRVTargetStreamer.h | 28 + llvm/lib/Target/SPIRV/SPIRV.h | 34 + llvm/lib/Target/SPIRV/SPIRV.td | 43 + llvm/lib/Target/SPIRV/SPIRVAsmPrinter.cpp | 348 + llvm/lib/Target/SPIRV/SPIRVCallLowering.cpp | 223 + llvm/lib/Target/SPIRV/SPIRVCallLowering.h | 50 + llvm/lib/Target/SPIRV/SPIRVEmitIntrinsics.cpp | 433 + llvm/lib/Target/SPIRV/SPIRVEnums.td | 51 + llvm/lib/Target/SPIRV/SPIRVFrameLowering.h | 39 + llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.cpp | 459 + llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.h | 174 + llvm/lib/Target/SPIRV/SPIRVISelLowering.cpp | 45 + llvm/lib/Target/SPIRV/SPIRVISelLowering.h | 47 + llvm/lib/Target/SPIRV/SPIRVInstrFormats.td | 31 + llvm/lib/Target/SPIRV/SPIRVInstrInfo.cpp | 195 + llvm/lib/Target/SPIRV/SPIRVInstrInfo.h | 54 + llvm/lib/Target/SPIRV/SPIRVInstrInfo.td | 732 + llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp | 1268 ++ llvm/lib/Target/SPIRV/SPIRVLegalizerInfo.cpp | 301 + llvm/lib/Target/SPIRV/SPIRVLegalizerInfo.h | 36 + llvm/lib/Target/SPIRV/SPIRVMCInstLower.cpp | 58 + llvm/lib/Target/SPIRV/SPIRVMCInstLower.h | 29 + llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.cpp | 250 + llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.h | 137 + llvm/lib/Target/SPIRV/SPIRVPreLegalizer.cpp | 440 + llvm/lib/Target/SPIRV/SPIRVRegisterBankInfo.cpp | 47 + llvm/lib/Target/SPIRV/SPIRVRegisterBankInfo.h | 38 + llvm/lib/Target/SPIRV/SPIRVRegisterBanks.td | 15 + llvm/lib/Target/SPIRV/SPIRVRegisterInfo.cpp | 32 + llvm/lib/Target/SPIRV/SPIRVRegisterInfo.h | 36 + llvm/lib/Target/SPIRV/SPIRVRegisterInfo.td | 39 + llvm/lib/Target/SPIRV/SPIRVSubtarget.cpp | 68 + llvm/lib/Target/SPIRV/SPIRVSubtarget.h | 93 + llvm/lib/Target/SPIRV/SPIRVTargetMachine.cpp | 186 + llvm/lib/Target/SPIRV/SPIRVTargetMachine.h | 47 + llvm/lib/Target/SPIRV/SPIRVTargetObjectFile.h | 45 + llvm/lib/Target/SPIRV/SPIRVTargetTransformInfo.h | 44 + llvm/lib/Target/SPIRV/SPIRVUtils.cpp | 207 + llvm/lib/Target/SPIRV/SPIRVUtils.h | 83 + .../Target/SPIRV/TargetInfo/SPIRVTargetInfo.cpp | 28 + llvm/lib/Target/SPIRV/TargetInfo/SPIRVTargetInfo.h | 21 + llvm/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp | 124 +- llvm/lib/Target/Sparc/DelaySlotFiller.cpp | 11 +- .../Sparc/Disassembler/SparcDisassembler.cpp | 185 +- .../Target/Sparc/MCTargetDesc/SparcAsmBackend.cpp | 23 +- .../Sparc/MCTargetDesc/SparcELFObjectWriter.cpp | 7 +- .../Target/Sparc/MCTargetDesc/SparcFixupKinds.h | 12 + .../Sparc/MCTargetDesc/SparcMCCodeEmitter.cpp | 15 +- llvm/lib/Target/Sparc/MCTargetDesc/SparcMCExpr.cpp | 16 + llvm/lib/Target/Sparc/MCTargetDesc/SparcMCExpr.h | 7 +- .../Target/Sparc/MCTargetDesc/SparcMCTargetDesc.h | 1 - llvm/lib/Target/Sparc/SparcCallingConv.td | 2 +- llvm/lib/Target/Sparc/SparcFrameLowering.cpp | 31 +- llvm/lib/Target/Sparc/SparcISelLowering.cpp | 172 +- llvm/lib/Target/Sparc/SparcISelLowering.h | 10 +- llvm/lib/Target/Sparc/SparcInstr64Bit.td | 23 +- llvm/lib/Target/Sparc/SparcInstrInfo.td | 123 +- llvm/lib/Target/Sparc/SparcMachineFunctionInfo.cpp | 7 + llvm/lib/Target/Sparc/SparcMachineFunctionInfo.h | 5 + llvm/lib/Target/Sparc/SparcTargetMachine.cpp | 4 +- llvm/lib/Target/Sparc/SparcTargetObjectFile.h | 2 +- .../Target/SystemZ/AsmParser/SystemZAsmParser.cpp | 12 +- .../SystemZ/Disassembler/SystemZDisassembler.cpp | 139 +- .../SystemZ/MCTargetDesc/SystemZMCCodeEmitter.cpp | 10 +- .../SystemZ/MCTargetDesc/SystemZMCTargetDesc.cpp | 3 +- .../SystemZ/MCTargetDesc/SystemZMCTargetDesc.h | 1 - llvm/lib/Target/SystemZ/SystemZAsmPrinter.cpp | 325 +- llvm/lib/Target/SystemZ/SystemZAsmPrinter.h | 21 +- llvm/lib/Target/SystemZ/SystemZCopyPhysRegs.cpp | 2 +- llvm/lib/Target/SystemZ/SystemZElimCompare.cpp | 16 +- llvm/lib/Target/SystemZ/SystemZFrameLowering.cpp | 90 +- llvm/lib/Target/SystemZ/SystemZFrameLowering.h | 3 + llvm/lib/Target/SystemZ/SystemZISelDAGToDAG.cpp | 9 +- llvm/lib/Target/SystemZ/SystemZISelLowering.cpp | 443 +- llvm/lib/Target/SystemZ/SystemZISelLowering.h | 42 +- llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp | 49 +- llvm/lib/Target/SystemZ/SystemZInstrInfo.h | 9 +- llvm/lib/Target/SystemZ/SystemZInstrInfo.td | 32 +- llvm/lib/Target/SystemZ/SystemZLDCleanup.cpp | 2 +- .../Target/SystemZ/SystemZMachineFunctionInfo.cpp | 6 + .../Target/SystemZ/SystemZMachineFunctionInfo.h | 5 + llvm/lib/Target/SystemZ/SystemZPostRewrite.cpp | 3 +- llvm/lib/Target/SystemZ/SystemZProcessors.td | 3 +- llvm/lib/Target/SystemZ/SystemZRegisterInfo.cpp | 5 +- llvm/lib/Target/SystemZ/SystemZRegisterInfo.h | 6 +- llvm/lib/Target/SystemZ/SystemZSchedule.td | 4 +- llvm/lib/Target/SystemZ/SystemZScheduleZ13.td | 6 +- llvm/lib/Target/SystemZ/SystemZScheduleZ14.td | 6 +- llvm/lib/Target/SystemZ/SystemZScheduleZ15.td | 6 +- llvm/lib/Target/SystemZ/SystemZScheduleZ16.td | 1728 ++ llvm/lib/Target/SystemZ/SystemZScheduleZ196.td | 6 +- llvm/lib/Target/SystemZ/SystemZScheduleZEC12.td | 6 +- .../lib/Target/SystemZ/SystemZSelectionDAGInfo.cpp | 2 +- llvm/lib/Target/SystemZ/SystemZSelectionDAGInfo.h | 2 +- llvm/lib/Target/SystemZ/SystemZShortenInst.cpp | 14 +- llvm/lib/Target/SystemZ/SystemZSubtarget.cpp | 20 +- llvm/lib/Target/SystemZ/SystemZSubtarget.h | 4 +- llvm/lib/Target/SystemZ/SystemZTargetMachine.cpp | 12 +- llvm/lib/Target/SystemZ/SystemZTargetMachine.h | 2 +- llvm/lib/Target/SystemZ/SystemZTargetStreamer.h | 1 + .../Target/SystemZ/SystemZTargetTransformInfo.cpp | 49 +- .../Target/SystemZ/SystemZTargetTransformInfo.h | 8 +- llvm/lib/Target/TargetIntrinsicInfo.cpp | 8 +- llvm/lib/Target/TargetLoweringObjectFile.cpp | 2 - llvm/lib/Target/TargetMachine.cpp | 17 +- llvm/lib/Target/TargetMachineC.cpp | 8 +- llvm/lib/Target/VE/AsmParser/VEAsmParser.cpp | 1 + llvm/lib/Target/VE/Disassembler/VEDisassembler.cpp | 126 +- .../Target/VE/MCTargetDesc/VEELFObjectWriter.cpp | 2 +- llvm/lib/Target/VE/MCTargetDesc/VEFixupKinds.h | 16 +- .../lib/Target/VE/MCTargetDesc/VEMCCodeEmitter.cpp | 1 - llvm/lib/Target/VE/MCTargetDesc/VEMCExpr.cpp | 1 + llvm/lib/Target/VE/MCTargetDesc/VEMCTargetDesc.h | 3 +- llvm/lib/Target/VE/VE.h | 4 +- llvm/lib/Target/VE/VECustomDAG.cpp | 514 +- llvm/lib/Target/VE/VECustomDAG.h | 144 + llvm/lib/Target/VE/VEISelDAGToDAG.cpp | 37 + llvm/lib/Target/VE/VEISelLowering.cpp | 281 +- llvm/lib/Target/VE/VEISelLowering.h | 29 +- llvm/lib/Target/VE/VEInstrInfo.cpp | 7 +- llvm/lib/Target/VE/VEInstrInfo.td | 50 +- llvm/lib/Target/VE/VEInstrIntrinsicVL.gen.td | 54 + llvm/lib/Target/VE/VEInstrIntrinsicVL.td | 3 - llvm/lib/Target/VE/VEInstrPatternsVec.td | 43 + llvm/lib/Target/VE/VEMachineFunctionInfo.cpp | 7 + llvm/lib/Target/VE/VEMachineFunctionInfo.h | 5 + llvm/lib/Target/VE/VERegisterInfo.td | 4 +- llvm/lib/Target/VE/VETargetMachine.cpp | 7 +- llvm/lib/Target/VE/VETargetMachine.h | 2 +- llvm/lib/Target/VE/VETargetTransformInfo.h | 66 + llvm/lib/Target/VE/VVPISelLowering.cpp | 443 + llvm/lib/Target/VE/VVPInstrInfo.td | 111 +- llvm/lib/Target/VE/VVPInstrPatternsVec.td | 358 + llvm/lib/Target/VE/VVPNodes.def | 89 +- .../WebAssembly/AsmParser/WebAssemblyAsmParser.cpp | 18 +- .../AsmParser/WebAssemblyAsmTypeCheck.cpp | 95 +- .../AsmParser/WebAssemblyAsmTypeCheck.h | 9 +- .../Disassembler/WebAssemblyDisassembler.cpp | 2 +- .../MCTargetDesc/WebAssemblyMCAsmInfo.cpp | 2 - .../MCTargetDesc/WebAssemblyMCTargetDesc.cpp | 1 - .../MCTargetDesc/WebAssemblyTargetStreamer.cpp | 6 - .../MCTargetDesc/WebAssemblyTargetStreamer.h | 5 - .../WebAssembly/Utils/WebAssemblyTypeUtilities.h | 4 + llvm/lib/Target/WebAssembly/WebAssembly.h | 4 - llvm/lib/Target/WebAssembly/WebAssembly.td | 4 + .../Target/WebAssembly/WebAssemblyAsmPrinter.cpp | 207 +- .../lib/Target/WebAssembly/WebAssemblyAsmPrinter.h | 4 +- .../Target/WebAssembly/WebAssemblyCFGStackify.cpp | 2 +- .../WebAssembly/WebAssemblyExceptionInfo.cpp | 1 + .../WebAssembly/WebAssemblyFixBrTableDefaults.cpp | 2 +- .../WebAssemblyFixIrreducibleControlFlow.cpp | 54 +- .../Target/WebAssembly/WebAssemblyISelLowering.cpp | 46 +- .../Target/WebAssembly/WebAssemblyISelLowering.h | 4 + .../Target/WebAssembly/WebAssemblyInstrAtomics.td | 22 +- .../Target/WebAssembly/WebAssemblyInstrFormats.td | 16 +- .../lib/Target/WebAssembly/WebAssemblyInstrInfo.td | 16 +- .../Target/WebAssembly/WebAssemblyInstrMemory.td | 8 +- llvm/lib/Target/WebAssembly/WebAssemblyInstrRef.td | 6 + .../lib/Target/WebAssembly/WebAssemblyInstrSIMD.td | 131 +- .../WebAssembly/WebAssemblyLateEHPrepare.cpp | 4 +- .../WebAssemblyLowerEmscriptenEHSjLj.cpp | 74 +- .../WebAssembly/WebAssemblyLowerGlobalDtors.cpp | 210 - .../WebAssembly/WebAssemblyMCLowerPrePass.cpp | 3 + .../WebAssembly/WebAssemblyMachineFunctionInfo.cpp | 14 +- .../WebAssembly/WebAssemblyMachineFunctionInfo.h | 13 +- .../WebAssemblyNullifyDebugValueLists.cpp | 1 + .../WebAssemblyOptimizeLiveIntervals.cpp | 7 +- .../WebAssemblyPrepareForLiveIntervals.cpp | 126 - .../WebAssembly/WebAssemblyReplacePhysRegs.cpp | 3 - .../WebAssembly/WebAssemblySelectionDAGInfo.cpp | 2 +- .../WebAssembly/WebAssemblySelectionDAGInfo.h | 1 + llvm/lib/Target/WebAssembly/WebAssemblySubtarget.h | 1 + .../WebAssembly/WebAssemblyTargetMachine.cpp | 42 +- .../Target/WebAssembly/WebAssemblyTargetMachine.h | 2 +- .../WebAssembly/WebAssemblyTargetTransformInfo.cpp | 4 + .../WebAssembly/WebAssemblyTargetTransformInfo.h | 2 + llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp | 513 +- llvm/lib/Target/X86/AsmParser/X86Operand.h | 36 +- .../Target/X86/Disassembler/X86Disassembler.cpp | 77 +- llvm/lib/Target/X86/MCA/X86CustomBehaviour.h | 2 +- .../Target/X86/MCTargetDesc/X86ATTInstPrinter.cpp | 8 +- llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp | 105 +- .../X86/MCTargetDesc/X86InstPrinterCommon.cpp | 22 +- .../Target/X86/MCTargetDesc/X86InstPrinterCommon.h | 3 +- .../X86/MCTargetDesc/X86InstrRelaxTables.cpp | 165 + .../Target/X86/MCTargetDesc/X86InstrRelaxTables.h | 54 + .../X86/MCTargetDesc/X86IntelInstPrinter.cpp | 4 +- .../Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp | 134 +- llvm/lib/Target/X86/MCTargetDesc/X86MCExpr.h | 1 + .../Target/X86/MCTargetDesc/X86MCTargetDesc.cpp | 91 + llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h | 26 +- .../Target/X86/MCTargetDesc/X86MnemonicTables.cpp | 16 + .../Target/X86/MCTargetDesc/X86WinCOFFStreamer.cpp | 21 +- .../X86/MCTargetDesc/X86WinCOFFTargetStreamer.cpp | 1 + llvm/lib/Target/X86/X86.h | 4 + llvm/lib/Target/X86/X86.td | 279 +- llvm/lib/Target/X86/X86AsmPrinter.cpp | 96 +- llvm/lib/Target/X86/X86AsmPrinter.h | 5 +- llvm/lib/Target/X86/X86AvoidTrailingCall.cpp | 7 +- llvm/lib/Target/X86/X86CallingConv.cpp | 2 +- llvm/lib/Target/X86/X86CmovConversion.cpp | 27 +- llvm/lib/Target/X86/X86DiscriminateMemOps.cpp | 3 +- llvm/lib/Target/X86/X86DomainReassignment.cpp | 14 +- llvm/lib/Target/X86/X86ExpandPseudo.cpp | 11 +- llvm/lib/Target/X86/X86FastISel.cpp | 133 +- llvm/lib/Target/X86/X86FastPreTileConfig.cpp | 709 + llvm/lib/Target/X86/X86FastTileConfig.cpp | 293 +- llvm/lib/Target/X86/X86FixupLEAs.cpp | 3 +- llvm/lib/Target/X86/X86FloatingPoint.cpp | 26 +- llvm/lib/Target/X86/X86FrameLowering.cpp | 136 +- llvm/lib/Target/X86/X86FrameLowering.h | 7 +- llvm/lib/Target/X86/X86ISelDAGToDAG.cpp | 282 +- llvm/lib/Target/X86/X86ISelLowering.cpp | 3225 ++- llvm/lib/Target/X86/X86ISelLowering.h | 58 +- llvm/lib/Target/X86/X86IndirectThunks.cpp | 1 + llvm/lib/Target/X86/X86InsertPrefetch.cpp | 1 + llvm/lib/Target/X86/X86InstCombineIntrinsic.cpp | 49 +- llvm/lib/Target/X86/X86InstrAMX.td | 18 +- llvm/lib/Target/X86/X86InstrAVX512.td | 131 +- llvm/lib/Target/X86/X86InstrArithmetic.td | 8 +- llvm/lib/Target/X86/X86InstrCMovSetCC.td | 8 +- llvm/lib/Target/X86/X86InstrCompiler.td | 85 +- llvm/lib/Target/X86/X86InstrControl.td | 4 +- llvm/lib/Target/X86/X86InstrFPStack.td | 22 +- llvm/lib/Target/X86/X86InstrFoldTables.cpp | 4 +- llvm/lib/Target/X86/X86InstrFormats.td | 6 +- llvm/lib/Target/X86/X86InstrFragmentsSIMD.td | 1 - llvm/lib/Target/X86/X86InstrInfo.cpp | 851 +- llvm/lib/Target/X86/X86InstrInfo.h | 18 +- llvm/lib/Target/X86/X86InstrInfo.td | 111 +- llvm/lib/Target/X86/X86InstrMMX.td | 4 +- llvm/lib/Target/X86/X86InstrSSE.td | 68 +- llvm/lib/Target/X86/X86InstrSystem.td | 16 +- llvm/lib/Target/X86/X86InstrTSX.td | 2 + llvm/lib/Target/X86/X86InstrVecCompiler.td | 6 +- llvm/lib/Target/X86/X86InstrXOP.td | 4 +- llvm/lib/Target/X86/X86InstructionSelector.cpp | 16 +- llvm/lib/Target/X86/X86IntrinsicsInfo.h | 12 +- .../X86/X86LoadValueInjectionLoadHardening.cpp | 3 +- llvm/lib/Target/X86/X86LowerAMXIntrinsics.cpp | 1 + llvm/lib/Target/X86/X86LowerAMXType.cpp | 181 +- llvm/lib/Target/X86/X86MCInstLower.cpp | 41 +- llvm/lib/Target/X86/X86MachineFunctionInfo.cpp | 7 + llvm/lib/Target/X86/X86MachineFunctionInfo.h | 10 +- llvm/lib/Target/X86/X86MacroFusion.cpp | 1 + llvm/lib/Target/X86/X86PadShortFunction.cpp | 11 +- llvm/lib/Target/X86/X86PartialReduction.cpp | 35 +- llvm/lib/Target/X86/X86PreAMXConfig.cpp | 56 +- llvm/lib/Target/X86/X86PreTileConfig.cpp | 53 +- llvm/lib/Target/X86/X86RegisterBankInfo.cpp | 7 +- llvm/lib/Target/X86/X86RegisterBankInfo.h | 2 +- llvm/lib/Target/X86/X86RegisterInfo.cpp | 62 + llvm/lib/Target/X86/X86RegisterInfo.h | 12 + llvm/lib/Target/X86/X86RegisterInfo.td | 15 +- llvm/lib/Target/X86/X86SchedBroadwell.td | 20 +- llvm/lib/Target/X86/X86SchedHaswell.td | 20 +- llvm/lib/Target/X86/X86SchedIceLake.td | 20 +- llvm/lib/Target/X86/X86SchedSandyBridge.td | 40 +- llvm/lib/Target/X86/X86SchedSkylakeClient.td | 26 +- llvm/lib/Target/X86/X86SchedSkylakeServer.td | 32 +- llvm/lib/Target/X86/X86ScheduleBtVer2.td | 4 +- llvm/lib/Target/X86/X86ScheduleSLM.td | 6 +- llvm/lib/Target/X86/X86ScheduleZnver1.td | 106 +- llvm/lib/Target/X86/X86ScheduleZnver2.td | 86 +- llvm/lib/Target/X86/X86SelectionDAGInfo.cpp | 39 +- llvm/lib/Target/X86/X86SelectionDAGInfo.h | 2 +- .../lib/Target/X86/X86SpeculativeLoadHardening.cpp | 31 +- llvm/lib/Target/X86/X86Subtarget.cpp | 12 +- llvm/lib/Target/X86/X86Subtarget.h | 629 +- llvm/lib/Target/X86/X86TargetMachine.cpp | 51 +- llvm/lib/Target/X86/X86TargetMachine.h | 2 +- llvm/lib/Target/X86/X86TargetTransformInfo.cpp | 290 +- llvm/lib/Target/X86/X86TargetTransformInfo.h | 21 +- llvm/lib/Target/X86/X86TileConfig.cpp | 15 +- .../XCore/Disassembler/XCoreDisassembler.cpp | 286 +- .../Target/XCore/MCTargetDesc/XCoreInstPrinter.h | 3 +- llvm/lib/Target/XCore/XCore.h | 1 + llvm/lib/Target/XCore/XCoreAsmPrinter.cpp | 2 +- llvm/lib/Target/XCore/XCoreISelLowering.cpp | 36 +- llvm/lib/Target/XCore/XCoreInstrInfo.td | 2 +- llvm/lib/Target/XCore/XCoreMachineFunctionInfo.cpp | 7 + llvm/lib/Target/XCore/XCoreMachineFunctionInfo.h | 5 + llvm/lib/Target/XCore/XCoreTargetMachine.cpp | 4 +- llvm/lib/Target/XCore/XCoreTargetMachine.h | 4 +- llvm/lib/Testing/Support/Annotations.cpp | 4 +- llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp | 28 +- llvm/lib/ToolDrivers/llvm-lib/Options.td | 16 +- .../AggressiveInstCombine.cpp | 92 +- .../AggressiveInstCombineInternal.h | 46 +- .../AggressiveInstCombine/TruncInstCombine.cpp | 86 +- llvm/lib/Transforms/Coroutines/CoroCleanup.cpp | 81 +- .../Coroutines/CoroConditionalWrapper.cpp | 24 + llvm/lib/Transforms/Coroutines/CoroEarly.cpp | 79 +- llvm/lib/Transforms/Coroutines/CoroElide.cpp | 125 +- llvm/lib/Transforms/Coroutines/CoroFrame.cpp | 177 +- llvm/lib/Transforms/Coroutines/CoroInternal.h | 47 +- llvm/lib/Transforms/Coroutines/CoroSplit.cpp | 377 +- llvm/lib/Transforms/Coroutines/Coroutines.cpp | 193 +- llvm/lib/Transforms/IPO/AlwaysInliner.cpp | 47 +- llvm/lib/Transforms/IPO/ArgumentPromotion.cpp | 1139 +- llvm/lib/Transforms/IPO/Attributor.cpp | 462 +- llvm/lib/Transforms/IPO/AttributorAttributes.cpp | 2060 +- llvm/lib/Transforms/IPO/BlockExtractor.cpp | 11 +- llvm/lib/Transforms/IPO/CalledValuePropagation.cpp | 6 +- llvm/lib/Transforms/IPO/ConstantMerge.cpp | 2 +- llvm/lib/Transforms/IPO/CrossDSOCFI.cpp | 5 - .../lib/Transforms/IPO/DeadArgumentElimination.cpp | 578 +- llvm/lib/Transforms/IPO/ExtractGV.cpp | 1 - llvm/lib/Transforms/IPO/ForceFunctionAttrs.cpp | 2 +- llvm/lib/Transforms/IPO/FunctionAttrs.cpp | 175 +- llvm/lib/Transforms/IPO/FunctionImport.cpp | 19 +- llvm/lib/Transforms/IPO/FunctionSpecialization.cpp | 501 +- llvm/lib/Transforms/IPO/GlobalDCE.cpp | 34 +- llvm/lib/Transforms/IPO/GlobalOpt.cpp | 177 +- llvm/lib/Transforms/IPO/GlobalSplit.cpp | 4 +- llvm/lib/Transforms/IPO/HotColdSplitting.cpp | 26 +- llvm/lib/Transforms/IPO/IPO.cpp | 5 - llvm/lib/Transforms/IPO/IROutliner.cpp | 326 +- llvm/lib/Transforms/IPO/InferFunctionAttrs.cpp | 5 +- llvm/lib/Transforms/IPO/InlineSimple.cpp | 8 +- llvm/lib/Transforms/IPO/Inliner.cpp | 111 +- llvm/lib/Transforms/IPO/Internalize.cpp | 3 - llvm/lib/Transforms/IPO/LoopExtractor.cpp | 5 - llvm/lib/Transforms/IPO/LowerTypeTests.cpp | 21 +- llvm/lib/Transforms/IPO/MergeFunctions.cpp | 48 +- llvm/lib/Transforms/IPO/ModuleInliner.cpp | 25 +- llvm/lib/Transforms/IPO/OpenMPOpt.cpp | 255 +- llvm/lib/Transforms/IPO/PartialInlining.cpp | 16 +- llvm/lib/Transforms/IPO/PassManagerBuilder.cpp | 295 +- llvm/lib/Transforms/IPO/PruneEH.cpp | 5 +- llvm/lib/Transforms/IPO/SCCP.cpp | 1 + llvm/lib/Transforms/IPO/SampleContextTracker.cpp | 123 +- llvm/lib/Transforms/IPO/SampleProfile.cpp | 293 +- llvm/lib/Transforms/IPO/SampleProfileProbe.cpp | 10 +- .../Transforms/IPO/SyntheticCountsPropagation.cpp | 10 +- llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp | 8 +- llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp | 134 +- .../Transforms/InstCombine/InstCombineAddSub.cpp | 115 +- .../Transforms/InstCombine/InstCombineAndOrXor.cpp | 1037 +- .../InstCombine/InstCombineAtomicRMW.cpp | 1 - .../Transforms/InstCombine/InstCombineCalls.cpp | 383 +- .../Transforms/InstCombine/InstCombineCasts.cpp | 185 +- .../Transforms/InstCombine/InstCombineCompares.cpp | 874 +- .../Transforms/InstCombine/InstCombineInternal.h | 41 +- .../InstCombine/InstCombineLoadStoreAlloca.cpp | 13 +- .../InstCombine/InstCombineMulDivRem.cpp | 344 +- .../Transforms/InstCombine/InstCombineNegator.cpp | 14 + llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp | 127 +- .../Transforms/InstCombine/InstCombineSelect.cpp | 913 +- .../Transforms/InstCombine/InstCombineShifts.cpp | 164 +- .../InstCombine/InstCombineSimplifyDemanded.cpp | 202 +- .../InstCombine/InstCombineVectorOps.cpp | 157 +- .../InstCombine/InstructionCombining.cpp | 533 +- .../Instrumentation/AddressSanitizer.cpp | 400 +- .../Transforms/Instrumentation/BoundsChecking.cpp | 5 +- llvm/lib/Transforms/Instrumentation/CGProfile.cpp | 3 - .../Instrumentation/ControlHeightReduction.cpp | 78 +- .../Instrumentation/DataFlowSanitizer.cpp | 237 +- .../Transforms/Instrumentation/GCOVProfiling.cpp | 59 +- .../Instrumentation/HWAddressSanitizer.cpp | 521 +- .../Instrumentation/IndirectCallPromotion.cpp | 73 +- .../Transforms/Instrumentation/InstrOrderFile.cpp | 9 +- .../Transforms/Instrumentation/InstrProfiling.cpp | 59 +- .../Transforms/Instrumentation/Instrumentation.cpp | 10 - .../Instrumentation/MaximumSpanningTree.h | 109 - .../lib/Transforms/Instrumentation/MemProfiler.cpp | 54 +- .../Transforms/Instrumentation/MemorySanitizer.cpp | 155 +- .../Instrumentation/PGOInstrumentation.cpp | 176 +- .../Transforms/Instrumentation/PGOMemOPSizeOpt.cpp | 65 +- .../Transforms/Instrumentation/PoisonChecking.cpp | 6 - .../Instrumentation/SanitizerCoverage.cpp | 23 +- .../Transforms/Instrumentation/ThreadSanitizer.cpp | 84 +- .../Instrumentation/ValueProfileCollector.cpp | 7 +- .../Instrumentation/ValueProfileCollector.h | 2 +- .../Instrumentation/ValueProfilePlugins.inc | 1 + llvm/lib/Transforms/ObjCARC/ObjCARC.cpp | 1 - llvm/lib/Transforms/ObjCARC/ObjCARC.h | 1 - llvm/lib/Transforms/ObjCARC/ObjCARCAPElim.cpp | 5 +- llvm/lib/Transforms/ObjCARC/ObjCARCContract.cpp | 9 +- llvm/lib/Transforms/ObjCARC/ObjCARCExpand.cpp | 2 +- llvm/lib/Transforms/Scalar/ADCE.cpp | 1 - .../Transforms/Scalar/AlignmentFromAssumptions.cpp | 7 +- llvm/lib/Transforms/Scalar/AnnotationRemarks.cpp | 3 - llvm/lib/Transforms/Scalar/CallSiteSplitting.cpp | 13 +- llvm/lib/Transforms/Scalar/ConstantHoisting.cpp | 1 + .../Transforms/Scalar/ConstraintElimination.cpp | 754 +- .../Scalar/CorrelatedValuePropagation.cpp | 110 +- llvm/lib/Transforms/Scalar/DFAJumpThreading.cpp | 157 +- .../lib/Transforms/Scalar/DeadStoreElimination.cpp | 138 +- llvm/lib/Transforms/Scalar/EarlyCSE.cpp | 25 +- llvm/lib/Transforms/Scalar/FlattenCFGPass.cpp | 2 - llvm/lib/Transforms/Scalar/Float2Int.cpp | 207 +- llvm/lib/Transforms/Scalar/GVN.cpp | 231 +- llvm/lib/Transforms/Scalar/GVNHoist.cpp | 16 +- llvm/lib/Transforms/Scalar/GVNSink.cpp | 30 +- llvm/lib/Transforms/Scalar/GuardWidening.cpp | 3 +- llvm/lib/Transforms/Scalar/IVUsersPrinter.cpp | 1 - llvm/lib/Transforms/Scalar/IndVarSimplify.cpp | 15 +- .../Scalar/InductiveRangeCheckElimination.cpp | 34 +- llvm/lib/Transforms/Scalar/InferAddressSpaces.cpp | 72 +- llvm/lib/Transforms/Scalar/InstSimplifyPass.cpp | 6 +- llvm/lib/Transforms/Scalar/JumpThreading.cpp | 142 +- llvm/lib/Transforms/Scalar/LICM.cpp | 482 +- .../Scalar/LoopAccessAnalysisPrinter.cpp | 1 + llvm/lib/Transforms/Scalar/LoopBoundSplit.cpp | 26 +- llvm/lib/Transforms/Scalar/LoopDataPrefetch.cpp | 18 +- llvm/lib/Transforms/Scalar/LoopDeletion.cpp | 12 +- llvm/lib/Transforms/Scalar/LoopDistribute.cpp | 15 +- llvm/lib/Transforms/Scalar/LoopFlatten.cpp | 14 +- llvm/lib/Transforms/Scalar/LoopFuse.cpp | 15 +- llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp | 64 +- llvm/lib/Transforms/Scalar/LoopInstSimplify.cpp | 13 +- llvm/lib/Transforms/Scalar/LoopInterchange.cpp | 200 +- llvm/lib/Transforms/Scalar/LoopLoadElimination.cpp | 14 +- llvm/lib/Transforms/Scalar/LoopPassManager.cpp | 10 +- llvm/lib/Transforms/Scalar/LoopPredication.cpp | 5 +- llvm/lib/Transforms/Scalar/LoopRerollPass.cpp | 11 +- llvm/lib/Transforms/Scalar/LoopRotation.cpp | 13 +- llvm/lib/Transforms/Scalar/LoopSimplifyCFG.cpp | 26 +- llvm/lib/Transforms/Scalar/LoopSink.cpp | 91 +- llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp | 664 +- .../lib/Transforms/Scalar/LoopUnrollAndJamPass.cpp | 30 +- llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp | 57 +- llvm/lib/Transforms/Scalar/LoopUnswitch.cpp | 1774 -- llvm/lib/Transforms/Scalar/LoopVersioningLICM.cpp | 2 - llvm/lib/Transforms/Scalar/LowerAtomic.cpp | 177 - llvm/lib/Transforms/Scalar/LowerAtomicPass.cpp | 99 + .../Transforms/Scalar/LowerConstantIntrinsics.cpp | 18 +- .../lib/Transforms/Scalar/LowerExpectIntrinsic.cpp | 12 +- llvm/lib/Transforms/Scalar/LowerGuardIntrinsic.cpp | 11 +- .../Transforms/Scalar/LowerMatrixIntrinsics.cpp | 57 +- .../Transforms/Scalar/LowerWidenableCondition.cpp | 13 +- llvm/lib/Transforms/Scalar/MakeGuardsExplicit.cpp | 4 +- llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp | 187 +- llvm/lib/Transforms/Scalar/MergeICmps.cpp | 59 +- .../Transforms/Scalar/MergedLoadStoreMotion.cpp | 6 +- llvm/lib/Transforms/Scalar/NewGVN.cpp | 46 +- .../Transforms/Scalar/PartiallyInlineLibCalls.cpp | 5 +- llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp | 3 +- llvm/lib/Transforms/Scalar/Reassociate.cpp | 7 +- llvm/lib/Transforms/Scalar/Reg2Mem.cpp | 2 - .../Transforms/Scalar/RewriteStatepointsForGC.cpp | 489 +- llvm/lib/Transforms/Scalar/SCCP.cpp | 105 +- llvm/lib/Transforms/Scalar/SROA.cpp | 75 +- llvm/lib/Transforms/Scalar/Scalar.cpp | 9 +- .../Transforms/Scalar/ScalarizeMaskedMemIntrin.cpp | 7 +- llvm/lib/Transforms/Scalar/Scalarizer.cpp | 103 +- .../Scalar/SeparateConstOffsetFromGEP.cpp | 1 - llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp | 121 +- llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp | 14 +- llvm/lib/Transforms/Scalar/Sink.cpp | 7 +- .../lib/Transforms/Scalar/SpeculativeExecution.cpp | 6 +- .../Scalar/StraightLineStrengthReduce.cpp | 19 +- llvm/lib/Transforms/Scalar/StructurizeCFG.cpp | 67 +- llvm/lib/Transforms/Scalar/TLSVariableHoist.cpp | 306 + .../Transforms/Scalar/TailRecursionElimination.cpp | 15 +- .../lib/Transforms/Scalar/WarnMissedTransforms.cpp | 2 +- llvm/lib/Transforms/Utils/AMDGPUEmitPrintf.cpp | 3 - llvm/lib/Transforms/Utils/ASanStackFrameLayout.cpp | 1 - llvm/lib/Transforms/Utils/AddDiscriminators.cpp | 4 +- llvm/lib/Transforms/Utils/AssumeBundleBuilder.cpp | 1 + llvm/lib/Transforms/Utils/BasicBlockUtils.cpp | 8 +- llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp | 15 +- llvm/lib/Transforms/Utils/BuildLibCalls.cpp | 406 +- llvm/lib/Transforms/Utils/CallGraphUpdater.cpp | 3 + llvm/lib/Transforms/Utils/CallPromotionUtils.cpp | 4 +- llvm/lib/Transforms/Utils/CanonicalizeAliases.cpp | 3 +- .../Transforms/Utils/CanonicalizeFreezeInLoops.cpp | 1 - llvm/lib/Transforms/Utils/CloneFunction.cpp | 106 +- llvm/lib/Transforms/Utils/CloneModule.cpp | 5 +- llvm/lib/Transforms/Utils/CodeExtractor.cpp | 24 +- llvm/lib/Transforms/Utils/CodeLayout.cpp | 28 +- llvm/lib/Transforms/Utils/CtorUtils.cpp | 65 +- llvm/lib/Transforms/Utils/Debugify.cpp | 184 +- llvm/lib/Transforms/Utils/DemoteRegToStack.cpp | 3 +- llvm/lib/Transforms/Utils/Evaluator.cpp | 109 +- llvm/lib/Transforms/Utils/FixIrreducible.cpp | 9 + llvm/lib/Transforms/Utils/FunctionImportUtils.cpp | 2 - llvm/lib/Transforms/Utils/GlobalStatus.cpp | 32 +- llvm/lib/Transforms/Utils/InjectTLIMappings.cpp | 1 - llvm/lib/Transforms/Utils/InlineFunction.cpp | 77 +- llvm/lib/Transforms/Utils/IntegerDivision.cpp | 1 - llvm/lib/Transforms/Utils/LCSSA.cpp | 3 +- llvm/lib/Transforms/Utils/LibCallsShrinkWrap.cpp | 2 - llvm/lib/Transforms/Utils/Local.cpp | 77 +- llvm/lib/Transforms/Utils/LoopPeel.cpp | 122 +- llvm/lib/Transforms/Utils/LoopRotationUtils.cpp | 19 +- llvm/lib/Transforms/Utils/LoopSimplify.cpp | 9 +- llvm/lib/Transforms/Utils/LoopUnroll.cpp | 4 +- llvm/lib/Transforms/Utils/LoopUnrollAndJam.cpp | 4 +- llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp | 47 +- llvm/lib/Transforms/Utils/LoopUtils.cpp | 85 +- llvm/lib/Transforms/Utils/LoopVersioning.cpp | 7 +- llvm/lib/Transforms/Utils/LowerAtomic.cpp | 93 + llvm/lib/Transforms/Utils/LowerGlobalDtors.cpp | 221 + llvm/lib/Transforms/Utils/LowerInvoke.cpp | 2 - llvm/lib/Transforms/Utils/LowerMemIntrinsics.cpp | 217 +- llvm/lib/Transforms/Utils/LowerSwitch.cpp | 43 +- llvm/lib/Transforms/Utils/MemoryTaggingSupport.cpp | 195 + llvm/lib/Transforms/Utils/MisExpect.cpp | 249 + llvm/lib/Transforms/Utils/ModuleUtils.cpp | 12 +- llvm/lib/Transforms/Utils/PredicateInfo.cpp | 8 - .../Transforms/Utils/PromoteMemoryToRegister.cpp | 8 +- .../Transforms/Utils/RelLookupTableConverter.cpp | 27 +- llvm/lib/Transforms/Utils/SCCPSolver.cpp | 204 +- llvm/lib/Transforms/Utils/SSAUpdater.cpp | 3 +- .../Transforms/Utils/SampleProfileInference.cpp | 394 +- .../Utils/SampleProfileLoaderBaseUtil.cpp | 10 +- llvm/lib/Transforms/Utils/SanitizerStats.cpp | 1 - .../Transforms/Utils/ScalarEvolutionExpander.cpp | 258 +- llvm/lib/Transforms/Utils/SimplifyCFG.cpp | 818 +- llvm/lib/Transforms/Utils/SimplifyIndVar.cpp | 18 +- llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp | 665 +- llvm/lib/Transforms/Utils/SizeOpts.cpp | 4 +- llvm/lib/Transforms/Utils/StripGCRelocates.cpp | 4 +- llvm/lib/Transforms/Utils/SymbolRewriter.cpp | 1 - llvm/lib/Transforms/Utils/UnifyLoopExits.cpp | 48 +- llvm/lib/Transforms/Utils/Utils.cpp | 1 + llvm/lib/Transforms/Utils/VNCoercion.cpp | 124 +- .../Transforms/Vectorize/LoadStoreVectorizer.cpp | 19 +- .../Vectorize/LoopVectorizationLegality.cpp | 133 +- .../Vectorize/LoopVectorizationPlanner.h | 22 +- llvm/lib/Transforms/Vectorize/LoopVectorize.cpp | 2149 +- llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp | 4378 ++-- llvm/lib/Transforms/Vectorize/VPRecipeBuilder.h | 12 +- llvm/lib/Transforms/Vectorize/VPlan.cpp | 1161 +- llvm/lib/Transforms/Vectorize/VPlan.h | 592 +- llvm/lib/Transforms/Vectorize/VPlanHCFGBuilder.cpp | 135 +- llvm/lib/Transforms/Vectorize/VPlanHCFGBuilder.h | 10 +- llvm/lib/Transforms/Vectorize/VPlanLoopInfo.h | 44 - llvm/lib/Transforms/Vectorize/VPlanPredicator.cpp | 248 - llvm/lib/Transforms/Vectorize/VPlanPredicator.h | 74 - llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp | 840 + llvm/lib/Transforms/Vectorize/VPlanSLP.cpp | 15 +- llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp | 114 +- llvm/lib/Transforms/Vectorize/VPlanTransforms.h | 16 +- llvm/lib/Transforms/Vectorize/VPlanValue.h | 24 +- llvm/lib/Transforms/Vectorize/VPlanVerifier.cpp | 55 +- llvm/lib/Transforms/Vectorize/VectorCombine.cpp | 379 +- llvm/lib/Transforms/Vectorize/Vectorize.cpp | 1 - llvm/lib/WindowsDriver/MSVCPaths.cpp | 719 + llvm/lib/WindowsManifest/WindowsManifestMerger.cpp | 4 +- llvm/lib/XRay/FDRTraceWriter.cpp | 2 +- llvm/tools/bugpoint/CrashDebugger.cpp | 4 +- llvm/tools/bugpoint/ExecutionDriver.cpp | 8 +- llvm/tools/bugpoint/OptimizerDriver.cpp | 2 +- llvm/tools/bugpoint/bugpoint.cpp | 12 +- llvm/tools/llc/llc.cpp | 42 +- llvm/tools/lli/lli.cpp | 158 +- llvm/tools/llvm-ar/llvm-ar.cpp | 169 +- llvm/tools/llvm-cov/CodeCoverage.cpp | 68 +- llvm/tools/llvm-cov/CoverageViewOptions.h | 2 + llvm/tools/llvm-cov/SourceCoverageViewHTML.cpp | 42 +- llvm/tools/llvm-cov/TestingSupport.cpp | 1 + llvm/tools/llvm-cxxdump/llvm-cxxdump.cpp | 2 +- llvm/tools/llvm-cxxfilt/Opts.td | 2 +- llvm/tools/llvm-cxxfilt/llvm-cxxfilt.cpp | 2 +- llvm/tools/llvm-dis/llvm-dis.cpp | 12 +- llvm/tools/llvm-dwarfdump/Statistics.cpp | 18 +- llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp | 93 +- llvm/tools/llvm-dwp/llvm-dwp.cpp | 17 +- llvm/tools/llvm-extract/llvm-extract.cpp | 21 +- llvm/tools/llvm-link/llvm-link.cpp | 24 +- llvm/tools/llvm-lto/llvm-lto.cpp | 16 +- llvm/tools/llvm-lto2/llvm-lto2.cpp | 57 +- llvm/tools/llvm-mc/llvm-mc.cpp | 4 +- llvm/tools/llvm-mca/CodeRegionGenerator.cpp | 9 +- llvm/tools/llvm-mca/Views/InstructionInfoView.cpp | 4 +- llvm/tools/llvm-mca/Views/InstructionView.h | 3 +- llvm/tools/llvm-mca/Views/SchedulerStatistics.cpp | 8 +- llvm/tools/llvm-mca/llvm-mca.cpp | 31 +- llvm/tools/llvm-modextract/llvm-modextract.cpp | 1 + llvm/tools/llvm-nm/Opts.td | 11 +- llvm/tools/llvm-nm/llvm-nm.cpp | 956 +- llvm/tools/llvm-objcopy/BitcodeStripOpts.td | 8 +- llvm/tools/llvm-objcopy/COFF/COFFConfig.h | 27 - llvm/tools/llvm-objcopy/COFF/COFFObjcopy.cpp | 297 - llvm/tools/llvm-objcopy/COFF/COFFObjcopy.h | 33 - llvm/tools/llvm-objcopy/COFF/Object.cpp | 132 - llvm/tools/llvm-objcopy/COFF/Object.h | 211 - llvm/tools/llvm-objcopy/COFF/Reader.cpp | 226 - llvm/tools/llvm-objcopy/COFF/Reader.h | 41 - llvm/tools/llvm-objcopy/COFF/Writer.cpp | 457 - llvm/tools/llvm-objcopy/COFF/Writer.h | 63 - llvm/tools/llvm-objcopy/CommonConfig.h | 260 - llvm/tools/llvm-objcopy/ConfigManager.cpp | 1432 -- llvm/tools/llvm-objcopy/ConfigManager.h | 80 - llvm/tools/llvm-objcopy/ELF/ELFConfig.h | 38 - llvm/tools/llvm-objcopy/ELF/ELFObjcopy.cpp | 833 - llvm/tools/llvm-objcopy/ELF/ELFObjcopy.h | 40 - llvm/tools/llvm-objcopy/ELF/Object.cpp | 2826 --- llvm/tools/llvm-objcopy/ELF/Object.h | 1113 - llvm/tools/llvm-objcopy/MachO/MachOConfig.h | 43 - .../llvm-objcopy/MachO/MachOLayoutBuilder.cpp | 441 - llvm/tools/llvm-objcopy/MachO/MachOLayoutBuilder.h | 97 - llvm/tools/llvm-objcopy/MachO/MachOObjcopy.cpp | 549 - llvm/tools/llvm-objcopy/MachO/MachOObjcopy.h | 39 - llvm/tools/llvm-objcopy/MachO/MachOReader.cpp | 374 - llvm/tools/llvm-objcopy/MachO/MachOReader.h | 57 - llvm/tools/llvm-objcopy/MachO/MachOWriter.cpp | 748 - llvm/tools/llvm-objcopy/MachO/MachOWriter.h | 71 - llvm/tools/llvm-objcopy/MachO/Object.cpp | 214 - llvm/tools/llvm-objcopy/MachO/Object.h | 374 - llvm/tools/llvm-objcopy/MultiFormatConfig.h | 37 - llvm/tools/llvm-objcopy/ObjcopyOptions.cpp | 1364 ++ llvm/tools/llvm-objcopy/ObjcopyOptions.h | 58 + llvm/tools/llvm-objcopy/ObjcopyOpts.td | 6 +- llvm/tools/llvm-objcopy/llvm-objcopy.cpp | 227 +- llvm/tools/llvm-objcopy/llvm-objcopy.h | 34 - llvm/tools/llvm-objcopy/wasm/Object.cpp | 34 - llvm/tools/llvm-objcopy/wasm/Object.h | 47 - llvm/tools/llvm-objcopy/wasm/Reader.cpp | 33 - llvm/tools/llvm-objcopy/wasm/Reader.h | 31 - llvm/tools/llvm-objcopy/wasm/WasmConfig.h | 21 - llvm/tools/llvm-objcopy/wasm/WasmObjcopy.cpp | 162 - llvm/tools/llvm-objcopy/wasm/WasmObjcopy.h | 32 - llvm/tools/llvm-objcopy/wasm/Writer.cpp | 79 - llvm/tools/llvm-objcopy/wasm/Writer.h | 49 - llvm/tools/llvm-objdump/COFFDump.cpp | 32 +- llvm/tools/llvm-objdump/ELFDump.cpp | 8 +- llvm/tools/llvm-objdump/MachODump.cpp | 69 +- llvm/tools/llvm-objdump/MachODump.h | 1 + llvm/tools/llvm-objdump/ObjdumpOpts.td | 9 + llvm/tools/llvm-objdump/OffloadDump.cpp | 102 + llvm/tools/llvm-objdump/OffloadDump.h | 22 + llvm/tools/llvm-objdump/OtoolOpts.td | 1 - llvm/tools/llvm-objdump/SourcePrinter.cpp | 2 + llvm/tools/llvm-objdump/SourcePrinter.h | 1 + llvm/tools/llvm-objdump/XCOFFDump.cpp | 2 +- llvm/tools/llvm-objdump/llvm-objdump.cpp | 125 +- llvm/tools/llvm-pdbutil/BytesOutputStyle.cpp | 12 +- llvm/tools/llvm-pdbutil/BytesOutputStyle.h | 2 +- llvm/tools/llvm-pdbutil/DumpOutputStyle.cpp | 398 +- llvm/tools/llvm-pdbutil/DumpOutputStyle.h | 2 +- llvm/tools/llvm-pdbutil/ExplainOutputStyle.cpp | 9 +- llvm/tools/llvm-pdbutil/ExplainOutputStyle.h | 3 +- llvm/tools/llvm-pdbutil/FormatUtil.cpp | 258 - llvm/tools/llvm-pdbutil/FormatUtil.h | 141 - llvm/tools/llvm-pdbutil/InputFile.cpp | 510 - llvm/tools/llvm-pdbutil/InputFile.h | 154 - llvm/tools/llvm-pdbutil/LinePrinter.cpp | 335 - llvm/tools/llvm-pdbutil/LinePrinter.h | 167 - llvm/tools/llvm-pdbutil/MinimalSymbolDumper.cpp | 10 +- llvm/tools/llvm-pdbutil/MinimalTypeDumper.cpp | 7 +- llvm/tools/llvm-pdbutil/OutputStyle.h | 5 +- llvm/tools/llvm-pdbutil/PrettyBuiltinDumper.cpp | 4 +- .../llvm-pdbutil/PrettyClassDefinitionDumper.cpp | 3 +- .../PrettyClassLayoutGraphicalDumper.cpp | 3 +- llvm/tools/llvm-pdbutil/PrettyCompilandDumper.cpp | 1 - llvm/tools/llvm-pdbutil/PrettyEnumDumper.cpp | 3 +- .../llvm-pdbutil/PrettyExternalSymbolDumper.cpp | 3 +- llvm/tools/llvm-pdbutil/PrettyFunctionDumper.cpp | 5 +- llvm/tools/llvm-pdbutil/PrettyTypeDumper.cpp | 4 +- llvm/tools/llvm-pdbutil/PrettyTypedefDumper.cpp | 4 +- llvm/tools/llvm-pdbutil/PrettyVariableDumper.cpp | 6 +- llvm/tools/llvm-pdbutil/StreamUtil.cpp | 4 +- llvm/tools/llvm-pdbutil/TypeReferenceTracker.cpp | 6 +- llvm/tools/llvm-pdbutil/TypeReferenceTracker.h | 3 +- llvm/tools/llvm-pdbutil/llvm-pdbutil.cpp | 145 +- llvm/tools/llvm-pdbutil/llvm-pdbutil.h | 3 + llvm/tools/llvm-profdata/llvm-profdata.cpp | 107 +- llvm/tools/llvm-readobj/ARMWinEHPrinter.cpp | 176 +- llvm/tools/llvm-readobj/ARMWinEHPrinter.h | 3 +- llvm/tools/llvm-readobj/ELFDumper.cpp | 196 +- llvm/tools/llvm-readobj/MachODumper.cpp | 53 +- llvm/tools/llvm-readobj/ObjDumper.h | 58 +- llvm/tools/llvm-readobj/Opts.td | 3 +- llvm/tools/llvm-readobj/WasmDumper.cpp | 14 +- llvm/tools/llvm-readobj/XCOFFDumper.cpp | 253 +- llvm/tools/llvm-readobj/llvm-readobj.cpp | 53 +- llvm/tools/llvm-readobj/llvm-readobj.h | 5 +- llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp | 19 +- llvm/tools/llvm-sim/llvm-sim.cpp | 5 +- llvm/tools/llvm-stress/llvm-stress.cpp | 101 +- llvm/tools/llvm-strings/llvm-strings.cpp | 3 +- llvm/tools/llvm-symbolizer/Opts.td | 6 + llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp | 210 +- llvm/tools/llvm-tapi-diff/llvm-tapi-diff.cpp | 1 + llvm/tools/llvm-tli-checker/llvm-tli-checker.cpp | 1 + llvm/tools/llvm-xray/func-id-helper.cpp | 1 + llvm/tools/llvm-xray/func-id-helper.h | 1 + llvm/tools/llvm-xray/xray-graph-diff.cpp | 1 + llvm/tools/opt/NewPMDriver.cpp | 70 +- llvm/tools/opt/NewPMDriver.h | 5 +- llvm/tools/opt/PassPrinters.cpp | 212 - llvm/tools/opt/PassPrinters.h | 40 - llvm/tools/opt/opt.cpp | 122 +- llvm/utils/TableGen/AsmMatcherEmitter.cpp | 3 +- llvm/utils/TableGen/AsmWriterEmitter.cpp | 23 +- llvm/utils/TableGen/AsmWriterInst.cpp | 1 + llvm/utils/TableGen/Attributes.cpp | 3 - llvm/utils/TableGen/CallingConvEmitter.cpp | 139 +- llvm/utils/TableGen/CodeBeadsGen.cpp | 137 - llvm/utils/TableGen/CodeEmitterGen.cpp | 250 +- llvm/utils/TableGen/CodeGenDAGPatterns.cpp | 14 +- llvm/utils/TableGen/CodeGenDAGPatterns.h | 1 - llvm/utils/TableGen/CodeGenInstruction.cpp | 6 +- llvm/utils/TableGen/CodeGenInstruction.h | 3 +- llvm/utils/TableGen/CodeGenIntrinsics.h | 5 +- llvm/utils/TableGen/CodeGenMapTable.cpp | 2 +- llvm/utils/TableGen/CodeGenRegisters.cpp | 38 +- llvm/utils/TableGen/CodeGenRegisters.h | 36 +- llvm/utils/TableGen/CodeGenSchedule.cpp | 1 - llvm/utils/TableGen/CodeGenSchedule.h | 3 - llvm/utils/TableGen/CodeGenTarget.cpp | 24 +- llvm/utils/TableGen/CodeGenTarget.h | 7 +- llvm/utils/TableGen/DAGISelEmitter.cpp | 1 + llvm/utils/TableGen/DAGISelMatcherEmitter.cpp | 2 - llvm/utils/TableGen/DAGISelMatcherGen.cpp | 3 +- llvm/utils/TableGen/DFAEmitter.cpp | 4 +- llvm/utils/TableGen/DFAPacketizerEmitter.cpp | 2 - llvm/utils/TableGen/DXILEmitter.cpp | 374 + llvm/utils/TableGen/DecoderEmitter.cpp | 2705 +++ llvm/utils/TableGen/DirectiveEmitter.cpp | 4 +- llvm/utils/TableGen/DisassemblerEmitter.cpp | 26 +- llvm/utils/TableGen/ExegesisEmitter.cpp | 4 - llvm/utils/TableGen/FastISelEmitter.cpp | 2 +- llvm/utils/TableGen/FixedLenDecoderEmitter.cpp | 2560 --- llvm/utils/TableGen/GICombinerEmitter.cpp | 17 +- llvm/utils/TableGen/GlobalISel/GIMatchDag.cpp | 4 +- llvm/utils/TableGen/GlobalISel/GIMatchTree.h | 4 +- llvm/utils/TableGen/GlobalISelEmitter.cpp | 23 +- llvm/utils/TableGen/InstrInfoEmitter.cpp | 51 +- llvm/utils/TableGen/IntrinsicEmitter.cpp | 81 +- llvm/utils/TableGen/OptParserEmitter.cpp | 2 +- llvm/utils/TableGen/OptRSTEmitter.cpp | 29 +- llvm/utils/TableGen/PseudoLoweringEmitter.cpp | 3 +- llvm/utils/TableGen/RegisterBankEmitter.cpp | 8 +- llvm/utils/TableGen/RegisterInfoEmitter.cpp | 120 +- llvm/utils/TableGen/SearchableTableEmitter.cpp | 4 +- llvm/utils/TableGen/SequenceToOffsetTable.h | 16 +- llvm/utils/TableGen/SubtargetEmitter.cpp | 53 +- llvm/utils/TableGen/SubtargetFeatureInfo.cpp | 66 +- llvm/utils/TableGen/TableGen.cpp | 20 +- llvm/utils/TableGen/TableGenBackends.h | 3 +- llvm/utils/TableGen/VarLenCodeEmitterGen.cpp | 487 + llvm/utils/TableGen/VarLenCodeEmitterGen.h | 66 + .../TableGen/WebAssemblyDisassemblerEmitter.cpp | 18 +- llvm/utils/TableGen/X86DisassemblerTables.cpp | 34 +- llvm/utils/TableGen/X86EVEX2VEXTablesEmitter.cpp | 75 +- llvm/utils/TableGen/X86FoldTablesEmitter.cpp | 266 +- llvm/utils/TableGen/X86MnemonicTables.cpp | 94 + llvm/utils/TableGen/X86RecognizableInstr.cpp | 192 +- llvm/utils/TableGen/X86RecognizableInstr.h | 77 +- openmp/runtime/src/dllexports | 5 +- openmp/runtime/src/include/omp-tools.h.var | 20 +- openmp/runtime/src/include/omp.h.var | 10 +- openmp/runtime/src/include/omp_lib.f90.var | 48 +- openmp/runtime/src/include/omp_lib.h.var | 60 +- openmp/runtime/src/kmp.h | 57 +- openmp/runtime/src/kmp_affinity.cpp | 10 +- openmp/runtime/src/kmp_alloc.cpp | 7 +- openmp/runtime/src/kmp_atomic.cpp | 4 + openmp/runtime/src/kmp_atomic.h | 6 + openmp/runtime/src/kmp_barrier.cpp | 9 +- openmp/runtime/src/kmp_csupport.cpp | 8 +- openmp/runtime/src/kmp_debugger.cpp | 8 +- openmp/runtime/src/kmp_dispatch.cpp | 15 + openmp/runtime/src/kmp_ftn_entry.h | 9 + openmp/runtime/src/kmp_ftn_os.h | 4 + openmp/runtime/src/kmp_global.cpp | 10 +- openmp/runtime/src/kmp_lock.cpp | 2 +- openmp/runtime/src/kmp_os.h | 47 +- openmp/runtime/src/kmp_runtime.cpp | 42 +- openmp/runtime/src/kmp_sched.cpp | 74 +- openmp/runtime/src/kmp_settings.cpp | 17 +- openmp/runtime/src/kmp_stub.cpp | 12 +- openmp/runtime/src/kmp_taskdeps.cpp | 3 + openmp/runtime/src/kmp_taskdeps.h | 9 + openmp/runtime/src/kmp_tasking.cpp | 326 +- openmp/runtime/src/kmp_version.cpp | 10 +- openmp/runtime/src/kmp_wait_release.h | 9 +- openmp/runtime/src/ompt-event-specific.h | 2 +- openmp/runtime/src/ompt-general.cpp | 7 +- openmp/runtime/src/ompt-internal.h | 1 + openmp/runtime/src/ompt-specific.h | 11 + openmp/runtime/src/z_Windows_NT_util.cpp | 21 +- 6117 files changed, 395192 insertions(+), 180296 deletions(-) create mode 100644 clang/include/clang/AST/ASTImportError.h create mode 100644 clang/include/clang/AST/Randstruct.h create mode 100644 clang/include/clang/Analysis/FlowSensitive/MatchSwitch.h create mode 100644 clang/include/clang/Analysis/FlowSensitive/Models/ChromiumCheckModel.h create mode 100644 clang/include/clang/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.h create mode 100644 clang/include/clang/Analysis/FlowSensitive/NoopLattice.h create mode 100644 clang/include/clang/Analysis/FlowSensitive/Solver.h create mode 100644 clang/include/clang/Analysis/FlowSensitive/WatchedLiteralsSolver.h create mode 100644 clang/include/clang/Basic/BuiltinsVE.def create mode 100644 clang/include/clang/Basic/BuiltinsVEVL.gen.def create mode 100644 clang/include/clang/ExtractAPI/API.h create mode 100644 clang/include/clang/ExtractAPI/AvailabilityInfo.h create mode 100644 clang/include/clang/ExtractAPI/DeclarationFragments.h create mode 100644 clang/include/clang/ExtractAPI/FrontendActions.h create mode 100644 clang/include/clang/ExtractAPI/Serialization/SerializerBase.h create mode 100644 clang/include/clang/ExtractAPI/Serialization/SymbolGraphSerializer.h create mode 100644 clang/include/clang/Lex/DependencyDirectivesScanner.h delete mode 100644 clang/include/clang/Lex/DependencyDirectivesSourceMinimizer.h delete mode 100644 clang/include/clang/Lex/PreprocessorExcludedConditionalDirectiveSkipMapping.h create mode 100644 clang/include/clang/Serialization/SourceLocationEncoding.h create mode 100644 clang/include/clang/StaticAnalyzer/Checkers/Taint.h create mode 100644 clang/include/clang/Support/RISCVVIntrinsicUtils.h create mode 100644 clang/include/clang/Testing/TestAST.h create mode 100644 clang/include/clang/Tooling/Inclusions/CSymbolMap.inc create mode 100644 clang/include/clang/Tooling/Inclusions/StandardLibrary.h create mode 100644 clang/include/clang/Tooling/Inclusions/StdSymbolMap.inc create mode 100644 clang/lib/AST/Randstruct.cpp create mode 100644 clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp create mode 100644 clang/lib/Analysis/FlowSensitive/Models/ChromiumCheckModel.cpp create mode 100644 clang/lib/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.cpp create mode 100644 clang/lib/Analysis/FlowSensitive/WatchedLiteralsSolver.cpp create mode 100644 clang/lib/Basic/BuiltinTargetFeatures.h create mode 100644 clang/lib/Basic/Targets/CSKY.cpp create mode 100644 clang/lib/Basic/Targets/CSKY.h create mode 100644 clang/lib/Basic/Targets/DirectX.cpp create mode 100644 clang/lib/Basic/Targets/DirectX.h create mode 100644 clang/lib/CodeGen/CGHLSLRuntime.cpp create mode 100644 clang/lib/CodeGen/CGHLSLRuntime.h create mode 100644 clang/lib/Driver/ToolChains/Arch/CSKY.cpp create mode 100644 clang/lib/Driver/ToolChains/Arch/CSKY.h create mode 100644 clang/lib/Driver/ToolChains/CSKYToolChain.cpp create mode 100644 clang/lib/Driver/ToolChains/CSKYToolChain.h create mode 100644 clang/lib/Driver/ToolChains/HLSL.cpp create mode 100644 clang/lib/Driver/ToolChains/HLSL.h delete mode 100644 clang/lib/Driver/ToolChains/MSVCSetupApi.h create mode 100644 clang/lib/ExtractAPI/API.cpp create mode 100644 clang/lib/ExtractAPI/DeclarationFragments.cpp create mode 100644 clang/lib/ExtractAPI/ExtractAPIConsumer.cpp create mode 100644 clang/lib/ExtractAPI/Serialization/SerializerBase.cpp create mode 100644 clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp create mode 100644 clang/lib/ExtractAPI/TypedefUnderlyingTypeResolver.cpp create mode 100644 clang/lib/ExtractAPI/TypedefUnderlyingTypeResolver.h delete mode 100644 clang/lib/Frontend/ExtractAPIConsumer.cpp create mode 100644 clang/lib/Headers/hlsl.h create mode 100644 clang/lib/Headers/hlsl/hlsl_basic_types.h create mode 100644 clang/lib/Headers/hlsl/hlsl_intrinsics.h create mode 100644 clang/lib/Headers/ppc_wrappers/bmi2intrin.h create mode 100644 clang/lib/Headers/ppc_wrappers/bmiintrin.h create mode 100644 clang/lib/Headers/ppc_wrappers/immintrin.h create mode 100644 clang/lib/Headers/ppc_wrappers/nmmintrin.h create mode 100644 clang/lib/Headers/ppc_wrappers/x86gprintrin.h create mode 100644 clang/lib/Headers/ppc_wrappers/x86intrin.h create mode 100644 clang/lib/Headers/velintrin.h create mode 100644 clang/lib/Headers/velintrin_approx.h create mode 100644 clang/lib/Headers/velintrin_gen.h create mode 100644 clang/lib/Lex/DependencyDirectivesScanner.cpp delete mode 100644 clang/lib/Lex/DependencyDirectivesSourceMinimizer.cpp create mode 100644 clang/lib/Parse/ParseHLSL.cpp create mode 100644 clang/lib/StaticAnalyzer/Checkers/ErrnoChecker.cpp create mode 100644 clang/lib/StaticAnalyzer/Checkers/ErrnoModeling.cpp create mode 100644 clang/lib/StaticAnalyzer/Checkers/ErrnoModeling.h create mode 100644 clang/lib/StaticAnalyzer/Checkers/ErrnoTesterChecker.cpp delete mode 100644 clang/lib/StaticAnalyzer/Checkers/Taint.h create mode 100644 clang/lib/StaticAnalyzer/Checkers/TrustReturnsNonnullChecker.cpp create mode 100644 clang/lib/Support/RISCVVIntrinsicUtils.cpp create mode 100644 clang/lib/Testing/TestAST.cpp create mode 100644 clang/lib/Tooling/Inclusions/StandardLibrary.cpp create mode 100644 compiler-rt/include/orc/c_api.h create mode 100644 compiler-rt/include/profile/MIBEntryDef.inc create mode 100644 compiler-rt/lib/builtins/avr/divmodhi4.S create mode 100644 compiler-rt/lib/builtins/avr/divmodqi4.S create mode 100644 compiler-rt/lib/builtins/avr/exit.S create mode 100644 compiler-rt/lib/builtins/avr/mulhi3.S create mode 100644 compiler-rt/lib/builtins/avr/mulqi3.S create mode 100644 compiler-rt/lib/builtins/avr/udivmodhi4.S create mode 100644 compiler-rt/lib/builtins/avr/udivmodqi4.S create mode 100644 compiler-rt/lib/builtins/truncdfbf2.c create mode 100644 compiler-rt/lib/builtins/truncsfbf2.c create mode 100644 compiler-rt/lib/hwasan/hwasan_preinit.cpp delete mode 100644 compiler-rt/lib/orc/c_api.h create mode 100644 compiler-rt/lib/orc/dlfcn_wrapper.cpp delete mode 100644 compiler-rt/lib/sanitizer_common/sanitizer_openbsd.cpp delete mode 100755 compiler-rt/lib/sanitizer_common/symbolizer/scripts/ar_to_bc.sh create mode 100644 libcxx/include/__algorithm/in_found_result.h create mode 100644 libcxx/include/__algorithm/in_fun_result.h create mode 100644 libcxx/include/__algorithm/in_out_out_result.h create mode 100644 libcxx/include/__algorithm/iterator_operations.h create mode 100644 libcxx/include/__algorithm/make_projected.h create mode 100644 libcxx/include/__algorithm/min_max_result.h create mode 100644 libcxx/include/__algorithm/ranges_adjacent_find.h create mode 100644 libcxx/include/__algorithm/ranges_all_of.h create mode 100644 libcxx/include/__algorithm/ranges_any_of.h create mode 100644 libcxx/include/__algorithm/ranges_binary_search.h create mode 100644 libcxx/include/__algorithm/ranges_copy.h create mode 100644 libcxx/include/__algorithm/ranges_copy_backward.h create mode 100644 libcxx/include/__algorithm/ranges_copy_if.h create mode 100644 libcxx/include/__algorithm/ranges_copy_n.h create mode 100644 libcxx/include/__algorithm/ranges_count.h create mode 100644 libcxx/include/__algorithm/ranges_count_if.h create mode 100644 libcxx/include/__algorithm/ranges_equal.h create mode 100644 libcxx/include/__algorithm/ranges_fill.h create mode 100644 libcxx/include/__algorithm/ranges_fill_n.h create mode 100644 libcxx/include/__algorithm/ranges_find.h create mode 100644 libcxx/include/__algorithm/ranges_find_first_of.h create mode 100644 libcxx/include/__algorithm/ranges_find_if.h create mode 100644 libcxx/include/__algorithm/ranges_find_if_not.h create mode 100644 libcxx/include/__algorithm/ranges_for_each.h create mode 100644 libcxx/include/__algorithm/ranges_for_each_n.h create mode 100644 libcxx/include/__algorithm/ranges_is_partitioned.h create mode 100644 libcxx/include/__algorithm/ranges_is_sorted.h create mode 100644 libcxx/include/__algorithm/ranges_is_sorted_until.h create mode 100644 libcxx/include/__algorithm/ranges_lexicographical_compare.h create mode 100644 libcxx/include/__algorithm/ranges_lower_bound.h create mode 100644 libcxx/include/__algorithm/ranges_max.h create mode 100644 libcxx/include/__algorithm/ranges_max_element.h create mode 100644 libcxx/include/__algorithm/ranges_min.h create mode 100644 libcxx/include/__algorithm/ranges_min_element.h create mode 100644 libcxx/include/__algorithm/ranges_minmax.h create mode 100644 libcxx/include/__algorithm/ranges_minmax_element.h create mode 100644 libcxx/include/__algorithm/ranges_mismatch.h create mode 100644 libcxx/include/__algorithm/ranges_move.h create mode 100644 libcxx/include/__algorithm/ranges_move_backward.h create mode 100644 libcxx/include/__algorithm/ranges_none_of.h create mode 100644 libcxx/include/__algorithm/ranges_replace.h create mode 100644 libcxx/include/__algorithm/ranges_replace_if.h create mode 100644 libcxx/include/__algorithm/ranges_reverse.h create mode 100644 libcxx/include/__algorithm/ranges_sort.h create mode 100644 libcxx/include/__algorithm/ranges_stable_sort.h create mode 100644 libcxx/include/__algorithm/ranges_swap_ranges.h create mode 100644 libcxx/include/__algorithm/ranges_transform.h create mode 100644 libcxx/include/__algorithm/ranges_upper_bound.h create mode 100644 libcxx/include/__assert create mode 100644 libcxx/include/__charconv/tables.h create mode 100644 libcxx/include/__charconv/to_chars_base_10.h create mode 100644 libcxx/include/__chrono/day.h create mode 100644 libcxx/include/__chrono/hh_mm_ss.h create mode 100644 libcxx/include/__chrono/literals.h create mode 100644 libcxx/include/__chrono/month.h create mode 100644 libcxx/include/__chrono/month_weekday.h create mode 100644 libcxx/include/__chrono/monthday.h create mode 100644 libcxx/include/__chrono/weekday.h create mode 100644 libcxx/include/__chrono/year.h create mode 100644 libcxx/include/__chrono/year_month.h create mode 100644 libcxx/include/__chrono/year_month_day.h create mode 100644 libcxx/include/__chrono/year_month_weekday.h create mode 100644 libcxx/include/__format/buffer.h create mode 100644 libcxx/include/__format/concepts.h create mode 100644 libcxx/include/__format/enable_insertable.h create mode 100644 libcxx/include/__format/format_arg_store.h create mode 100644 libcxx/include/__format/formatter_output.h create mode 100644 libcxx/include/__functional/boyer_moore_searcher.h delete mode 100644 libcxx/include/__functional_base create mode 100644 libcxx/include/__fwd/span.h create mode 100644 libcxx/include/__fwd/string_view.h create mode 100644 libcxx/include/__ios/fpos.h create mode 100644 libcxx/include/__iterator/bounded_iter.h create mode 100644 libcxx/include/__iterator/mergeable.h create mode 100644 libcxx/include/__iterator/move_sentinel.h create mode 100644 libcxx/include/__iterator/permutable.h create mode 100644 libcxx/include/__iterator/sortable.h delete mode 100644 libcxx/include/__libcpp_version create mode 100644 libcxx/include/__memory/allocate_at_least.h create mode 100644 libcxx/include/__memory/assume_aligned.h delete mode 100644 libcxx/include/__nullptr create mode 100644 libcxx/include/__random/is_valid.h create mode 100644 libcxx/include/__ranges/filter_view.h create mode 100644 libcxx/include/__ranges/lazy_split_view.h create mode 100644 libcxx/include/__ranges/rbegin.h create mode 100644 libcxx/include/__ranges/rend.h create mode 100644 libcxx/include/__ranges/views.h create mode 100644 libcxx/include/__ranges/zip_view.h delete mode 100644 libcxx/include/__string create mode 100644 libcxx/include/__string/char_traits.h create mode 100644 libcxx/include/__string/extern_template_lists.h create mode 100644 libcxx/include/__type_traits/add_const.h create mode 100644 libcxx/include/__type_traits/add_cv.h create mode 100644 libcxx/include/__type_traits/add_lvalue_reference.h create mode 100644 libcxx/include/__type_traits/add_pointer.h create mode 100644 libcxx/include/__type_traits/add_rvalue_reference.h create mode 100644 libcxx/include/__type_traits/add_volatile.h create mode 100644 libcxx/include/__type_traits/alignment_of.h create mode 100644 libcxx/include/__type_traits/apply_cv.h create mode 100644 libcxx/include/__type_traits/conditional.h create mode 100644 libcxx/include/__type_traits/conjunction.h create mode 100644 libcxx/include/__type_traits/decay.h create mode 100644 libcxx/include/__type_traits/disjunction.h create mode 100644 libcxx/include/__type_traits/enable_if.h create mode 100644 libcxx/include/__type_traits/extent.h create mode 100644 libcxx/include/__type_traits/has_unique_object_representation.h create mode 100644 libcxx/include/__type_traits/has_virtual_destructor.h create mode 100644 libcxx/include/__type_traits/integral_constant.h create mode 100644 libcxx/include/__type_traits/is_abstract.h create mode 100644 libcxx/include/__type_traits/is_aggregate.h create mode 100644 libcxx/include/__type_traits/is_arithmetic.h create mode 100644 libcxx/include/__type_traits/is_array.h create mode 100644 libcxx/include/__type_traits/is_assignable.h create mode 100644 libcxx/include/__type_traits/is_base_of.h create mode 100644 libcxx/include/__type_traits/is_bounded_array.h create mode 100644 libcxx/include/__type_traits/is_callable.h create mode 100644 libcxx/include/__type_traits/is_class.h create mode 100644 libcxx/include/__type_traits/is_compound.h create mode 100644 libcxx/include/__type_traits/is_const.h create mode 100644 libcxx/include/__type_traits/is_constant_evaluated.h create mode 100644 libcxx/include/__type_traits/is_constructible.h create mode 100644 libcxx/include/__type_traits/is_convertible.h create mode 100644 libcxx/include/__type_traits/is_copy_assignable.h create mode 100644 libcxx/include/__type_traits/is_copy_constructible.h create mode 100644 libcxx/include/__type_traits/is_core_convertible.h create mode 100644 libcxx/include/__type_traits/is_default_constructible.h create mode 100644 libcxx/include/__type_traits/is_destructible.h create mode 100644 libcxx/include/__type_traits/is_empty.h create mode 100644 libcxx/include/__type_traits/is_enum.h create mode 100644 libcxx/include/__type_traits/is_final.h create mode 100644 libcxx/include/__type_traits/is_floating_point.h create mode 100644 libcxx/include/__type_traits/is_function.h create mode 100644 libcxx/include/__type_traits/is_fundamental.h create mode 100644 libcxx/include/__type_traits/is_integral.h create mode 100644 libcxx/include/__type_traits/is_literal_type.h create mode 100644 libcxx/include/__type_traits/is_member_function_pointer.h create mode 100644 libcxx/include/__type_traits/is_member_object_pointer.h create mode 100644 libcxx/include/__type_traits/is_member_pointer.h create mode 100644 libcxx/include/__type_traits/is_move_assignable.h create mode 100644 libcxx/include/__type_traits/is_move_constructible.h create mode 100644 libcxx/include/__type_traits/is_nothrow_assignable.h create mode 100644 libcxx/include/__type_traits/is_nothrow_constructible.h create mode 100644 libcxx/include/__type_traits/is_nothrow_copy_assignable.h create mode 100644 libcxx/include/__type_traits/is_nothrow_copy_constructible.h create mode 100644 libcxx/include/__type_traits/is_nothrow_default_constructible.h create mode 100644 libcxx/include/__type_traits/is_nothrow_destructible.h create mode 100644 libcxx/include/__type_traits/is_nothrow_move_assignable.h create mode 100644 libcxx/include/__type_traits/is_nothrow_move_constructible.h create mode 100644 libcxx/include/__type_traits/is_null_pointer.h create mode 100644 libcxx/include/__type_traits/is_object.h create mode 100644 libcxx/include/__type_traits/is_pod.h create mode 100644 libcxx/include/__type_traits/is_pointer.h create mode 100644 libcxx/include/__type_traits/is_polymorphic.h create mode 100644 libcxx/include/__type_traits/is_reference.h create mode 100644 libcxx/include/__type_traits/is_reference_wrapper.h create mode 100644 libcxx/include/__type_traits/is_referenceable.h create mode 100644 libcxx/include/__type_traits/is_same.h create mode 100644 libcxx/include/__type_traits/is_scalar.h create mode 100644 libcxx/include/__type_traits/is_scoped_enum.h create mode 100644 libcxx/include/__type_traits/is_signed.h create mode 100644 libcxx/include/__type_traits/is_standard_layout.h create mode 100644 libcxx/include/__type_traits/is_trivial.h create mode 100644 libcxx/include/__type_traits/is_trivially_assignable.h create mode 100644 libcxx/include/__type_traits/is_trivially_constructible.h create mode 100644 libcxx/include/__type_traits/is_trivially_copy_assignable.h create mode 100644 libcxx/include/__type_traits/is_trivially_copy_constructible.h create mode 100644 libcxx/include/__type_traits/is_trivially_copyable.h create mode 100644 libcxx/include/__type_traits/is_trivially_default_constructible.h create mode 100644 libcxx/include/__type_traits/is_trivially_destructible.h create mode 100644 libcxx/include/__type_traits/is_trivially_move_assignable.h create mode 100644 libcxx/include/__type_traits/is_trivially_move_constructible.h create mode 100644 libcxx/include/__type_traits/is_unbounded_array.h create mode 100644 libcxx/include/__type_traits/is_union.h create mode 100644 libcxx/include/__type_traits/is_unsigned.h create mode 100644 libcxx/include/__type_traits/is_void.h create mode 100644 libcxx/include/__type_traits/is_volatile.h create mode 100644 libcxx/include/__type_traits/negation.h create mode 100644 libcxx/include/__type_traits/rank.h create mode 100644 libcxx/include/__type_traits/remove_all_extents.h create mode 100644 libcxx/include/__type_traits/remove_const.h create mode 100644 libcxx/include/__type_traits/remove_cv.h create mode 100644 libcxx/include/__type_traits/remove_extent.h create mode 100644 libcxx/include/__type_traits/remove_pointer.h create mode 100644 libcxx/include/__type_traits/remove_reference.h create mode 100644 libcxx/include/__type_traits/remove_volatile.h create mode 100644 libcxx/include/__type_traits/type_identity.h create mode 100644 libcxx/include/__type_traits/underlying_type.h create mode 100644 libcxx/include/__type_traits/void_t.h create mode 100644 libcxx/include/__utility/unreachable.h create mode 100644 libcxx/include/cuchar delete mode 100644 libcxx/include/experimental/filesystem delete mode 100644 libcxx/include/module.modulemap create mode 100644 libcxx/include/module.modulemap.in create mode 100644 libcxx/include/stdatomic.h create mode 100644 libcxx/include/uchar.h create mode 100644 libcxx/src/assert.cpp create mode 100644 libcxx/src/legacy_debug_handler.cpp create mode 100644 libunwind/src/Unwind_AIXExtras.cpp create mode 100644 lld/MachO/EhFrame.cpp create mode 100644 lld/MachO/EhFrame.h delete mode 100644 lld/include/lld/Core/AbsoluteAtom.h delete mode 100644 lld/include/lld/Core/ArchiveLibraryFile.h delete mode 100644 lld/include/lld/Core/Atom.h delete mode 100644 lld/include/lld/Core/DefinedAtom.h delete mode 100644 lld/include/lld/Core/Error.h delete mode 100644 lld/include/lld/Core/File.h delete mode 100644 lld/include/lld/Core/Instrumentation.h delete mode 100644 lld/include/lld/Core/LinkingContext.h delete mode 100644 lld/include/lld/Core/Node.h delete mode 100644 lld/include/lld/Core/Pass.h delete mode 100644 lld/include/lld/Core/PassManager.h delete mode 100644 lld/include/lld/Core/Reader.h delete mode 100644 lld/include/lld/Core/Reference.h delete mode 100644 lld/include/lld/Core/Resolver.h delete mode 100644 lld/include/lld/Core/SharedLibraryAtom.h delete mode 100644 lld/include/lld/Core/SharedLibraryFile.h delete mode 100644 lld/include/lld/Core/Simple.h delete mode 100644 lld/include/lld/Core/SymbolTable.h delete mode 100644 lld/include/lld/Core/UndefinedAtom.h delete mode 100644 lld/include/lld/Core/Writer.h create mode 100644 lldb/include/lldb/Core/DebuggerEvents.h create mode 100644 lldb/include/lldb/Interpreter/OptionGroupMemoryTag.h create mode 100644 lldb/include/lldb/Symbol/SymbolFileOnDemand.h create mode 100644 lldb/include/lldb/Target/TraceDumper.h delete mode 100644 lldb/include/lldb/Target/TraceInstructionDumper.h create mode 100644 lldb/include/lldb/Utility/LLDBLog.h delete mode 100644 lldb/include/lldb/Utility/Logging.h delete mode 100644 lldb/include/lldb/Utility/StreamCallback.h create mode 100644 lldb/source/Core/DebuggerEvents.cpp create mode 100644 lldb/source/Interpreter/OptionGroupMemoryTag.cpp create mode 100644 lldb/source/Plugins/Language/CPlusPlus/LibCxxSpan.cpp create mode 100644 lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParser.cpp create mode 100644 lldb/source/Plugins/SymbolVendor/PECOFF/SymbolVendorPECOFF.cpp create mode 100644 lldb/source/Plugins/SymbolVendor/PECOFF/SymbolVendorPECOFF.h delete mode 100644 lldb/source/Plugins/Trace/common/TraceJSONStructs.cpp delete mode 100644 lldb/source/Plugins/Trace/common/TraceJSONStructs.h delete mode 100644 lldb/source/Plugins/Trace/common/TraceSessionFileParser.cpp delete mode 100644 lldb/source/Plugins/Trace/common/TraceSessionFileParser.h delete mode 100644 lldb/source/Plugins/Trace/common/TraceSessionSaver.cpp delete mode 100644 lldb/source/Plugins/Trace/common/TraceSessionSaver.h delete mode 100644 lldb/source/Plugins/Trace/intel-pt/IntelPTDecoder.cpp delete mode 100644 lldb/source/Plugins/Trace/intel-pt/IntelPTDecoder.h create mode 100644 lldb/source/Plugins/Trace/intel-pt/LibiptDecoder.cpp create mode 100644 lldb/source/Plugins/Trace/intel-pt/LibiptDecoder.h create mode 100644 lldb/source/Plugins/Trace/intel-pt/PerfContextSwitchDecoder.cpp create mode 100644 lldb/source/Plugins/Trace/intel-pt/PerfContextSwitchDecoder.h create mode 100644 lldb/source/Plugins/Trace/intel-pt/TaskTimer.cpp create mode 100644 lldb/source/Plugins/Trace/intel-pt/TaskTimer.h create mode 100644 lldb/source/Plugins/Trace/intel-pt/ThreadDecoder.cpp create mode 100644 lldb/source/Plugins/Trace/intel-pt/ThreadDecoder.h create mode 100644 lldb/source/Plugins/Trace/intel-pt/TraceIntelPTBundleLoader.cpp create mode 100644 lldb/source/Plugins/Trace/intel-pt/TraceIntelPTBundleLoader.h create mode 100644 lldb/source/Plugins/Trace/intel-pt/TraceIntelPTBundleSaver.cpp create mode 100644 lldb/source/Plugins/Trace/intel-pt/TraceIntelPTBundleSaver.h create mode 100644 lldb/source/Plugins/Trace/intel-pt/TraceIntelPTMultiCpuDecoder.cpp create mode 100644 lldb/source/Plugins/Trace/intel-pt/TraceIntelPTMultiCpuDecoder.h delete mode 100644 lldb/source/Plugins/Trace/intel-pt/TraceIntelPTSessionFileParser.cpp delete mode 100644 lldb/source/Plugins/Trace/intel-pt/TraceIntelPTSessionFileParser.h delete mode 100644 lldb/source/Plugins/Trace/intel-pt/TraceIntelPTSessionSaver.cpp delete mode 100644 lldb/source/Plugins/Trace/intel-pt/TraceIntelPTSessionSaver.h create mode 100644 lldb/source/Symbol/SymbolFileOnDemand.cpp create mode 100644 lldb/source/Target/TraceDumper.cpp delete mode 100644 lldb/source/Target/TraceInstructionDumper.cpp create mode 100644 lldb/source/Utility/LLDBLog.cpp delete mode 100644 lldb/source/Utility/Logging.cpp delete mode 100644 lldb/source/Utility/StreamCallback.cpp delete mode 100644 llvm/include/llvm-c/Transforms/Coroutines.h create mode 100644 llvm/include/llvm-c/blake3.h create mode 100644 llvm/include/llvm/ADT/AddressRanges.h create mode 100644 llvm/include/llvm/Analysis/ScalarFuncs.def create mode 100644 llvm/include/llvm/Analysis/TensorSpec.h create mode 100644 llvm/include/llvm/BinaryFormat/DXContainer.h create mode 100644 llvm/include/llvm/BinaryFormat/ELFRelocs/LoongArch.def create mode 100644 llvm/include/llvm/BinaryFormat/GOFF.h create mode 100644 llvm/include/llvm/Bitstream/BitCodeEnums.h create mode 100644 llvm/include/llvm/CodeGen/BasicBlockSectionsProfileReader.h create mode 100644 llvm/include/llvm/CodeGen/CFIFixup.h delete mode 100644 llvm/include/llvm/CodeGen/GlobalISel/RegisterBank.h delete mode 100644 llvm/include/llvm/CodeGen/GlobalISel/RegisterBankInfo.h create mode 100644 llvm/include/llvm/CodeGen/RegisterBank.h create mode 100644 llvm/include/llvm/CodeGen/RegisterBankInfo.h create mode 100644 llvm/include/llvm/DebugInfo/DWARF/DWARFTypePrinter.h create mode 100644 llvm/include/llvm/DebugInfo/GSYM/ExtractRanges.h delete mode 100644 llvm/include/llvm/DebugInfo/GSYM/Range.h create mode 100644 llvm/include/llvm/DebugInfo/PDB/Native/FormatUtil.h create mode 100644 llvm/include/llvm/DebugInfo/PDB/Native/InputFile.h create mode 100644 llvm/include/llvm/DebugInfo/PDB/Native/LinePrinter.h create mode 100644 llvm/include/llvm/DebugInfo/Symbolize/DIFetcher.h create mode 100644 llvm/include/llvm/DebugInfo/Symbolize/Markup.h create mode 100644 llvm/include/llvm/DebugInfo/Symbolize/MarkupFilter.h create mode 100644 llvm/include/llvm/DebugInfo/Symbolize/SymbolizableObjectFile.h create mode 100644 llvm/include/llvm/Debuginfod/DIFetcher.h create mode 100644 llvm/include/llvm/Demangle/ItaniumNodes.def create mode 100644 llvm/include/llvm/ExecutionEngine/JITLink/DWARFRecordSectionSplitter.h create mode 100644 llvm/include/llvm/ExecutionEngine/Orc/MemoryMapper.h delete mode 100644 llvm/include/llvm/IR/AttributesAMDGPU.td create mode 100644 llvm/include/llvm/IR/ConstantFold.h create mode 100644 llvm/include/llvm/IR/FMF.h create mode 100644 llvm/include/llvm/IR/IntrinsicsDirectX.td create mode 100644 llvm/include/llvm/IR/IntrinsicsSPIRV.td create mode 100644 llvm/include/llvm/IR/VectorBuilder.h create mode 100644 llvm/include/llvm/MC/MCDXContainerStreamer.h create mode 100644 llvm/include/llvm/MC/MCDXContainerWriter.h create mode 100644 llvm/include/llvm/MC/MCDecoderOps.h delete mode 100644 llvm/include/llvm/MC/MCFixedLenDisassembler.h create mode 100644 llvm/include/llvm/MC/MCSPIRVObjectWriter.h create mode 100644 llvm/include/llvm/MC/MCSPIRVStreamer.h create mode 100644 llvm/include/llvm/MC/MCSectionDXContainer.h create mode 100644 llvm/include/llvm/MC/MCSectionSPIRV.h create mode 100644 llvm/include/llvm/MCA/IncrementalSourceMgr.h create mode 100644 llvm/include/llvm/ObjCopy/COFF/COFFConfig.h create mode 100644 llvm/include/llvm/ObjCopy/COFF/COFFObjcopy.h create mode 100644 llvm/include/llvm/ObjCopy/CommonConfig.h create mode 100644 llvm/include/llvm/ObjCopy/ConfigManager.h create mode 100644 llvm/include/llvm/ObjCopy/ELF/ELFConfig.h create mode 100644 llvm/include/llvm/ObjCopy/ELF/ELFObjcopy.h create mode 100644 llvm/include/llvm/ObjCopy/MachO/MachOConfig.h create mode 100644 llvm/include/llvm/ObjCopy/MachO/MachOObjcopy.h create mode 100644 llvm/include/llvm/ObjCopy/MultiFormatConfig.h create mode 100644 llvm/include/llvm/ObjCopy/ObjCopy.h create mode 100644 llvm/include/llvm/ObjCopy/XCOFF/XCOFFConfig.h create mode 100644 llvm/include/llvm/ObjCopy/XCOFF/XCOFFObjcopy.h create mode 100644 llvm/include/llvm/ObjCopy/wasm/WasmConfig.h create mode 100644 llvm/include/llvm/ObjCopy/wasm/WasmObjcopy.h create mode 100644 llvm/include/llvm/Object/DXContainer.h create mode 100644 llvm/include/llvm/Object/OffloadBinary.h create mode 100644 llvm/include/llvm/ObjectYAML/DXContainerYAML.h create mode 100644 llvm/include/llvm/ObjectYAML/OffloadYAML.h create mode 100644 llvm/include/llvm/ProfileData/MIBEntryDef.inc create mode 100644 llvm/include/llvm/ProfileData/MemProf.h create mode 100644 llvm/include/llvm/Support/BLAKE3.h create mode 100644 llvm/include/llvm/Support/CSKYAttributeParser.h create mode 100644 llvm/include/llvm/Support/CSKYAttributes.h create mode 100644 llvm/include/llvm/Support/CSKYTargetParser.def create mode 100644 llvm/include/llvm/Support/CSKYTargetParser.h create mode 100644 llvm/include/llvm/TableGen/Parser.h delete mode 100644 llvm/include/llvm/Transforms/Coroutines.h create mode 100644 llvm/include/llvm/Transforms/Coroutines/CoroConditionalWrapper.h delete mode 100644 llvm/include/llvm/Transforms/Scalar/LowerAtomic.h create mode 100644 llvm/include/llvm/Transforms/Scalar/LowerAtomicPass.h create mode 100644 llvm/include/llvm/Transforms/Scalar/TLSVariableHoist.h create mode 100644 llvm/include/llvm/Transforms/Utils/LowerAtomic.h create mode 100644 llvm/include/llvm/Transforms/Utils/LowerGlobalDtors.h create mode 100644 llvm/include/llvm/Transforms/Utils/MemoryTaggingSupport.h create mode 100644 llvm/include/llvm/Transforms/Utils/MisExpect.h create mode 100644 llvm/include/llvm/WindowsDriver/MSVCPaths.h create mode 100644 llvm/include/llvm/WindowsDriver/MSVCSetupApi.h create mode 100644 llvm/lib/Analysis/TensorSpec.cpp create mode 100644 llvm/lib/BinaryFormat/COFF.cpp create mode 100644 llvm/lib/CodeGen/BasicBlockSectionsProfileReader.cpp create mode 100644 llvm/lib/CodeGen/CFIFixup.cpp delete mode 100644 llvm/lib/CodeGen/GlobalISel/RegisterBank.cpp delete mode 100644 llvm/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp create mode 100644 llvm/lib/CodeGen/JMCInstrumenter.cpp create mode 100644 llvm/lib/CodeGen/RegisterBank.cpp create mode 100644 llvm/lib/CodeGen/RegisterBankInfo.cpp create mode 100644 llvm/lib/CodeGen/SelectOptimize.cpp create mode 100644 llvm/lib/DebugInfo/DWARF/DWARFTypePrinter.cpp create mode 100644 llvm/lib/DebugInfo/GSYM/ExtractRanges.cpp delete mode 100644 llvm/lib/DebugInfo/GSYM/Range.cpp create mode 100644 llvm/lib/DebugInfo/PDB/Native/FormatUtil.cpp create mode 100644 llvm/lib/DebugInfo/PDB/Native/InputFile.cpp create mode 100644 llvm/lib/DebugInfo/PDB/Native/LinePrinter.cpp create mode 100644 llvm/lib/DebugInfo/Symbolize/DIFetcher.cpp create mode 100644 llvm/lib/DebugInfo/Symbolize/Markup.cpp create mode 100644 llvm/lib/DebugInfo/Symbolize/MarkupFilter.cpp delete mode 100644 llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.h create mode 100644 llvm/lib/Debuginfod/DIFetcher.cpp create mode 100644 llvm/lib/ExecutionEngine/JITLink/DWARFRecordSectionSplitter.cpp create mode 100644 llvm/lib/ExecutionEngine/Orc/MemoryMapper.cpp delete mode 100644 llvm/lib/IR/ConstantFold.h create mode 100644 llvm/lib/IR/VectorBuilder.cpp create mode 100644 llvm/lib/MC/MCDXContainerStreamer.cpp create mode 100644 llvm/lib/MC/MCDXContainerWriter.cpp create mode 100644 llvm/lib/MC/MCSPIRVStreamer.cpp create mode 100644 llvm/lib/MC/MCSectionDXContainer.cpp create mode 100644 llvm/lib/MC/SPIRVObjectWriter.cpp create mode 100644 llvm/lib/MCA/IncrementalSourceMgr.cpp create mode 100644 llvm/lib/ObjCopy/Archive.cpp create mode 100644 llvm/lib/ObjCopy/Archive.h create mode 100644 llvm/lib/ObjCopy/COFF/COFFObjcopy.cpp create mode 100644 llvm/lib/ObjCopy/COFF/COFFObject.cpp create mode 100644 llvm/lib/ObjCopy/COFF/COFFObject.h create mode 100644 llvm/lib/ObjCopy/COFF/COFFReader.cpp create mode 100644 llvm/lib/ObjCopy/COFF/COFFReader.h create mode 100644 llvm/lib/ObjCopy/COFF/COFFWriter.cpp create mode 100644 llvm/lib/ObjCopy/COFF/COFFWriter.h create mode 100644 llvm/lib/ObjCopy/CommonConfig.cpp create mode 100644 llvm/lib/ObjCopy/ConfigManager.cpp create mode 100644 llvm/lib/ObjCopy/ELF/ELFObjcopy.cpp create mode 100644 llvm/lib/ObjCopy/ELF/ELFObject.cpp create mode 100644 llvm/lib/ObjCopy/ELF/ELFObject.h create mode 100644 llvm/lib/ObjCopy/MachO/MachOLayoutBuilder.cpp create mode 100644 llvm/lib/ObjCopy/MachO/MachOLayoutBuilder.h create mode 100644 llvm/lib/ObjCopy/MachO/MachOObjcopy.cpp create mode 100644 llvm/lib/ObjCopy/MachO/MachOObject.cpp create mode 100644 llvm/lib/ObjCopy/MachO/MachOObject.h create mode 100644 llvm/lib/ObjCopy/MachO/MachOReader.cpp create mode 100644 llvm/lib/ObjCopy/MachO/MachOReader.h create mode 100644 llvm/lib/ObjCopy/MachO/MachOWriter.cpp create mode 100644 llvm/lib/ObjCopy/MachO/MachOWriter.h create mode 100644 llvm/lib/ObjCopy/ObjCopy.cpp create mode 100644 llvm/lib/ObjCopy/XCOFF/XCOFFObjcopy.cpp create mode 100644 llvm/lib/ObjCopy/XCOFF/XCOFFObject.h create mode 100644 llvm/lib/ObjCopy/XCOFF/XCOFFReader.cpp create mode 100644 llvm/lib/ObjCopy/XCOFF/XCOFFReader.h create mode 100644 llvm/lib/ObjCopy/XCOFF/XCOFFWriter.cpp create mode 100644 llvm/lib/ObjCopy/XCOFF/XCOFFWriter.h create mode 100644 llvm/lib/ObjCopy/wasm/WasmObjcopy.cpp create mode 100644 llvm/lib/ObjCopy/wasm/WasmObject.cpp create mode 100644 llvm/lib/ObjCopy/wasm/WasmObject.h create mode 100644 llvm/lib/ObjCopy/wasm/WasmReader.cpp create mode 100644 llvm/lib/ObjCopy/wasm/WasmReader.h create mode 100644 llvm/lib/ObjCopy/wasm/WasmWriter.cpp create mode 100644 llvm/lib/ObjCopy/wasm/WasmWriter.h create mode 100644 llvm/lib/Object/DXContainer.cpp create mode 100644 llvm/lib/Object/OffloadBinary.cpp create mode 100644 llvm/lib/ObjectYAML/DXContainerEmitter.cpp create mode 100644 llvm/lib/ObjectYAML/DXContainerYAML.cpp create mode 100644 llvm/lib/ObjectYAML/OffloadEmitter.cpp create mode 100644 llvm/lib/ObjectYAML/OffloadYAML.cpp create mode 100644 llvm/lib/ProfileData/MemProf.cpp create mode 100644 llvm/lib/Support/AddressRanges.cpp create mode 100644 llvm/lib/Support/BLAKE3/LICENSE create mode 100644 llvm/lib/Support/BLAKE3/README.md create mode 100644 llvm/lib/Support/BLAKE3/blake3.c create mode 100644 llvm/lib/Support/BLAKE3/blake3_avx2.c create mode 100644 llvm/lib/Support/BLAKE3/blake3_avx2_x86-64_unix.S create mode 100644 llvm/lib/Support/BLAKE3/blake3_avx2_x86-64_windows_gnu.S create mode 100644 llvm/lib/Support/BLAKE3/blake3_avx2_x86-64_windows_msvc.asm create mode 100644 llvm/lib/Support/BLAKE3/blake3_avx512.c create mode 100644 llvm/lib/Support/BLAKE3/blake3_avx512_x86-64_unix.S create mode 100644 llvm/lib/Support/BLAKE3/blake3_avx512_x86-64_windows_gnu.S create mode 100644 llvm/lib/Support/BLAKE3/blake3_avx512_x86-64_windows_msvc.asm create mode 100644 llvm/lib/Support/BLAKE3/blake3_dispatch.c create mode 100644 llvm/lib/Support/BLAKE3/blake3_impl.h create mode 100644 llvm/lib/Support/BLAKE3/blake3_neon.c create mode 100644 llvm/lib/Support/BLAKE3/blake3_portable.c create mode 100644 llvm/lib/Support/BLAKE3/blake3_sse2.c create mode 100644 llvm/lib/Support/BLAKE3/blake3_sse2_x86-64_unix.S create mode 100644 llvm/lib/Support/BLAKE3/blake3_sse2_x86-64_windows_gnu.S create mode 100644 llvm/lib/Support/BLAKE3/blake3_sse2_x86-64_windows_msvc.asm create mode 100644 llvm/lib/Support/BLAKE3/blake3_sse41.c create mode 100644 llvm/lib/Support/BLAKE3/blake3_sse41_x86-64_unix.S create mode 100644 llvm/lib/Support/BLAKE3/blake3_sse41_x86-64_windows_gnu.S create mode 100644 llvm/lib/Support/BLAKE3/blake3_sse41_x86-64_windows_msvc.asm create mode 100644 llvm/lib/Support/CSKYAttributeParser.cpp create mode 100644 llvm/lib/Support/CSKYAttributes.cpp create mode 100644 llvm/lib/Support/CSKYTargetParser.cpp create mode 100644 llvm/lib/Support/UnicodeNameToCodepoint.cpp create mode 100644 llvm/lib/Support/UnicodeNameToCodepointGenerated.cpp create mode 100644 llvm/lib/TableGen/Parser.cpp create mode 100644 llvm/lib/Target/AArch64/AArch64MachineScheduler.cpp create mode 100644 llvm/lib/Target/AArch64/AArch64MachineScheduler.h create mode 100644 llvm/lib/Target/AArch64/AArch64SchedAmpere1.td create mode 100644 llvm/lib/Target/AArch64/AArch64SchedPredAmpere.td create mode 100644 llvm/lib/Target/AMDGPU/AMDGPUAttributes.def delete mode 100644 llvm/lib/Target/AMDGPU/AMDGPUFixFunctionBitcasts.cpp create mode 100644 llvm/lib/Target/AMDGPU/AMDGPUIGroupLP.cpp create mode 100644 llvm/lib/Target/AMDGPU/AMDGPUIGroupLP.h create mode 100644 llvm/lib/Target/AMDGPU/AMDGPUInsertDelayAlu.cpp create mode 100644 llvm/lib/Target/AMDGPU/AMDGPUReleaseVGPRs.cpp create mode 100644 llvm/lib/Target/AMDGPU/AMDGPUSetWavePriority.cpp delete mode 100644 llvm/lib/Target/AMDGPU/AMDILCFGStructurizer.cpp create mode 100644 llvm/lib/Target/AMDGPU/LDSDIRInstructions.td create mode 100644 llvm/lib/Target/AMDGPU/R600MachineCFGStructurizer.cpp delete mode 100644 llvm/lib/Target/AMDGPU/Utils/AMDGPULDSUtils.cpp delete mode 100644 llvm/lib/Target/AMDGPU/Utils/AMDGPULDSUtils.h create mode 100644 llvm/lib/Target/AMDGPU/Utils/AMDGPUMemoryUtils.cpp create mode 100644 llvm/lib/Target/AMDGPU/Utils/AMDGPUMemoryUtils.h create mode 100644 llvm/lib/Target/AMDGPU/VINTERPInstructions.td create mode 100644 llvm/lib/Target/AMDGPU/VOPDInstructions.td create mode 100644 llvm/lib/Target/ARM/ARMFixCortexA57AES1742098Pass.cpp delete mode 100644 llvm/lib/Target/AVR/AVRRelaxMemOperations.cpp create mode 100644 llvm/lib/Target/CSKY/CSKYInstrAlias.td create mode 100644 llvm/lib/Target/CSKY/CSKYTargetObjectFile.cpp create mode 100644 llvm/lib/Target/CSKY/CSKYTargetObjectFile.h create mode 100644 llvm/lib/Target/CSKY/Disassembler/CSKYDisassembler.cpp create mode 100644 llvm/lib/Target/CSKY/MCTargetDesc/CSKYELFStreamer.cpp create mode 100644 llvm/lib/Target/CSKY/MCTargetDesc/CSKYELFStreamer.h create mode 100644 llvm/lib/Target/CSKY/MCTargetDesc/CSKYTargetStreamer.cpp create mode 100644 llvm/lib/Target/CSKY/MCTargetDesc/CSKYTargetStreamer.h create mode 100644 llvm/lib/Target/DirectX/DXIL.td create mode 100644 llvm/lib/Target/DirectX/DXILConstants.h create mode 100644 llvm/lib/Target/DirectX/DXILOpLowering.cpp create mode 100644 llvm/lib/Target/DirectX/DXILPointerType.cpp create mode 100644 llvm/lib/Target/DirectX/DXILPointerType.h create mode 100644 llvm/lib/Target/DirectX/DXILPrepare.cpp create mode 100644 llvm/lib/Target/DirectX/DXILStubs.td create mode 100644 llvm/lib/Target/DirectX/DXILTranslateMetadata.cpp create mode 100644 llvm/lib/Target/DirectX/DXILWriter/DXILBitcodeWriter.cpp create mode 100644 llvm/lib/Target/DirectX/DXILWriter/DXILBitcodeWriter.h create mode 100644 llvm/lib/Target/DirectX/DXILWriter/DXILValueEnumerator.cpp create mode 100644 llvm/lib/Target/DirectX/DXILWriter/DXILValueEnumerator.h create mode 100644 llvm/lib/Target/DirectX/DXILWriter/DXILWriterPass.cpp create mode 100644 llvm/lib/Target/DirectX/DXILWriter/DXILWriterPass.h create mode 100644 llvm/lib/Target/DirectX/DirectX.h create mode 100644 llvm/lib/Target/DirectX/DirectX.td create mode 100644 llvm/lib/Target/DirectX/DirectXAsmPrinter.cpp create mode 100644 llvm/lib/Target/DirectX/DirectXFrameLowering.h create mode 100644 llvm/lib/Target/DirectX/DirectXInstrInfo.cpp create mode 100644 llvm/lib/Target/DirectX/DirectXInstrInfo.h create mode 100644 llvm/lib/Target/DirectX/DirectXRegisterInfo.cpp create mode 100644 llvm/lib/Target/DirectX/DirectXRegisterInfo.h create mode 100644 llvm/lib/Target/DirectX/DirectXSubtarget.cpp create mode 100644 llvm/lib/Target/DirectX/DirectXSubtarget.h create mode 100644 llvm/lib/Target/DirectX/DirectXTargetLowering.h create mode 100644 llvm/lib/Target/DirectX/DirectXTargetMachine.cpp create mode 100644 llvm/lib/Target/DirectX/DirectXTargetMachine.h create mode 100644 llvm/lib/Target/DirectX/DirectXTargetTransformInfo.h create mode 100644 llvm/lib/Target/DirectX/MCTargetDesc/DirectXContainerObjectWriter.cpp create mode 100644 llvm/lib/Target/DirectX/MCTargetDesc/DirectXContainerObjectWriter.h create mode 100644 llvm/lib/Target/DirectX/MCTargetDesc/DirectXMCTargetDesc.cpp create mode 100644 llvm/lib/Target/DirectX/MCTargetDesc/DirectXMCTargetDesc.h create mode 100644 llvm/lib/Target/DirectX/PointerTypeAnalysis.cpp create mode 100644 llvm/lib/Target/DirectX/PointerTypeAnalysis.h create mode 100644 llvm/lib/Target/DirectX/TargetInfo/DirectXTargetInfo.cpp create mode 100644 llvm/lib/Target/DirectX/TargetInfo/DirectXTargetInfo.h delete mode 100644 llvm/lib/Target/Hexagon/HexagonArch.h create mode 100644 llvm/lib/Target/LoongArch/AsmParser/LoongArchAsmParser.cpp create mode 100644 llvm/lib/Target/LoongArch/Disassembler/LoongArchDisassembler.cpp create mode 100644 llvm/lib/Target/LoongArch/LoongArch.h create mode 100644 llvm/lib/Target/LoongArch/LoongArch.td create mode 100644 llvm/lib/Target/LoongArch/LoongArchAsmPrinter.cpp create mode 100644 llvm/lib/Target/LoongArch/LoongArchAsmPrinter.h create mode 100644 llvm/lib/Target/LoongArch/LoongArchCallingConv.td create mode 100644 llvm/lib/Target/LoongArch/LoongArchFloat32InstrInfo.td create mode 100644 llvm/lib/Target/LoongArch/LoongArchFloat64InstrInfo.td create mode 100644 llvm/lib/Target/LoongArch/LoongArchFloatInstrFormats.td create mode 100644 llvm/lib/Target/LoongArch/LoongArchFrameLowering.cpp create mode 100644 llvm/lib/Target/LoongArch/LoongArchFrameLowering.h create mode 100644 llvm/lib/Target/LoongArch/LoongArchISelDAGToDAG.cpp create mode 100644 llvm/lib/Target/LoongArch/LoongArchISelDAGToDAG.h create mode 100644 llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp create mode 100644 llvm/lib/Target/LoongArch/LoongArchISelLowering.h create mode 100644 llvm/lib/Target/LoongArch/LoongArchInstrFormats.td create mode 100644 llvm/lib/Target/LoongArch/LoongArchInstrInfo.cpp create mode 100644 llvm/lib/Target/LoongArch/LoongArchInstrInfo.h create mode 100644 llvm/lib/Target/LoongArch/LoongArchInstrInfo.td create mode 100644 llvm/lib/Target/LoongArch/LoongArchMCInstLower.cpp create mode 100644 llvm/lib/Target/LoongArch/LoongArchMachineFunctionInfo.h create mode 100644 llvm/lib/Target/LoongArch/LoongArchRegisterInfo.cpp create mode 100644 llvm/lib/Target/LoongArch/LoongArchRegisterInfo.h create mode 100644 llvm/lib/Target/LoongArch/LoongArchRegisterInfo.td create mode 100644 llvm/lib/Target/LoongArch/LoongArchSubtarget.cpp create mode 100644 llvm/lib/Target/LoongArch/LoongArchSubtarget.h create mode 100644 llvm/lib/Target/LoongArch/LoongArchTargetMachine.cpp create mode 100644 llvm/lib/Target/LoongArch/LoongArchTargetMachine.h create mode 100644 llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchAsmBackend.cpp create mode 100644 llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchAsmBackend.h create mode 100644 llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchBaseInfo.cpp create mode 100644 llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchBaseInfo.h create mode 100644 llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchELFObjectWriter.cpp create mode 100644 llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchInstPrinter.cpp create mode 100644 llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchInstPrinter.h create mode 100644 llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchMCAsmInfo.cpp create mode 100644 llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchMCAsmInfo.h create mode 100644 llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchMCCodeEmitter.cpp create mode 100644 llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchMCTargetDesc.cpp create mode 100644 llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchMCTargetDesc.h create mode 100644 llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchMatInt.cpp create mode 100644 llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchMatInt.h create mode 100644 llvm/lib/Target/LoongArch/TargetInfo/LoongArchTargetInfo.cpp create mode 100644 llvm/lib/Target/LoongArch/TargetInfo/LoongArchTargetInfo.h create mode 100644 llvm/lib/Target/Mips/MipsCombine.td create mode 100644 llvm/lib/Target/Mips/MipsPostLegalizerCombiner.cpp create mode 100644 llvm/lib/Target/Mips/MipsTargetTransformInfo.cpp create mode 100644 llvm/lib/Target/Mips/MipsTargetTransformInfo.h create mode 100644 llvm/lib/Target/PowerPC/PPCCTRLoopsVerify.cpp create mode 100644 llvm/lib/Target/PowerPC/PPCGenScalarMASSEntries.cpp create mode 100644 llvm/lib/Target/PowerPC/PPCInstrMMA.td create mode 100644 llvm/lib/Target/PowerPC/PPCInstrP10.td delete mode 100644 llvm/lib/Target/PowerPC/PPCInstrPrefix.td create mode 100644 llvm/lib/Target/PowerPC/PPCRegisterInfoMMA.td create mode 100644 llvm/lib/Target/RISCV/RISCVInstrInfoZicbo.td create mode 100644 llvm/lib/Target/RISCV/RISCVMachineFunctionInfo.cpp create mode 100644 llvm/lib/Target/RISCV/RISCVMacroFusion.cpp create mode 100644 llvm/lib/Target/RISCV/RISCVMacroFusion.h create mode 100644 llvm/lib/Target/RISCV/RISCVMakeCompressible.cpp create mode 100644 llvm/lib/Target/RISCV/RISCVRedundantCopyElimination.cpp create mode 100644 llvm/lib/Target/SPIRV/MCTargetDesc/SPIRVAsmBackend.cpp create mode 100644 llvm/lib/Target/SPIRV/MCTargetDesc/SPIRVBaseInfo.cpp create mode 100644 llvm/lib/Target/SPIRV/MCTargetDesc/SPIRVBaseInfo.h create mode 100644 llvm/lib/Target/SPIRV/MCTargetDesc/SPIRVInstPrinter.cpp create mode 100644 llvm/lib/Target/SPIRV/MCTargetDesc/SPIRVInstPrinter.h create mode 100644 llvm/lib/Target/SPIRV/MCTargetDesc/SPIRVMCAsmInfo.cpp create mode 100644 llvm/lib/Target/SPIRV/MCTargetDesc/SPIRVMCAsmInfo.h create mode 100644 llvm/lib/Target/SPIRV/MCTargetDesc/SPIRVMCCodeEmitter.cpp create mode 100644 llvm/lib/Target/SPIRV/MCTargetDesc/SPIRVMCTargetDesc.cpp create mode 100644 llvm/lib/Target/SPIRV/MCTargetDesc/SPIRVMCTargetDesc.h create mode 100644 llvm/lib/Target/SPIRV/MCTargetDesc/SPIRVObjectTargetWriter.cpp create mode 100644 llvm/lib/Target/SPIRV/MCTargetDesc/SPIRVTargetStreamer.cpp create mode 100644 llvm/lib/Target/SPIRV/MCTargetDesc/SPIRVTargetStreamer.h create mode 100644 llvm/lib/Target/SPIRV/SPIRV.h create mode 100644 llvm/lib/Target/SPIRV/SPIRV.td create mode 100644 llvm/lib/Target/SPIRV/SPIRVAsmPrinter.cpp create mode 100644 llvm/lib/Target/SPIRV/SPIRVCallLowering.cpp create mode 100644 llvm/lib/Target/SPIRV/SPIRVCallLowering.h create mode 100644 llvm/lib/Target/SPIRV/SPIRVEmitIntrinsics.cpp create mode 100644 llvm/lib/Target/SPIRV/SPIRVEnums.td create mode 100644 llvm/lib/Target/SPIRV/SPIRVFrameLowering.h create mode 100644 llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.cpp create mode 100644 llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.h create mode 100644 llvm/lib/Target/SPIRV/SPIRVISelLowering.cpp create mode 100644 llvm/lib/Target/SPIRV/SPIRVISelLowering.h create mode 100644 llvm/lib/Target/SPIRV/SPIRVInstrFormats.td create mode 100644 llvm/lib/Target/SPIRV/SPIRVInstrInfo.cpp create mode 100644 llvm/lib/Target/SPIRV/SPIRVInstrInfo.h create mode 100644 llvm/lib/Target/SPIRV/SPIRVInstrInfo.td create mode 100644 llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp create mode 100644 llvm/lib/Target/SPIRV/SPIRVLegalizerInfo.cpp create mode 100644 llvm/lib/Target/SPIRV/SPIRVLegalizerInfo.h create mode 100644 llvm/lib/Target/SPIRV/SPIRVMCInstLower.cpp create mode 100644 llvm/lib/Target/SPIRV/SPIRVMCInstLower.h create mode 100644 llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.cpp create mode 100644 llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.h create mode 100644 llvm/lib/Target/SPIRV/SPIRVPreLegalizer.cpp create mode 100644 llvm/lib/Target/SPIRV/SPIRVRegisterBankInfo.cpp create mode 100644 llvm/lib/Target/SPIRV/SPIRVRegisterBankInfo.h create mode 100644 llvm/lib/Target/SPIRV/SPIRVRegisterBanks.td create mode 100644 llvm/lib/Target/SPIRV/SPIRVRegisterInfo.cpp create mode 100644 llvm/lib/Target/SPIRV/SPIRVRegisterInfo.h create mode 100644 llvm/lib/Target/SPIRV/SPIRVRegisterInfo.td create mode 100644 llvm/lib/Target/SPIRV/SPIRVSubtarget.cpp create mode 100644 llvm/lib/Target/SPIRV/SPIRVSubtarget.h create mode 100644 llvm/lib/Target/SPIRV/SPIRVTargetMachine.cpp create mode 100644 llvm/lib/Target/SPIRV/SPIRVTargetMachine.h create mode 100644 llvm/lib/Target/SPIRV/SPIRVTargetObjectFile.h create mode 100644 llvm/lib/Target/SPIRV/SPIRVTargetTransformInfo.h create mode 100644 llvm/lib/Target/SPIRV/SPIRVUtils.cpp create mode 100644 llvm/lib/Target/SPIRV/SPIRVUtils.h create mode 100644 llvm/lib/Target/SPIRV/TargetInfo/SPIRVTargetInfo.cpp create mode 100644 llvm/lib/Target/SPIRV/TargetInfo/SPIRVTargetInfo.h create mode 100644 llvm/lib/Target/SystemZ/SystemZScheduleZ16.td create mode 100644 llvm/lib/Target/VE/VVPISelLowering.cpp delete mode 100644 llvm/lib/Target/WebAssembly/WebAssemblyLowerGlobalDtors.cpp delete mode 100644 llvm/lib/Target/WebAssembly/WebAssemblyPrepareForLiveIntervals.cpp create mode 100644 llvm/lib/Target/X86/MCTargetDesc/X86InstrRelaxTables.cpp create mode 100644 llvm/lib/Target/X86/MCTargetDesc/X86InstrRelaxTables.h create mode 100644 llvm/lib/Target/X86/MCTargetDesc/X86MnemonicTables.cpp create mode 100644 llvm/lib/Target/X86/X86FastPreTileConfig.cpp create mode 100644 llvm/lib/Transforms/Coroutines/CoroConditionalWrapper.cpp delete mode 100644 llvm/lib/Transforms/Instrumentation/MaximumSpanningTree.h delete mode 100644 llvm/lib/Transforms/Scalar/LoopUnswitch.cpp delete mode 100644 llvm/lib/Transforms/Scalar/LowerAtomic.cpp create mode 100644 llvm/lib/Transforms/Scalar/LowerAtomicPass.cpp create mode 100644 llvm/lib/Transforms/Scalar/TLSVariableHoist.cpp create mode 100644 llvm/lib/Transforms/Utils/LowerAtomic.cpp create mode 100644 llvm/lib/Transforms/Utils/LowerGlobalDtors.cpp create mode 100644 llvm/lib/Transforms/Utils/MemoryTaggingSupport.cpp create mode 100644 llvm/lib/Transforms/Utils/MisExpect.cpp delete mode 100644 llvm/lib/Transforms/Vectorize/VPlanLoopInfo.h delete mode 100644 llvm/lib/Transforms/Vectorize/VPlanPredicator.cpp delete mode 100644 llvm/lib/Transforms/Vectorize/VPlanPredicator.h create mode 100644 llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp create mode 100644 llvm/lib/WindowsDriver/MSVCPaths.cpp delete mode 100644 llvm/tools/llvm-objcopy/COFF/COFFConfig.h delete mode 100644 llvm/tools/llvm-objcopy/COFF/COFFObjcopy.cpp delete mode 100644 llvm/tools/llvm-objcopy/COFF/COFFObjcopy.h delete mode 100644 llvm/tools/llvm-objcopy/COFF/Object.cpp delete mode 100644 llvm/tools/llvm-objcopy/COFF/Object.h delete mode 100644 llvm/tools/llvm-objcopy/COFF/Reader.cpp delete mode 100644 llvm/tools/llvm-objcopy/COFF/Reader.h delete mode 100644 llvm/tools/llvm-objcopy/COFF/Writer.cpp delete mode 100644 llvm/tools/llvm-objcopy/COFF/Writer.h delete mode 100644 llvm/tools/llvm-objcopy/CommonConfig.h delete mode 100644 llvm/tools/llvm-objcopy/ConfigManager.cpp delete mode 100644 llvm/tools/llvm-objcopy/ConfigManager.h delete mode 100644 llvm/tools/llvm-objcopy/ELF/ELFConfig.h delete mode 100644 llvm/tools/llvm-objcopy/ELF/ELFObjcopy.cpp delete mode 100644 llvm/tools/llvm-objcopy/ELF/ELFObjcopy.h delete mode 100644 llvm/tools/llvm-objcopy/ELF/Object.cpp delete mode 100644 llvm/tools/llvm-objcopy/ELF/Object.h delete mode 100644 llvm/tools/llvm-objcopy/MachO/MachOConfig.h delete mode 100644 llvm/tools/llvm-objcopy/MachO/MachOLayoutBuilder.cpp delete mode 100644 llvm/tools/llvm-objcopy/MachO/MachOLayoutBuilder.h delete mode 100644 llvm/tools/llvm-objcopy/MachO/MachOObjcopy.cpp delete mode 100644 llvm/tools/llvm-objcopy/MachO/MachOObjcopy.h delete mode 100644 llvm/tools/llvm-objcopy/MachO/MachOReader.cpp delete mode 100644 llvm/tools/llvm-objcopy/MachO/MachOReader.h delete mode 100644 llvm/tools/llvm-objcopy/MachO/MachOWriter.cpp delete mode 100644 llvm/tools/llvm-objcopy/MachO/MachOWriter.h delete mode 100644 llvm/tools/llvm-objcopy/MachO/Object.cpp delete mode 100644 llvm/tools/llvm-objcopy/MachO/Object.h delete mode 100644 llvm/tools/llvm-objcopy/MultiFormatConfig.h create mode 100644 llvm/tools/llvm-objcopy/ObjcopyOptions.cpp create mode 100644 llvm/tools/llvm-objcopy/ObjcopyOptions.h delete mode 100644 llvm/tools/llvm-objcopy/llvm-objcopy.h delete mode 100644 llvm/tools/llvm-objcopy/wasm/Object.cpp delete mode 100644 llvm/tools/llvm-objcopy/wasm/Object.h delete mode 100644 llvm/tools/llvm-objcopy/wasm/Reader.cpp delete mode 100644 llvm/tools/llvm-objcopy/wasm/Reader.h delete mode 100644 llvm/tools/llvm-objcopy/wasm/WasmConfig.h delete mode 100644 llvm/tools/llvm-objcopy/wasm/WasmObjcopy.cpp delete mode 100644 llvm/tools/llvm-objcopy/wasm/WasmObjcopy.h delete mode 100644 llvm/tools/llvm-objcopy/wasm/Writer.cpp delete mode 100644 llvm/tools/llvm-objcopy/wasm/Writer.h create mode 100644 llvm/tools/llvm-objdump/OffloadDump.cpp create mode 100644 llvm/tools/llvm-objdump/OffloadDump.h delete mode 100644 llvm/tools/llvm-pdbutil/FormatUtil.cpp delete mode 100644 llvm/tools/llvm-pdbutil/FormatUtil.h delete mode 100644 llvm/tools/llvm-pdbutil/InputFile.cpp delete mode 100644 llvm/tools/llvm-pdbutil/InputFile.h delete mode 100644 llvm/tools/llvm-pdbutil/LinePrinter.cpp delete mode 100644 llvm/tools/llvm-pdbutil/LinePrinter.h delete mode 100644 llvm/tools/opt/PassPrinters.cpp delete mode 100644 llvm/tools/opt/PassPrinters.h delete mode 100644 llvm/utils/TableGen/CodeBeadsGen.cpp create mode 100644 llvm/utils/TableGen/DXILEmitter.cpp create mode 100644 llvm/utils/TableGen/DecoderEmitter.cpp delete mode 100644 llvm/utils/TableGen/FixedLenDecoderEmitter.cpp create mode 100644 llvm/utils/TableGen/VarLenCodeEmitterGen.cpp create mode 100644 llvm/utils/TableGen/VarLenCodeEmitterGen.h create mode 100644 llvm/utils/TableGen/X86MnemonicTables.cpp diff --git a/clang/include/clang-c/Index.h b/clang/include/clang-c/Index.h index b0d7ef509c26..b897910624de 100644 --- a/clang/include/clang-c/Index.h +++ b/clang/include/clang-c/Index.h @@ -2189,7 +2189,17 @@ enum CXCursorKind { */ CXCursor_CXXAddrspaceCastExpr = 152, - CXCursor_LastExpr = CXCursor_CXXAddrspaceCastExpr, + /** + * Expression that references a C++20 concept. + */ + CXCursor_ConceptSpecializationExpr = 153, + + /** + * Expression that references a C++20 concept. + */ + CXCursor_RequiresExpr = 154, + + CXCursor_LastExpr = CXCursor_RequiresExpr, /* Statements */ CXCursor_FirstStmt = 200, @@ -2600,7 +2610,43 @@ enum CXCursorKind { */ CXCursor_OMPGenericLoopDirective = 295, - CXCursor_LastStmt = CXCursor_OMPGenericLoopDirective, + /** OpenMP teams loop directive. + */ + CXCursor_OMPTeamsGenericLoopDirective = 296, + + /** OpenMP target teams loop directive. + */ + CXCursor_OMPTargetTeamsGenericLoopDirective = 297, + + /** OpenMP parallel loop directive. + */ + CXCursor_OMPParallelGenericLoopDirective = 298, + + /** OpenMP target parallel loop directive. + */ + CXCursor_OMPTargetParallelGenericLoopDirective = 299, + + /** OpenMP parallel masked directive. + */ + CXCursor_OMPParallelMaskedDirective = 300, + + /** OpenMP masked taskloop directive. + */ + CXCursor_OMPMaskedTaskLoopDirective = 301, + + /** OpenMP masked taskloop simd directive. + */ + CXCursor_OMPMaskedTaskLoopSimdDirective = 302, + + /** OpenMP parallel masked taskloop directive. + */ + CXCursor_OMPParallelMaskedTaskLoopDirective = 303, + + /** OpenMP parallel masked taskloop simd directive. + */ + CXCursor_OMPParallelMaskedTaskLoopSimdDirective = 304, + + CXCursor_LastStmt = CXCursor_OMPParallelMaskedTaskLoopSimdDirective, /** * Cursor that represents the translation unit itself. @@ -2608,7 +2654,7 @@ enum CXCursorKind { * The translation unit cursor exists primarily to act as the root * cursor for traversing the contents of a translation unit. */ - CXCursor_TranslationUnit = 300, + CXCursor_TranslationUnit = 350, /* Attributes */ CXCursor_FirstAttr = 400, @@ -2684,8 +2730,13 @@ enum CXCursorKind { * a friend declaration. */ CXCursor_FriendDecl = 603, + /** + * a concept declaration. + */ + CXCursor_ConceptDecl = 604, + CXCursor_FirstExtraDecl = CXCursor_ModuleImportDecl, - CXCursor_LastExtraDecl = CXCursor_FriendDecl, + CXCursor_LastExtraDecl = CXCursor_ConceptDecl, /** * A code completion overload candidate. @@ -3401,7 +3452,8 @@ enum CXTypeKind { CXType_OCLIntelSubgroupAVCImeDualRefStreamin = 175, CXType_ExtVector = 176, - CXType_Atomic = 177 + CXType_Atomic = 177, + CXType_BTFTagAttributed = 178 }; /** @@ -3428,6 +3480,7 @@ enum CXCallingConv { CXCallingConv_PreserveAll = 15, CXCallingConv_AArch64VectorCall = 16, CXCallingConv_SwiftAsync = 17, + CXCallingConv_AArch64SVEPCS = 18, CXCallingConv_Invalid = 100, CXCallingConv_Unexposed = 200 @@ -3900,7 +3953,7 @@ enum CXTypeNullabilityKind { /** * Generally behaves like Nullable, except when used in a block parameter that * was imported into a swift async method. There, swift will assume that the - * parameter can get null even if no error occured. _Nullable parameters are + * parameter can get null even if no error occurred. _Nullable parameters are * assumed to only get null on error. */ CXTypeNullability_NullableResult = 4 @@ -6301,7 +6354,8 @@ typedef enum { CXIdxEntity_CXXDestructor = 23, CXIdxEntity_CXXConversionFunction = 24, CXIdxEntity_CXXTypeAlias = 25, - CXIdxEntity_CXXInterface = 26 + CXIdxEntity_CXXInterface = 26, + CXIdxEntity_CXXConcept = 27 } CXIdxEntityKind; diff --git a/clang/include/clang/APINotes/Types.h b/clang/include/clang/APINotes/Types.h index f741d9b91d76..d79586931995 100644 --- a/clang/include/clang/APINotes/Types.h +++ b/clang/include/clang/APINotes/Types.h @@ -77,7 +77,7 @@ public: void setSwiftPrivate(llvm::Optional Private) { SwiftPrivateSpecified = Private.hasValue(); - SwiftPrivate = Private.hasValue() ? *Private : 0; + SwiftPrivate = Private ? *Private : 0; } friend bool operator==(const CommonEntityInfo &, const CommonEntityInfo &); @@ -238,8 +238,8 @@ public: : llvm::None; } void setSwiftImportAsNonGeneric(llvm::Optional Value) { - SwiftImportAsNonGenericSpecified = Value.hasValue(); - SwiftImportAsNonGeneric = Value.getValueOr(false); + SwiftImportAsNonGenericSpecified = Value.has_value(); + SwiftImportAsNonGeneric = Value.value_or(false); } llvm::Optional getSwiftObjCMembers() const { @@ -247,8 +247,8 @@ public: : llvm::None; } void setSwiftObjCMembers(llvm::Optional Value) { - SwiftObjCMembersSpecified = Value.hasValue(); - SwiftObjCMembers = Value.getValueOr(false); + SwiftObjCMembersSpecified = Value.has_value(); + SwiftObjCMembers = Value.value_or(false); } /// Strip off any information within the class information structure that is @@ -365,8 +365,8 @@ public: : llvm::None; } void setSwiftImportAsAccessors(llvm::Optional Value) { - SwiftImportAsAccessorsSpecified = Value.hasValue(); - SwiftImportAsAccessors = Value.getValueOr(false); + SwiftImportAsAccessorsSpecified = Value.has_value(); + SwiftImportAsAccessors = Value.value_or(false); } friend bool operator==(const ObjCPropertyInfo &, const ObjCPropertyInfo &); @@ -429,8 +429,8 @@ public: return NoEscape; } void setNoEscape(llvm::Optional Value) { - NoEscapeSpecified = Value.hasValue(); - NoEscape = Value.getValueOr(false); + NoEscapeSpecified = Value.has_value(); + NoEscape = Value.value_or(false); } llvm::Optional getRetainCountConvention() const { @@ -440,8 +440,7 @@ public: } void setRetainCountConvention(llvm::Optional Value) { - RawRetainCountConvention = - Value.hasValue() ? static_cast(Value.getValue()) + 1 : 0; + RawRetainCountConvention = Value ? static_cast(*Value) + 1 : 0; assert(getRetainCountConvention() == Value && "bitfield too small"); } @@ -559,8 +558,7 @@ public: } void setRetainCountConvention(llvm::Optional Value) { - RawRetainCountConvention = - Value.hasValue() ? static_cast(Value.getValue()) + 1 : 0; + RawRetainCountConvention = Value ? static_cast(*Value) + 1 : 0; assert(getRetainCountConvention() == Value && "bitfield too small"); } @@ -666,17 +664,17 @@ public: return llvm::None; } void setFlagEnum(llvm::Optional Value) { - HasFlagEnum = Value.hasValue(); - IsFlagEnum = Value.getValueOr(false); + HasFlagEnum = Value.has_value(); + IsFlagEnum = Value.value_or(false); } TagInfo &operator|=(const TagInfo &RHS) { static_cast(*this) |= RHS; - if (!HasFlagEnum && HasFlagEnum) + if (!HasFlagEnum) setFlagEnum(RHS.isFlagEnum()); - if (!EnumExtensibility.hasValue()) + if (!EnumExtensibility) EnumExtensibility = RHS.EnumExtensibility; return *this; @@ -706,7 +704,7 @@ public: TypedefInfo &operator|=(const TypedefInfo &RHS) { static_cast(*this) |= RHS; - if (!SwiftWrapper.hasValue()) + if (!SwiftWrapper) SwiftWrapper = RHS.SwiftWrapper; return *this; } diff --git a/clang/include/clang/AST/ASTContext.h b/clang/include/clang/AST/ASTContext.h index 63c11e237d6c..7db6af9cb87d 100644 --- a/clang/include/clang/AST/ASTContext.h +++ b/clang/include/clang/AST/ASTContext.h @@ -211,7 +211,7 @@ class ASTContext : public RefCountedBase { mutable SmallVector Types; mutable llvm::FoldingSet ExtQualNodes; mutable llvm::FoldingSet ComplexTypes; - mutable llvm::FoldingSet PointerTypes; + mutable llvm::FoldingSet PointerTypes{GeneralTypesLog2InitSize}; mutable llvm::FoldingSet AdjustedTypes; mutable llvm::FoldingSet BlockPointerTypes; mutable llvm::FoldingSet LValueReferenceTypes; @@ -243,9 +243,10 @@ class ASTContext : public RefCountedBase { SubstTemplateTypeParmPackTypes; mutable llvm::ContextualFoldingSet TemplateSpecializationTypes; - mutable llvm::FoldingSet ParenTypes; + mutable llvm::FoldingSet ParenTypes{GeneralTypesLog2InitSize}; mutable llvm::FoldingSet UsingTypes; - mutable llvm::FoldingSet ElaboratedTypes; + mutable llvm::FoldingSet ElaboratedTypes{ + GeneralTypesLog2InitSize}; mutable llvm::FoldingSet DependentNameTypes; mutable llvm::ContextualFoldingSet @@ -263,6 +264,7 @@ class ASTContext : public RefCountedBase { mutable llvm::FoldingSet PipeTypes; mutable llvm::FoldingSet BitIntTypes; mutable llvm::FoldingSet DependentBitIntTypes; + llvm::FoldingSet BTFTagAttributedTypes; mutable llvm::FoldingSet QualifiedTemplateNames; mutable llvm::FoldingSet DependentTemplateNames; @@ -312,6 +314,10 @@ class ASTContext : public RefCountedBase { /// Mapping from GUIDs to the corresponding MSGuidDecl. mutable llvm::FoldingSet MSGuidDecls; + /// Mapping from APValues to the corresponding UnnamedGlobalConstantDecl. + mutable llvm::FoldingSet + UnnamedGlobalConstantDecls; + /// Mapping from APValues to the corresponding TemplateParamObjects. mutable llvm::FoldingSet TemplateParamObjectDecls; @@ -466,6 +472,10 @@ class ASTContext : public RefCountedBase { }; llvm::DenseMap ModuleInitializers; + static constexpr unsigned ConstantArrayTypesLog2InitSize = 8; + static constexpr unsigned GeneralTypesLog2InitSize = 9; + static constexpr unsigned FunctionProtoTypesLog2InitSize = 12; + ASTContext &this_() { return *this; } public: @@ -1150,6 +1160,10 @@ public: /// Keep track of CUDA/HIP device-side variables ODR-used by host code. llvm::DenseSet CUDADeviceVarODRUsedByHost; + /// Keep track of CUDA/HIP external kernels or device variables ODR-used by + /// host code. + llvm::DenseSet CUDAExternalDeviceDeclODRUsedByHost; + ASTContext(LangOptions &LOpts, SourceManager &SM, IdentifierTable &idents, SelectorTable &sels, Builtin::Context &builtins, TranslationUnitKind TUKind); @@ -1587,6 +1601,9 @@ public: QualType modifiedType, QualType equivalentType); + QualType getBTFTagAttributedType(const BTFTypeTagAttr *BTFAttr, + QualType Wrapped); + QualType getSubstTemplateTypeParmType(const TemplateTypeParmType *Replaced, QualType Replacement) const; QualType getSubstTemplateTypeParmPackType( @@ -2165,7 +2182,7 @@ public: TemplateName getQualifiedTemplateName(NestedNameSpecifier *NNS, bool TemplateKeyword, - TemplateDecl *Template) const; + TemplateName Template) const; TemplateName getDependentTemplateName(NestedNameSpecifier *NNS, const IdentifierInfo *Name) const; @@ -2537,7 +2554,7 @@ public: bool IsParam) const { auto SubTnullability = SubT->getNullability(*this); auto SuperTnullability = SuperT->getNullability(*this); - if (SubTnullability.hasValue() == SuperTnullability.hasValue()) { + if (SubTnullability.has_value() == SuperTnullability.has_value()) { // Neither has nullability; return true if (!SubTnullability) return true; @@ -2753,14 +2770,6 @@ public: /// long double and double on AArch64 will return 0). int getFloatingTypeSemanticOrder(QualType LHS, QualType RHS) const; - /// Return a real floating point or a complex type (based on - /// \p typeDomain/\p typeSize). - /// - /// \param typeDomain a real floating point or complex type. - /// \param typeSize a real floating point or complex type. - QualType getFloatingTypeOfSizeWithinDomain(QualType typeSize, - QualType typeDomain) const; - unsigned getTargetAddressSpace(QualType T) const; unsigned getTargetAddressSpace(Qualifiers Q) const; @@ -3032,7 +3041,8 @@ public: DeclaratorDecl *getDeclaratorForUnnamedTagDecl(const TagDecl *TD); void setManglingNumber(const NamedDecl *ND, unsigned Number); - unsigned getManglingNumber(const NamedDecl *ND) const; + unsigned getManglingNumber(const NamedDecl *ND, + bool ForAuxTarget = false) const; void setStaticLocalNumber(const VarDecl *VD, unsigned Number); unsigned getStaticLocalNumber(const VarDecl *VD) const; @@ -3063,6 +3073,11 @@ public: /// GUID value. MSGuidDecl *getMSGuidDecl(MSGuidDeclParts Parts) const; + /// Return a declaration for a uniquified anonymous global constant + /// corresponding to a given APValue. + UnnamedGlobalConstantDecl * + getUnnamedGlobalConstantDecl(QualType Ty, const APValue &Value) const; + /// Return the template parameter object of the given type with the given /// value. TemplateParamObjectDecl *getTemplateParamObjectDecl(QualType T, @@ -3279,11 +3294,11 @@ public: /// Return a new OMPTraitInfo object owned by this context. OMPTraitInfo &getNewOMPTraitInfo(); - /// Whether a C++ static variable may be externalized. - bool mayExternalizeStaticVar(const Decl *D) const; + /// Whether a C++ static variable or CUDA/HIP kernel may be externalized. + bool mayExternalize(const Decl *D) const; - /// Whether a C++ static variable should be externalized. - bool shouldExternalizeStaticVar(const Decl *D) const; + /// Whether a C++ static variable or CUDA/HIP kernel should be externalized. + bool shouldExternalize(const Decl *D) const; StringRef getCUIDHash() const; diff --git a/clang/include/clang/AST/ASTFwd.h b/clang/include/clang/AST/ASTFwd.h index fdbd603ce5d0..f84b3238e32b 100644 --- a/clang/include/clang/AST/ASTFwd.h +++ b/clang/include/clang/AST/ASTFwd.h @@ -33,6 +33,7 @@ class OMPClause; class Attr; #define ATTR(A) class A##Attr; #include "clang/Basic/AttrList.inc" +class ObjCProtocolLoc; } // end namespace clang diff --git a/clang/include/clang/AST/ASTImportError.h b/clang/include/clang/AST/ASTImportError.h new file mode 100644 index 000000000000..405790b6ded3 --- /dev/null +++ b/clang/include/clang/AST/ASTImportError.h @@ -0,0 +1,51 @@ +//===- ASTImportError.h - Define errors while importing AST -----*- 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 the ASTImportError class which basically defines the kind +// of error while importing AST . +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_CLANG_AST_ASTIMPORTERROR_H +#define LLVM_CLANG_AST_ASTIMPORTERROR_H + +#include "llvm/Support/Error.h" + +namespace clang { + +class ASTImportError : public llvm::ErrorInfo { + +public: + /// \brief Kind of error when importing an AST component. + enum ErrorKind { + NameConflict, /// Naming ambiguity (likely ODR violation). + UnsupportedConstruct, /// Not supported node or case. + Unknown /// Other error. + }; + + ErrorKind Error; + + static char ID; + + ASTImportError() : Error(Unknown) {} + ASTImportError(const ASTImportError &Other) : Error(Other.Error) {} + ASTImportError &operator=(const ASTImportError &Other) { + Error = Other.Error; + return *this; + } + ASTImportError(ErrorKind Error) : Error(Error) {} + + std::string toString() const; + + void log(llvm::raw_ostream &OS) const override; + std::error_code convertToErrorCode() const override; +}; + +} // namespace clang + +#endif // LLVM_CLANG_AST_ASTIMPORTERROR_H diff --git a/clang/include/clang/AST/ASTImporter.h b/clang/include/clang/AST/ASTImporter.h index c8bdae10a6e6..e38ffa50ad4a 100644 --- a/clang/include/clang/AST/ASTImporter.h +++ b/clang/include/clang/AST/ASTImporter.h @@ -14,7 +14,7 @@ #ifndef LLVM_CLANG_AST_ASTIMPORTER_H #define LLVM_CLANG_AST_ASTIMPORTER_H -#include "clang/AST/APValue.h" +#include "clang/AST/ASTImportError.h" #include "clang/AST/DeclBase.h" #include "clang/AST/DeclarationName.h" #include "clang/AST/ExprCXX.h" @@ -29,7 +29,6 @@ #include "llvm/ADT/DenseSet.h" #include "llvm/ADT/Optional.h" #include "llvm/ADT/SmallVector.h" -#include "llvm/Support/Error.h" #include namespace clang { @@ -49,33 +48,6 @@ class TagDecl; class TranslationUnitDecl; class TypeSourceInfo; - class ImportError : public llvm::ErrorInfo { - public: - /// \brief Kind of error when importing an AST component. - enum ErrorKind { - NameConflict, /// Naming ambiguity (likely ODR violation). - UnsupportedConstruct, /// Not supported node or case. - Unknown /// Other error. - }; - - ErrorKind Error; - - static char ID; - - 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; - - void log(raw_ostream &OS) const override; - std::error_code convertToErrorCode() const override; - }; - // \brief Returns with a list of declarations started from the canonical decl // then followed by subsequent decls in the translation unit. // This gives a canonical list for each entry in the redecl chain. @@ -259,7 +231,7 @@ class TypeSourceInfo; /// imported. The same declaration may or may not be included in /// ImportedDecls. This map is updated continuously during imports and never /// cleared (like ImportedDecls). - llvm::DenseMap ImportDeclErrors; + llvm::DenseMap ImportDeclErrors; /// Mapping from the already-imported declarations in the "to" /// context to the corresponding declarations in the "from" context. @@ -592,10 +564,10 @@ class TypeSourceInfo; /// Return if import of the given declaration has failed and if yes /// the kind of the problem. This gives the first error encountered with /// the node. - llvm::Optional getImportDeclErrorIfAny(Decl *FromD) const; + llvm::Optional getImportDeclErrorIfAny(Decl *FromD) const; /// Mark (newly) imported declaration with error. - void setImportDeclError(Decl *From, ImportError Error); + void setImportDeclError(Decl *From, ASTImportError Error); /// Determine whether the given types are structurally /// equivalent. diff --git a/clang/include/clang/AST/ASTImporterSharedState.h b/clang/include/clang/AST/ASTImporterSharedState.h index 686a8e22b2fa..ce7fb290c976 100644 --- a/clang/include/clang/AST/ASTImporterSharedState.h +++ b/clang/include/clang/AST/ASTImporterSharedState.h @@ -14,11 +14,10 @@ #ifndef LLVM_CLANG_AST_ASTIMPORTERSHAREDSTATE_H #define LLVM_CLANG_AST_ASTIMPORTERSHAREDSTATE_H +#include "clang/AST/ASTImportError.h" #include "clang/AST/ASTImporterLookupTable.h" #include "clang/AST/Decl.h" #include "llvm/ADT/DenseMap.h" -// FIXME We need this because of ImportError. -#include "clang/AST/ASTImporter.h" namespace clang { @@ -37,7 +36,10 @@ class ASTImporterSharedState { /// imported. The same declaration may or may not be included in /// ImportedFromDecls. This map is updated continuously during imports and /// never cleared (like ImportedFromDecls). - llvm::DenseMap ImportErrors; + llvm::DenseMap ImportErrors; + + /// Set of the newly created declarations. + llvm::DenseSet NewDecls; // FIXME put ImportedFromDecls here! // And from that point we can better encapsulate the lookup table. @@ -63,17 +65,21 @@ public: LookupTable->remove(ND); } - llvm::Optional getImportDeclErrorIfAny(Decl *ToD) const { + llvm::Optional getImportDeclErrorIfAny(Decl *ToD) const { auto Pos = ImportErrors.find(ToD); if (Pos != ImportErrors.end()) return Pos->second; else - return Optional(); + return Optional(); } - void setImportDeclError(Decl *To, ImportError Error) { + void setImportDeclError(Decl *To, ASTImportError Error) { ImportErrors[To] = Error; } + + bool isNewDecl(const Decl *ToD) const { return NewDecls.count(ToD); } + + void markAsNewDecl(Decl *ToD) { NewDecls.insert(ToD); } }; } // namespace clang diff --git a/clang/include/clang/AST/ASTLambda.h b/clang/include/clang/AST/ASTLambda.h index 6fd82d6af490..230e0c848610 100644 --- a/clang/include/clang/AST/ASTLambda.h +++ b/clang/include/clang/AST/ASTLambda.h @@ -65,8 +65,8 @@ inline bool isGenericLambdaCallOperatorSpecialization(DeclContext *DC) { } inline bool isGenericLambdaCallOperatorOrStaticInvokerSpecialization( - DeclContext *DC) { - CXXMethodDecl *MD = dyn_cast(DC); + const DeclContext *DC) { + const auto *MD = dyn_cast(DC); if (!MD) return false; const CXXRecordDecl *LambdaClass = MD->getParent(); if (LambdaClass && LambdaClass->isGenericLambda()) @@ -75,7 +75,6 @@ inline bool isGenericLambdaCallOperatorOrStaticInvokerSpecialization( return false; } - // This returns the parent DeclContext ensuring that the correct // parent DeclContext is returned for Lambdas inline DeclContext *getLambdaAwareParentOfDeclContext(DeclContext *DC) { diff --git a/clang/include/clang/AST/ASTNodeTraverser.h b/clang/include/clang/AST/ASTNodeTraverser.h index 18e7f491f222..093dc9a773c7 100644 --- a/clang/include/clang/AST/ASTNodeTraverser.h +++ b/clang/include/clang/AST/ASTNodeTraverser.h @@ -386,6 +386,9 @@ public: // FIXME: AttrKind Visit(T->getModifiedType()); } + void VisitBTFTagAttributedType(const BTFTagAttributedType *T) { + Visit(T->getWrappedType()); + } void VisitSubstTemplateTypeParmType(const SubstTemplateTypeParmType *T) { Visit(T->getReplacedParameter()); } @@ -464,6 +467,10 @@ public: void VisitBindingDecl(const BindingDecl *D) { if (Traversal == TK_IgnoreUnlessSpelledInSource) return; + + if (const auto *V = D->getHoldingVar()) + Visit(V); + if (const auto *E = D->getBinding()) Visit(E); } diff --git a/clang/include/clang/AST/ASTTypeTraits.h b/clang/include/clang/AST/ASTTypeTraits.h index 6d96146a4d45..cd6b5143bf79 100644 --- a/clang/include/clang/AST/ASTTypeTraits.h +++ b/clang/include/clang/AST/ASTTypeTraits.h @@ -160,6 +160,7 @@ private: NKI_Attr, #define ATTR(A) NKI_##A##Attr, #include "clang/Basic/AttrList.inc" + NKI_ObjCProtocolLoc, NKI_NumberOfKinds }; @@ -213,6 +214,7 @@ KIND_TO_KIND_ID(Stmt) KIND_TO_KIND_ID(Type) KIND_TO_KIND_ID(OMPClause) KIND_TO_KIND_ID(Attr) +KIND_TO_KIND_ID(ObjCProtocolLoc) KIND_TO_KIND_ID(CXXBaseSpecifier) #define DECL(DERIVED, BASE) KIND_TO_KIND_ID(DERIVED##Decl) #include "clang/AST/DeclNodes.inc" @@ -499,7 +501,7 @@ private: /// have storage or unique pointers and thus need to be stored by value. llvm::AlignedCharArrayUnion + QualType, TypeLoc, ObjCProtocolLoc> Storage; }; @@ -570,6 +572,10 @@ template <> struct DynTypedNode::BaseConverter : public PtrConverter {}; +template <> +struct DynTypedNode::BaseConverter + : public ValueConverter {}; + // The only operation we allow on unsupported types is \c get. // This allows to conveniently use \c DynTypedNode when having an arbitrary // AST node that is not supported, but prevents misuse - a user cannot create diff --git a/clang/include/clang/AST/AbstractBasicReader.h b/clang/include/clang/AST/AbstractBasicReader.h index b2fc2d2c7e4b..3394c68f54eb 100644 --- a/clang/include/clang/AST/AbstractBasicReader.h +++ b/clang/include/clang/AST/AbstractBasicReader.h @@ -21,7 +21,7 @@ inline T makeNullableFromOptional(const Optional &value) { template inline T *makePointerFromOptional(Optional value) { - return value.getValueOr(nullptr); + return value.value_or(nullptr); } // PropertyReader is a class concept that requires the following method: diff --git a/clang/include/clang/AST/AbstractTypeReader.h b/clang/include/clang/AST/AbstractTypeReader.h index c9162b1779bc..e44bbf61c0ed 100644 --- a/clang/include/clang/AST/AbstractTypeReader.h +++ b/clang/include/clang/AST/AbstractTypeReader.h @@ -9,8 +9,9 @@ #ifndef LLVM_CLANG_AST_ABSTRACTTYPEREADER_H #define LLVM_CLANG_AST_ABSTRACTTYPEREADER_H -#include "clang/AST/Type.h" #include "clang/AST/AbstractBasicReader.h" +#include "clang/AST/DeclObjC.h" +#include "clang/AST/Type.h" namespace clang { namespace serialization { diff --git a/clang/include/clang/AST/CharUnits.h b/clang/include/clang/AST/CharUnits.h index f14d3abf71e5..2705f24789e4 100644 --- a/clang/include/clang/AST/CharUnits.h +++ b/clang/include/clang/AST/CharUnits.h @@ -182,6 +182,12 @@ namespace clang { /// Beware llvm::Align assumes power of two 8-bit bytes. llvm::Align getAsAlign() const { return llvm::Align(Quantity); } + /// getAsMaybeAlign - Returns Quantity as a valid llvm::Align or + /// llvm::None, Beware llvm::MaybeAlign assumes power of two 8-bit bytes. + llvm::MaybeAlign getAsMaybeAlign() const { + return llvm::MaybeAlign(Quantity); + } + /// alignTo - Returns the next integer (mod 2**64) that is /// greater than or equal to this quantity and is a multiple of \p Align. /// Align must be non-zero. diff --git a/clang/include/clang/AST/Comment.h b/clang/include/clang/AST/Comment.h index 5ecc35791b7b..0b68c1131664 100644 --- a/clang/include/clang/AST/Comment.h +++ b/clang/include/clang/AST/Comment.h @@ -194,6 +194,11 @@ public: #include "clang/AST/CommentNodes.inc" }; + struct Argument { + SourceRange Range; + StringRef Text; + }; + Comment(CommentKind K, SourceLocation LocBegin, SourceLocation LocEnd) : @@ -296,13 +301,6 @@ private: /// A command with word-like arguments that is considered inline content. class InlineCommandComment : public InlineContentComment { public: - struct Argument { - SourceRange Range; - StringRef Text; - - Argument(SourceRange Range, StringRef Text) : Range(Range), Text(Text) { } - }; - /// The most appropriate rendering mode for this command, chosen on command /// semantics in Doxygen. enum RenderKind { @@ -588,15 +586,6 @@ private: /// arguments depends on command name) and a paragraph as an argument /// (e. g., \\brief). class BlockCommandComment : public BlockContentComment { -public: - struct Argument { - SourceRange Range; - StringRef Text; - - Argument() { } - Argument(SourceRange Range, StringRef Text) : Range(Range), Text(Text) { } - }; - protected: /// Word-like arguments. ArrayRef Args; diff --git a/clang/include/clang/AST/CommentCommands.td b/clang/include/clang/AST/CommentCommands.td index 7e962a4b4171..e839031752cd 100644 --- a/clang/include/clang/AST/CommentCommands.td +++ b/clang/include/clang/AST/CommentCommands.td @@ -31,6 +31,7 @@ class Command { } class InlineCommand : Command { + let NumArgs = 1; let IsInlineCommand = 1; } @@ -62,6 +63,11 @@ class VerbatimLineCommand : Command { let IsVerbatimLineCommand = 1; } +class PropertyCommand : Command { + let NumArgs = 0; + let IsInlineCommand = 1; +} + class DeclarationVerbatimLineCommand : VerbatimLineCommand { let IsDeclarationCommand = 1; @@ -86,6 +92,7 @@ def C : InlineCommand<"c">; def P : InlineCommand<"p">; def A : InlineCommand<"a">; def E : InlineCommand<"e">; +def N : InlineCommand<"n"> { let NumArgs = 0; } def Em : InlineCommand<"em">; def Emoji : InlineCommand<"emoji">; @@ -154,7 +161,7 @@ def Post : BlockCommand<"post">; def Pre : BlockCommand<"pre">; def Remark : BlockCommand<"remark">; def Remarks : BlockCommand<"remarks">; -def Retval : BlockCommand<"retval">; +def Retval : BlockCommand<"retval"> { let NumArgs = 1; } def Sa : BlockCommand<"sa">; def See : BlockCommand<"see">; def Since : BlockCommand<"since">; @@ -162,7 +169,7 @@ def Test : BlockCommand<"test">; def Todo : BlockCommand<"todo">; def Version : BlockCommand<"version">; def Warning : BlockCommand<"warning">; -def XRefItem : BlockCommand<"xrefitem">; +def XRefItem : BlockCommand<"xrefitem"> { let NumArgs = 3; } // HeaderDoc commands def Abstract : BlockCommand<"abstract"> { let IsBriefCommand = 1; } def ClassDesign : RecordLikeDetailCommand<"classdesign">; @@ -273,31 +280,6 @@ def Until : VerbatimLineCommand<"until">; def NoOp : VerbatimLineCommand<"noop">; -// These have actually no arguments, but we can treat them as line commands. -def CallGraph : VerbatimLineCommand<"callgraph">; -def HideCallGraph : VerbatimLineCommand<"hidecallgraph">; -def CallerGraph : VerbatimLineCommand<"callergraph">; -def HideCallerGraph : VerbatimLineCommand<"hidecallergraph">; -def ShowInitializer : VerbatimLineCommand<"showinitializer">; -def HideInitializer : VerbatimLineCommand<"hideinitializer">; -def ShowRefBy : VerbatimLineCommand<"showrefby">; -def HideRefBy : VerbatimLineCommand<"hiderefby">; -def ShowRefs : VerbatimLineCommand<"showrefs">; -def HideRefs : VerbatimLineCommand<"hiderefs">; - -// These also have no argument. -def Private : VerbatimLineCommand<"private">; -def Protected : VerbatimLineCommand<"protected">; -def Public : VerbatimLineCommand<"public">; -def Pure : VerbatimLineCommand<"pure">; -def Static : VerbatimLineCommand<"static">; - -// These also have no argument. -def NoSubgrouping : VerbatimLineCommand<"nosubgrouping">; -def PrivateSection : VerbatimLineCommand<"privatesection">; -def ProtectedSection : VerbatimLineCommand<"protectedsection">; -def PublicSection : VerbatimLineCommand<"publicsection">; - // We might also build proper support for if/ifnot/else/elseif/endif. def If : VerbatimLineCommand<"if">; def IfNot : VerbatimLineCommand<"ifnot">; @@ -309,6 +291,32 @@ def Endif : VerbatimLineCommand<"endif">; def Cond : VerbatimLineCommand<"cond">; def EndCond : VerbatimLineCommand<"endcond">; +//===----------------------------------------------------------------------===// +// PropertyCommand +//===----------------------------------------------------------------------===// + +def CallGraph : PropertyCommand<"callgraph">; +def HideCallGraph : PropertyCommand<"hidecallgraph">; +def CallerGraph : PropertyCommand<"callergraph">; +def HideCallerGraph : PropertyCommand<"hidecallergraph">; +def ShowInitializer : PropertyCommand<"showinitializer">; +def HideInitializer : PropertyCommand<"hideinitializer">; +def ShowRefBy : PropertyCommand<"showrefby">; +def HideRefBy : PropertyCommand<"hiderefby">; +def ShowRefs : PropertyCommand<"showrefs">; +def HideRefs : PropertyCommand<"hiderefs">; + +def Private : PropertyCommand<"private">; +def Protected : PropertyCommand<"protected">; +def Public : PropertyCommand<"public">; +def Pure : PropertyCommand<"pure">; +def Static : PropertyCommand<"static">; + +def NoSubgrouping : PropertyCommand<"nosubgrouping">; +def PrivateSection : PropertyCommand<"privatesection">; +def ProtectedSection : PropertyCommand<"protectedsection">; +def PublicSection : PropertyCommand<"publicsection">; + //===----------------------------------------------------------------------===// // DeclarationVerbatimLineCommand //===----------------------------------------------------------------------===// diff --git a/clang/include/clang/AST/CommentParser.h b/clang/include/clang/AST/CommentParser.h index 1a0cfb06e52b..e11e818b1af0 100644 --- a/clang/include/clang/AST/CommentParser.h +++ b/clang/include/clang/AST/CommentParser.h @@ -97,9 +97,8 @@ public: void parseTParamCommandArgs(TParamCommandComment *TPC, TextTokenRetokenizer &Retokenizer); - void parseBlockCommandArgs(BlockCommandComment *BC, - TextTokenRetokenizer &Retokenizer, - unsigned NumArgs); + ArrayRef + parseCommandArgs(TextTokenRetokenizer &Retokenizer, unsigned NumArgs); BlockCommandComment *parseBlockCommand(); InlineCommandComment *parseInlineCommand(); diff --git a/clang/include/clang/AST/CommentSema.h b/clang/include/clang/AST/CommentSema.h index 015ce8f8652a..5e30ff8adb91 100644 --- a/clang/include/clang/AST/CommentSema.h +++ b/clang/include/clang/AST/CommentSema.h @@ -128,16 +128,10 @@ public: void actOnTParamCommandFinish(TParamCommandComment *Command, ParagraphComment *Paragraph); - InlineCommandComment *actOnInlineCommand(SourceLocation CommandLocBegin, - SourceLocation CommandLocEnd, - unsigned CommandID); - InlineCommandComment *actOnInlineCommand(SourceLocation CommandLocBegin, SourceLocation CommandLocEnd, unsigned CommandID, - SourceLocation ArgLocBegin, - SourceLocation ArgLocEnd, - StringRef Arg); + ArrayRef Args); InlineContentComment *actOnUnknownCommand(SourceLocation LocBegin, SourceLocation LocEnd, diff --git a/clang/include/clang/AST/ComputeDependence.h b/clang/include/clang/AST/ComputeDependence.h index cb545aff51f8..3360fd11ab1f 100644 --- a/clang/include/clang/AST/ComputeDependence.h +++ b/clang/include/clang/AST/ComputeDependence.h @@ -30,7 +30,8 @@ class UnaryExprOrTypeTraitExpr; class ArraySubscriptExpr; class MatrixSubscriptExpr; class CompoundLiteralExpr; -class CastExpr; +class ImplicitCastExpr; +class ExplicitCastExpr; class BinaryOperator; class ConditionalOperator; class BinaryConditionalOperator; @@ -70,6 +71,7 @@ class CXXPseudoDestructorExpr; class OverloadExpr; class DependentScopeDeclRefExpr; class CXXConstructExpr; +class CXXTemporaryObjectExpr; class CXXDefaultInitExpr; class CXXDefaultArgExpr; class LambdaExpr; @@ -114,7 +116,8 @@ ExprDependence computeDependence(UnaryExprOrTypeTraitExpr *E); ExprDependence computeDependence(ArraySubscriptExpr *E); ExprDependence computeDependence(MatrixSubscriptExpr *E); ExprDependence computeDependence(CompoundLiteralExpr *E); -ExprDependence computeDependence(CastExpr *E); +ExprDependence computeDependence(ImplicitCastExpr *E); +ExprDependence computeDependence(ExplicitCastExpr *E); ExprDependence computeDependence(BinaryOperator *E); ExprDependence computeDependence(ConditionalOperator *E); ExprDependence computeDependence(BinaryConditionalOperator *E); @@ -156,6 +159,7 @@ ExprDependence computeDependence(OverloadExpr *E, bool KnownDependent, bool KnownContainsUnexpandedParameterPack); ExprDependence computeDependence(DependentScopeDeclRefExpr *E); ExprDependence computeDependence(CXXConstructExpr *E); +ExprDependence computeDependence(CXXTemporaryObjectExpr *E); ExprDependence computeDependence(CXXDefaultInitExpr *E); ExprDependence computeDependence(CXXDefaultArgExpr *E); ExprDependence computeDependence(LambdaExpr *E, diff --git a/clang/include/clang/AST/Decl.h b/clang/include/clang/AST/Decl.h index 862e8899d275..66fab94b45b8 100644 --- a/clang/include/clang/AST/Decl.h +++ b/clang/include/clang/AST/Decl.h @@ -1041,7 +1041,7 @@ protected: }; VarDecl(Kind DK, ASTContext &C, DeclContext *DC, SourceLocation StartLoc, - SourceLocation IdLoc, IdentifierInfo *Id, QualType T, + SourceLocation IdLoc, const IdentifierInfo *Id, QualType T, TypeSourceInfo *TInfo, StorageClass SC); using redeclarable_base = Redeclarable; @@ -1071,8 +1071,8 @@ public: static VarDecl *Create(ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, - IdentifierInfo *Id, QualType T, TypeSourceInfo *TInfo, - StorageClass S); + const IdentifierInfo *Id, QualType T, + TypeSourceInfo *TInfo, StorageClass S); static VarDecl *CreateDeserialized(ASTContext &C, unsigned ID); @@ -1591,6 +1591,20 @@ public: /// kind? QualType::DestructionKind needsDestruction(const ASTContext &Ctx) const; + /// Whether this variable has a flexible array member initialized with one + /// or more elements. This can only be called for declarations where + /// hasInit() is true. + /// + /// (The standard doesn't allow initializing flexible array members; this is + /// a gcc/msvc extension.) + bool hasFlexibleArrayInit(const ASTContext &Ctx) const; + + /// If hasFlexibleArrayInit is true, compute the number of additional bytes + /// necessary to store those elements. Otherwise, returns zero. + /// + /// This can only be called for declarations where hasInit() is true. + CharUnits getFlexibleArrayInitChars(const ASTContext &Ctx) const; + // Implement isa/cast/dyncast/etc. static bool classof(const Decl *D) { return classofKind(D->getKind()); } static bool classofKind(Kind K) { return K >= firstVar && K <= lastVar; } @@ -1619,6 +1633,9 @@ public: /// Parameter for captured context CapturedContext, + /// Parameter for Thread private variable + ThreadPrivateVar, + /// Other implicit parameter Other, }; @@ -2234,6 +2251,13 @@ public: DeclAsWritten->getCanonicalDecl()->isDefaulted()); } + bool isIneligibleOrNotSelected() const { + return FunctionDeclBits.IsIneligibleOrNotSelected; + } + void setIneligibleOrNotSelected(bool II) { + FunctionDeclBits.IsIneligibleOrNotSelected = II; + } + /// 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. @@ -3486,6 +3510,24 @@ public: /// parameters. bool isDependentType() const { return isDependentContext(); } + /// Whether this declaration was a definition in some module but was forced + /// to be a declaration. + /// + /// Useful for clients checking if a module has a definition of a specific + /// symbol and not interested in the final AST with deduplicated definitions. + bool isThisDeclarationADemotedDefinition() const { + return TagDeclBits.IsThisDeclarationADemotedDefinition; + } + + /// Mark a definition as a declaration and maintain information it _was_ + /// a definition. + void demoteThisDefinitionToDeclaration() { + assert(isCompleteDefinition() && + "Should demote definitions only, not forward declarations"); + setCompleteDefinition(false); + TagDeclBits.IsThisDeclarationADemotedDefinition = true; + } + /// Starts the definition of this tag declaration. /// /// This method should be invoked at the beginning of the definition @@ -4033,6 +4075,12 @@ public: RecordDeclBits.ParamDestroyedInCallee = V; } + bool isRandomized() const { return RecordDeclBits.IsRandomized; } + + void setIsRandomized(bool V) { RecordDeclBits.IsRandomized = V; } + + void reorderDecls(const SmallVectorImpl &Decls); + /// Determines whether this declaration represents the /// injected class name. /// @@ -4449,6 +4497,16 @@ public: /// @import std.vector; /// \endcode /// +/// A C++20 module import declaration imports the named module or partition. +/// Periods are permitted in C++20 module names, but have no semantic meaning. +/// For example: +/// \code +/// import NamedModule; +/// import :SomePartition; // Must be a partition of the current module. +/// import Names.Like.this; // Allowed. +/// import :and.Also.Partition.names; +/// \endcode +/// /// Import declarations can also be implicitly generated from /// \#include/\#import directives. class ImportDecl final : public Decl, diff --git a/clang/include/clang/AST/DeclBase.h b/clang/include/clang/AST/DeclBase.h index 06d2f17d1430..52fe8dd6b1e5 100644 --- a/clang/include/clang/AST/DeclBase.h +++ b/clang/include/clang/AST/DeclBase.h @@ -225,8 +225,15 @@ public: /// module is imported. VisibleWhenImported, + /// This declaration has an owning module, and is visible to lookups + /// that occurs within that module. And it is reachable in other module + /// when the owning module is transitively imported. + ReachableWhenImported, + /// This declaration has an owning module, but is only visible to /// lookups that occur within that module. + /// The discarded declarations in global module fragment belongs + /// to this group too. ModulePrivate }; @@ -235,8 +242,8 @@ protected: /// DeclContext. These pointers form the linked list that is /// traversed via DeclContext's decls_begin()/decls_end(). /// - /// The extra two bits are used for the ModuleOwnershipKind. - llvm::PointerIntPair NextInContextAndBits; + /// The extra three bits are used for the ModuleOwnershipKind. + llvm::PointerIntPair NextInContextAndBits; private: friend class DeclContext; @@ -313,6 +320,7 @@ protected: friend class ASTReader; friend class CXXClassMemberWrapper; friend class LinkageComputer; + friend class RecordDecl; template friend class Redeclarable; /// Access - Used by C++ decls for the access specifier. @@ -621,6 +629,14 @@ public: /// export void B::f2(); // isInExportDeclContext() == true bool isInExportDeclContext() const; + bool isInvisibleOutsideTheOwningModule() const { + return getModuleOwnershipKind() > ModuleOwnershipKind::VisibleWhenImported; + } + + /// FIXME: Implement discarding declarations actually in global module + /// fragment. See [module.global.frag]p3,4 for details. + bool isDiscardedInGlobalModuleFragment() const { return false; } + /// Return true if this declaration has an attribute which acts as /// definition of the entity, such as 'alias' or 'ifunc'. bool hasDefiningAttr() const; @@ -798,6 +814,11 @@ public: return (int)getModuleOwnershipKind() <= (int)ModuleOwnershipKind::Visible; } + bool isReachable() const { + return (int)getModuleOwnershipKind() <= + (int)ModuleOwnershipKind::ReachableWhenImported; + } + /// Set that this declaration is globally visible, even if it came from a /// module that is not visible. void setVisibleDespiteOwningModule() { @@ -1443,10 +1464,14 @@ class DeclContext { /// Has the full definition of this type been required by a use somewhere in /// the TU. uint64_t IsCompleteDefinitionRequired : 1; + + /// Whether this tag is a definition which was demoted due to + /// a module merge. + uint64_t IsThisDeclarationADemotedDefinition : 1; }; /// Number of non-inherited bits in TagDeclBitfields. - enum { NumTagDeclBits = 9 }; + enum { NumTagDeclBits = 10 }; /// Stores the bits used by EnumDecl. /// If modified NumEnumDeclBit and the accessor @@ -1536,10 +1561,13 @@ class DeclContext { /// Represents the way this type is passed to a function. uint64_t ArgPassingRestrictions : 2; + + /// Indicates whether this struct has had its field layout randomized. + uint64_t IsRandomized : 1; }; /// Number of non-inherited bits in RecordDeclBitfields. - enum { NumRecordDeclBits = 14 }; + enum { NumRecordDeclBits = 15 }; /// Stores the bits used by OMPDeclareReductionDecl. /// If modified NumOMPDeclareReductionDeclBits and the accessor @@ -1588,6 +1616,12 @@ class DeclContext { uint64_t IsDefaulted : 1; uint64_t IsExplicitlyDefaulted : 1; uint64_t HasDefaultedFunctionInfo : 1; + + /// For member functions of complete types, whether this is an ineligible + /// special member function or an unselected destructor. See + /// [class.mem.special]. + uint64_t IsIneligibleOrNotSelected : 1; + uint64_t HasImplicitReturnZero : 1; uint64_t IsLateTemplateParsed : 1; @@ -1623,7 +1657,7 @@ class DeclContext { }; /// Number of non-inherited bits in FunctionDeclBitfields. - enum { NumFunctionDeclBits = 27 }; + enum { NumFunctionDeclBits = 28 }; /// Stores the bits used by CXXConstructorDecl. If modified /// NumCXXConstructorDeclBits and the accessor @@ -1635,12 +1669,12 @@ class DeclContext { /// For the bits in FunctionDeclBitfields. uint64_t : NumFunctionDeclBits; - /// 24 bits to fit in the remaining available space. + /// 23 bits to fit in the remaining available space. /// Note that this makes CXXConstructorDeclBitfields take /// exactly 64 bits and thus the width of NumCtorInitializers /// will need to be shrunk if some bit is added to NumDeclContextBitfields, /// NumFunctionDeclBitfields or CXXConstructorDeclBitfields. - uint64_t NumCtorInitializers : 21; + uint64_t NumCtorInitializers : 20; uint64_t IsInheritingConstructor : 1; /// Whether this constructor has a trail-allocated explicit specifier. diff --git a/clang/include/clang/AST/DeclCXX.h b/clang/include/clang/AST/DeclCXX.h index 2833df0505da..edcd0425a735 100644 --- a/clang/include/clang/AST/DeclCXX.h +++ b/clang/include/clang/AST/DeclCXX.h @@ -275,6 +275,14 @@ class CXXRecordDecl : public RecordDecl { SMF_All = 0x3f }; +public: + enum LambdaDependencyKind { + LDK_Unknown = 0, + LDK_AlwaysDependent, + LDK_NeverDependent, + }; + +private: struct DefinitionData { #define FIELD(Name, Width, Merge) \ unsigned Name : Width; @@ -374,7 +382,7 @@ class CXXRecordDecl : public RecordDecl { /// lambda will have been created with the enclosing context as its /// declaration context, rather than function. This is an unfortunate /// artifact of having to parse the default arguments before. - unsigned Dependent : 1; + unsigned DependencyKind : 2; /// Whether this lambda is a generic lambda. unsigned IsGenericLambda : 1; @@ -408,9 +416,9 @@ class CXXRecordDecl : public RecordDecl { /// The type of the call method. TypeSourceInfo *MethodTyInfo; - LambdaDefinitionData(CXXRecordDecl *D, TypeSourceInfo *Info, bool Dependent, + LambdaDefinitionData(CXXRecordDecl *D, TypeSourceInfo *Info, unsigned DK, bool IsGeneric, LambdaCaptureDefault CaptureDefault) - : DefinitionData(D), Dependent(Dependent), IsGenericLambda(IsGeneric), + : DefinitionData(D), DependencyKind(DK), IsGenericLambda(IsGeneric), CaptureDefault(CaptureDefault), NumCaptures(0), NumExplicitCaptures(0), HasKnownInternalLinkage(0), ManglingNumber(0), MethodTyInfo(Info) { @@ -547,7 +555,7 @@ public: bool DelayTypeCreation = false); static CXXRecordDecl *CreateLambda(const ASTContext &C, DeclContext *DC, TypeSourceInfo *Info, SourceLocation Loc, - bool DependentLambda, bool IsGeneric, + unsigned DependencyKind, bool IsGeneric, LambdaCaptureDefault CaptureDefault); static CXXRecordDecl *CreateDeserialized(const ASTContext &C, unsigned ID); @@ -1414,6 +1422,19 @@ public: return isLiteral() && data().StructuralIfLiteral; } + /// Notify the class that this destructor is now selected. + /// + /// Important properties of the class depend on destructor properties. Since + /// C++20, it is possible to have multiple destructor declarations in a class + /// out of which one will be selected at the end. + /// This is called separately from addedMember because it has to be deferred + /// to the completion of the class. + void addedSelectedDestructor(CXXDestructorDecl *DD); + + /// Notify the class that an eligible SMF has been added. + /// This updates triviality and destructor based properties of the class accordingly. + void addedEligibleSpecialMemberFunction(const CXXMethodDecl *MD, unsigned SMKind); + /// If this record is an instantiation of a member class, /// retrieves the member class from which it was instantiated. /// @@ -1774,7 +1795,17 @@ public: /// function declaration itself is dependent. This flag indicates when we /// know that the lambda is dependent despite that. bool isDependentLambda() const { - return isLambda() && getLambdaData().Dependent; + return isLambda() && getLambdaData().DependencyKind == LDK_AlwaysDependent; + } + + bool isNeverDependentLambda() const { + return isLambda() && getLambdaData().DependencyKind == LDK_NeverDependent; + } + + unsigned getLambdaDependencyKind() const { + if (!isLambda()) + return LDK_Unknown; + return getLambdaData().DependencyKind; } TypeSourceInfo *getLambdaTypeInfo() const { @@ -4188,6 +4219,54 @@ public: static bool classofKind(Kind K) { return K == Decl::MSGuid; } }; +/// An artificial decl, representing a global anonymous constant value which is +/// uniquified by value within a translation unit. +/// +/// These is currently only used to back the LValue returned by +/// __builtin_source_location, but could potentially be used for other similar +/// situations in the future. +class UnnamedGlobalConstantDecl : public ValueDecl, + public Mergeable, + public llvm::FoldingSetNode { + + // The constant value of this global. + APValue Value; + + void anchor() override; + + UnnamedGlobalConstantDecl(const ASTContext &C, DeclContext *DC, QualType T, + const APValue &Val); + + static UnnamedGlobalConstantDecl *Create(const ASTContext &C, QualType T, + const APValue &APVal); + static UnnamedGlobalConstantDecl *CreateDeserialized(ASTContext &C, + unsigned ID); + + // Only ASTContext::getUnnamedGlobalConstantDecl and deserialization create + // these. + friend class ASTContext; + friend class ASTReader; + friend class ASTDeclReader; + +public: + /// Print this in a human-readable format. + void printName(llvm::raw_ostream &OS) const override; + + const APValue &getValue() const { return Value; } + + static void Profile(llvm::FoldingSetNodeID &ID, QualType Ty, + const APValue &APVal) { + Ty.Profile(ID); + APVal.Profile(ID); + } + void Profile(llvm::FoldingSetNodeID &ID) { + Profile(ID, getType(), getValue()); + } + + static bool classof(const Decl *D) { return classofKind(D->getKind()); } + static bool classofKind(Kind K) { return K == Decl::UnnamedGlobalConstant; } +}; + /// Insertion operator for diagnostics. This allows sending an AccessSpecifier /// into a diagnostic with <<. const StreamingDiagnostic &operator<<(const StreamingDiagnostic &DB, diff --git a/clang/include/clang/AST/DeclObjC.h b/clang/include/clang/AST/DeclObjC.h index 110b7dc0c6f2..59a2cf5de234 100644 --- a/clang/include/clang/AST/DeclObjC.h +++ b/clang/include/clang/AST/DeclObjC.h @@ -1951,7 +1951,10 @@ public: /// in; this is either the interface where the ivar was declared, or the /// interface the ivar is conceptually a part of in the case of synthesized /// ivars. - const ObjCInterfaceDecl *getContainingInterface() const; + ObjCInterfaceDecl *getContainingInterface(); + const ObjCInterfaceDecl *getContainingInterface() const { + return const_cast(this)->getContainingInterface(); + } ObjCIvarDecl *getNextIvar() { return NextIvar; } const ObjCIvarDecl *getNextIvar() const { return NextIvar; } @@ -2885,15 +2888,16 @@ ObjCInterfaceDecl::filtered_category_iterator::operator++() { } inline bool ObjCInterfaceDecl::isVisibleCategory(ObjCCategoryDecl *Cat) { - return Cat->isUnconditionallyVisible(); + return !Cat->isInvalidDecl() && Cat->isUnconditionallyVisible(); } inline bool ObjCInterfaceDecl::isVisibleExtension(ObjCCategoryDecl *Cat) { - return Cat->IsClassExtension() && Cat->isUnconditionallyVisible(); + return !Cat->isInvalidDecl() && Cat->IsClassExtension() && + Cat->isUnconditionallyVisible(); } inline bool ObjCInterfaceDecl::isKnownExtension(ObjCCategoryDecl *Cat) { - return Cat->IsClassExtension(); + return !Cat->isInvalidDecl() && Cat->IsClassExtension(); } } // namespace clang diff --git a/clang/include/clang/AST/DeclTemplate.h b/clang/include/clang/AST/DeclTemplate.h index d216b359816e..3e4ccda73111 100644 --- a/clang/include/clang/AST/DeclTemplate.h +++ b/clang/include/clang/AST/DeclTemplate.h @@ -1109,7 +1109,7 @@ public: bool isAbbreviated() const { // Since the invented template parameters generated from 'auto' parameters // are either appended to the end of the explicit template parameter list or - // form a new template paramter list, we can simply observe the last + // form a new template parameter list, we can simply observe the last // parameter to determine if such a thing happened. const TemplateParameterList *TPL = getTemplateParameters(); return TPL->getParam(TPL->size() - 1)->isImplicit(); @@ -1148,23 +1148,40 @@ public: /// parameters and is not part of the Decl hierarchy. Just a facility. class TemplateParmPosition { protected: - // FIXME: These probably don't need to be ints. int:5 for depth, int:8 for - // position? Maybe? - unsigned Depth; - unsigned Position; + enum { DepthWidth = 20, PositionWidth = 12 }; + unsigned Depth : DepthWidth; + unsigned Position : PositionWidth; - TemplateParmPosition(unsigned D, unsigned P) : Depth(D), Position(P) {} + static constexpr unsigned MaxDepth = (1U << DepthWidth) - 1; + static constexpr unsigned MaxPosition = (1U << PositionWidth) - 1; + + TemplateParmPosition(unsigned D, unsigned P) : Depth(D), Position(P) { + // The input may fill maximum values to show that it is invalid. + // Add one here to convert it to zero. + assert((D + 1) <= MaxDepth && + "The depth of template parmeter position is more than 2^20!"); + assert((P + 1) <= MaxPosition && + "The position of template parmeter position is more than 2^12!"); + } public: TemplateParmPosition() = delete; /// Get the nesting depth of the template parameter. unsigned getDepth() const { return Depth; } - void setDepth(unsigned D) { Depth = D; } + void setDepth(unsigned D) { + assert((D + 1) <= MaxDepth && + "The depth of template parmeter position is more than 2^20!"); + Depth = D; + } /// Get the position of the template parameter within its parameter list. unsigned getPosition() const { return Position; } - void setPosition(unsigned P) { Position = P; } + void setPosition(unsigned P) { + assert((P + 1) <= MaxPosition && + "The position of template parmeter position is more than 2^12!"); + Position = P; + } /// Get the index of the template parameter within its parameter list. unsigned getIndex() const { return Position; } @@ -1216,7 +1233,7 @@ class TemplateTypeParmDecl final : public TypeDecl, : TypeDecl(TemplateTypeParm, DC, IdLoc, Id, KeyLoc), Typename(Typename), HasTypeConstraint(HasTypeConstraint), TypeConstraintInitialized(false), ExpandedParameterPack(NumExpanded), - NumExpanded(NumExpanded.getValueOr(0)) {} + NumExpanded(NumExpanded.value_or(0)) {} public: static TemplateTypeParmDecl *Create(const ASTContext &C, DeclContext *DC, @@ -2461,10 +2478,10 @@ private: SourceLocation FriendLoc; FriendTemplateDecl(DeclContext *DC, SourceLocation Loc, - MutableArrayRef Params, + TemplateParameterList **Params, unsigned NumParams, FriendUnion Friend, SourceLocation FriendLoc) - : Decl(Decl::FriendTemplate, DC, Loc), NumParams(Params.size()), - Params(Params.data()), Friend(Friend), FriendLoc(FriendLoc) {} + : Decl(Decl::FriendTemplate, DC, Loc), NumParams(NumParams), + Params(Params), Friend(Friend), FriendLoc(FriendLoc) {} FriendTemplateDecl(EmptyShell Empty) : Decl(Decl::FriendTemplate, Empty) {} @@ -2701,7 +2718,7 @@ class VarTemplateSpecializationDecl : public VarDecl, /// The template arguments used to describe this specialization. const TemplateArgumentList *TemplateArgs; - TemplateArgumentListInfo TemplateArgsInfo; + const ASTTemplateArgumentListInfo *TemplateArgsInfo = nullptr; /// The point where this template was instantiated (if any). SourceLocation PointOfInstantiation; @@ -2756,8 +2773,9 @@ public: // TODO: Always set this when creating the new specialization? void setTemplateArgsInfo(const TemplateArgumentListInfo &ArgsInfo); + void setTemplateArgsInfo(const ASTTemplateArgumentListInfo *ArgsInfo); - const TemplateArgumentListInfo &getTemplateArgsInfo() const { + const ASTTemplateArgumentListInfo *getTemplateArgsInfo() const { return TemplateArgsInfo; } @@ -3313,10 +3331,12 @@ public: /// Print this object as an equivalent expression. void printAsExpr(llvm::raw_ostream &OS) const; + void printAsExpr(llvm::raw_ostream &OS, const PrintingPolicy &Policy) const; /// Print this object as an initializer suitable for a variable of the /// object's type. void printAsInit(llvm::raw_ostream &OS) const; + void printAsInit(llvm::raw_ostream &OS, const PrintingPolicy &Policy) const; const APValue &getValue() const { return Value; } diff --git a/clang/include/clang/AST/DeclarationName.h b/clang/include/clang/AST/DeclarationName.h index 0762e0a478ea..1a1cbbf9f6eb 100644 --- a/clang/include/clang/AST/DeclarationName.h +++ b/clang/include/clang/AST/DeclarationName.h @@ -21,6 +21,7 @@ #include "clang/Basic/SourceLocation.h" #include "llvm/ADT/DenseMapInfo.h" #include "llvm/ADT/FoldingSet.h" +#include "llvm/ADT/STLExtras.h" #include "llvm/Support/Compiler.h" #include "llvm/Support/type_traits.h" #include @@ -192,6 +193,13 @@ class DeclarationName { "The various classes that DeclarationName::Ptr can point to" " must be at least aligned to 8 bytes!"); + static_assert( + std::is_same, + std::underlying_type_t< + detail::DeclarationNameExtra::ExtraKind>>::value, + "The various enums used to compute values for NameKind should " + "all have the same underlying type"); + public: /// The kind of the name stored in this DeclarationName. /// The first 7 enumeration values are stored inline and correspond @@ -205,15 +213,18 @@ public: CXXDestructorName = StoredCXXDestructorName, CXXConversionFunctionName = StoredCXXConversionFunctionName, CXXOperatorName = StoredCXXOperatorName, - CXXDeductionGuideName = UncommonNameKindOffset + - detail::DeclarationNameExtra::CXXDeductionGuideName, - CXXLiteralOperatorName = - UncommonNameKindOffset + - detail::DeclarationNameExtra::CXXLiteralOperatorName, - CXXUsingDirective = UncommonNameKindOffset + - detail::DeclarationNameExtra::CXXUsingDirective, - ObjCMultiArgSelector = UncommonNameKindOffset + - detail::DeclarationNameExtra::ObjCMultiArgSelector + CXXDeductionGuideName = llvm::addEnumValues( + UncommonNameKindOffset, + detail::DeclarationNameExtra::CXXDeductionGuideName), + CXXLiteralOperatorName = llvm::addEnumValues( + UncommonNameKindOffset, + detail::DeclarationNameExtra::CXXLiteralOperatorName), + CXXUsingDirective = + llvm::addEnumValues(UncommonNameKindOffset, + detail::DeclarationNameExtra::CXXUsingDirective), + ObjCMultiArgSelector = + llvm::addEnumValues(UncommonNameKindOffset, + detail::DeclarationNameExtra::ObjCMultiArgSelector), }; private: diff --git a/clang/include/clang/AST/DependenceFlags.h b/clang/include/clang/AST/DependenceFlags.h index 62efdb4ce6e4..3b3c1afb096a 100644 --- a/clang/include/clang/AST/DependenceFlags.h +++ b/clang/include/clang/AST/DependenceFlags.h @@ -130,6 +130,14 @@ public: // Dependence that is propagated syntactically, regardless of semantics. Syntactic = UnexpandedPack | Instantiation | Error, + // Dependence that is propagated semantically, even in cases where the + // type doesn't syntactically appear. This currently excludes only + // UnexpandedPack. Even though Instantiation dependence is also notionally + // syntactic, we also want to propagate it semantically because anything + // that semantically depends on an instantiation-dependent entity should + // always be instantiated when that instantiation-dependent entity is. + Semantic = + Instantiation | Type | Value | Dependent | Error | VariablyModified, LLVM_MARK_AS_BITMASK_ENUM(/*LargestValue=*/VariablyModified) }; @@ -175,6 +183,14 @@ public: return Result; } + /// Extract the semantic portions of this type's dependence that apply even + /// to uses where the type does not appear syntactically. + Dependence semantic() { + Dependence Result = *this; + Result.V &= Semantic; + return Result; + } + TypeDependence type() const { return translate(V, UnexpandedPack, TypeDependence::UnexpandedPack) | translate(V, Instantiation, TypeDependence::Instantiation) | @@ -231,7 +247,10 @@ private: inline ExprDependence toExprDependence(TemplateArgumentDependence TA) { return Dependence(TA).expr(); } -inline ExprDependence toExprDependence(TypeDependence D) { +inline ExprDependence toExprDependenceForImpliedType(TypeDependence D) { + return Dependence(D).semantic().expr(); +} +inline ExprDependence toExprDependenceAsWritten(TypeDependence D) { return Dependence(D).expr(); } // Note: it's often necessary to strip `Dependent` from qualifiers. @@ -269,6 +288,9 @@ inline TypeDependence toTypeDependence(TemplateArgumentDependence D) { inline TypeDependence toSyntacticDependence(TypeDependence D) { return Dependence(D).syntactic().type(); } +inline TypeDependence toSemanticDependence(TypeDependence D) { + return Dependence(D).semantic().type(); +} inline NestedNameSpecifierDependence toNestedNameSpecifierDependendence(TypeDependence D) { diff --git a/clang/include/clang/AST/Expr.h b/clang/include/clang/AST/Expr.h index c32e74ac76ee..1f3d524691ed 100644 --- a/clang/include/clang/AST/Expr.h +++ b/clang/include/clang/AST/Expr.h @@ -1786,7 +1786,7 @@ class StringLiteral final /// * An array of getByteLength() char used to store the string data. public: - enum StringKind { Ascii, Wide, UTF8, UTF16, UTF32 }; + enum StringKind { Ordinary, Wide, UTF8, UTF16, UTF32 }; private: unsigned numTrailingObjects(OverloadToken) const { return 1; } @@ -1883,7 +1883,7 @@ public: return static_cast(StringLiteralBits.Kind); } - bool isAscii() const { return getKind() == Ascii; } + bool isOrdinary() const { return getKind() == Ordinary; } bool isWide() const { return getKind() == Wide; } bool isUTF8() const { return getKind() == UTF8; } bool isUTF16() const { return getKind() == UTF16; } @@ -3128,11 +3128,7 @@ public: setDependence(getDependence() | ExprDependence::TypeValueInstantiation); } - bool isCallToStdMove() const { - const FunctionDecl *FD = getDirectCallee(); - return getNumArgs() == 1 && FD && FD->isInStdNamespace() && - FD->getIdentifier() && FD->getIdentifier()->isStr("move"); - } + bool isCallToStdMove() const; static bool classof(const Stmt *T) { return T->getStmtClass() >= firstCallExprConstant && @@ -3497,7 +3493,6 @@ protected: CastExprBits.BasePathSize = BasePathSize; assert((CastExprBits.BasePathSize == BasePathSize) && "BasePathSize overflow!"); - setDependence(computeDependence(this)); assert(CastConsistency()); CastExprBits.HasFPFeatures = HasFPFeatures; } @@ -3631,6 +3626,7 @@ class ImplicitCastExpr final ExprValueKind VK) : CastExpr(ImplicitCastExprClass, ty, VK, kind, op, BasePathLength, FPO.requiresTrailingStorage()) { + setDependence(computeDependence(this)); if (hasStoredFPFeatures()) *getTrailingFPFeatures() = FPO; } @@ -3708,7 +3704,9 @@ protected: CastKind kind, Expr *op, unsigned PathSize, bool HasFPFeatures, TypeSourceInfo *writtenTy) : CastExpr(SC, exprTy, VK, kind, op, PathSize, HasFPFeatures), - TInfo(writtenTy) {} + TInfo(writtenTy) { + setDependence(computeDependence(this)); + } /// Construct an empty explicit cast. ExplicitCastExpr(StmtClass SC, EmptyShell Shell, unsigned PathSize, @@ -4680,16 +4678,17 @@ public: }; /// Represents a function call to one of __builtin_LINE(), __builtin_COLUMN(), -/// __builtin_FUNCTION(), or __builtin_FILE(). +/// __builtin_FUNCTION(), __builtin_FILE(), or __builtin_source_location(). class SourceLocExpr final : public Expr { SourceLocation BuiltinLoc, RParenLoc; DeclContext *ParentContext; public: - enum IdentKind { Function, File, Line, Column }; + enum IdentKind { Function, File, Line, Column, SourceLocStruct }; - SourceLocExpr(const ASTContext &Ctx, IdentKind Type, SourceLocation BLoc, - SourceLocation RParenLoc, DeclContext *Context); + SourceLocExpr(const ASTContext &Ctx, IdentKind Type, QualType ResultTy, + SourceLocation BLoc, SourceLocation RParenLoc, + DeclContext *Context); /// Build an empty call expression. explicit SourceLocExpr(EmptyShell Empty) : Expr(SourceLocExprClass, Empty) {} @@ -4706,18 +4705,18 @@ public: return static_cast(SourceLocExprBits.Kind); } - bool isStringType() const { + bool isIntType() const { switch (getIdentKind()) { case File: case Function: - return true; + case SourceLocStruct: + return false; case Line: case Column: - return false; + return true; } llvm_unreachable("unknown source location expression kind"); } - bool isIntType() const LLVM_READONLY { return !isStringType(); } /// If the SourceLocExpr has been resolved return the subexpression /// representing the resolved value. Otherwise return null. diff --git a/clang/include/clang/AST/ExprCXX.h b/clang/include/clang/AST/ExprCXX.h index 161287adce4c..967a74db916d 100644 --- a/clang/include/clang/AST/ExprCXX.h +++ b/clang/include/clang/AST/ExprCXX.h @@ -2261,15 +2261,32 @@ public: bool isArray() const { return CXXNewExprBits.IsArray; } + /// This might return None even if isArray() returns true, + /// since there might not be an array size expression. + /// If the result is not-None, it will never wrap a nullptr. Optional getArraySize() { if (!isArray()) return None; - return cast_or_null(getTrailingObjects()[arraySizeOffset()]); + + if (auto *Result = + cast_or_null(getTrailingObjects()[arraySizeOffset()])) + return Result; + + return None; } + + /// This might return None even if isArray() returns true, + /// since there might not be an array size expression. + /// If the result is not-None, it will never wrap a nullptr. Optional getArraySize() const { if (!isArray()) return None; - return cast_or_null(getTrailingObjects()[arraySizeOffset()]); + + if (auto *Result = + cast_or_null(getTrailingObjects()[arraySizeOffset()])) + return Result; + + return None; } unsigned getNumPlacementArgs() const { @@ -4681,18 +4698,19 @@ class CoroutineSuspendExpr : public Expr { SourceLocation KeywordLoc; - enum SubExpr { Common, Ready, Suspend, Resume, Count }; + enum SubExpr { Operand, Common, Ready, Suspend, Resume, Count }; Stmt *SubExprs[SubExpr::Count]; OpaqueValueExpr *OpaqueValue = nullptr; public: - CoroutineSuspendExpr(StmtClass SC, SourceLocation KeywordLoc, Expr *Common, - Expr *Ready, Expr *Suspend, Expr *Resume, + CoroutineSuspendExpr(StmtClass SC, SourceLocation KeywordLoc, Expr *Operand, + Expr *Common, Expr *Ready, Expr *Suspend, Expr *Resume, OpaqueValueExpr *OpaqueValue) : Expr(SC, Resume->getType(), Resume->getValueKind(), Resume->getObjectKind()), KeywordLoc(KeywordLoc), OpaqueValue(OpaqueValue) { + SubExprs[SubExpr::Operand] = Operand; SubExprs[SubExpr::Common] = Common; SubExprs[SubExpr::Ready] = Ready; SubExprs[SubExpr::Suspend] = Suspend; @@ -4701,10 +4719,11 @@ public: } CoroutineSuspendExpr(StmtClass SC, SourceLocation KeywordLoc, QualType Ty, - Expr *Common) + Expr *Operand, Expr *Common) : Expr(SC, Ty, VK_PRValue, OK_Ordinary), KeywordLoc(KeywordLoc) { assert(Common->isTypeDependent() && Ty->isDependentType() && "wrong constructor for non-dependent co_await/co_yield expression"); + SubExprs[SubExpr::Operand] = Operand; SubExprs[SubExpr::Common] = Common; SubExprs[SubExpr::Ready] = nullptr; SubExprs[SubExpr::Suspend] = nullptr; @@ -4713,14 +4732,13 @@ public: } CoroutineSuspendExpr(StmtClass SC, EmptyShell Empty) : Expr(SC, Empty) { + SubExprs[SubExpr::Operand] = nullptr; SubExprs[SubExpr::Common] = nullptr; SubExprs[SubExpr::Ready] = nullptr; SubExprs[SubExpr::Suspend] = nullptr; SubExprs[SubExpr::Resume] = nullptr; } - SourceLocation getKeywordLoc() const { return KeywordLoc; } - Expr *getCommonExpr() const { return static_cast(SubExprs[SubExpr::Common]); } @@ -4740,10 +4758,17 @@ public: return static_cast(SubExprs[SubExpr::Resume]); } + // The syntactic operand written in the code + Expr *getOperand() const { + return static_cast(SubExprs[SubExpr::Operand]); + } + + SourceLocation getKeywordLoc() const { return KeywordLoc; } + SourceLocation getBeginLoc() const LLVM_READONLY { return KeywordLoc; } SourceLocation getEndLoc() const LLVM_READONLY { - return getCommonExpr()->getEndLoc(); + return getOperand()->getEndLoc(); } child_range children() { @@ -4765,28 +4790,24 @@ class CoawaitExpr : public CoroutineSuspendExpr { friend class ASTStmtReader; public: - CoawaitExpr(SourceLocation CoawaitLoc, Expr *Operand, Expr *Ready, - Expr *Suspend, Expr *Resume, OpaqueValueExpr *OpaqueValue, - bool IsImplicit = false) - : CoroutineSuspendExpr(CoawaitExprClass, CoawaitLoc, Operand, Ready, - Suspend, Resume, OpaqueValue) { + CoawaitExpr(SourceLocation CoawaitLoc, Expr *Operand, Expr *Common, + Expr *Ready, Expr *Suspend, Expr *Resume, + OpaqueValueExpr *OpaqueValue, bool IsImplicit = false) + : CoroutineSuspendExpr(CoawaitExprClass, CoawaitLoc, Operand, Common, + Ready, Suspend, Resume, OpaqueValue) { CoawaitBits.IsImplicit = IsImplicit; } CoawaitExpr(SourceLocation CoawaitLoc, QualType Ty, Expr *Operand, - bool IsImplicit = false) - : CoroutineSuspendExpr(CoawaitExprClass, CoawaitLoc, Ty, Operand) { + Expr *Common, bool IsImplicit = false) + : CoroutineSuspendExpr(CoawaitExprClass, CoawaitLoc, Ty, Operand, + Common) { CoawaitBits.IsImplicit = IsImplicit; } CoawaitExpr(EmptyShell Empty) : CoroutineSuspendExpr(CoawaitExprClass, Empty) {} - Expr *getOperand() const { - // FIXME: Dig out the actual operand or store it. - return getCommonExpr(); - } - bool isImplicit() const { return CoawaitBits.IsImplicit; } void setIsImplicit(bool value = true) { CoawaitBits.IsImplicit = value; } @@ -4850,20 +4871,18 @@ class CoyieldExpr : public CoroutineSuspendExpr { friend class ASTStmtReader; public: - CoyieldExpr(SourceLocation CoyieldLoc, Expr *Operand, Expr *Ready, - Expr *Suspend, Expr *Resume, OpaqueValueExpr *OpaqueValue) - : CoroutineSuspendExpr(CoyieldExprClass, CoyieldLoc, Operand, Ready, - Suspend, Resume, OpaqueValue) {} - CoyieldExpr(SourceLocation CoyieldLoc, QualType Ty, Expr *Operand) - : CoroutineSuspendExpr(CoyieldExprClass, CoyieldLoc, Ty, Operand) {} + CoyieldExpr(SourceLocation CoyieldLoc, Expr *Operand, Expr *Common, + Expr *Ready, Expr *Suspend, Expr *Resume, + OpaqueValueExpr *OpaqueValue) + : CoroutineSuspendExpr(CoyieldExprClass, CoyieldLoc, Operand, Common, + Ready, Suspend, Resume, OpaqueValue) {} + CoyieldExpr(SourceLocation CoyieldLoc, QualType Ty, Expr *Operand, + Expr *Common) + : CoroutineSuspendExpr(CoyieldExprClass, CoyieldLoc, Ty, Operand, + Common) {} CoyieldExpr(EmptyShell Empty) : CoroutineSuspendExpr(CoyieldExprClass, Empty) {} - Expr *getOperand() const { - // FIXME: Dig out the actual operand or store it. - return getCommonExpr(); - } - static bool classof(const Stmt *T) { return T->getStmtClass() == CoyieldExprClass; } diff --git a/clang/include/clang/AST/ExprConcepts.h b/clang/include/clang/AST/ExprConcepts.h index 6849b65b71c0..fd9cd31f3b90 100644 --- a/clang/include/clang/AST/ExprConcepts.h +++ b/clang/include/clang/AST/ExprConcepts.h @@ -122,6 +122,8 @@ public: } SourceLocation getBeginLoc() const LLVM_READONLY { + if (auto QualifierLoc = getNestedNameSpecifierLoc()) + return QualifierLoc.getBeginLoc(); return ConceptName.getBeginLoc(); } diff --git a/clang/include/clang/AST/JSONNodeDumper.h b/clang/include/clang/AST/JSONNodeDumper.h index 5638df42a1c5..ed49e0007a18 100644 --- a/clang/include/clang/AST/JSONNodeDumper.h +++ b/clang/include/clang/AST/JSONNodeDumper.h @@ -160,6 +160,7 @@ class JSONNodeDumper std::string createPointerRepresentation(const void *Ptr); llvm::json::Object createQualType(QualType QT, bool Desugar = true); llvm::json::Object createBareDeclRef(const Decl *D); + llvm::json::Object createFPOptions(FPOptionsOverride FPO); void writeBareDeclRef(const Decl *D); llvm::json::Object createCXXRecordDefinitionData(const CXXRecordDecl *RD); llvm::json::Object createCXXBaseSpecifier(const CXXBaseSpecifier &BS); @@ -317,6 +318,7 @@ public: void VisitGotoStmt(const GotoStmt *GS); void VisitWhileStmt(const WhileStmt *WS); void VisitObjCAtCatchStmt(const ObjCAtCatchStmt *OACS); + void VisitCompoundStmt(const CompoundStmt *IS); void VisitNullTemplateArgument(const TemplateArgument &TA); void VisitTypeTemplateArgument(const TemplateArgument &TA); diff --git a/clang/include/clang/AST/Mangle.h b/clang/include/clang/AST/Mangle.h index 7d02f08e0120..96cc8c90a8e8 100644 --- a/clang/include/clang/AST/Mangle.h +++ b/clang/include/clang/AST/Mangle.h @@ -54,6 +54,9 @@ private: ASTContext &Context; DiagnosticsEngine &Diags; const ManglerKind Kind; + /// For aux target. If true, uses mangling number for aux target from + /// ASTContext. + bool IsAux = false; llvm::DenseMap GlobalBlockIds; llvm::DenseMap LocalBlockIds; @@ -62,10 +65,11 @@ private: public: ManglerKind getKind() const { return Kind; } - explicit MangleContext(ASTContext &Context, - DiagnosticsEngine &Diags, - ManglerKind Kind) - : Context(Context), Diags(Diags), Kind(Kind) {} + bool isAux() const { return IsAux; } + + explicit MangleContext(ASTContext &Context, DiagnosticsEngine &Diags, + ManglerKind Kind, bool IsAux = false) + : Context(Context), Diags(Diags), Kind(Kind), IsAux(IsAux) {} virtual ~MangleContext() { } @@ -172,8 +176,9 @@ class ItaniumMangleContext : public MangleContext { public: using DiscriminatorOverrideTy = llvm::Optional (*)(ASTContext &, const NamedDecl *); - explicit ItaniumMangleContext(ASTContext &C, DiagnosticsEngine &D) - : MangleContext(C, D, MK_Itanium) {} + explicit ItaniumMangleContext(ASTContext &C, DiagnosticsEngine &D, + bool IsAux = false) + : MangleContext(C, D, MK_Itanium, IsAux) {} virtual void mangleCXXVTable(const CXXRecordDecl *RD, raw_ostream &) = 0; virtual void mangleCXXVTT(const CXXRecordDecl *RD, raw_ostream &) = 0; @@ -194,6 +199,8 @@ public: virtual void mangleDynamicStermFinalizer(const VarDecl *D, raw_ostream &) = 0; + virtual void mangleModuleInitializer(const Module *Module, raw_ostream &) = 0; + // This has to live here, otherwise the CXXNameMangler won't have access to // it. virtual DiscriminatorOverrideTy getDiscriminatorOverride() const = 0; @@ -201,17 +208,19 @@ public: return C->getKind() == MK_Itanium; } - static ItaniumMangleContext *create(ASTContext &Context, - DiagnosticsEngine &Diags); + static ItaniumMangleContext * + create(ASTContext &Context, DiagnosticsEngine &Diags, bool IsAux = false); static ItaniumMangleContext *create(ASTContext &Context, DiagnosticsEngine &Diags, - DiscriminatorOverrideTy Discriminator); + DiscriminatorOverrideTy Discriminator, + bool IsAux = false); }; class MicrosoftMangleContext : public MangleContext { public: - explicit MicrosoftMangleContext(ASTContext &C, DiagnosticsEngine &D) - : MangleContext(C, D, MK_Microsoft) {} + explicit MicrosoftMangleContext(ASTContext &C, DiagnosticsEngine &D, + bool IsAux = false) + : MangleContext(C, D, MK_Microsoft, IsAux) {} /// Mangle vftable symbols. Only a subset of the bases along the path /// to the vftable are included in the name. It's up to the caller to pick @@ -270,8 +279,8 @@ public: return C->getKind() == MK_Microsoft; } - static MicrosoftMangleContext *create(ASTContext &Context, - DiagnosticsEngine &Diags); + static MicrosoftMangleContext * + create(ASTContext &Context, DiagnosticsEngine &Diags, bool IsAux = false); }; class ASTNameGenerator { diff --git a/clang/include/clang/AST/NestedNameSpecifier.h b/clang/include/clang/AST/NestedNameSpecifier.h index eb01780598a7..3b6cf9721185 100644 --- a/clang/include/clang/AST/NestedNameSpecifier.h +++ b/clang/include/clang/AST/NestedNameSpecifier.h @@ -162,7 +162,7 @@ public: /// Return the prefix of this nested name specifier. /// /// The prefix contains all of the parts of the nested name - /// specifier that preced this current specifier. For example, for a + /// specifier that precede this current specifier. For example, for a /// nested name specifier that represents "foo::bar::", the current /// specifier will contain "bar::" and the prefix will contain /// "foo::". diff --git a/clang/include/clang/AST/OpenMPClause.h b/clang/include/clang/AST/OpenMPClause.h index 3ecc1d40fafc..a745df114346 100644 --- a/clang/include/clang/AST/OpenMPClause.h +++ b/clang/include/clang/AST/OpenMPClause.h @@ -4746,14 +4746,24 @@ class OMPDependClause final friend OMPVarListClause; friend TrailingObjects; - /// Dependency type (one of in, out, inout). - OpenMPDependClauseKind DepKind = OMPC_DEPEND_unknown; +public: + struct DependDataTy final { + /// Dependency type (one of in, out, inout). + OpenMPDependClauseKind DepKind = OMPC_DEPEND_unknown; - /// Dependency type location. - SourceLocation DepLoc; + /// Dependency type location. + SourceLocation DepLoc; - /// Colon location. - SourceLocation ColonLoc; + /// Colon location. + SourceLocation ColonLoc; + + /// Location of 'omp_all_memory'. + SourceLocation OmpAllMemoryLoc; + }; + +private: + /// Dependency type and source locations. + DependDataTy Data; /// Number of loops, associated with the depend clause. unsigned NumLoops = 0; @@ -4784,13 +4794,16 @@ class OMPDependClause final NumLoops(NumLoops) {} /// Set dependency kind. - void setDependencyKind(OpenMPDependClauseKind K) { DepKind = K; } + void setDependencyKind(OpenMPDependClauseKind K) { Data.DepKind = K; } /// Set dependency kind and its location. - void setDependencyLoc(SourceLocation Loc) { DepLoc = Loc; } + void setDependencyLoc(SourceLocation Loc) { Data.DepLoc = Loc; } /// Set colon location. - void setColonLoc(SourceLocation Loc) { ColonLoc = Loc; } + void setColonLoc(SourceLocation Loc) { Data.ColonLoc = Loc; } + + /// Set the 'omp_all_memory' location. + void setOmpAllMemoryLoc(SourceLocation Loc) { Data.OmpAllMemoryLoc = Loc; } /// Sets optional dependency modifier. void setModifier(Expr *DepModifier); @@ -4802,18 +4815,15 @@ public: /// \param StartLoc Starting location of the clause. /// \param LParenLoc Location of '('. /// \param EndLoc Ending location of the clause. - /// \param DepKind Dependency type. - /// \param DepLoc Location of the dependency type. - /// \param ColonLoc Colon location. + /// \param Data Dependency type and source locations. /// \param VL List of references to the variables. /// \param NumLoops Number of loops that is associated with this depend /// clause. static OMPDependClause *Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, - SourceLocation EndLoc, Expr *DepModifier, - OpenMPDependClauseKind DepKind, - SourceLocation DepLoc, SourceLocation ColonLoc, - ArrayRef VL, unsigned NumLoops); + SourceLocation EndLoc, DependDataTy Data, + Expr *DepModifier, ArrayRef VL, + unsigned NumLoops); /// Creates an empty clause with \a N variables. /// @@ -4825,7 +4835,16 @@ public: unsigned NumLoops); /// Get dependency type. - OpenMPDependClauseKind getDependencyKind() const { return DepKind; } + OpenMPDependClauseKind getDependencyKind() const { return Data.DepKind; } + + /// Get dependency type location. + SourceLocation getDependencyLoc() const { return Data.DepLoc; } + + /// Get colon location. + SourceLocation getColonLoc() const { return Data.ColonLoc; } + + /// Get 'omp_all_memory' location. + SourceLocation getOmpAllMemoryLoc() const { return Data.OmpAllMemoryLoc; } /// Return optional depend modifier. Expr *getModifier(); @@ -4833,12 +4852,6 @@ public: return const_cast(this)->getModifier(); } - /// Get dependency type location. - SourceLocation getDependencyLoc() const { return DepLoc; } - - /// Get colon location. - SourceLocation getColonLoc() const { return ColonLoc; } - /// Get number of loops associated with the clause. unsigned getNumLoops() const { return NumLoops; } @@ -7416,6 +7429,110 @@ public: } }; +/// This represents clause 'has_device_ptr' in the '#pragma omp ...' +/// directives. +/// +/// \code +/// #pragma omp target has_device_addr(a,b) +/// \endcode +/// In this example directive '#pragma omp target' has clause +/// 'has_device_ptr' with the variables 'a' and 'b'. +class OMPHasDeviceAddrClause final + : public OMPMappableExprListClause, + private llvm::TrailingObjects< + OMPHasDeviceAddrClause, Expr *, ValueDecl *, unsigned, + OMPClauseMappableExprCommon::MappableComponent> { + friend class OMPClauseReader; + friend OMPMappableExprListClause; + friend OMPVarListClause; + friend TrailingObjects; + + /// Build clause with number of variables \a NumVars. + /// + /// \param Locs Locations needed to build a mappable clause. It includes 1) + /// StartLoc: starting location of the clause (the clause keyword); 2) + /// LParenLoc: location of '('; 3) EndLoc: ending location of the clause. + /// \param Sizes All required sizes to build a mappable clause. It includes 1) + /// NumVars: number of expressions listed in this clause; 2) + /// NumUniqueDeclarations: number of unique base declarations in this clause; + /// 3) NumComponentLists: number of component lists in this clause; and 4) + /// NumComponents: total number of expression components in the clause. + explicit OMPHasDeviceAddrClause(const OMPVarListLocTy &Locs, + const OMPMappableExprListSizeTy &Sizes) + : OMPMappableExprListClause(llvm::omp::OMPC_has_device_addr, Locs, + Sizes) {} + + /// Build an empty clause. + /// + /// \param Sizes All required sizes to build a mappable clause. It includes 1) + /// NumVars: number of expressions listed in this clause; 2) + /// NumUniqueDeclarations: number of unique base declarations in this clause; + /// 3) NumComponentLists: number of component lists in this clause; and 4) + /// NumComponents: total number of expression components in the clause. + explicit OMPHasDeviceAddrClause(const OMPMappableExprListSizeTy &Sizes) + : OMPMappableExprListClause(llvm::omp::OMPC_has_device_addr, + OMPVarListLocTy(), Sizes) {} + + /// Define the sizes of each trailing object array except the last one. This + /// is required for TrailingObjects to work properly. + size_t numTrailingObjects(OverloadToken) const { + return varlist_size(); + } + size_t numTrailingObjects(OverloadToken) const { + return getUniqueDeclarationsNum(); + } + size_t numTrailingObjects(OverloadToken) const { + return getUniqueDeclarationsNum() + getTotalComponentListNum(); + } + +public: + /// Creates clause with a list of variables \a Vars. + /// + /// \param C AST context. + /// \param Locs Locations needed to build a mappable clause. It includes 1) + /// StartLoc: starting location of the clause (the clause keyword); 2) + /// LParenLoc: location of '('; 3) EndLoc: ending location of the clause. + /// \param Vars The original expression used in the clause. + /// \param Declarations Declarations used in the clause. + /// \param ComponentLists Component lists used in the clause. + static OMPHasDeviceAddrClause * + Create(const ASTContext &C, const OMPVarListLocTy &Locs, + ArrayRef Vars, ArrayRef Declarations, + MappableExprComponentListsRef ComponentLists); + + /// Creates an empty clause with the place for \a NumVars variables. + /// + /// \param C AST context. + /// \param Sizes All required sizes to build a mappable clause. It includes 1) + /// NumVars: number of expressions listed in this clause; 2) + /// NumUniqueDeclarations: number of unique base declarations in this clause; + /// 3) NumComponentLists: number of component lists in this clause; and 4) + /// NumComponents: total number of expression components in the clause. + static OMPHasDeviceAddrClause * + CreateEmpty(const ASTContext &C, const OMPMappableExprListSizeTy &Sizes); + + 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 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() == llvm::omp::OMPC_has_device_addr; + } +}; + /// This represents clause 'nontemporal' in the '#pragma omp ...' directives. /// /// \code diff --git a/clang/include/clang/AST/ParentMapContext.h b/clang/include/clang/AST/ParentMapContext.h index 2edbc987850d..3c2e2f9640ca 100644 --- a/clang/include/clang/AST/ParentMapContext.h +++ b/clang/include/clang/AST/ParentMapContext.h @@ -90,29 +90,27 @@ public: /// Container for either a single DynTypedNode or for an ArrayRef to /// DynTypedNode. For use with ParentMap. class DynTypedNodeList { - llvm::AlignedCharArrayUnion> Storage; + union { + DynTypedNode SingleNode; + ArrayRef Nodes; + }; bool IsSingleNode; public: DynTypedNodeList(const DynTypedNode &N) : IsSingleNode(true) { - new (&Storage) DynTypedNode(N); + new (&SingleNode) DynTypedNode(N); } DynTypedNodeList(ArrayRef A) : IsSingleNode(false) { - new (&Storage) ArrayRef(A); + new (&Nodes) ArrayRef(A); } const DynTypedNode *begin() const { - if (!IsSingleNode) - return reinterpret_cast *>(&Storage) - ->begin(); - return reinterpret_cast(&Storage); + return !IsSingleNode ? Nodes.begin() : &SingleNode; } const DynTypedNode *end() const { - if (!IsSingleNode) - return reinterpret_cast *>(&Storage)->end(); - return reinterpret_cast(&Storage) + 1; + return !IsSingleNode ? Nodes.end() : &SingleNode + 1; } size_t size() const { return end() - begin(); } diff --git a/clang/include/clang/AST/PrettyPrinter.h b/clang/include/clang/AST/PrettyPrinter.h index fd40328d8dcf..cb25b2750dd4 100644 --- a/clang/include/clang/AST/PrettyPrinter.h +++ b/clang/include/clang/AST/PrettyPrinter.h @@ -74,7 +74,8 @@ struct PrintingPolicy { SuppressImplicitBase(false), FullyQualifiedName(false), PrintCanonicalTypes(false), PrintInjectedClassNameWithArguments(true), UsePreferredNames(true), AlwaysIncludeTypeForTemplateArgument(false), - CleanUglifiedParameters(false) {} + CleanUglifiedParameters(false), EntireContentsOfLargeArray(true), + UseEnumerators(true) {} /// 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 @@ -286,6 +287,14 @@ struct PrintingPolicy { /// This only affects parameter names, and so describes a compatible API. unsigned CleanUglifiedParameters : 1; + /// Whether to print the entire array initializers, especially on non-type + /// template parameters, no matter how many elements there are. + unsigned EntireContentsOfLargeArray : 1; + + /// Whether to print enumerator non-type template parameters with a matching + /// enumerator name or via cast of an integer. + unsigned UseEnumerators : 1; + /// Callbacks to use to allow the behavior of printing to be customized. const PrintingCallbacks *Callbacks = nullptr; }; diff --git a/clang/include/clang/AST/PropertiesBase.td b/clang/include/clang/AST/PropertiesBase.td index 9282b24eb68c..559f29edcf0f 100644 --- a/clang/include/clang/AST/PropertiesBase.td +++ b/clang/include/clang/AST/PropertiesBase.td @@ -79,6 +79,7 @@ def AttrKind : EnumPropertyType<"attr::Kind">; def AutoTypeKeyword : EnumPropertyType; def Bool : PropertyType<"bool">; def BuiltinTypeKind : EnumPropertyType<"BuiltinType::Kind">; +def BTFTypeTagAttr : PropertyType<"const BTFTypeTagAttr *">; def CallingConv : EnumPropertyType; def DeclarationName : PropertyType; def DeclarationNameKind : EnumPropertyType<"DeclarationName::NameKind">; @@ -619,6 +620,16 @@ let Class = PropertyTypeCase in { return TemplateName(declaration); }]>; } + +let Class = PropertyTypeCase in { + def : Property<"foundDecl", UsingShadowDeclRef> { + let Read = [{ node.getAsUsingShadowDecl() }]; + } + def : Creator<[{ + return TemplateName(foundDecl); + }]>; +} + let Class = PropertyTypeCase in { def : Property<"overloads", Array> { let Read = [{ node.getAsOverloadedTemplate()->decls() }]; @@ -652,12 +663,12 @@ let Class = PropertyTypeCase in { def : Property<"hasTemplateKeyword", Bool> { let Read = [{ qtn->hasTemplateKeyword() }]; } - def : Property<"declaration", TemplateDeclRef> { - let Read = [{ qtn->getTemplateDecl() }]; + def : Property<"underlyingTemplateName", TemplateName> { + let Read = [{ qtn->getUnderlyingTemplate() }]; } def : Creator<[{ return ctx.getQualifiedTemplateName(qualifier, hasTemplateKeyword, - declaration); + underlyingTemplateName); }]>; } let Class = PropertyTypeCase in { diff --git a/clang/include/clang/AST/Randstruct.h b/clang/include/clang/AST/Randstruct.h new file mode 100644 index 000000000000..d5eaf30919e3 --- /dev/null +++ b/clang/include/clang/AST/Randstruct.h @@ -0,0 +1,35 @@ +//===- Randstruct.h - Interfact for structure randomization -------*- 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 contains the interface for Clang's structure field layout +// randomization. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_CLANG_AST_RANDSTRUCT_H +#define LLVM_CLANG_AST_RANDSTRUCT_H + +namespace llvm { +template class SmallVectorImpl; +} // end namespace llvm + +namespace clang { + +class ASTContext; +class Decl; +class RecordDecl; + +namespace randstruct { + +bool randomizeStructureLayout(const ASTContext &Context, RecordDecl *RD, + llvm::SmallVectorImpl &FinalOrdering); + +} // namespace randstruct +} // namespace clang + +#endif // LLVM_CLANG_AST_RANDSTRUCT_H diff --git a/clang/include/clang/AST/RawCommentList.h b/clang/include/clang/AST/RawCommentList.h index a18432c2b768..1bb8d7ce40a9 100644 --- a/clang/include/clang/AST/RawCommentList.h +++ b/clang/include/clang/AST/RawCommentList.h @@ -139,6 +139,21 @@ public: std::string getFormattedText(const SourceManager &SourceMgr, DiagnosticsEngine &Diags) const; + struct CommentLine { + std::string Text; + PresumedLoc Begin; + PresumedLoc End; + + CommentLine(StringRef Text, PresumedLoc Begin, PresumedLoc End) + : Text(Text), Begin(Begin), End(End) {} + }; + + /// Returns sanitized comment text as separated lines with locations in + /// source, suitable for further processing and rendering requiring source + /// locations. + std::vector getFormattedLines(const SourceManager &SourceMgr, + DiagnosticsEngine &Diags) const; + /// Parse the comment, assuming it is attached to decl \c D. comments::FullComment *parse(const ASTContext &Context, const Preprocessor *PP, const Decl *D) const; diff --git a/clang/include/clang/AST/RecursiveASTVisitor.h b/clang/include/clang/AST/RecursiveASTVisitor.h index f62dc36de556..6c6d5402d5d1 100644 --- a/clang/include/clang/AST/RecursiveASTVisitor.h +++ b/clang/include/clang/AST/RecursiveASTVisitor.h @@ -13,18 +13,19 @@ #ifndef LLVM_CLANG_AST_RECURSIVEASTVISITOR_H #define LLVM_CLANG_AST_RECURSIVEASTVISITOR_H +#include "clang/AST/ASTConcept.h" #include "clang/AST/Attr.h" #include "clang/AST/Decl.h" -#include "clang/AST/DeclarationName.h" #include "clang/AST/DeclBase.h" #include "clang/AST/DeclCXX.h" #include "clang/AST/DeclFriend.h" #include "clang/AST/DeclObjC.h" #include "clang/AST/DeclOpenMP.h" #include "clang/AST/DeclTemplate.h" +#include "clang/AST/DeclarationName.h" #include "clang/AST/Expr.h" -#include "clang/AST/ExprConcepts.h" #include "clang/AST/ExprCXX.h" +#include "clang/AST/ExprConcepts.h" #include "clang/AST/ExprObjC.h" #include "clang/AST/ExprOpenMP.h" #include "clang/AST/LambdaCapture.h" @@ -319,10 +320,11 @@ public: bool TraverseSynOrSemInitListExpr(InitListExpr *S, DataRecursionQueue *Queue = nullptr); - /// Recursively visit a reference to a concept with potential arguments. + /// Recursively visit an Objective-C protocol reference with location + /// information. /// /// \returns false if the visitation was terminated early, true otherwise. - bool TraverseConceptReference(const ConceptReference &C); + bool TraverseObjCProtocolLoc(ObjCProtocolLoc ProtocolLoc); // ---- Methods on Attrs ---- @@ -469,11 +471,21 @@ public: DEF_TRAVERSE_TMPL_INST(Function) #undef DEF_TRAVERSE_TMPL_INST + bool TraverseTypeConstraint(const TypeConstraint *C); + + bool TraverseConceptRequirement(concepts::Requirement *R); + bool TraverseConceptTypeRequirement(concepts::TypeRequirement *R); + bool TraverseConceptExprRequirement(concepts::ExprRequirement *R); + bool TraverseConceptNestedRequirement(concepts::NestedRequirement *R); + bool dataTraverseNode(Stmt *S, DataRecursionQueue *Queue); private: // These are helper methods used by more than one Traverse* method. bool TraverseTemplateParameterListHelper(TemplateParameterList *TPL); + /// Traverses the qualifier, name and template arguments of a concept + /// reference. + bool TraverseConceptReferenceHelper(const ConceptReference &C); // Traverses template parameter lists of either a DeclaratorDecl or TagDecl. template @@ -505,6 +517,55 @@ private: bool PostVisitStmt(Stmt *S); }; +template +bool RecursiveASTVisitor::TraverseTypeConstraint( + const TypeConstraint *C) { + if (!getDerived().shouldVisitImplicitCode()) { + TRY_TO(TraverseConceptReferenceHelper(*C)); + return true; + } + if (Expr *IDC = C->getImmediatelyDeclaredConstraint()) { + TRY_TO(TraverseStmt(IDC)); + } else { + // Avoid traversing the ConceptReference in the TypeConstraint + // if we have an immediately-declared-constraint, otherwise + // we'll end up visiting the concept and the arguments in + // the TC twice. + TRY_TO(TraverseConceptReferenceHelper(*C)); + } + return true; +} + +template +bool RecursiveASTVisitor::TraverseConceptRequirement( + concepts::Requirement *R) { + switch (R->getKind()) { + case concepts::Requirement::RK_Type: + return getDerived().TraverseConceptTypeRequirement( + cast(R)); + case concepts::Requirement::RK_Simple: + case concepts::Requirement::RK_Compound: + return getDerived().TraverseConceptExprRequirement( + cast(R)); + case concepts::Requirement::RK_Nested: + return getDerived().TraverseConceptNestedRequirement( + cast(R)); + } + llvm_unreachable("unexpected case"); +} + +template +bool RecursiveASTVisitor::TraverseConceptReferenceHelper( + const ConceptReference &C) { + TRY_TO(TraverseNestedNameSpecifierLoc(C.getNestedNameSpecifierLoc())); + TRY_TO(TraverseDeclarationNameInfo(C.getConceptNameInfo())); + if (C.hasExplicitTemplateArgs()) + TRY_TO(TraverseTemplateArgumentLocsHelper( + C.getTemplateArgsAsWritten()->getTemplateArgs(), + C.getTemplateArgsAsWritten()->NumTemplateArgs)); + return true; +} + template bool RecursiveASTVisitor::dataTraverseNode(Stmt *S, DataRecursionQueue *Queue) { @@ -524,6 +585,40 @@ bool RecursiveASTVisitor::dataTraverseNode(Stmt *S, #undef DISPATCH_STMT +template +bool RecursiveASTVisitor::TraverseConceptTypeRequirement( + concepts::TypeRequirement *R) { + if (R->isSubstitutionFailure()) + return true; + return getDerived().TraverseTypeLoc(R->getType()->getTypeLoc()); +} + +template +bool RecursiveASTVisitor::TraverseConceptExprRequirement( + concepts::ExprRequirement *R) { + if (!R->isExprSubstitutionFailure()) + TRY_TO(TraverseStmt(R->getExpr())); + auto &RetReq = R->getReturnTypeRequirement(); + if (RetReq.isTypeConstraint()) { + if (getDerived().shouldVisitImplicitCode()) { + TRY_TO(TraverseTemplateParameterListHelper( + RetReq.getTypeConstraintTemplateParameterList())); + } else { + // Template parameter list is implicit, visit constraint directly. + TRY_TO(TraverseTypeConstraint(RetReq.getTypeConstraint())); + } + } + return true; +} + +template +bool RecursiveASTVisitor::TraverseConceptNestedRequirement( + concepts::NestedRequirement *R) { + if (!R->isSubstitutionFailure()) + return getDerived().TraverseStmt(R->getConstraintExpr()); + return true; +} + template bool RecursiveASTVisitor::PostVisitStmt(Stmt *S) { // In pre-order traversal mode, each Traverse##STMT method is responsible for @@ -1001,7 +1096,6 @@ DEF_TRAVERSE_TYPE(UnaryTransformType, { DEF_TRAVERSE_TYPE(AutoType, { TRY_TO(TraverseType(T->getDeducedType())); if (T->isConstrained()) { - TRY_TO(TraverseDecl(T->getTypeConstraintConcept())); TRY_TO(TraverseTemplateArguments(T->getArgs(), T->getNumArgs())); } }) @@ -1030,6 +1124,9 @@ DEF_TRAVERSE_TYPE(InjectedClassNameType, {}) DEF_TRAVERSE_TYPE(AttributedType, { TRY_TO(TraverseType(T->getModifiedType())); }) +DEF_TRAVERSE_TYPE(BTFTagAttributedType, + { TRY_TO(TraverseType(T->getWrappedType())); }) + DEF_TRAVERSE_TYPE(ParenType, { TRY_TO(TraverseType(T->getInnerType())); }) DEF_TRAVERSE_TYPE(MacroQualifiedType, @@ -1316,6 +1413,9 @@ DEF_TRAVERSE_TYPELOC(MacroQualifiedType, DEF_TRAVERSE_TYPELOC(AttributedType, { TRY_TO(TraverseTypeLoc(TL.getModifiedLoc())); }) +DEF_TRAVERSE_TYPELOC(BTFTagAttributedType, + { TRY_TO(TraverseTypeLoc(TL.getWrappedLoc())); }) + DEF_TRAVERSE_TYPELOC(ElaboratedType, { if (TL.getQualifierLoc()) { TRY_TO(TraverseNestedNameSpecifierLoc(TL.getQualifierLoc())); @@ -1340,7 +1440,12 @@ DEF_TRAVERSE_TYPELOC(DependentTemplateSpecializationType, { DEF_TRAVERSE_TYPELOC(PackExpansionType, { TRY_TO(TraverseTypeLoc(TL.getPatternLoc())); }) -DEF_TRAVERSE_TYPELOC(ObjCTypeParamType, {}) +DEF_TRAVERSE_TYPELOC(ObjCTypeParamType, { + for (unsigned I = 0, N = TL.getNumProtocols(); I != N; ++I) { + ObjCProtocolLoc ProtocolLoc(TL.getProtocol(I), TL.getProtocolLoc(I)); + TRY_TO(TraverseObjCProtocolLoc(ProtocolLoc)); + } +}) DEF_TRAVERSE_TYPELOC(ObjCInterfaceType, {}) @@ -1351,6 +1456,10 @@ DEF_TRAVERSE_TYPELOC(ObjCObjectType, { TRY_TO(TraverseTypeLoc(TL.getBaseLoc())); for (unsigned i = 0, n = TL.getNumTypeArgs(); i != n; ++i) TRY_TO(TraverseTypeLoc(TL.getTypeArgTInfo(i)->getTypeLoc())); + for (unsigned I = 0, N = TL.getNumProtocols(); I != N; ++I) { + ObjCProtocolLoc ProtocolLoc(TL.getProtocol(I), TL.getProtocolLoc(I)); + TRY_TO(TraverseObjCProtocolLoc(ProtocolLoc)); + } }) DEF_TRAVERSE_TYPELOC(ObjCObjectPointerType, @@ -1541,12 +1650,16 @@ DEF_TRAVERSE_DECL( DEF_TRAVERSE_DECL(ObjCCompatibleAliasDecl, {// FIXME: implement }) -DEF_TRAVERSE_DECL(ObjCCategoryDecl, {// FIXME: implement +DEF_TRAVERSE_DECL(ObjCCategoryDecl, { if (ObjCTypeParamList *typeParamList = D->getTypeParamList()) { for (auto typeParam : *typeParamList) { TRY_TO(TraverseObjCTypeParamDecl(typeParam)); } } + for (auto It : llvm::zip(D->protocols(), D->protocol_locs())) { + ObjCProtocolLoc ProtocolLoc(std::get<0>(It), std::get<1>(It)); + TRY_TO(TraverseObjCProtocolLoc(ProtocolLoc)); + } }) DEF_TRAVERSE_DECL(ObjCCategoryImplDecl, {// FIXME: implement @@ -1555,7 +1668,7 @@ DEF_TRAVERSE_DECL(ObjCCategoryImplDecl, {// FIXME: implement DEF_TRAVERSE_DECL(ObjCImplementationDecl, {// FIXME: implement }) -DEF_TRAVERSE_DECL(ObjCInterfaceDecl, {// FIXME: implement +DEF_TRAVERSE_DECL(ObjCInterfaceDecl, { if (ObjCTypeParamList *typeParamList = D->getTypeParamListAsWritten()) { for (auto typeParam : *typeParamList) { TRY_TO(TraverseObjCTypeParamDecl(typeParam)); @@ -1565,10 +1678,22 @@ DEF_TRAVERSE_DECL(ObjCInterfaceDecl, {// FIXME: implement if (TypeSourceInfo *superTInfo = D->getSuperClassTInfo()) { TRY_TO(TraverseTypeLoc(superTInfo->getTypeLoc())); } + if (D->isThisDeclarationADefinition()) { + for (auto It : llvm::zip(D->protocols(), D->protocol_locs())) { + ObjCProtocolLoc ProtocolLoc(std::get<0>(It), std::get<1>(It)); + TRY_TO(TraverseObjCProtocolLoc(ProtocolLoc)); + } + } }) -DEF_TRAVERSE_DECL(ObjCProtocolDecl, {// FIXME: implement - }) +DEF_TRAVERSE_DECL(ObjCProtocolDecl, { + if (D->isThisDeclarationADefinition()) { + for (auto It : llvm::zip(D->protocols(), D->protocol_locs())) { + ObjCProtocolLoc ProtocolLoc(std::get<0>(It), std::get<1>(It)); + TRY_TO(TraverseObjCProtocolLoc(ProtocolLoc)); + } + } +}) DEF_TRAVERSE_DECL(ObjCMethodDecl, { if (D->getReturnTypeSourceInfo()) { @@ -1801,17 +1926,8 @@ DEF_TRAVERSE_DECL(BuiltinTemplateDecl, { template bool RecursiveASTVisitor::TraverseTemplateTypeParamDeclConstraints( const TemplateTypeParmDecl *D) { - if (const auto *TC = D->getTypeConstraint()) { - if (Expr *IDC = TC->getImmediatelyDeclaredConstraint()) { - TRY_TO(TraverseStmt(IDC)); - } else { - // Avoid traversing the ConceptReference in the TypeCosntraint - // if we have an immediately-declared-constraint, otherwise - // we'll end up visiting the concept and the arguments in - // the TC twice. - TRY_TO(TraverseConceptReference(*TC)); - } - } + if (const auto *TC = D->getTypeConstraint()) + TRY_TO(TraverseTypeConstraint(TC)); return true; } @@ -1905,7 +2021,7 @@ DEF_TRAVERSE_DECL(RecordDecl, { TRY_TO(TraverseRecordHelper(D)); }) DEF_TRAVERSE_DECL(CXXRecordDecl, { TRY_TO(TraverseCXXRecordHelper(D)); }) -#define DEF_TRAVERSE_TMPL_SPEC_DECL(TMPLDECLKIND) \ +#define DEF_TRAVERSE_TMPL_SPEC_DECL(TMPLDECLKIND, DECLKIND) \ DEF_TRAVERSE_DECL(TMPLDECLKIND##TemplateSpecializationDecl, { \ /* For implicit instantiations ("set x;"), we don't want to \ recurse at all, since the instatiated template isn't written in \ @@ -1918,18 +2034,23 @@ DEF_TRAVERSE_DECL(CXXRecordDecl, { TRY_TO(TraverseCXXRecordHelper(D)); }) if (TypeSourceInfo *TSI = D->getTypeAsWritten()) \ TRY_TO(TraverseTypeLoc(TSI->getTypeLoc())); \ \ - TRY_TO(TraverseNestedNameSpecifierLoc(D->getQualifierLoc())); \ - if (!getDerived().shouldVisitTemplateInstantiations() && \ - D->getTemplateSpecializationKind() != TSK_ExplicitSpecialization) \ + if (getDerived().shouldVisitTemplateInstantiations() || \ + D->getTemplateSpecializationKind() == TSK_ExplicitSpecialization) { \ + /* Traverse base definition for explicit specializations */ \ + TRY_TO(Traverse##DECLKIND##Helper(D)); \ + } else { \ + TRY_TO(TraverseNestedNameSpecifierLoc(D->getQualifierLoc())); \ + \ /* Returning from here skips traversing the \ declaration context of the *TemplateSpecializationDecl \ (embedded in the DEF_TRAVERSE_DECL() macro) \ which contains the instantiated members of the template. */ \ return true; \ + } \ }) -DEF_TRAVERSE_TMPL_SPEC_DECL(Class) -DEF_TRAVERSE_TMPL_SPEC_DECL(Var) +DEF_TRAVERSE_TMPL_SPEC_DECL(Class, CXXRecord) +DEF_TRAVERSE_TMPL_SPEC_DECL(Var, Var) template bool RecursiveASTVisitor::TraverseTemplateArgumentLocsHelper( @@ -2002,6 +2123,7 @@ DEF_TRAVERSE_DECL(BindingDecl, { DEF_TRAVERSE_DECL(MSPropertyDecl, { TRY_TO(TraverseDeclaratorHelper(D)); }) DEF_TRAVERSE_DECL(MSGuidDecl, {}) +DEF_TRAVERSE_DECL(UnnamedGlobalConstantDecl, {}) DEF_TRAVERSE_DECL(TemplateParamObjectDecl, {}) @@ -2397,15 +2519,9 @@ bool RecursiveASTVisitor::TraverseSynOrSemInitListExpr( return true; } -template -bool RecursiveASTVisitor::TraverseConceptReference( - const ConceptReference &C) { - TRY_TO(TraverseNestedNameSpecifierLoc(C.getNestedNameSpecifierLoc())); - TRY_TO(TraverseDeclarationNameInfo(C.getConceptNameInfo())); - if (C.hasExplicitTemplateArgs()) - TRY_TO(TraverseTemplateArgumentLocsHelper( - C.getTemplateArgsAsWritten()->getTemplateArgs(), - C.getTemplateArgsAsWritten()->NumTemplateArgs)); +template +bool RecursiveASTVisitor::TraverseObjCProtocolLoc( + ObjCProtocolLoc ProtocolLoc) { return true; } @@ -2781,30 +2897,15 @@ DEF_TRAVERSE_STMT(CoyieldExpr, { } }) -DEF_TRAVERSE_STMT(ConceptSpecializationExpr, { - TRY_TO(TraverseConceptReference(*S)); -}) +DEF_TRAVERSE_STMT(ConceptSpecializationExpr, + { TRY_TO(TraverseConceptReferenceHelper(*S)); }) DEF_TRAVERSE_STMT(RequiresExpr, { TRY_TO(TraverseDecl(S->getBody())); for (ParmVarDecl *Parm : S->getLocalParameters()) TRY_TO(TraverseDecl(Parm)); for (concepts::Requirement *Req : S->getRequirements()) - if (auto *TypeReq = dyn_cast(Req)) { - if (!TypeReq->isSubstitutionFailure()) - TRY_TO(TraverseTypeLoc(TypeReq->getType()->getTypeLoc())); - } else if (auto *ExprReq = dyn_cast(Req)) { - if (!ExprReq->isExprSubstitutionFailure()) - TRY_TO(TraverseStmt(ExprReq->getExpr())); - auto &RetReq = ExprReq->getReturnTypeRequirement(); - if (RetReq.isTypeConstraint()) - TRY_TO(TraverseTemplateParameterListHelper( - RetReq.getTypeConstraintTemplateParameterList())); - } else { - auto *NestedReq = cast(Req); - if (!NestedReq->isSubstitutionFailure()) - TRY_TO(TraverseStmt(NestedReq->getConstraintExpr())); - } + TRY_TO(TraverseConceptRequirement(Req)); }) // These literals (all of them) do not need any action. @@ -2893,6 +2994,9 @@ DEF_TRAVERSE_STMT(OMPParallelForSimdDirective, DEF_TRAVERSE_STMT(OMPParallelMasterDirective, { TRY_TO(TraverseOMPExecutableDirective(S)); }) +DEF_TRAVERSE_STMT(OMPParallelMaskedDirective, + { TRY_TO(TraverseOMPExecutableDirective(S)); }) + DEF_TRAVERSE_STMT(OMPParallelSectionsDirective, { TRY_TO(TraverseOMPExecutableDirective(S)); }) @@ -2974,6 +3078,18 @@ DEF_TRAVERSE_STMT(OMPParallelMasterTaskLoopDirective, DEF_TRAVERSE_STMT(OMPParallelMasterTaskLoopSimdDirective, { TRY_TO(TraverseOMPExecutableDirective(S)); }) +DEF_TRAVERSE_STMT(OMPMaskedTaskLoopDirective, + { TRY_TO(TraverseOMPExecutableDirective(S)); }) + +DEF_TRAVERSE_STMT(OMPMaskedTaskLoopSimdDirective, + { TRY_TO(TraverseOMPExecutableDirective(S)); }) + +DEF_TRAVERSE_STMT(OMPParallelMaskedTaskLoopDirective, + { TRY_TO(TraverseOMPExecutableDirective(S)); }) + +DEF_TRAVERSE_STMT(OMPParallelMaskedTaskLoopSimdDirective, + { TRY_TO(TraverseOMPExecutableDirective(S)); }) + DEF_TRAVERSE_STMT(OMPDistributeDirective, { TRY_TO(TraverseOMPExecutableDirective(S)); }) @@ -3031,6 +3147,17 @@ DEF_TRAVERSE_STMT(OMPMaskedDirective, DEF_TRAVERSE_STMT(OMPGenericLoopDirective, { TRY_TO(TraverseOMPExecutableDirective(S)); }) +DEF_TRAVERSE_STMT(OMPTeamsGenericLoopDirective, + { TRY_TO(TraverseOMPExecutableDirective(S)); }) + +DEF_TRAVERSE_STMT(OMPTargetTeamsGenericLoopDirective, + { TRY_TO(TraverseOMPExecutableDirective(S)); }) + +DEF_TRAVERSE_STMT(OMPParallelGenericLoopDirective, + { TRY_TO(TraverseOMPExecutableDirective(S)); }) + +DEF_TRAVERSE_STMT(OMPTargetParallelGenericLoopDirective, + { TRY_TO(TraverseOMPExecutableDirective(S)); }) // OpenMP clauses. template bool RecursiveASTVisitor::TraverseOMPClause(OMPClause *C) { @@ -3647,6 +3774,13 @@ bool RecursiveASTVisitor::VisitOMPIsDevicePtrClause( return true; } +template +bool RecursiveASTVisitor::VisitOMPHasDeviceAddrClause( + OMPHasDeviceAddrClause *C) { + TRY_TO(VisitOMPClauseList(C)); + return true; +} + template bool RecursiveASTVisitor::VisitOMPNontemporalClause( OMPNontemporalClause *C) { diff --git a/clang/include/clang/AST/Stmt.h b/clang/include/clang/AST/Stmt.h index a32126d23d31..49a66a1ea5b8 100644 --- a/clang/include/clang/AST/Stmt.h +++ b/clang/include/clang/AST/Stmt.h @@ -19,6 +19,7 @@ #include "clang/Basic/CapturedStmt.h" #include "clang/Basic/IdentifierTable.h" #include "clang/Basic/LLVM.h" +#include "clang/Basic/LangOptions.h" #include "clang/Basic/SourceLocation.h" #include "clang/Basic/Specifiers.h" #include "llvm/ADT/ArrayRef.h" @@ -128,10 +129,11 @@ protected: unsigned : NumStmtBits; - unsigned NumStmts : 32 - NumStmtBits; + /// True if the compound statement has one or more pragmas that set some + /// floating-point features. + unsigned HasFPFeatures : 1; - /// The location of the opening "{". - SourceLocation LBraceLoc; + unsigned NumStmts; }; class LabelStmtBitfields { @@ -594,8 +596,8 @@ protected: unsigned : NumExprBits; /// The kind of source location builtin represented by the SourceLocExpr. - /// Ex. __builtin_LINE, __builtin_FUNCTION, ect. - unsigned Kind : 2; + /// Ex. __builtin_LINE, __builtin_FUNCTION, etc. + unsigned Kind : 3; }; class StmtExprBitfields { @@ -1244,7 +1246,7 @@ public: } /// Child Iterators: All subclasses must implement 'children' - /// to permit easy iteration over the substatements/subexpessions of an + /// to permit easy iteration over the substatements/subexpressions of an /// AST node. This permits easy iteration over all nodes in the AST. using child_iterator = StmtIterator; using const_child_iterator = ConstStmtIterator; @@ -1401,36 +1403,61 @@ public: }; /// CompoundStmt - This represents a group of statements like { stmt stmt }. -class CompoundStmt final : public Stmt, - private llvm::TrailingObjects { +class CompoundStmt final + : public Stmt, + private llvm::TrailingObjects { friend class ASTStmtReader; friend TrailingObjects; - /// The location of the closing "}". LBraceLoc is stored in CompoundStmtBits. + /// The location of the opening "{". + SourceLocation LBraceLoc; + + /// The location of the closing "}". SourceLocation RBraceLoc; - CompoundStmt(ArrayRef Stmts, SourceLocation LB, SourceLocation RB); + CompoundStmt(ArrayRef Stmts, FPOptionsOverride FPFeatures, + SourceLocation LB, SourceLocation RB); explicit CompoundStmt(EmptyShell Empty) : Stmt(CompoundStmtClass, Empty) {} void setStmts(ArrayRef Stmts); + /// Set FPOptionsOverride in trailing storage. Used only by Serialization. + void setStoredFPFeatures(FPOptionsOverride F) { + assert(hasStoredFPFeatures()); + *getTrailingObjects() = F; + } + + size_t numTrailingObjects(OverloadToken) const { + return CompoundStmtBits.NumStmts; + } + public: static CompoundStmt *Create(const ASTContext &C, ArrayRef Stmts, - SourceLocation LB, SourceLocation RB); + FPOptionsOverride FPFeatures, SourceLocation LB, + SourceLocation RB); // Build an empty compound statement with a location. explicit CompoundStmt(SourceLocation Loc) - : Stmt(CompoundStmtClass), RBraceLoc(Loc) { + : Stmt(CompoundStmtClass), LBraceLoc(Loc), RBraceLoc(Loc) { CompoundStmtBits.NumStmts = 0; - CompoundStmtBits.LBraceLoc = Loc; + CompoundStmtBits.HasFPFeatures = 0; } // Build an empty compound statement. - static CompoundStmt *CreateEmpty(const ASTContext &C, unsigned NumStmts); + static CompoundStmt *CreateEmpty(const ASTContext &C, unsigned NumStmts, + bool HasFPFeatures); bool body_empty() const { return CompoundStmtBits.NumStmts == 0; } unsigned size() const { return CompoundStmtBits.NumStmts; } + bool hasStoredFPFeatures() const { return CompoundStmtBits.HasFPFeatures; } + + /// Get FPOptionsOverride from trailing storage. + FPOptionsOverride getStoredFPFeatures() const { + assert(hasStoredFPFeatures()); + return *getTrailingObjects(); + } + using body_iterator = Stmt **; using body_range = llvm::iterator_range; @@ -1505,10 +1532,10 @@ public: return const_cast(this)->getStmtExprResult(); } - SourceLocation getBeginLoc() const { return CompoundStmtBits.LBraceLoc; } + SourceLocation getBeginLoc() const { return LBraceLoc; } SourceLocation getEndLoc() const { return RBraceLoc; } - SourceLocation getLBracLoc() const { return CompoundStmtBits.LBraceLoc; } + SourceLocation getLBracLoc() const { return LBraceLoc; } SourceLocation getRBracLoc() const { return RBraceLoc; } static bool classof(const Stmt *T) { diff --git a/clang/include/clang/AST/StmtCXX.h b/clang/include/clang/AST/StmtCXX.h index 4d1f3e8ef255..2c71f8676896 100644 --- a/clang/include/clang/AST/StmtCXX.h +++ b/clang/include/clang/AST/StmtCXX.h @@ -327,7 +327,6 @@ class CoroutineBodyStmt final Allocate, ///< Coroutine frame memory allocation. Deallocate, ///< Coroutine frame memory deallocation. ReturnValue, ///< Return value for thunk function: p.get_return_object(). - ResultDecl, ///< Declaration holding the result of get_return_object. ReturnStmt, ///< Return statement for the thunk function. ReturnStmtOnAllocFailure, ///< Return statement if allocation failed. FirstParamMove ///< First offset for move construction of parameter copies. @@ -354,7 +353,6 @@ public: Expr *Allocate = nullptr; Expr *Deallocate = nullptr; Expr *ReturnValue = nullptr; - Stmt *ResultDecl = nullptr; Stmt *ReturnStmt = nullptr; Stmt *ReturnStmtOnAllocFailure = nullptr; ArrayRef ParamMoves; @@ -409,7 +407,11 @@ public: Expr *getReturnValueInit() const { return cast(getStoredStmts()[SubStmt::ReturnValue]); } - Stmt *getResultDecl() const { return getStoredStmts()[SubStmt::ResultDecl]; } + Expr *getReturnValue() const { + assert(getReturnStmt()); + auto *RS = cast(getReturnStmt()); + return RS->getRetValue(); + } Stmt *getReturnStmt() const { return getStoredStmts()[SubStmt::ReturnStmt]; } Stmt *getReturnStmtOnAllocFailure() const { return getStoredStmts()[SubStmt::ReturnStmtOnAllocFailure]; @@ -495,16 +497,10 @@ public: } child_range children() { - if (!getOperand()) - return child_range(SubStmts + SubStmt::PromiseCall, - SubStmts + SubStmt::Count); return child_range(SubStmts, SubStmts + SubStmt::Count); } const_child_range children() const { - if (!getOperand()) - return const_child_range(SubStmts + SubStmt::PromiseCall, - SubStmts + SubStmt::Count); return const_child_range(SubStmts, SubStmts + SubStmt::Count); } diff --git a/clang/include/clang/AST/StmtOpenMP.h b/clang/include/clang/AST/StmtOpenMP.h index d5b5c9580da9..702a82537ab2 100644 --- a/clang/include/clang/AST/StmtOpenMP.h +++ b/clang/include/clang/AST/StmtOpenMP.h @@ -1523,9 +1523,17 @@ public: T->getStmtClass() == OMPParallelForSimdDirectiveClass || T->getStmtClass() == OMPTaskLoopDirectiveClass || T->getStmtClass() == OMPTaskLoopSimdDirectiveClass || + T->getStmtClass() == OMPMaskedTaskLoopDirectiveClass || + T->getStmtClass() == OMPMaskedTaskLoopSimdDirectiveClass || T->getStmtClass() == OMPMasterTaskLoopDirectiveClass || T->getStmtClass() == OMPMasterTaskLoopSimdDirectiveClass || T->getStmtClass() == OMPGenericLoopDirectiveClass || + T->getStmtClass() == OMPTeamsGenericLoopDirectiveClass || + T->getStmtClass() == OMPTargetTeamsGenericLoopDirectiveClass || + T->getStmtClass() == OMPParallelGenericLoopDirectiveClass || + T->getStmtClass() == OMPTargetParallelGenericLoopDirectiveClass || + T->getStmtClass() == OMPParallelMaskedTaskLoopDirectiveClass || + T->getStmtClass() == OMPParallelMaskedTaskLoopSimdDirectiveClass || T->getStmtClass() == OMPParallelMasterTaskLoopDirectiveClass || T->getStmtClass() == OMPParallelMasterTaskLoopSimdDirectiveClass || T->getStmtClass() == OMPDistributeDirectiveClass || @@ -2300,6 +2308,69 @@ public: } }; +/// This represents '#pragma omp parallel masked' directive. +/// +/// \code +/// #pragma omp parallel masked filter(tid) +/// \endcode +/// In this example directive '#pragma omp parallel masked' has a clause +/// 'filter' with the variable tid +/// +class OMPParallelMaskedDirective final : public OMPExecutableDirective { + friend class ASTStmtReader; + friend class OMPExecutableDirective; + + OMPParallelMaskedDirective(SourceLocation StartLoc, SourceLocation EndLoc) + : OMPExecutableDirective(OMPParallelMaskedDirectiveClass, + llvm::omp::OMPD_parallel_masked, StartLoc, + EndLoc) {} + + explicit OMPParallelMaskedDirective() + : OMPExecutableDirective(OMPParallelMaskedDirectiveClass, + llvm::omp::OMPD_parallel_masked, + SourceLocation(), SourceLocation()) {} + + /// Sets special task reduction descriptor. + void setTaskReductionRefExpr(Expr *E) { Data->getChildren()[0] = E; } + +public: + /// Creates directive with a list of \a Clauses. + /// + /// \param C AST context. + /// \param StartLoc Starting location of the directive kind. + /// \param EndLoc Ending Location of the directive. + /// \param Clauses List of clauses. + /// \param AssociatedStmt Statement, associated with the directive. + /// \param TaskRedRef Task reduction special reference expression to handle + /// taskgroup descriptor. + /// + static OMPParallelMaskedDirective * + Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, + ArrayRef Clauses, Stmt *AssociatedStmt, Expr *TaskRedRef); + + /// Creates an empty directive with the place for \a NumClauses + /// clauses. + /// + /// \param C AST context. + /// \param NumClauses Number of clauses. + /// + static OMPParallelMaskedDirective * + CreateEmpty(const ASTContext &C, unsigned NumClauses, EmptyShell); + + /// Returns special task reduction reference expression. + Expr *getTaskReductionRefExpr() { + return cast_or_null(Data->getChildren()[0]); + } + const Expr *getTaskReductionRefExpr() const { + return const_cast(this) + ->getTaskReductionRefExpr(); + } + + static bool classof(const Stmt *T) { + return T->getStmtClass() == OMPParallelMaskedDirectiveClass; + } +}; + /// This represents '#pragma omp parallel sections' directive. /// /// \code @@ -2823,25 +2894,31 @@ public: class OMPAtomicDirective : public OMPExecutableDirective { friend class ASTStmtReader; friend class OMPExecutableDirective; - /// Used for 'atomic update' or 'atomic capture' constructs. They may - /// have atomic expressions of forms - /// \code - /// x = x binop expr; - /// x = expr binop x; - /// \endcode - /// This field is true for the first form of the expression and false for the - /// second. Required for correct codegen of non-associative operations (like - /// << or >>). - bool IsXLHSInRHSPart = false; - /// Used for 'atomic update' or 'atomic capture' constructs. They may - /// have atomic expressions of forms - /// \code - /// v = x; ; - /// ; v = x; - /// \endcode - /// This field is true for the first(postfix) form of the expression and false - /// otherwise. - bool IsPostfixUpdate = false; + + struct FlagTy { + /// Used for 'atomic update' or 'atomic capture' constructs. They may + /// have atomic expressions of forms: + /// \code + /// x = x binop expr; + /// x = expr binop x; + /// \endcode + /// This field is 1 for the first form of the expression and 0 for the + /// second. Required for correct codegen of non-associative operations (like + /// << or >>). + uint8_t IsXLHSInRHSPart : 1; + /// Used for 'atomic update' or 'atomic capture' constructs. They may + /// have atomic expressions of forms: + /// \code + /// v = x; ; + /// ; v = x; + /// \endcode + /// This field is 1 for the first(postfix) form of the expression and 0 + /// otherwise. + uint8_t IsPostfixUpdate : 1; + /// 1 if 'v' is updated only when the condition is false (compare capture + /// only). + uint8_t IsFailOnly : 1; + } Flags; /// Build directive with the given start and end location. /// @@ -2863,6 +2940,9 @@ class OMPAtomicDirective : public OMPExecutableDirective { POS_V, POS_E, POS_UpdateExpr, + POS_D, + POS_Cond, + POS_R, }; /// Set 'x' part of the associated expression/statement. @@ -2875,10 +2955,42 @@ class OMPAtomicDirective : public OMPExecutableDirective { } /// Set 'v' part of the associated expression/statement. void setV(Expr *V) { Data->getChildren()[DataPositionTy::POS_V] = V; } + /// Set 'r' part of the associated expression/statement. + void setR(Expr *R) { Data->getChildren()[DataPositionTy::POS_R] = R; } /// Set 'expr' part of the associated expression/statement. void setExpr(Expr *E) { Data->getChildren()[DataPositionTy::POS_E] = E; } + /// Set 'd' part of the associated expression/statement. + void setD(Expr *D) { Data->getChildren()[DataPositionTy::POS_D] = D; } + /// Set conditional expression in `atomic compare`. + void setCond(Expr *C) { Data->getChildren()[DataPositionTy::POS_Cond] = C; } public: + struct Expressions { + /// 'x' part of the associated expression/statement. + Expr *X = nullptr; + /// 'v' part of the associated expression/statement. + Expr *V = nullptr; + // 'r' part of the associated expression/statement. + Expr *R = nullptr; + /// 'expr' part of the associated expression/statement. + Expr *E = nullptr; + /// UE Helper expression of the form: + /// 'OpaqueValueExpr(x) binop OpaqueValueExpr(expr)' or + /// 'OpaqueValueExpr(expr) binop OpaqueValueExpr(x)'. + Expr *UE = nullptr; + /// 'd' part of the associated expression/statement. + Expr *D = nullptr; + /// Conditional expression in `atomic compare` construct. + Expr *Cond = nullptr; + /// True if UE has the first form and false if the second. + bool IsXLHSInRHSPart; + /// True if original value of 'x' must be stored in 'v', not an updated one. + bool IsPostfixUpdate; + /// True if 'v' is updated only when the condition is false (compare capture + /// only). + bool IsFailOnly; + }; + /// Creates directive with a list of \a Clauses and 'x', 'v' and 'expr' /// parts of the atomic construct (see Section 2.12.6, atomic Construct, for /// detailed description of 'x', 'v' and 'expr'). @@ -2888,20 +3000,12 @@ public: /// \param EndLoc Ending Location of the directive. /// \param Clauses List of clauses. /// \param AssociatedStmt Statement, associated with the directive. - /// \param X 'x' part of the associated expression/statement. - /// \param V 'v' part of the associated expression/statement. - /// \param E 'expr' part of the associated expression/statement. - /// \param UE Helper expression of the form - /// 'OpaqueValueExpr(x) binop OpaqueValueExpr(expr)' or - /// 'OpaqueValueExpr(expr) binop OpaqueValueExpr(x)'. - /// \param IsXLHSInRHSPart true if \a UE has the first form and false if the - /// second. - /// \param IsPostfixUpdate true if original value of 'x' must be stored in - /// 'v', not an updated one. - static OMPAtomicDirective * - Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, - ArrayRef Clauses, Stmt *AssociatedStmt, Expr *X, Expr *V, - Expr *E, Expr *UE, bool IsXLHSInRHSPart, bool IsPostfixUpdate); + /// \param Exprs Associated expressions or statements. + static OMPAtomicDirective *Create(const ASTContext &C, + SourceLocation StartLoc, + SourceLocation EndLoc, + ArrayRef Clauses, + Stmt *AssociatedStmt, Expressions Exprs); /// Creates an empty directive with the place for \a NumClauses /// clauses. @@ -2933,10 +3037,13 @@ public: /// Return true if helper update expression has form /// 'OpaqueValueExpr(x) binop OpaqueValueExpr(expr)' and false if it has form /// 'OpaqueValueExpr(expr) binop OpaqueValueExpr(x)'. - bool isXLHSInRHSPart() const { return IsXLHSInRHSPart; } + bool isXLHSInRHSPart() const { return Flags.IsXLHSInRHSPart; } /// Return true if 'v' expression must be updated to original value of /// 'x', false if 'v' must be updated to the new value of 'x'. - bool isPostfixUpdate() const { return IsPostfixUpdate; } + bool isPostfixUpdate() const { return Flags.IsPostfixUpdate; } + /// Return true if 'v' is updated only when the condition is evaluated false + /// (compare capture only). + bool isFailOnly() const { return Flags.IsFailOnly; } /// Get 'v' part of the associated expression/statement. Expr *getV() { return cast_or_null(Data->getChildren()[DataPositionTy::POS_V]); @@ -2944,6 +3051,13 @@ public: const Expr *getV() const { return cast_or_null(Data->getChildren()[DataPositionTy::POS_V]); } + /// Get 'r' part of the associated expression/statement. + Expr *getR() { + return cast_or_null(Data->getChildren()[DataPositionTy::POS_R]); + } + const Expr *getR() const { + return cast_or_null(Data->getChildren()[DataPositionTy::POS_R]); + } /// Get 'expr' part of the associated expression/statement. Expr *getExpr() { return cast_or_null(Data->getChildren()[DataPositionTy::POS_E]); @@ -2951,6 +3065,20 @@ public: const Expr *getExpr() const { return cast_or_null(Data->getChildren()[DataPositionTy::POS_E]); } + /// Get 'd' part of the associated expression/statement. + Expr *getD() { + return cast_or_null(Data->getChildren()[DataPositionTy::POS_D]); + } + Expr *getD() const { + return cast_or_null(Data->getChildren()[DataPositionTy::POS_D]); + } + /// Get the 'cond' part of the source atomic expression. + Expr *getCondExpr() { + return cast_or_null(Data->getChildren()[DataPositionTy::POS_Cond]); + } + Expr *getCondExpr() const { + return cast_or_null(Data->getChildren()[DataPositionTy::POS_Cond]); + } static bool classof(const Stmt *T) { return T->getStmtClass() == OMPAtomicDirectiveClass; @@ -3734,6 +3862,82 @@ public: } }; +/// This represents '#pragma omp masked taskloop' directive. +/// +/// \code +/// #pragma omp masked taskloop private(a,b) grainsize(val) num_tasks(num) +/// \endcode +/// In this example directive '#pragma omp masked taskloop' has clauses +/// 'private' with the variables 'a' and 'b', 'grainsize' with expression 'val' +/// and 'num_tasks' with expression 'num'. +/// +class OMPMaskedTaskLoopDirective final : public OMPLoopDirective { + friend class ASTStmtReader; + friend class OMPExecutableDirective; + /// true if the construct has inner cancel directive. + bool HasCancel = false; + + /// Build directive with the given start and end location. + /// + /// \param StartLoc Starting location of the directive kind. + /// \param EndLoc Ending location of the directive. + /// \param CollapsedNum Number of collapsed nested loops. + /// + OMPMaskedTaskLoopDirective(SourceLocation StartLoc, SourceLocation EndLoc, + unsigned CollapsedNum) + : OMPLoopDirective(OMPMaskedTaskLoopDirectiveClass, + llvm::omp::OMPD_masked_taskloop, StartLoc, EndLoc, + CollapsedNum) {} + + /// Build an empty directive. + /// + /// \param CollapsedNum Number of collapsed nested loops. + /// + explicit OMPMaskedTaskLoopDirective(unsigned CollapsedNum) + : OMPLoopDirective(OMPMaskedTaskLoopDirectiveClass, + llvm::omp::OMPD_masked_taskloop, SourceLocation(), + SourceLocation(), CollapsedNum) {} + + /// Set cancel state. + void setHasCancel(bool Has) { HasCancel = Has; } + +public: + /// Creates directive with a list of \a Clauses. + /// + /// \param C AST context. + /// \param StartLoc Starting location of the directive kind. + /// \param EndLoc Ending Location of the directive. + /// \param CollapsedNum Number of collapsed loops. + /// \param Clauses List of clauses. + /// \param AssociatedStmt Statement, associated with the directive. + /// \param Exprs Helper expressions for CodeGen. + /// \param HasCancel true if this directive has inner cancel directive. + /// + static OMPMaskedTaskLoopDirective * + Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, + unsigned CollapsedNum, ArrayRef Clauses, + Stmt *AssociatedStmt, const HelperExprs &Exprs, bool HasCancel); + + /// Creates an empty directive with the place + /// for \a NumClauses clauses. + /// + /// \param C AST context. + /// \param CollapsedNum Number of collapsed nested loops. + /// \param NumClauses Number of clauses. + /// + static OMPMaskedTaskLoopDirective *CreateEmpty(const ASTContext &C, + unsigned NumClauses, + unsigned CollapsedNum, + EmptyShell); + + /// Return true if current directive has inner cancel directive. + bool hasCancel() const { return HasCancel; } + + static bool classof(const Stmt *T) { + return T->getStmtClass() == OMPMaskedTaskLoopDirectiveClass; + } +}; + /// This represents '#pragma omp master taskloop simd' directive. /// /// \code @@ -3799,6 +4003,71 @@ public: } }; +/// This represents '#pragma omp masked taskloop simd' directive. +/// +/// \code +/// #pragma omp masked taskloop simd private(a,b) grainsize(val) num_tasks(num) +/// \endcode +/// In this example directive '#pragma omp masked taskloop simd' has clauses +/// 'private' with the variables 'a' and 'b', 'grainsize' with expression 'val' +/// and 'num_tasks' with expression 'num'. +/// +class OMPMaskedTaskLoopSimdDirective final : public OMPLoopDirective { + friend class ASTStmtReader; + friend class OMPExecutableDirective; + /// Build directive with the given start and end location. + /// + /// \param StartLoc Starting location of the directive kind. + /// \param EndLoc Ending location of the directive. + /// \param CollapsedNum Number of collapsed nested loops. + /// + OMPMaskedTaskLoopSimdDirective(SourceLocation StartLoc, SourceLocation EndLoc, + unsigned CollapsedNum) + : OMPLoopDirective(OMPMaskedTaskLoopSimdDirectiveClass, + llvm::omp::OMPD_masked_taskloop_simd, StartLoc, EndLoc, + CollapsedNum) {} + + /// Build an empty directive. + /// + /// \param CollapsedNum Number of collapsed nested loops. + /// + explicit OMPMaskedTaskLoopSimdDirective(unsigned CollapsedNum) + : OMPLoopDirective(OMPMaskedTaskLoopSimdDirectiveClass, + llvm::omp::OMPD_masked_taskloop_simd, SourceLocation(), + SourceLocation(), CollapsedNum) {} + +public: + /// Creates directive with a list of \p Clauses. + /// + /// \param C AST context. + /// \param StartLoc Starting location of the directive kind. + /// \param EndLoc Ending Location of the directive. + /// \param CollapsedNum Number of collapsed loops. + /// \param Clauses List of clauses. + /// \param AssociatedStmt Statement, associated with the directive. + /// \param Exprs Helper expressions for CodeGen. + /// + static OMPMaskedTaskLoopSimdDirective * + Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, + unsigned CollapsedNum, ArrayRef Clauses, + Stmt *AssociatedStmt, const HelperExprs &Exprs); + + /// Creates an empty directive with the place for \p NumClauses clauses. + /// + /// \param C AST context. + /// \param CollapsedNum Number of collapsed nested loops. + /// \param NumClauses Number of clauses. + /// + static OMPMaskedTaskLoopSimdDirective *CreateEmpty(const ASTContext &C, + unsigned NumClauses, + unsigned CollapsedNum, + EmptyShell); + + static bool classof(const Stmt *T) { + return T->getStmtClass() == OMPMaskedTaskLoopSimdDirectiveClass; + } +}; + /// This represents '#pragma omp parallel master taskloop' directive. /// /// \code @@ -3877,6 +4146,84 @@ public: } }; +/// This represents '#pragma omp parallel masked taskloop' directive. +/// +/// \code +/// #pragma omp parallel masked taskloop private(a,b) grainsize(val) +/// num_tasks(num) +/// \endcode +/// In this example directive '#pragma omp parallel masked taskloop' has clauses +/// 'private' with the variables 'a' and 'b', 'grainsize' with expression 'val' +/// and 'num_tasks' with expression 'num'. +/// +class OMPParallelMaskedTaskLoopDirective final : public OMPLoopDirective { + friend class ASTStmtReader; + friend class OMPExecutableDirective; + /// true if the construct has inner cancel directive. + bool HasCancel = false; + + /// Build directive with the given start and end location. + /// + /// \param StartLoc Starting location of the directive kind. + /// \param EndLoc Ending location of the directive. + /// \param CollapsedNum Number of collapsed nested loops. + /// + OMPParallelMaskedTaskLoopDirective(SourceLocation StartLoc, + SourceLocation EndLoc, + unsigned CollapsedNum) + : OMPLoopDirective(OMPParallelMaskedTaskLoopDirectiveClass, + llvm::omp::OMPD_parallel_masked_taskloop, StartLoc, + EndLoc, CollapsedNum) {} + + /// Build an empty directive. + /// + /// \param CollapsedNum Number of collapsed nested loops. + /// + explicit OMPParallelMaskedTaskLoopDirective(unsigned CollapsedNum) + : OMPLoopDirective(OMPParallelMaskedTaskLoopDirectiveClass, + llvm::omp::OMPD_parallel_masked_taskloop, + SourceLocation(), SourceLocation(), CollapsedNum) {} + + /// Set cancel state. + void setHasCancel(bool Has) { HasCancel = Has; } + +public: + /// Creates directive with a list of \a Clauses. + /// + /// \param C AST context. + /// \param StartLoc Starting location of the directive kind. + /// \param EndLoc Ending Location of the directive. + /// \param CollapsedNum Number of collapsed loops. + /// \param Clauses List of clauses. + /// \param AssociatedStmt Statement, associated with the directive. + /// \param Exprs Helper expressions for CodeGen. + /// \param HasCancel true if this directive has inner cancel directive. + /// + static OMPParallelMaskedTaskLoopDirective * + Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, + unsigned CollapsedNum, ArrayRef Clauses, + Stmt *AssociatedStmt, const HelperExprs &Exprs, bool HasCancel); + + /// Creates an empty directive with the place + /// for \a NumClauses clauses. + /// + /// \param C AST context. + /// \param CollapsedNum Number of collapsed nested loops. + /// \param NumClauses Number of clauses. + /// + static OMPParallelMaskedTaskLoopDirective *CreateEmpty(const ASTContext &C, + unsigned NumClauses, + unsigned CollapsedNum, + EmptyShell); + + /// Return true if current directive has inner cancel directive. + bool hasCancel() const { return HasCancel; } + + static bool classof(const Stmt *T) { + return T->getStmtClass() == OMPParallelMaskedTaskLoopDirectiveClass; + } +}; + /// This represents '#pragma omp parallel master taskloop simd' directive. /// /// \code @@ -3944,6 +4291,73 @@ public: } }; +/// This represents '#pragma omp parallel masked taskloop simd' directive. +/// +/// \code +/// #pragma omp parallel masked taskloop simd private(a,b) grainsize(val) +/// num_tasks(num) +/// \endcode +/// In this example directive '#pragma omp parallel masked taskloop simd' has +/// clauses 'private' with the variables 'a' and 'b', 'grainsize' with +/// expression 'val' and 'num_tasks' with expression 'num'. +/// +class OMPParallelMaskedTaskLoopSimdDirective final : public OMPLoopDirective { + friend class ASTStmtReader; + friend class OMPExecutableDirective; + /// Build directive with the given start and end location. + /// + /// \param StartLoc Starting location of the directive kind. + /// \param EndLoc Ending location of the directive. + /// \param CollapsedNum Number of collapsed nested loops. + /// + OMPParallelMaskedTaskLoopSimdDirective(SourceLocation StartLoc, + SourceLocation EndLoc, + unsigned CollapsedNum) + : OMPLoopDirective(OMPParallelMaskedTaskLoopSimdDirectiveClass, + llvm::omp::OMPD_parallel_masked_taskloop_simd, + StartLoc, EndLoc, CollapsedNum) {} + + /// Build an empty directive. + /// + /// \param CollapsedNum Number of collapsed nested loops. + /// + explicit OMPParallelMaskedTaskLoopSimdDirective(unsigned CollapsedNum) + : OMPLoopDirective(OMPParallelMaskedTaskLoopSimdDirectiveClass, + llvm::omp::OMPD_parallel_masked_taskloop_simd, + SourceLocation(), SourceLocation(), CollapsedNum) {} + +public: + /// Creates directive with a list of \p Clauses. + /// + /// \param C AST context. + /// \param StartLoc Starting location of the directive kind. + /// \param EndLoc Ending Location of the directive. + /// \param CollapsedNum Number of collapsed loops. + /// \param Clauses List of clauses. + /// \param AssociatedStmt Statement, associated with the directive. + /// \param Exprs Helper expressions for CodeGen. + /// + static OMPParallelMaskedTaskLoopSimdDirective * + Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, + unsigned CollapsedNum, ArrayRef Clauses, + Stmt *AssociatedStmt, const HelperExprs &Exprs); + + /// Creates an empty directive with the place + /// for \a NumClauses clauses. + /// + /// \param C AST context. + /// \param CollapsedNum Number of collapsed nested loops. + /// \param NumClauses Number of clauses. + /// + static OMPParallelMaskedTaskLoopSimdDirective * + CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, + EmptyShell); + + static bool classof(const Stmt *T) { + return T->getStmtClass() == OMPParallelMaskedTaskLoopSimdDirectiveClass; + } +}; + /// This represents '#pragma omp distribute' directive. /// /// \code @@ -5546,6 +5960,266 @@ public: } }; +/// This represents '#pragma omp teams loop' directive. +/// +/// \code +/// #pragma omp teams loop private(a,b) order(concurrent) +/// \endcode +/// In this example directive '#pragma omp teams loop' has +/// clauses 'private' with the variables 'a' and 'b', and order(concurrent). +/// +class OMPTeamsGenericLoopDirective final : public OMPLoopDirective { + friend class ASTStmtReader; + friend class OMPExecutableDirective; + /// Build directive with the given start and end location. + /// + /// \param StartLoc Starting location of the directive kind. + /// \param EndLoc Ending location of the directive. + /// \param CollapsedNum Number of collapsed nested loops. + /// + OMPTeamsGenericLoopDirective(SourceLocation StartLoc, SourceLocation EndLoc, + unsigned CollapsedNum) + : OMPLoopDirective(OMPTeamsGenericLoopDirectiveClass, + llvm::omp::OMPD_teams_loop, StartLoc, EndLoc, + CollapsedNum) {} + + /// Build an empty directive. + /// + /// \param CollapsedNum Number of collapsed nested loops. + /// + explicit OMPTeamsGenericLoopDirective(unsigned CollapsedNum) + : OMPLoopDirective(OMPTeamsGenericLoopDirectiveClass, + llvm::omp::OMPD_teams_loop, SourceLocation(), + SourceLocation(), CollapsedNum) {} + +public: + /// Creates directive with a list of \p Clauses. + /// + /// \param C AST context. + /// \param StartLoc Starting location of the directive kind. + /// \param EndLoc Ending Location of the directive. + /// \param CollapsedNum Number of collapsed loops. + /// \param Clauses List of clauses. + /// \param AssociatedStmt Statement, associated with the directive. + /// \param Exprs Helper expressions for CodeGen. + /// + static OMPTeamsGenericLoopDirective * + Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, + unsigned CollapsedNum, ArrayRef Clauses, + Stmt *AssociatedStmt, const HelperExprs &Exprs); + + /// Creates an empty directive with the place + /// for \a NumClauses clauses. + /// + /// \param C AST context. + /// \param CollapsedNum Number of collapsed nested loops. + /// \param NumClauses Number of clauses. + /// + static OMPTeamsGenericLoopDirective *CreateEmpty(const ASTContext &C, + unsigned NumClauses, + unsigned CollapsedNum, + EmptyShell); + + static bool classof(const Stmt *T) { + return T->getStmtClass() == OMPTeamsGenericLoopDirectiveClass; + } +}; + +/// This represents '#pragma omp target teams loop' directive. +/// +/// \code +/// #pragma omp target teams loop private(a,b) order(concurrent) +/// \endcode +/// In this example directive '#pragma omp target teams loop' has +/// clauses 'private' with the variables 'a' and 'b', and order(concurrent). +/// +class OMPTargetTeamsGenericLoopDirective final : public OMPLoopDirective { + friend class ASTStmtReader; + friend class OMPExecutableDirective; + /// Build directive with the given start and end location. + /// + /// \param StartLoc Starting location of the directive kind. + /// \param EndLoc Ending location of the directive. + /// \param CollapsedNum Number of collapsed nested loops. + /// + OMPTargetTeamsGenericLoopDirective(SourceLocation StartLoc, + SourceLocation EndLoc, + unsigned CollapsedNum) + : OMPLoopDirective(OMPTargetTeamsGenericLoopDirectiveClass, + llvm::omp::OMPD_target_teams_loop, StartLoc, EndLoc, + CollapsedNum) {} + + /// Build an empty directive. + /// + /// \param CollapsedNum Number of collapsed nested loops. + /// + explicit OMPTargetTeamsGenericLoopDirective(unsigned CollapsedNum) + : OMPLoopDirective(OMPTargetTeamsGenericLoopDirectiveClass, + llvm::omp::OMPD_target_teams_loop, SourceLocation(), + SourceLocation(), CollapsedNum) {} + +public: + /// Creates directive with a list of \p Clauses. + /// + /// \param C AST context. + /// \param StartLoc Starting location of the directive kind. + /// \param EndLoc Ending Location of the directive. + /// \param CollapsedNum Number of collapsed loops. + /// \param Clauses List of clauses. + /// \param AssociatedStmt Statement, associated with the directive. + /// \param Exprs Helper expressions for CodeGen. + /// + static OMPTargetTeamsGenericLoopDirective * + Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, + unsigned CollapsedNum, ArrayRef Clauses, + Stmt *AssociatedStmt, const HelperExprs &Exprs); + + /// Creates an empty directive with the place + /// for \a NumClauses clauses. + /// + /// \param C AST context. + /// \param CollapsedNum Number of collapsed nested loops. + /// \param NumClauses Number of clauses. + /// + static OMPTargetTeamsGenericLoopDirective *CreateEmpty(const ASTContext &C, + unsigned NumClauses, + unsigned CollapsedNum, + EmptyShell); + + static bool classof(const Stmt *T) { + return T->getStmtClass() == OMPTargetTeamsGenericLoopDirectiveClass; + } +}; + +/// This represents '#pragma omp parallel loop' directive. +/// +/// \code +/// #pragma omp parallel loop private(a,b) order(concurrent) +/// \endcode +/// In this example directive '#pragma omp parallel loop' has +/// clauses 'private' with the variables 'a' and 'b', and order(concurrent). +/// +class OMPParallelGenericLoopDirective final : public OMPLoopDirective { + friend class ASTStmtReader; + friend class OMPExecutableDirective; + /// Build directive with the given start and end location. + /// + /// \param StartLoc Starting location of the directive kind. + /// \param EndLoc Ending location of the directive. + /// \param CollapsedNum Number of collapsed nested loops. + /// + OMPParallelGenericLoopDirective(SourceLocation StartLoc, + SourceLocation EndLoc, unsigned CollapsedNum) + : OMPLoopDirective(OMPParallelGenericLoopDirectiveClass, + llvm::omp::OMPD_parallel_loop, StartLoc, EndLoc, + CollapsedNum) {} + + /// Build an empty directive. + /// + /// \param CollapsedNum Number of collapsed nested loops. + /// + explicit OMPParallelGenericLoopDirective(unsigned CollapsedNum) + : OMPLoopDirective(OMPParallelGenericLoopDirectiveClass, + llvm::omp::OMPD_parallel_loop, SourceLocation(), + SourceLocation(), CollapsedNum) {} + +public: + /// Creates directive with a list of \p Clauses. + /// + /// \param C AST context. + /// \param StartLoc Starting location of the directive kind. + /// \param EndLoc Ending Location of the directive. + /// \param CollapsedNum Number of collapsed loops. + /// \param Clauses List of clauses. + /// \param AssociatedStmt Statement, associated with the directive. + /// \param Exprs Helper expressions for CodeGen. + /// + static OMPParallelGenericLoopDirective * + Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, + unsigned CollapsedNum, ArrayRef Clauses, + Stmt *AssociatedStmt, const HelperExprs &Exprs); + + /// Creates an empty directive with the place + /// for \a NumClauses clauses. + /// + /// \param C AST context. + /// \param CollapsedNum Number of collapsed nested loops. + /// \param NumClauses Number of clauses. + /// + static OMPParallelGenericLoopDirective *CreateEmpty(const ASTContext &C, + unsigned NumClauses, + unsigned CollapsedNum, + EmptyShell); + + static bool classof(const Stmt *T) { + return T->getStmtClass() == OMPParallelGenericLoopDirectiveClass; + } +}; + +/// This represents '#pragma omp target parallel loop' directive. +/// +/// \code +/// #pragma omp target parallel loop private(a,b) order(concurrent) +/// \endcode +/// In this example directive '#pragma omp target parallel loop' has +/// clauses 'private' with the variables 'a' and 'b', and order(concurrent). +/// +class OMPTargetParallelGenericLoopDirective final : public OMPLoopDirective { + friend class ASTStmtReader; + friend class OMPExecutableDirective; + /// Build directive with the given start and end location. + /// + /// \param StartLoc Starting location of the directive kind. + /// \param EndLoc Ending location of the directive. + /// \param CollapsedNum Number of collapsed nested loops. + /// + OMPTargetParallelGenericLoopDirective(SourceLocation StartLoc, + SourceLocation EndLoc, + unsigned CollapsedNum) + : OMPLoopDirective(OMPTargetParallelGenericLoopDirectiveClass, + llvm::omp::OMPD_target_parallel_loop, StartLoc, EndLoc, + CollapsedNum) {} + + /// Build an empty directive. + /// + /// \param CollapsedNum Number of collapsed nested loops. + /// + explicit OMPTargetParallelGenericLoopDirective(unsigned CollapsedNum) + : OMPLoopDirective(OMPTargetParallelGenericLoopDirectiveClass, + llvm::omp::OMPD_target_parallel_loop, SourceLocation(), + SourceLocation(), CollapsedNum) {} + +public: + /// Creates directive with a list of \p Clauses. + /// + /// \param C AST context. + /// \param StartLoc Starting location of the directive kind. + /// \param EndLoc Ending Location of the directive. + /// \param CollapsedNum Number of collapsed loops. + /// \param Clauses List of clauses. + /// \param AssociatedStmt Statement, associated with the directive. + /// \param Exprs Helper expressions for CodeGen. + /// + static OMPTargetParallelGenericLoopDirective * + Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation EndLoc, + unsigned CollapsedNum, ArrayRef Clauses, + Stmt *AssociatedStmt, const HelperExprs &Exprs); + + /// Creates an empty directive with the place + /// for \a NumClauses clauses. + /// + /// \param C AST context. + /// \param CollapsedNum Number of collapsed nested loops. + /// \param NumClauses Number of clauses. + /// + static OMPTargetParallelGenericLoopDirective * + CreateEmpty(const ASTContext &C, unsigned NumClauses, unsigned CollapsedNum, + EmptyShell); + + static bool classof(const Stmt *T) { + return T->getStmtClass() == OMPTargetParallelGenericLoopDirectiveClass; + } +}; } // end namespace clang #endif diff --git a/clang/include/clang/AST/TemplateBase.h b/clang/include/clang/AST/TemplateBase.h index e8064121d279..3ac755ef74a1 100644 --- a/clang/include/clang/AST/TemplateBase.h +++ b/clang/include/clang/AST/TemplateBase.h @@ -618,6 +618,9 @@ private: ASTTemplateArgumentListInfo(const TemplateArgumentListInfo &List); + // FIXME: Is it ever necessary to copy to another context? + ASTTemplateArgumentListInfo(const ASTTemplateArgumentListInfo *List); + public: /// The source location of the left angle bracket ('<'). SourceLocation LAngleLoc; @@ -647,6 +650,10 @@ public: static const ASTTemplateArgumentListInfo * Create(const ASTContext &C, const TemplateArgumentListInfo &List); + + // FIXME: Is it ever necessary to copy to another context? + static const ASTTemplateArgumentListInfo * + Create(const ASTContext &C, const ASTTemplateArgumentListInfo *List); }; /// Represents an explicit template argument list in C++, e.g., diff --git a/clang/include/clang/AST/TemplateName.h b/clang/include/clang/AST/TemplateName.h index 44080a7f56d4..ca85adac648b 100644 --- a/clang/include/clang/AST/TemplateName.h +++ b/clang/include/clang/AST/TemplateName.h @@ -25,6 +25,7 @@ namespace clang { class ASTContext; +class Decl; class DependentTemplateName; class IdentifierInfo; class NamedDecl; @@ -39,6 +40,7 @@ class SubstTemplateTemplateParmStorage; class TemplateArgument; class TemplateDecl; class TemplateTemplateParmDecl; +class UsingShadowDecl; /// Implementation class used to describe either a set of overloaded /// template names or an already-substituted template template parameter pack. @@ -188,8 +190,12 @@ public: /// specifier in the typedef. "apply" is a nested template, and can /// only be understood in the context of class TemplateName { + // NameDecl is either a TemplateDecl or a UsingShadowDecl depending on the + // NameKind. + // !! There is no free low bits in 32-bit builds to discriminate more than 4 + // pointer types in PointerUnion. using StorageType = - llvm::PointerUnion; StorageType Storage; @@ -224,7 +230,11 @@ public: /// A template template parameter pack that has been substituted for /// a template template argument pack, but has not yet been expanded into /// individual arguments. - SubstTemplateTemplateParmPack + SubstTemplateTemplateParmPack, + + /// A template name that refers to a template declaration found through a + /// specific using shadow declaration. + UsingTemplate, }; TemplateName() = default; @@ -235,6 +245,7 @@ public: explicit TemplateName(SubstTemplateTemplateParmPackStorage *Storage); explicit TemplateName(QualifiedTemplateName *Qual); explicit TemplateName(DependentTemplateName *Dep); + explicit TemplateName(UsingShadowDecl *Using); /// Determine whether this template name is NULL. bool isNull() const; @@ -287,6 +298,10 @@ public: /// structure, if any. DependentTemplateName *getAsDependentTemplateName() const; + /// Retrieve the using shadow declaration through which the underlying + /// template declaration is introduced, if any. + UsingShadowDecl *getAsUsingShadowDecl() const; + TemplateName getUnderlying() const; /// Get the template name to substitute when this template name is used as a @@ -399,13 +414,19 @@ class QualifiedTemplateName : public llvm::FoldingSetNode { /// this name with DependentTemplateName). llvm::PointerIntPair Qualifier; - /// The template declaration or set of overloaded function templates - /// that this qualified name refers to. - TemplateDecl *Template; + /// The underlying template name, it is either + /// 1) a Template -- a template declaration that this qualified name refers + /// to. + /// 2) or a UsingTemplate -- a template declaration introduced by a + /// using-shadow declaration. + TemplateName UnderlyingTemplate; QualifiedTemplateName(NestedNameSpecifier *NNS, bool TemplateKeyword, - TemplateDecl *Template) - : Qualifier(NNS, TemplateKeyword? 1 : 0), Template(Template) {} + TemplateName Template) + : Qualifier(NNS, TemplateKeyword ? 1 : 0), UnderlyingTemplate(Template) { + assert(UnderlyingTemplate.getKind() == TemplateName::Template || + UnderlyingTemplate.getKind() == TemplateName::UsingTemplate); + } public: /// Return the nested name specifier that qualifies this name. @@ -415,23 +436,18 @@ public: /// keyword. bool hasTemplateKeyword() const { return Qualifier.getInt(); } - /// The template declaration that this qualified name refers - /// to. - TemplateDecl *getDecl() const { return Template; } - - /// The template declaration to which this qualified name - /// refers. - TemplateDecl *getTemplateDecl() const { return Template; } + /// Return the underlying template name. + TemplateName getUnderlyingTemplate() const { return UnderlyingTemplate; } void Profile(llvm::FoldingSetNodeID &ID) { - Profile(ID, getQualifier(), hasTemplateKeyword(), getTemplateDecl()); + Profile(ID, getQualifier(), hasTemplateKeyword(), UnderlyingTemplate); } static void Profile(llvm::FoldingSetNodeID &ID, NestedNameSpecifier *NNS, - bool TemplateKeyword, TemplateDecl *Template) { + bool TemplateKeyword, TemplateName TN) { ID.AddPointer(NNS); ID.AddBoolean(TemplateKeyword); - ID.AddPointer(Template); + ID.AddPointer(TN.getAsVoidPointer()); } }; diff --git a/clang/include/clang/AST/TextNodeDumper.h b/clang/include/clang/AST/TextNodeDumper.h index 41bbf2ec593a..2e4bcdd27a8a 100644 --- a/clang/include/clang/AST/TextNodeDumper.h +++ b/clang/include/clang/AST/TextNodeDumper.h @@ -246,6 +246,7 @@ public: void VisitLabelStmt(const LabelStmt *Node); void VisitGotoStmt(const GotoStmt *Node); void VisitCaseStmt(const CaseStmt *Node); + void VisitCompoundStmt(const CompoundStmt *Node); void VisitConstantExpr(const ConstantExpr *Node); void VisitCallExpr(const CallExpr *Node); void VisitCXXOperatorCallExpr(const CXXOperatorCallExpr *Node); @@ -317,6 +318,8 @@ public: void VisitTagType(const TagType *T); void VisitTemplateTypeParmType(const TemplateTypeParmType *T); void VisitAutoType(const AutoType *T); + void VisitDeducedTemplateSpecializationType( + const DeducedTemplateSpecializationType *T); void VisitTemplateSpecializationType(const TemplateSpecializationType *T); void VisitInjectedClassNameType(const InjectedClassNameType *T); void VisitObjCInterfaceType(const ObjCInterfaceType *T); diff --git a/clang/include/clang/AST/Type.h b/clang/include/clang/AST/Type.h index a69c0ae67d0a..61c153b1f675 100644 --- a/clang/include/clang/AST/Type.h +++ b/clang/include/clang/AST/Type.h @@ -57,6 +57,7 @@ namespace clang { +class BTFTypeTagAttr; class ExtQuals; class QualType; class ConceptDecl; @@ -264,16 +265,31 @@ public: bool hasOnlyConst() const { return Mask == Const; } void removeConst() { Mask &= ~Const; } void addConst() { Mask |= Const; } + Qualifiers withConst() const { + Qualifiers Qs = *this; + Qs.addConst(); + return Qs; + } bool hasVolatile() const { return Mask & Volatile; } bool hasOnlyVolatile() const { return Mask == Volatile; } void removeVolatile() { Mask &= ~Volatile; } void addVolatile() { Mask |= Volatile; } + Qualifiers withVolatile() const { + Qualifiers Qs = *this; + Qs.addVolatile(); + return Qs; + } bool hasRestrict() const { return Mask & Restrict; } bool hasOnlyRestrict() const { return Mask == Restrict; } void removeRestrict() { Mask &= ~Restrict; } void addRestrict() { Mask |= Restrict; } + Qualifiers withRestrict() const { + Qualifiers Qs = *this; + Qs.addRestrict(); + return Qs; + } bool hasCVRQualifiers() const { return getCVRQualifiers(); } unsigned getCVRQualifiers() const { return Mask & CVRMask; } @@ -608,6 +624,47 @@ private: static const uint32_t AddressSpaceShift = 9; }; +class QualifiersAndAtomic { + Qualifiers Quals; + bool HasAtomic; + +public: + QualifiersAndAtomic() : HasAtomic(false) {} + QualifiersAndAtomic(Qualifiers Quals, bool HasAtomic) + : Quals(Quals), HasAtomic(HasAtomic) {} + + operator Qualifiers() const { return Quals; } + + bool hasVolatile() const { return Quals.hasVolatile(); } + bool hasConst() const { return Quals.hasConst(); } + bool hasRestrict() const { return Quals.hasRestrict(); } + bool hasAtomic() const { return HasAtomic; } + + void addVolatile() { Quals.addVolatile(); } + void addConst() { Quals.addConst(); } + void addRestrict() { Quals.addRestrict(); } + void addAtomic() { HasAtomic = true; } + + void removeVolatile() { Quals.removeVolatile(); } + void removeConst() { Quals.removeConst(); } + void removeRestrict() { Quals.removeRestrict(); } + void removeAtomic() { HasAtomic = false; } + + QualifiersAndAtomic withVolatile() { + return {Quals.withVolatile(), HasAtomic}; + } + QualifiersAndAtomic withConst() { return {Quals.withConst(), HasAtomic}; } + QualifiersAndAtomic withRestrict() { + return {Quals.withRestrict(), HasAtomic}; + } + QualifiersAndAtomic withAtomic() { return {Quals, true}; } + + QualifiersAndAtomic &operator+=(Qualifiers RHS) { + Quals += RHS; + return *this; + } +}; + /// A std::pair-like structure for storing a qualified type split /// into its local qualifiers and its locally-unqualified type. struct SplitQualType { @@ -829,6 +886,8 @@ public: /// Return true if this is a trivially copyable type (C++0x [basic.types]p9) bool isTriviallyCopyableType(const ASTContext &Context) const; + /// Return true if this is a trivially relocatable type. + bool isTriviallyRelocatableType(const ASTContext &Context) const; /// Returns true if it is a class and it might be dynamic. bool mayBeDynamicClass() const; @@ -930,6 +989,10 @@ public: /// The resulting type might still be qualified if it's sugar for an array /// type. To strip qualifiers even from within a sugared array type, use /// ASTContext::getUnqualifiedArrayType. + /// + /// Note: In C, the _Atomic qualifier is special (see C2x 6.2.5p29 for + /// details), and it is not stripped by this function. Use + /// getAtomicUnqualifiedType() to strip qualifiers including _Atomic. inline QualType getUnqualifiedType() const; /// Retrieve the unqualified variant of the given type, removing as little @@ -1311,6 +1374,8 @@ private: static bool hasNonTrivialToPrimitiveCopyCUnion(const RecordDecl *RD); }; +raw_ostream &operator<<(raw_ostream &OS, QualType QT); + } // namespace clang namespace llvm { @@ -1615,6 +1680,9 @@ protected: /// Whether this function has extended parameter information. unsigned HasExtParameterInfos : 1; + /// Whether this function has extra bitfields for the prototype. + unsigned HasExtraBitfields : 1; + /// Whether the function is variadic. unsigned Variadic : 1; @@ -2046,6 +2114,7 @@ public: bool isComplexIntegerType() const; // GCC _Complex integer type. bool isVectorType() const; // GCC vector type. bool isExtVectorType() const; // Extended vector type. + bool isExtVectorBoolType() const; // Extended vector type with bool element. bool isMatrixType() const; // Matrix type. bool isConstantMatrixType() const; // Constant matrix type. bool isDependentAddressSpaceType() const; // value-dependent address space qualifier @@ -2555,6 +2624,8 @@ public: return getKind() >= Half && getKind() <= Ibm128; } + bool isSVEBool() const { return getKind() == Kind::SveBool; } + /// Determines whether the given kind corresponds to a placeholder type. static bool isPlaceholderTypeKind(Kind K) { return K >= Overload; @@ -3786,13 +3857,12 @@ public: /// A simple holder for various uncommon bits which do not fit in /// FunctionTypeBitfields. Aligned to alignof(void *) to maintain the - /// alignment of subsequent objects in TrailingObjects. You must update - /// hasExtraBitfields in FunctionProtoType after adding extra data here. + /// alignment of subsequent objects in TrailingObjects. struct alignas(void *) FunctionTypeExtraBitfields { /// The number of types in the exception specification. /// A whole unsigned is not needed here and according to /// [implimits] 8 bits would be enough here. - unsigned NumExceptionType; + unsigned NumExceptionType = 0; }; protected: @@ -3986,6 +4056,10 @@ public: Result.ExceptionSpec = ESI; return Result; } + + bool requiresFunctionProtoTypeExtraBitfields() const { + return ExceptionSpec.Type == EST_Dynamic; + } }; private: @@ -4076,16 +4150,13 @@ private: return getExceptionSpecSize(getExceptionSpecType(), getNumExceptions()); } - /// Whether the trailing FunctionTypeExtraBitfields is present. - static bool hasExtraBitfields(ExceptionSpecificationType EST) { - // If the exception spec type is EST_Dynamic then we have > 0 exception - // types and the exact number is stored in FunctionTypeExtraBitfields. - return EST == EST_Dynamic; - } - /// Whether the trailing FunctionTypeExtraBitfields is present. bool hasExtraBitfields() const { - return hasExtraBitfields(getExceptionSpecType()); + assert((getExceptionSpecType() != EST_Dynamic || + FunctionTypeBits.HasExtraBitfields) && + "ExtraBitfields are required for given ExceptionSpecType"); + return FunctionTypeBits.HasExtraBitfields; + } bool hasExtQualifiers() const { @@ -4784,6 +4855,40 @@ public: } }; +class BTFTagAttributedType : public Type, public llvm::FoldingSetNode { +private: + friend class ASTContext; // ASTContext creates these + + QualType WrappedType; + const BTFTypeTagAttr *BTFAttr; + + BTFTagAttributedType(QualType Canon, QualType Wrapped, + const BTFTypeTagAttr *BTFAttr) + : Type(BTFTagAttributed, Canon, Wrapped->getDependence()), + WrappedType(Wrapped), BTFAttr(BTFAttr) {} + +public: + QualType getWrappedType() const { return WrappedType; } + const BTFTypeTagAttr *getAttr() const { return BTFAttr; } + + bool isSugared() const { return true; } + QualType desugar() const { return getWrappedType(); } + + void Profile(llvm::FoldingSetNodeID &ID) { + Profile(ID, WrappedType, BTFAttr); + } + + static void Profile(llvm::FoldingSetNodeID &ID, QualType Wrapped, + const BTFTypeTagAttr *BTFAttr) { + ID.AddPointer(Wrapped.getAsOpaquePtr()); + ID.AddPointer(BTFAttr); + } + + static bool classof(const Type *T) { + return T->getTypeClass() == BTFTagAttributed; + } +}; + class TemplateTypeParmType : public Type, public llvm::FoldingSetNode { friend class ASTContext; // ASTContext creates these @@ -5045,6 +5150,10 @@ public: return getKeyword() == AutoTypeKeyword::DecltypeAuto; } + bool isGNUAutoType() const { + return getKeyword() == AutoTypeKeyword::GNUAutoType; + } + AutoTypeKeyword getKeyword() const { return (AutoTypeKeyword)AutoTypeBits.Keyword; } @@ -5696,7 +5805,7 @@ public: static void Profile(llvm::FoldingSetNodeID &ID, QualType Pattern, Optional NumExpansions) { ID.AddPointer(Pattern.getAsOpaquePtr()); - ID.AddBoolean(NumExpansions.hasValue()); + ID.AddBoolean(NumExpansions.has_value()); if (NumExpansions) ID.AddInteger(*NumExpansions); } @@ -6805,6 +6914,12 @@ inline bool Type::isExtVectorType() const { return isa(CanonicalType); } +inline bool Type::isExtVectorBoolType() const { + if (!isExtVectorType()) + return false; + return cast(CanonicalType)->getElementType()->isBooleanType(); +} + inline bool Type::isMatrixType() const { return isa(CanonicalType); } @@ -7218,6 +7333,8 @@ template const T *Type::getAsAdjusted() const { while (Ty) { if (const auto *A = dyn_cast(Ty)) Ty = A->getModifiedType().getTypePtr(); + else if (const auto *A = dyn_cast(Ty)) + Ty = A->getWrappedType().getTypePtr(); else if (const auto *E = dyn_cast(Ty)) Ty = E->desugar().getTypePtr(); else if (const auto *P = dyn_cast(Ty)) diff --git a/clang/include/clang/AST/TypeLoc.h b/clang/include/clang/AST/TypeLoc.h index 8cfa579a22da..6d7612b06adc 100644 --- a/clang/include/clang/AST/TypeLoc.h +++ b/clang/include/clang/AST/TypeLoc.h @@ -901,6 +901,29 @@ public: } }; +struct BTFTagAttributedLocInfo {}; // Nothing. + +/// Type source information for an btf_tag attributed type. +class BTFTagAttributedTypeLoc + : public ConcreteTypeLoc { +public: + TypeLoc getWrappedLoc() const { return getInnerTypeLoc(); } + + /// The btf_type_tag attribute. + const BTFTypeTagAttr *getAttr() const { return getTypePtr()->getAttr(); } + + template T *getAttrAs() { + return dyn_cast_or_null(getAttr()); + } + + SourceRange getLocalSourceRange() const; + + void initializeLocal(ASTContext &Context, SourceLocation loc) {} + + QualType getInnerType() const { return getTypePtr()->getWrappedType(); } +}; + struct ObjCObjectTypeLocInfo { SourceLocation TypeArgsLAngleLoc; SourceLocation TypeArgsRAngleLoc; @@ -2589,6 +2612,8 @@ inline T TypeLoc::getAsAdjusted() const { Cur = PTL.getInnerLoc(); else if (auto ATL = Cur.getAs()) Cur = ATL.getModifiedLoc(); + else if (auto ATL = Cur.getAs()) + Cur = ATL.getWrappedLoc(); else if (auto ETL = Cur.getAs()) Cur = ETL.getNamedTypeLoc(); else if (auto ATL = Cur.getAs()) @@ -2607,6 +2632,22 @@ class DependentBitIntTypeLoc final : public InheritingConcreteTypeLoc {}; +class ObjCProtocolLoc { + ObjCProtocolDecl *Protocol = nullptr; + SourceLocation Loc = SourceLocation(); + +public: + ObjCProtocolLoc(ObjCProtocolDecl *protocol, SourceLocation loc) + : Protocol(protocol), Loc(loc) {} + ObjCProtocolDecl *getProtocol() const { return Protocol; } + SourceLocation getLocation() const { return Loc; } + + /// The source range is just the protocol name. + SourceRange getSourceRange() const LLVM_READONLY { + return SourceRange(Loc, Loc); + } +}; + } // namespace clang #endif // LLVM_CLANG_AST_TYPELOC_H diff --git a/clang/include/clang/AST/TypeProperties.td b/clang/include/clang/AST/TypeProperties.td index 8cbb67589b94..c46b0bd68cad 100644 --- a/clang/include/clang/AST/TypeProperties.td +++ b/clang/include/clang/AST/TypeProperties.td @@ -619,6 +619,19 @@ let Class = AttributedType in { }]>; } +let Class = BTFTagAttributedType in { + def : Property<"attr", BTFTypeTagAttr> { + let Read = [{ node->getAttr() }]; + } + def : Property<"wrappedType", QualType> { + let Read = [{ node->getWrappedType() }]; + } + + def : Creator<[{ + return ctx.getBTFTagAttributedType(attr, wrappedType); + }]>; +} + let Class = DependentAddressSpaceType in { def : Property<"pointeeType", QualType> { let Read = [{ node->getPointeeType() }]; @@ -658,7 +671,7 @@ let Class = TemplateSpecializationType in { def : Creator<[{ QualType result; - if (!underlyingType.hasValue()) { + if (!underlyingType) { result = ctx.getCanonicalTemplateSpecializationType(templateName, templateArguments); } else { diff --git a/clang/include/clang/ASTMatchers/ASTMatchers.h b/clang/include/clang/ASTMatchers/ASTMatchers.h index 86bd44091b59..ae5502d7af71 100644 --- a/clang/include/clang/ASTMatchers/ASTMatchers.h +++ b/clang/include/clang/ASTMatchers/ASTMatchers.h @@ -1515,6 +1515,15 @@ extern const internal::VariadicDynCastAllOfMatcher extern const internal::VariadicDynCastAllOfMatcher objcMessageExpr; +/// Matches ObjectiveC String literal expressions. +/// +/// Example matches @"abcd" +/// \code +/// NSString *s = @"abcd"; +/// \endcode +extern const internal::VariadicDynCastAllOfMatcher + objcStringLiteral; + /// Matches Objective-C interface declarations. /// /// Example matches Foo @@ -2523,7 +2532,7 @@ extern const internal::VariadicDynCastAllOfMatcher /// Matches a C++ static_assert declaration. /// /// Example: -/// staticAssertExpr() +/// staticAssertDecl() /// matches /// static_assert(sizeof(S) == sizeof(int)) /// in @@ -5011,6 +5020,49 @@ AST_POLYMORPHIC_MATCHER_P(parameterCountIs, return Node.getNumParams() == N; } +/// Matches classTemplateSpecialization, templateSpecializationType and +/// functionDecl nodes where the template argument matches the inner matcher. +/// This matcher may produce multiple matches. +/// +/// Given +/// \code +/// template +/// struct Matrix {}; +/// +/// constexpr unsigned R = 2; +/// Matrix M; +/// +/// template +/// void f(T&& t, U&& u) {} +/// +/// bool B = false; +/// f(R, B); +/// \endcode +/// templateSpecializationType(forEachTemplateArgument(isExpr(expr()))) +/// matches twice, with expr() matching 'R * 2' and 'R * 4' +/// functionDecl(forEachTemplateArgument(refersToType(builtinType()))) +/// matches the specialization f twice, for 'unsigned' +/// and 'bool' +AST_POLYMORPHIC_MATCHER_P( + forEachTemplateArgument, + AST_POLYMORPHIC_SUPPORTED_TYPES(ClassTemplateSpecializationDecl, + TemplateSpecializationType, FunctionDecl), + clang::ast_matchers::internal::Matcher, InnerMatcher) { + ArrayRef TemplateArgs = + clang::ast_matchers::internal::getTemplateSpecializationArgs(Node); + clang::ast_matchers::internal::BoundNodesTreeBuilder Result; + bool Matched = false; + for (const auto &Arg : TemplateArgs) { + clang::ast_matchers::internal::BoundNodesTreeBuilder ArgBuilder(*Builder); + if (InnerMatcher.matches(Arg, Finder, &ArgBuilder)) { + Matched = true; + Result.addMatch(ArgBuilder); + } + } + *Builder = std::move(Result); + return Matched; +} + /// Matches \c FunctionDecls that have a noreturn attribute. /// /// Given @@ -7673,7 +7725,7 @@ AST_MATCHER_P(FunctionDecl, hasExplicitSpecifier, internal::Matcher, return InnerMatcher.matches(*ES.getExpr(), Finder, Builder); } -/// Matches function and namespace declarations that are marked with +/// Matches functions, variables and namespace declarations that are marked with /// the inline keyword. /// /// Given @@ -7683,18 +7735,22 @@ AST_MATCHER_P(FunctionDecl, hasExplicitSpecifier, internal::Matcher, /// namespace n { /// inline namespace m {} /// } +/// inline int Foo = 5; /// \endcode /// functionDecl(isInline()) will match ::f(). /// namespaceDecl(isInline()) will match n::m. -AST_POLYMORPHIC_MATCHER(isInline, - AST_POLYMORPHIC_SUPPORTED_TYPES(NamespaceDecl, - FunctionDecl)) { +/// varDecl(isInline()) will match Foo; +AST_POLYMORPHIC_MATCHER(isInline, AST_POLYMORPHIC_SUPPORTED_TYPES(NamespaceDecl, + FunctionDecl, + VarDecl)) { // This is required because the spelling of the function used to determine // whether inline is specified or not differs between the polymorphic types. if (const auto *FD = dyn_cast(&Node)) return FD->isInlineSpecified(); - else if (const auto *NSD = dyn_cast(&Node)) + if (const auto *NSD = dyn_cast(&Node)) return NSD->isInline(); + if (const auto *VD = dyn_cast(&Node)) + return VD->isInline(); llvm_unreachable("Not a valid polymorphic type"); } @@ -7924,8 +7980,7 @@ AST_MATCHER_P(Stmt, forFunction, internal::Matcher, return true; } } else { - for (const auto &Parent : Finder->getASTContext().getParents(CurNode)) - Stack.push_back(Parent); + llvm::append_range(Stack, Finder->getASTContext().getParents(CurNode)); } } return false; @@ -7983,8 +8038,7 @@ AST_MATCHER_P(Stmt, forCallable, internal::Matcher, InnerMatcher) { return true; } } else { - for (const auto &Parent : Finder->getASTContext().getParents(CurNode)) - Stack.push_back(Parent); + llvm::append_range(Stack, Finder->getASTContext().getParents(CurNode)); } } return false; @@ -8258,12 +8312,13 @@ AST_MATCHER_P(OMPExecutableDirective, hasAnyClause, /// \code /// #pragma omp parallel default(none) /// #pragma omp parallel default(shared) +/// #pragma omp parallel default(private) /// #pragma omp parallel default(firstprivate) /// #pragma omp parallel /// \endcode /// -/// ``ompDefaultClause()`` matches ``default(none)``, ``default(shared)``, and -/// ``default(firstprivate)`` +/// ``ompDefaultClause()`` matches ``default(none)``, ``default(shared)``, +/// `` default(private)`` and ``default(firstprivate)`` extern const internal::VariadicDynCastAllOfMatcher ompDefaultClause; @@ -8275,6 +8330,7 @@ extern const internal::VariadicDynCastAllOfMatcher /// #pragma omp parallel /// #pragma omp parallel default(none) /// #pragma omp parallel default(shared) +/// #pragma omp parallel default(private) /// #pragma omp parallel default(firstprivate) /// \endcode /// @@ -8291,6 +8347,7 @@ AST_MATCHER(OMPDefaultClause, isNoneKind) { /// #pragma omp parallel /// #pragma omp parallel default(none) /// #pragma omp parallel default(shared) +/// #pragma omp parallel default(private) /// #pragma omp parallel default(firstprivate) /// \endcode /// @@ -8299,6 +8356,25 @@ AST_MATCHER(OMPDefaultClause, isSharedKind) { return Node.getDefaultKind() == llvm::omp::OMP_DEFAULT_shared; } +/// Matches if the OpenMP ``default`` clause has ``private`` kind +/// specified. +/// +/// Given +/// +/// \code +/// #pragma omp parallel +/// #pragma omp parallel default(none) +/// #pragma omp parallel default(shared) +/// #pragma omp parallel default(private) +/// #pragma omp parallel default(firstprivate) +/// \endcode +/// +/// ``ompDefaultClause(isPrivateKind())`` matches only +/// ``default(private)``. +AST_MATCHER(OMPDefaultClause, isPrivateKind) { + return Node.getDefaultKind() == llvm::omp::OMP_DEFAULT_private; +} + /// Matches if the OpenMP ``default`` clause has ``firstprivate`` kind /// specified. /// @@ -8308,6 +8384,7 @@ AST_MATCHER(OMPDefaultClause, isSharedKind) { /// #pragma omp parallel /// #pragma omp parallel default(none) /// #pragma omp parallel default(shared) +/// #pragma omp parallel default(private) /// #pragma omp parallel default(firstprivate) /// \endcode /// diff --git a/clang/include/clang/ASTMatchers/ASTMatchersInternal.h b/clang/include/clang/ASTMatchers/ASTMatchersInternal.h index ab7a445dbcd4..49de9a458c3d 100644 --- a/clang/include/clang/ASTMatchers/ASTMatchersInternal.h +++ b/clang/include/clang/ASTMatchers/ASTMatchersInternal.h @@ -132,10 +132,7 @@ struct VariadicFunction { // We also allow calls with an already created array, in case the caller // already had it. ResultT operator()(ArrayRef Args) const { - SmallVector InnerArgs; - for (const ArgT &Arg : Args) - InnerArgs.push_back(&Arg); - return Func(InnerArgs); + return Func(llvm::to_vector<8>(llvm::make_pointer_range(Args))); } private: @@ -600,17 +597,15 @@ public: /// Convert \c this into a \c Matcher by applying dyn_cast<> to the /// argument. /// \c To must be a base class of \c T. - template Matcher dynCastTo() const LLVM_LVALUE_FUNCTION { + template Matcher dynCastTo() const & { static_assert(std::is_base_of::value, "Invalid dynCast call."); return Matcher(Implementation); } -#if LLVM_HAS_RVALUE_REFERENCE_THIS template Matcher dynCastTo() && { static_assert(std::is_base_of::value, "Invalid dynCast call."); return Matcher(std::move(Implementation)); } -#endif /// Forwards the call to the underlying MatcherInterface pointer. bool matches(const T &Node, @@ -628,13 +623,9 @@ public: /// /// The returned matcher keeps the same restrictions as \c this and remembers /// that it is meant to support nodes of type \c T. - operator DynTypedMatcher() const LLVM_LVALUE_FUNCTION { - return Implementation; - } + operator DynTypedMatcher() const & { return Implementation; } -#if LLVM_HAS_RVALUE_REFERENCE_THIS operator DynTypedMatcher() && { return std::move(Implementation); } -#endif /// Allows the conversion of a \c Matcher to a \c /// Matcher. @@ -1361,35 +1352,31 @@ public: VariadicOperatorMatcher(DynTypedMatcher::VariadicOperator Op, Ps &&... Params) : Op(Op), Params(std::forward(Params)...) {} - template operator Matcher() const LLVM_LVALUE_FUNCTION { + template operator Matcher() const & { return DynTypedMatcher::constructVariadic( Op, ASTNodeKind::getFromNodeKind(), getMatchers(std::index_sequence_for())) .template unconditionalConvertTo(); } -#if LLVM_HAS_RVALUE_REFERENCE_THIS template operator Matcher() && { return DynTypedMatcher::constructVariadic( Op, ASTNodeKind::getFromNodeKind(), getMatchers(std::index_sequence_for())) .template unconditionalConvertTo(); } -#endif + private: // Helper method to unpack the tuple into a vector. template - std::vector - getMatchers(std::index_sequence) const LLVM_LVALUE_FUNCTION { + std::vector getMatchers(std::index_sequence) const & { return {Matcher(std::get(Params))...}; } -#if LLVM_HAS_RVALUE_REFERENCE_THIS template std::vector getMatchers(std::index_sequence) && { return {Matcher(std::get(std::move(Params)))...}; } -#endif const DynTypedMatcher::VariadicOperator Op; std::tuple Params; @@ -1479,15 +1466,13 @@ public: using ReturnTypes = ToTypes; - template operator Matcher() const LLVM_LVALUE_FUNCTION { + template operator Matcher() const & { return Matcher(new ArgumentAdapterT(InnerMatcher)); } -#if LLVM_HAS_RVALUE_REFERENCE_THIS template operator Matcher() && { return Matcher(new ArgumentAdapterT(std::move(InnerMatcher))); } -#endif private: Matcher InnerMatcher; @@ -1558,21 +1543,19 @@ public: TraversalWrapper(TraversalKind TK, const MatcherType &InnerMatcher) : TK(TK), InnerMatcher(InnerMatcher) {} - template operator Matcher() const LLVM_LVALUE_FUNCTION { + template operator Matcher() const & { return internal::DynTypedMatcher::constructRestrictedWrapper( new internal::TraversalMatcher(TK, InnerMatcher), ASTNodeKind::getFromNodeKind()) .template unconditionalConvertTo(); } -#if LLVM_HAS_RVALUE_REFERENCE_THIS template operator Matcher() && { return internal::DynTypedMatcher::constructRestrictedWrapper( new internal::TraversalMatcher(TK, std::move(InnerMatcher)), ASTNodeKind::getFromNodeKind()) .template unconditionalConvertTo(); } -#endif private: TraversalKind TK; @@ -1599,20 +1582,18 @@ public: using ReturnTypes = typename ExtractFunctionArgMeta::type; - template operator Matcher() const LLVM_LVALUE_FUNCTION { + template operator Matcher() const & { static_assert(TypeListContainsSuperOf::value, "right polymorphic conversion"); return Matcher(new_from_tuple>(Params)); } -#if LLVM_HAS_RVALUE_REFERENCE_THIS template operator Matcher() && { static_assert(TypeListContainsSuperOf::value, "right polymorphic conversion"); return Matcher( new_from_tuple>(std::move(Params))); } -#endif private: std::tuple Params; diff --git a/clang/include/clang/ASTMatchers/Dynamic/VariantValue.h b/clang/include/clang/ASTMatchers/Dynamic/VariantValue.h index e1c19eb835ba..240ee9a89b33 100644 --- a/clang/include/clang/ASTMatchers/Dynamic/VariantValue.h +++ b/clang/include/clang/ASTMatchers/Dynamic/VariantValue.h @@ -188,7 +188,7 @@ public: bool hasTypedMatcher(ASTNodeKind NK) const { if (!Value) return false; - return Value->getTypedMatcher(MatcherOps(NK)).hasValue(); + return Value->getTypedMatcher(MatcherOps(NK)).has_value(); } /// Determines if the contained matcher can be converted to \p Kind. diff --git a/clang/include/clang/Analysis/Analyses/CalledOnceCheck.h b/clang/include/clang/Analysis/Analyses/CalledOnceCheck.h index 6d78fa4a897a..b65a3967cd50 100644 --- a/clang/include/clang/Analysis/Analyses/CalledOnceCheck.h +++ b/clang/include/clang/Analysis/Analyses/CalledOnceCheck.h @@ -79,7 +79,7 @@ public: /// the path containing the call and not containing the call. This helps us /// to pinpoint a bad path for the user. /// \param Parameter -- parameter that should be called once. - /// \param Function -- function declaration where the problem occured. + /// \param Function -- function declaration where the problem occurred. /// \param Where -- the least common ancestor statement. /// \param Reason -- a reason describing the path without a call. /// \param IsCalledDirectly -- true, if parameter actually gets called on diff --git a/clang/include/clang/Analysis/Analyses/ExprMutationAnalyzer.h b/clang/include/clang/Analysis/Analyses/ExprMutationAnalyzer.h index 9397c5df78ab..1ceef944fbc3 100644 --- a/clang/include/clang/Analysis/Analyses/ExprMutationAnalyzer.h +++ b/clang/include/clang/Analysis/Analyses/ExprMutationAnalyzer.h @@ -38,6 +38,8 @@ public: } const Stmt *findPointeeMutation(const Expr *Exp); const Stmt *findPointeeMutation(const Decl *Dec); + static bool isUnevaluated(const Stmt *Smt, const Stmt &Stm, + ASTContext &Context); private: using MutationFinder = const Stmt *(ExprMutationAnalyzer::*)(const Expr *); diff --git a/clang/include/clang/Analysis/Analyses/ThreadSafety.h b/clang/include/clang/Analysis/Analyses/ThreadSafety.h index bfa9870a1e1f..1808d1d71e05 100644 --- a/clang/include/clang/Analysis/Analyses/ThreadSafety.h +++ b/clang/include/clang/Analysis/Analyses/ThreadSafety.h @@ -98,9 +98,8 @@ public: virtual ~ThreadSafetyHandler(); /// Warn about lock expressions which fail to resolve to lockable objects. - /// \param Kind -- the capability's name parameter (role, mutex, etc). /// \param Loc -- the SourceLocation of the unresolved expression. - virtual void handleInvalidLockExp(StringRef Kind, SourceLocation Loc) {} + virtual void handleInvalidLockExp(SourceLocation Loc) {} /// Warn about unlock function calls that do not have a prior matching lock /// expression. @@ -169,14 +168,12 @@ public: SourceLocation Loc2) {} /// Warn when a protected operation occurs while no locks are held. - /// \param Kind -- the capability's name parameter (role, mutex, etc). /// \param D -- The decl for the protected variable or function /// \param POK -- The kind of protected operation (e.g. variable access) /// \param AK -- The kind of access (i.e. read or write) that occurred /// \param Loc -- The location of the protected operation. - virtual void handleNoMutexHeld(StringRef Kind, const NamedDecl *D, - ProtectedOperationKind POK, AccessKind AK, - SourceLocation Loc) {} + virtual void handleNoMutexHeld(const NamedDecl *D, ProtectedOperationKind POK, + AccessKind AK, SourceLocation Loc) {} /// Warn when a protected operation occurs while the specific mutex protecting /// the operation is not locked. diff --git a/clang/include/clang/Analysis/Analyses/ThreadSafetyCommon.h b/clang/include/clang/Analysis/Analyses/ThreadSafetyCommon.h index 2f6a78126a1d..da69348ea938 100644 --- a/clang/include/clang/Analysis/Analyses/ThreadSafetyCommon.h +++ b/clang/include/clang/Analysis/Analyses/ThreadSafetyCommon.h @@ -30,6 +30,7 @@ #include "clang/Analysis/CFG.h" #include "clang/Basic/LLVM.h" #include "llvm/ADT/DenseMap.h" +#include "llvm/ADT/PointerIntPair.h" #include "llvm/ADT/SmallVector.h" #include "llvm/Support/Casting.h" #include @@ -269,28 +270,36 @@ private: // translateAttrExpr needs it, but that should be moved too. class CapabilityExpr { private: - /// The capability expression. - const til::SExpr* CapExpr; + /// The capability expression and whether it's negated. + llvm::PointerIntPair CapExpr; - /// True if this is a negative capability. - bool Negated; + /// The kind of capability as specified by @ref CapabilityAttr::getName. + StringRef CapKind; public: - CapabilityExpr(const til::SExpr *E, bool Neg) : CapExpr(E), Negated(Neg) {} + CapabilityExpr() : CapExpr(nullptr, false) {} + CapabilityExpr(const til::SExpr *E, StringRef Kind, bool Neg) + : CapExpr(E, Neg), CapKind(Kind) {} - const til::SExpr* sexpr() const { return CapExpr; } - bool negative() const { return Negated; } + // Don't allow implicitly-constructed StringRefs since we'll capture them. + template CapabilityExpr(const til::SExpr *, T, bool) = delete; + + const til::SExpr *sexpr() const { return CapExpr.getPointer(); } + StringRef getKind() const { return CapKind; } + bool negative() const { return CapExpr.getInt(); } CapabilityExpr operator!() const { - return CapabilityExpr(CapExpr, !Negated); + return CapabilityExpr(CapExpr.getPointer(), CapKind, !CapExpr.getInt()); } bool equals(const CapabilityExpr &other) const { - return (Negated == other.Negated) && sx::equals(CapExpr, other.CapExpr); + return (negative() == other.negative()) && + sx::equals(sexpr(), other.sexpr()); } bool matches(const CapabilityExpr &other) const { - return (Negated == other.Negated) && sx::matches(CapExpr, other.CapExpr); + return (negative() == other.negative()) && + sx::matches(sexpr(), other.sexpr()); } bool matchesUniv(const CapabilityExpr &CapE) const { @@ -298,27 +307,27 @@ public: } bool partiallyMatches(const CapabilityExpr &other) const { - return (Negated == other.Negated) && - sx::partiallyMatches(CapExpr, other.CapExpr); + return (negative() == other.negative()) && + sx::partiallyMatches(sexpr(), other.sexpr()); } const ValueDecl* valueDecl() const { - if (Negated || CapExpr == nullptr) + if (negative() || sexpr() == nullptr) return nullptr; - if (const auto *P = dyn_cast(CapExpr)) + if (const auto *P = dyn_cast(sexpr())) return P->clangDecl(); - if (const auto *P = dyn_cast(CapExpr)) + if (const auto *P = dyn_cast(sexpr())) return P->clangDecl(); return nullptr; } std::string toString() const { - if (Negated) - return "!" + sx::toString(CapExpr); - return sx::toString(CapExpr); + if (negative()) + return "!" + sx::toString(sexpr()); + return sx::toString(sexpr()); } - bool shouldIgnore() const { return CapExpr == nullptr; } + bool shouldIgnore() const { return sexpr() == nullptr; } bool isInvalid() const { return sexpr() && isa(sexpr()); } diff --git a/clang/include/clang/Analysis/AnalysisDeclContext.h b/clang/include/clang/Analysis/AnalysisDeclContext.h index 102970a1d55e..ce60ad56af4e 100644 --- a/clang/include/clang/Analysis/AnalysisDeclContext.h +++ b/clang/include/clang/Analysis/AnalysisDeclContext.h @@ -229,7 +229,9 @@ private: protected: LocationContext(ContextKind k, AnalysisDeclContext *ctx, const LocationContext *parent, int64_t ID) - : Kind(k), Ctx(ctx), Parent(parent), ID(ID) {} + : Kind(k), Ctx(ctx), Parent(parent), ID(ID) { + assert(ctx); + } public: virtual ~LocationContext(); @@ -238,8 +240,10 @@ public: int64_t getID() const { return ID; } + LLVM_ATTRIBUTE_RETURNS_NONNULL AnalysisDeclContext *getAnalysisDeclContext() const { return Ctx; } + /// It might return null. const LocationContext *getParent() const { return Parent; } bool isParentOf(const LocationContext *LC) const; diff --git a/clang/include/clang/Analysis/CloneDetection.h b/clang/include/clang/Analysis/CloneDetection.h index b2911a5b44eb..ffd496c5c9f6 100644 --- a/clang/include/clang/Analysis/CloneDetection.h +++ b/clang/include/clang/Analysis/CloneDetection.h @@ -208,13 +208,7 @@ public: // The initial assumption is that there is only one clone group and every // statement is a clone of the others. This clone group will then be // split up with the help of the constraints. - CloneGroup AllClones; - AllClones.reserve(Sequences.size()); - for (const auto &C : Sequences) { - AllClones.push_back(C); - } - - Result.push_back(AllClones); + Result.push_back(Sequences); constrainClones(Result, ConstraintList...); } diff --git a/clang/include/clang/Analysis/ConstructionContext.h b/clang/include/clang/Analysis/ConstructionContext.h index 4fa5c8b454a0..a437160e0778 100644 --- a/clang/include/clang/Analysis/ConstructionContext.h +++ b/clang/include/clang/Analysis/ConstructionContext.h @@ -120,7 +120,8 @@ public: ConstructionContextItem(const Expr *E, unsigned Index) : Data(E), Kind(ArgumentKind), Index(Index) { assert(isa(E) || isa(E) || - isa(E) || isa(E)); + isa(E) || isa(E) || + isa(E)); } ConstructionContextItem(const CXXCtorInitializer *Init) diff --git a/clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h b/clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h index b5a7c061e17b..40ac95b3abdd 100644 --- a/clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h +++ b/clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h @@ -106,16 +106,36 @@ template struct DataflowAnalysisState { }; /// Performs dataflow analysis and returns a mapping from basic block IDs to -/// dataflow analysis states that model the respective basic blocks. Indices -/// of the returned vector correspond to basic block IDs. Returns an error if -/// the dataflow analysis cannot be performed successfully. +/// dataflow analysis states that model the respective basic blocks. The +/// returned vector, if any, will have the same size as the number of CFG +/// blocks, with indices corresponding to basic block IDs. Returns an error if +/// the dataflow analysis cannot be performed successfully. Otherwise, calls +/// `PostVisitStmt` on each statement with the final analysis results at that +/// program point. template llvm::Expected>>> -runDataflowAnalysis(const ControlFlowContext &CFCtx, AnalysisT &Analysis, - const Environment &InitEnv) { - auto TypeErasedBlockStates = - runTypeErasedDataflowAnalysis(CFCtx, Analysis, InitEnv); +runDataflowAnalysis( + const ControlFlowContext &CFCtx, AnalysisT &Analysis, + const Environment &InitEnv, + std::function &)> + PostVisitStmt = nullptr) { + std::function + PostVisitStmtClosure = nullptr; + if (PostVisitStmt != nullptr) { + PostVisitStmtClosure = [&PostVisitStmt]( + const Stmt *Stmt, + const TypeErasedDataflowAnalysisState &State) { + auto *Lattice = + llvm::any_cast(&State.Lattice.Value); + PostVisitStmt(Stmt, DataflowAnalysisState{ + *Lattice, State.Env}); + }; + } + + auto TypeErasedBlockStates = runTypeErasedDataflowAnalysis( + CFCtx, Analysis, InitEnv, PostVisitStmtClosure); if (!TypeErasedBlockStates) return TypeErasedBlockStates.takeError(); @@ -136,6 +156,15 @@ runDataflowAnalysis(const ControlFlowContext &CFCtx, AnalysisT &Analysis, return BlockStates; } +/// Abstract base class for dataflow "models": reusable analysis components that +/// model a particular aspect of program semantics in the `Environment`. For +/// example, a model may capture a type and its related functions. +class DataflowModel : public Environment::ValueModel { +public: + /// Return value indicates whether the model processed the `Stmt`. + virtual bool transfer(const Stmt *Stmt, Environment &Env) = 0; +}; + } // namespace dataflow } // namespace clang diff --git a/clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h b/clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h index 5c1b41d53892..c1100d8474aa 100644 --- a/clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h +++ b/clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h @@ -17,9 +17,12 @@ #include "clang/AST/Decl.h" #include "clang/AST/Expr.h" +#include "clang/AST/TypeOrdering.h" +#include "clang/Analysis/FlowSensitive/Solver.h" #include "clang/Analysis/FlowSensitive/StorageLocation.h" #include "clang/Analysis/FlowSensitive/Value.h" #include "llvm/ADT/DenseMap.h" +#include "llvm/ADT/DenseSet.h" #include #include #include @@ -29,13 +32,36 @@ namespace clang { namespace dataflow { +/// Skip past nodes that the CFG does not emit. These nodes are invisible to +/// flow-sensitive analysis, and should be ignored as they will effectively not +/// exist. +/// +/// * `ParenExpr` - The CFG takes the operator precedence into account, but +/// otherwise omits the node afterwards. +/// +/// * `ExprWithCleanups` - The CFG will generate the appropriate calls to +/// destructors and then omit the node. +/// +const Expr &ignoreCFGOmittedNodes(const Expr &E); +const Stmt &ignoreCFGOmittedNodes(const Stmt &S); + +/// Returns the set of all fields in the type. +llvm::DenseSet getObjectFields(QualType Type); + /// Owns objects that encompass the state of a program and stores context that /// is used during dataflow analysis. class DataflowAnalysisContext { public: - DataflowAnalysisContext() - : TrueVal(&takeOwnership(std::make_unique())), - FalseVal(&takeOwnership(std::make_unique())) {} + /// Constructs a dataflow analysis context. + /// + /// Requirements: + /// + /// `S` must not be null. + DataflowAnalysisContext(std::unique_ptr S) + : S(std::move(S)), TrueVal(createAtomicBoolValue()), + FalseVal(createAtomicBoolValue()) { + assert(this->S != nullptr); + } /// Takes ownership of `Loc` and returns a reference to it. /// @@ -63,6 +89,19 @@ public: return *cast(Vals.back().get()); } + /// Returns a stable storage location appropriate for `Type`. + /// + /// Requirements: + /// + /// `Type` must not be null. + StorageLocation &getStableStorageLocation(QualType Type); + + /// Returns a stable storage location for `D`. + StorageLocation &getStableStorageLocation(const VarDecl &D); + + /// Returns a stable storage location for `E`. + StorageLocation &getStableStorageLocation(const Expr &E); + /// Assigns `Loc` as the storage location of `D`. /// /// Requirements: @@ -86,14 +125,15 @@ public: /// /// `E` must not be assigned a storage location. void setStorageLocation(const Expr &E, StorageLocation &Loc) { - assert(ExprToLoc.find(&E) == ExprToLoc.end()); - ExprToLoc[&E] = &Loc; + const Expr &CanonE = ignoreCFGOmittedNodes(E); + assert(ExprToLoc.find(&CanonE) == ExprToLoc.end()); + ExprToLoc[&CanonE] = &Loc; } /// Returns the storage location assigned to `E` or null if `E` has no /// assigned storage location. StorageLocation *getStorageLocation(const Expr &E) const { - auto It = ExprToLoc.find(&E); + auto It = ExprToLoc.find(&ignoreCFGOmittedNodes(E)); return It == ExprToLoc.end() ? nullptr : It->second; } @@ -113,13 +153,144 @@ public: return ThisPointeeLoc; } + /// Returns a pointer value that represents a null pointer. Calls with + /// `PointeeType` that are canonically equivalent will return the same result. + PointerValue &getOrCreateNullPointerValue(QualType PointeeType); + /// Returns a symbolic boolean value that models a boolean literal equal to /// `Value`. - BoolValue &getBoolLiteralValue(bool Value) const { - return Value ? *TrueVal : *FalseVal; + AtomicBoolValue &getBoolLiteralValue(bool Value) const { + return Value ? TrueVal : FalseVal; + } + + /// Creates an atomic boolean value. + AtomicBoolValue &createAtomicBoolValue() { + return takeOwnership(std::make_unique()); } + /// Returns a boolean value that represents the conjunction of `LHS` and + /// `RHS`. Subsequent calls with the same arguments, regardless of their + /// order, will return the same result. If the given boolean values represent + /// the same value, the result will be the value itself. + BoolValue &getOrCreateConjunction(BoolValue &LHS, BoolValue &RHS); + + /// Returns a boolean value that represents the disjunction of `LHS` and + /// `RHS`. Subsequent calls with the same arguments, regardless of their + /// order, will return the same result. If the given boolean values represent + /// the same value, the result will be the value itself. + BoolValue &getOrCreateDisjunction(BoolValue &LHS, BoolValue &RHS); + + /// Returns a boolean value that represents the negation of `Val`. Subsequent + /// calls with the same argument will return the same result. + BoolValue &getOrCreateNegation(BoolValue &Val); + + /// Returns a boolean value that represents `LHS => RHS`. Subsequent calls + /// with the same arguments, will return the same result. If the given boolean + /// values represent the same value, the result will be a value that + /// represents the true boolean literal. + BoolValue &getOrCreateImplication(BoolValue &LHS, BoolValue &RHS); + + /// Returns a boolean value that represents `LHS <=> RHS`. Subsequent calls + /// with the same arguments, regardless of their order, will return the same + /// result. If the given boolean values represent the same value, the result + /// will be a value that represents the true boolean literal. + BoolValue &getOrCreateIff(BoolValue &LHS, BoolValue &RHS); + + /// Creates a fresh flow condition and returns a token that identifies it. The + /// token can be used to perform various operations on the flow condition such + /// as adding constraints to it, forking it, joining it with another flow + /// condition, or checking implications. + AtomicBoolValue &makeFlowConditionToken(); + + /// Adds `Constraint` to the flow condition identified by `Token`. + void addFlowConditionConstraint(AtomicBoolValue &Token, + BoolValue &Constraint); + + /// Creates a new flow condition with the same constraints as the flow + /// condition identified by `Token` and returns its token. + AtomicBoolValue &forkFlowCondition(AtomicBoolValue &Token); + + /// Creates a new flow condition that represents the disjunction of the flow + /// conditions identified by `FirstToken` and `SecondToken`, and returns its + /// token. + AtomicBoolValue &joinFlowConditions(AtomicBoolValue &FirstToken, + AtomicBoolValue &SecondToken); + + // FIXME: This function returns the flow condition expressed directly as its + // constraints: (C1 AND C2 AND ...). This differs from the general approach in + // the framework where a flow condition is represented as a token (an atomic + // boolean) with dependencies and constraints tracked in `FlowConditionDeps` + // and `FlowConditionConstraints`: (FC <=> C1 AND C2 AND ...). + // Consider if we should make the representation of flow condition consistent, + // returning an atomic boolean token with separate constraints instead. + // + /// Builds and returns the logical formula defining the flow condition + /// identified by `Token`. If a value in the formula is present as a key in + /// `Substitutions`, it will be substituted with the value it maps to. + /// As an example, say we have flow condition tokens FC1, FC2, FC3 and + /// FlowConditionConstraints: { FC1: C1, + /// FC2: C2, + /// FC3: (FC1 v FC2) ^ C3 } + /// buildAndSubstituteFlowCondition(FC3, {{C1 -> C1'}}) will return a value + /// corresponding to (C1' v C2) ^ C3. + BoolValue &buildAndSubstituteFlowCondition( + AtomicBoolValue &Token, + llvm::DenseMap Substitutions); + + /// Returns true if and only if the constraints of the flow condition + /// identified by `Token` imply that `Val` is true. + bool flowConditionImplies(AtomicBoolValue &Token, BoolValue &Val); + + /// Returns true if and only if the constraints of the flow condition + /// identified by `Token` are always true. + bool flowConditionIsTautology(AtomicBoolValue &Token); + + /// Returns true if `Val1` is equivalent to `Val2`. + /// Note: This function doesn't take into account constraints on `Val1` and + /// `Val2` imposed by the flow condition. + bool equivalentBoolValues(BoolValue &Val1, BoolValue &Val2); + private: + /// Adds all constraints of the flow condition identified by `Token` and all + /// of its transitive dependencies to `Constraints`. `VisitedTokens` is used + /// to track tokens of flow conditions that were already visited by recursive + /// calls. + void addTransitiveFlowConditionConstraints( + AtomicBoolValue &Token, llvm::DenseSet &Constraints, + llvm::DenseSet &VisitedTokens); + + /// Returns the result of satisfiability checking on `Constraints`. + /// Possible return values are: + /// - `Satisfiable`: There exists a satisfying assignment for `Constraints`. + /// - `Unsatisfiable`: There is no satisfying assignment for `Constraints`. + /// - `TimedOut`: The solver gives up on finding a satisfying assignment. + Solver::Result querySolver(llvm::DenseSet Constraints); + + /// Returns true if the solver is able to prove that there is no satisfying + /// assignment for `Constraints` + bool isUnsatisfiable(llvm::DenseSet Constraints) { + return querySolver(std::move(Constraints)) == Solver::Result::Unsatisfiable; + } + + /// Returns a boolean value as a result of substituting `Val` and its sub + /// values based on entries in `SubstitutionsCache`. Intermediate results are + /// stored in `SubstitutionsCache` to avoid reprocessing values that have + /// already been visited. + BoolValue &substituteBoolValue( + BoolValue &Val, + llvm::DenseMap &SubstitutionsCache); + + /// Builds and returns the logical formula defining the flow condition + /// identified by `Token`, sub values may be substituted based on entries in + /// `SubstitutionsCache`. Intermediate results are stored in + /// `SubstitutionsCache` to avoid reprocessing values that have already been + /// visited. + BoolValue &buildAndSubstituteFlowConditionWithCache( + AtomicBoolValue &Token, + llvm::DenseMap &SubstitutionsCache); + + std::unique_ptr S; + // Storage for the state of a program. std::vector> Locs; std::vector> Vals; @@ -134,9 +305,40 @@ private: StorageLocation *ThisPointeeLoc = nullptr; - // FIXME: Add support for boolean expressions. - BoolValue *TrueVal; - BoolValue *FalseVal; + // Null pointer values, keyed by the canonical pointee type. + // + // FIXME: The pointer values are indexed by the pointee types which are + // required to initialize the `PointeeLoc` field in `PointerValue`. Consider + // creating a type-independent `NullPointerValue` without a `PointeeLoc` + // field. + llvm::DenseMap NullPointerVals; + + AtomicBoolValue &TrueVal; + AtomicBoolValue &FalseVal; + + // Indices that are used to avoid recreating the same composite boolean + // values. + llvm::DenseMap, ConjunctionValue *> + ConjunctionVals; + llvm::DenseMap, DisjunctionValue *> + DisjunctionVals; + llvm::DenseMap NegationVals; + + // Flow conditions are tracked symbolically: each unique flow condition is + // associated with a fresh symbolic variable (token), bound to the clause that + // defines the flow condition. Conceptually, each binding corresponds to an + // "iff" of the form `FC <=> (C1 ^ C2 ^ ...)` where `FC` is a flow condition + // token (an atomic boolean) and `Ci`s are the set of constraints in the flow + // flow condition clause. The set of constraints (C1 ^ C2 ^ ...) are stored in + // the `FlowConditionConstraints` map, keyed by the token of the flow + // condition. + // + // Flow conditions depend on other flow conditions if they are created using + // `forkFlowCondition` or `joinFlowConditions`. The graph of flow condition + // dependencies is stored in the `FlowConditionDeps` map. + llvm::DenseMap> + FlowConditionDeps; + llvm::DenseMap FlowConditionConstraints; }; } // namespace dataflow diff --git a/clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h b/clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h index cebfb66ef242..ce195f0662f5 100644 --- a/clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h +++ b/clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h @@ -49,6 +49,11 @@ enum class SkipPast { }; /// Holds the state of the program (store and heap) at a given program point. +/// +/// WARNING: Symbolic values that are created by the environment for static +/// local and global variables are not currently invalidated on function calls. +/// This is unsound and should be taken into account when designing dataflow +/// analyses. class Environment { public: /// Supplements `Environment` with non-standard comparison and join @@ -64,32 +69,55 @@ public: /// `Val1` and `Val2` must be distinct. /// /// `Val1` and `Val2` must model values of type `Type`. + /// + /// `Val1` and `Val2` must be assigned to the same storage location in + /// `Env1` and `Env2` respectively. virtual bool compareEquivalent(QualType Type, const Value &Val1, - const Value &Val2) { + const Environment &Env1, const Value &Val2, + const Environment &Env2) { // FIXME: Consider adding QualType to StructValue and removing the Type // argument here. - return false; + // + // FIXME: default to a sound comparison and/or expand the comparison logic + // built into the framework to support broader forms of equivalence than + // strict pointer equality. + return true; } /// Modifies `MergedVal` to approximate both `Val1` and `Val2`. This could - /// be a strict lattice join or a more general widening operation. If this - /// function returns true, `MergedVal` will be assigned to a storage - /// location of type `Type` in `Env`. + /// be a strict lattice join or a more general widening operation. + /// + /// If this function returns true, `MergedVal` will be assigned to a storage + /// location of type `Type` in `MergedEnv`. + /// + /// `Env1` and `Env2` can be used to query child values and path condition + /// implications of `Val1` and `Val2` respectively. /// /// Requirements: /// /// `Val1` and `Val2` must be distinct. /// /// `Val1`, `Val2`, and `MergedVal` must model values of type `Type`. - virtual bool merge(QualType Type, const Value &Val1, const Value &Val2, - Value &MergedVal, Environment &Env) { - return false; + /// + /// `Val1` and `Val2` must be assigned to the same storage location in + /// `Env1` and `Env2` respectively. + virtual bool merge(QualType Type, const Value &Val1, + const Environment &Env1, const Value &Val2, + const Environment &Env2, Value &MergedVal, + Environment &MergedEnv) { + return true; } }; /// Creates an environment that uses `DACtx` to store objects that encompass /// the state of a program. - explicit Environment(DataflowAnalysisContext &DACtx) : DACtx(&DACtx) {} + explicit Environment(DataflowAnalysisContext &DACtx); + + Environment(const Environment &Other); + Environment &operator=(const Environment &Other); + + Environment(Environment &&Other) = default; + Environment &operator=(Environment &&Other) = default; /// Creates an environment that uses `DACtx` to store objects that encompass /// the state of a program. @@ -175,6 +203,10 @@ public: /// in the environment. StorageLocation *getThisPointeeStorageLocation() const; + /// Returns a pointer value that represents a null pointer. Calls with + /// `PointeeType` that are canonically equivalent will return the same result. + PointerValue &getOrCreateNullPointerValue(QualType PointeeType); + /// Creates a value appropriate for `Type`, if `Type` is supported, otherwise /// return null. If `Type` is a pointer or reference type, creates all the /// necessary storage locations and values for indirections until it finds a @@ -226,10 +258,73 @@ public: /// Returns a symbolic boolean value that models a boolean literal equal to /// `Value` - BoolValue &getBoolLiteralValue(bool Value) const { + AtomicBoolValue &getBoolLiteralValue(bool Value) const { return DACtx->getBoolLiteralValue(Value); } + /// Returns an atomic boolean value. + BoolValue &makeAtomicBoolValue() const { + return DACtx->createAtomicBoolValue(); + } + + /// Returns a boolean value that represents the conjunction of `LHS` and + /// `RHS`. Subsequent calls with the same arguments, regardless of their + /// order, will return the same result. If the given boolean values represent + /// the same value, the result will be the value itself. + BoolValue &makeAnd(BoolValue &LHS, BoolValue &RHS) const { + return DACtx->getOrCreateConjunction(LHS, RHS); + } + + /// Returns a boolean value that represents the disjunction of `LHS` and + /// `RHS`. Subsequent calls with the same arguments, regardless of their + /// order, will return the same result. If the given boolean values represent + /// the same value, the result will be the value itself. + BoolValue &makeOr(BoolValue &LHS, BoolValue &RHS) const { + return DACtx->getOrCreateDisjunction(LHS, RHS); + } + + /// Returns a boolean value that represents the negation of `Val`. Subsequent + /// calls with the same argument will return the same result. + BoolValue &makeNot(BoolValue &Val) const { + return DACtx->getOrCreateNegation(Val); + } + + /// Returns a boolean value represents `LHS` => `RHS`. Subsequent calls with + /// the same arguments, will return the same result. If the given boolean + /// values represent the same value, the result will be a value that + /// represents the true boolean literal. + BoolValue &makeImplication(BoolValue &LHS, BoolValue &RHS) const { + return DACtx->getOrCreateImplication(LHS, RHS); + } + + /// Returns a boolean value represents `LHS` <=> `RHS`. Subsequent calls with + /// the same arguments, regardless of their order, will return the same + /// result. If the given boolean values represent the same value, the result + /// will be a value that represents the true boolean literal. + BoolValue &makeIff(BoolValue &LHS, BoolValue &RHS) const { + return DACtx->getOrCreateIff(LHS, RHS); + } + + /// Returns the token that identifies the flow condition of the environment. + AtomicBoolValue &getFlowConditionToken() const { return *FlowConditionToken; } + + /// Builds and returns the logical formula defining the flow condition + /// identified by `Token`. If a value in the formula is present as a key in + /// `Substitutions`, it will be substituted with the value it maps to. + BoolValue &buildAndSubstituteFlowCondition( + AtomicBoolValue &Token, + llvm::DenseMap Substitutions) { + return DACtx->buildAndSubstituteFlowCondition(Token, + std::move(Substitutions)); + } + + /// Adds `Val` to the set of clauses that constitute the flow condition. + void addToFlowCondition(BoolValue &Val); + + /// Returns true if and only if the clauses that constitute the flow condition + /// imply that `Val` is true. + bool flowConditionImplies(BoolValue &Val) const; + private: /// Creates a value appropriate for `Type`, if `Type` is supported, otherwise /// return null. @@ -243,7 +338,8 @@ private: /// /// `Type` must not be null. Value *createValueUnlessSelfReferential(QualType Type, - llvm::DenseSet &Visited); + llvm::DenseSet &Visited, + int Depth, int &CreatedValuesCount); StorageLocation &skip(StorageLocation &Loc, SkipPast SP) const; const StorageLocation &skip(const StorageLocation &Loc, SkipPast SP) const; @@ -260,7 +356,13 @@ private: llvm::DenseMap LocToVal; - // FIXME: Add flow condition constraints. + // Maps locations of struct members to symbolic values of the structs that own + // them and the decls of the struct members. + llvm::DenseMap> + MemberLocToStruct; + + AtomicBoolValue *FlowConditionToken; }; } // namespace dataflow diff --git a/clang/include/clang/Analysis/FlowSensitive/MatchSwitch.h b/clang/include/clang/Analysis/FlowSensitive/MatchSwitch.h new file mode 100644 index 000000000000..927aec7df573 --- /dev/null +++ b/clang/include/clang/Analysis/FlowSensitive/MatchSwitch.h @@ -0,0 +1,151 @@ +//===---- MatchSwitch.h -----------------------------------------*- 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 the `MatchSwitch` abstraction for building a "switch" +// statement, where each case of the switch is defined by an AST matcher. The +// cases are considered in order, like pattern matching in functional +// languages. +// +// Currently, the design is catered towards simplifying the implementation of +// `DataflowAnalysis` transfer functions. Based on experience here, this +// library may be generalized and moved to ASTMatchers. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_CLANG_ANALYSIS_FLOWSENSITIVE_MATCHSWITCH_H_ +#define LLVM_CLANG_ANALYSIS_FLOWSENSITIVE_MATCHSWITCH_H_ + +#include "clang/AST/ASTContext.h" +#include "clang/AST/Stmt.h" +#include "clang/ASTMatchers/ASTMatchFinder.h" +#include "clang/ASTMatchers/ASTMatchers.h" +#include "clang/Analysis/FlowSensitive/DataflowEnvironment.h" +#include "llvm/ADT/StringRef.h" +#include +#include +#include +#include + +namespace clang { +namespace dataflow { + +/// A common form of state shared between the cases of a transfer function. +template struct TransferState { + TransferState(LatticeT &Lattice, Environment &Env) + : Lattice(Lattice), Env(Env) {} + + /// Current lattice element. + LatticeT &Lattice; + Environment &Env; +}; + +/// Matches against `Stmt` and, based on its structure, dispatches to an +/// appropriate handler. +template +using MatchSwitch = std::function; + +/// Collects cases of a "match switch": a collection of matchers paired with +/// callbacks, which together define a switch that can be applied to a +/// `Stmt`. This structure can simplify the definition of `transfer` functions +/// that rely on pattern-matching. +/// +/// For example, consider an analysis that handles particular function calls. It +/// can define the `MatchSwitch` once, in the constructor of the analysis, and +/// then reuse it each time that `transfer` is called, with a fresh state value. +/// +/// \code +/// MatchSwitch BuildSwitch() { +/// return MatchSwitchBuilder>() +/// .CaseOf(callExpr(callee(functionDecl(hasName("foo")))), TransferFooCall) +/// .CaseOf(callExpr(argumentCountIs(2), +/// callee(functionDecl(hasName("bar")))), +/// TransferBarCall) +/// .Build(); +/// } +/// \endcode +template class MatchSwitchBuilder { +public: + /// Registers an action that will be triggered by the match of a pattern + /// against the input statement. + /// + /// Requirements: + /// + /// `Node` should be a subclass of `Stmt`. + template + MatchSwitchBuilder && + CaseOf(ast_matchers::internal::Matcher M, + std::function + A) && { + Matchers.push_back(std::move(M)); + Actions.push_back( + [A = std::move(A)](const Stmt *Stmt, + const ast_matchers::MatchFinder::MatchResult &R, + State &S) { return A(cast(Stmt), R, S); }); + return std::move(*this); + } + + MatchSwitch Build() && { + return [Matcher = BuildMatcher(), Actions = std::move(Actions)]( + const Stmt &Stmt, ASTContext &Context, State &S) -> Result { + auto Results = ast_matchers::matchDynamic(Matcher, Stmt, Context); + if (Results.empty()) + return Result(); + // Look through the map for the first binding of the form "TagN..." use + // that to select the action. + for (const auto &Element : Results[0].getMap()) { + llvm::StringRef ID(Element.first); + size_t Index = 0; + if (ID.consume_front("Tag") && !ID.getAsInteger(10, Index) && + Index < Actions.size()) { + return Actions[Index]( + &Stmt, + ast_matchers::MatchFinder::MatchResult(Results[0], &Context), S); + } + } + return Result(); + }; + } + +private: + ast_matchers::internal::DynTypedMatcher BuildMatcher() { + using ast_matchers::anything; + using ast_matchers::stmt; + using ast_matchers::unless; + using ast_matchers::internal::DynTypedMatcher; + if (Matchers.empty()) + return stmt(unless(anything())); + for (int I = 0, N = Matchers.size(); I < N; ++I) { + std::string Tag = ("Tag" + llvm::Twine(I)).str(); + // Many matchers are not bindable, so ensure that tryBind will work. + Matchers[I].setAllowBind(true); + auto M = *Matchers[I].tryBind(Tag); + // Each anyOf explicitly controls the traversal kind. The anyOf itself is + // set to `TK_AsIs` to ensure no nodes are skipped, thereby deferring to + // the kind of the branches. Then, each branch is either left as is, if + // the kind is already set, or explicitly set to `TK_AsIs`. We choose this + // setting because it is the default interpretation of matchers. + Matchers[I] = + !M.getTraversalKind() ? M.withTraversalKind(TK_AsIs) : std::move(M); + } + // The matcher type on the cases ensures that `Expr` kind is compatible with + // all of the matchers. + return DynTypedMatcher::constructVariadic( + DynTypedMatcher::VO_AnyOf, ASTNodeKind::getFromNodeKind(), + std::move(Matchers)); + } + + std::vector Matchers; + std::vector> + Actions; +}; +} // namespace dataflow +} // namespace clang +#endif // LLVM_CLANG_ANALYSIS_FLOWSENSITIVE_MATCHSWITCH_H_ diff --git a/clang/include/clang/Analysis/FlowSensitive/Models/ChromiumCheckModel.h b/clang/include/clang/Analysis/FlowSensitive/Models/ChromiumCheckModel.h new file mode 100644 index 000000000000..93c427bd1ddc --- /dev/null +++ b/clang/include/clang/Analysis/FlowSensitive/Models/ChromiumCheckModel.h @@ -0,0 +1,39 @@ +//===-- ChromiumCheckModel.h ------------------------------------*- 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 a dataflow model for Chromium's family of CHECK functions. +// +//===----------------------------------------------------------------------===// +#ifndef CLANG_ANALYSIS_FLOWSENSITIVE_MODELS_CHROMIUMCHECKMODEL_H +#define CLANG_ANALYSIS_FLOWSENSITIVE_MODELS_CHROMIUMCHECKMODEL_H + +#include "clang/AST/DeclCXX.h" +#include "clang/AST/Stmt.h" +#include "clang/Analysis/FlowSensitive/DataflowAnalysis.h" +#include "clang/Analysis/FlowSensitive/DataflowEnvironment.h" +#include "llvm/ADT/DenseSet.h" + +namespace clang { +namespace dataflow { + +/// Models the behavior of Chromium's CHECK, DCHECK, etc. macros, so that code +/// after a call to `*CHECK` can rely on the condition being true. +class ChromiumCheckModel : public DataflowModel { +public: + ChromiumCheckModel() = default; + bool transfer(const Stmt *Stmt, Environment &Env) override; + +private: + /// Declarations for `::logging::CheckError::.*Check`, lazily initialized. + llvm::SmallDenseSet CheckDecls; +}; + +} // namespace dataflow +} // namespace clang + +#endif // CLANG_ANALYSIS_FLOWSENSITIVE_MODELS_CHROMIUMCHECKMODEL_H diff --git a/clang/include/clang/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.h b/clang/include/clang/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.h new file mode 100644 index 000000000000..25054deaf8af --- /dev/null +++ b/clang/include/clang/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.h @@ -0,0 +1,85 @@ +//===-- UncheckedOptionalAccessModel.h --------------------------*- 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 a dataflow analysis that detects unsafe uses of optional +// values. +// +//===----------------------------------------------------------------------===// + +#ifndef CLANG_ANALYSIS_FLOWSENSITIVE_MODELS_UNCHECKEDOPTIONALACCESSMODEL_H +#define CLANG_ANALYSIS_FLOWSENSITIVE_MODELS_UNCHECKEDOPTIONALACCESSMODEL_H + +#include "clang/AST/ASTContext.h" +#include "clang/AST/Stmt.h" +#include "clang/Analysis/FlowSensitive/DataflowAnalysis.h" +#include "clang/Analysis/FlowSensitive/DataflowEnvironment.h" +#include "clang/Analysis/FlowSensitive/MatchSwitch.h" +#include "clang/Analysis/FlowSensitive/NoopLattice.h" +#include "clang/Basic/SourceLocation.h" +#include + +namespace clang { +namespace dataflow { + +// FIXME: Explore using an allowlist-approach, where constructs supported by the +// analysis are always enabled and additional constructs are enabled through the +// `Options`. +struct UncheckedOptionalAccessModelOptions { + /// Ignore optionals reachable through overloaded `operator*` or `operator->` + /// (other than those of the optional type itself). The analysis does not + /// equate the results of such calls, so it can't identify when their results + /// are used safely (across calls), resulting in false positives in all such + /// cases. Note: this option does not cover access through `operator[]`. + bool IgnoreSmartPointerDereference = false; +}; + +/// Dataflow analysis that models whether optionals hold values or not. +/// +/// Models the `std::optional`, `absl::optional`, and `base::Optional` types. +class UncheckedOptionalAccessModel + : public DataflowAnalysis { +public: + UncheckedOptionalAccessModel( + ASTContext &AstContext, UncheckedOptionalAccessModelOptions Options = {}); + + /// Returns a matcher for the optional classes covered by this model. + static ast_matchers::DeclarationMatcher optionalClassDecl(); + + static NoopLattice initialElement() { return {}; } + + void transfer(const Stmt *Stmt, NoopLattice &State, Environment &Env); + + bool compareEquivalent(QualType Type, const Value &Val1, + const Environment &Env1, const Value &Val2, + const Environment &Env2) override; + + bool merge(QualType Type, const Value &Val1, const Environment &Env1, + const Value &Val2, const Environment &Env2, Value &MergedVal, + Environment &MergedEnv) override; + +private: + MatchSwitch> TransferMatchSwitch; +}; + +class UncheckedOptionalAccessDiagnoser { +public: + UncheckedOptionalAccessDiagnoser( + UncheckedOptionalAccessModelOptions Options = {}); + + std::vector diagnose(ASTContext &Context, const Stmt *Stmt, + const Environment &Env); + +private: + MatchSwitch> + DiagnoseMatchSwitch; +}; + +} // namespace dataflow +} // namespace clang + +#endif // CLANG_ANALYSIS_FLOWSENSITIVE_MODELS_UNCHECKEDOPTIONALACCESSMODEL_H diff --git a/clang/include/clang/Analysis/FlowSensitive/NoopLattice.h b/clang/include/clang/Analysis/FlowSensitive/NoopLattice.h new file mode 100644 index 000000000000..019219328111 --- /dev/null +++ b/clang/include/clang/Analysis/FlowSensitive/NoopLattice.h @@ -0,0 +1,41 @@ +//===-- NoopLattice.h -------------------------------------------*- 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 the lattice with exactly one element. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_CLANG_ANALYSIS_FLOWSENSITIVE_NOOP_LATTICE_H +#define LLVM_CLANG_ANALYSIS_FLOWSENSITIVE_NOOP_LATTICE_H + +#include "clang/Analysis/FlowSensitive/DataflowLattice.h" +#include + +namespace clang { +namespace dataflow { + +/// Trivial lattice for dataflow analysis with exactly one element. +/// +/// Useful for analyses that only need the Environment and nothing more. +class NoopLattice { +public: + bool operator==(const NoopLattice &Other) const { return true; } + + LatticeJoinEffect join(const NoopLattice &Other) { + return LatticeJoinEffect::Unchanged; + } +}; + +inline std::ostream &operator<<(std::ostream &OS, const NoopLattice &) { + return OS << "noop"; +} + +} // namespace dataflow +} // namespace clang + +#endif // LLVM_CLANG_ANALYSIS_FLOWSENSITIVE_NOOP_LATTICE_H diff --git a/clang/include/clang/Analysis/FlowSensitive/Solver.h b/clang/include/clang/Analysis/FlowSensitive/Solver.h new file mode 100644 index 000000000000..6b685b9b3c9a --- /dev/null +++ b/clang/include/clang/Analysis/FlowSensitive/Solver.h @@ -0,0 +1,56 @@ +//===- Solver.h -------------------------------------------------*- 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 interface for a SAT solver that can be used by +// dataflow analyses. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_CLANG_ANALYSIS_FLOWSENSITIVE_SOLVER_H +#define LLVM_CLANG_ANALYSIS_FLOWSENSITIVE_SOLVER_H + +#include "clang/Analysis/FlowSensitive/Value.h" +#include "llvm/ADT/DenseSet.h" + +namespace clang { +namespace dataflow { + +/// An interface for a SAT solver that can be used by dataflow analyses. +class Solver { +public: + enum class Result { + /// Indicates that there exists a satisfying assignment for a boolean + /// formula. + Satisfiable, + + /// Indicates that there is no satisfying assignment for a boolean formula. + Unsatisfiable, + + /// Indicates that the solver gave up trying to find a satisfying assignment + /// for a boolean formula. + TimedOut, + }; + + virtual ~Solver() = default; + + /// Checks if the conjunction of `Vals` is satisfiable and returns the + /// corresponding result. + /// + /// Requirements: + /// + /// All elements in `Vals` must not be null. + /// + /// FIXME: Consider returning a model in case the conjunction of `Vals` is + /// satisfiable so that it can be used to generate warning messages. + virtual Result solve(llvm::DenseSet Vals) = 0; +}; + +} // namespace dataflow +} // namespace clang + +#endif // LLVM_CLANG_ANALYSIS_FLOWSENSITIVE_SOLVER_H diff --git a/clang/include/clang/Analysis/FlowSensitive/StorageLocation.h b/clang/include/clang/Analysis/FlowSensitive/StorageLocation.h index 5532813d6d29..fdfd03129b81 100644 --- a/clang/include/clang/Analysis/FlowSensitive/StorageLocation.h +++ b/clang/include/clang/Analysis/FlowSensitive/StorageLocation.h @@ -31,6 +31,12 @@ public: StorageLocation(Kind LocKind, QualType Type) : LocKind(LocKind), Type(Type) {} + // Non-copyable because addresses of storage locations are used as their + // identities throughout framework and user code. The framework is responsible + // for construction and destruction of storage locations. + StorageLocation(const StorageLocation &) = delete; + StorageLocation &operator=(const StorageLocation &) = delete; + virtual ~StorageLocation() = default; Kind getKind() const { return LocKind; } @@ -56,7 +62,9 @@ public: /// A storage location which is subdivided into smaller storage locations that /// can be traced independently by abstract interpretation. For example: a -/// struct with public members. +/// struct with public members. The child map is flat, so when used for a struct +/// or class type, all accessible members of base struct and class types are +/// directly accesible as children of this location. class AggregateStorageLocation final : public StorageLocation { public: explicit AggregateStorageLocation(QualType Type) diff --git a/clang/include/clang/Analysis/FlowSensitive/Transfer.h b/clang/include/clang/Analysis/FlowSensitive/Transfer.h index a12674a173be..25afa01f307c 100644 --- a/clang/include/clang/Analysis/FlowSensitive/Transfer.h +++ b/clang/include/clang/Analysis/FlowSensitive/Transfer.h @@ -20,12 +20,23 @@ namespace clang { namespace dataflow { +/// Maps statements to the environments of basic blocks that contain them. +class StmtToEnvMap { +public: + virtual ~StmtToEnvMap() = default; + + /// Returns the environment of the basic block that contains `S` or nullptr if + /// there isn't one. + /// FIXME: Ensure that the result can't be null and return a const reference. + virtual const Environment *getEnvironment(const Stmt &S) const = 0; +}; + /// Evaluates `S` and updates `Env` accordingly. /// /// Requirements: /// -/// The type of `S` must not be `ParenExpr`. -void transfer(const Stmt &S, Environment &Env); +/// `S` must not be `ParenExpr` or `ExprWithCleanups`. +void transfer(const StmtToEnvMap &StmtToEnv, const Stmt &S, Environment &Env); } // namespace dataflow } // namespace clang diff --git a/clang/include/clang/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.h b/clang/include/clang/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.h index 2d3a9e456370..5e168194064f 100644 --- a/clang/include/clang/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.h +++ b/clang/include/clang/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.h @@ -115,13 +115,17 @@ TypeErasedDataflowAnalysisState transferBlock( HandleTransferredStmt = nullptr); /// Performs dataflow analysis and returns a mapping from basic block IDs to -/// dataflow analysis states that model the respective basic blocks. Indices -/// of the returned vector correspond to basic block IDs. Returns an error if -/// the dataflow analysis cannot be performed successfully. +/// dataflow analysis states that model the respective basic blocks. Indices of +/// the returned vector correspond to basic block IDs. Returns an error if the +/// dataflow analysis cannot be performed successfully. Otherwise, calls +/// `PostVisitStmt` on each statement with the final analysis results at that +/// program point. llvm::Expected>> -runTypeErasedDataflowAnalysis(const ControlFlowContext &CFCtx, - TypeErasedDataflowAnalysis &Analysis, - const Environment &InitEnv); +runTypeErasedDataflowAnalysis( + const ControlFlowContext &CFCtx, TypeErasedDataflowAnalysis &Analysis, + const Environment &InitEnv, + std::function + PostVisitStmt = nullptr); } // namespace dataflow } // namespace clang diff --git a/clang/include/clang/Analysis/FlowSensitive/Value.h b/clang/include/clang/Analysis/FlowSensitive/Value.h index da04f926c597..70348f874543 100644 --- a/clang/include/clang/Analysis/FlowSensitive/Value.h +++ b/clang/include/clang/Analysis/FlowSensitive/Value.h @@ -26,79 +26,188 @@ namespace clang { namespace dataflow { /// Base class for all values computed by abstract interpretation. +/// +/// Don't use `Value` instances by value. All `Value` instances are allocated +/// and owned by `DataflowAnalysisContext`. class Value { public: - enum class Kind { Bool, Integer, Reference, Pointer, Struct }; + enum class Kind { + Integer, + Reference, + Pointer, + Struct, + + // Synthetic boolean values are either atomic values or composites that + // represent conjunctions, disjunctions, and negations. + AtomicBool, + Conjunction, + Disjunction, + Negation + }; explicit Value(Kind ValKind) : ValKind(ValKind) {} + // Non-copyable because addresses of values are used as their identities + // throughout framework and user code. The framework is responsible for + // construction and destruction of values. + Value(const Value &) = delete; + Value &operator=(const Value &) = delete; + virtual ~Value() = default; Kind getKind() const { return ValKind; } + /// Returns the value of the synthetic property with the given `Name` or null + /// if the property isn't assigned a value. + Value *getProperty(llvm::StringRef Name) const { + auto It = Properties.find(Name); + return It == Properties.end() ? nullptr : It->second; + } + + /// Assigns `Val` as the value of the synthetic property with the given + /// `Name`. + void setProperty(llvm::StringRef Name, Value &Val) { + Properties.insert_or_assign(Name, &Val); + } + private: Kind ValKind; + llvm::StringMap Properties; }; /// Models a boolean. class BoolValue : public Value { public: - explicit BoolValue() : Value(Kind::Bool) {} + explicit BoolValue(Kind ValueKind) : Value(ValueKind) {} - static bool classof(const Value *Val) { return Val->getKind() == Kind::Bool; } + static bool classof(const Value *Val) { + return Val->getKind() == Kind::AtomicBool || + Val->getKind() == Kind::Conjunction || + Val->getKind() == Kind::Disjunction || + Val->getKind() == Kind::Negation; + } }; -/// Models an integer. -class IntegerValue : public Value { +/// Models an atomic boolean. +class AtomicBoolValue : public BoolValue { public: - explicit IntegerValue() : Value(Kind::Integer) {} + explicit AtomicBoolValue() : BoolValue(Kind::AtomicBool) {} static bool classof(const Value *Val) { - return Val->getKind() == Kind::Integer; + return Val->getKind() == Kind::AtomicBool; } }; -/// Base class for values that refer to storage locations. -class IndirectionValue : public Value { +/// Models a boolean conjunction. +// FIXME: Consider representing binary and unary boolean operations similar +// to how they are represented in the AST. This might become more pressing +// when such operations need to be added for other data types. +class ConjunctionValue : public BoolValue { public: - /// Constructs a value that refers to `PointeeLoc`. - explicit IndirectionValue(Kind ValueKind, StorageLocation &PointeeLoc) - : Value(ValueKind), PointeeLoc(PointeeLoc) {} + explicit ConjunctionValue(BoolValue &LeftSubVal, BoolValue &RightSubVal) + : BoolValue(Kind::Conjunction), LeftSubVal(LeftSubVal), + RightSubVal(RightSubVal) {} static bool classof(const Value *Val) { - return Val->getKind() == Kind::Reference || Val->getKind() == Kind::Pointer; + return Val->getKind() == Kind::Conjunction; } - StorageLocation &getPointeeLoc() const { return PointeeLoc; } + /// Returns the left sub-value of the conjunction. + BoolValue &getLeftSubValue() const { return LeftSubVal; } + + /// Returns the right sub-value of the conjunction. + BoolValue &getRightSubValue() const { return RightSubVal; } private: - StorageLocation &PointeeLoc; + BoolValue &LeftSubVal; + BoolValue &RightSubVal; +}; + +/// Models a boolean disjunction. +class DisjunctionValue : public BoolValue { +public: + explicit DisjunctionValue(BoolValue &LeftSubVal, BoolValue &RightSubVal) + : BoolValue(Kind::Disjunction), LeftSubVal(LeftSubVal), + RightSubVal(RightSubVal) {} + + static bool classof(const Value *Val) { + return Val->getKind() == Kind::Disjunction; + } + + /// Returns the left sub-value of the disjunction. + BoolValue &getLeftSubValue() const { return LeftSubVal; } + + /// Returns the right sub-value of the disjunction. + BoolValue &getRightSubValue() const { return RightSubVal; } + +private: + BoolValue &LeftSubVal; + BoolValue &RightSubVal; +}; + +/// Models a boolean negation. +class NegationValue : public BoolValue { +public: + explicit NegationValue(BoolValue &SubVal) + : BoolValue(Kind::Negation), SubVal(SubVal) {} + + static bool classof(const Value *Val) { + return Val->getKind() == Kind::Negation; + } + + /// Returns the sub-value of the negation. + BoolValue &getSubVal() const { return SubVal; } + +private: + BoolValue &SubVal; +}; + +/// Models an integer. +class IntegerValue : public Value { +public: + explicit IntegerValue() : Value(Kind::Integer) {} + + static bool classof(const Value *Val) { + return Val->getKind() == Kind::Integer; + } }; /// Models a dereferenced pointer. For example, a reference in C++ or an lvalue /// in C. -class ReferenceValue final : public IndirectionValue { +class ReferenceValue final : public Value { public: - explicit ReferenceValue(StorageLocation &PointeeLoc) - : IndirectionValue(Kind::Reference, PointeeLoc) {} + explicit ReferenceValue(StorageLocation &ReferentLoc) + : Value(Kind::Reference), ReferentLoc(ReferentLoc) {} static bool classof(const Value *Val) { return Val->getKind() == Kind::Reference; } + + StorageLocation &getReferentLoc() const { return ReferentLoc; } + +private: + StorageLocation &ReferentLoc; }; /// Models a symbolic pointer. Specifically, any value of type `T*`. -class PointerValue final : public IndirectionValue { +class PointerValue final : public Value { public: explicit PointerValue(StorageLocation &PointeeLoc) - : IndirectionValue(Kind::Pointer, PointeeLoc) {} + : Value(Kind::Pointer), PointeeLoc(PointeeLoc) {} static bool classof(const Value *Val) { return Val->getKind() == Kind::Pointer; } + + StorageLocation &getPointeeLoc() const { return PointeeLoc; } + +private: + StorageLocation &PointeeLoc; }; -/// Models a value of `struct` or `class` type. +/// Models a value of `struct` or `class` type, with a flat map of fields to +/// child storage locations, containing all accessible members of base struct +/// and class types. class StructValue final : public Value { public: StructValue() : StructValue(llvm::DenseMap()) {} @@ -110,32 +219,20 @@ public: return Val->getKind() == Kind::Struct; } - /// Returns the child value that is assigned for `D`. - Value &getChild(const ValueDecl &D) const { + /// Returns the child value that is assigned for `D` or null if the child is + /// not initialized. + Value *getChild(const ValueDecl &D) const { auto It = Children.find(&D); - assert(It != Children.end()); - return *It->second; + if (It == Children.end()) + return nullptr; + return It->second; } /// Assigns `Val` as the child value for `D`. void setChild(const ValueDecl &D, Value &Val) { Children[&D] = &Val; } - /// Returns the value of the synthetic property with the given `Name` or null - /// if the property isn't assigned a value. - Value *getProperty(llvm::StringRef Name) const { - auto It = Properties.find(Name); - return It == Properties.end() ? nullptr : It->second; - } - - /// Assigns `Val` as the value of the synthetic property with the given - /// `Name`. - void setProperty(llvm::StringRef Name, Value &Val) { - Properties.insert_or_assign(Name, &Val); - } - private: llvm::DenseMap Children; - llvm::StringMap Properties; }; } // namespace dataflow diff --git a/clang/include/clang/Analysis/FlowSensitive/WatchedLiteralsSolver.h b/clang/include/clang/Analysis/FlowSensitive/WatchedLiteralsSolver.h new file mode 100644 index 000000000000..702da97349da --- /dev/null +++ b/clang/include/clang/Analysis/FlowSensitive/WatchedLiteralsSolver.h @@ -0,0 +1,37 @@ +//===- WatchedLiteralsSolver.h ----------------------------------*- 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 a SAT solver implementation that can be used by dataflow +// analyses. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_CLANG_ANALYSIS_FLOWSENSITIVE_WATCHEDLITERALSSOLVER_H +#define LLVM_CLANG_ANALYSIS_FLOWSENSITIVE_WATCHEDLITERALSSOLVER_H + +#include "clang/Analysis/FlowSensitive/Solver.h" +#include "clang/Analysis/FlowSensitive/Value.h" +#include "llvm/ADT/DenseSet.h" + +namespace clang { +namespace dataflow { + +/// A SAT solver that is an implementation of Algorithm D from Knuth's The Art +/// of Computer Programming Volume 4: Satisfiability, Fascicle 6. It is based on +/// the Davis-Putnam-Logemann-Loveland (DPLL) algorithm, keeps references to a +/// single "watched" literal per clause, and uses a set of "active" variables +/// for unit propagation. +class WatchedLiteralsSolver : public Solver { +public: + Result solve(llvm::DenseSet Vals) override; +}; + +} // namespace dataflow +} // namespace clang + +#endif // LLVM_CLANG_ANALYSIS_FLOWSENSITIVE_WATCHEDLITERALSSOLVER_H diff --git a/clang/include/clang/Analysis/PathDiagnostic.h b/clang/include/clang/Analysis/PathDiagnostic.h index 446f67b23e75..9877f1e3d01f 100644 --- a/clang/include/clang/Analysis/PathDiagnostic.h +++ b/clang/include/clang/Analysis/PathDiagnostic.h @@ -544,15 +544,13 @@ public: /// flag may have been previously set, at which point it will not /// be reset unless one specifies to do so. void setPrunable(bool isPrunable, bool override = false) { - if (IsPrunable.hasValue() && !override) - return; + if (IsPrunable && !override) + return; IsPrunable = isPrunable; } /// Return true if the diagnostic piece is prunable. - bool isPrunable() const { - return IsPrunable.getValueOr(false); - } + bool isPrunable() const { return IsPrunable.value_or(false); } void dump() const override; diff --git a/clang/include/clang/Basic/Attr.td b/clang/include/clang/Basic/Attr.td index be56373cc3ca..cb47215f7e1d 100644 --- a/clang/include/clang/Basic/Attr.td +++ b/clang/include/clang/Basic/Attr.td @@ -19,10 +19,19 @@ def DocCatType : DocumentationCategory<"Type Attributes">; def DocCatStmt : DocumentationCategory<"Statement Attributes">; def DocCatDecl : DocumentationCategory<"Declaration Attributes">; -// Attributes listed under the Undocumented category do not generate any public -// documentation. Ideally, this category should be used for internal-only -// attributes which contain no spellings. -def DocCatUndocumented : DocumentationCategory<"Undocumented">; +// This category is for attributes which have not yet been properly documented, +// but should be. +def DocCatUndocumented : DocumentationCategory<"Undocumented"> { + let Content = [{ +This section lists attributes which are recognized by Clang, but which are +currently missing documentation. +}]; +} + +// Attributes listed under the InternalOnly category do not generate any entry +// in the documentation. This category should be used only when we _want_ +// to not document the attribute, e.g. if the attribute has no spellings. +def DocCatInternalOnly : DocumentationCategory<"InternalOnly">; class DocDeprecated { // If the Replacement field is empty, no replacement will be listed with the @@ -48,11 +57,17 @@ class Documentation { DocDeprecated Deprecated; } -// Specifies that the attribute is explicitly undocumented. This can be a -// helpful placeholder for the attribute while working on the implementation, -// but should not be used once feature work has been completed. +// Specifies that the attribute is explicitly omitted from the documentation, +// because it is not intended to be user-facing. +def InternalOnly : Documentation { + let Category = DocCatInternalOnly; +} + +// Specifies that the attribute is undocumented, but that it _should_ have +// documentation. def Undocumented : Documentation { let Category = DocCatUndocumented; + let Content = "No documentation."; } include "clang/Basic/AttrDocs.td" @@ -126,6 +141,11 @@ def FunctionTmpl FunctionDecl::TK_FunctionTemplate}], "function templates">; +def HLSLEntry + : SubsetSubjectisExternallyVisible() && !isa(S)}], + "global functions">; + def ClassTmpl : SubsetSubjectgetDescribedClassTemplate()}], "class templates">; @@ -295,6 +315,9 @@ class Clang : Spelling { bit AllowInC = allowInC; } +// HLSL Semantic spellings +class HLSLSemantic : Spelling; + class Accessor spellings> { string Name = name; list Spellings = spellings; @@ -336,6 +359,8 @@ def ObjCAutoRefCount : LangOpt<"ObjCAutoRefCount">; def ObjCNonFragileRuntime : LangOpt<"", "LangOpts.ObjCRuntime.allowsClassStubs()">; +def HLSL : LangOpt<"HLSL">; + // Language option for CMSE extensions def Cmse : LangOpt<"Cmse">; @@ -541,6 +566,8 @@ class Attr { // match rules. // - It has GNU/CXX11 spelling and doesn't require delayed parsing. bit PragmaAttributeSupport; + // Set to true if this attribute accepts parameter pack expansion expressions. + bit AcceptsExprPack = 0; // Lists language options, one of which is required to be true for the // attribute to be applicable. If empty, no language options are required. list LangOpts = []; @@ -614,7 +641,7 @@ class IgnoredAttr : Attr { let Ignored = 1; let ASTNode = 0; let SemaHandler = 0; - let Documentation = [Undocumented]; + let Documentation = [InternalOnly]; } // @@ -694,19 +721,23 @@ def AlignMac68k : InheritableAttr { // This attribute has no spellings as it is only ever created implicitly. let Spellings = []; let SemaHandler = 0; - let Documentation = [Undocumented]; + let Documentation = [InternalOnly]; } def AlignNatural : InheritableAttr { // This attribute has no spellings as it is only ever created implicitly. let Spellings = []; let SemaHandler = 0; - let Documentation = [Undocumented]; + let Documentation = [InternalOnly]; } -def AlwaysInline : InheritableAttr { - let Spellings = [GCC<"always_inline">, Keyword<"__forceinline">]; - let Subjects = SubjectList<[Function]>; +def AlwaysInline : DeclOrStmtAttr { + let Spellings = [GCC<"always_inline">, CXX11<"clang", "always_inline">, + C2x<"clang", "always_inline">, Keyword<"__forceinline">]; + let Accessors = [Accessor<"isClangAlwaysInline", [CXX11<"clang", "always_inline">, + C2x<"clang", "always_inline">]>]; + let Subjects = SubjectList<[Function, Stmt], WarnDiag, + "functions and statements">; let Documentation = [AlwaysInlineDocs]; } @@ -784,9 +815,18 @@ def Annotate : InheritableParamAttr { } }]; let PragmaAttributeSupport = 1; + let AcceptsExprPack = 1; let Documentation = [Undocumented]; } +def AnnotateType : TypeAttr { + let Spellings = [CXX11<"clang", "annotate_type">, C2x<"clang", "annotate_type">]; + let Args = [StringArgument<"Annotation">, VariadicExprArgument<"Args">]; + let HasCustomParsing = 1; + let AcceptsExprPack = 1; + let Documentation = [AnnotateTypeDocs]; +} + def ARMInterrupt : InheritableAttr, TargetSpecificAttr { // NOTE: If you add any additional spellings, M68kInterrupt's, // MSP430Interrupt's, MipsInterrupt's and AnyX86Interrupt's spellings @@ -853,6 +893,7 @@ def Availability : InheritableAttr { .Case("macos", "macOS") .Case("tvos", "tvOS") .Case("watchos", "watchOS") + .Case("driverkit", "DriverKit") .Case("ios_app_extension", "iOS (App Extension)") .Case("macos_app_extension", "macOS (App Extension)") .Case("tvos_app_extension", "tvOS (App Extension)") @@ -1162,7 +1203,7 @@ def CUDAInvalidTarget : InheritableAttr { let Spellings = []; let Subjects = SubjectList<[Function]>; let LangOpts = [CUDA]; - let Documentation = [Undocumented]; + let Documentation = [InternalOnly]; } def CUDALaunchBounds : InheritableAttr { @@ -1206,10 +1247,10 @@ def C11NoReturn : InheritableAttr { } def CXX11NoReturn : InheritableAttr { - let Spellings = [CXX11<"", "noreturn", 200809>]; + let Spellings = [CXX11<"", "noreturn", 200809>, + C2x<"", "noreturn", 202202>, C2x<"", "_Noreturn", 202202>]; let Subjects = SubjectList<[Function], ErrorDiag>; let Documentation = [CXX11NoReturnDocs]; - let SimpleHandler = 1; } // Similar to CUDA, OpenCL attributes do not receive a [[]] spelling because @@ -1387,7 +1428,6 @@ def : MutualExclusions<[Likely, Unlikely]>; def NoMerge : DeclOrStmtAttr { let Spellings = [Clang<"nomerge">]; let Documentation = [NoMergeDocs]; - let InheritEvenIfAlreadyPresent = 1; let Subjects = SubjectList<[Function, Stmt], ErrorDiag, "functions and statements">; let SimpleHandler = 1; @@ -1415,13 +1455,15 @@ def Final : InheritableAttr { let Spellings = [Keyword<"final">, Keyword<"sealed">]; let Accessors = [Accessor<"isSpelledAsSealed", [Keyword<"sealed">]>]; let SemaHandler = 0; - let Documentation = [Undocumented]; + // Omitted from docs, since this is language syntax, not an attribute, as far + // as users are concerned. + let Documentation = [InternalOnly]; } def MinSize : InheritableAttr { let Spellings = [Clang<"minsize">]; let Subjects = SubjectList<[Function, ObjCMethod], ErrorDiag>; - let Documentation = [Undocumented]; + let Documentation = [MinSizeDocs]; } def FlagEnum : InheritableAttr { @@ -1477,8 +1519,6 @@ def GNUInline : InheritableAttr { def Hot : InheritableAttr { let Spellings = [GCC<"hot">]; let Subjects = SubjectList<[Function]>; - // An AST node is created for this attribute, but not actually used beyond - // semantic checking for mutual exclusion with the Cold attribute. let Documentation = [Undocumented]; let SimpleHandler = 1; } @@ -1557,7 +1597,7 @@ def MaxFieldAlignment : InheritableAttr { let Spellings = []; let Args = [UnsignedArgument<"Alignment">]; let SemaHandler = 0; - let Documentation = [Undocumented]; + let Documentation = [InternalOnly]; } def MayAlias : InheritableAttr { @@ -1758,10 +1798,15 @@ def Convergent : InheritableAttr { let SimpleHandler = 1; } -def NoInline : InheritableAttr { - let Spellings = [GCC<"noinline">, Declspec<"noinline">]; - let Subjects = SubjectList<[Function]>; - let Documentation = [Undocumented]; +def NoInline : DeclOrStmtAttr { + let Spellings = [Keyword<"__noinline__">, GCC<"noinline">, + CXX11<"clang", "noinline">, C2x<"clang", "noinline">, + Declspec<"noinline">]; + let Accessors = [Accessor<"isClangNoInline", [CXX11<"clang", "noinline">, + C2x<"clang", "noinline">]>]; + let Documentation = [NoInlineDocs]; + let Subjects = SubjectList<[Function, Stmt], WarnDiag, + "functions and statements">; let SimpleHandler = 1; } @@ -1835,6 +1880,11 @@ def AMDGPUNumVGPR : InheritableAttr { let Subjects = SubjectList<[Function], ErrorDiag, "kernel functions">; } +def AMDGPUKernelCall : DeclOrTypeAttr { + let Spellings = [Clang<"amdgpu_kernel">]; + let Documentation = [Undocumented]; +} + def BPFPreserveAccessIndex : InheritableAttr, TargetSpecificAttr { let Spellings = [Clang<"preserve_access_index">]; @@ -1899,9 +1949,9 @@ def NonNull : InheritableParamAttr { bool isNonNull(unsigned IdxAST) const { if (!args_size()) return true; - return args_end() != std::find_if( - args_begin(), args_end(), - [=](const ParamIdx &Idx) { return Idx.getASTIndex() == IdxAST; }); + return llvm::any_of(args(), [=](const ParamIdx &Idx) { + return Idx.getASTIndex() == IdxAST; + }); } }]; // FIXME: We should merge duplicates into a single nonnull attribute. @@ -1959,7 +2009,7 @@ def TypeNullUnspecified : TypeAttr { // qualifier is as an ObjCOwnership attribute with Kind == "none". def ObjCInertUnsafeUnretained : TypeAttr { let Spellings = [Keyword<"__unsafe_unretained">]; - let Documentation = [Undocumented]; + let Documentation = [InternalOnly]; } def ObjCKindOf : TypeAttr { @@ -2243,7 +2293,9 @@ def Overloadable : Attr { def Override : InheritableAttr { let Spellings = [Keyword<"override">]; let SemaHandler = 0; - let Documentation = [Undocumented]; + // Omitted from docs, since this is language syntax, not an attribute, as far + // as users are concerned. + let Documentation = [InternalOnly]; } def Ownership : InheritableAttr { @@ -2292,6 +2344,11 @@ def AArch64VectorPcs: DeclOrTypeAttr { let Documentation = [AArch64VectorPcsDocs]; } +def AArch64SVEPcs: DeclOrTypeAttr { + let Spellings = [Clang<"aarch64_sve_pcs">]; + let Documentation = [AArch64SVEPcsDocs]; +} + def Pure : InheritableAttr { let Spellings = [GCC<"pure">]; let Documentation = [Undocumented]; @@ -2427,7 +2484,7 @@ def PragmaClangBSSSection : InheritableAttr { let Spellings = []; let Args = [StringArgument<"Name">]; let Subjects = SubjectList<[GlobalVar], ErrorDiag>; - let Documentation = [Undocumented]; + let Documentation = [InternalOnly]; } def PragmaClangDataSection : InheritableAttr { @@ -2435,7 +2492,7 @@ def PragmaClangDataSection : InheritableAttr { let Spellings = []; let Args = [StringArgument<"Name">]; let Subjects = SubjectList<[GlobalVar], ErrorDiag>; - let Documentation = [Undocumented]; + let Documentation = [InternalOnly]; } def PragmaClangRodataSection : InheritableAttr { @@ -2443,7 +2500,7 @@ def PragmaClangRodataSection : InheritableAttr { let Spellings = []; let Args = [StringArgument<"Name">]; let Subjects = SubjectList<[GlobalVar], ErrorDiag>; - let Documentation = [Undocumented]; + let Documentation = [InternalOnly]; } def PragmaClangRelroSection : InheritableAttr { @@ -2451,7 +2508,7 @@ def PragmaClangRelroSection : InheritableAttr { let Spellings = []; let Args = [StringArgument<"Name">]; let Subjects = SubjectList<[GlobalVar], ErrorDiag>; - let Documentation = [Undocumented]; + let Documentation = [InternalOnly]; } def StrictFP : InheritableAttr { @@ -2459,7 +2516,7 @@ def StrictFP : InheritableAttr { // Function uses strict floating point operations. let Spellings = []; let Subjects = SubjectList<[Function]>; - let Documentation = [Undocumented]; + let Documentation = [InternalOnly]; } def PragmaClangTextSection : InheritableAttr { @@ -2467,7 +2524,7 @@ def PragmaClangTextSection : InheritableAttr { let Spellings = []; let Args = [StringArgument<"Name">]; let Subjects = SubjectList<[Function], ErrorDiag>; - let Documentation = [Undocumented]; + let Documentation = [InternalOnly]; } def Sentinel : InheritableAttr { @@ -2561,6 +2618,19 @@ def VectorCall : DeclOrTypeAttr { let Documentation = [VectorCallDocs]; } +def ZeroCallUsedRegs : InheritableAttr { + let Spellings = [GCC<"zero_call_used_regs">]; + let Subjects = SubjectList<[Function], ErrorDiag>; + let Args = [ + EnumArgument<"ZeroCallUsedRegs", "ZeroCallUsedRegsKind", + ["skip", "used-gpr-arg", "used-gpr", "used-arg", "used", + "all-gpr-arg", "all-gpr", "all-arg", "all"], + ["Skip", "UsedGPRArg", "UsedGPR", "UsedArg", "Used", + "AllGPRArg", "AllGPR", "AllArg", "All"]> + ]; + let Documentation = [ZeroCallUsedRegsDocs]; +} + def Pascal : DeclOrTypeAttr { let Spellings = [Clang<"pascal">, Keyword<"__pascal">, Keyword<"_pascal">]; // let Subjects = [Function, ObjCMethod]; @@ -2693,8 +2763,12 @@ def TargetClones : InheritableAttr { StringRef getFeatureStr(unsigned Index) const { return *(featuresStrs_begin() + Index); } - // 'default' is always moved to the end, so it isn't considered - // when mangling the index. + // Given an index into the 'featuresStrs' sequence, compute a unique + // ID to be used with function name mangling for the associated variant. + // This mapping is necessary due to a requirement that the mangling ID + // used for the "default" variant be the largest mangling ID in the + // variant set. Duplicate variants present in 'featuresStrs' are also + // assigned their own unique ID (the mapping is bijective). unsigned getMangledIndex(unsigned Index) const { if (getFeatureStr(Index) == "default") return std::count_if(featuresStrs_begin(), featuresStrs_end(), @@ -2704,9 +2778,10 @@ def TargetClones : InheritableAttr { [](StringRef S) { return S != "default"; }); } - // True if this is the first of this version to appear in the config string. - // This is used to make sure we don't try to emit this function multiple - // times. + // Given an index into the 'featuresStrs' sequence, determine if the + // index corresponds to the first instance of the named variant. This + // is used to skip over duplicate variant instances when iterating over + // 'featuresStrs'. bool isFirstOfVersion(unsigned Index) const { StringRef FeatureStr(getFeatureStr(Index)); return 0 == std::count_if( @@ -2894,7 +2969,7 @@ def WarnUnusedResult : InheritableAttr { C2x<"", "nodiscard", 201904>, CXX11<"clang", "warn_unused_result">, GCC<"warn_unused_result">]; - let Subjects = SubjectList<[ObjCMethod, Enum, Record, FunctionLike]>; + let Subjects = SubjectList<[ObjCMethod, Enum, Record, FunctionLike, TypedefName]>; let Args = [StringArgument<"Message", 1>]; let Documentation = [WarnUnusedResultsDocs]; let AdditionalMembers = [{ @@ -2909,7 +2984,7 @@ def WarnUnusedResult : InheritableAttr { def Weak : InheritableAttr { let Spellings = [GCC<"weak">]; let Subjects = SubjectList<[Var, Function, CXXRecord]>; - let Documentation = [Undocumented]; + let Documentation = [WeakDocs]; let SimpleHandler = 1; } @@ -3438,7 +3513,7 @@ def DLLExportStaticLocal : InheritableAttr, TargetSpecificAttr; - let Documentation = [Undocumented]; + let Documentation = [InternalOnly]; } def DLLImport : InheritableAttr, TargetSpecificAttr { @@ -3464,7 +3539,7 @@ def DLLImportStaticLocal : InheritableAttr, TargetSpecificAttr; - let Documentation = [Undocumented]; + let Documentation = [InternalOnly]; } def SelectAny : InheritableAttr { @@ -3530,7 +3605,7 @@ def MSVtorDisp : InheritableAttr { let AdditionalMembers = [{ MSVtorDispMode getVtorDispMode() const { return MSVtorDispMode(vdm); } }]; - let Documentation = [Undocumented]; + let Documentation = [InternalOnly]; } def InitSeg : Attr { @@ -3622,21 +3697,21 @@ def CapturedRecord : InheritableAttr { // This attribute has no spellings as it is only ever created implicitly. let Spellings = []; let SemaHandler = 0; - let Documentation = [Undocumented]; + let Documentation = [InternalOnly]; } def OMPThreadPrivateDecl : InheritableAttr { // This attribute has no spellings as it is only ever created implicitly. let Spellings = []; let SemaHandler = 0; - let Documentation = [Undocumented]; + let Documentation = [InternalOnly]; } def OMPCaptureNoInit : InheritableAttr { // This attribute has no spellings as it is only ever created implicitly. let Spellings = []; let SemaHandler = 0; - let Documentation = [Undocumented]; + let Documentation = [InternalOnly]; } def OMPCaptureKind : Attr { @@ -3644,7 +3719,7 @@ def OMPCaptureKind : Attr { let Spellings = []; let SemaHandler = 0; let Args = [UnsignedArgument<"CaptureKindVal">]; - let Documentation = [Undocumented]; + let Documentation = [InternalOnly]; let AdditionalMembers = [{ llvm::omp::Clause getCaptureKind() const { return static_cast(getCaptureKindVal()); @@ -3657,7 +3732,7 @@ def OMPReferencedVar : Attr { let Spellings = []; let SemaHandler = 0; let Args = [ExprArgument<"Ref">]; - let Documentation = [Undocumented]; + let Documentation = [InternalOnly]; } def OMPDeclareSimdDecl : Attr { @@ -3730,7 +3805,7 @@ def OMPAllocateDecl : InheritableAttr { ExprArgument<"Allocator">, ExprArgument<"Alignment"> ]; - let Documentation = [Undocumented]; + let Documentation = [InternalOnly]; } def OMPDeclareVariant : InheritableAttr { @@ -3887,12 +3962,12 @@ def Builtin : InheritableAttr { let Args = [UnsignedArgument<"ID">]; let Subjects = SubjectList<[Function]>; let SemaHandler = 0; - let Documentation = [Undocumented]; + let Documentation = [InternalOnly]; } def EnforceTCB : InheritableAttr { let Spellings = [Clang<"enforce_tcb">]; - let Subjects = SubjectList<[Function]>; + let Subjects = SubjectList<[Function, ObjCMethod]>; let Args = [StringArgument<"TCBName">]; let Documentation = [EnforceTCBDocs]; bit InheritEvenIfAlreadyPresent = 1; @@ -3900,7 +3975,7 @@ def EnforceTCB : InheritableAttr { def EnforceTCBLeaf : InheritableAttr { let Spellings = [Clang<"enforce_tcb_leaf">]; - let Subjects = SubjectList<[Function]>; + let Subjects = SubjectList<[Function, ObjCMethod]>; let Args = [StringArgument<"TCBName">]; let Documentation = [EnforceTCBLeafDocs]; bit InheritEvenIfAlreadyPresent = 1; @@ -3914,3 +3989,50 @@ def Error : InheritableAttr { let Subjects = SubjectList<[Function], ErrorDiag>; let Documentation = [ErrorAttrDocs]; } + +def HLSLNumThreads: InheritableAttr { + let Spellings = [Microsoft<"numthreads">]; + let Args = [IntArgument<"X">, IntArgument<"Y">, IntArgument<"Z">]; + let Subjects = SubjectList<[HLSLEntry]>; + let LangOpts = [HLSL]; + let Documentation = [NumThreadsDocs]; +} + +def HLSLSV_GroupIndex: InheritableAttr { + let Spellings = [HLSLSemantic<"SV_GroupIndex">]; + let Subjects = SubjectList<[ParmVar, GlobalVar]>; + let LangOpts = [HLSL]; + let Documentation = [HLSLSV_GroupIndexDocs]; +} + +def HLSLShader : InheritableAttr { + let Spellings = [Microsoft<"shader">]; + let Subjects = SubjectList<[HLSLEntry]>; + let LangOpts = [HLSL]; + let Args = [EnumArgument<"Type", "ShaderType", + ["pixel", "vertex", "geometry", "hull", "domain", + "compute", "raygeneration", "intersection", + "anyhit", "closesthit", "miss", "callable", "mesh", + "amplification"], + ["Pixel", "Vertex", "Geometry", "Hull", "Domain", + "Compute", "RayGeneration", "Intersection", + "AnyHit", "ClosestHit", "Miss", "Callable", "Mesh", + "Amplification"] + >]; + let Documentation = [HLSLSV_ShaderTypeAttrDocs]; +} + +def RandomizeLayout : InheritableAttr { + let Spellings = [GCC<"randomize_layout">]; + let Subjects = SubjectList<[Record]>; + let Documentation = [ClangRandomizeLayoutDocs]; + let LangOpts = [COnly]; +} + +def NoRandomizeLayout : InheritableAttr { + let Spellings = [GCC<"no_randomize_layout">]; + let Subjects = SubjectList<[Record]>; + let Documentation = [ClangRandomizeLayoutDocs]; + let LangOpts = [COnly]; +} +def : MutualExclusions<[RandomizeLayout, NoRandomizeLayout]>; diff --git a/clang/include/clang/Basic/AttrDocs.td b/clang/include/clang/Basic/AttrDocs.td index efd2af1ab1df..4e4d871a58a7 100644 --- a/clang/include/clang/Basic/AttrDocs.td +++ b/clang/include/clang/Basic/AttrDocs.td @@ -285,6 +285,17 @@ features that are required for the function to be called. The result of this is that future processors execute the most restrictive version of the function the new processor can execute. +In addition, unlike the ICC implementation of this feature, the selection of the +version does not consider the manufacturer or microarchitecture of the processor. +It tests solely the list of features that are both supported by the specified +processor and present in the compiler-rt library. This can be surprising at times, +as the runtime processor may be from a completely different manufacturer, as long +as it supports the same feature set. + +This can additionally be surprising, as some processors are indistringuishable from +others based on the list of testable features. When this happens, the variant +is selected in an unspecified manner. + Function versions are defined with ``cpu_specific``, which takes one or more CPU names as a parameter. For example: @@ -487,10 +498,14 @@ pointer type. def CXX11NoReturnDocs : Documentation { let Category = DocCatFunction; + let Heading = "noreturn, _Noreturn"; let Content = [{ A function declared as ``[[noreturn]]`` shall not return to its caller. The compiler will generate a diagnostic for a function declared as ``[[noreturn]]`` that appears to be capable of returning to its caller. + +The ``[[_Noreturn]]`` spelling is deprecated and only exists to ease code +migration for code using ``[[noreturn]]`` after including ````. }]; } @@ -512,6 +527,33 @@ calls. }]; } +def NoInlineDocs : Documentation { + let Category = DocCatFunction; + let Content = [{ +This function attribute suppresses the inlining of a function at the call sites +of the function. + +``[[clang::noinline]]`` spelling can be used as a statement attribute; other +spellings of the attribute are not supported on statements. If a statement is +marked ``[[clang::noinline]]`` and contains calls, those calls inside the +statement will not be inlined by the compiler. + +``__noinline__`` can be used as a keyword in CUDA/HIP languages. This is to +avoid diagnostics due to usage of ``__attribute__((__noinline__))`` +with ``__noinline__`` defined as a macro as ``__attribute__((noinline))``. + +.. code-block:: c + + int example(void) { + int r; + [[clang::noinline]] foo(); + [[clang::noinline]] r = bar(); + return r; + } + + }]; +} + def MustTailDocs : Documentation { let Category = DocCatStmt; let Content = [{ @@ -1513,6 +1555,10 @@ attributes are ignored. Supported platforms are: ``watchos`` Apple's watchOS operating system. The minimum deployment target is specified by the ``-mwatchos-version-min=*version*`` command-line argument. + +``driverkit`` + Apple's DriverKit userspace kernel extensions. The minimum deployment target + is specified as part of the triple. A declaration can typically be used even when deploying back to a platform version prior to when the declaration was introduced. When this happens, the @@ -2509,6 +2555,32 @@ the Arm Developer website. }]; } +def AArch64SVEPcsDocs : Documentation { + let Category = DocCatCallingConvs; + let Content = [{ +On AArch64 targets, this attribute changes the calling convention of a +function to preserve additional Scalable Vector registers and Scalable +Predicate registers relative to the default calling convention used for +AArch64. + +This means it is more efficient to call such functions from code that performs +extensive scalable vector and scalable predicate calculations, because fewer +live SVE registers need to be saved. This property makes it well-suited for SVE +math library functions, which are typically leaf functions that require a small +number of registers. + +However, using this attribute also means that it is more expensive to call +a function that adheres to the default calling convention from within such +a function. Therefore, it is recommended that this attribute is only used +for leaf functions. + +For more information, see the documentation for `aarch64_sve_pcs` in the +ARM C Language Extension (ACLE) documentation. + +.. _`aarch64_sve_pcs`: https://github.com/ARM-software/acle/blob/main/main/acle.md#scalable-vector-extension-procedure-call-standard-attribute + }]; +} + def RegparmDocs : Documentation { let Category = DocCatCallingConvs; let Content = [{ @@ -3295,6 +3367,9 @@ If a type is trivial for the purposes of calls, has a non-trivial destructor, and is passed as an argument by value, the convention is that the callee will destroy the object before returning. +If a type is trivial for the purpose of calls, it is assumed to be trivially +relocatable for the purpose of ``__is_trivially_relocatable``. + Attribute ``trivial_abi`` has no effect in the following cases: - The class directly declares a virtual base or virtual methods. @@ -3813,10 +3888,10 @@ completion handler in a Swift async method. For instance, here: This method asynchronously calls ``completionHandler`` when the data is available, or calls it with an error. ``_Nullable_result`` indicates to the Swift importer that this is the uncommon case where ``result`` can get ``nil`` -even if no error has occured, and will therefore import it as a Swift optional +even if no error has occurred, and will therefore import it as a Swift optional type. Otherwise, if ``result`` was annotated with ``_Nullable``, the Swift importer will assume that ``result`` will always be non-nil unless an error -occured. +occurred. }]; } @@ -4255,6 +4330,7 @@ Clang provides the following context selector extensions, used via match_none disable_implicit_base allow_templates + bind_to_declaration The match extensions change when the *entire* context selector is considered a match for an OpenMP context. The default is ``all``, with ``none`` no trait in the @@ -4270,8 +4346,9 @@ The allow extensions change when the ``begin declare variant`` effect is applied to a definition. If ``allow_templates`` is given, template function definitions are considered as specializations of existing or assumed template declarations with the same name. The template parameters for the base functions -are used to instantiate the specialization. - +are used to instantiate the specialization. If ``bind_to_declartion`` is given, +apply the same variant rules to function declarations. This allows the user to +override declarations with only a function declaration. }]; } @@ -5758,6 +5835,15 @@ attribute can also be written using C++11 syntax: ``[[mig::server_routine]]``. }]; } +def MinSizeDocs : Documentation { + let Category = DocCatFunction; + let Content = [{ +This function attribute indicates that optimization passes and code generator passes +make choices that keep the function code size as small as possible. Optimizations may +also sacrifice runtime performance in order to minimize the size of the generated code. + }]; +} + def MSAllocatorDocs : Documentation { let Category = DocCatFunction; let Content = [{ @@ -5925,9 +6011,6 @@ attribute `clang_builtin_alias`. def NoBuiltinDocs : Documentation { let Category = DocCatFunction; let Content = [{ -.. Note:: This attribute is not yet fully implemented, it is validated but has - no effect on the generated code. - The ``__attribute__((no_builtin))`` is similar to the ``-fno-builtin`` flag except it is specific to the body of a function. The attribute may also be applied to a virtual function but has no effect on the behavior of overriding @@ -6200,7 +6283,36 @@ def AlwaysInlineDocs : Documentation { Inlining heuristics are disabled and inlining is always attempted regardless of optimization level. -Does not guarantee that inline substitution actually occurs. +``[[clang::always_inline]]`` spelling can be used as a statement attribute; other +spellings of the attribute are not supported on statements. If a statement is +marked ``[[clang::always_inline]]`` and contains calls, the compiler attempts +to inline those calls. + +.. code-block:: c + + int example(void) { + int i; + [[clang::always_inline]] foo(); // attempts to inline foo + [[clang::always_inline]] i = bar(); // attempts to inline bar + [[clang::always_inline]] return f(42, baz(bar())); // attempts to inline everything + } + +A declaration statement, which is a statement, is not a statement that can have an +attribute associated with it (the attribute applies to the declaration, not the +statement in that case). So this use case will not work: + +.. code-block:: c + + int example(void) { + [[clang::always_inline]] int i = bar(); + return i; + } + +This attribute does not guarantee that inline substitution actually occurs. + +Note: applying this attribute to a coroutine at the `-O0` optimization level +has no effect; other optimization levels may only partially inline and result in a +diagnostic. See also `the Microsoft Docs on Inline Functions`_, `the GCC Common Function Attribute docs`_, and `the GCC Inline docs`_. @@ -6263,3 +6375,216 @@ pointing to precise locations of the call site in the source. } }]; } + +def ZeroCallUsedRegsDocs : Documentation { + let Category = DocCatFunction; + let Content = [{ +This attribute, when attached to a function, causes the compiler to zero a +subset of all call-used registers before the function returns. It's used to +increase program security by either mitigating `Return-Oriented Programming`_ +(ROP) attacks or preventing information leakage through registers. + +The term "call-used" means registers which are not guaranteed to be preserved +unchanged for the caller by the current calling convention. This could also be +described as "caller-saved" or "not callee-saved". + +The `choice` parameters gives the programmer flexibility to choose the subset +of the call-used registers to be zeroed: + +- ``skip`` doesn't zero any call-used registers. This choice overrides any + command-line arguments. +- ``used`` only zeros call-used registers used in the function. By ``used``, we + mean a register whose contents have been set or referenced in the function. +- ``used-gpr`` only zeros call-used GPR registers used in the funciton. +- ``used-arg`` only zeros call-used registers used to pass arguments to the + function. +- ``used-gpr-arg`` only zeros call-used GPR registers used to pass arguments to + the function. +- ``all`` zeros all call-used registers. +- ``all-gpr`` zeros all call-used GPR registers. +- ``all-arg`` zeros all call-used registers used to pass arguments to the + function. +- ``all-gpr-arg`` zeros all call-used GPR registers used to pass arguments to + the function. + +The default for the attribute is contolled by the ``-fzero-call-used-regs`` +flag. + +.. _Return-Oriented Programming: https://en.wikipedia.org/wiki/Return-oriented_programming + }]; +} + +def NumThreadsDocs : Documentation { + let Category = DocCatFunction; + let Content = [{ +The ``numthreads`` attribute applies to HLSL shaders where explcit thread counts +are required. The ``X``, ``Y``, and ``Z`` values provided to the attribute +dictate the thread id. Total number of threads executed is ``X * Y * Z``. + +The full documentation is available here: https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/sm5-attributes-numthreads + }]; +} + +def HLSLSV_ShaderTypeAttrDocs : Documentation { + let Category = DocCatFunction; + let Content = [{ +The ``shader`` type attribute applies to HLSL shader entry functions to +identify the shader type for the entry function. +The syntax is: + +.. code-block:: text + + ``[shader(string-literal)]`` + +where the string literal is one of: "pixel", "vertex", "geometry", "hull", +"domain", "compute", "raygeneration", "intersection", "anyhit", "closesthit", +"miss", "callable", "mesh", "amplification". Normally the shader type is set +by shader target with the ``-T`` option like ``-Tps_6_1``. When compiling to a +library target like ``lib_6_3``, the shader type attribute can help the +compiler to identify the shader type. It is mostly used by Raytracing shaders +where shaders must be compiled into a library and linked at runtime. + }]; +} + +def ClangRandomizeLayoutDocs : Documentation { + let Category = DocCatDecl; + let Heading = "randomize_layout, no_randomize_layout"; + let Content = [{ +The attribute ``randomize_layout``, when attached to a C structure, selects it +for structure layout field randomization; a compile-time hardening technique. A +"seed" value, is specified via the ``-frandomize-layout-seed=`` command line flag. +For example: + +.. code-block:: bash + + SEED=`od -A n -t x8 -N 32 /dev/urandom | tr -d ' \n'` + make ... CFLAGS="-frandomize-layout-seed=$SEED" ... + +You can also supply the seed in a file with ``-frandomize-layout-seed-file=``. +For example: + +.. code-block:: bash + + od -A n -t x8 -N 32 /dev/urandom | tr -d ' \n' > /tmp/seed_file.txt + make ... CFLAGS="-frandomize-layout-seed-file=/tmp/seed_file.txt" ... + +The randomization is deterministic based for a given seed, so the entire +program should be compiled with the same seed, but keep the seed safe +otherwise. + +The attribute ``no_randomize_layout``, when attached to a C structure, +instructs the compiler that this structure should not have its field layout +randomized. + }]; +} + +def HLSLSV_GroupIndexDocs : Documentation { + let Category = DocCatFunction; + let Content = [{ +The ``SV_GroupIndex`` semantic, when applied to an input parameter, specifies a +data binding to map the group index to the specified parameter. This attribute +is only supported in compute shaders. + +The full documentation is available here: https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/sv-groupindex + }]; +} + +def AnnotateTypeDocs : Documentation { + let Category = DocCatType; + let Heading = "annotate_type"; + let Content = [{ +This attribute is used to add annotations to types, typically for use by static +analysis tools that are not integrated into the core Clang compiler (e.g., +Clang-Tidy checks or out-of-tree Clang-based tools). It is a counterpart to the +`annotate` attribute, which serves the same purpose, but for declarations. + +The attribute takes a mandatory string literal argument specifying the +annotation category and an arbitrary number of optional arguments that provide +additional information specific to the annotation category. The optional +arguments must be constant expressions of arbitrary type. + +For example: + +.. code-block:: c++ + + int* [[clang::annotate("category1", "foo", 1)]] f(int[[clang::annotate("category2")]] *); + +The attribute does not have any effect on the semantics of the type system, +neither type checking rules, nor runtime semantics. In particular: + +- ``std::is_same`` is true for all types + ``T``. + +- It is not permissible for overloaded functions or template specializations + to differ merely by an ``annotate_type`` attribute. + +- The presence of an ``annotate_type`` attribute will not affect name + mangling. + }]; +} + +def WeakDocs : Documentation { + let Category = DocCatDecl; + let Content = [{ + +In supported output formats the ``weak`` attribute can be used to +specify that a variable or function should be emitted as a symbol with +``weak`` (if a definition) or ``extern_weak`` (if a declaration of an +external symbol) `linkage +`_. + +If there is a non-weak definition of the symbol the linker will select +that over the weak. They must have same type and alignment (variables +must also have the same size), but may have a different value. + +If there are multiple weak definitions of same symbol, but no non-weak +definition, they should have same type, size, alignment and value, the +linker will select one of them (see also selectany_ attribute). + +If the ``weak`` attribute is applied to a ``const`` qualified variable +definition that variable is no longer consider a compiletime constant +as its value can change during linking (or dynamic linking). This +means that it can e.g no longer be part of an initializer expression. + +.. code-block:: c + + const int ANSWER __attribute__ ((weak)) = 42; + + /* This function may be replaced link-time */ + __attribute__ ((weak)) void debug_log(const char *msg) + { + fprintf(stderr, "DEBUG: %s\n", msg); + } + + int main(int argc, const char **argv) + { + debug_log ("Starting up..."); + + /* This may print something else than "6 * 7 = 42", + if there is a non-weak definition of "ANSWER" in + an object linked in */ + printf("6 * 7 = %d\n", ANSWER); + + return 0; + } + +If an external declaration is marked weak and that symbol does not +exist during linking (possibly dynamic) the address of the symbol will +evaluate to NULL. + +.. code-block:: c + + void may_not_exist(void) __attribute__ ((weak)); + + int main(int argc, const char **argv) + { + if (may_not_exist) { + may_not_exist(); + } else { + printf("Function did not exist\n"); + } + return 0; + } + + }]; +} diff --git a/clang/include/clang/Basic/AttrSubjectMatchRules.h b/clang/include/clang/Basic/AttrSubjectMatchRules.h index 4a4c1a883cf4..e3dcb943e59d 100644 --- a/clang/include/clang/Basic/AttrSubjectMatchRules.h +++ b/clang/include/clang/Basic/AttrSubjectMatchRules.h @@ -18,6 +18,9 @@ namespace attr { /// A list of all the recognized kinds of attributes. enum SubjectMatchRule { #define ATTR_MATCH_RULE(X, Spelling, IsAbstract) X, +#include "clang/Basic/AttrSubMatchRulesList.inc" + SubjectMatchRule_Last = -1 +#define ATTR_MATCH_RULE(X, Spelling, IsAbstract) +1 #include "clang/Basic/AttrSubMatchRulesList.inc" }; diff --git a/clang/include/clang/Basic/AttributeCommonInfo.h b/clang/include/clang/Basic/AttributeCommonInfo.h index 4be598e109fd..81a8d2134193 100644 --- a/clang/include/clang/Basic/AttributeCommonInfo.h +++ b/clang/include/clang/Basic/AttributeCommonInfo.h @@ -48,6 +48,9 @@ public: // without adding related code to TableGen/ClangAttrEmitter.cpp. /// Context-sensitive version of a keyword attribute. AS_ContextSensitiveKeyword, + + /// : + AS_HLSLSemantic, }; enum Kind { #define PARSED_ATTR(NAME) AT_##NAME, @@ -66,7 +69,7 @@ private: // Corresponds to the Kind enum. unsigned AttrKind : 16; /// Corresponds to the Syntax enum. - unsigned SyntaxUsed : 3; + unsigned SyntaxUsed : 4; unsigned SpellingIndex : 4; protected: @@ -143,9 +146,25 @@ public: bool isMicrosoftAttribute() const { return SyntaxUsed == AS_Microsoft; } bool isGNUScope() const; + bool isClangScope() const; bool isAlignasAttribute() const { // FIXME: Use a better mechanism to determine this. + // We use this in `isCXX11Attribute` below, so it _should_ only return + // true for the `alignas` spelling, but it currently also returns true + // for the `_Alignas` spelling, which only exists in C11. Distinguishing + // between the two is important because they behave differently: + // - `alignas` may only appear in the attribute-specifier-seq before + // the decl-specifier-seq and is therefore associated with the + // declaration. + // - `_Alignas` may appear anywhere within the declaration-specifiers + // and is therefore associated with the `DeclSpec`. + // It's not clear how best to fix this: + // - We have the necessary information in the form of the `SpellingIndex`, + // but we would need to compare against AlignedAttr::Keyword_alignas, + // and we can't depend on clang/AST/Attr.h here. + // - We could test `getAttrName()->getName() == "alignas"`, but this is + // inefficient. return getParsedKind() == AT_Aligned && isKeywordAttribute(); } @@ -161,6 +180,8 @@ public: return isCXX11Attribute() || isC2xAttribute(); } + bool isGNUAttribute() const { return SyntaxUsed == AS_GNU; } + bool isKeywordAttribute() const { return SyntaxUsed == AS_Keyword || SyntaxUsed == AS_ContextSensitiveKeyword; } diff --git a/clang/include/clang/Basic/Attributes.h b/clang/include/clang/Basic/Attributes.h index c69633decd57..3fc5fbacdb2c 100644 --- a/clang/include/clang/Basic/Attributes.h +++ b/clang/include/clang/Basic/Attributes.h @@ -9,6 +9,7 @@ #ifndef LLVM_CLANG_BASIC_ATTRIBUTES_H #define LLVM_CLANG_BASIC_ATTRIBUTES_H +#include "clang/Basic/AttributeCommonInfo.h" #include "clang/Basic/LangOptions.h" #include "clang/Basic/TargetInfo.h" @@ -16,26 +17,11 @@ namespace clang { class IdentifierInfo; -enum class AttrSyntax { - /// Is the identifier known as a GNU-style attribute? - GNU, - /// Is the identifier known as a __declspec-style attribute? - Declspec, - /// Is the identifier known as a [] Microsoft-style attribute? - Microsoft, - // Is the identifier known as a C++-style attribute? - CXX, - // Is the identifier known as a C-style attribute? - C, - // Is the identifier known as a pragma attribute? - Pragma -}; - /// Return the version number associated with the attribute if we /// recognize and implement the attribute specified by the given information. -int hasAttribute(AttrSyntax Syntax, const IdentifierInfo *Scope, - const IdentifierInfo *Attr, const TargetInfo &Target, - const LangOptions &LangOpts); +int hasAttribute(AttributeCommonInfo::Syntax Syntax, + const IdentifierInfo *Scope, const IdentifierInfo *Attr, + const TargetInfo &Target, const LangOptions &LangOpts); } // end namespace clang diff --git a/clang/include/clang/Basic/Builtins.def b/clang/include/clang/Basic/Builtins.def index d2cb14d2fd8c..f19807dbbb0b 100644 --- a/clang/include/clang/Basic/Builtins.def +++ b/clang/include/clang/Basic/Builtins.def @@ -81,7 +81,9 @@ // builtin even if type doesn't match signature, and don't warn if we // can't be sure the type is right // F -> this is a libc/libm function with a '__builtin_' prefix added. -// f -> this is a libc/libm function without the '__builtin_' prefix. +// f -> this is a libc/libm function without a '__builtin_' prefix, or with +// 'z', a C++ standard library function in namespace std::. This builtin +// is disableable by '-fno-builtin-foo' / '-fno-builtin-std-foo'. // h -> this function requires a specific header or an explicit declaration. // i -> this is a runtime library implemented function without the // '__builtin_' prefix. It will be implemented in compiler-rt or libgcc. @@ -101,6 +103,7 @@ // V:N: -> requires vectors of at least N bits to be legal // C -> callback behavior: argument N is called with argument // M_0, ..., M_k as payload +// z -> this is a function in (possibly-versioned) namespace std // FIXME: gcc has nonnull #if defined(BUILTIN) && !defined(LIBBUILTIN) @@ -139,10 +142,12 @@ BUILTIN(__builtin_frexpf128, "LLdLLdi*", "Fn") BUILTIN(__builtin_huge_val, "d", "nc") BUILTIN(__builtin_huge_valf, "f", "nc") BUILTIN(__builtin_huge_vall, "Ld", "nc") +BUILTIN(__builtin_huge_valf16, "x", "nc") BUILTIN(__builtin_huge_valf128, "LLd", "nc") BUILTIN(__builtin_inf , "d" , "nc") BUILTIN(__builtin_inff , "f" , "nc") BUILTIN(__builtin_infl , "Ld" , "nc") +BUILTIN(__builtin_inff16 , "x" , "nc") BUILTIN(__builtin_inff128 , "LLd" , "nc") BUILTIN(__builtin_labs , "LiLi" , "Fnc") BUILTIN(__builtin_llabs, "LLiLLi", "Fnc") @@ -157,10 +162,12 @@ BUILTIN(__builtin_modff128, "LLdLLdLLd*", "Fn") BUILTIN(__builtin_nan, "dcC*" , "FnU") BUILTIN(__builtin_nanf, "fcC*" , "FnU") BUILTIN(__builtin_nanl, "LdcC*", "FnU") +BUILTIN(__builtin_nanf16, "xcC*", "FnU") BUILTIN(__builtin_nanf128, "LLdcC*", "FnU") BUILTIN(__builtin_nans, "dcC*" , "FnU") BUILTIN(__builtin_nansf, "fcC*" , "FnU") BUILTIN(__builtin_nansl, "LdcC*", "FnU") +BUILTIN(__builtin_nansf16, "xcC*", "FnU") BUILTIN(__builtin_nansf128, "LLdcC*", "FnU") BUILTIN(__builtin_powi , "ddi" , "Fnc") BUILTIN(__builtin_powif, "ffi" , "Fnc") @@ -548,10 +555,11 @@ BUILTIN(__builtin_malloc, "v*z", "nF") BUILTIN(__builtin_memchr, "v*vC*iz", "nF") BUILTIN(__builtin_memcmp, "ivC*vC*z", "nF") BUILTIN(__builtin_memcpy, "v*v*vC*z", "nF") -BUILTIN(__builtin_memcpy_inline, "vv*vC*Iz", "nt") +BUILTIN(__builtin_memcpy_inline, "vv*vC*Iz", "n") BUILTIN(__builtin_memmove, "v*v*vC*z", "nF") BUILTIN(__builtin_mempcpy, "v*v*vC*z", "nF") BUILTIN(__builtin_memset, "v*v*iz", "nF") +BUILTIN(__builtin_memset_inline, "vv*iIz", "n") BUILTIN(__builtin_printf, "icC*.", "Fp:0:") BUILTIN(__builtin_stpcpy, "c*c*cC*", "nF") BUILTIN(__builtin_stpncpy, "c*c*cC*z", "nF") @@ -653,11 +661,15 @@ BUILTIN(__builtin_elementwise_ceil, "v.", "nct") BUILTIN(__builtin_elementwise_floor, "v.", "nct") BUILTIN(__builtin_elementwise_roundeven, "v.", "nct") BUILTIN(__builtin_elementwise_trunc, "v.", "nct") +BUILTIN(__builtin_elementwise_add_sat, "v.", "nct") +BUILTIN(__builtin_elementwise_sub_sat, "v.", "nct") BUILTIN(__builtin_reduce_max, "v.", "nct") BUILTIN(__builtin_reduce_min, "v.", "nct") BUILTIN(__builtin_reduce_xor, "v.", "nct") BUILTIN(__builtin_reduce_or, "v.", "nct") BUILTIN(__builtin_reduce_and, "v.", "nct") +BUILTIN(__builtin_reduce_add, "v.", "nct") +BUILTIN(__builtin_reduce_mul, "v.", "nct") BUILTIN(__builtin_matrix_transpose, "v.", "nFt") BUILTIN(__builtin_matrix_column_major_load, "v.", "nFt") @@ -917,7 +929,7 @@ LANGBUILTIN(__exception_info, "v*", "n", ALL_MS_LANGUAGES) LANGBUILTIN(_exception_info, "v*", "n", ALL_MS_LANGUAGES) LANGBUILTIN(__abnormal_termination, "i", "n", ALL_MS_LANGUAGES) LANGBUILTIN(_abnormal_termination, "i", "n", ALL_MS_LANGUAGES) -LANGBUILTIN(__GetExceptionInfo, "v*.", "ntu", ALL_MS_LANGUAGES) +LANGBUILTIN(__GetExceptionInfo, "v*.", "zntu", ALL_MS_LANGUAGES) LANGBUILTIN(_InterlockedAnd8, "ccD*c", "n", ALL_MS_LANGUAGES) LANGBUILTIN(_InterlockedAnd16, "ssD*s", "n", ALL_MS_LANGUAGES) LANGBUILTIN(_InterlockedAnd, "NiNiD*Ni", "n", ALL_MS_LANGUAGES) @@ -1541,6 +1553,15 @@ LIBBUILTIN(_Block_object_assign, "vv*vC*iC", "f", "Blocks.h", ALL_LANGUAGES) LIBBUILTIN(_Block_object_dispose, "vvC*iC", "f", "Blocks.h", ALL_LANGUAGES) // FIXME: Also declare NSConcreteGlobalBlock and NSConcreteStackBlock. +// C++ standard library builtins in namespace 'std'. +LIBBUILTIN(addressof, "v*v&", "zfncTh", "memory", CXX_LANG) +// Synonym for addressof used internally by libstdc++. +LANGBUILTIN(__addressof, "v*v&", "zfncT", CXX_LANG) +LIBBUILTIN(as_const, "v&v&", "zfncTh", "utility", CXX_LANG) +LIBBUILTIN(forward, "v&v&", "zfncTh", "utility", CXX_LANG) +LIBBUILTIN(move, "v&v&", "zfncTh", "utility", CXX_LANG) +LIBBUILTIN(move_if_noexcept, "v&v&", "zfncTh", "utility", CXX_LANG) + // Annotation function BUILTIN(__builtin_annotation, "v.", "tn") @@ -1588,7 +1609,7 @@ BUILTIN(__builtin_function_start, "v*v&", "nct") BUILTIN(__builtin_operator_new, "v*z", "tc") BUILTIN(__builtin_operator_delete, "vv*", "tn") BUILTIN(__builtin_char_memchr, "c*cC*iz", "n") -BUILTIN(__builtin_dump_struct, "ivC*v*", "tn") +BUILTIN(__builtin_dump_struct, "v.", "t") BUILTIN(__builtin_preserve_access_index, "v.", "t") // Alignment builtins (uses custom parsing to support pointers and integers) @@ -1625,50 +1646,50 @@ LANGBUILTIN(__builtin_coro_suspend, "cIb", "n", COR_LANG) // OpenCL v2.0 s6.13.16, s9.17.3.5 - Pipe functions. // We need the generic prototype, since the packet type could be anything. -LANGBUILTIN(read_pipe, "i.", "tn", OCLC20_LANG) -LANGBUILTIN(write_pipe, "i.", "tn", OCLC20_LANG) +LANGBUILTIN(read_pipe, "i.", "tn", OCL_PIPE) +LANGBUILTIN(write_pipe, "i.", "tn", OCL_PIPE) -LANGBUILTIN(reserve_read_pipe, "i.", "tn", OCLC20_LANG) -LANGBUILTIN(reserve_write_pipe, "i.", "tn", OCLC20_LANG) +LANGBUILTIN(reserve_read_pipe, "i.", "tn", OCL_PIPE) +LANGBUILTIN(reserve_write_pipe, "i.", "tn", OCL_PIPE) -LANGBUILTIN(commit_write_pipe, "v.", "tn", OCLC20_LANG) -LANGBUILTIN(commit_read_pipe, "v.", "tn", OCLC20_LANG) +LANGBUILTIN(commit_write_pipe, "v.", "tn", OCL_PIPE) +LANGBUILTIN(commit_read_pipe, "v.", "tn", OCL_PIPE) -LANGBUILTIN(sub_group_reserve_read_pipe, "i.", "tn", OCLC20_LANG) -LANGBUILTIN(sub_group_reserve_write_pipe, "i.", "tn", OCLC20_LANG) +LANGBUILTIN(sub_group_reserve_read_pipe, "i.", "tn", OCL_PIPE) +LANGBUILTIN(sub_group_reserve_write_pipe, "i.", "tn", OCL_PIPE) -LANGBUILTIN(sub_group_commit_read_pipe, "v.", "tn", OCLC20_LANG) -LANGBUILTIN(sub_group_commit_write_pipe, "v.", "tn", OCLC20_LANG) +LANGBUILTIN(sub_group_commit_read_pipe, "v.", "tn", OCL_PIPE) +LANGBUILTIN(sub_group_commit_write_pipe, "v.", "tn", OCL_PIPE) -LANGBUILTIN(work_group_reserve_read_pipe, "i.", "tn", OCLC20_LANG) -LANGBUILTIN(work_group_reserve_write_pipe, "i.", "tn", OCLC20_LANG) +LANGBUILTIN(work_group_reserve_read_pipe, "i.", "tn", OCL_PIPE) +LANGBUILTIN(work_group_reserve_write_pipe, "i.", "tn", OCL_PIPE) -LANGBUILTIN(work_group_commit_read_pipe, "v.", "tn", OCLC20_LANG) -LANGBUILTIN(work_group_commit_write_pipe, "v.", "tn", OCLC20_LANG) +LANGBUILTIN(work_group_commit_read_pipe, "v.", "tn", OCL_PIPE) +LANGBUILTIN(work_group_commit_write_pipe, "v.", "tn", OCL_PIPE) -LANGBUILTIN(get_pipe_num_packets, "Ui.", "tn", OCLC20_LANG) -LANGBUILTIN(get_pipe_max_packets, "Ui.", "tn", OCLC20_LANG) +LANGBUILTIN(get_pipe_num_packets, "Ui.", "tn", OCL_PIPE) +LANGBUILTIN(get_pipe_max_packets, "Ui.", "tn", OCL_PIPE) // OpenCL v2.0 s6.13.17 - Enqueue kernel functions. // Custom builtin check allows to perform special check of passed block arguments. -LANGBUILTIN(enqueue_kernel, "i.", "tn", OCLC20_LANG) -LANGBUILTIN(get_kernel_work_group_size, "Ui.", "tn", OCLC20_LANG) -LANGBUILTIN(get_kernel_preferred_work_group_size_multiple, "Ui.", "tn", OCLC20_LANG) -LANGBUILTIN(get_kernel_max_sub_group_size_for_ndrange, "Ui.", "tn", OCLC20_LANG) -LANGBUILTIN(get_kernel_sub_group_count_for_ndrange, "Ui.", "tn", OCLC20_LANG) +LANGBUILTIN(enqueue_kernel, "i.", "tn", OCL_DSE) +LANGBUILTIN(get_kernel_work_group_size, "Ui.", "tn", OCL_DSE) +LANGBUILTIN(get_kernel_preferred_work_group_size_multiple, "Ui.", "tn", OCL_DSE) +LANGBUILTIN(get_kernel_max_sub_group_size_for_ndrange, "Ui.", "tn", OCL_DSE) +LANGBUILTIN(get_kernel_sub_group_count_for_ndrange, "Ui.", "tn", OCL_DSE) // OpenCL v2.0 s6.13.9 - Address space qualifier functions. // FIXME: Pointer parameters of OpenCL builtins should have their address space // requirement defined. -LANGBUILTIN(to_global, "v*v*", "tn", OCLC20_LANG) -LANGBUILTIN(to_local, "v*v*", "tn", OCLC20_LANG) -LANGBUILTIN(to_private, "v*v*", "tn", OCLC20_LANG) +LANGBUILTIN(to_global, "v*v*", "tn", OCL_GAS) +LANGBUILTIN(to_local, "v*v*", "tn", OCL_GAS) +LANGBUILTIN(to_private, "v*v*", "tn", OCL_GAS) // OpenCL half load/store builtin -LANGBUILTIN(__builtin_store_half, "vdh*", "n", ALL_OCLC_LANGUAGES) -LANGBUILTIN(__builtin_store_halff, "vfh*", "n", ALL_OCLC_LANGUAGES) -LANGBUILTIN(__builtin_load_half, "dhC*", "nc", ALL_OCLC_LANGUAGES) -LANGBUILTIN(__builtin_load_halff, "fhC*", "nc", ALL_OCLC_LANGUAGES) +LANGBUILTIN(__builtin_store_half, "vdh*", "n", ALL_OCL_LANGUAGES) +LANGBUILTIN(__builtin_store_halff, "vfh*", "n", ALL_OCL_LANGUAGES) +LANGBUILTIN(__builtin_load_half, "dhC*", "nc", ALL_OCL_LANGUAGES) +LANGBUILTIN(__builtin_load_halff, "fhC*", "nc", ALL_OCL_LANGUAGES) // Builtins for os_log/os_trace BUILTIN(__builtin_os_log_format_buffer_size, "zcC*.", "p:0:nut") @@ -1677,6 +1698,9 @@ BUILTIN(__builtin_os_log_format, "v*v*cC*.", "p:0:nt") // CUDA/HIP LANGBUILTIN(__builtin_get_device_side_mangled_name, "cC*.", "ncT", CUDA_LANG) +// HLSL +LANGBUILTIN(__builtin_hlsl_wave_active_count_bits, "Uib", "nc", HLSL_LANG) + // Builtins for XRay BUILTIN(__xray_customevent, "vcC*z", "") BUILTIN(__xray_typedevent, "vzcC*z", "") diff --git a/clang/include/clang/Basic/Builtins.h b/clang/include/clang/Basic/Builtins.h index cdaaee48c32d..2761f5d282ac 100644 --- a/clang/include/clang/Basic/Builtins.h +++ b/clang/include/clang/Basic/Builtins.h @@ -16,6 +16,8 @@ #define LLVM_CLANG_BASIC_BUILTINS_H #include "llvm/ADT/ArrayRef.h" +#include "llvm/ADT/StringMap.h" +#include "llvm/ADT/StringRef.h" #include // VC++ defines 'alloca' as an object-like macro, which interferes with our @@ -28,20 +30,22 @@ class IdentifierTable; class LangOptions; enum LanguageID { - GNU_LANG = 0x1, // builtin requires GNU mode. - C_LANG = 0x2, // builtin for c only. - CXX_LANG = 0x4, // builtin for cplusplus only. - OBJC_LANG = 0x8, // builtin for objective-c and objective-c++ - MS_LANG = 0x10, // builtin requires MS mode. - OCLC20_LANG = 0x20, // builtin for OpenCL C 2.0 only. - OCLC1X_LANG = 0x40, // builtin for OpenCL C 1.x only. - OMP_LANG = 0x80, // builtin requires OpenMP. - CUDA_LANG = 0x100, // builtin requires CUDA. - COR_LANG = 0x200, // builtin requires use of 'fcoroutine-ts' option. + GNU_LANG = 0x1, // builtin requires GNU mode. + C_LANG = 0x2, // builtin for c only. + CXX_LANG = 0x4, // builtin for cplusplus only. + OBJC_LANG = 0x8, // builtin for objective-c and objective-c++ + MS_LANG = 0x10, // builtin requires MS mode. + OMP_LANG = 0x20, // builtin requires OpenMP. + CUDA_LANG = 0x40, // builtin requires CUDA. + COR_LANG = 0x80, // builtin requires use of 'fcoroutine-ts' option. + OCL_GAS = 0x100, // builtin requires OpenCL generic address space. + OCL_PIPE = 0x200, // builtin requires OpenCL pipe. + OCL_DSE = 0x400, // builtin requires OpenCL device side enqueue. + ALL_OCL_LANGUAGES = 0x800, // builtin for OCL languages. + HLSL_LANG = 0x1000, // builtin requires HLSL. ALL_LANGUAGES = C_LANG | CXX_LANG | OBJC_LANG, // builtin for all languages. ALL_GNU_LANGUAGES = ALL_LANGUAGES | GNU_LANG, // builtin requires GNU mode. - ALL_MS_LANGUAGES = ALL_LANGUAGES | MS_LANG, // builtin requires MS mode. - ALL_OCLC_LANGUAGES = OCLC1X_LANG | OCLC20_LANG // builtin for OCLC languages. + ALL_MS_LANGUAGES = ALL_LANGUAGES | MS_LANG // builtin requires MS mode. }; namespace Builtin { @@ -69,7 +73,7 @@ class Context { llvm::ArrayRef AuxTSRecords; public: - Context() {} + Context() = default; /// Perform target-specific initialization /// \param AuxTarget Target info to incorporate builtins from. May be nullptr. @@ -137,6 +141,10 @@ public: /// Determines whether this builtin is a predefined libc/libm /// function, such as "malloc", where we know the signature a /// priori. + /// In C, such functions behave as if they are predeclared, + /// possibly with a warning on first use. In Objective-C and C++, + /// they do not, but they are recognized as builtins once we see + /// a declaration. bool isPredefinedLibFunction(unsigned ID) const { return strchr(getRecord(ID).Attributes, 'f') != nullptr; } @@ -155,6 +163,23 @@ public: return strchr(getRecord(ID).Attributes, 'i') != nullptr; } + /// Determines whether this builtin is a C++ standard library function + /// that lives in (possibly-versioned) namespace std, possibly a template + /// specialization, where the signature is determined by the standard library + /// declaration. + bool isInStdNamespace(unsigned ID) const { + return strchr(getRecord(ID).Attributes, 'z') != nullptr; + } + + /// Determines whether this builtin can have its address taken with no + /// special action required. + bool isDirectlyAddressable(unsigned ID) const { + // Most standard library functions can have their addresses taken. C++ + // standard library functions formally cannot in C++20 onwards, and when + // we allow it, we need to ensure we instantiate a definition. + return isPredefinedLibFunction(ID) && !isInStdNamespace(ID); + } + /// Determines whether this builtin has custom typechecking. bool hasCustomTypechecking(unsigned ID) const { return strchr(getRecord(ID).Attributes, 't') != nullptr; @@ -236,16 +261,20 @@ public: private: const Info &getRecord(unsigned ID) const; - /// Is this builtin supported according to the given language options? - bool builtinIsSupported(const Builtin::Info &BuiltinInfo, - const LangOptions &LangOpts); - /// Helper function for isPrintfLike and isScanfLike. bool isLike(unsigned ID, unsigned &FormatIdx, bool &HasVAListArg, const char *Fmt) const; }; -} +/// Returns true if the required target features of a builtin function are +/// enabled. +/// \p TargetFeatureMap maps a target feature to true if it is enabled and +/// false if it is disabled. +bool evaluateRequiredTargetFeatures( + llvm::StringRef RequiredFatures, + const llvm::StringMap &TargetFetureMap); + +} // namespace Builtin /// Kinds of BuiltinTemplateDecl. enum BuiltinTemplateKind : int { diff --git a/clang/include/clang/Basic/BuiltinsAArch64.def b/clang/include/clang/Basic/BuiltinsAArch64.def index 0869b87e32fb..65ab4fcced9a 100644 --- a/clang/include/clang/Basic/BuiltinsAArch64.def +++ b/clang/include/clang/Basic/BuiltinsAArch64.def @@ -249,6 +249,18 @@ TARGET_HEADER_BUILTIN(_AddressOfReturnAddress, "v*", "nh", "intrin.h", ALL_MS_LA TARGET_HEADER_BUILTIN(__mulh, "SLLiSLLiSLLi", "nh", "intrin.h", ALL_MS_LANGUAGES, "") TARGET_HEADER_BUILTIN(__umulh, "ULLiULLiULLi", "nh", "intrin.h", ALL_MS_LANGUAGES, "") +TARGET_HEADER_BUILTIN(__break, "vi", "nh", "intrin.h", ALL_MS_LANGUAGES, "") + +TARGET_HEADER_BUILTIN(__writex18byte, "vULiUc", "nh", "intrin.h", ALL_MS_LANGUAGES, "") +TARGET_HEADER_BUILTIN(__writex18word, "vULiUs", "nh", "intrin.h", ALL_MS_LANGUAGES, "") +TARGET_HEADER_BUILTIN(__writex18dword, "vULiULi", "nh", "intrin.h", ALL_MS_LANGUAGES, "") +TARGET_HEADER_BUILTIN(__writex18qword, "vULiULLi", "nh", "intrin.h", ALL_MS_LANGUAGES, "") + +TARGET_HEADER_BUILTIN(__readx18byte, "UcULi", "nh", "intrin.h", ALL_MS_LANGUAGES, "") +TARGET_HEADER_BUILTIN(__readx18word, "UsULi", "nh", "intrin.h", ALL_MS_LANGUAGES, "") +TARGET_HEADER_BUILTIN(__readx18dword, "ULiULi", "nh", "intrin.h", ALL_MS_LANGUAGES, "") +TARGET_HEADER_BUILTIN(__readx18qword, "ULLiULi", "nh", "intrin.h", ALL_MS_LANGUAGES, "") + #undef BUILTIN #undef LANGBUILTIN #undef TARGET_HEADER_BUILTIN diff --git a/clang/include/clang/Basic/BuiltinsAMDGPU.def b/clang/include/clang/Basic/BuiltinsAMDGPU.def index 2e1d3c7ccbff..68bcf546d177 100644 --- a/clang/include/clang/Basic/BuiltinsAMDGPU.def +++ b/clang/include/clang/Basic/BuiltinsAMDGPU.def @@ -62,6 +62,7 @@ BUILTIN(__builtin_amdgcn_s_sendmsg, "vIiUi", "n") BUILTIN(__builtin_amdgcn_s_sendmsghalt, "vIiUi", "n") BUILTIN(__builtin_amdgcn_s_barrier, "v", "n") BUILTIN(__builtin_amdgcn_wave_barrier, "v", "n") +BUILTIN(__builtin_amdgcn_sched_barrier, "vIi", "n") BUILTIN(__builtin_amdgcn_s_dcache_inv, "v", "n") BUILTIN(__builtin_amdgcn_buffer_wbinvl1, "v", "n") BUILTIN(__builtin_amdgcn_ds_gws_init, "vUiUi", "n") @@ -116,6 +117,7 @@ BUILTIN(__builtin_amdgcn_cubema, "ffff", "nc") BUILTIN(__builtin_amdgcn_s_sleep, "vIi", "n") BUILTIN(__builtin_amdgcn_s_incperflevel, "vIi", "n") BUILTIN(__builtin_amdgcn_s_decperflevel, "vIi", "n") +BUILTIN(__builtin_amdgcn_s_setprio, "vIs", "n") BUILTIN(__builtin_amdgcn_uicmp, "WUiUiUiIi", "nc") BUILTIN(__builtin_amdgcn_uicmpl, "WUiWUiWUiIi", "nc") BUILTIN(__builtin_amdgcn_sicmp, "WUiiiIi", "nc") @@ -209,17 +211,28 @@ TARGET_BUILTIN(__builtin_amdgcn_flat_atomic_fmax_f64, "dd*0d", "t", "gfx90a-inst TARGET_BUILTIN(__builtin_amdgcn_ds_atomic_fadd_f64, "dd*3d", "t", "gfx90a-insts") TARGET_BUILTIN(__builtin_amdgcn_ds_atomic_fadd_f32, "ff*3f", "t", "gfx8-insts") +TARGET_BUILTIN(__builtin_amdgcn_flat_atomic_fadd_f32, "ff*0f", "t", "gfx940-insts") +TARGET_BUILTIN(__builtin_amdgcn_flat_atomic_fadd_v2f16, "V2hV2h*0V2h", "t", "gfx940-insts") +TARGET_BUILTIN(__builtin_amdgcn_flat_atomic_fadd_v2bf16, "V2sV2s*0V2s", "t", "gfx940-insts") +TARGET_BUILTIN(__builtin_amdgcn_global_atomic_fadd_v2bf16, "V2sV2s*1V2s", "t", "gfx940-insts") +TARGET_BUILTIN(__builtin_amdgcn_ds_atomic_fadd_v2bf16, "V2sV2s*3V2s", "t", "gfx940-insts") + //===----------------------------------------------------------------------===// // Deep learning builtins. //===----------------------------------------------------------------------===// TARGET_BUILTIN(__builtin_amdgcn_fdot2, "fV2hV2hfIb", "nc", "dot7-insts") +TARGET_BUILTIN(__builtin_amdgcn_fdot2_f16_f16, "hV2hV2hh", "nc", "dot8-insts") +TARGET_BUILTIN(__builtin_amdgcn_fdot2_bf16_bf16, "sV2sV2ss", "nc", "dot8-insts") +TARGET_BUILTIN(__builtin_amdgcn_fdot2_f32_bf16, "fV2sV2sfIb", "nc", "dot8-insts") TARGET_BUILTIN(__builtin_amdgcn_sdot2, "SiV2SsV2SsSiIb", "nc", "dot2-insts") TARGET_BUILTIN(__builtin_amdgcn_udot2, "UiV2UsV2UsUiIb", "nc", "dot2-insts") TARGET_BUILTIN(__builtin_amdgcn_sdot4, "SiSiSiSiIb", "nc", "dot1-insts") TARGET_BUILTIN(__builtin_amdgcn_udot4, "UiUiUiUiIb", "nc", "dot7-insts") +TARGET_BUILTIN(__builtin_amdgcn_sudot4, "iIbiIbiiIb", "nc", "dot8-insts") TARGET_BUILTIN(__builtin_amdgcn_sdot8, "SiSiSiSiIb", "nc", "dot1-insts") TARGET_BUILTIN(__builtin_amdgcn_udot8, "UiUiUiUiIb", "nc", "dot7-insts") +TARGET_BUILTIN(__builtin_amdgcn_sudot8, "iIbiIbiiIb", "nc", "dot8-insts") //===----------------------------------------------------------------------===// // GFX10+ only builtins. @@ -239,6 +252,30 @@ TARGET_BUILTIN(__builtin_amdgcn_image_bvh_intersect_ray_h, "V4UiUifV4fV4hV4hV4Ui TARGET_BUILTIN(__builtin_amdgcn_image_bvh_intersect_ray_l, "V4UiWUifV4fV4fV4fV4Ui", "nc", "gfx10-insts") TARGET_BUILTIN(__builtin_amdgcn_image_bvh_intersect_ray_lh, "V4UiWUifV4fV4hV4hV4Ui", "nc", "gfx10-insts") + +//===----------------------------------------------------------------------===// +// GFX11+ only builtins. +//===----------------------------------------------------------------------===// + +//===----------------------------------------------------------------------===// +// WMMA builtins. +// Postfix w32 indicates the builtin requires wavefront size of 32. +// Postfix w64 indicates the builtin requires wavefront size of 64. +//===----------------------------------------------------------------------===// +TARGET_BUILTIN(__builtin_amdgcn_wmma_f32_16x16x16_f16_w32, "V8fV16hV16hV8f", "nc", "gfx11-insts") +TARGET_BUILTIN(__builtin_amdgcn_wmma_f32_16x16x16_bf16_w32, "V8fV16sV16sV8f", "nc", "gfx11-insts") +TARGET_BUILTIN(__builtin_amdgcn_wmma_f16_16x16x16_f16_w32, "V16hV16hV16hV16hIb", "nc", "gfx11-insts") +TARGET_BUILTIN(__builtin_amdgcn_wmma_bf16_16x16x16_bf16_w32, "V16sV16sV16sV16sIb", "nc", "gfx11-insts") +TARGET_BUILTIN(__builtin_amdgcn_wmma_i32_16x16x16_iu8_w32, "V8iIbV4iIbV4iV8iIb", "nc", "gfx11-insts") +TARGET_BUILTIN(__builtin_amdgcn_wmma_i32_16x16x16_iu4_w32, "V8iIbV2iIbV2iV8iIb", "nc", "gfx11-insts") + +TARGET_BUILTIN(__builtin_amdgcn_wmma_f32_16x16x16_f16_w64, "V4fV16hV16hV4f", "nc", "gfx11-insts") +TARGET_BUILTIN(__builtin_amdgcn_wmma_f32_16x16x16_bf16_w64, "V4fV16sV16sV4f", "nc", "gfx11-insts") +TARGET_BUILTIN(__builtin_amdgcn_wmma_f16_16x16x16_f16_w64, "V8hV16hV16hV8hIb", "nc", "gfx11-insts") +TARGET_BUILTIN(__builtin_amdgcn_wmma_bf16_16x16x16_bf16_w64, "V8sV16sV16sV8sIb", "nc", "gfx11-insts") +TARGET_BUILTIN(__builtin_amdgcn_wmma_i32_16x16x16_iu8_w64, "V4iIbV4iIbV4iV4iIb", "nc", "gfx11-insts") +TARGET_BUILTIN(__builtin_amdgcn_wmma_i32_16x16x16_iu4_w64, "V4iIbV2iIbV2iV4iIb", "nc", "gfx11-insts") + //===----------------------------------------------------------------------===// // Special builtins. //===----------------------------------------------------------------------===// @@ -298,5 +335,16 @@ TARGET_BUILTIN(__builtin_amdgcn_mfma_f32_16x16x16bf16_1k, "V4fV4sV4sV4fIiIiIi", TARGET_BUILTIN(__builtin_amdgcn_mfma_f64_16x16x4f64, "V4dddV4dIiIiIi", "nc", "mai-insts") TARGET_BUILTIN(__builtin_amdgcn_mfma_f64_4x4x4f64, "ddddIiIiIi", "nc", "mai-insts") +TARGET_BUILTIN(__builtin_amdgcn_mfma_i32_16x16x32_i8, "V4iWiWiV4iIiIiIi", "nc", "mai-insts") +TARGET_BUILTIN(__builtin_amdgcn_mfma_i32_32x32x16_i8, "V16iWiWiV16iIiIiIi", "nc", "mai-insts") +TARGET_BUILTIN(__builtin_amdgcn_mfma_f32_16x16x8_xf32, "V4fV2fV2fV4fIiIiIi", "nc", "mai-insts") +TARGET_BUILTIN(__builtin_amdgcn_mfma_f32_32x32x4_xf32, "V16fV2fV2fV16fIiIiIi", "nc", "mai-insts") +TARGET_BUILTIN(__builtin_amdgcn_smfmac_f32_16x16x32_f16, "V4fV4hV8hV4fiIiIi", "nc", "mai-insts") +TARGET_BUILTIN(__builtin_amdgcn_smfmac_f32_32x32x16_f16, "V16fV4hV8hV16fiIiIi", "nc", "mai-insts") +TARGET_BUILTIN(__builtin_amdgcn_smfmac_f32_16x16x32_bf16, "V4fV4sV8sV4fiIiIi", "nc", "mai-insts") +TARGET_BUILTIN(__builtin_amdgcn_smfmac_f32_32x32x16_bf16, "V16fV4sV8sV16fiIiIi", "nc", "mai-insts") +TARGET_BUILTIN(__builtin_amdgcn_smfmac_i32_16x16x64_i8, "V4iV2iV4iV4iiIiIi", "nc", "mai-insts") +TARGET_BUILTIN(__builtin_amdgcn_smfmac_i32_32x32x32_i8, "V16iV2iV4iV16iiIiIi", "nc", "mai-insts") + #undef BUILTIN #undef TARGET_BUILTIN diff --git a/clang/include/clang/Basic/BuiltinsARM.def b/clang/include/clang/Basic/BuiltinsARM.def index be20c24aa28a..0cea0a9051e5 100644 --- a/clang/include/clang/Basic/BuiltinsARM.def +++ b/clang/include/clang/Basic/BuiltinsARM.def @@ -197,6 +197,9 @@ BUILTIN(__builtin_arm_wsr, "vcC*Ui", "nc") BUILTIN(__builtin_arm_wsr64, "vcC*LLUi", "nc") BUILTIN(__builtin_arm_wsrp, "vcC*vC*", "nc") +// Misc +BUILTIN(__builtin_sponentry, "v*", "c") + // Builtins for implementing ACLE MVE intrinsics. (Unlike NEON, these // don't need to live in a separate BuiltinsMVE.def, because they // aren't included from both here and BuiltinsAArch64.def.) diff --git a/clang/include/clang/Basic/BuiltinsNVPTX.def b/clang/include/clang/Basic/BuiltinsNVPTX.def index 6b94dd857300..a5ec77a6112c 100644 --- a/clang/include/clang/Basic/BuiltinsNVPTX.def +++ b/clang/include/clang/Basic/BuiltinsNVPTX.def @@ -17,6 +17,7 @@ # define TARGET_BUILTIN(ID, TYPE, ATTRS, FEATURE) BUILTIN(ID, TYPE, ATTRS) #endif +#pragma push_macro("SM_53") #pragma push_macro("SM_70") #pragma push_macro("SM_72") #pragma push_macro("SM_75") @@ -30,7 +31,9 @@ #pragma push_macro("SM_60") #define SM_60 "sm_60|sm_61|sm_62|" SM_70 +#define SM_53 "sm_53|" SM_60 +#pragma push_macro("PTX42") #pragma push_macro("PTX60") #pragma push_macro("PTX61") #pragma push_macro("PTX63") @@ -53,6 +56,7 @@ #define PTX63 "ptx63|" PTX64 #define PTX61 "ptx61|" PTX63 #define PTX60 "ptx60|" PTX61 +#define PTX42 "ptx42|" PTX60 #pragma push_macro("AND") #define AND(a, b) "(" a "),(" b ")" @@ -107,13 +111,89 @@ BUILTIN(__nvvm_prmt, "UiUiUiUi", "") // Min Max -BUILTIN(__nvvm_fmax_ftz_f, "fff", "") -BUILTIN(__nvvm_fmax_f, "fff", "") -BUILTIN(__nvvm_fmin_ftz_f, "fff", "") -BUILTIN(__nvvm_fmin_f, "fff", "") +TARGET_BUILTIN(__nvvm_fmin_f16, "hhh", "", AND(SM_80, PTX70)) +TARGET_BUILTIN(__nvvm_fmin_ftz_f16, "hhh", "", AND(SM_80, PTX70)) +TARGET_BUILTIN(__nvvm_fmin_nan_f16, "hhh", "", AND(SM_80, PTX70)) +TARGET_BUILTIN(__nvvm_fmin_ftz_nan_f16, "hhh", "", AND(SM_80, PTX70)) +TARGET_BUILTIN(__nvvm_fmin_xorsign_abs_f16, "hhh", "", AND(SM_86, PTX72)) +TARGET_BUILTIN(__nvvm_fmin_ftz_xorsign_abs_f16, "hhh", "", AND(SM_86, PTX72)) +TARGET_BUILTIN(__nvvm_fmin_nan_xorsign_abs_f16, "hhh", "", AND(SM_86, PTX72)) +TARGET_BUILTIN(__nvvm_fmin_ftz_nan_xorsign_abs_f16, "hhh", "", + AND(SM_86, PTX72)) +TARGET_BUILTIN(__nvvm_fmin_f16x2, "V2hV2hV2h", "", AND(SM_80, PTX70)) +TARGET_BUILTIN(__nvvm_fmin_ftz_f16x2, "V2hV2hV2h", "", AND(SM_80, PTX70)) +TARGET_BUILTIN(__nvvm_fmin_nan_f16x2, "V2hV2hV2h", "", AND(SM_80, PTX70)) +TARGET_BUILTIN(__nvvm_fmin_ftz_nan_f16x2, "V2hV2hV2h", "", AND(SM_80, PTX70)) +TARGET_BUILTIN(__nvvm_fmin_xorsign_abs_f16x2, "V2hV2hV2h", "", + AND(SM_86, PTX72)) +TARGET_BUILTIN(__nvvm_fmin_ftz_xorsign_abs_f16x2, "V2hV2hV2h", "", + AND(SM_86, PTX72)) +TARGET_BUILTIN(__nvvm_fmin_nan_xorsign_abs_f16x2, "V2hV2hV2h", "", + AND(SM_86, PTX72)) +TARGET_BUILTIN(__nvvm_fmin_ftz_nan_xorsign_abs_f16x2, "V2hV2hV2h", "", + AND(SM_86, PTX72)) +TARGET_BUILTIN(__nvvm_fmin_bf16, "UsUsUs", "", AND(SM_80, PTX70)) +TARGET_BUILTIN(__nvvm_fmin_nan_bf16, "UsUsUs", "", AND(SM_80, PTX70)) +TARGET_BUILTIN(__nvvm_fmin_xorsign_abs_bf16, "UsUsUs", "", AND(SM_86, PTX72)) +TARGET_BUILTIN(__nvvm_fmin_nan_xorsign_abs_bf16, "UsUsUs", "", + AND(SM_86, PTX72)) +TARGET_BUILTIN(__nvvm_fmin_bf16x2, "ZUiZUiZUi", "", AND(SM_80, PTX70)) +TARGET_BUILTIN(__nvvm_fmin_nan_bf16x2, "ZUiZUiZUi", "", AND(SM_80, PTX70)) +TARGET_BUILTIN(__nvvm_fmin_xorsign_abs_bf16x2, "ZUiZUiZUi", "", + AND(SM_86, PTX72)) +TARGET_BUILTIN(__nvvm_fmin_nan_xorsign_abs_bf16x2, "ZUiZUiZUi", "", + AND(SM_86, PTX72)) +BUILTIN(__nvvm_fmin_f, "fff", "") +BUILTIN(__nvvm_fmin_ftz_f, "fff", "") +TARGET_BUILTIN(__nvvm_fmin_nan_f, "fff", "", AND(SM_80, PTX70)) +TARGET_BUILTIN(__nvvm_fmin_ftz_nan_f, "fff", "", AND(SM_80, PTX70)) +TARGET_BUILTIN(__nvvm_fmin_xorsign_abs_f, "fff", "", AND(SM_86, PTX72)) +TARGET_BUILTIN(__nvvm_fmin_ftz_xorsign_abs_f, "fff", "", AND(SM_86, PTX72)) +TARGET_BUILTIN(__nvvm_fmin_nan_xorsign_abs_f, "fff", "", AND(SM_86, PTX72)) +TARGET_BUILTIN(__nvvm_fmin_ftz_nan_xorsign_abs_f, "fff", "", AND(SM_86, PTX72)) +BUILTIN(__nvvm_fmin_d, "ddd", "") +TARGET_BUILTIN(__nvvm_fmax_f16, "hhh", "", AND(SM_80, PTX70)) +TARGET_BUILTIN(__nvvm_fmax_ftz_f16, "hhh", "", AND(SM_80, PTX70)) +TARGET_BUILTIN(__nvvm_fmax_nan_f16, "hhh", "", AND(SM_80, PTX70)) +TARGET_BUILTIN(__nvvm_fmax_ftz_nan_f16, "hhh", "", AND(SM_80, PTX70)) +TARGET_BUILTIN(__nvvm_fmax_xorsign_abs_f16, "hhh", "", AND(SM_86, PTX72)) +TARGET_BUILTIN(__nvvm_fmax_ftz_xorsign_abs_f16, "hhh", "", AND(SM_86, PTX72)) +TARGET_BUILTIN(__nvvm_fmax_nan_xorsign_abs_f16, "hhh", "", AND(SM_86, PTX72)) +TARGET_BUILTIN(__nvvm_fmax_ftz_nan_xorsign_abs_f16, "hhh", "", + AND(SM_86, PTX72)) +TARGET_BUILTIN(__nvvm_fmax_f16x2, "V2hV2hV2h", "", AND(SM_80, PTX70)) +TARGET_BUILTIN(__nvvm_fmax_ftz_f16x2, "V2hV2hV2h", "", AND(SM_80, PTX70)) +TARGET_BUILTIN(__nvvm_fmax_nan_f16x2, "V2hV2hV2h", "", AND(SM_80, PTX70)) +TARGET_BUILTIN(__nvvm_fmax_ftz_nan_f16x2, "V2hV2hV2h", "", AND(SM_80, PTX70)) +TARGET_BUILTIN(__nvvm_fmax_xorsign_abs_f16x2, "V2hV2hV2h", "", + AND(SM_86, PTX72)) +TARGET_BUILTIN(__nvvm_fmax_ftz_xorsign_abs_f16x2, "V2hV2hV2h", "", + AND(SM_86, PTX72)) +TARGET_BUILTIN(__nvvm_fmax_nan_xorsign_abs_f16x2, "V2hV2hV2h", "", + AND(SM_86, PTX72)) +TARGET_BUILTIN(__nvvm_fmax_ftz_nan_xorsign_abs_f16x2, "V2hV2hV2h", "", + AND(SM_86, PTX72)) +TARGET_BUILTIN(__nvvm_fmax_bf16, "UsUsUs", "", AND(SM_80, PTX70)) +TARGET_BUILTIN(__nvvm_fmax_nan_bf16, "UsUsUs", "", AND(SM_80, PTX70)) +TARGET_BUILTIN(__nvvm_fmax_xorsign_abs_bf16, "UsUsUs", "", AND(SM_86, PTX72)) +TARGET_BUILTIN(__nvvm_fmax_nan_xorsign_abs_bf16, "UsUsUs", "", + AND(SM_86, PTX72)) +TARGET_BUILTIN(__nvvm_fmax_bf16x2, "ZUiZUiZUi", "", AND(SM_80, PTX70)) +TARGET_BUILTIN(__nvvm_fmax_nan_bf16x2, "ZUiZUiZUi", "", AND(SM_80, PTX70)) +TARGET_BUILTIN(__nvvm_fmax_xorsign_abs_bf16x2, "ZUiZUiZUi", "", + AND(SM_86, PTX72)) +TARGET_BUILTIN(__nvvm_fmax_nan_xorsign_abs_bf16x2, "ZUiZUiZUi", "", + AND(SM_86, PTX72)) +BUILTIN(__nvvm_fmax_f, "fff", "") +BUILTIN(__nvvm_fmax_ftz_f, "fff", "") +TARGET_BUILTIN(__nvvm_fmax_nan_f, "fff", "", AND(SM_80, PTX70)) +TARGET_BUILTIN(__nvvm_fmax_ftz_nan_f, "fff", "", AND(SM_80, PTX70)) +TARGET_BUILTIN(__nvvm_fmax_xorsign_abs_f, "fff", "", AND(SM_86, PTX72)) +TARGET_BUILTIN(__nvvm_fmax_ftz_xorsign_abs_f, "fff", "", AND(SM_86, PTX72)) +TARGET_BUILTIN(__nvvm_fmax_nan_xorsign_abs_f, "fff", "", AND(SM_86, PTX72)) +TARGET_BUILTIN(__nvvm_fmax_ftz_nan_xorsign_abs_f, "fff", "", AND(SM_86, PTX72)) BUILTIN(__nvvm_fmax_d, "ddd", "") -BUILTIN(__nvvm_fmin_d, "ddd", "") // Multiplication @@ -202,6 +282,8 @@ BUILTIN(__nvvm_saturate_d, "dd", "") BUILTIN(__nvvm_ex2_approx_ftz_f, "ff", "") BUILTIN(__nvvm_ex2_approx_f, "ff", "") BUILTIN(__nvvm_ex2_approx_d, "dd", "") +TARGET_BUILTIN(__nvvm_ex2_approx_f16, "hh", "", AND(SM_75, PTX70)) +TARGET_BUILTIN(__nvvm_ex2_approx_f16x2, "V2hV2h", "", AND(SM_75, PTX70)) BUILTIN(__nvvm_lg2_approx_ftz_f, "ff", "") BUILTIN(__nvvm_lg2_approx_f, "ff", "") @@ -217,6 +299,22 @@ BUILTIN(__nvvm_cos_approx_f, "ff", "") // Fma +TARGET_BUILTIN(__nvvm_fma_rn_f16, "hhhh", "", AND(SM_53, PTX42)) +TARGET_BUILTIN(__nvvm_fma_rn_ftz_f16, "hhhh", "", AND(SM_53, PTX42)) +TARGET_BUILTIN(__nvvm_fma_rn_sat_f16, "hhhh", "", AND(SM_53, PTX42)) +TARGET_BUILTIN(__nvvm_fma_rn_ftz_sat_f16, "hhhh", "", AND(SM_53, PTX42)) +TARGET_BUILTIN(__nvvm_fma_rn_relu_f16, "hhhh", "", AND(SM_80, PTX70)) +TARGET_BUILTIN(__nvvm_fma_rn_ftz_relu_f16, "hhhh", "", AND(SM_80, PTX70)) +TARGET_BUILTIN(__nvvm_fma_rn_f16x2, "V2hV2hV2hV2h", "", AND(SM_53, PTX42)) +TARGET_BUILTIN(__nvvm_fma_rn_ftz_f16x2, "V2hV2hV2hV2h", "", AND(SM_53, PTX42)) +TARGET_BUILTIN(__nvvm_fma_rn_sat_f16x2, "V2hV2hV2hV2h", "", AND(SM_53, PTX42)) +TARGET_BUILTIN(__nvvm_fma_rn_ftz_sat_f16x2, "V2hV2hV2hV2h", "", AND(SM_53, PTX42)) +TARGET_BUILTIN(__nvvm_fma_rn_relu_f16x2, "V2hV2hV2hV2h", "", AND(SM_80, PTX70)) +TARGET_BUILTIN(__nvvm_fma_rn_ftz_relu_f16x2, "V2hV2hV2hV2h", "", AND(SM_80, PTX70)) +TARGET_BUILTIN(__nvvm_fma_rn_bf16, "UsUsUsUs", "", AND(SM_80, PTX70)) +TARGET_BUILTIN(__nvvm_fma_rn_relu_bf16, "UsUsUsUs", "", AND(SM_80, PTX70)) +TARGET_BUILTIN(__nvvm_fma_rn_bf16x2, "ZUiZUiZUiZUi", "", AND(SM_80, PTX70)) +TARGET_BUILTIN(__nvvm_fma_rn_relu_bf16x2, "ZUiZUiZUiZUi", "", AND(SM_80, PTX70)) BUILTIN(__nvvm_fma_rn_ftz_f, "ffff", "") BUILTIN(__nvvm_fma_rn_f, "ffff", "") BUILTIN(__nvvm_fma_rz_ftz_f, "ffff", "") @@ -245,6 +343,8 @@ BUILTIN(__nvvm_rcp_rn_d, "dd", "") BUILTIN(__nvvm_rcp_rz_d, "dd", "") BUILTIN(__nvvm_rcp_rm_d, "dd", "") BUILTIN(__nvvm_rcp_rp_d, "dd", "") + +BUILTIN(__nvvm_rcp_approx_ftz_f, "ff", "") BUILTIN(__nvvm_rcp_approx_ftz_d, "dd", "") // Sqrt @@ -473,11 +573,11 @@ TARGET_BUILTIN(__nvvm_vote_uni_sync, "bUib", "", PTX60) TARGET_BUILTIN(__nvvm_vote_ballot_sync, "UiUib", "", PTX60) // Match -TARGET_BUILTIN(__nvvm_match_any_sync_i32, "UiUiUi", "", PTX60) -TARGET_BUILTIN(__nvvm_match_any_sync_i64, "WiUiWi", "", PTX60) +TARGET_BUILTIN(__nvvm_match_any_sync_i32, "UiUiUi", "", AND(SM_70,PTX60)) +TARGET_BUILTIN(__nvvm_match_any_sync_i64, "UiUiWi", "", AND(SM_70,PTX60)) // These return a pair {value, predicate}, which requires custom lowering. -TARGET_BUILTIN(__nvvm_match_all_sync_i32p, "UiUiUii*", "", PTX60) -TARGET_BUILTIN(__nvvm_match_all_sync_i64p, "WiUiWii*", "", PTX60) +TARGET_BUILTIN(__nvvm_match_all_sync_i32p, "UiUiUii*", "", AND(SM_70,PTX60)) +TARGET_BUILTIN(__nvvm_match_all_sync_i64p, "UiUiWii*", "", AND(SM_70,PTX60)) // Redux TARGET_BUILTIN(__nvvm_redux_sync_add, "iii", "", AND(SM_80,PTX70)) @@ -827,15 +927,24 @@ TARGET_BUILTIN(__nvvm_cp_async_commit_group, "v", "", AND(SM_80,PTX70)) TARGET_BUILTIN(__nvvm_cp_async_wait_group, "vIi", "", AND(SM_80,PTX70)) TARGET_BUILTIN(__nvvm_cp_async_wait_all, "v", "", AND(SM_80,PTX70)) + +// bf16, bf16x2 abs, neg +TARGET_BUILTIN(__nvvm_abs_bf16, "UsUs", "", AND(SM_80,PTX70)) +TARGET_BUILTIN(__nvvm_abs_bf16x2, "ZUiZUi", "", AND(SM_80,PTX70)) +TARGET_BUILTIN(__nvvm_neg_bf16, "UsUs", "", AND(SM_80,PTX70)) +TARGET_BUILTIN(__nvvm_neg_bf16x2, "ZUiZUi", "", AND(SM_80,PTX70)) + #undef BUILTIN #undef TARGET_BUILTIN #pragma pop_macro("AND") +#pragma pop_macro("SM_53") #pragma pop_macro("SM_60") #pragma pop_macro("SM_70") #pragma pop_macro("SM_72") #pragma pop_macro("SM_75") #pragma pop_macro("SM_80") #pragma pop_macro("SM_86") +#pragma pop_macro("PTX42") #pragma pop_macro("PTX60") #pragma pop_macro("PTX61") #pragma pop_macro("PTX63") diff --git a/clang/include/clang/Basic/BuiltinsPPC.def b/clang/include/clang/Basic/BuiltinsPPC.def index 70b0184f199f..a7a242b4f659 100644 --- a/clang/include/clang/Basic/BuiltinsPPC.def +++ b/clang/include/clang/Basic/BuiltinsPPC.def @@ -152,6 +152,16 @@ BUILTIN(__builtin_ppc_mtmsr, "vUi", "") BUILTIN(__builtin_ppc_mtspr, "vIiULi", "") BUILTIN(__builtin_ppc_stfiw, "viC*d", "") BUILTIN(__builtin_ppc_addex, "LLiLLiLLiCIi", "") +// select +BUILTIN(__builtin_ppc_maxfe, "LdLdLdLd.", "t") +BUILTIN(__builtin_ppc_maxfl, "dddd.", "t") +BUILTIN(__builtin_ppc_maxfs, "ffff.", "t") +BUILTIN(__builtin_ppc_minfe, "LdLdLdLd.", "t") +BUILTIN(__builtin_ppc_minfl, "dddd.", "t") +BUILTIN(__builtin_ppc_minfs, "ffff.", "t") +// Floating Negative Absolute Value +BUILTIN(__builtin_ppc_fnabs, "dd", "") +BUILTIN(__builtin_ppc_fnabss, "ff", "") BUILTIN(__builtin_ppc_get_timebase, "ULLi", "n") @@ -168,6 +178,9 @@ BUILTIN(__builtin_altivec_vaddeuqm, "V1ULLLiV1ULLLiV1ULLLiV1ULLLi","") BUILTIN(__builtin_altivec_vaddcuq, "V1ULLLiV1ULLLiV1ULLLi","") BUILTIN(__builtin_altivec_vaddecuq, "V1ULLLiV1ULLLiV1ULLLiV1ULLLi","") BUILTIN(__builtin_altivec_vadduqm, "V1ULLLiV16UcV16Uc","") +BUILTIN(__builtin_altivec_vaddeuqm_c, "V16UcV16UcV16UcV16Uc","") +BUILTIN(__builtin_altivec_vaddcuq_c, "V16UcV16UcV16Uc","") +BUILTIN(__builtin_altivec_vaddecuq_c, "V16UcV16UcV16UcV16Uc","") BUILTIN(__builtin_altivec_vsubsbs, "V16ScV16ScV16Sc", "") BUILTIN(__builtin_altivec_vsububs, "V16UcV16UcV16Uc", "") @@ -179,6 +192,9 @@ BUILTIN(__builtin_altivec_vsubeuqm, "V1ULLLiV1ULLLiV1ULLLiV1ULLLi","") BUILTIN(__builtin_altivec_vsubcuq, "V1ULLLiV1ULLLiV1ULLLi","") BUILTIN(__builtin_altivec_vsubecuq, "V1ULLLiV1ULLLiV1ULLLiV1ULLLi","") BUILTIN(__builtin_altivec_vsubuqm, "V1ULLLiV16UcV16Uc","") +BUILTIN(__builtin_altivec_vsubeuqm_c, "V16UcV16UcV16UcV16Uc","") +BUILTIN(__builtin_altivec_vsubcuq_c, "V16UcV16UcV16Uc","") +BUILTIN(__builtin_altivec_vsubecuq_c, "V16UcV16UcV16UcV16Uc","") BUILTIN(__builtin_altivec_vavgsb, "V16ScV16ScV16Sc", "") BUILTIN(__builtin_altivec_vavgub, "V16UcV16UcV16Uc", "") @@ -514,12 +530,12 @@ BUILTIN(__builtin_altivec_vpdepd, "V2ULLiV2ULLiV2ULLi", "") BUILTIN(__builtin_altivec_vpextd, "V2ULLiV2ULLiV2ULLi", "") // P10 Vector String Isolate Built-ins. -BUILTIN(__builtin_altivec_vstribr, "V16cV16c", "") -BUILTIN(__builtin_altivec_vstribl, "V16cV16c", "") +BUILTIN(__builtin_altivec_vstribr, "V16UcV16Uc", "") +BUILTIN(__builtin_altivec_vstribl, "V16UcV16Uc", "") BUILTIN(__builtin_altivec_vstrihr, "V8sV8s", "") BUILTIN(__builtin_altivec_vstrihl, "V8sV8s", "") -BUILTIN(__builtin_altivec_vstribr_p, "iiV16c", "") -BUILTIN(__builtin_altivec_vstribl_p, "iiV16c", "") +BUILTIN(__builtin_altivec_vstribr_p, "iiV16Uc", "") +BUILTIN(__builtin_altivec_vstribl_p, "iiV16Uc", "") BUILTIN(__builtin_altivec_vstrihr_p, "iiV8s", "") BUILTIN(__builtin_altivec_vstrihl_p, "iiV8s", "") @@ -530,8 +546,8 @@ BUILTIN(__builtin_altivec_vcfuged, "V2ULLiV2ULLiV2ULLi", "") BUILTIN(__builtin_altivec_vgnb, "ULLiV1ULLLiIi", "") // P10 Vector Clear Bytes built-ins. -BUILTIN(__builtin_altivec_vclrlb, "V16cV16cUi", "") -BUILTIN(__builtin_altivec_vclrrb, "V16cV16cUi", "") +BUILTIN(__builtin_altivec_vclrlb, "V16UcV16UcUi", "") +BUILTIN(__builtin_altivec_vclrrb, "V16UcV16UcUi", "") // P10 Vector Count Leading / Trailing Zeroes under bit Mask built-ins. BUILTIN(__builtin_altivec_vclzdm, "V2ULLiV2ULLiV2ULLi", "") @@ -556,8 +572,10 @@ BUILTIN(__builtin_altivec_vinshvlx, "V8UsV8UsUiV8Us", "") BUILTIN(__builtin_altivec_vinshvrx, "V8UsV8UsUiV8Us", "") BUILTIN(__builtin_altivec_vinswvlx, "V4UiV4UiUiV4Ui", "") BUILTIN(__builtin_altivec_vinswvrx, "V4UiV4UiUiV4Ui", "") -BUILTIN(__builtin_altivec_vec_replace_elt, "V4UiV4UiUiIi", "t") -BUILTIN(__builtin_altivec_vec_replace_unaligned, "V4UiV4UiUiIi", "t") +BUILTIN(__builtin_altivec_vinsw, "V16UcV16UcUiIi", "") +BUILTIN(__builtin_altivec_vinsd, "V16UcV16UcULLiIi", "") +BUILTIN(__builtin_altivec_vinsw_elt, "V16UcV16UcUiiC", "") +BUILTIN(__builtin_altivec_vinsd_elt, "V16UcV16UcULLiiC", "") // P10 Vector Extract built-ins. BUILTIN(__builtin_altivec_vextdubvlx, "V2ULLiV16UcV16UcUi", "") @@ -833,7 +851,7 @@ BUILTIN(__builtin_dcbf, "vvC*", "") // Provided builtins with _mma_ prefix for compatibility. CUSTOM_BUILTIN(mma_lxvp, vsx_lxvp, "W256SLiW256C*", false) -CUSTOM_BUILTIN(mma_stxvp, vsx_stxvp, "vW256SLiW256C*", false) +CUSTOM_BUILTIN(mma_stxvp, vsx_stxvp, "vW256SLiW256*", false) CUSTOM_BUILTIN(mma_assemble_pair, vsx_assemble_pair, "vW256*VV", false) CUSTOM_BUILTIN(mma_disassemble_pair, vsx_disassemble_pair, "vv*W256*", false) CUSTOM_BUILTIN(vsx_build_pair, vsx_assemble_pair, "vW256*VV", false) @@ -845,7 +863,7 @@ CUSTOM_BUILTIN(mma_build_acc, mma_assemble_acc, "vW512*VVVV", false) // This avoids repeating the ID and INTR in the macro expression. UNALIASED_CUSTOM_BUILTIN(vsx_lxvp, "W256SLiW256C*", false) -UNALIASED_CUSTOM_BUILTIN(vsx_stxvp, "vW256SLiW256C*", false) +UNALIASED_CUSTOM_BUILTIN(vsx_stxvp, "vW256SLiW256*", false) UNALIASED_CUSTOM_BUILTIN(vsx_assemble_pair, "vW256*VV", false) UNALIASED_CUSTOM_BUILTIN(vsx_disassemble_pair, "vv*W256*", false) diff --git a/clang/include/clang/Basic/BuiltinsRISCV.def b/clang/include/clang/Basic/BuiltinsRISCV.def index 495a036e576f..b146118a99b5 100644 --- a/clang/include/clang/Basic/BuiltinsRISCV.def +++ b/clang/include/clang/Basic/BuiltinsRISCV.def @@ -18,12 +18,20 @@ // Zbb extension TARGET_BUILTIN(__builtin_riscv_orc_b_32, "ZiZi", "nc", "zbb") TARGET_BUILTIN(__builtin_riscv_orc_b_64, "WiWi", "nc", "zbb,64bit") +TARGET_BUILTIN(__builtin_riscv_clz_32, "ZiZi", "nc", "zbb") +TARGET_BUILTIN(__builtin_riscv_clz_64, "WiWi", "nc", "zbb,64bit") +TARGET_BUILTIN(__builtin_riscv_ctz_32, "ZiZi", "nc", "zbb") +TARGET_BUILTIN(__builtin_riscv_ctz_64, "WiWi", "nc", "zbb,64bit") -// Zbc extension -TARGET_BUILTIN(__builtin_riscv_clmul, "LiLiLi", "nc", "zbc") -TARGET_BUILTIN(__builtin_riscv_clmulh, "LiLiLi", "nc", "zbc") +// Zbc or Zbkc extension +TARGET_BUILTIN(__builtin_riscv_clmul, "LiLiLi", "nc", "zbc|zbkc") +TARGET_BUILTIN(__builtin_riscv_clmulh, "LiLiLi", "nc", "zbc|zbkc") TARGET_BUILTIN(__builtin_riscv_clmulr, "LiLiLi", "nc", "zbc") +// Zbkx +TARGET_BUILTIN(__builtin_riscv_xperm4, "LiLiLi", "nc", "zbkx") +TARGET_BUILTIN(__builtin_riscv_xperm8, "LiLiLi", "nc", "zbkx") + // Zbe extension TARGET_BUILTIN(__builtin_riscv_bcompress_32, "ZiZiZi", "nc", "experimental-zbe") TARGET_BUILTIN(__builtin_riscv_bcompress_64, "WiWiWi", "nc", @@ -67,5 +75,52 @@ TARGET_BUILTIN(__builtin_riscv_fsr_32, "LiLiLiLi", "nc", "experimental-zbt") TARGET_BUILTIN(__builtin_riscv_fsl_64, "WiWiWiWi", "nc", "experimental-zbt,64bit") TARGET_BUILTIN(__builtin_riscv_fsr_64, "WiWiWiWi", "nc", "experimental-zbt,64bit") +// Zbkb extension +TARGET_BUILTIN(__builtin_riscv_brev8, "LiLi", "nc", "zbkb") +TARGET_BUILTIN(__builtin_riscv_zip_32, "ZiZi", "nc", "zbkb") +TARGET_BUILTIN(__builtin_riscv_unzip_32, "ZiZi", "nc", "zbkb") + +// Zknd extension +TARGET_BUILTIN(__builtin_riscv_aes32dsi_32, "ZiZiZiIUc", "nc", "zknd") +TARGET_BUILTIN(__builtin_riscv_aes32dsmi_32, "ZiZiZiIUc", "nc", "zknd") +TARGET_BUILTIN(__builtin_riscv_aes64ds_64, "WiWiWi", "nc", "zknd,64bit") +TARGET_BUILTIN(__builtin_riscv_aes64dsm_64, "WiWiWi", "nc", "zknd,64bit") +TARGET_BUILTIN(__builtin_riscv_aes64im_64, "WiWi", "nc", "zknd,64bit") + +// Zknd & zkne +TARGET_BUILTIN(__builtin_riscv_aes64ks1i_64, "WiWiIUi", "nc", "zknd|zkne,64bit") +TARGET_BUILTIN(__builtin_riscv_aes64ks2_64, "WiWiWi", "nc", "zknd|zkne,64bit") + +// Zkne extension +TARGET_BUILTIN(__builtin_riscv_aes32esi_32, "ZiZiZiIUc", "nc", "zkne") +TARGET_BUILTIN(__builtin_riscv_aes32esmi_32, "ZiZiZiIUc", "nc", "zkne") +TARGET_BUILTIN(__builtin_riscv_aes64es_64, "WiWiWi", "nc", "zkne,64bit") +TARGET_BUILTIN(__builtin_riscv_aes64esm_64, "WiWiWi", "nc", "zkne,64bit") + +// Zknh extension +TARGET_BUILTIN(__builtin_riscv_sha256sig0, "LiLi", "nc", "zknh") +TARGET_BUILTIN(__builtin_riscv_sha256sig1, "LiLi", "nc", "zknh") +TARGET_BUILTIN(__builtin_riscv_sha256sum0, "LiLi", "nc", "zknh") +TARGET_BUILTIN(__builtin_riscv_sha256sum1, "LiLi", "nc", "zknh") + +TARGET_BUILTIN(__builtin_riscv_sha512sig0h_32, "ZiZiZi", "nc", "zknh") +TARGET_BUILTIN(__builtin_riscv_sha512sig0l_32, "ZiZiZi", "nc", "zknh") +TARGET_BUILTIN(__builtin_riscv_sha512sig1h_32, "ZiZiZi", "nc", "zknh") +TARGET_BUILTIN(__builtin_riscv_sha512sig1l_32, "ZiZiZi", "nc", "zknh") +TARGET_BUILTIN(__builtin_riscv_sha512sum0r_32, "ZiZiZi", "nc", "zknh") +TARGET_BUILTIN(__builtin_riscv_sha512sum1r_32, "ZiZiZi", "nc", "zknh") +TARGET_BUILTIN(__builtin_riscv_sha512sig0_64, "WiWi", "nc", "zknh,64bit") +TARGET_BUILTIN(__builtin_riscv_sha512sig1_64, "WiWi", "nc", "zknh,64bit") +TARGET_BUILTIN(__builtin_riscv_sha512sum0_64, "WiWi", "nc", "zknh,64bit") +TARGET_BUILTIN(__builtin_riscv_sha512sum1_64, "WiWi", "nc", "zknh,64bit") + +// Zksed extension +TARGET_BUILTIN(__builtin_riscv_sm4ed, "LiLiLiIUc", "nc", "zksed") +TARGET_BUILTIN(__builtin_riscv_sm4ks, "LiLiLiIUc", "nc", "zksed") + +// Zksh extension +TARGET_BUILTIN(__builtin_riscv_sm3p0, "LiLi", "nc", "zksh") +TARGET_BUILTIN(__builtin_riscv_sm3p1, "LiLi", "nc", "zksh") + #undef BUILTIN #undef TARGET_BUILTIN diff --git a/clang/include/clang/Basic/BuiltinsVE.def b/clang/include/clang/Basic/BuiltinsVE.def new file mode 100644 index 000000000000..3bffb241d8dc --- /dev/null +++ b/clang/include/clang/Basic/BuiltinsVE.def @@ -0,0 +1,32 @@ +//===--- BuiltinsVE.def - VE Builtin function database ----------*- 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 the VE-specific builtin function database. Users of +// this file must define the BUILTIN macro to make use of this information. +// +//===----------------------------------------------------------------------===// + +#if defined(BUILTIN) && !defined(TARGET_BUILTIN) +# define TARGET_BUILTIN(ID, TYPE, ATTRS, FEATURE) BUILTIN(ID, TYPE, ATTRS) +#endif + +// The format of this database is decribed in clang/Basic/Builtins.def. + +BUILTIN(__builtin_ve_vl_pack_f32p, "ULifC*fC*", "n") +BUILTIN(__builtin_ve_vl_pack_f32a, "ULifC*", "n") + +BUILTIN(__builtin_ve_vl_extract_vm512u, "V256bV512b", "n") +BUILTIN(__builtin_ve_vl_extract_vm512l, "V256bV512b", "n") +BUILTIN(__builtin_ve_vl_insert_vm512u, "V512bV512bV256b", "n") +BUILTIN(__builtin_ve_vl_insert_vm512l, "V512bV512bV256b", "n") + +// Use generated BUILTIN definitions +#include "clang/Basic/BuiltinsVEVL.gen.def" + +#undef BUILTIN +#undef TARGET_BUILTIN diff --git a/clang/include/clang/Basic/BuiltinsVEVL.gen.def b/clang/include/clang/Basic/BuiltinsVEVL.gen.def new file mode 100644 index 000000000000..7b06e5c30e93 --- /dev/null +++ b/clang/include/clang/Basic/BuiltinsVEVL.gen.def @@ -0,0 +1,1257 @@ +BUILTIN(__builtin_ve_vl_vld_vssl, "V256dLUivC*Ui", "n") +BUILTIN(__builtin_ve_vl_vld_vssvl, "V256dLUivC*V256dUi", "n") +BUILTIN(__builtin_ve_vl_vldnc_vssl, "V256dLUivC*Ui", "n") +BUILTIN(__builtin_ve_vl_vldnc_vssvl, "V256dLUivC*V256dUi", "n") +BUILTIN(__builtin_ve_vl_vldu_vssl, "V256dLUivC*Ui", "n") +BUILTIN(__builtin_ve_vl_vldu_vssvl, "V256dLUivC*V256dUi", "n") +BUILTIN(__builtin_ve_vl_vldunc_vssl, "V256dLUivC*Ui", "n") +BUILTIN(__builtin_ve_vl_vldunc_vssvl, "V256dLUivC*V256dUi", "n") +BUILTIN(__builtin_ve_vl_vldlsx_vssl, "V256dLUivC*Ui", "n") +BUILTIN(__builtin_ve_vl_vldlsx_vssvl, "V256dLUivC*V256dUi", "n") +BUILTIN(__builtin_ve_vl_vldlsxnc_vssl, "V256dLUivC*Ui", "n") +BUILTIN(__builtin_ve_vl_vldlsxnc_vssvl, "V256dLUivC*V256dUi", "n") +BUILTIN(__builtin_ve_vl_vldlzx_vssl, "V256dLUivC*Ui", "n") +BUILTIN(__builtin_ve_vl_vldlzx_vssvl, "V256dLUivC*V256dUi", "n") +BUILTIN(__builtin_ve_vl_vldlzxnc_vssl, "V256dLUivC*Ui", "n") +BUILTIN(__builtin_ve_vl_vldlzxnc_vssvl, "V256dLUivC*V256dUi", "n") +BUILTIN(__builtin_ve_vl_vld2d_vssl, "V256dLUivC*Ui", "n") +BUILTIN(__builtin_ve_vl_vld2d_vssvl, "V256dLUivC*V256dUi", "n") +BUILTIN(__builtin_ve_vl_vld2dnc_vssl, "V256dLUivC*Ui", "n") +BUILTIN(__builtin_ve_vl_vld2dnc_vssvl, "V256dLUivC*V256dUi", "n") +BUILTIN(__builtin_ve_vl_vldu2d_vssl, "V256dLUivC*Ui", "n") +BUILTIN(__builtin_ve_vl_vldu2d_vssvl, "V256dLUivC*V256dUi", "n") +BUILTIN(__builtin_ve_vl_vldu2dnc_vssl, "V256dLUivC*Ui", "n") +BUILTIN(__builtin_ve_vl_vldu2dnc_vssvl, "V256dLUivC*V256dUi", "n") +BUILTIN(__builtin_ve_vl_vldl2dsx_vssl, "V256dLUivC*Ui", "n") +BUILTIN(__builtin_ve_vl_vldl2dsx_vssvl, "V256dLUivC*V256dUi", "n") +BUILTIN(__builtin_ve_vl_vldl2dsxnc_vssl, "V256dLUivC*Ui", "n") +BUILTIN(__builtin_ve_vl_vldl2dsxnc_vssvl, "V256dLUivC*V256dUi", "n") +BUILTIN(__builtin_ve_vl_vldl2dzx_vssl, "V256dLUivC*Ui", "n") +BUILTIN(__builtin_ve_vl_vldl2dzx_vssvl, "V256dLUivC*V256dUi", "n") +BUILTIN(__builtin_ve_vl_vldl2dzxnc_vssl, "V256dLUivC*Ui", "n") +BUILTIN(__builtin_ve_vl_vldl2dzxnc_vssvl, "V256dLUivC*V256dUi", "n") +BUILTIN(__builtin_ve_vl_vst_vssl, "vV256dLUiv*Ui", "n") +BUILTIN(__builtin_ve_vl_vst_vssml, "vV256dLUiv*V256bUi", "n") +BUILTIN(__builtin_ve_vl_vstnc_vssl, "vV256dLUiv*Ui", "n") +BUILTIN(__builtin_ve_vl_vstnc_vssml, "vV256dLUiv*V256bUi", "n") +BUILTIN(__builtin_ve_vl_vstot_vssl, "vV256dLUiv*Ui", "n") +BUILTIN(__builtin_ve_vl_vstot_vssml, "vV256dLUiv*V256bUi", "n") +BUILTIN(__builtin_ve_vl_vstncot_vssl, "vV256dLUiv*Ui", "n") +BUILTIN(__builtin_ve_vl_vstncot_vssml, "vV256dLUiv*V256bUi", "n") +BUILTIN(__builtin_ve_vl_vstu_vssl, "vV256dLUiv*Ui", "n") +BUILTIN(__builtin_ve_vl_vstu_vssml, "vV256dLUiv*V256bUi", "n") +BUILTIN(__builtin_ve_vl_vstunc_vssl, "vV256dLUiv*Ui", "n") +BUILTIN(__builtin_ve_vl_vstunc_vssml, "vV256dLUiv*V256bUi", "n") +BUILTIN(__builtin_ve_vl_vstuot_vssl, "vV256dLUiv*Ui", "n") +BUILTIN(__builtin_ve_vl_vstuot_vssml, "vV256dLUiv*V256bUi", "n") +BUILTIN(__builtin_ve_vl_vstuncot_vssl, "vV256dLUiv*Ui", "n") +BUILTIN(__builtin_ve_vl_vstuncot_vssml, "vV256dLUiv*V256bUi", "n") +BUILTIN(__builtin_ve_vl_vstl_vssl, "vV256dLUiv*Ui", "n") +BUILTIN(__builtin_ve_vl_vstl_vssml, "vV256dLUiv*V256bUi", "n") +BUILTIN(__builtin_ve_vl_vstlnc_vssl, "vV256dLUiv*Ui", "n") +BUILTIN(__builtin_ve_vl_vstlnc_vssml, "vV256dLUiv*V256bUi", "n") +BUILTIN(__builtin_ve_vl_vstlot_vssl, "vV256dLUiv*Ui", "n") +BUILTIN(__builtin_ve_vl_vstlot_vssml, "vV256dLUiv*V256bUi", "n") +BUILTIN(__builtin_ve_vl_vstlncot_vssl, "vV256dLUiv*Ui", "n") +BUILTIN(__builtin_ve_vl_vstlncot_vssml, "vV256dLUiv*V256bUi", "n") +BUILTIN(__builtin_ve_vl_vst2d_vssl, "vV256dLUiv*Ui", "n") +BUILTIN(__builtin_ve_vl_vst2d_vssml, "vV256dLUiv*V256bUi", "n") +BUILTIN(__builtin_ve_vl_vst2dnc_vssl, "vV256dLUiv*Ui", "n") +BUILTIN(__builtin_ve_vl_vst2dnc_vssml, "vV256dLUiv*V256bUi", "n") +BUILTIN(__builtin_ve_vl_vst2dot_vssl, "vV256dLUiv*Ui", "n") +BUILTIN(__builtin_ve_vl_vst2dot_vssml, "vV256dLUiv*V256bUi", "n") +BUILTIN(__builtin_ve_vl_vst2dncot_vssl, "vV256dLUiv*Ui", "n") +BUILTIN(__builtin_ve_vl_vst2dncot_vssml, "vV256dLUiv*V256bUi", "n") +BUILTIN(__builtin_ve_vl_vstu2d_vssl, "vV256dLUiv*Ui", "n") +BUILTIN(__builtin_ve_vl_vstu2d_vssml, "vV256dLUiv*V256bUi", "n") +BUILTIN(__builtin_ve_vl_vstu2dnc_vssl, "vV256dLUiv*Ui", "n") +BUILTIN(__builtin_ve_vl_vstu2dnc_vssml, "vV256dLUiv*V256bUi", "n") +BUILTIN(__builtin_ve_vl_vstu2dot_vssl, "vV256dLUiv*Ui", "n") +BUILTIN(__builtin_ve_vl_vstu2dot_vssml, "vV256dLUiv*V256bUi", "n") +BUILTIN(__builtin_ve_vl_vstu2dncot_vssl, "vV256dLUiv*Ui", "n") +BUILTIN(__builtin_ve_vl_vstu2dncot_vssml, "vV256dLUiv*V256bUi", "n") +BUILTIN(__builtin_ve_vl_vstl2d_vssl, "vV256dLUiv*Ui", "n") +BUILTIN(__builtin_ve_vl_vstl2d_vssml, "vV256dLUiv*V256bUi", "n") +BUILTIN(__builtin_ve_vl_vstl2dnc_vssl, "vV256dLUiv*Ui", "n") +BUILTIN(__builtin_ve_vl_vstl2dnc_vssml, "vV256dLUiv*V256bUi", "n") +BUILTIN(__builtin_ve_vl_vstl2dot_vssl, "vV256dLUiv*Ui", "n") +BUILTIN(__builtin_ve_vl_vstl2dot_vssml, "vV256dLUiv*V256bUi", "n") +BUILTIN(__builtin_ve_vl_vstl2dncot_vssl, "vV256dLUiv*Ui", "n") +BUILTIN(__builtin_ve_vl_vstl2dncot_vssml, "vV256dLUiv*V256bUi", "n") +BUILTIN(__builtin_ve_vl_pfchv_ssl, "vLivC*Ui", "n") +BUILTIN(__builtin_ve_vl_pfchvnc_ssl, "vLivC*Ui", "n") +BUILTIN(__builtin_ve_vl_lsv_vvss, "V256dV256dUiLUi", "n") +BUILTIN(__builtin_ve_vl_lvsl_svs, "LUiV256dUi", "n") +BUILTIN(__builtin_ve_vl_lvsd_svs, "dV256dUi", "n") +BUILTIN(__builtin_ve_vl_lvss_svs, "fV256dUi", "n") +BUILTIN(__builtin_ve_vl_lvm_mmss, "V256bV256bLUiLUi", "n") +BUILTIN(__builtin_ve_vl_lvm_MMss, "V512bV512bLUiLUi", "n") +BUILTIN(__builtin_ve_vl_svm_sms, "LUiV256bLUi", "n") +BUILTIN(__builtin_ve_vl_svm_sMs, "LUiV512bLUi", "n") +BUILTIN(__builtin_ve_vl_vbrdd_vsl, "V256ddUi", "n") +BUILTIN(__builtin_ve_vl_vbrdd_vsvl, "V256ddV256dUi", "n") +BUILTIN(__builtin_ve_vl_vbrdd_vsmvl, "V256ddV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vbrdl_vsl, "V256dLiUi", "n") +BUILTIN(__builtin_ve_vl_vbrdl_vsvl, "V256dLiV256dUi", "n") +BUILTIN(__builtin_ve_vl_vbrdl_vsmvl, "V256dLiV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vbrds_vsl, "V256dfUi", "n") +BUILTIN(__builtin_ve_vl_vbrds_vsvl, "V256dfV256dUi", "n") +BUILTIN(__builtin_ve_vl_vbrds_vsmvl, "V256dfV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vbrdw_vsl, "V256diUi", "n") +BUILTIN(__builtin_ve_vl_vbrdw_vsvl, "V256diV256dUi", "n") +BUILTIN(__builtin_ve_vl_vbrdw_vsmvl, "V256diV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvbrd_vsl, "V256dLUiUi", "n") +BUILTIN(__builtin_ve_vl_pvbrd_vsvl, "V256dLUiV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvbrd_vsMvl, "V256dLUiV512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vmv_vsvl, "V256dUiV256dUi", "n") +BUILTIN(__builtin_ve_vl_vmv_vsvvl, "V256dUiV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vmv_vsvmvl, "V256dUiV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vaddul_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vaddul_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vaddul_vsvl, "V256dLUiV256dUi", "n") +BUILTIN(__builtin_ve_vl_vaddul_vsvvl, "V256dLUiV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vaddul_vvvmvl, "V256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vaddul_vsvmvl, "V256dLUiV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vadduw_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vadduw_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vadduw_vsvl, "V256dUiV256dUi", "n") +BUILTIN(__builtin_ve_vl_vadduw_vsvvl, "V256dUiV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vadduw_vvvmvl, "V256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vadduw_vsvmvl, "V256dUiV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvaddu_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvaddu_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvaddu_vsvl, "V256dLUiV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvaddu_vsvvl, "V256dLUiV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvaddu_vvvMvl, "V256dV256dV256dV512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvaddu_vsvMvl, "V256dLUiV256dV512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vaddswsx_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vaddswsx_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vaddswsx_vsvl, "V256diV256dUi", "n") +BUILTIN(__builtin_ve_vl_vaddswsx_vsvvl, "V256diV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vaddswsx_vvvmvl, "V256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vaddswsx_vsvmvl, "V256diV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vaddswzx_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vaddswzx_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vaddswzx_vsvl, "V256diV256dUi", "n") +BUILTIN(__builtin_ve_vl_vaddswzx_vsvvl, "V256diV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vaddswzx_vvvmvl, "V256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vaddswzx_vsvmvl, "V256diV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvadds_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvadds_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvadds_vsvl, "V256dLUiV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvadds_vsvvl, "V256dLUiV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvadds_vvvMvl, "V256dV256dV256dV512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvadds_vsvMvl, "V256dLUiV256dV512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vaddsl_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vaddsl_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vaddsl_vsvl, "V256dLiV256dUi", "n") +BUILTIN(__builtin_ve_vl_vaddsl_vsvvl, "V256dLiV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vaddsl_vvvmvl, "V256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vaddsl_vsvmvl, "V256dLiV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vsubul_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vsubul_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vsubul_vsvl, "V256dLUiV256dUi", "n") +BUILTIN(__builtin_ve_vl_vsubul_vsvvl, "V256dLUiV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vsubul_vvvmvl, "V256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vsubul_vsvmvl, "V256dLUiV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vsubuw_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vsubuw_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vsubuw_vsvl, "V256dUiV256dUi", "n") +BUILTIN(__builtin_ve_vl_vsubuw_vsvvl, "V256dUiV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vsubuw_vvvmvl, "V256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vsubuw_vsvmvl, "V256dUiV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvsubu_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvsubu_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvsubu_vsvl, "V256dLUiV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvsubu_vsvvl, "V256dLUiV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvsubu_vvvMvl, "V256dV256dV256dV512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvsubu_vsvMvl, "V256dLUiV256dV512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vsubswsx_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vsubswsx_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vsubswsx_vsvl, "V256diV256dUi", "n") +BUILTIN(__builtin_ve_vl_vsubswsx_vsvvl, "V256diV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vsubswsx_vvvmvl, "V256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vsubswsx_vsvmvl, "V256diV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vsubswzx_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vsubswzx_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vsubswzx_vsvl, "V256diV256dUi", "n") +BUILTIN(__builtin_ve_vl_vsubswzx_vsvvl, "V256diV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vsubswzx_vvvmvl, "V256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vsubswzx_vsvmvl, "V256diV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvsubs_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvsubs_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvsubs_vsvl, "V256dLUiV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvsubs_vsvvl, "V256dLUiV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvsubs_vvvMvl, "V256dV256dV256dV512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvsubs_vsvMvl, "V256dLUiV256dV512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vsubsl_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vsubsl_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vsubsl_vsvl, "V256dLiV256dUi", "n") +BUILTIN(__builtin_ve_vl_vsubsl_vsvvl, "V256dLiV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vsubsl_vvvmvl, "V256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vsubsl_vsvmvl, "V256dLiV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vmulul_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vmulul_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vmulul_vsvl, "V256dLUiV256dUi", "n") +BUILTIN(__builtin_ve_vl_vmulul_vsvvl, "V256dLUiV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vmulul_vvvmvl, "V256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vmulul_vsvmvl, "V256dLUiV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vmuluw_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vmuluw_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vmuluw_vsvl, "V256dUiV256dUi", "n") +BUILTIN(__builtin_ve_vl_vmuluw_vsvvl, "V256dUiV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vmuluw_vvvmvl, "V256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vmuluw_vsvmvl, "V256dUiV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vmulswsx_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vmulswsx_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vmulswsx_vsvl, "V256diV256dUi", "n") +BUILTIN(__builtin_ve_vl_vmulswsx_vsvvl, "V256diV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vmulswsx_vvvmvl, "V256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vmulswsx_vsvmvl, "V256diV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vmulswzx_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vmulswzx_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vmulswzx_vsvl, "V256diV256dUi", "n") +BUILTIN(__builtin_ve_vl_vmulswzx_vsvvl, "V256diV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vmulswzx_vvvmvl, "V256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vmulswzx_vsvmvl, "V256diV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vmulsl_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vmulsl_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vmulsl_vsvl, "V256dLiV256dUi", "n") +BUILTIN(__builtin_ve_vl_vmulsl_vsvvl, "V256dLiV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vmulsl_vvvmvl, "V256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vmulsl_vsvmvl, "V256dLiV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vmulslw_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vmulslw_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vmulslw_vsvl, "V256diV256dUi", "n") +BUILTIN(__builtin_ve_vl_vmulslw_vsvvl, "V256diV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vdivul_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vdivul_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vdivul_vsvl, "V256dLUiV256dUi", "n") +BUILTIN(__builtin_ve_vl_vdivul_vsvvl, "V256dLUiV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vdivul_vvvmvl, "V256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vdivul_vsvmvl, "V256dLUiV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vdivuw_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vdivuw_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vdivuw_vsvl, "V256dUiV256dUi", "n") +BUILTIN(__builtin_ve_vl_vdivuw_vsvvl, "V256dUiV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vdivuw_vvvmvl, "V256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vdivuw_vsvmvl, "V256dUiV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vdivul_vvsl, "V256dV256dLUiUi", "n") +BUILTIN(__builtin_ve_vl_vdivul_vvsvl, "V256dV256dLUiV256dUi", "n") +BUILTIN(__builtin_ve_vl_vdivul_vvsmvl, "V256dV256dLUiV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vdivuw_vvsl, "V256dV256dUiUi", "n") +BUILTIN(__builtin_ve_vl_vdivuw_vvsvl, "V256dV256dUiV256dUi", "n") +BUILTIN(__builtin_ve_vl_vdivuw_vvsmvl, "V256dV256dUiV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vdivswsx_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vdivswsx_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vdivswsx_vsvl, "V256diV256dUi", "n") +BUILTIN(__builtin_ve_vl_vdivswsx_vsvvl, "V256diV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vdivswsx_vvvmvl, "V256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vdivswsx_vsvmvl, "V256diV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vdivswzx_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vdivswzx_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vdivswzx_vsvl, "V256diV256dUi", "n") +BUILTIN(__builtin_ve_vl_vdivswzx_vsvvl, "V256diV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vdivswzx_vvvmvl, "V256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vdivswzx_vsvmvl, "V256diV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vdivswsx_vvsl, "V256dV256diUi", "n") +BUILTIN(__builtin_ve_vl_vdivswsx_vvsvl, "V256dV256diV256dUi", "n") +BUILTIN(__builtin_ve_vl_vdivswsx_vvsmvl, "V256dV256diV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vdivswzx_vvsl, "V256dV256diUi", "n") +BUILTIN(__builtin_ve_vl_vdivswzx_vvsvl, "V256dV256diV256dUi", "n") +BUILTIN(__builtin_ve_vl_vdivswzx_vvsmvl, "V256dV256diV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vdivsl_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vdivsl_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vdivsl_vsvl, "V256dLiV256dUi", "n") +BUILTIN(__builtin_ve_vl_vdivsl_vsvvl, "V256dLiV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vdivsl_vvvmvl, "V256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vdivsl_vsvmvl, "V256dLiV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vdivsl_vvsl, "V256dV256dLiUi", "n") +BUILTIN(__builtin_ve_vl_vdivsl_vvsvl, "V256dV256dLiV256dUi", "n") +BUILTIN(__builtin_ve_vl_vdivsl_vvsmvl, "V256dV256dLiV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcmpul_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcmpul_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcmpul_vsvl, "V256dLUiV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcmpul_vsvvl, "V256dLUiV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcmpul_vvvmvl, "V256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcmpul_vsvmvl, "V256dLUiV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcmpuw_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcmpuw_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcmpuw_vsvl, "V256dUiV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcmpuw_vsvvl, "V256dUiV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcmpuw_vvvmvl, "V256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcmpuw_vsvmvl, "V256dUiV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvcmpu_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvcmpu_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvcmpu_vsvl, "V256dLUiV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvcmpu_vsvvl, "V256dLUiV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvcmpu_vvvMvl, "V256dV256dV256dV512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvcmpu_vsvMvl, "V256dLUiV256dV512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcmpswsx_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcmpswsx_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcmpswsx_vsvl, "V256diV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcmpswsx_vsvvl, "V256diV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcmpswsx_vvvmvl, "V256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcmpswsx_vsvmvl, "V256diV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcmpswzx_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcmpswzx_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcmpswzx_vsvl, "V256diV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcmpswzx_vsvvl, "V256diV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcmpswzx_vvvmvl, "V256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcmpswzx_vsvmvl, "V256diV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvcmps_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvcmps_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvcmps_vsvl, "V256dLUiV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvcmps_vsvvl, "V256dLUiV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvcmps_vvvMvl, "V256dV256dV256dV512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvcmps_vsvMvl, "V256dLUiV256dV512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcmpsl_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcmpsl_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcmpsl_vsvl, "V256dLiV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcmpsl_vsvvl, "V256dLiV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcmpsl_vvvmvl, "V256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcmpsl_vsvmvl, "V256dLiV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vmaxswsx_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vmaxswsx_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vmaxswsx_vsvl, "V256diV256dUi", "n") +BUILTIN(__builtin_ve_vl_vmaxswsx_vsvvl, "V256diV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vmaxswsx_vvvmvl, "V256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vmaxswsx_vsvmvl, "V256diV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vmaxswzx_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vmaxswzx_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vmaxswzx_vsvl, "V256diV256dUi", "n") +BUILTIN(__builtin_ve_vl_vmaxswzx_vsvvl, "V256diV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vmaxswzx_vvvmvl, "V256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vmaxswzx_vsvmvl, "V256diV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvmaxs_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvmaxs_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvmaxs_vsvl, "V256dLUiV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvmaxs_vsvvl, "V256dLUiV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvmaxs_vvvMvl, "V256dV256dV256dV512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvmaxs_vsvMvl, "V256dLUiV256dV512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vminswsx_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vminswsx_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vminswsx_vsvl, "V256diV256dUi", "n") +BUILTIN(__builtin_ve_vl_vminswsx_vsvvl, "V256diV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vminswsx_vvvmvl, "V256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vminswsx_vsvmvl, "V256diV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vminswzx_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vminswzx_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vminswzx_vsvl, "V256diV256dUi", "n") +BUILTIN(__builtin_ve_vl_vminswzx_vsvvl, "V256diV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vminswzx_vvvmvl, "V256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vminswzx_vsvmvl, "V256diV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvmins_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvmins_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvmins_vsvl, "V256dLUiV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvmins_vsvvl, "V256dLUiV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvmins_vvvMvl, "V256dV256dV256dV512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvmins_vsvMvl, "V256dLUiV256dV512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vmaxsl_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vmaxsl_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vmaxsl_vsvl, "V256dLiV256dUi", "n") +BUILTIN(__builtin_ve_vl_vmaxsl_vsvvl, "V256dLiV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vmaxsl_vvvmvl, "V256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vmaxsl_vsvmvl, "V256dLiV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vminsl_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vminsl_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vminsl_vsvl, "V256dLiV256dUi", "n") +BUILTIN(__builtin_ve_vl_vminsl_vsvvl, "V256dLiV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vminsl_vvvmvl, "V256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vminsl_vsvmvl, "V256dLiV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vand_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vand_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vand_vsvl, "V256dLUiV256dUi", "n") +BUILTIN(__builtin_ve_vl_vand_vsvvl, "V256dLUiV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vand_vvvmvl, "V256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vand_vsvmvl, "V256dLUiV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvand_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvand_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvand_vsvl, "V256dLUiV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvand_vsvvl, "V256dLUiV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvand_vvvMvl, "V256dV256dV256dV512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvand_vsvMvl, "V256dLUiV256dV512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vor_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vor_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vor_vsvl, "V256dLUiV256dUi", "n") +BUILTIN(__builtin_ve_vl_vor_vsvvl, "V256dLUiV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vor_vvvmvl, "V256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vor_vsvmvl, "V256dLUiV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvor_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvor_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvor_vsvl, "V256dLUiV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvor_vsvvl, "V256dLUiV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvor_vvvMvl, "V256dV256dV256dV512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvor_vsvMvl, "V256dLUiV256dV512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vxor_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vxor_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vxor_vsvl, "V256dLUiV256dUi", "n") +BUILTIN(__builtin_ve_vl_vxor_vsvvl, "V256dLUiV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vxor_vvvmvl, "V256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vxor_vsvmvl, "V256dLUiV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvxor_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvxor_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvxor_vsvl, "V256dLUiV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvxor_vsvvl, "V256dLUiV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvxor_vvvMvl, "V256dV256dV256dV512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvxor_vsvMvl, "V256dLUiV256dV512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_veqv_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_veqv_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_veqv_vsvl, "V256dLUiV256dUi", "n") +BUILTIN(__builtin_ve_vl_veqv_vsvvl, "V256dLUiV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_veqv_vvvmvl, "V256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_veqv_vsvmvl, "V256dLUiV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pveqv_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pveqv_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pveqv_vsvl, "V256dLUiV256dUi", "n") +BUILTIN(__builtin_ve_vl_pveqv_vsvvl, "V256dLUiV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pveqv_vvvMvl, "V256dV256dV256dV512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pveqv_vsvMvl, "V256dLUiV256dV512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vldz_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vldz_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vldz_vvmvl, "V256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvldzlo_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvldzlo_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvldzlo_vvmvl, "V256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvldzup_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvldzup_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvldzup_vvmvl, "V256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvldz_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvldz_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvldz_vvMvl, "V256dV256dV512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vpcnt_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vpcnt_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vpcnt_vvmvl, "V256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvpcntlo_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvpcntlo_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvpcntlo_vvmvl, "V256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvpcntup_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvpcntup_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvpcntup_vvmvl, "V256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvpcnt_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvpcnt_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvpcnt_vvMvl, "V256dV256dV512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vbrv_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vbrv_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vbrv_vvmvl, "V256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvbrvlo_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvbrvlo_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvbrvlo_vvmvl, "V256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvbrvup_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvbrvup_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvbrvup_vvmvl, "V256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvbrv_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvbrv_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvbrv_vvMvl, "V256dV256dV512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vseq_vl, "V256dUi", "n") +BUILTIN(__builtin_ve_vl_vseq_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvseqlo_vl, "V256dUi", "n") +BUILTIN(__builtin_ve_vl_pvseqlo_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvsequp_vl, "V256dUi", "n") +BUILTIN(__builtin_ve_vl_pvsequp_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvseq_vl, "V256dUi", "n") +BUILTIN(__builtin_ve_vl_pvseq_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vsll_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vsll_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vsll_vvsl, "V256dV256dLUiUi", "n") +BUILTIN(__builtin_ve_vl_vsll_vvsvl, "V256dV256dLUiV256dUi", "n") +BUILTIN(__builtin_ve_vl_vsll_vvvmvl, "V256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vsll_vvsmvl, "V256dV256dLUiV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvsll_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvsll_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvsll_vvsl, "V256dV256dLUiUi", "n") +BUILTIN(__builtin_ve_vl_pvsll_vvsvl, "V256dV256dLUiV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvsll_vvvMvl, "V256dV256dV256dV512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvsll_vvsMvl, "V256dV256dLUiV512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vsrl_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vsrl_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vsrl_vvsl, "V256dV256dLUiUi", "n") +BUILTIN(__builtin_ve_vl_vsrl_vvsvl, "V256dV256dLUiV256dUi", "n") +BUILTIN(__builtin_ve_vl_vsrl_vvvmvl, "V256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vsrl_vvsmvl, "V256dV256dLUiV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvsrl_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvsrl_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvsrl_vvsl, "V256dV256dLUiUi", "n") +BUILTIN(__builtin_ve_vl_pvsrl_vvsvl, "V256dV256dLUiV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvsrl_vvvMvl, "V256dV256dV256dV512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvsrl_vvsMvl, "V256dV256dLUiV512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vslawsx_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vslawsx_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vslawsx_vvsl, "V256dV256diUi", "n") +BUILTIN(__builtin_ve_vl_vslawsx_vvsvl, "V256dV256diV256dUi", "n") +BUILTIN(__builtin_ve_vl_vslawsx_vvvmvl, "V256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vslawsx_vvsmvl, "V256dV256diV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vslawzx_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vslawzx_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vslawzx_vvsl, "V256dV256diUi", "n") +BUILTIN(__builtin_ve_vl_vslawzx_vvsvl, "V256dV256diV256dUi", "n") +BUILTIN(__builtin_ve_vl_vslawzx_vvvmvl, "V256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vslawzx_vvsmvl, "V256dV256diV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvsla_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvsla_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvsla_vvsl, "V256dV256dLUiUi", "n") +BUILTIN(__builtin_ve_vl_pvsla_vvsvl, "V256dV256dLUiV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvsla_vvvMvl, "V256dV256dV256dV512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvsla_vvsMvl, "V256dV256dLUiV512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vslal_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vslal_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vslal_vvsl, "V256dV256dLiUi", "n") +BUILTIN(__builtin_ve_vl_vslal_vvsvl, "V256dV256dLiV256dUi", "n") +BUILTIN(__builtin_ve_vl_vslal_vvvmvl, "V256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vslal_vvsmvl, "V256dV256dLiV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vsrawsx_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vsrawsx_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vsrawsx_vvsl, "V256dV256diUi", "n") +BUILTIN(__builtin_ve_vl_vsrawsx_vvsvl, "V256dV256diV256dUi", "n") +BUILTIN(__builtin_ve_vl_vsrawsx_vvvmvl, "V256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vsrawsx_vvsmvl, "V256dV256diV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vsrawzx_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vsrawzx_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vsrawzx_vvsl, "V256dV256diUi", "n") +BUILTIN(__builtin_ve_vl_vsrawzx_vvsvl, "V256dV256diV256dUi", "n") +BUILTIN(__builtin_ve_vl_vsrawzx_vvvmvl, "V256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vsrawzx_vvsmvl, "V256dV256diV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvsra_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvsra_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvsra_vvsl, "V256dV256dLUiUi", "n") +BUILTIN(__builtin_ve_vl_pvsra_vvsvl, "V256dV256dLUiV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvsra_vvvMvl, "V256dV256dV256dV512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvsra_vvsMvl, "V256dV256dLUiV512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vsral_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vsral_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vsral_vvsl, "V256dV256dLiUi", "n") +BUILTIN(__builtin_ve_vl_vsral_vvsvl, "V256dV256dLiV256dUi", "n") +BUILTIN(__builtin_ve_vl_vsral_vvvmvl, "V256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vsral_vvsmvl, "V256dV256dLiV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vsfa_vvssl, "V256dV256dLUiLUiUi", "n") +BUILTIN(__builtin_ve_vl_vsfa_vvssvl, "V256dV256dLUiLUiV256dUi", "n") +BUILTIN(__builtin_ve_vl_vsfa_vvssmvl, "V256dV256dLUiLUiV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfaddd_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfaddd_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfaddd_vsvl, "V256ddV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfaddd_vsvvl, "V256ddV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfaddd_vvvmvl, "V256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfaddd_vsvmvl, "V256ddV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfadds_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfadds_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfadds_vsvl, "V256dfV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfadds_vsvvl, "V256dfV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfadds_vvvmvl, "V256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfadds_vsvmvl, "V256dfV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfadd_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfadd_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfadd_vsvl, "V256dLUiV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfadd_vsvvl, "V256dLUiV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfadd_vvvMvl, "V256dV256dV256dV512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfadd_vsvMvl, "V256dLUiV256dV512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfsubd_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfsubd_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfsubd_vsvl, "V256ddV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfsubd_vsvvl, "V256ddV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfsubd_vvvmvl, "V256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfsubd_vsvmvl, "V256ddV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfsubs_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfsubs_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfsubs_vsvl, "V256dfV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfsubs_vsvvl, "V256dfV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfsubs_vvvmvl, "V256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfsubs_vsvmvl, "V256dfV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfsub_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfsub_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfsub_vsvl, "V256dLUiV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfsub_vsvvl, "V256dLUiV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfsub_vvvMvl, "V256dV256dV256dV512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfsub_vsvMvl, "V256dLUiV256dV512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmuld_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmuld_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmuld_vsvl, "V256ddV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmuld_vsvvl, "V256ddV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmuld_vvvmvl, "V256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmuld_vsvmvl, "V256ddV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmuls_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmuls_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmuls_vsvl, "V256dfV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmuls_vsvvl, "V256dfV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmuls_vvvmvl, "V256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmuls_vsvmvl, "V256dfV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmul_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmul_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmul_vsvl, "V256dLUiV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmul_vsvvl, "V256dLUiV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmul_vvvMvl, "V256dV256dV256dV512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmul_vsvMvl, "V256dLUiV256dV512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfdivd_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfdivd_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfdivd_vsvl, "V256ddV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfdivd_vsvvl, "V256ddV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfdivd_vvvmvl, "V256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfdivd_vsvmvl, "V256ddV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfdivs_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfdivs_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfdivs_vsvl, "V256dfV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfdivs_vsvvl, "V256dfV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfdivs_vvvmvl, "V256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfdivs_vsvmvl, "V256dfV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfsqrtd_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfsqrtd_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfsqrts_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfsqrts_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfcmpd_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfcmpd_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfcmpd_vsvl, "V256ddV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfcmpd_vsvvl, "V256ddV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfcmpd_vvvmvl, "V256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfcmpd_vsvmvl, "V256ddV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfcmps_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfcmps_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfcmps_vsvl, "V256dfV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfcmps_vsvvl, "V256dfV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfcmps_vvvmvl, "V256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfcmps_vsvmvl, "V256dfV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfcmp_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfcmp_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfcmp_vsvl, "V256dLUiV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfcmp_vsvvl, "V256dLUiV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfcmp_vvvMvl, "V256dV256dV256dV512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfcmp_vsvMvl, "V256dLUiV256dV512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmaxd_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmaxd_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmaxd_vsvl, "V256ddV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmaxd_vsvvl, "V256ddV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmaxd_vvvmvl, "V256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmaxd_vsvmvl, "V256ddV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmaxs_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmaxs_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmaxs_vsvl, "V256dfV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmaxs_vsvvl, "V256dfV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmaxs_vvvmvl, "V256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmaxs_vsvmvl, "V256dfV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmax_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmax_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmax_vsvl, "V256dLUiV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmax_vsvvl, "V256dLUiV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmax_vvvMvl, "V256dV256dV256dV512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmax_vsvMvl, "V256dLUiV256dV512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmind_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmind_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmind_vsvl, "V256ddV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmind_vsvvl, "V256ddV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmind_vvvmvl, "V256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmind_vsvmvl, "V256ddV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmins_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmins_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmins_vsvl, "V256dfV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmins_vsvvl, "V256dfV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmins_vvvmvl, "V256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmins_vsvmvl, "V256dfV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmin_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmin_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmin_vsvl, "V256dLUiV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmin_vsvvl, "V256dLUiV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmin_vvvMvl, "V256dV256dV256dV512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmin_vsvMvl, "V256dLUiV256dV512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmadd_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmadd_vvvvvl, "V256dV256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmadd_vsvvl, "V256ddV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmadd_vsvvvl, "V256ddV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmadd_vvsvl, "V256dV256ddV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmadd_vvsvvl, "V256dV256ddV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmadd_vvvvmvl, "V256dV256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmadd_vsvvmvl, "V256ddV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmadd_vvsvmvl, "V256dV256ddV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmads_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmads_vvvvvl, "V256dV256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmads_vsvvl, "V256dfV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmads_vsvvvl, "V256dfV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmads_vvsvl, "V256dV256dfV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmads_vvsvvl, "V256dV256dfV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmads_vvvvmvl, "V256dV256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmads_vsvvmvl, "V256dfV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmads_vvsvmvl, "V256dV256dfV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmad_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmad_vvvvvl, "V256dV256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmad_vsvvl, "V256dLUiV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmad_vsvvvl, "V256dLUiV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmad_vvsvl, "V256dV256dLUiV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmad_vvsvvl, "V256dV256dLUiV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmad_vvvvMvl, "V256dV256dV256dV256dV512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmad_vsvvMvl, "V256dLUiV256dV256dV512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmad_vvsvMvl, "V256dV256dLUiV256dV512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmsbd_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmsbd_vvvvvl, "V256dV256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmsbd_vsvvl, "V256ddV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmsbd_vsvvvl, "V256ddV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmsbd_vvsvl, "V256dV256ddV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmsbd_vvsvvl, "V256dV256ddV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmsbd_vvvvmvl, "V256dV256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmsbd_vsvvmvl, "V256ddV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmsbd_vvsvmvl, "V256dV256ddV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmsbs_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmsbs_vvvvvl, "V256dV256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmsbs_vsvvl, "V256dfV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmsbs_vsvvvl, "V256dfV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmsbs_vvsvl, "V256dV256dfV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmsbs_vvsvvl, "V256dV256dfV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmsbs_vvvvmvl, "V256dV256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmsbs_vsvvmvl, "V256dfV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmsbs_vvsvmvl, "V256dV256dfV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmsb_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmsb_vvvvvl, "V256dV256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmsb_vsvvl, "V256dLUiV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmsb_vsvvvl, "V256dLUiV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmsb_vvsvl, "V256dV256dLUiV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmsb_vvsvvl, "V256dV256dLUiV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmsb_vvvvMvl, "V256dV256dV256dV256dV512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmsb_vsvvMvl, "V256dLUiV256dV256dV512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmsb_vvsvMvl, "V256dV256dLUiV256dV512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfnmadd_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfnmadd_vvvvvl, "V256dV256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfnmadd_vsvvl, "V256ddV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfnmadd_vsvvvl, "V256ddV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfnmadd_vvsvl, "V256dV256ddV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfnmadd_vvsvvl, "V256dV256ddV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfnmadd_vvvvmvl, "V256dV256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfnmadd_vsvvmvl, "V256ddV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfnmadd_vvsvmvl, "V256dV256ddV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfnmads_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfnmads_vvvvvl, "V256dV256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfnmads_vsvvl, "V256dfV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfnmads_vsvvvl, "V256dfV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfnmads_vvsvl, "V256dV256dfV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfnmads_vvsvvl, "V256dV256dfV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfnmads_vvvvmvl, "V256dV256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfnmads_vsvvmvl, "V256dfV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfnmads_vvsvmvl, "V256dV256dfV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfnmad_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfnmad_vvvvvl, "V256dV256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfnmad_vsvvl, "V256dLUiV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfnmad_vsvvvl, "V256dLUiV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfnmad_vvsvl, "V256dV256dLUiV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfnmad_vvsvvl, "V256dV256dLUiV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfnmad_vvvvMvl, "V256dV256dV256dV256dV512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfnmad_vsvvMvl, "V256dLUiV256dV256dV512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfnmad_vvsvMvl, "V256dV256dLUiV256dV512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfnmsbd_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfnmsbd_vvvvvl, "V256dV256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfnmsbd_vsvvl, "V256ddV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfnmsbd_vsvvvl, "V256ddV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfnmsbd_vvsvl, "V256dV256ddV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfnmsbd_vvsvvl, "V256dV256ddV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfnmsbd_vvvvmvl, "V256dV256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfnmsbd_vsvvmvl, "V256ddV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfnmsbd_vvsvmvl, "V256dV256ddV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfnmsbs_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfnmsbs_vvvvvl, "V256dV256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfnmsbs_vsvvl, "V256dfV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfnmsbs_vsvvvl, "V256dfV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfnmsbs_vvsvl, "V256dV256dfV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfnmsbs_vvsvvl, "V256dV256dfV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfnmsbs_vvvvmvl, "V256dV256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfnmsbs_vsvvmvl, "V256dfV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfnmsbs_vvsvmvl, "V256dV256dfV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfnmsb_vvvvl, "V256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfnmsb_vvvvvl, "V256dV256dV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfnmsb_vsvvl, "V256dLUiV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfnmsb_vsvvvl, "V256dLUiV256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfnmsb_vvsvl, "V256dV256dLUiV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfnmsb_vvsvvl, "V256dV256dLUiV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfnmsb_vvvvMvl, "V256dV256dV256dV256dV512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfnmsb_vsvvMvl, "V256dLUiV256dV256dV512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfnmsb_vvsvMvl, "V256dV256dLUiV256dV512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vrcpd_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vrcpd_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vrcps_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vrcps_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvrcp_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvrcp_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vrsqrtd_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vrsqrtd_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vrsqrts_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vrsqrts_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvrsqrt_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvrsqrt_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vrsqrtdnex_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vrsqrtdnex_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vrsqrtsnex_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vrsqrtsnex_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvrsqrtnex_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvrsqrtnex_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcvtwdsx_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcvtwdsx_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcvtwdsx_vvmvl, "V256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcvtwdsxrz_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcvtwdsxrz_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcvtwdsxrz_vvmvl, "V256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcvtwdzx_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcvtwdzx_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcvtwdzx_vvmvl, "V256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcvtwdzxrz_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcvtwdzxrz_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcvtwdzxrz_vvmvl, "V256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcvtwssx_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcvtwssx_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcvtwssx_vvmvl, "V256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcvtwssxrz_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcvtwssxrz_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcvtwssxrz_vvmvl, "V256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcvtwszx_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcvtwszx_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcvtwszx_vvmvl, "V256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcvtwszxrz_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcvtwszxrz_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcvtwszxrz_vvmvl, "V256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvcvtws_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvcvtws_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvcvtws_vvMvl, "V256dV256dV512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvcvtwsrz_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvcvtwsrz_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvcvtwsrz_vvMvl, "V256dV256dV512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcvtld_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcvtld_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcvtld_vvmvl, "V256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcvtldrz_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcvtldrz_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcvtldrz_vvmvl, "V256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcvtdw_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcvtdw_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcvtsw_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcvtsw_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvcvtsw_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvcvtsw_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcvtdl_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcvtdl_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcvtds_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcvtds_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcvtsd_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcvtsd_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vmrg_vvvml, "V256dV256dV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_vmrg_vvvmvl, "V256dV256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vmrg_vsvml, "V256dLUiV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_vmrg_vsvmvl, "V256dLUiV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vmrgw_vvvMl, "V256dV256dV256dV512bUi", "n") +BUILTIN(__builtin_ve_vl_vmrgw_vvvMvl, "V256dV256dV256dV512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vmrgw_vsvMl, "V256dUiV256dV512bUi", "n") +BUILTIN(__builtin_ve_vl_vmrgw_vsvMvl, "V256dUiV256dV512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vshf_vvvsl, "V256dV256dV256dLUiUi", "n") +BUILTIN(__builtin_ve_vl_vshf_vvvsvl, "V256dV256dV256dLUiV256dUi", "n") +BUILTIN(__builtin_ve_vl_vcp_vvmvl, "V256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vex_vvmvl, "V256dV256dV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmklat_ml, "V256bUi", "n") +BUILTIN(__builtin_ve_vl_vfmklaf_ml, "V256bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkat_Ml, "V512bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkaf_Ml, "V512bUi", "n") +BUILTIN(__builtin_ve_vl_vfmklgt_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmklgt_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_vfmkllt_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmkllt_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_vfmklne_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmklne_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_vfmkleq_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmkleq_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_vfmklge_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmklge_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_vfmklle_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmklle_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_vfmklnum_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmklnum_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_vfmklnan_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmklnan_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_vfmklgtnan_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmklgtnan_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_vfmklltnan_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmklltnan_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_vfmklnenan_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmklnenan_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_vfmkleqnan_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmkleqnan_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_vfmklgenan_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmklgenan_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_vfmkllenan_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmkllenan_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_vfmkwgt_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmkwgt_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_vfmkwlt_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmkwlt_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_vfmkwne_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmkwne_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_vfmkweq_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmkweq_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_vfmkwge_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmkwge_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_vfmkwle_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmkwle_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_vfmkwnum_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmkwnum_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_vfmkwnan_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmkwnan_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_vfmkwgtnan_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmkwgtnan_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_vfmkwltnan_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmkwltnan_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_vfmkwnenan_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmkwnenan_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_vfmkweqnan_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmkweqnan_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_vfmkwgenan_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmkwgenan_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_vfmkwlenan_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmkwlenan_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwlogt_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwupgt_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwlogt_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwupgt_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwlolt_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwuplt_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwlolt_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwuplt_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwlone_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwupne_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwlone_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwupne_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwloeq_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwupeq_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwloeq_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwupeq_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwloge_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwupge_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwloge_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwupge_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwlole_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwuple_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwlole_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwuple_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwlonum_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwupnum_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwlonum_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwupnum_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwlonan_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwupnan_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwlonan_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwupnan_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwlogtnan_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwupgtnan_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwlogtnan_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwupgtnan_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwloltnan_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwupltnan_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwloltnan_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwupltnan_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwlonenan_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwupnenan_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwlonenan_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwupnenan_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwloeqnan_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwupeqnan_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwloeqnan_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwupeqnan_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwlogenan_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwupgenan_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwlogenan_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwupgenan_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwlolenan_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwuplenan_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwlolenan_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwuplenan_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwgt_Mvl, "V512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwgt_MvMl, "V512bV256dV512bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwlt_Mvl, "V512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwlt_MvMl, "V512bV256dV512bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwne_Mvl, "V512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwne_MvMl, "V512bV256dV512bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkweq_Mvl, "V512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkweq_MvMl, "V512bV256dV512bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwge_Mvl, "V512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwge_MvMl, "V512bV256dV512bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwle_Mvl, "V512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwle_MvMl, "V512bV256dV512bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwnum_Mvl, "V512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwnum_MvMl, "V512bV256dV512bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwnan_Mvl, "V512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwnan_MvMl, "V512bV256dV512bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwgtnan_Mvl, "V512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwgtnan_MvMl, "V512bV256dV512bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwltnan_Mvl, "V512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwltnan_MvMl, "V512bV256dV512bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwnenan_Mvl, "V512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwnenan_MvMl, "V512bV256dV512bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkweqnan_Mvl, "V512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkweqnan_MvMl, "V512bV256dV512bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwgenan_Mvl, "V512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwgenan_MvMl, "V512bV256dV512bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwlenan_Mvl, "V512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkwlenan_MvMl, "V512bV256dV512bUi", "n") +BUILTIN(__builtin_ve_vl_vfmkdgt_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmkdgt_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_vfmkdlt_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmkdlt_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_vfmkdne_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmkdne_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_vfmkdeq_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmkdeq_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_vfmkdge_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmkdge_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_vfmkdle_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmkdle_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_vfmkdnum_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmkdnum_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_vfmkdnan_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmkdnan_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_vfmkdgtnan_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmkdgtnan_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_vfmkdltnan_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmkdltnan_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_vfmkdnenan_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmkdnenan_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_vfmkdeqnan_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmkdeqnan_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_vfmkdgenan_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmkdgenan_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_vfmkdlenan_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmkdlenan_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_vfmksgt_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmksgt_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_vfmkslt_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmkslt_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_vfmksne_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmksne_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_vfmkseq_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmkseq_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_vfmksge_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmksge_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_vfmksle_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmksle_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_vfmksnum_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmksnum_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_vfmksnan_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmksnan_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_vfmksgtnan_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmksgtnan_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_vfmksltnan_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmksltnan_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_vfmksnenan_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmksnenan_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_vfmkseqnan_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmkseqnan_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_vfmksgenan_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmksgenan_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_vfmkslenan_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfmkslenan_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkslogt_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmksupgt_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkslogt_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmksupgt_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkslolt_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmksuplt_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkslolt_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmksuplt_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkslone_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmksupne_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkslone_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmksupne_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmksloeq_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmksupeq_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmksloeq_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmksupeq_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmksloge_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmksupge_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmksloge_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmksupge_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkslole_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmksuple_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkslole_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmksuple_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkslonum_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmksupnum_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkslonum_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmksupnum_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkslonan_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmksupnan_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkslonan_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmksupnan_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkslogtnan_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmksupgtnan_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkslogtnan_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmksupgtnan_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmksloltnan_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmksupltnan_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmksloltnan_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmksupltnan_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkslonenan_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmksupnenan_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkslonenan_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmksupnenan_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmksloeqnan_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmksupeqnan_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmksloeqnan_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmksupeqnan_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkslogenan_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmksupgenan_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkslogenan_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmksupgenan_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkslolenan_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmksuplenan_mvl, "V256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkslolenan_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmksuplenan_mvml, "V256bV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmksgt_Mvl, "V512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmksgt_MvMl, "V512bV256dV512bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkslt_Mvl, "V512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkslt_MvMl, "V512bV256dV512bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmksne_Mvl, "V512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmksne_MvMl, "V512bV256dV512bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkseq_Mvl, "V512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkseq_MvMl, "V512bV256dV512bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmksge_Mvl, "V512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmksge_MvMl, "V512bV256dV512bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmksle_Mvl, "V512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmksle_MvMl, "V512bV256dV512bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmksnum_Mvl, "V512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmksnum_MvMl, "V512bV256dV512bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmksnan_Mvl, "V512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmksnan_MvMl, "V512bV256dV512bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmksgtnan_Mvl, "V512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmksgtnan_MvMl, "V512bV256dV512bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmksltnan_Mvl, "V512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmksltnan_MvMl, "V512bV256dV512bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmksnenan_Mvl, "V512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmksnenan_MvMl, "V512bV256dV512bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkseqnan_Mvl, "V512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkseqnan_MvMl, "V512bV256dV512bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmksgenan_Mvl, "V512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmksgenan_MvMl, "V512bV256dV512bUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkslenan_Mvl, "V512bV256dUi", "n") +BUILTIN(__builtin_ve_vl_pvfmkslenan_MvMl, "V512bV256dV512bUi", "n") +BUILTIN(__builtin_ve_vl_vsumwsx_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vsumwsx_vvml, "V256dV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_vsumwzx_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vsumwzx_vvml, "V256dV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_vsuml_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vsuml_vvml, "V256dV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_vfsumd_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfsumd_vvml, "V256dV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_vfsums_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfsums_vvml, "V256dV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_vrmaxswfstsx_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vrmaxswfstsx_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vrmaxswlstsx_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vrmaxswlstsx_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vrmaxswfstzx_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vrmaxswfstzx_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vrmaxswlstzx_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vrmaxswlstzx_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vrminswfstsx_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vrminswfstsx_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vrminswlstsx_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vrminswlstsx_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vrminswfstzx_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vrminswfstzx_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vrminswlstzx_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vrminswlstzx_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vrmaxslfst_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vrmaxslfst_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vrmaxsllst_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vrmaxsllst_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vrminslfst_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vrminslfst_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vrminsllst_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vrminsllst_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfrmaxdfst_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfrmaxdfst_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfrmaxdlst_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfrmaxdlst_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfrmaxsfst_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfrmaxsfst_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfrmaxslst_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfrmaxslst_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfrmindfst_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfrmindfst_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfrmindlst_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfrmindlst_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfrminsfst_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfrminsfst_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfrminslst_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vfrminslst_vvvl, "V256dV256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vrand_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vrand_vvml, "V256dV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_vror_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vror_vvml, "V256dV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_vrxor_vvl, "V256dV256dUi", "n") +BUILTIN(__builtin_ve_vl_vrxor_vvml, "V256dV256dV256bUi", "n") +BUILTIN(__builtin_ve_vl_vgt_vvssl, "V256dV256dLUiLUiUi", "n") +BUILTIN(__builtin_ve_vl_vgt_vvssvl, "V256dV256dLUiLUiV256dUi", "n") +BUILTIN(__builtin_ve_vl_vgt_vvssml, "V256dV256dLUiLUiV256bUi", "n") +BUILTIN(__builtin_ve_vl_vgt_vvssmvl, "V256dV256dLUiLUiV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vgtnc_vvssl, "V256dV256dLUiLUiUi", "n") +BUILTIN(__builtin_ve_vl_vgtnc_vvssvl, "V256dV256dLUiLUiV256dUi", "n") +BUILTIN(__builtin_ve_vl_vgtnc_vvssml, "V256dV256dLUiLUiV256bUi", "n") +BUILTIN(__builtin_ve_vl_vgtnc_vvssmvl, "V256dV256dLUiLUiV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vgtu_vvssl, "V256dV256dLUiLUiUi", "n") +BUILTIN(__builtin_ve_vl_vgtu_vvssvl, "V256dV256dLUiLUiV256dUi", "n") +BUILTIN(__builtin_ve_vl_vgtu_vvssml, "V256dV256dLUiLUiV256bUi", "n") +BUILTIN(__builtin_ve_vl_vgtu_vvssmvl, "V256dV256dLUiLUiV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vgtunc_vvssl, "V256dV256dLUiLUiUi", "n") +BUILTIN(__builtin_ve_vl_vgtunc_vvssvl, "V256dV256dLUiLUiV256dUi", "n") +BUILTIN(__builtin_ve_vl_vgtunc_vvssml, "V256dV256dLUiLUiV256bUi", "n") +BUILTIN(__builtin_ve_vl_vgtunc_vvssmvl, "V256dV256dLUiLUiV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vgtlsx_vvssl, "V256dV256dLUiLUiUi", "n") +BUILTIN(__builtin_ve_vl_vgtlsx_vvssvl, "V256dV256dLUiLUiV256dUi", "n") +BUILTIN(__builtin_ve_vl_vgtlsx_vvssml, "V256dV256dLUiLUiV256bUi", "n") +BUILTIN(__builtin_ve_vl_vgtlsx_vvssmvl, "V256dV256dLUiLUiV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vgtlsxnc_vvssl, "V256dV256dLUiLUiUi", "n") +BUILTIN(__builtin_ve_vl_vgtlsxnc_vvssvl, "V256dV256dLUiLUiV256dUi", "n") +BUILTIN(__builtin_ve_vl_vgtlsxnc_vvssml, "V256dV256dLUiLUiV256bUi", "n") +BUILTIN(__builtin_ve_vl_vgtlsxnc_vvssmvl, "V256dV256dLUiLUiV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vgtlzx_vvssl, "V256dV256dLUiLUiUi", "n") +BUILTIN(__builtin_ve_vl_vgtlzx_vvssvl, "V256dV256dLUiLUiV256dUi", "n") +BUILTIN(__builtin_ve_vl_vgtlzx_vvssml, "V256dV256dLUiLUiV256bUi", "n") +BUILTIN(__builtin_ve_vl_vgtlzx_vvssmvl, "V256dV256dLUiLUiV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vgtlzxnc_vvssl, "V256dV256dLUiLUiUi", "n") +BUILTIN(__builtin_ve_vl_vgtlzxnc_vvssvl, "V256dV256dLUiLUiV256dUi", "n") +BUILTIN(__builtin_ve_vl_vgtlzxnc_vvssml, "V256dV256dLUiLUiV256bUi", "n") +BUILTIN(__builtin_ve_vl_vgtlzxnc_vvssmvl, "V256dV256dLUiLUiV256bV256dUi", "n") +BUILTIN(__builtin_ve_vl_vsc_vvssl, "vV256dV256dLUiLUiUi", "n") +BUILTIN(__builtin_ve_vl_vsc_vvssml, "vV256dV256dLUiLUiV256bUi", "n") +BUILTIN(__builtin_ve_vl_vscnc_vvssl, "vV256dV256dLUiLUiUi", "n") +BUILTIN(__builtin_ve_vl_vscnc_vvssml, "vV256dV256dLUiLUiV256bUi", "n") +BUILTIN(__builtin_ve_vl_vscot_vvssl, "vV256dV256dLUiLUiUi", "n") +BUILTIN(__builtin_ve_vl_vscot_vvssml, "vV256dV256dLUiLUiV256bUi", "n") +BUILTIN(__builtin_ve_vl_vscncot_vvssl, "vV256dV256dLUiLUiUi", "n") +BUILTIN(__builtin_ve_vl_vscncot_vvssml, "vV256dV256dLUiLUiV256bUi", "n") +BUILTIN(__builtin_ve_vl_vscu_vvssl, "vV256dV256dLUiLUiUi", "n") +BUILTIN(__builtin_ve_vl_vscu_vvssml, "vV256dV256dLUiLUiV256bUi", "n") +BUILTIN(__builtin_ve_vl_vscunc_vvssl, "vV256dV256dLUiLUiUi", "n") +BUILTIN(__builtin_ve_vl_vscunc_vvssml, "vV256dV256dLUiLUiV256bUi", "n") +BUILTIN(__builtin_ve_vl_vscuot_vvssl, "vV256dV256dLUiLUiUi", "n") +BUILTIN(__builtin_ve_vl_vscuot_vvssml, "vV256dV256dLUiLUiV256bUi", "n") +BUILTIN(__builtin_ve_vl_vscuncot_vvssl, "vV256dV256dLUiLUiUi", "n") +BUILTIN(__builtin_ve_vl_vscuncot_vvssml, "vV256dV256dLUiLUiV256bUi", "n") +BUILTIN(__builtin_ve_vl_vscl_vvssl, "vV256dV256dLUiLUiUi", "n") +BUILTIN(__builtin_ve_vl_vscl_vvssml, "vV256dV256dLUiLUiV256bUi", "n") +BUILTIN(__builtin_ve_vl_vsclnc_vvssl, "vV256dV256dLUiLUiUi", "n") +BUILTIN(__builtin_ve_vl_vsclnc_vvssml, "vV256dV256dLUiLUiV256bUi", "n") +BUILTIN(__builtin_ve_vl_vsclot_vvssl, "vV256dV256dLUiLUiUi", "n") +BUILTIN(__builtin_ve_vl_vsclot_vvssml, "vV256dV256dLUiLUiV256bUi", "n") +BUILTIN(__builtin_ve_vl_vsclncot_vvssl, "vV256dV256dLUiLUiUi", "n") +BUILTIN(__builtin_ve_vl_vsclncot_vvssml, "vV256dV256dLUiLUiV256bUi", "n") +BUILTIN(__builtin_ve_vl_andm_mmm, "V256bV256bV256b", "n") +BUILTIN(__builtin_ve_vl_andm_MMM, "V512bV512bV512b", "n") +BUILTIN(__builtin_ve_vl_orm_mmm, "V256bV256bV256b", "n") +BUILTIN(__builtin_ve_vl_orm_MMM, "V512bV512bV512b", "n") +BUILTIN(__builtin_ve_vl_xorm_mmm, "V256bV256bV256b", "n") +BUILTIN(__builtin_ve_vl_xorm_MMM, "V512bV512bV512b", "n") +BUILTIN(__builtin_ve_vl_eqvm_mmm, "V256bV256bV256b", "n") +BUILTIN(__builtin_ve_vl_eqvm_MMM, "V512bV512bV512b", "n") +BUILTIN(__builtin_ve_vl_nndm_mmm, "V256bV256bV256b", "n") +BUILTIN(__builtin_ve_vl_nndm_MMM, "V512bV512bV512b", "n") +BUILTIN(__builtin_ve_vl_negm_mm, "V256bV256b", "n") +BUILTIN(__builtin_ve_vl_negm_MM, "V512bV512b", "n") +BUILTIN(__builtin_ve_vl_pcvm_sml, "LUiV256bUi", "n") +BUILTIN(__builtin_ve_vl_lzvm_sml, "LUiV256bUi", "n") +BUILTIN(__builtin_ve_vl_tovm_sml, "LUiV256bUi", "n") +BUILTIN(__builtin_ve_vl_lcr_sss, "LUiLUiLUi", "n") +BUILTIN(__builtin_ve_vl_scr_sss, "vLUiLUiLUi", "n") +BUILTIN(__builtin_ve_vl_tscr_ssss, "LUiLUiLUiLUi", "n") +BUILTIN(__builtin_ve_vl_fidcr_sss, "LUiLUiUi", "n") +BUILTIN(__builtin_ve_vl_fencei, "v", "n") +BUILTIN(__builtin_ve_vl_fencem_s, "vUi", "n") +BUILTIN(__builtin_ve_vl_fencec_s, "vUi", "n") +BUILTIN(__builtin_ve_vl_svob, "v", "n") diff --git a/clang/include/clang/Basic/BuiltinsWebAssembly.def b/clang/include/clang/Basic/BuiltinsWebAssembly.def index 057d968e9bca..03c6162f62e3 100644 --- a/clang/include/clang/Basic/BuiltinsWebAssembly.def +++ b/clang/include/clang/Basic/BuiltinsWebAssembly.def @@ -158,8 +158,8 @@ TARGET_BUILTIN(__builtin_wasm_narrow_u_i8x16_i16x8, "V16UcV8sV8s", "nc", "simd12 TARGET_BUILTIN(__builtin_wasm_narrow_s_i16x8_i32x4, "V8sV4iV4i", "nc", "simd128") TARGET_BUILTIN(__builtin_wasm_narrow_u_i16x8_i32x4, "V8UsV4iV4i", "nc", "simd128") -TARGET_BUILTIN(__builtin_wasm_trunc_sat_zero_s_f64x2_i32x4, "V4iV2d", "nc", "simd128") -TARGET_BUILTIN(__builtin_wasm_trunc_sat_zero_u_f64x2_i32x4, "V4UiV2d", "nc", "simd128") +TARGET_BUILTIN(__builtin_wasm_trunc_sat_s_zero_f64x2_i32x4, "V4iV2d", "nc", "simd128") +TARGET_BUILTIN(__builtin_wasm_trunc_sat_u_zero_f64x2_i32x4, "V4UiV2d", "nc", "simd128") // Relaxed SIMD builtins (experimental) TARGET_BUILTIN(__builtin_wasm_fma_f32x4, "V4fV4fV4fV4f", "nc", "relaxed-simd") @@ -181,8 +181,13 @@ TARGET_BUILTIN(__builtin_wasm_relaxed_max_f64x2, "V2dV2dV2d", "nc", "relaxed-sim TARGET_BUILTIN(__builtin_wasm_relaxed_trunc_s_i32x4_f32x4, "V4iV4f", "nc", "relaxed-simd") TARGET_BUILTIN(__builtin_wasm_relaxed_trunc_u_i32x4_f32x4, "V4UiV4f", "nc", "relaxed-simd") -TARGET_BUILTIN(__builtin_wasm_relaxed_trunc_zero_s_i32x4_f64x2, "V4iV2d", "nc", "relaxed-simd") -TARGET_BUILTIN(__builtin_wasm_relaxed_trunc_zero_u_i32x4_f64x2, "V4UiV2d", "nc", "relaxed-simd") +TARGET_BUILTIN(__builtin_wasm_relaxed_trunc_s_zero_i32x4_f64x2, "V4iV2d", "nc", "relaxed-simd") +TARGET_BUILTIN(__builtin_wasm_relaxed_trunc_u_zero_i32x4_f64x2, "V4UiV2d", "nc", "relaxed-simd") + +TARGET_BUILTIN(__builtin_wasm_relaxed_q15mulr_s_i16x8, "V8sV8sV8s", "nc", "relaxed-simd") + +TARGET_BUILTIN(__builtin_wasm_dot_i8x16_i7x16_s_i16x8, "V8sV16ScV16Sc", "nc", "relaxed-simd") +TARGET_BUILTIN(__builtin_wasm_dot_i8x16_i7x16_add_s_i32x4, "V4iV16ScV16ScV4i", "nc", "relaxed-simd") #undef BUILTIN #undef TARGET_BUILTIN diff --git a/clang/include/clang/Basic/BuiltinsX86.def b/clang/include/clang/Basic/BuiltinsX86.def index 0669a96b942b..3e5c376f9bc1 100644 --- a/clang/include/clang/Basic/BuiltinsX86.def +++ b/clang/include/clang/Basic/BuiltinsX86.def @@ -254,14 +254,6 @@ TARGET_BUILTIN(__builtin_ia32_minpd, "V2dV2dV2d", "ncV:128:", "sse2") TARGET_BUILTIN(__builtin_ia32_maxpd, "V2dV2dV2d", "ncV:128:", "sse2") TARGET_BUILTIN(__builtin_ia32_minsd, "V2dV2dV2d", "ncV:128:", "sse2") TARGET_BUILTIN(__builtin_ia32_maxsd, "V2dV2dV2d", "ncV:128:", "sse2") -TARGET_BUILTIN(__builtin_ia32_paddsb128, "V16cV16cV16c", "ncV:128:", "sse2") -TARGET_BUILTIN(__builtin_ia32_paddsw128, "V8sV8sV8s", "ncV:128:", "sse2") -TARGET_BUILTIN(__builtin_ia32_psubsb128, "V16cV16cV16c", "ncV:128:", "sse2") -TARGET_BUILTIN(__builtin_ia32_psubsw128, "V8sV8sV8s", "ncV:128:", "sse2") -TARGET_BUILTIN(__builtin_ia32_paddusb128, "V16cV16cV16c", "ncV:128:", "sse2") -TARGET_BUILTIN(__builtin_ia32_paddusw128, "V8sV8sV8s", "ncV:128:", "sse2") -TARGET_BUILTIN(__builtin_ia32_psubusb128, "V16cV16cV16c", "ncV:128:", "sse2") -TARGET_BUILTIN(__builtin_ia32_psubusw128, "V8sV8sV8s", "ncV:128:", "sse2") TARGET_BUILTIN(__builtin_ia32_pmulhw128, "V8sV8sV8s", "ncV:128:", "sse2") TARGET_BUILTIN(__builtin_ia32_pavgb128, "V16cV16cV16c", "ncV:128:", "sse2") TARGET_BUILTIN(__builtin_ia32_pavgw128, "V8sV8sV8s", "ncV:128:", "sse2") @@ -269,6 +261,7 @@ TARGET_BUILTIN(__builtin_ia32_packsswb128, "V16cV8sV8s", "ncV:128:", "sse2") TARGET_BUILTIN(__builtin_ia32_packssdw128, "V8sV4iV4i", "ncV:128:", "sse2") TARGET_BUILTIN(__builtin_ia32_packuswb128, "V16cV8sV8s", "ncV:128:", "sse2") TARGET_BUILTIN(__builtin_ia32_pmulhuw128, "V8sV8sV8s", "ncV:128:", "sse2") +TARGET_BUILTIN(__builtin_ia32_vec_ext_v2di, "OiV2OiIi", "ncV:128:", "sse2") TARGET_BUILTIN(__builtin_ia32_vec_ext_v4si, "iV4iIi", "ncV:128:", "sse2") TARGET_BUILTIN(__builtin_ia32_vec_ext_v4sf, "fV4fIi", "ncV:128:", "sse2") TARGET_BUILTIN(__builtin_ia32_vec_ext_v8hi, "sV8sIi", "ncV:128:", "sse2") @@ -547,14 +540,6 @@ TARGET_BUILTIN(__builtin_ia32_packsswb256, "V32cV16sV16s", "ncV:256:", "avx2") TARGET_BUILTIN(__builtin_ia32_packssdw256, "V16sV8iV8i", "ncV:256:", "avx2") TARGET_BUILTIN(__builtin_ia32_packuswb256, "V32cV16sV16s", "ncV:256:", "avx2") TARGET_BUILTIN(__builtin_ia32_packusdw256, "V16sV8iV8i", "ncV:256:", "avx2") -TARGET_BUILTIN(__builtin_ia32_paddsb256, "V32cV32cV32c", "ncV:256:", "avx2") -TARGET_BUILTIN(__builtin_ia32_paddsw256, "V16sV16sV16s", "ncV:256:", "avx2") -TARGET_BUILTIN(__builtin_ia32_psubsb256, "V32cV32cV32c", "ncV:256:", "avx2") -TARGET_BUILTIN(__builtin_ia32_psubsw256, "V16sV16sV16s", "ncV:256:", "avx2") -TARGET_BUILTIN(__builtin_ia32_paddusb256, "V32cV32cV32c", "ncV:256:", "avx2") -TARGET_BUILTIN(__builtin_ia32_paddusw256, "V16sV16sV16s", "ncV:256:", "avx2") -TARGET_BUILTIN(__builtin_ia32_psubusb256, "V32cV32cV32c", "ncV:256:", "avx2") -TARGET_BUILTIN(__builtin_ia32_psubusw256, "V16sV16sV16s", "ncV:256:", "avx2") TARGET_BUILTIN(__builtin_ia32_palignr256, "V32cV32cV32cIi", "ncV:256:", "avx2") TARGET_BUILTIN(__builtin_ia32_pavgb256, "V32cV32cV32c", "ncV:256:", "avx2") TARGET_BUILTIN(__builtin_ia32_pavgw256, "V16sV16sV16s", "ncV:256:", "avx2") @@ -1009,17 +994,9 @@ TARGET_BUILTIN(__builtin_ia32_packssdw512, "V32sV16iV16i", "ncV:512:", "avx512bw TARGET_BUILTIN(__builtin_ia32_packsswb512, "V64cV32sV32s", "ncV:512:", "avx512bw") TARGET_BUILTIN(__builtin_ia32_packusdw512, "V32sV16iV16i", "ncV:512:", "avx512bw") TARGET_BUILTIN(__builtin_ia32_packuswb512, "V64cV32sV32s", "ncV:512:", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_paddsb512, "V64cV64cV64c", "ncV:512:", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_paddsw512, "V32sV32sV32s", "ncV:512:", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_paddusb512, "V64cV64cV64c", "ncV:512:", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_paddusw512, "V32sV32sV32s", "ncV:512:", "avx512bw") TARGET_BUILTIN(__builtin_ia32_pavgb512, "V64cV64cV64c", "ncV:512:", "avx512bw") TARGET_BUILTIN(__builtin_ia32_pavgw512, "V32sV32sV32s", "ncV:512:", "avx512bw") TARGET_BUILTIN(__builtin_ia32_pshufb512, "V64cV64cV64c", "ncV:512:", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_psubsb512, "V64cV64cV64c", "ncV:512:", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_psubsw512, "V32sV32sV32s", "ncV:512:", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_psubusb512, "V64cV64cV64c", "ncV:512:", "avx512bw") -TARGET_BUILTIN(__builtin_ia32_psubusw512, "V32sV32sV32s", "ncV:512:", "avx512bw") TARGET_BUILTIN(__builtin_ia32_vpconflictdi_128, "V2OiV2Oi", "ncV:128:", "avx512cd,avx512vl") TARGET_BUILTIN(__builtin_ia32_vpconflictdi_256, "V4OiV4Oi", "ncV:256:", "avx512cd,avx512vl") @@ -2013,8 +1990,6 @@ TARGET_BUILTIN(__builtin_ia32_selectss_128, "V4fUcV4fV4f", "ncV:128:", "avx512f" TARGET_BUILTIN(__builtin_ia32_selectsd_128, "V2dUcV2dV2d", "ncV:128:", "avx512f") // generic reduction intrinsics -TARGET_BUILTIN(__builtin_ia32_reduce_add_d512, "iV16i", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_reduce_add_q512, "OiV8Oi", "ncV:512:", "avx512f") TARGET_BUILTIN(__builtin_ia32_reduce_fadd_pd512, "ddV8d", "ncV:512:", "avx512f") TARGET_BUILTIN(__builtin_ia32_reduce_fadd_ps512, "ffV16f", "ncV:512:", "avx512f") TARGET_BUILTIN(__builtin_ia32_reduce_fadd_ph512, "xxV32x", "ncV:512:", "avx512fp16") @@ -2035,8 +2010,6 @@ TARGET_BUILTIN(__builtin_ia32_reduce_fmul_ps512, "ffV16f", "ncV:512:", "avx512f" TARGET_BUILTIN(__builtin_ia32_reduce_fmul_ph512, "xxV32x", "ncV:512:", "avx512fp16") TARGET_BUILTIN(__builtin_ia32_reduce_fmul_ph256, "xxV16x", "ncV:256:", "avx512fp16,avx512vl") TARGET_BUILTIN(__builtin_ia32_reduce_fmul_ph128, "xxV8x", "ncV:128:", "avx512fp16,avx512vl") -TARGET_BUILTIN(__builtin_ia32_reduce_mul_d512, "iV16i", "ncV:512:", "avx512f") -TARGET_BUILTIN(__builtin_ia32_reduce_mul_q512, "OiV8Oi", "ncV:512:", "avx512f") // MONITORX/MWAITX TARGET_BUILTIN(__builtin_ia32_monitorx, "vvC*UiUi", "n", "mwaitx") @@ -2095,6 +2068,9 @@ TARGET_HEADER_BUILTIN(_ReadWriteBarrier, "v", "nh", "intrin.h", ALL_MS_LANGUAGES TARGET_HEADER_BUILTIN(_ReadBarrier, "v", "nh", "intrin.h", ALL_MS_LANGUAGES, "") TARGET_HEADER_BUILTIN(_WriteBarrier, "v", "nh", "intrin.h", ALL_MS_LANGUAGES, "") +TARGET_HEADER_BUILTIN(__cpuid, "vi*i", "nh", "intrin.h", ALL_MS_LANGUAGES, "") +TARGET_HEADER_BUILTIN(__cpuidex, "vi*ii", "nh", "intrin.h", ALL_MS_LANGUAGES, "") + TARGET_HEADER_BUILTIN(__emul, "LLiii", "nch", "intrin.h", ALL_MS_LANGUAGES, "") TARGET_HEADER_BUILTIN(__emulu, "ULLiUiUi", "nch", "intrin.h", ALL_MS_LANGUAGES, "") diff --git a/clang/include/clang/Basic/BuiltinsX86_64.def b/clang/include/clang/Basic/BuiltinsX86_64.def index c3b9703a9cc6..81cda3c5b94f 100644 --- a/clang/include/clang/Basic/BuiltinsX86_64.def +++ b/clang/include/clang/Basic/BuiltinsX86_64.def @@ -42,7 +42,6 @@ TARGET_BUILTIN(__builtin_ia32_cvttss2si64, "OiV4f", "ncV:128:", "sse") TARGET_BUILTIN(__builtin_ia32_cvtsd2si64, "OiV2d", "ncV:128:", "sse2") TARGET_BUILTIN(__builtin_ia32_cvttsd2si64, "OiV2d", "ncV:128:", "sse2") TARGET_BUILTIN(__builtin_ia32_movnti64, "vOi*Oi", "n", "sse2") -TARGET_BUILTIN(__builtin_ia32_vec_ext_v2di, "OiV2OiIi", "ncV:128:", "sse2") TARGET_BUILTIN(__builtin_ia32_vec_set_v2di, "V2OiV2OiOiIi", "ncV:128:", "sse4.1") TARGET_BUILTIN(__builtin_ia32_crc32di, "UOiUOiUOi", "nc", "crc32") TARGET_BUILTIN(__builtin_ia32_vec_ext_v4di, "OiV4OiIi", "ncV:256:", "avx") diff --git a/clang/include/clang/Basic/CharInfo.h b/clang/include/clang/Basic/CharInfo.h index c751b6a005e2..7d4119383508 100644 --- a/clang/include/clang/Basic/CharInfo.h +++ b/clang/include/clang/Basic/CharInfo.h @@ -38,15 +38,16 @@ namespace charinfo { }; } // end namespace charinfo -/// Returns true if this is an ASCII character. +/// Returns true if a byte is an ASCII character. LLVM_READNONE inline bool isASCII(char c) { return static_cast(c) <= 127; } LLVM_READNONE inline bool isASCII(unsigned char c) { return c <= 127; } -/// Returns true if this is an ASCII character. +/// Returns true if a codepoint is an ASCII character. LLVM_READNONE inline bool isASCII(uint32_t c) { return c <= 127; } +LLVM_READNONE inline bool isASCII(int64_t c) { return 0 <= c && c <= 127; } /// Returns true if this is a valid first character of a C identifier, /// which is [a-zA-Z_]. @@ -162,6 +163,44 @@ LLVM_READONLY inline bool isRawStringDelimBody(unsigned char c) { CHAR_DIGIT|CHAR_UNDER|CHAR_RAWDEL)) != 0; } +enum class EscapeChar { + Single = 1, + Double = 2, + SingleAndDouble = static_cast(Single) | static_cast(Double), +}; + +/// Return C-style escaped string for special characters, or an empty string if +/// there is no such mapping. +template +LLVM_READONLY inline auto escapeCStyle(CharT Ch) -> StringRef { + switch (Ch) { + case '\\': + return "\\\\"; + case '\'': + if ((static_cast(Opt) & static_cast(EscapeChar::Single)) == 0) + break; + return "\\'"; + case '"': + if ((static_cast(Opt) & static_cast(EscapeChar::Double)) == 0) + break; + return "\\\""; + case '\a': + return "\\a"; + case '\b': + return "\\b"; + case '\f': + return "\\f"; + case '\n': + return "\\n"; + case '\r': + return "\\r"; + case '\t': + return "\\t"; + case '\v': + return "\\v"; + } + return {}; +} /// Converts the given ASCII character to its lowercase equivalent. /// diff --git a/clang/include/clang/Basic/CodeGenOptions.def b/clang/include/clang/Basic/CodeGenOptions.def index 0da875525c0c..72b0e5d8eb41 100644 --- a/clang/include/clang/Basic/CodeGenOptions.def +++ b/clang/include/clang/Basic/CodeGenOptions.def @@ -64,8 +64,7 @@ CODEGENOPT(DisableLifetimeMarkers, 1, 0) ///< Don't emit any lifetime markers CODEGENOPT(DisableO0ImplyOptNone , 1, 0) ///< Don't annonate function with optnone at O0 CODEGENOPT(ExperimentalStrictFloatingPoint, 1, 0) ///< Enables the new, experimental ///< strict floating point. -CODEGENOPT(DisableNoundefAttrs, 1, 0) ///< Disable emitting `noundef` attributes on IR call arguments and return values -CODEGENOPT(LegacyPassManager, 1, 0) ///< Use the legacy pass manager. +CODEGENOPT(EnableNoundefAttrs, 1, 0) ///< Enable emitting `noundef` attributes on IR call arguments and return values CODEGENOPT(DebugPassManager, 1, 0) ///< Prints debug information for the new ///< pass manager. CODEGENOPT(DisableRedZone , 1, 0) ///< Set when -mno-red-zone is enabled. @@ -115,6 +114,10 @@ CODEGENOPT(StackSizeSection , 1, 0) ///< Set when -fstack-size-section is enabl CODEGENOPT(ForceDwarfFrameSection , 1, 0) ///< Set when -fforce-dwarf-frame is ///< enabled. +///< Set when -femit-dwarf-unwind is passed. +ENUM_CODEGENOPT(EmitDwarfUnwind, llvm::EmitDwarfUnwindType, 2, + llvm::EmitDwarfUnwindType::Default) + ///< Set when -fxray-always-emit-customevents is enabled. CODEGENOPT(XRayAlwaysEmitCustomEvents , 1, 0) @@ -144,6 +147,7 @@ VALUE_CODEGENOPT(PatchableFunctionEntryOffset , 32, 0) CODEGENOPT(HotPatch, 1, 0) ///< Supports the Microsoft /HOTPATCH flag and ///< generates a 'patchable-function' attribute. +CODEGENOPT(JMCInstrument, 1, 0) ///< Set when -fjmc is enabled. CODEGENOPT(InstrumentForProfiling , 1, 0) ///< Set when -pg is enabled. CODEGENOPT(CallFEntry , 1, 0) ///< Set when -mfentry is enabled. CODEGENOPT(MNopMCount , 1, 0) ///< Set when -mnop-mcount is enabled. @@ -174,6 +178,7 @@ CODEGENOPT(NoExecStack , 1, 0) ///< Set when -Wa,--noexecstack is enabled. CODEGENOPT(FatalWarnings , 1, 0) ///< Set when -Wa,--fatal-warnings is ///< enabled. CODEGENOPT(NoWarn , 1, 0) ///< Set when -Wa,--no-warn is enabled. +CODEGENOPT(MisExpect , 1, 0) ///< Set when -Wmisexpect is enabled CODEGENOPT(EnableSegmentedStacks , 1, 0) ///< Set when -fsplit-stack is enabled. CODEGENOPT(NoInlineLineTables, 1, 0) ///< Whether debug info should contain ///< inline line tables. @@ -182,6 +187,7 @@ CODEGENOPT(NoImplicitFloat , 1, 0) ///< Set when -mno-implicit-float is enable CODEGENOPT(NullPointerIsValid , 1, 0) ///< Assume Null pointer deference is defined. CODEGENOPT(OpenCLCorrectlyRoundedDivSqrt, 1, 0) ///< -cl-fp32-correctly-rounded-divide-sqrt CODEGENOPT(HIPCorrectlyRoundedDivSqrt, 1, 1) ///< -fno-hip-fp32-correctly-rounded-divide-sqrt +CODEGENOPT(HIPSaveKernelArgName, 1, 0) ///< Set when -fhip-kernel-arg-name is enabled. CODEGENOPT(UniqueInternalLinkageNames, 1, 0) ///< Internal Linkage symbols get unique names. CODEGENOPT(SplitMachineFunctions, 1, 0) ///< Split machine functions using profile information. @@ -464,6 +470,13 @@ ENUM_CODEGENOPT(SwiftAsyncFramePointer, SwiftAsyncFramePointerKind, 2, /// Whether to skip RAX setup when passing variable arguments (x86 only). CODEGENOPT(SkipRaxSetup, 1, 0) +/// Whether to zero out caller-used registers before returning. +ENUM_CODEGENOPT(ZeroCallUsedRegs, llvm::ZeroCallUsedRegs::ZeroCallUsedRegsKind, + 5, llvm::ZeroCallUsedRegs::ZeroCallUsedRegsKind::Skip) + +/// Whether to use opaque pointers. +CODEGENOPT(OpaquePointers, 1, 0) + #undef CODEGENOPT #undef ENUM_CODEGENOPT #undef VALUE_CODEGENOPT diff --git a/clang/include/clang/Basic/CodeGenOptions.h b/clang/include/clang/Basic/CodeGenOptions.h index 128ca2f5df3c..23d76c308d84 100644 --- a/clang/include/clang/Basic/CodeGenOptions.h +++ b/clang/include/clang/Basic/CodeGenOptions.h @@ -276,9 +276,8 @@ public: /// CUDA runtime back-end for incorporating them into host-side object file. std::string CudaGpuBinaryFileName; - /// List of filenames and section name pairs passed in using the - /// -fembed-offload-object option to embed device-side offloading objects into - /// the host as a named section. Input passed in as ',
' + /// List of filenames passed in using the -fembed-offload-object option. These + /// are offloading binaries containing device images and metadata. std::vector OffloadObjects; /// The name of the file to which the backend should save YAML optimization @@ -420,6 +419,10 @@ public: /// If threshold option is not specified, it is disabled by default. Optional DiagnosticsHotnessThreshold = 0; + /// The maximum percentage profiling weights can deviate from the expected + /// values in order to be included in misexpect diagnostics. + Optional DiagnosticsMisExpectTolerance = 0; + public: // Define accessors/mutators for code generation options of enumeration type. #define CODEGENOPT(Name, Bits, Default) diff --git a/clang/include/clang/Basic/Cuda.h b/clang/include/clang/Basic/Cuda.h index 04967925e9a4..18ef373784e5 100644 --- a/clang/include/clang/Basic/Cuda.h +++ b/clang/include/clang/Basic/Cuda.h @@ -85,6 +85,7 @@ enum class CudaArch { GFX909, GFX90a, GFX90c, + GFX940, GFX1010, GFX1011, GFX1012, @@ -95,9 +96,17 @@ enum class CudaArch { GFX1033, GFX1034, GFX1035, + GFX1036, + GFX1100, + GFX1101, + GFX1102, + GFX1103, Generic, // A processor model named 'generic' if the target backend defines a // public one. LAST, + + CudaDefault = CudaArch::SM_35, + HIPDefault = CudaArch::GFX803, }; static inline bool IsNVIDIAGpuArch(CudaArch A) { diff --git a/clang/include/clang/Basic/DarwinSDKInfo.h b/clang/include/clang/Basic/DarwinSDKInfo.h index df16827debfc..728bbc17c3ac 100644 --- a/clang/include/clang/Basic/DarwinSDKInfo.h +++ b/clang/include/clang/Basic/DarwinSDKInfo.h @@ -142,8 +142,7 @@ public: auto Mapping = VersionMappings.find(Kind.Value); if (Mapping == VersionMappings.end()) return nullptr; - return Mapping->getSecond().hasValue() ? Mapping->getSecond().getPointer() - : nullptr; + return Mapping->getSecond() ? Mapping->getSecond().getPointer() : nullptr; } static Optional diff --git a/clang/include/clang/Basic/DeclNodes.td b/clang/include/clang/Basic/DeclNodes.td index f8ad6cf5b262..1ac9b399aba2 100644 --- a/clang/include/clang/Basic/DeclNodes.td +++ b/clang/include/clang/Basic/DeclNodes.td @@ -41,6 +41,7 @@ def Named : DeclNode; def OMPDeclareReduction : DeclNode, DeclContext; def OMPDeclareMapper : DeclNode, DeclContext; def MSGuid : DeclNode; + def UnnamedGlobalConstant : DeclNode; def TemplateParamObject : DeclNode; def Declarator : DeclNode; def Field : DeclNode; diff --git a/clang/include/clang/Basic/Diagnostic.h b/clang/include/clang/Basic/Diagnostic.h index e5577e74fa63..09857da61d32 100644 --- a/clang/include/clang/Basic/Diagnostic.h +++ b/clang/include/clang/Basic/Diagnostic.h @@ -39,7 +39,8 @@ namespace llvm { class Error; -} +class raw_ostream; +} // namespace llvm namespace clang { @@ -544,6 +545,7 @@ public: DiagnosticsEngine &operator=(const DiagnosticsEngine &) = delete; ~DiagnosticsEngine(); + friend void DiagnosticsTestHelper(DiagnosticsEngine &); LLVM_DUMP_METHOD void dump() const; LLVM_DUMP_METHOD void dump(StringRef DiagName) const; @@ -890,9 +892,9 @@ public: LastDiagLevel = Other.LastDiagLevel; } - /// Reset the state of the diagnostic object to its initial - /// configuration. - void Reset(); + /// Reset the state of the diagnostic object to its initial configuration. + /// \param[in] soft - if true, doesn't reset the diagnostic mappings and state + void Reset(bool soft = false); //===--------------------------------------------------------------------===// // DiagnosticsEngine classification and reporting interfaces. @@ -1403,7 +1405,13 @@ inline const StreamingDiagnostic &operator<<(const StreamingDiagnostic &DB, } inline const StreamingDiagnostic &operator<<(const StreamingDiagnostic &DB, - int64_t I) { + long I) { + DB.AddTaggedVal(I, DiagnosticsEngine::ak_sint); + return DB; +} + +inline const StreamingDiagnostic &operator<<(const StreamingDiagnostic &DB, + long long I) { DB.AddTaggedVal(I, DiagnosticsEngine::ak_sint); return DB; } @@ -1425,7 +1433,13 @@ inline const StreamingDiagnostic &operator<<(const StreamingDiagnostic &DB, } inline const StreamingDiagnostic &operator<<(const StreamingDiagnostic &DB, - uint64_t I) { + unsigned long I) { + DB.AddTaggedVal(I, DiagnosticsEngine::ak_uint); + return DB; +} + +inline const StreamingDiagnostic &operator<<(const StreamingDiagnostic &DB, + unsigned long long I) { DB.AddTaggedVal(I, DiagnosticsEngine::ak_uint); return DB; } @@ -1717,6 +1731,9 @@ public: } }; +// Simple debug printing of StoredDiagnostic. +llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, const StoredDiagnostic &); + /// Abstract interface, implemented by clients of the front-end, which /// formats and prints fully processed diagnostics. class DiagnosticConsumer { diff --git a/clang/include/clang/Basic/DiagnosticASTKinds.td b/clang/include/clang/Basic/DiagnosticASTKinds.td index a89bdff1a10c..5e694c6ad07b 100644 --- a/clang/include/clang/Basic/DiagnosticASTKinds.td +++ b/clang/include/clang/Basic/DiagnosticASTKinds.td @@ -65,6 +65,8 @@ def note_consteval_address_accessible : Note< "is not a constant expression">; def note_constexpr_uninitialized : Note< "%select{|sub}0object of type %1 is not initialized">; +def note_constexpr_static_local : Note< + "control flows through the definition of a %select{static|thread_local}0 variable">; def note_constexpr_subobject_declared_here : Note< "subobject declared here">; def note_constexpr_array_index : Note<"cannot refer to element %0 of " @@ -362,6 +364,8 @@ def note_constexpr_memory_leak : Note< "%plural{0:|: (along with %0 other memory leak%s0)}0">; def note_constexpr_unsupported_layout : Note< "type %0 has unexpected layout">; +def note_constexpr_unsupported_flexible_array : Note< + "flexible array initialization is not yet supported">; def err_experimental_clang_interp_failed : Error< "the experimental clang interpreter failed to evaluate an expression">; @@ -439,8 +443,6 @@ def note_odr_tag_kind_here: Note< def note_odr_field : Note<"field %0 has type %1 here">; def note_odr_field_name : Note<"field has name %0 here">; def note_odr_missing_field : Note<"no corresponding field here">; -def note_odr_bit_field : Note<"bit-field %0 with type %1 and length %2 here">; -def note_odr_not_bit_field : Note<"field %0 is not a bit-field">; def note_odr_base : Note<"class has base type %0">; def note_odr_virtual_base : Note< "%select{non-virtual|virtual}0 derivation here">; diff --git a/clang/include/clang/Basic/DiagnosticCategories.h b/clang/include/clang/Basic/DiagnosticCategories.h index 2bbdeb31a7b7..14be326f7515 100644 --- a/clang/include/clang/Basic/DiagnosticCategories.h +++ b/clang/include/clang/Basic/DiagnosticCategories.h @@ -21,7 +21,8 @@ namespace clang { }; enum class Group { -#define DIAG_ENTRY(GroupName, FlagNameOffset, Members, SubGroups) GroupName, +#define DIAG_ENTRY(GroupName, FlagNameOffset, Members, SubGroups, Docs) \ + GroupName, #include "clang/Basic/DiagnosticGroups.inc" #undef CATEGORY #undef DIAG_ENTRY diff --git a/clang/include/clang/Basic/DiagnosticCommentKinds.td b/clang/include/clang/Basic/DiagnosticCommentKinds.td index ae63bb623ed3..1122ace3027d 100644 --- a/clang/include/clang/Basic/DiagnosticCommentKinds.td +++ b/clang/include/clang/Basic/DiagnosticCommentKinds.td @@ -155,8 +155,8 @@ def note_add_deprecation_attr : Note< // inline contents commands -def warn_doc_inline_contents_no_argument : Warning< - "'%select{\\|@}0%1' command does not have a valid word argument">, +def warn_doc_inline_command_not_enough_arguments : Warning< + "'%select{\\|@}0%1' command has %plural{0:no|:%2}2 word argument%s2, expected %3">, InGroup, DefaultIgnore; // verbatim block commands diff --git a/clang/include/clang/Basic/DiagnosticCommonKinds.td b/clang/include/clang/Basic/DiagnosticCommonKinds.td index 5ea55b0fd31b..39dee7e683ff 100644 --- a/clang/include/clang/Basic/DiagnosticCommonKinds.td +++ b/clang/include/clang/Basic/DiagnosticCommonKinds.td @@ -123,7 +123,9 @@ def err_enum_template : Error<"enumeration cannot be a template">; def warn_cxx20_compat_consteval : Warning< "'consteval' specifier is incompatible with C++ standards before C++20">, InGroup, DefaultIgnore; - +def warn_missing_type_specifier : Warning< + "type specifier missing, defaults to 'int'">, + InGroup, DefaultIgnore; } let CategoryName = "Nullability Issue" in { @@ -145,8 +147,8 @@ def warn_conflicting_nullability_attr_overriding_param_types : Warning< def err_nullability_conflicting : Error< "nullability specifier %0 conflicts with existing specifier %1">; -def warn_target_unsupported_branch_protection_option: Warning < - "ignoring '-mbranch-protection=' option because the '%0' architecture does not support it">, +def warn_incompatible_branch_protection_option: Warning < + "'-mbranch-protection=' option is incompatible with the '%0' architecture">, InGroup; def warn_target_unsupported_branch_protection_attribute: Warning < @@ -161,6 +163,8 @@ def err_opencl_unknown_type_specifier : Error< def warn_unknown_attribute_ignored : Warning< "unknown attribute %0 ignored">, InGroup; +def warn_attribute_ignored : Warning<"%0 attribute ignored">, + InGroup; def err_use_of_tag_name_without_tag : Error< "must use '%1' tag to refer to type %0%select{| in this scope}2">; @@ -207,6 +211,12 @@ def err_cxx2b_size_t_suffix: Error< def err_size_t_literal_too_large: Error< "%select{signed |}0'size_t' literal is out of range of possible " "%select{signed |}0'size_t' values">; +def ext_c2x_bitint_suffix : ExtWarn< + "'_BitInt' suffix for literals is a C2x extension">, + InGroup; +def warn_c2x_compat_bitint_suffix : Warning< + "'_BitInt' suffix for literals is incompatible with C standards before C2x">, + InGroup, DefaultIgnore; def err_integer_literal_too_large : Error< "integer literal is too large to be represented in any %select{signed |}0" "integer type">; diff --git a/clang/include/clang/Basic/DiagnosticCrossTUKinds.td b/clang/include/clang/Basic/DiagnosticCrossTUKinds.td index 4277a3173203..e6ea1956f98a 100644 --- a/clang/include/clang/Basic/DiagnosticCrossTUKinds.td +++ b/clang/include/clang/Basic/DiagnosticCrossTUKinds.td @@ -12,8 +12,8 @@ def err_ctu_error_opening : Error< "error opening '%0': required by the CrossTU functionality">; def err_extdefmap_parsing : Error< - "error parsing index file: '%0' line: %1 'UniqueID filename' format " - "expected">; + "error parsing index file: '%0' line: %1 ': ' " + "format expected">; def err_multiple_def_index : Error< "multiple definitions are found for the same key in index ">; diff --git a/clang/include/clang/Basic/DiagnosticDriverKinds.td b/clang/include/clang/Basic/DiagnosticDriverKinds.td index 3efedbe0f642..96219f83b0a5 100644 --- a/clang/include/clang/Basic/DiagnosticDriverKinds.td +++ b/clang/include/clang/Basic/DiagnosticDriverKinds.td @@ -19,7 +19,7 @@ def err_drv_unsupported_opt_for_target : Error< def err_drv_unsupported_opt_for_language_mode : Error< "unsupported option '%0' for language mode '%1'">; def err_drv_unsupported_option_argument : Error< - "unsupported argument '%1' to option '%0'">; + "unsupported argument '%1' to option '-%0'">; def err_drv_unknown_stdin_type : Error< "-E or -x required when input is from standard input">; def err_drv_unknown_stdin_type_clang_cl : Error< @@ -29,8 +29,6 @@ def err_drv_invalid_arch_name : Error< "invalid arch name '%0'">; def err_drv_invalid_riscv_arch_name : Error< "invalid arch name '%0', %1">; -def err_drv_invalid_riscv_ext_arch_name : Error< - "invalid arch name '%0', %1 '%2'">; def warn_drv_invalid_arch_name_with_suggestion : Warning< "ignoring invalid /arch: argument '%0'; for %select{64|32}1-bit expected one of %2">, InGroup; @@ -38,10 +36,6 @@ def warn_drv_avr_mcu_not_specified : Warning< "no target microcontroller specified on command line, cannot " "link standard libraries, please pass -mmcu=">, InGroup; -def warn_drv_avr_gcc_not_found: Warning< - "no avr-gcc installation can be found on the system, " - "cannot link standard libraries">, - InGroup; def warn_drv_avr_libc_not_found: Warning< "no avr-libc installation can be found on the system, " "cannot link standard libraries">, @@ -58,6 +52,7 @@ def warn_drv_avr_stdlib_not_linked: Warning< "compiler runtime routines will be linked">, InGroup; def err_drv_cuda_bad_gpu_arch : Error<"unsupported CUDA gpu architecture: %0">; +def err_drv_offload_bad_gpu_arch : Error<"unsupported %0 gpu architecture: %1">; def err_drv_no_cuda_installation : Error< "cannot find CUDA installation; provide its path via '--cuda-path', or pass " "'-nocudainc' to build without CUDA includes">; @@ -65,9 +60,11 @@ def err_drv_no_cuda_libdevice : Error< "cannot find libdevice for %0; provide path to different CUDA installation " "via '--cuda-path', or pass '-nocudalib' to build without linking with " "libdevice">; +def err_drv_no_rdc_new_driver : Error< + "Using '--offload-new-driver' requires '-fgpu-rdc'">; def err_drv_no_rocm_device_lib : Error< - "cannot find ROCm device library%select{| for %1}0; provide its path via " + "cannot find ROCm device library%select{| for %1|for ABI version %1}0; provide its path via " "'--rocm-path' or '--rocm-device-lib-path', or pass '-nogpulib' to build " "without ROCm device library">; def err_drv_no_hip_runtime : Error< @@ -109,8 +106,8 @@ def err_drv_bad_offload_arch_combo : Error< "a feature should either exist in all offload archs, or not exist in any " "offload archs)">; def warn_drv_unsupported_option_for_offload_arch_req_feature : Warning< - "ignoring '%0' option as it is not currently supported for " - "offload arch '%1'. Use it with an offload arch containing '%2' instead">, + "ignoring '%0' option for offload arch '%1' as it is not currently supported " + "there. Use it with an offload arch containing '%2' instead">, InGroup; def warn_drv_unsupported_option_for_target : Warning< "ignoring '%0' option as it is not currently supported for target '%1'">, @@ -151,6 +148,8 @@ def err_drv_invalid_darwin_version : Error< "invalid Darwin version number: %0">; def err_drv_invalid_diagnotics_hotness_threshold : Error< "invalid argument in '%0', only integer or 'auto' is supported">; +def err_drv_invalid_diagnotics_misexpect_tolerance : Error< + "invalid argument in '%0', only integers are supported">; def err_drv_missing_argument : Error< "argument to '%0' is missing (expected %1 value%s1)">; def err_drv_invalid_Xarch_argument_with_args : Error< @@ -167,6 +166,8 @@ def err_drv_amdgpu_ieee_without_no_honor_nans : Error< "invalid argument '-mno-amdgpu-ieee' only allowed with relaxed NaN handling">; def err_drv_argument_not_allowed_with : Error< "invalid argument '%0' not allowed with '%1'">; +def err_drv_cannot_open_randomize_layout_seed_file : Error< + "cannot read randomize layout seed file '%0'">; def err_drv_invalid_version_number : Error< "invalid version number in '%0'">; def err_drv_no_linker_llvm_support : Error< @@ -207,6 +208,8 @@ def err_drv_invalid_libcxx_deployment : Error< "invalid deployment target for -stdlib=libc++ (requires %0 or later)">; def err_drv_invalid_argument_to_option : Error< "invalid argument '%0' to -%1">; +def err_drv_missing_sanitizer_ignorelist : Error< + "missing sanitizer ignorelist: '%0'">; def err_drv_malformed_sanitizer_ignorelist : Error< "malformed sanitizer ignorelist: '%0'">; def err_drv_malformed_sanitizer_coverage_allowlist : Error< @@ -268,6 +271,8 @@ def err_drv_cc_print_options_failure : Error< def err_drv_lto_without_lld : Error<"LTO requires -fuse-ld=lld">; def err_drv_preamble_format : Error< "incorrect format for -preamble-bytes=N,END">; +def err_drv_header_unit_extra_inputs : Error< + "multiple inputs are not valid for header units (first extra '%0')">; def warn_invalid_ios_deployment_target : Warning< "invalid iOS deployment version '%0', iOS 10 is the maximum deployment " "target for 32-bit targets">, InGroup, @@ -302,7 +307,6 @@ def err_drv_optimization_remark_format : Error< "unknown remark serializer format: '%0'">; def err_drv_no_neon_modifier : Error<"[no]neon is not accepted as modifier, please use [no]simd instead">; def err_drv_invalid_omp_target : Error<"OpenMP target is invalid: '%0'">; -def err_drv_debug_no_new_runtime : Error<"OpenMP target device debugging enabled with incompatible runtime">; def err_drv_incompatible_omp_arch : Error<"OpenMP target architecture '%0' pointer size is incompatible with host '%1'">; def err_drv_omp_host_ir_file_not_found : Error< "provided host compiler IR file '%0' is required to generate code for OpenMP " @@ -312,6 +316,9 @@ def err_drv_omp_host_target_not_supported : Error< def err_drv_expecting_fopenmp_with_fopenmp_targets : Error< "'-fopenmp-targets' must be used in conjunction with a '-fopenmp' option " "compatible with offloading; e.g., '-fopenmp=libomp' or '-fopenmp=libiomp5'">; +def err_drv_failed_to_deduce_target_from_arch : Error< + "failed to deduce triple for target architecture '%0'; specify the triple " + "using '-fopenmp-targets' and '-Xopenmp-target' instead.">; def err_drv_omp_offload_target_missingbcruntime : Error< "no library '%0' found in the default clang lib directory or in LIBRARY_PATH" "; use '--libomptarget-%1-bc-path' to specify %1 bitcode library">; @@ -327,9 +334,9 @@ def err_drv_unsupported_embed_bitcode def err_drv_bitcode_unsupported_on_toolchain : Error< "-fembed-bitcode is not supported on versions of iOS prior to 6.0">; def err_drv_negative_columns : Error< - "invalid value '%1' in '%0', value must be 'none' or a positive integer">; + "invalid value '%1' in '%0', value must be 'none' or a positive integer">; def err_drv_small_columns : Error< - "invalid value '%1' in '%0', value must be '%2' or greater">; + "invalid value '%1' in '%0', value must be '%2' or greater">; def err_drv_invalid_malign_branch_EQ : Error< "invalid argument '%0' to -malign-branch=; each element must be one of: %1">; @@ -368,12 +375,18 @@ def warn_drv_preprocessed_input_file_unused : Warning< def warn_drv_unused_argument : Warning< "argument unused during compilation: '%0'">, InGroup; +def warn_drv_unused_x : Warning< + "'-x %0' after last input file has no effect">, + InGroup; def warn_drv_empty_joined_argument : Warning< "joined argument expects additional value: '%0'">, InGroup; def warn_drv_diagnostics_hotness_requires_pgo : Warning< "argument '%0' requires profile-guided optimization information">, InGroup; +def warn_drv_diagnostics_misexpect_requires_pgo : Warning< + "argument '%0' requires profile-guided optimization information">, + InGroup; def warn_drv_clang_unsupported : Warning< "the clang compiler does not support '%0'">; def warn_drv_deprecated_arg : Warning< @@ -397,7 +410,7 @@ def warn_missing_sysroot : Warning<"no such sysroot directory: '%0'">, InGroup>; def warn_incompatible_sysroot : Warning<"using sysroot for '%0' but targeting '%1'">, InGroup>; -def warn_debug_compression_unavailable : Warning<"cannot compress debug sections (zlib not installed)">, +def warn_debug_compression_unavailable : Warning<"cannot compress debug sections (zlib not enabled)">, InGroup>; def warn_drv_disabling_vptr_no_rtti_default : Warning< "implicitly disabling vptr sanitizer because rtti wasn't enabled">, @@ -409,12 +422,8 @@ def warn_ignoring_verify_debuginfo_preserve_export : Warning< "ignoring -fverify-debuginfo-preserve-export=%0 because " "-fverify-debuginfo-preserve wasn't enabled">, InGroup; -def err_invalid_branch_protection: Error < - "invalid branch protection option '%0' in '%1'">; def warn_unsupported_branch_protection: Warning < "invalid branch protection option '%0' in '%1'">, InGroup; -def err_invalid_sls_hardening : Error< - "invalid sls hardening option '%0' in '%1'">; def err_sls_hardening_arm_not_supported : Error< "-mharden-sls is only supported on armv7-a or later">; @@ -441,6 +450,13 @@ def err_analyzer_checker_option_invalid_input : Error< "invalid input for checker option '%0', that expects %1">; def err_analyzer_checker_incompatible_analyzer_option : Error< "checker cannot be enabled with analyzer option '%0' == %1">; +def err_analyzer_not_built_with_z3 : Error< + "analyzer constraint manager 'z3' is only available if LLVM was built with " + "-DLLVM_ENABLE_Z3_SOLVER=ON">; +def warn_analyzer_deprecated_option : Warning< + "analyzer option '%0' is deprecated. This flag will be removed in %1, and " + "passing this option will be an error.">, + InGroup; def warn_drv_needs_hvx : Warning< "%0 requires HVX, use -mhvx/-mhvx= to enable it">, @@ -461,6 +477,10 @@ def err_test_module_file_extension_format : Error< "-ftest-module-file-extension argument '%0' is not of the required form " "'blockname:major:minor:hashed:user info'">; +def err_drv_extract_api_wrong_kind : Error< + "header file '%0' input '%1' does not match the type of prior input " + "in api extraction; use '-x %2' to override">; + def warn_slash_u_filename : Warning<"'/U%0' treated as the '/U' option">, InGroup>; def note_use_dashdash : Note< @@ -472,7 +492,8 @@ def err_drv_ropi_incompatible_with_cxx : Error< "ROPI is not compatible with c++">; def err_stack_tagging_requires_hardware_feature : Error< - "'-fsanitize=memtag' requires hardware support (+memtag)">; + "'-fsanitize=memtag-stack' requires hardware support (+memtag). For Armv8 or " + "Armv9, try compiling with -march=armv8a+memtag or -march=armv9a+memtag">; def err_cmse_pi_are_incompatible : Error< "cmse is not compatible with %select{RWPI|ROPI}0">; @@ -523,15 +544,14 @@ def warn_drv_unable_to_find_directory_expected : Warning< "unable to find %0 directory, expected to be in '%1'">, InGroup, DefaultIgnore; -def warn_drv_ps4_force_pic : Warning< - "option '%0' was ignored by the PS4 toolchain, using '-fPIC'">, +def warn_drv_ps_force_pic : Warning< + "option '%0' was ignored by the %1 toolchain, using '-fPIC'">, InGroup; -def warn_drv_ps4_sdk_dir : Warning< - "environment variable SCE_ORBIS_SDK_DIR is set, but points to invalid or nonexistent directory '%0'">, +def warn_drv_ps_sdk_dir : Warning< + "environment variable '%0' is set, but points to invalid or nonexistent directory '%1'">, InGroup; -def err_drv_unsupported_linker : Error<"unsupported value '%0' for -linker option">; def err_drv_defsym_invalid_format : Error<"defsym must be of the form: sym=value: %0">; def err_drv_defsym_invalid_symval : Error<"value is not an integer: %0">; def warn_drv_msvc_not_found : Warning< @@ -633,4 +653,31 @@ def err_drv_invalid_or_unsupported_offload_target : Error< "invalid or unsupported offload target: '%0'">; def err_drv_cuda_offload_only_emit_bc : Error< "CUDA offload target is supported only along with --emit-llvm">; + +def warn_drv_jmc_requires_debuginfo : Warning< + "%0 requires debug info. Use %1 or debug options that enable debugger's " + "stepping function; option ignored">, + InGroup; + +def warn_drv_fjmc_for_elf_only : Warning< + "-fjmc works only for ELF; option ignored">, + InGroup; + +def err_drv_target_variant_invalid : Error< + "unsupported '%0' value '%1'; use 'ios-macabi' instead">; + +def err_drv_invalid_directx_shader_module : Error< + "invalid profile : %0">; +def err_drv_dxc_missing_target_profile : Error< + "target profile option (-T) is missing">; + +def err_drv_invalid_range_dxil_validator_version : Error< + "invalid validator version : %0\n" + "Validator version must be less than or equal to current internal version.">; +def err_drv_invalid_format_dxil_validator_version : Error< + "invalid validator version : %0\n" + "Format of validator version is \".\" (ex:\"1.4\").">; +def err_drv_invalid_empty_dxil_validator_version : Error< + "invalid validator version : %0\n" + "If validator major version is 0, minor version must also be 0.">; } diff --git a/clang/include/clang/Basic/DiagnosticFrontendKinds.td b/clang/include/clang/Basic/DiagnosticFrontendKinds.td index eacb7e4de0ea..50f7e2b9221d 100644 --- a/clang/include/clang/Basic/DiagnosticFrontendKinds.td +++ b/clang/include/clang/Basic/DiagnosticFrontendKinds.td @@ -48,6 +48,10 @@ def warn_fe_backend_unsupported_fp_exceptions : Warning< "overriding currently unsupported use of floating point exceptions " "on this target">, InGroup; +def err_incompatible_fp_eval_method_options : Error< + "option 'ffp-eval-method' cannot be used with option " + "%select{'fapprox-func'|'mreassociate'|'freciprocal'}0">; + def remark_fe_backend_optimization_remark : Remark<"%0">, BackendInfo, InGroup; def remark_fe_backend_optimization_remark_missed : Remark<"%0">, BackendInfo, @@ -311,6 +315,11 @@ def warn_profile_data_missing : Warning< def warn_profile_data_unprofiled : Warning< "no profile data available for file \"%0\"">, InGroup; +def warn_profile_data_misexpect : Warning< + "Potential performance regression from use of __builtin_expect(): " + "Annotation was correct on %0 of profiled executions.">, + BackendInfo, + InGroup; } // end of instrumentation issue category } diff --git a/clang/include/clang/Basic/DiagnosticGroups.td b/clang/include/clang/Basic/DiagnosticGroups.td index 608e16147b1c..10da02ecbf7e 100644 --- a/clang/include/clang/Basic/DiagnosticGroups.td +++ b/clang/include/clang/Basic/DiagnosticGroups.td @@ -15,6 +15,8 @@ def Implicit : DiagGroup<"implicit", [ ImplicitInt ]>; +def DeprecatedStaticAnalyzerFlag : DiagGroup<"deprecated-static-analyzer-flag">; + // Empty DiagGroups are recognized by clang but ignored. def ODR : DiagGroup<"odr">; def : DiagGroup<"abi">; @@ -58,7 +60,9 @@ def DeprecatedExperimentalCoroutine : DiagGroup<"deprecated-experimental-coroutine">; def DeprecatedCoroutine : DiagGroup<"deprecated-coroutine", [DeprecatedExperimentalCoroutine]>; -def Coroutine : DiagGroup<"coroutine", [CoroutineMissingUnhandledException, DeprecatedCoroutine]>; +def AlwaysInlineCoroutine : + DiagGroup<"always-inline-coroutine">; +def Coroutine : DiagGroup<"coroutine", [CoroutineMissingUnhandledException, DeprecatedCoroutine, AlwaysInlineCoroutine]>; def ObjCBoolConstantConversion : DiagGroup<"objc-bool-constant-conversion">; def ConstantConversion : DiagGroup<"constant-conversion", [BitFieldConstantConversion, @@ -442,10 +446,13 @@ def InlineNamespaceReopenedNoninline def InvalidNoreturn : DiagGroup<"invalid-noreturn">; def InvalidSourceEncoding : DiagGroup<"invalid-source-encoding">; def KNRPromotedParameter : DiagGroup<"knr-promoted-parameter">; +def DeprecatedNonPrototype : DiagGroup<"deprecated-non-prototype">; +def StrictPrototypes : DiagGroup<"strict-prototypes", [DeprecatedNonPrototype]>; def : DiagGroup<"init-self">; def : DiagGroup<"inline">; def : DiagGroup<"invalid-pch">; def GNULabelsAsValue : DiagGroup<"gnu-label-as-value">; +def GNULineMarker : DiagGroup<"gnu-line-marker">; def LiteralRange : DiagGroup<"literal-range">; def LocalTypeTemplateArgs : DiagGroup<"local-type-template-args", [CXX98CompatLocalTypeTemplateArgs]>; @@ -500,7 +507,9 @@ def NonPODVarargs : DiagGroup<"non-pod-varargs">; def ClassVarargs : DiagGroup<"class-varargs", [NonPODVarargs]>; def : DiagGroup<"nonportable-cfstrings">; def NonVirtualDtor : DiagGroup<"non-virtual-dtor">; -def NullPointerArithmetic : DiagGroup<"null-pointer-arithmetic">; +def GNUNullPointerArithmetic : DiagGroup<"gnu-null-pointer-arithmetic">; +def NullPointerArithmetic + : DiagGroup<"null-pointer-arithmetic", [GNUNullPointerArithmetic]>; def NullPointerSubtraction : DiagGroup<"null-pointer-subtraction">; def : DiagGroup<"effc++", [NonVirtualDtor]>; def OveralignedType : DiagGroup<"over-aligned">; @@ -548,7 +557,9 @@ def UnalignedAccess : DiagGroup<"unaligned-access">; def PessimizingMove : DiagGroup<"pessimizing-move">; def ReturnStdMove : DiagGroup<"return-std-move">; -def PointerArith : DiagGroup<"pointer-arith">; +def GNUPointerArith : DiagGroup<"gnu-pointer-arith">; +def PointerArith : DiagGroup<"pointer-arith", [GNUPointerArith]>; + def PoundWarning : DiagGroup<"#warnings">; def PoundPragmaMessage : DiagGroup<"#pragma-messages">, DiagCategory<"#pragma message Directive">; @@ -602,7 +613,12 @@ def StaticInInline : DiagGroup<"static-in-inline">; def StaticLocalInInline : DiagGroup<"static-local-in-inline">; def GNUStaticFloatInit : DiagGroup<"gnu-static-float-init">; def StaticFloatInit : DiagGroup<"static-float-init", [GNUStaticFloatInit]>; -def GNUStatementExpression : DiagGroup<"gnu-statement-expression">; +// Allow differentiation between GNU statement expressions in a macro versus +// written directly in source. +def GNUStatementExpressionFromMacroExpansion : + DiagGroup<"gnu-statement-expression-from-macro-expansion">; +def GNUStatementExpression : DiagGroup<"gnu-statement-expression", + [GNUStatementExpressionFromMacroExpansion]>; def StringConcatation : DiagGroup<"string-concatenation">; def StringCompare : DiagGroup<"string-compare">; def StringPlusInt : DiagGroup<"string-plus-int">; @@ -835,9 +851,11 @@ def ReservedIdentifier : DiagGroup<"reserved-identifier", // def UnreachableCodeLoopIncrement : DiagGroup<"unreachable-code-loop-increment">; def UnreachableCodeFallthrough : DiagGroup<"unreachable-code-fallthrough">; +def UnreachableCodeGenericAssoc : DiagGroup<"unreachable-code-generic-assoc">; def UnreachableCode : DiagGroup<"unreachable-code", [UnreachableCodeLoopIncrement, - UnreachableCodeFallthrough]>; + UnreachableCodeFallthrough, + UnreachableCodeGenericAssoc]>; def UnreachableCodeBreak : DiagGroup<"unreachable-code-break">; def UnreachableCodeReturn : DiagGroup<"unreachable-code-return">; def UnreachableCodeAggressive : DiagGroup<"unreachable-code-aggressive", @@ -1103,12 +1121,13 @@ def GNU : DiagGroup<"gnu", [GNUAlignofExpression, GNUAnonymousStruct, VLAExtension, GNUFlexibleArrayInitializer, GNUFlexibleArrayUnionMember, GNUFoldingConstant, GNUImaginaryConstant, GNUIncludeNext, - GNULabelsAsValue, - RedeclaredClassMember, GNURedeclaredEnum, - GNUStatementExpression, GNUStaticFloatInit, - GNUStringLiteralOperatorTemplate, - GNUUnionCast, GNUVariableSizedTypeNotAtEnd, - ZeroLengthArray, GNUZeroLineDirective, + GNULabelsAsValue, GNULineMarker, GNUNullPointerArithmetic, + GNUPointerArith, RedeclaredClassMember, + GNURedeclaredEnum, GNUStatementExpression, + GNUStaticFloatInit, + GNUStringLiteralOperatorTemplate, GNUUnionCast, + GNUVariableSizedTypeNotAtEnd, ZeroLengthArray, + GNUZeroLineDirective, GNUZeroVariadicMacroArguments]>; // A warning group for warnings about code that clang accepts but gcc doesn't. def GccCompat : DiagGroup<"gcc-compat">; @@ -1247,6 +1266,7 @@ def BackendWarningAttributes : DiagGroup<"attribute-warning">; def ProfileInstrMissing : DiagGroup<"profile-instr-missing">; def ProfileInstrOutOfDate : DiagGroup<"profile-instr-out-of-date">; def ProfileInstrUnprofiled : DiagGroup<"profile-instr-unprofiled">; +def MisExpect : DiagGroup<"misexpect">; // AddressSanitizer frontend instrumentation remarks. def SanitizeAddressRemarks : DiagGroup<"sanitize-address">; @@ -1352,3 +1372,6 @@ def PedanticMacros : DiagGroup<"pedantic-macros", def BranchProtection : DiagGroup<"branch-protection">; +// HLSL diagnostic groups +// Warnings for HLSL Clang extensions +def HLSLExtension : DiagGroup<"hlsl-extensions">; diff --git a/clang/include/clang/Basic/DiagnosticIDs.h b/clang/include/clang/Basic/DiagnosticIDs.h index ba5f5acc8ce6..709d5e1dc80d 100644 --- a/clang/include/clang/Basic/DiagnosticIDs.h +++ b/clang/include/clang/Basic/DiagnosticIDs.h @@ -34,7 +34,7 @@ namespace clang { DIAG_SIZE_FRONTEND = 150, DIAG_SIZE_SERIALIZATION = 120, DIAG_SIZE_LEX = 400, - DIAG_SIZE_PARSE = 600, + DIAG_SIZE_PARSE = 700, DIAG_SIZE_AST = 250, DIAG_SIZE_COMMENT = 100, DIAG_SIZE_CROSSTU = 100, @@ -231,6 +231,17 @@ public: /// "deprecated-declarations". static StringRef getWarningOptionForGroup(diag::Group); + /// Given a diagnostic group ID, return its documentation. + static StringRef getWarningOptionDocumentation(diag::Group GroupID); + + /// Given a group ID, returns the flag that toggles the group. + /// For example, for "deprecated-declarations", returns + /// Group::DeprecatedDeclarations. + static llvm::Optional getGroupForWarningOption(StringRef); + + /// Return the lowest-level group that contains the specified diagnostic. + static llvm::Optional getGroupForDiag(unsigned DiagID); + /// Return the lowest-level warning option that enables the specified /// diagnostic. /// diff --git a/clang/include/clang/Basic/DiagnosticLexKinds.td b/clang/include/clang/Basic/DiagnosticLexKinds.td index a4436208799f..ac86076140c5 100644 --- a/clang/include/clang/Basic/DiagnosticLexKinds.td +++ b/clang/include/clang/Basic/DiagnosticLexKinds.td @@ -128,7 +128,7 @@ def warn_utf8_symbol_zero_width : Warning< "some environments">, InGroup>; def ext_delimited_escape_sequence : Extension< - "delimited escape sequences are a Clang extension">, + "%select{delimited|named}0 escape sequences are a Clang extension">, InGroup>; def err_delimited_escape_empty : Error< "delimited escape sequence cannot be empty">; @@ -138,6 +138,13 @@ def err_delimited_escape_invalid : Error< "invalid digit '%0' in escape sequence">; def err_hex_escape_no_digits : Error< "\\%0 used with no following hex digits">; +def err_invalid_ucn_name : Error< + "'%0' is not a valid Unicode character name">; +def note_invalid_ucn_name_loose_matching : Note< + "characters names in Unicode escape sequences are sensitive to case and whitespaces">; +def note_invalid_ucn_name_candidate : Note< + "did you mean %0 ('%2' U+%1)?">; + def warn_ucn_escape_no_digits : Warning< "\\%0 used with no following hex digits; " "treating as '\\' followed by identifier">, InGroup; @@ -145,10 +152,10 @@ def err_ucn_escape_incomplete : Error< "incomplete universal character name">; def warn_delimited_ucn_incomplete : Warning< "incomplete delimited universal character name; " - "treating as '\\' 'u' '{' identifier">, InGroup; + "treating as '\\' '%0' '{' identifier">, InGroup; def warn_delimited_ucn_empty : Warning< "empty delimited universal character name; " - "treating as '\\' 'u' '{' '}'">, InGroup; + "treating as '\\' '%0' '{' '}'">, InGroup; def warn_ucn_escape_incomplete : Warning< "incomplete universal character name; " "treating as '\\' followed by identifier">, InGroup; @@ -315,11 +322,9 @@ def pp_pragma_sysheader_in_main_file : Warning< "#pragma system_header ignored in main file">, InGroup>; -def err_pragma_include_instead_not_sysheader : Error< - "'#pragma clang include_instead' cannot be used outside of system headers">; -def err_pragma_include_instead_system_reserved : Error< - "header '%0' is an implementation detail; #include %select{'%2'|either '%2' " - "or '%3'|one of %2}1 instead">; +def err_illegal_use_of_flt_eval_macro : Error< + "'__FLT_EVAL_METHOD__' cannot be expanded inside a scope containing " + "'#pragma clang fp eval_method'">; def pp_poisoning_existing_macro : Warning<"poisoning existing macro">; def pp_out_of_date_dependency : Warning< @@ -429,7 +434,13 @@ def note_macro_expansion_here : Note<"expansion of macro %0 requested here">; def ext_pp_opencl_variadic_macros : Extension< "variadic macros are a Clang extension in OpenCL">; -def err_pp_invalid_directive : Error<"invalid preprocessing directive">; +def ext_pp_gnu_line_directive : Extension< + "this style of line directive is a GNU extension">, + InGroup; +def err_pp_invalid_directive : Error< + "invalid preprocessing directive%select{|, did you mean '#%1'?}0">; +def warn_pp_invalid_directive : Warning< + err_pp_invalid_directive.Text>, InGroup>; def err_pp_directive_required : Error< "%0 must be used within a preprocessing directive">; def err_pp_file_not_found : Error<"'%0' file not found">, DefaultFatal; @@ -696,6 +707,23 @@ def warn_cxx98_compat_pp_line_too_big : Warning< "#line number greater than 32767 is incompatible with C++98">, InGroup, DefaultIgnore; +def warn_c2x_compat_pp_directive : Warning< + "use of a '#%select{|elifdef|elifndef}0' directive " + "is incompatible with C standards before C2x">, + InGroup, DefaultIgnore; +def ext_c2x_pp_directive : ExtWarn< + "use of a '#%select{|elifdef|elifndef}0' directive " + "is a C2x extension">, + InGroup; +def warn_cxx2b_compat_pp_directive : Warning< + "use of a '#%select{|elifdef|elifndef}0' directive " + "is incompatible with C++ standards before C++2b">, + InGroup, DefaultIgnore; +def ext_cxx2b_pp_directive : ExtWarn< + "use of a '#%select{|elifdef|elifndef}0' directive " + "is a C++2b extension">, + InGroup; + def err_pp_visibility_non_macro : Error<"no macro named %0">; def err_pp_arc_cf_code_audited_syntax : Error<"expected 'begin' or 'end'">; @@ -878,11 +906,11 @@ def err_pp_eof_in_assume_nonnull : Error< } -let CategoryName = "Dependency Directive Source Minimization Issue" in { +let CategoryName = "Dependency Directive Source Scanner Issue" in { -def err_dep_source_minimizer_missing_sema_after_at_import : Error< +def err_dep_source_scanner_missing_semi_after_at_import : Error< "could not find ';' after @import">; -def err_dep_source_minimizer_unexpected_tokens_at_import : Error< +def err_dep_source_scanner_unexpected_tokens_at_import : Error< "unexpected extra tokens at end of @import declaration">; } diff --git a/clang/include/clang/Basic/DiagnosticParseKinds.td b/clang/include/clang/Basic/DiagnosticParseKinds.td index 770ddb3ab16f..352a050ba5cf 100644 --- a/clang/include/clang/Basic/DiagnosticParseKinds.td +++ b/clang/include/clang/Basic/DiagnosticParseKinds.td @@ -174,6 +174,9 @@ def err_stmtexpr_file_scope : Error< "statement expression not allowed at file scope">; def ext_gnu_statement_expr : Extension< "use of GNU statement expression extension">, InGroup; +def ext_gnu_statement_expr_macro : Extension< + "use of GNU statement expression extension from macro expansion">, + InGroup; def ext_gnu_conditional_expr : Extension< "use of GNU ?: conditional expression extension, omitting middle operand">, InGroup; def ext_gnu_empty_initializer : Extension< @@ -719,6 +722,8 @@ def err_attributes_misplaced : Error<"misplaced attributes; expected attributes def err_l_square_l_square_not_attribute : Error< "C++11 only allows consecutive left square brackets when " "introducing an attribute">; +def err_attribute_argument_parm_pack_not_supported : Error< + "attribute %0 does not support argument pack expansion">; def err_ms_declspec_type : Error< "__declspec attributes must be an identifier or string literal">; def err_ms_property_no_getter_or_putter : Error< @@ -1164,10 +1169,6 @@ def warn_pragma_pack_malformed : Warning< def warn_pragma_intrinsic_builtin : Warning< "%0 is not a recognized builtin%select{|; consider including to access non-builtin intrinsics}1">, InGroup; -// - #pragma optimize -def warn_pragma_optimize : Warning< - "'#pragma optimize' is not supported">, - InGroup; // - #pragma unused def warn_pragma_unused_expected_var : Warning< "expected '#pragma unused' argument to be a variable name">, @@ -1235,8 +1236,6 @@ def err_pragma_attribute_extra_tokens_after_attribute : Error< "extra tokens after attribute in a '#pragma clang attribute push'">; def err_pragma_attribute_unsupported_attribute : Error< "attribute %0 is not supported by '#pragma clang attribute'">; -def err_pragma_attribute_multiple_attributes : Error< - "more than one attribute specified in '#pragma clang attribute push'">; def err_pragma_attribute_expected_attribute_syntax : Error< "expected an attribute that is specified using the GNU, C++11 or '__declspec'" " syntax">; @@ -1265,6 +1264,9 @@ def err_pragma_attribute_namespace_on_attribute : Error< def note_pragma_attribute_namespace_on_attribute : Note< "omit the namespace to add attributes to the most-recently" " pushed attribute group">; +def warn_no_support_for_eval_method_source_on_m32 : Warning< + "Setting the floating point evaluation method to `source` on a target" + " without SSE is not supported.">, InGroup; // OpenCL EXTENSION pragma (OpenCL 1.1 [9.1]) def warn_pragma_expected_colon : Warning< @@ -1272,7 +1274,7 @@ def warn_pragma_expected_colon : Warning< def warn_pragma_expected_predicate : Warning< "expected %select{'enable', 'disable', 'begin' or 'end'|'disable'}0 - ignoring">, InGroup; def warn_pragma_unknown_extension : Warning< - "unknown OpenCL extension %0 - ignoring">, InGroup; + "OpenCL extension %0 unknown or does not require pragma - ignoring">, InGroup; def warn_pragma_unsupported_extension : Warning< "unsupported OpenCL extension %0 - ignoring">, InGroup; def warn_pragma_extension_is_core : Warning< @@ -1461,6 +1463,12 @@ def warn_omp51_compat_attributes : Warning< def err_omp_expected_colon : Error<"missing ':' in %0">; def err_omp_expected_context_selector : Error<"expected valid context selector in %0">; +def err_omp_requires_out_inout_depend_type : Error< + "reserved locator 'omp_all_memory' requires 'out' or 'inout' " + "dependency types">; +def warn_omp_more_one_omp_all_memory : Warning< + "reserved locator 'omp_all_memory' cannot be specified more than once">, + InGroup; // Pragma loop support. def err_pragma_loop_missing_argument : Error< @@ -1484,7 +1492,8 @@ def err_pragma_fp_invalid_argument : Error< "%select{" "'fast' or 'on' or 'off'|" "'on' or 'off'|" - "'ignore', 'maytrap' or 'strict'}2">; + "'ignore', 'maytrap' or 'strict'|" + "'source', 'double' or 'extended'}2">; def err_pragma_invalid_keyword : Error< "invalid argument; expected 'enable'%select{|, 'full'}0%select{|, 'assume_safety'}1 or 'disable'">; @@ -1536,7 +1545,13 @@ def err_private_module_fragment_expected_semi : Error< "expected ';' after private module fragment declaration">; def err_missing_before_module_end : Error<"expected %0 at end of module">; def err_unsupported_module_partition : Error< - "sorry, module partitions are not yet supported">; + "module partitions are only supported for C++20 onwards">; +def err_import_not_allowed_here : Error< + "imports must immediately follow the module declaration">; +def err_partition_import_outside_module : Error< + "module partition imports must be within a module purview">; +def err_import_in_wrong_fragment : Error< + "module%select{| partition}0 imports cannot be in the %select{global|private}1 module fragment">; def err_export_empty : Error<"export declaration cannot be empty">; } @@ -1584,4 +1599,13 @@ def warn_max_tokens_total : Warning< def note_max_tokens_total_override : Note<"total token limit set here">; +// HLSL Parser Diagnostics + +def err_expected_semantic_identifier : Error< + "expected HLSL Semantic identifier">; +def err_unknown_hlsl_semantic : Error<"unknown HLSL semantic %0">; +def ext_hlsl_access_specifiers : ExtWarn< + "access specifiers are a clang HLSL extension">, + InGroup; + } // end of Parser diagnostics diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td index a8cf00c1263f..bc7aec3803e8 100644 --- a/clang/include/clang/Basic/DiagnosticSemaKinds.td +++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td @@ -118,6 +118,10 @@ def warn_float_overflow : Warning< def warn_float_underflow : Warning< "magnitude of floating-point constant too small for type %0; minimum is %1">, InGroup; +def warn_float_compare_literal : Warning< + "floating-point comparison is always %select{true|false}0; " + "constant cannot be represented exactly in type %1">, + InGroup; def warn_double_const_requires_fp64 : Warning< "double precision constant requires %select{cl_khr_fp64|cl_khr_fp64 and __opencl_c_fp64}0, " "casting to single precision">; @@ -413,9 +417,9 @@ def warn_return_value_udt_incomplete: Warning< def warn_implicit_function_decl : Warning< "implicit declaration of function %0">, InGroup, DefaultIgnore; -def ext_implicit_function_decl : ExtWarn< - "implicit declaration of function %0 is invalid in C99">, - InGroup; +def ext_implicit_function_decl_c99 : ExtWarn< + "call to undeclared function %0; ISO C99 and later do not support implicit " + "function declarations">, InGroup, DefaultError; def note_function_suggestion : Note<"did you mean %0?">; def err_ellipsis_first_param : Error< @@ -556,9 +560,6 @@ def err_using_decl_can_not_refer_to_class_member : Error< def warn_cxx17_compat_using_decl_class_member_enumerator : Warning< "member using declaration naming a non-member enumerator is incompatible " "with C++ standards before C++20">, InGroup, DefaultIgnore; -def ext_using_decl_class_member_enumerator : ExtWarn< - "member using declaration naming a non-member enumerator is " - "a C++20 extension">, InGroup; def err_using_enum_is_dependent : Error< "using-enum cannot name a dependent type">; def err_ambiguous_inherited_constructor : Error< @@ -692,11 +693,19 @@ def warn_unreachable_fallthrough_attr : Warning< InGroup, DefaultIgnore; def note_unreachable_silence : Note< "silence by adding parentheses to mark code as explicitly dead">; +def warn_unreachable_association : Warning< + "due to lvalue conversion of the controlling expression, association of type " + "%0 will never be selected because it is %select{of array type|qualified}1">, + InGroup; /// Built-in functions. def ext_implicit_lib_function_decl : ExtWarn< "implicitly declaring library function '%0' with type %1">, InGroup; +def ext_implicit_lib_function_decl_c99 : ExtWarn< + "call to undeclared library function '%0' with type %1; ISO C99 and later " + "do not support implicit function declarations">, + InGroup, DefaultError; def note_include_header_or_declare : Note< "include the header <%0> or explicitly provide a declaration for '%1'">; def note_previous_builtin_declaration : Note<"%0 is a builtin with type %1">; @@ -979,6 +988,13 @@ def err_invalid_super_scope : Error<"invalid use of '__super', " def err_super_in_lambda_unsupported : Error< "use of '__super' inside a lambda is unsupported">; +def err_pragma_expected_file_scope : Error< + "'#pragma %0' can only appear at file scope">; +def err_pragma_alloc_text_c_linkage: Error< + "'#pragma alloc_text' is applicable only to functions with C linkage">; +def err_pragma_alloc_text_not_function: Error< + "'#pragma alloc_text' is applicable only to functions">; + def warn_pragma_unused_undeclared_var : Warning< "undeclared variable %0 used as an argument for '#pragma unused'">, InGroup; @@ -1513,9 +1529,9 @@ def err_static_assert_expression_is_not_constant : Error< "static_assert expression is not an integral constant expression">; def err_constexpr_if_condition_expression_is_not_constant : Error< "constexpr if condition is not a constant expression">; -def err_static_assert_failed : Error<"static_assert failed%select{ %1|}0">; +def err_static_assert_failed : Error<"static_assert failed%select{: %1|}0">; def err_static_assert_requirement_failed : Error< - "static_assert failed due to requirement '%0'%select{ %2|}1">; + "static_assert failed due to requirement '%0'%select{: %2|}1">; def warn_consteval_if_always_true : Warning< "consteval if is always true in an %select{unevaluated|immediate}0 context">, @@ -1696,8 +1712,6 @@ def err_missing_exception_specification : Error< def ext_missing_exception_specification : ExtWarn< err_missing_exception_specification.Text>, InGroup>; -def err_noexcept_needs_constant_expression : Error< - "argument to noexcept specifier must be a constant expression">; def err_exception_spec_not_parsed : Error< "exception specification is not available until end of class definition">; def err_exception_spec_cycle : Error< @@ -2325,13 +2339,23 @@ def ext_auto_new_list_init : Extension< "type %0 to use list-initialization">, InGroup; def err_auto_var_init_no_expression : Error< "initializer for variable %0 with type %1 is empty">; +def err_auto_expr_init_no_expression : Error< + "initializer for functional-style cast to %0 is empty">; def err_auto_var_init_multiple_expressions : Error< "initializer for variable %0 with type %1 contains multiple expressions">; +def err_auto_expr_init_multiple_expressions : Error< + "initializer for functional-style cast to %0 contains multiple expressions">; def err_auto_var_init_paren_braces : Error< "cannot deduce type for variable %1 with type %2 from " "%select{parenthesized|nested}0 initializer list">; def err_auto_new_ctor_multiple_expressions : Error< "new expression for type %0 contains multiple constructor arguments">; +def err_auto_expr_init_paren_braces : Error< + "cannot deduce actual type for %1 from " + "%select{parenthesized|nested}0 initializer list">; +def warn_cxx20_compat_auto_expr : Warning< + "'auto' as a functional-style cast is incompatible with C++ standards " + "before C++2b">, InGroup, DefaultIgnore; def err_auto_missing_trailing_return : Error< "'auto' return without trailing return type; deduced return types are a " "C++14 extension">; @@ -2345,6 +2369,8 @@ def err_auto_var_deduction_failure : Error< "variable %0 with type %1 has incompatible initializer of type %2">; def err_auto_var_deduction_failure_from_init_list : Error< "cannot deduce actual type for variable %0 with type %1 from initializer list">; +def err_auto_expr_deduction_failure : Error< + "functional-style cast to %0 has incompatible initializer of type %1">; def err_auto_new_deduction_failure : Error< "new expression for type %0 has incompatible constructor argument of type %1">; def err_auto_inconsistent_deduction : Error< @@ -2682,6 +2708,13 @@ def warn_cxx17_compat_constexpr_body_invalid_stmt : Warning< "use of this statement in a constexpr %select{function|constructor}0 " "is incompatible with C++ standards before C++20">, InGroup, DefaultIgnore; +def ext_constexpr_body_invalid_stmt_cxx2b : ExtWarn< + "use of this statement in a constexpr %select{function|constructor}0 " + "is a C++2b extension">, InGroup; +def warn_cxx20_compat_constexpr_body_invalid_stmt : Warning< + "use of this statement in a constexpr %select{function|constructor}0 " + "is incompatible with C++ standards before C++2b">, + InGroup, DefaultIgnore; def ext_constexpr_type_definition : ExtWarn< "type definition in a constexpr %select{function|constructor}0 " "is a C++14 extension">, InGroup; @@ -2699,12 +2732,18 @@ def warn_cxx11_compat_constexpr_local_var : Warning< "variable declaration in a constexpr %select{function|constructor}0 " "is incompatible with C++ standards before C++14">, InGroup, DefaultIgnore; -def err_constexpr_local_var_static : Error< - "%select{static|thread_local}1 variable not permitted in a constexpr " - "%select{function|constructor}0">; +def ext_constexpr_static_var : ExtWarn< + "definition of a %select{static|thread_local}1 variable " + "in a constexpr %select{function|constructor}0 " + "is a C++2b extension">, InGroup; +def warn_cxx20_compat_constexpr_var : Warning< + "definition of a %select{static variable|thread_local variable|variable " + "of non-literal type}1 in a constexpr %select{function|constructor}0 " + "is incompatible with C++ standards before C++2b">, + InGroup, DefaultIgnore; def err_constexpr_local_var_non_literal_type : Error< "variable of non-literal type %1 cannot be defined in a constexpr " - "%select{function|constructor}0">; + "%select{function|constructor}0 before C++2b">; def ext_constexpr_local_var_no_init : ExtWarn< "uninitialized variable in a constexpr %select{function|constructor}0 " "is a C++20 extension">, InGroup; @@ -2816,6 +2855,8 @@ def err_constrained_virtual_method : Error< "virtual function cannot have a requires clause">; def err_trailing_requires_clause_on_deduction_guide : Error< "deduction guide cannot have a requires clause">; +def err_constrained_non_templated_function + : Error<"non-templated function cannot have a requires clause">; def err_reference_to_function_with_unsatisfied_constraints : Error< "invalid reference to function %0: constraints not satisfied">; def err_requires_expr_local_parameter_default_argument : Error< @@ -2896,11 +2937,16 @@ def warn_auto_var_is_id : Warning< InGroup>; // Attributes -def warn_nomerge_attribute_ignored_in_stmt: Warning< +def warn_attribute_ignored_no_calls_in_stmt: Warning< "%0 attribute is ignored because there exists no call expression inside the " "statement">, InGroup; +def warn_function_attribute_ignored_in_stmt : Warning< + "attribute is ignored on this statement as it only applies to functions; " + "use '%0' on statements">, + InGroup; + def err_musttail_needs_trivial_args : Error< "tail call requires that the return value, all parameters, and any " "temporaries created by the expression are trivially destructible">; @@ -3010,8 +3056,9 @@ def err_aligned_attribute_argument_not_int : Error< def err_align_value_attribute_argument_not_int : Error< "'align_value' attribute requires integer constant">; def err_alignas_attribute_wrong_decl_type : Error< - "%0 attribute cannot be applied to a %select{function parameter|" - "variable with 'register' storage class|'catch' variable|bit-field}1">; + "%0 attribute cannot be applied to %select{a function parameter|" + "a variable with 'register' storage class|a 'catch' variable|a bit-field|" + "an enumeration}1">; def err_alignas_missing_on_definition : Error< "%0 must be specified on definition if it is specified on any declaration">; def note_alignas_on_declaration : Note<"declared with %0 attribute here">; @@ -3070,7 +3117,7 @@ def err_format_strftime_third_parameter : Error< "strftime format attribute requires 3rd parameter to be 0">; def err_format_attribute_requires_variadic : Error< "format attribute requires variadic function">; -def err_format_attribute_not : Error<"format argument not %0">; +def err_format_attribute_not : Error<"format argument not a string type">; def err_format_attribute_result_not : Error<"function does not return %0">; def err_format_attribute_implicit_this_format_string : Error< "format attribute cannot specify the implicit this argument as the format " @@ -3309,8 +3356,6 @@ def warn_redeclaration_without_import_attribute : Warning< def warn_dllimport_dropped_from_inline_function : Warning< "%q0 redeclared inline; %1 attribute ignored">, InGroup; -def warn_attribute_ignored : Warning<"%0 attribute ignored">, - InGroup; def warn_nothrow_attribute_ignored : Warning<"'nothrow' attribute conflicts with" " exception specification; attribute ignored">, InGroup; @@ -3347,8 +3392,11 @@ def note_attribute_has_no_effect_on_compile_time_if_here : Note< "annotating the 'if %select{constexpr|consteval}0' statement here">; def err_decl_attribute_invalid_on_stmt : Error< "%0 attribute cannot be applied to a statement">; -def err_stmt_attribute_invalid_on_decl : Error< +def err_attribute_invalid_on_decl : Error< "%0 attribute cannot be applied to a declaration">; +def warn_type_attribute_deprecated_on_decl : Warning< + "applying attribute %0 to a declaration is deprecated; apply it to the type instead">, + InGroup; def warn_declspec_attribute_ignored : Warning< "attribute %0 is ignored, place it after " "\"%select{class|struct|interface|union|enum}1\" to apply attribute to " @@ -3524,8 +3572,6 @@ def warn_attribute_not_on_decl : Warning< "%0 attribute ignored when parsing type">, InGroup; def err_base_specifier_attribute : Error< "%0 attribute cannot be applied to a base specifier">; -def err_invalid_attribute_on_virtual_function : Error< - "%0 attribute cannot be applied to virtual functions">; def warn_declspec_allocator_nonpointer : Warning< "ignoring __declspec(allocator) because the function return type %0 is not " "a pointer or reference type">, InGroup; @@ -4027,6 +4073,9 @@ def warn_vector_mode_deprecated : Warning< "specifying vector types with the 'mode' attribute is deprecated; " "use the 'vector_size' attribute instead">, InGroup; +def warn_deprecated_noreturn_spelling : Warning< + "the '[[_Noreturn]]' attribute spelling is deprecated in C2x; use " + "'[[noreturn]]' instead">, InGroup; def err_complex_mode_vector_type : Error< "type of machine mode does not support base vector types">; def err_enum_mode_vector_type : Error< @@ -4037,6 +4086,10 @@ def warn_attribute_nonnull_no_pointers : Warning< def warn_attribute_nonnull_parm_no_args : Warning< "'nonnull' attribute when used on parameters takes no arguments">, InGroup; +def warn_function_stmt_attribute_precedence : Warning< + "statement attribute %0 has higher precedence than function attribute " + "'%select{always_inline|flatten|noinline}1'">, + InGroup; def note_declared_nonnull : Note< "declared %select{'returns_nonnull'|'nonnull'}0 here">; def warn_attribute_sentinel_named_arguments : Warning< @@ -4130,7 +4183,7 @@ def err_attribute_preferred_name_arg_invalid : Error< "argument %0 to 'preferred_name' attribute is not a typedef for " "a specialization of %1">; def err_attribute_builtin_alias : Error< - "%0 attribute can only be applied to a ARM or RISC-V builtin">; + "%0 attribute can only be applied to a ARM, HLSL or RISC-V builtin">; // called-once attribute diagnostics. def err_called_once_attribute_wrong_type : Error< @@ -4302,8 +4355,9 @@ def err_void_param_qualified : Error< "'void' as parameter must not have type qualifiers">; def err_ident_list_in_fn_declaration : Error< "a parameter list without types is only allowed in a function definition">; -def ext_param_not_declared : Extension< - "parameter %0 was not declared, defaulting to type 'int'">; +def ext_param_not_declared : ExtWarn< + "parameter %0 was not declared, defaults to 'int'; ISO C99 and later do not " + "support implicit int">, InGroup, DefaultError; def err_param_default_argument : Error< "C does not support default arguments">; def err_param_default_argument_redefinition : Error< @@ -4345,6 +4399,9 @@ def err_uninitialized_member_in_ctor : Error< def err_default_arg_makes_ctor_special : Error< "addition of default argument on redeclaration makes this constructor a " "%select{default|copy|move}0 constructor">; +def err_stmt_expr_in_default_arg : Error< + "default %select{argument|non-type template argument}0 may not use a GNU " + "statement expression">; def err_use_of_default_argument_to_function_declared_later : Error< "use of default argument to function %0 that is declared later in class %1">; @@ -4661,11 +4718,17 @@ def err_bound_member_function : Error< "reference to non-static member function must be called" "%select{|; did you mean to call it with no arguments?}0">; def note_possible_target_of_call : Note<"possible target for call">; +def err_no_viable_destructor : Error< + "no viable destructor found for class %0">; +def err_ambiguous_destructor : Error< + "destructor of class %0 is ambiguous">; def err_ovl_no_viable_object_call : Error< "no matching function for call to object of type %0">; def err_ovl_ambiguous_object_call : Error< "call to object of type %0 is ambiguous">; +def err_ovl_ambiguous_subscript_call : Error< + "call to subscript operator of type %0 is ambiguous">; def err_ovl_deleted_object_call : Error< "call to deleted function call operator in type %0">; def note_ovl_surrogate_cand : Note<"conversion candidate of type %0">; @@ -4792,6 +4855,7 @@ def warn_cxx11_compat_variable_template : Warning< def err_template_variable_noparams : Error< "extraneous 'template<>' in declaration of variable %0">; def err_template_member : Error<"member %0 declared as a template">; +def err_member_with_template_arguments : Error<"member %0 cannot have template arguments">; def err_template_member_noparams : Error< "extraneous 'template<>' in declaration of member %0">; def err_template_tag_noparams : Error< @@ -4806,6 +4870,9 @@ def ext_adl_only_template_id : ExtWarn< "use of function template name with no prior declaration in function call " "with explicit template arguments is a C++20 extension">, InGroup; +def warn_unqualified_call_to_std_cast_function : Warning< + "unqualified call to '%0'">, InGroup>; + // C++ Template Argument Lists def err_template_missing_args : Error< "use of " @@ -4971,8 +5038,6 @@ def err_template_spec_unknown_kind : Error< "class template">; def note_specialized_entity : Note< "explicitly specialized declaration is here">; -def note_explicit_specialization_declared_here : Note< - "explicit specialization declared here">; def err_template_spec_decl_function_scope : Error< "explicit specialization of %0 in function scope">; def err_template_spec_decl_friend : Error< @@ -5081,8 +5146,6 @@ def err_partial_spec_ordering_ambiguous : Error< def note_partial_spec_match : Note<"partial specialization matches %0">; def err_partial_spec_redeclared : Error< "class template partial specialization %0 cannot be redeclared">; -def note_partial_specialization_declared_here : Note< - "explicit specialization declared here">; def note_prev_partial_spec_here : Note< "previous declaration of class template partial specialization %0 is here">; def err_partial_spec_fully_specialized : Error< @@ -5464,6 +5527,9 @@ def err_found_later_in_class : Error<"member %0 used before its declaration">; def ext_found_later_in_class : ExtWarn< "use of member %0 before its declaration is a Microsoft extension">, InGroup; +def ext_unqualified_base_class : ExtWarn< + "unqualified base initializer of class templates is a Microsoft extension">, + InGroup; def note_dependent_member_use : Note< "must qualify identifier to find this declaration in dependent base class">; def err_not_found_by_two_phase_lookup : Error<"call to function %0 that is neither " @@ -5514,16 +5580,28 @@ def warn_missing_sentinel : Warning < InGroup; def note_sentinel_here : Note< "%select{function|method|block}0 has been explicitly marked sentinel here">; +def warn_strict_uses_without_prototype : Warning< + "passing arguments to %select{a function|%1}0 without a prototype is " + "deprecated in all versions of C and is not supported in C2x">, + InGroup; def warn_missing_prototype : Warning< "no previous prototype for function %0">, InGroup>, DefaultIgnore; def note_declaration_not_a_prototype : Note< "this declaration is not a prototype; add %select{'void'|parameter declarations}0 " "to make it %select{a prototype for a zero-parameter function|one}0">; -def warn_strict_prototypes : Warning< - "this %select{function declaration is not|block declaration is not|" - "old-style function definition is not preceded by}0 a prototype">, - InGroup>, DefaultIgnore; +// This is not actually an extension, but we only want it to be enabled in +// -pedantic mode and this is the most direct way of accomplishing that. +def warn_strict_prototypes : Extension< + "a %select{function|block}0 declaration without a prototype is deprecated " + "%select{in all versions of C|}0">, InGroup; +def warn_non_prototype_changes_behavior : Warning< + "a function %select{declaration|definition}0 without a prototype is " + "deprecated in all versions of C %select{and is not supported in C2x|and is " + "treated as a zero-parameter prototype in C2x, conflicting with a " + "%select{previous|subsequent}2 %select{declaration|definition}3}1">, + InGroup; +def note_conflicting_prototype : Note<"conflicting prototype is here">; def warn_missing_variable_declarations : Warning< "no previous extern declaration for non-static variable %0">, InGroup>, DefaultIgnore; @@ -6402,6 +6480,9 @@ def err_atomic_specifier_bad_type "%select{incomplete |array |function |reference |atomic |qualified " "|sizeless ||integer }0type " "%1 %select{|||||||which is not trivially copyable|}0">; +def warn_atomic_member_access : Warning< + "accessing a member of an atomic structure or union is undefined behavior">, + InGroup>, DefaultError; // Expressions. def ext_sizeof_alignof_function_type : Extension< @@ -6440,9 +6521,9 @@ def warn_sub_ptr_zero_size_types : Warning< def warn_pointer_arith_null_ptr : Warning< "performing pointer arithmetic on a null pointer has undefined behavior%select{| if the offset is nonzero}0">, InGroup, DefaultIgnore; -def warn_gnu_null_ptr_arith : Warning< +def warn_gnu_null_ptr_arith : Extension< "arithmetic on a null pointer treated as a cast from integer to pointer is a GNU extension">, - InGroup, DefaultIgnore; + InGroup; def warn_pointer_sub_null_ptr : Warning< "performing pointer subtraction with a null pointer %select{has|may have}0 undefined behavior">, InGroup, DefaultIgnore; @@ -6451,6 +6532,10 @@ def warn_floatingpoint_eq : Warning< "comparing floating point with == or != is unsafe">, InGroup>, DefaultIgnore; +def err_setting_eval_method_used_in_unsafe_context : Error < + "%select{'#pragma clang fp eval_method'|option 'ffp-eval-method'}0 cannot be used with " + "%select{option 'fapprox-func'|option 'mreassociate'|option 'freciprocal'|option 'ffp-eval-method'|'#pragma clang fp reassociate'}1">; + def warn_remainder_division_by_zero : Warning< "%select{remainder|division}0 by zero is undefined">, InGroup; @@ -6529,6 +6614,15 @@ def warn_self_move : Warning< "explicitly moving variable of type %0 to itself">, InGroup, DefaultIgnore; +def err_builtin_move_forward_unsupported : Error< + "unsupported signature for %q0">; +def err_use_of_unaddressable_function : Error< + "taking address of non-addressable standard library function">; +// FIXME: This should also be in -Wc++23-compat once we have it. +def warn_cxx20_compat_use_of_unaddressable_function : Warning< + "taking address of non-addressable standard library function " + "is incompatible with C++20">, InGroup; + def warn_redundant_move_on_return : Warning< "redundant move in return statement">, InGroup, DefaultIgnore; @@ -6571,7 +6665,8 @@ def err_arithmetic_nonfragile_interface : Error< "this architecture and platform">; def warn_deprecated_comma_subscript : Warning< - "top-level comma expression in array subscript is deprecated">, + "top-level comma expression in array subscript is deprecated " + "in C++20 and unsupported in C++2b">, InGroup; def ext_subscript_non_lvalue : Extension< @@ -6584,10 +6679,13 @@ def err_subscript_function_type : Error< "subscript of pointer to function type %0">; def err_subscript_incomplete_or_sizeless_type : Error< "subscript of pointer to %select{incomplete|sizeless}0 type %1">; +def err_subscript_svbool_t : Error< + "subscript of svbool_t is not allowed">; def err_dereference_incomplete_type : Error< "dereference of pointer to incomplete type %0">; def ext_gnu_subscript_void_type : Extension< - "subscript of a pointer to void is a GNU extension">, InGroup; + "subscript of a pointer to void is a GNU extension">, + InGroup; def err_typecheck_member_reference_struct_union : Error< "member reference base type %0 is not a structure or union">; def err_typecheck_member_reference_ivar : Error< @@ -7108,11 +7206,11 @@ def err_duplicate_property : Error< "property has a previous declaration">; def ext_gnu_void_ptr : Extension< "arithmetic on%select{ a|}0 pointer%select{|s}0 to void is a GNU extension">, - InGroup; + InGroup; def ext_gnu_ptr_func_arith : Extension< "arithmetic on%select{ a|}0 pointer%select{|s}0 to%select{ the|}2 function " "type%select{|s}2 %1%select{| and %3}2 is a GNU extension">, - InGroup; + InGroup; def err_readonly_message_assignment : Error< "assigning to 'readonly' return result of an Objective-C message not allowed">; def ext_integer_increment_complex : Extension< @@ -7358,8 +7456,6 @@ def err_bad_dynamic_cast_not_polymorphic : Error<"%0 is not polymorphic">; // Other C++ expressions def err_need_header_before_typeid : Error< "you need to include before using the 'typeid' operator">; -def err_need_header_before_ms_uuidof : Error< - "you need to include before using the '__uuidof' operator">; def err_need_header_before_placement_new : Error< "no matching %0 function for non-allocating placement new expression; " "include ">; @@ -7499,6 +7595,12 @@ def warn_deprecated_altivec_src_compat : Warning< "'-altivec-compat=xl' option">, InGroup>; +def warn_deprecated_lax_vec_conv_all : Warning< + "Implicit conversion between vector types ('%0' and '%1') is deprecated. " + "In the future, the behavior implied by '-fno-lax-vector-conversions' " + "will be the default.">, + InGroup>; + def err_catch_incomplete_ptr : Error< "cannot catch pointer to incomplete type %0">; def err_catch_incomplete_ref : Error< @@ -7806,8 +7908,8 @@ def err_invalid_declarator_scope : Error<"cannot define or redeclare %0 here " def err_export_non_namespace_scope_name : Error< "cannot export %0 as it is not at namespace scope">; def err_redeclaration_non_exported : Error < - "cannot export redeclaration %0 here since the previous declaration is not " - "exported">; + "cannot export redeclaration %0 here since the previous declaration " + "%select{is not exported|has internal linkage|has module linkage}1">; def err_invalid_declarator_global_scope : Error< "definition or redeclaration of %0 cannot name the global scope">; def err_invalid_declarator_in_function : Error< @@ -8395,6 +8497,12 @@ def err_overflow_builtin_must_be_ptr_int : Error< def err_overflow_builtin_bit_int_max_size : Error< "__builtin_mul_overflow does not support 'signed _BitInt' operands of more " "than %0 bits">; +def err_expected_struct_pointer_argument : Error< + "expected pointer to struct as %ordinal0 argument to %1, found %2">; +def err_expected_callable_argument : Error< + "expected a callable expression as %ordinal0 argument to %1, found %2">; +def note_building_builtin_dump_struct_call : Note< + "in call to printing function with arguments '(%0)' while dumping struct">; def err_atomic_load_store_uses_lib : Error< "atomic %select{load|store}0 requires runtime support that is not " @@ -8639,6 +8747,10 @@ def warn_unused_result : Warning< def warn_unused_result_msg : Warning< "ignoring return value of function declared with %0 attribute: %1">, InGroup; +def warn_unused_result_typedef_unsupported_spelling : Warning< + "'[[%select{nodiscard|gnu::warn_unused_result}0]]' attribute ignored when " + "applied to a typedef; consider using '__attribute__((warn_unused_result))' " + "or '[[clang::warn_unused_result]]' instead">, InGroup; def warn_unused_volatile : Warning< "expression result unused; assign into a variable to force a volatile load">, InGroup>; @@ -8746,6 +8858,8 @@ let CategoryName = "Inline Assembly Issue" in { " in asm %select{input|output}1 with a memory constraint '%2'">; def err_asm_input_duplicate_match : Error< "more than one input constraint matches the same output '%0'">; + def err_store_value_to_reg : Error< + "impossible constraint in asm: can't store value into a register">; def warn_asm_label_on_auto_decl : Warning< "ignored asm label '%0' on automatic variable">; @@ -8972,6 +9086,12 @@ def err_operator_overload_static : Error< "overloaded %0 cannot be a static member function">; def err_operator_overload_default_arg : Error< "parameter of overloaded %0 cannot have a default argument">; + +def ext_subscript_overload : ExtWarn< + "overloaded %0 with %select{no|a defaulted|more than one}1 parameter is a C++2b extension">, InGroup, DefaultIgnore; +def error_subscript_overload : Error< + "overloaded %0 cannot have %select{no|a defaulted|more than one}1 parameter before C++2b">; + def err_operator_overload_must_be : Error< "overloaded %0 must be a %select{unary|binary|unary or binary}2 operator " "(has %1 parameter%s1)">; @@ -9917,15 +10037,13 @@ def warn_receiver_forward_class : Warning< "receiver %0 is a forward class and corresponding @interface may not exist">, InGroup; def note_method_sent_forward_class : Note<"method %0 is used for the forward class">; -def ext_missing_declspec : ExtWarn< - "declaration specifier missing, defaulting to 'int'">; def ext_missing_type_specifier : ExtWarn< - "type specifier missing, defaults to 'int'">, - InGroup; + "type specifier missing, defaults to 'int'; ISO C99 and later do not support " + "implicit int">, InGroup, DefaultError; +def err_missing_type_specifier : Error< + "a type specifier is required for all declarations">; def err_decimal_unsupported : Error< "GNU decimal type extension not supported">; -def err_missing_type_specifier : Error< - "C++ requires a type specifier for all declarations">; def err_objc_array_of_interfaces : Error< "array of interface %0 is invalid (probably should be an array of pointers)">; def ext_c99_array_usage : Extension< @@ -10118,8 +10236,6 @@ def err_opencl_scalar_type_rank_greater_than_vector_type : Error< "element. (%0 and %1)">; def err_bad_kernel_param_type : Error< "%0 cannot be used as the type of a kernel parameter">; -def err_opencl_implicit_function_decl : Error< - "implicit declaration of function %0 is invalid in OpenCL">; def err_record_with_pointers_kernel_param : Error< "%select{struct|union}0 kernel parameters may not contain pointers">; def note_within_field_of_type : Note< @@ -10248,6 +10364,11 @@ def err_openclcxx_placement_new : Error< def warn_mig_server_routine_does_not_return_kern_return_t : Warning< "'mig_server_routine' attribute only applies to routines that return a kern_return_t">, InGroup; + +def warn_imp_cast_drops_unaligned : Warning< + "implicit cast from type %0 to type %1 drops __unaligned qualifier">, + InGroup>; + } // end of sema category let CategoryName = "OpenMP Issue" in { @@ -10519,6 +10640,21 @@ def err_omp_atomic_capture_not_compound_statement : Error< " where x is an lvalue expression with scalar type">; def note_omp_atomic_capture: Note< "%select{expected assignment expression|expected compound statement|expected exactly two expression statements|expected in right hand side of the first expression}0">; +def err_omp_atomic_compare : Error< + "the statement for 'atomic compare' must be a compound statement of form '{x = expr ordop x ? expr : x;}', '{x = x ordop expr? expr : x;}'," + " '{x = x == e ? d : x;}', '{x = e == x ? d : x;}', or 'if(expr ordop x) {x = expr;}', 'if(x ordop expr) {x = expr;}', 'if(x == e) {x = d;}'," + " 'if(e == x) {x = d;}' where 'x' is an lvalue expression with scalar type, 'expr', 'e', and 'd' are expressions with scalar type," + " and 'ordop' is one of '<' or '>'.">; +def err_omp_atomic_compare_capture : Error< + "the statement for 'atomic compare capture' must be a compound statement of form '{v = x; cond-up-stmt}', ''{cond-up-stmt v = x;}', '{if(x == e) {x = d;} else {v = x;}}'," + " '{r = x == e; if(r) {x = d;}}', or '{r = x == e; if(r) {x = d;} else {v = x;}}', where 'cond-update-stmt' can have one of the following forms: 'if(expr ordop x) {x = expr;}'," + " 'if(x ordop expr) {x = expr;}', 'if(x == e) {x = d;}', or 'if(e == x) {x = d;}' where 'x', 'r', and 'v' are lvalue expressions with scalar type, 'expr', 'e', and 'd' are expressions with scalar type," + " and 'ordop' is one of '<' or '>'.">; +def note_omp_atomic_compare: Note< + "%select{expected compound statement|expected exactly one expression statement|expected assignment statement|expected conditional operator|expect result value to be at false expression|" + "expect binary operator in conditional expression|expect '<', '>' or '==' as order operator|expect comparison in a form of 'x == e', 'e == x', 'x ordop expr', or 'expr ordop x'|" + "expect lvalue for result value|expect scalar value|expect integer value|unexpected 'else' statement|expect '==' operator|expect an assignment statement 'v = x'|" + "expect a 'if' statement|expect no more than two statements|expect a compound statement|expect 'else' statement|expect a form 'r = x == e; if (r) ...'}0">; def err_omp_atomic_several_clauses : Error< "directive '#pragma omp atomic' cannot contain more than one 'read', 'write', 'update', 'capture', or 'compare' clause">; def err_omp_several_mem_order_clauses : Error< @@ -10669,6 +10805,8 @@ def err_omp_expected_int_param : Error< "expected a reference to an integer-typed parameter">; def err_omp_at_least_one_motion_clause_required : Error< "expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'">; +def err_omp_cannot_update_with_internal_linkage : Error< + "the host cannot update a declare target variable that is not externally visible.">; def err_omp_usedeviceptr_not_a_pointer : Error< "expected pointer or reference to pointer in 'use_device_ptr' clause">; def err_omp_argument_type_isdeviceptr : Error < @@ -10699,6 +10837,8 @@ def err_omp_directive_before_requires : Error < "'%0' region encountered before requires directive with '%1' clause">; def note_omp_requires_encountered_directive : Note < "'%0' previously encountered here">; +def err_omp_device_ancestor_without_requires_reverse_offload : Error < + "Device clause with ancestor device-modifier used without specifying 'requires reverse_offload'">; def err_omp_invalid_scope : Error < "'#pragma omp %0' directive must appear only in file scope">; def note_omp_invalid_length_on_this_ptr_mapping : Note < @@ -10807,6 +10947,8 @@ def err_omp_interop_type_not_found : Error< def err_omp_declare_variant_incompat_types : Error< "variant in '#pragma omp declare variant' with type %0 is incompatible with" " type %1%select{| with appended arguments}2">; +def err_omp_declare_variant_same_base_function : Error< + "variant in '#pragma omp declare variant' is the same as the base function">; def warn_omp_declare_variant_marked_as_declare_variant : Warning< "variant function in '#pragma omp declare variant' is itself marked as '#pragma omp declare variant'" >, InGroup; @@ -10849,7 +10991,7 @@ def note_omp_exits_structured_block : Note<"jump exits scope of OpenMP structured block">; def err_omp_lastprivate_loop_var_non_loop_iteration : Error< "only loop iteration variables are allowed in 'lastprivate' clause in " - "'omp loop' directives">; + "'omp %0' directives">; def err_omp_interop_variable_expected : Error< "expected%select{| non-const}0 variable of type 'omp_interop_t'">; def err_omp_interop_variable_wrong_type : Error< @@ -10875,6 +11017,11 @@ def err_omp_clause_requires_dispatch_construct : Error< "'%0' clause requires 'dispatch' context selector">; def err_omp_append_args_with_varargs : Error< "'append_args' is not allowed with varargs functions">; +def err_openmp_vla_in_task_untied : Error< + "variable length arrays are not supported in OpenMP tasking regions with 'untied' clause">; +def warn_omp_unterminated_declare_target : Warning< + "expected '#pragma omp end declare target' at end of file to match '#pragma omp %0'">, + InGroup; } // end of OpenMP category let CategoryName = "Related Result Type Issue" in { @@ -10968,6 +11115,8 @@ def ext_module_import_not_at_top_level_noop : ExtWarn< def note_module_import_not_at_top_level : Note<"%0 begins here">; def err_module_self_import : Error< "import of module '%0' appears within same top-level module '%1'">; +def err_module_self_import_cxx20 : Error< + "import of module '%0' appears within its own %select{interface|implementation}1">; def err_module_import_in_implementation : Error< "@import of module '%0' in implementation of '%1'; use #import">; @@ -10986,6 +11135,8 @@ def ext_export_no_name_block : ExtWarn< def ext_export_no_names : ExtWarn< "ISO C++20 does not permit a declaration that does not introduce any names " "to be exported">, InGroup; +def introduces_no_names : Error< + "declaration does not introduce any names to be exported">; def note_export : Note<"export block begins here">; def err_export_no_name : Error< "%select{empty|static_assert|asm}0 declaration cannot be exported">; @@ -10997,10 +11148,13 @@ def err_export_within_export : Error< def err_export_internal : Error< "declaration of %0 with internal linkage cannot be exported">; def err_export_using_internal : Error< - "using declaration referring to %0 with internal linkage cannot be exported">; + "using declaration referring to %1 with %select{internal|module|unknown}0 " + "linkage cannot be exported">; def err_export_not_in_module_interface : Error< "export declaration can only be used within a module interface unit" "%select{ after the module declaration|}0">; +def err_export_partition_impl : Error< + "module partition implementations cannot be exported">; def err_export_in_private_module_fragment : Error< "export declaration cannot be used in a private module fragment">; def note_private_module_fragment : Note< @@ -11111,6 +11265,13 @@ def err_coroutine_promise_final_suspend_requires_nothrow : Error< def note_coroutine_function_declare_noexcept : Note< "must be declared with 'noexcept'" >; +def warn_always_inline_coroutine : Warning< + "this coroutine may be split into pieces; not every piece is guaranteed to be inlined" + >, + InGroup; +def err_coroutine_unusable_new : Error< + "'operator new' provided by %0 is not usable with the function signature of %1" +>; } // end of coroutines issue category let CategoryName = "Documentation Issue" in { @@ -11290,9 +11451,6 @@ def err_multiversion_disallowed_other_attr "'%select{|target|cpu_specific|cpu_dispatch|target_clones}0' " "multiversioning cannot be combined" " with attribute %1">; -def err_multiversion_mismatched_attrs - : Error<"attributes on multiversioned functions must all match, attribute " - "%0 %select{is missing|has different arguments}1">; def err_multiversion_diff : Error< "multiversioned function declaration has a different %select{calling convention" "|return type|constexpr specification|inline specification|linkage|" @@ -11478,4 +11636,28 @@ def err_riscv_builtin_requires_extension : Error< "builtin requires at least one of the following extensions support to be enabled : %0">; def err_riscv_builtin_invalid_lmul : Error< "LMUL argument must be in the range [0,3] or [5,7]">; + +def err_std_source_location_impl_not_found : Error< + "'std::source_location::__impl' was not found; it must be defined before '__builtin_source_location' is called">; +def err_std_source_location_impl_malformed : Error< + "'std::source_location::__impl' must be standard-layout and have only two 'const char *' fields '_M_file_name' and '_M_function_name', and two integral fields '_M_line' and '_M_column'">; + +// HLSL Diagnostics +def err_hlsl_attr_unsupported_in_stage : Error<"attribute %0 is unsupported in %select{Pixel|Vertex|Geometry|Hull|Domain|Compute|Library|RayGeneration|Intersection|AnyHit|ClosestHit|Miss|Callable|Mesh|Amplification|Invalid}1 shaders, requires %2">; + +def err_hlsl_numthreads_argument_oor : Error<"argument '%select{X|Y|Z}0' to numthreads attribute cannot exceed %1">; +def err_hlsl_numthreads_invalid : Error<"total number of threads cannot exceed %0">; +def err_hlsl_attribute_param_mismatch : Error<"%0 attribute parameters do not match the previous declaration">; + +def err_hlsl_pointers_unsupported : Error< + "%select{pointers|references}0 are unsupported in HLSL">; + +def err_hlsl_operator_unsupported : Error< + "the '%select{&|*|->}0' operator is unsupported in HLSL">; + +// Layout randomization diagnostics. +def err_non_designated_init_used : Error< + "a randomized struct can only be initialized with a designated initializer">; +def err_cast_from_randomized_struct : Error< + "casting from randomized structure pointer type %0 to %1">; } // end of sema component. diff --git a/clang/include/clang/Basic/DiagnosticSerializationKinds.td b/clang/include/clang/Basic/DiagnosticSerializationKinds.td index f15a935d2af1..0bd3734a4a04 100644 --- a/clang/include/clang/Basic/DiagnosticSerializationKinds.td +++ b/clang/include/clang/Basic/DiagnosticSerializationKinds.td @@ -154,16 +154,15 @@ def err_module_odr_violation_template_parameter : Error < "%select{definition in module '%2'|defined here}1 found " "%select{" "unnamed template parameter|" - "template parameter %4|" + "template parameter %5|" "template parameter with %select{no |}4default argument|" "template parameter with default argument}3">; - def note_module_odr_violation_template_parameter : Note < "but in '%0' found " "%select{" "unnamed template parameter %2|" - "template parameter %2|" + "template parameter %3|" "template parameter with %select{no |}2default argument|" "template parameter with different default argument}1">; @@ -178,20 +177,13 @@ def note_module_odr_violation_mismatch_decl : Note<"but in '%0' found " "protected access specifier|static assert|field|method|type alias|typedef|" "data member|friend declaration|function template}1">; -def err_module_odr_violation_mismatch_decl_diff : Error< +def err_module_odr_violation_record : Error< "%q0 has different definitions in different modules; first difference is " "%select{definition in module '%2'|defined here}1 found " "%select{" "static assert with condition|" "static assert with message|" "static assert with %select{|no }4message|" - "field %4|" - "field %4 with type %5|" - "%select{non-|}5bitfield %4|" - "bitfield %4 with one width expression|" - "%select{non-|}5mutable field %4|" - "field %4 with %select{no|an}5 initalizer|" - "field %4 with an initializer|" "%select{method %5|constructor|destructor}4|" "%select{method %5|constructor|destructor}4 " "is %select{not deleted|deleted}6|" @@ -227,13 +219,6 @@ def err_module_odr_violation_mismatch_decl_diff : Error< "with %select{no body|body}6|" "%select{method %5|constructor|destructor}4 " "with body|" - "%select{typedef|type alias}4 name %5|" - "%select{typedef|type alias}4 %5 with underlying type %6|" - "data member with name %4|" - "data member %4 with type %5|" - "data member %4 with%select{out|}5 an initializer|" - "data member %4 with an initializer|" - "data member %4 %select{is constexpr|is not constexpr}5|" "friend %select{class|function}4|" "friend %4|" "friend function %4|" @@ -251,18 +236,11 @@ def err_module_odr_violation_mismatch_decl_diff : Error< "being a template parameter pack|" "}3">; -def note_module_odr_violation_mismatch_decl_diff : Note<"but in '%0' found " +def note_module_odr_violation_record : Note<"but in '%0' found " "%select{" "static assert with different condition|" "static assert with different message|" "static assert with %select{|no }2message|" - "field %2|" - "field %2 with type %3|" - "%select{non-|}3bitfield %2|" - "bitfield %2 with different width expression|" - "%select{non-|}3mutable field %2|" - "field %2 with %select{no|an}3 initializer|" - "field %2 with a different initializer|" "%select{method %3|constructor|destructor}2|" "%select{method %3|constructor|destructor}2 " "is %select{not deleted|deleted}4|" @@ -298,13 +276,6 @@ def note_module_odr_violation_mismatch_decl_diff : Note<"but in '%0' found " "with %select{no body|body}4|" "%select{method %3|constructor|destructor}2 " "with different body|" - "%select{typedef|type alias}2 name %3|" - "%select{typedef|type alias}2 %3 with different underlying type %4|" - "data member with name %2|" - "data member %2 with different type %3|" - "data member %2 with%select{out|}3 an initializer|" - "data member %2 with a different initializer|" - "data member %2 %select{is constexpr|is not constexpr}3|" "friend %select{class|function}2|" "friend %2|" "friend function %2|" @@ -322,6 +293,61 @@ def note_module_odr_violation_mismatch_decl_diff : Note<"but in '%0' found " "being a template parameter pack|" "}1">; +def err_module_odr_violation_field : Error< + "%q0 has different definitions in different modules; first difference is " + "%select{definition in module '%2'|defined here}1 found " + "%select{" + "field %4|" + "field %4 with type %5|" + "%select{non-|}5bitfield %4|" + "bitfield %4 with one width expression|" + "%select{non-|}5mutable field %4|" + "field %4 with %select{no|an}5 initalizer|" + "field %4 with an initializer" + "}3">; +def note_module_odr_violation_field : Note<"but in '%0' found " + "%select{" + "field %2|" + "field %2 with type %3|" + "%select{non-|}3bitfield %2|" + "bitfield %2 with different width expression|" + "%select{non-|}3mutable field %2|" + "field %2 with %select{no|an}3 initializer|" + "field %2 with a different initializer" + "}1">; + +def err_module_odr_violation_typedef : Error< + "%q0 has different definitions in different modules; first difference is " + "%select{definition in module '%2'|defined here}1 found " + "%select{" + "%select{typedef|type alias}4 name %5|" + "%select{typedef|type alias}4 %5 with underlying type %6" + "}3">; +def note_module_odr_violation_typedef : Note<"but in '%0' found " + "%select{" + "%select{typedef|type alias}2 name %3|" + "%select{typedef|type alias}2 %3 with different underlying type %4" + "}1">; + +def err_module_odr_violation_variable : Error< + "%q0 has different definitions in different modules; first difference is " + "%select{definition in module '%2'|defined here}1 found " + "%select{" + "data member with name %4|" + "data member %4 with type %5|" + "data member %4 with%select{out|}5 an initializer|" + "data member %4 with an initializer|" + "data member %4 %select{is constexpr|is not constexpr}5" + "}3">; +def note_module_odr_violation_variable : Note<"but in '%0' found " + "%select{" + "data member with name %2|" + "data member %2 with different type %3|" + "data member %2 with%select{out|}3 an initializer|" + "data member %2 with a different initializer|" + "data member %2 %select{is constexpr|is not constexpr}3" + "}1">; + def err_module_odr_violation_function : Error< "%q0 has different definitions in different modules; " "%select{definition in module '%2'|defined here}1 " @@ -356,7 +382,7 @@ def err_module_odr_violation_enum : Error< "enum with specified type %4|" "enum with %4 element%s4|" "%ordinal4 element has name %5|" - "%ordinal4 element %5 %select{has|does not have}6 an initilizer|" + "%ordinal4 element %5 %select{has|does not have}6 an initializer|" "%ordinal4 element %5 has an initializer|" "}3">; @@ -376,12 +402,14 @@ def err_module_odr_violation_mismatch_decl_unknown : Error< "%q0 %select{with definition in module '%2'|defined here}1 has different " "definitions in different modules; first difference is this " "%select{||||static assert|field|method|type alias|typedef|data member|" - "friend declaration|unexpected decl}3">; + "friend declaration|function template|" + "unexpected decl}3">; def note_module_odr_violation_mismatch_decl_unknown : Note< "but in '%0' found " "%select{||||different static assert|different field|different method|" "different type alias|different typedef|different data member|" - "different friend declaration|another unexpected decl}1">; + "different friend declaration|different function template|" + "another unexpected decl}1">; def warn_duplicate_module_file_extension : Warning< "duplicate module file extension block name '%0'">, diff --git a/clang/include/clang/Basic/DirectoryEntry.h b/clang/include/clang/Basic/DirectoryEntry.h index ac8e790230fc..fe5ec958b37c 100644 --- a/clang/include/clang/Basic/DirectoryEntry.h +++ b/clang/include/clang/Basic/DirectoryEntry.h @@ -32,7 +32,11 @@ template class MapEntryOptionalStorage; /// Cached information about one directory (either on disk or in /// the virtual file system). class DirectoryEntry { + DirectoryEntry() = default; + DirectoryEntry(const DirectoryEntry &) = delete; + DirectoryEntry &operator=(const DirectoryEntry &) = delete; friend class FileManager; + friend class FileEntryTestHelper; // FIXME: We should not be storing a directory entry name here. StringRef Name; // Name of the directory. @@ -126,22 +130,33 @@ public: void reset() { MaybeRef = optional_none_tag(); } + bool has_value() const { return MaybeRef.hasOptionalValue(); } bool hasValue() const { return MaybeRef.hasOptionalValue(); } - RefTy &getValue() LLVM_LVALUE_FUNCTION { - assert(hasValue()); + RefTy &value() & { + assert(has_value()); return MaybeRef; } - RefTy const &getValue() const LLVM_LVALUE_FUNCTION { - assert(hasValue()); + RefTy &getValue() & { + assert(has_value()); return MaybeRef; } -#if LLVM_HAS_RVALUE_REFERENCE_THIS + RefTy const &value() const & { + assert(has_value()); + return MaybeRef; + } + RefTy const &getValue() const & { + assert(has_value()); + return MaybeRef; + } + RefTy &&value() && { + assert(has_value()); + return std::move(MaybeRef); + } RefTy &&getValue() && { - assert(hasValue()); + assert(has_value()); return std::move(MaybeRef); } -#endif template void emplace(Args &&...args) { MaybeRef = RefTy(std::forward(args)...); @@ -284,7 +299,7 @@ public: /// DirectoryEntry::getName have been deleted, delete this class and replace /// instances with Optional operator const DirectoryEntry *() const { - return hasValue() ? &getValue().getDirEntry() : nullptr; + return has_value() ? &value().getDirEntry() : nullptr; } }; diff --git a/clang/include/clang/Basic/FPOptions.def b/clang/include/clang/Basic/FPOptions.def index a93fa475cd5f..1dfbbb549c87 100644 --- a/clang/include/clang/Basic/FPOptions.def +++ b/clang/include/clang/Basic/FPOptions.def @@ -14,13 +14,15 @@ // OPTION(name, type, width, previousName) OPTION(FPContractMode, LangOptions::FPModeKind, 2, First) -OPTION(RoundingMode, LangOptions::RoundingMode, 3, FPContractMode) -OPTION(FPExceptionMode, LangOptions::FPExceptionModeKind, 2, RoundingMode) -OPTION(AllowFEnvAccess, bool, 1, FPExceptionMode) +OPTION(RoundingMath, bool, 1, FPContractMode) +OPTION(ConstRoundingMode, LangOptions::RoundingMode, 3, RoundingMath) +OPTION(SpecifiedExceptionMode, LangOptions::FPExceptionModeKind, 2, ConstRoundingMode) +OPTION(AllowFEnvAccess, bool, 1, SpecifiedExceptionMode) OPTION(AllowFPReassociate, bool, 1, AllowFEnvAccess) OPTION(NoHonorNaNs, bool, 1, AllowFPReassociate) OPTION(NoHonorInfs, bool, 1, NoHonorNaNs) OPTION(NoSignedZero, bool, 1, NoHonorInfs) OPTION(AllowReciprocal, bool, 1, NoSignedZero) OPTION(AllowApproxFunc, bool, 1, AllowReciprocal) +OPTION(FPEvalMethod, LangOptions::FPEvalMethodKind, 2, AllowApproxFunc) #undef OPTION diff --git a/clang/include/clang/Basic/Features.def b/clang/include/clang/Basic/Features.def index 6ca0e646b865..a7f0ae03e0be 100644 --- a/clang/include/clang/Basic/Features.def +++ b/clang/include/clang/Basic/Features.def @@ -45,7 +45,12 @@ FEATURE(leak_sanitizer, FEATURE(hwaddress_sanitizer, LangOpts.Sanitize.hasOneOf(SanitizerKind::HWAddress | SanitizerKind::KernelHWAddress)) -FEATURE(memtag_sanitizer, LangOpts.Sanitize.has(SanitizerKind::MemTag)) +FEATURE(memtag_stack, + LangOpts.Sanitize.has(SanitizerKind::MemtagStack)) +FEATURE(memtag_heap, + LangOpts.Sanitize.has(SanitizerKind::MemtagHeap)) +FEATURE(memtag_globals, + LangOpts.Sanitize.has(SanitizerKind::MemtagGlobals)) FEATURE(xray_instrument, LangOpts.XRayInstrument) FEATURE(undefined_behavior_sanitizer, LangOpts.Sanitize.hasOneOf(SanitizerKind::Undefined)) @@ -58,6 +63,7 @@ FEATURE(attribute_availability_app_extension, true) FEATURE(attribute_availability_with_version_underscores, true) FEATURE(attribute_availability_tvos, true) FEATURE(attribute_availability_watchos, true) +FEATURE(attribute_availability_driverkit, true) FEATURE(attribute_availability_with_strict, true) FEATURE(attribute_availability_with_replacement, true) FEATURE(attribute_availability_in_templates, true) @@ -173,6 +179,7 @@ FEATURE(cxx_thread_local, FEATURE(cxx_trailing_return, LangOpts.CPlusPlus11) FEATURE(cxx_unicode_literals, LangOpts.CPlusPlus11) FEATURE(cxx_unrestricted_unions, LangOpts.CPlusPlus11) +FEATURE(cxx_unstable, LangOpts.Unstable) FEATURE(cxx_user_literals, LangOpts.CPlusPlus11) FEATURE(cxx_variadic_templates, LangOpts.CPlusPlus11) // C++14 features @@ -266,5 +273,8 @@ EXTENSION(cxx_attributes_on_using_declarations, LangOpts.CPlusPlus11) FEATURE(cxx_abi_relative_vtable, LangOpts.CPlusPlus && LangOpts.RelativeCXXABIVTables) +// CUDA/HIP Features +FEATURE(cuda_noinline_keyword, LangOpts.CUDA) + #undef EXTENSION #undef FEATURE diff --git a/clang/include/clang/Basic/FileEntry.h b/clang/include/clang/Basic/FileEntry.h index 6e91b42e18b7..8676604b4836 100644 --- a/clang/include/clang/Basic/FileEntry.h +++ b/clang/include/clang/Basic/FileEntry.h @@ -65,7 +65,6 @@ public: } DirectoryEntryRef getDir() const { return *ME->second->Dir; } - inline bool isValid() const; inline off_t getSize() const; inline unsigned getUID() const; inline const llvm::sys::fs::UniqueID &getUniqueID() const; @@ -314,7 +313,7 @@ public: /// FileEntry::getName have been deleted, delete this class and replace /// instances with Optional operator const FileEntry *() const { - return hasValue() ? &getValue().getFileEntry() : nullptr; + return has_value() ? &value().getFileEntry() : nullptr; } }; @@ -330,6 +329,10 @@ static_assert( /// descriptor for the file. class FileEntry { friend class FileManager; + friend class FileEntryTestHelper; + FileEntry(); + FileEntry(const FileEntry &) = delete; + FileEntry &operator=(const FileEntry &) = delete; std::string RealPathName; // Real path to the file; could be empty. off_t Size = 0; // File size in bytes. @@ -338,7 +341,6 @@ class FileEntry { llvm::sys::fs::UniqueID UniqueID; unsigned UID = 0; // A unique (small) ID for the file. bool IsNamedPipe = false; - bool IsValid = false; // Is this \c FileEntry initialized and valid? /// The open file, if it is owned by the \p FileEntry. mutable std::unique_ptr File; @@ -355,17 +357,11 @@ class FileEntry { Optional LastRef; public: - FileEntry(); ~FileEntry(); - - FileEntry(const FileEntry &) = delete; - FileEntry &operator=(const FileEntry &) = delete; - StringRef getName() const { return LastRef->getName(); } FileEntryRef getLastRef() const { return *LastRef; } StringRef tryGetRealPathName() const { return RealPathName; } - bool isValid() const { return IsValid; } off_t getSize() const { return Size; } unsigned getUID() const { return UID; } const llvm::sys::fs::UniqueID &getUniqueID() const { return UniqueID; } @@ -374,8 +370,6 @@ public: /// Return the directory the file lives in. const DirectoryEntry *getDir() const { return Dir; } - bool operator<(const FileEntry &RHS) const { return UniqueID < RHS.UniqueID; } - /// Check whether the file is a named pipe (and thus can't be opened by /// the native FileManager methods). bool isNamedPipe() const { return IsNamedPipe; } @@ -383,8 +377,6 @@ public: void closeFile() const; }; -bool FileEntryRef::isValid() const { return getFileEntry().isValid(); } - off_t FileEntryRef::getSize() const { return getFileEntry().getSize(); } unsigned FileEntryRef::getUID() const { return getFileEntry().getUID(); } diff --git a/clang/include/clang/Basic/FileManager.h b/clang/include/clang/Basic/FileManager.h index 974771a8f8f3..d3dc54a6be2a 100644 --- a/clang/include/clang/Basic/FileManager.h +++ b/clang/include/clang/Basic/FileManager.h @@ -53,24 +53,26 @@ class FileSystemStatCache; class FileManager : public RefCountedBase { IntrusiveRefCntPtr FS; FileSystemOptions FileSystemOpts; + llvm::SpecificBumpPtrAllocator FilesAlloc; + llvm::SpecificBumpPtrAllocator DirsAlloc; /// Cache for existing real directories. - std::map UniqueRealDirs; + llvm::DenseMap UniqueRealDirs; /// Cache for existing real files. - std::map UniqueRealFiles; + llvm::DenseMap UniqueRealFiles; /// The virtual directories that we have allocated. /// /// For each virtual file (e.g. foo/bar/baz.cpp), we add all of its parent /// directories (foo/ and foo/bar/) here. - SmallVector, 4> VirtualDirectoryEntries; + SmallVector VirtualDirectoryEntries; /// The virtual files that we have allocated. - SmallVector, 4> VirtualFileEntries; + SmallVector VirtualFileEntries; /// A set of files that bypass the maps and uniquing. They can have /// conflicting filenames. - SmallVector, 0> BypassFileEntries; + SmallVector BypassFileEntries; /// A cache that maps paths to directory entries (either real or /// virtual) we have looked up, or an error that occurred when we looked up diff --git a/clang/include/clang/Basic/Lambda.h b/clang/include/clang/Basic/Lambda.h index 853821a33c2a..de01d6f33c01 100644 --- a/clang/include/clang/Basic/Lambda.h +++ b/clang/include/clang/Basic/Lambda.h @@ -32,7 +32,7 @@ enum LambdaCaptureDefault { /// is an expression. enum LambdaCaptureKind { LCK_This, ///< Capturing the \c *this object by reference - LCK_StarThis, /// < Capturing the \c *this object by copy + LCK_StarThis, ///< Capturing the \c *this object by copy LCK_ByCopy, ///< Capturing by copy (a.k.a., by value) LCK_ByRef, ///< Capturing by reference LCK_VLAType ///< Capturing variable-length array type diff --git a/clang/include/clang/Basic/LangOptions.def b/clang/include/clang/Basic/LangOptions.def index 4651f4fff6aa..c41b5ddc7fa1 100644 --- a/clang/include/clang/Basic/LangOptions.def +++ b/clang/include/clang/Basic/LangOptions.def @@ -7,7 +7,11 @@ //===----------------------------------------------------------------------===// // // This file defines the language options. Users of this file must -// define the LANGOPT macro to make use of this information. +// define the LANGOPT macro to make use of this information. The arguments to +// the macro are: +// LANGOPT(Name, Bits, DefaultValue, Description) +// Note that the DefaultValue must be a constant value (literal or enumeration); +// it cannot depend on the value of another language option. // // Optionally, the user may also define: // @@ -84,6 +88,7 @@ LANGOPT(C11 , 1, 0, "C11") LANGOPT(C17 , 1, 0, "C17") LANGOPT(C2x , 1, 0, "C2x") LANGOPT(MSVCCompat , 1, 0, "Microsoft Visual C++ full compatibility mode") +LANGOPT(Kernel , 1, 0, "Kernel mode") LANGOPT(MicrosoftExt , 1, 0, "Microsoft C++ extensions") LANGOPT(AsmBlocks , 1, 0, "Microsoft inline asm blocks") LANGOPT(Borland , 1, 0, "Borland extensions") @@ -107,7 +112,7 @@ LANGOPT(Trigraphs , 1, 0,"trigraphs") LANGOPT(LineComment , 1, 0, "'//' comments") LANGOPT(Bool , 1, 0, "bool, true, and false keywords") LANGOPT(Half , 1, 0, "half keyword") -LANGOPT(WChar , 1, CPlusPlus, "wchar_t keyword") +LANGOPT(WChar , 1, 0, "wchar_t keyword") LANGOPT(Char8 , 1, 0, "char8_t keyword") LANGOPT(IEEE128 , 1, 0, "__ieee128 keyword") LANGOPT(DeclSpecKeyword , 1, 0, "__declspec keyword") @@ -116,9 +121,9 @@ BENIGN_LANGOPT(AsmPreprocessor, 1, 0, "preprocessor in asm mode") LANGOPT(GNUMode , 1, 1, "GNU extensions") LANGOPT(GNUKeywords , 1, 1, "GNU keywords") VALUE_LANGOPT(GNUCVersion , 32, 0, "GNU C compatibility version") -BENIGN_LANGOPT(ImplicitInt, 1, !C99 && !CPlusPlus, "C89 implicit 'int'") +LANGOPT(DisableKNRFunctions, 1, 0, "require function types to have a prototype") LANGOPT(Digraphs , 1, 0, "digraphs") -BENIGN_LANGOPT(HexFloats , 1, C99, "C99 hexadecimal float constants") +BENIGN_LANGOPT(HexFloats , 1, 0, "C99 hexadecimal float constants") LANGOPT(CXXOperatorNames , 1, 0, "C++ operator name keywords") LANGOPT(AppleKext , 1, 0, "Apple kext support") BENIGN_LANGOPT(PascalStrings, 1, 0, "Pascal string support") @@ -150,6 +155,7 @@ LANGOPT(GNUAsm , 1, 1, "GNU-style inline assembly") LANGOPT(Coroutines , 1, 0, "C++20 coroutines") LANGOPT(DllExportInlines , 1, 1, "dllexported classes dllexport inline methods") LANGOPT(RelaxedTemplateTemplateArgs, 1, 0, "C++17 relaxed matching of template template arguments") +LANGOPT(Unstable , 1, 0, "Enable unstable and experimental features") LANGOPT(DoubleSquareBracketAttributes, 1, 0, "'[[]]' attributes extension for all language standard modes") @@ -165,7 +171,7 @@ BENIGN_LANGOPT(HeinousExtensions , 1, 0, "extensions that we really don't like a LANGOPT(Modules , 1, 0, "modules semantics") COMPATIBLE_LANGOPT(ModulesTS , 1, 0, "C++ Modules TS syntax") COMPATIBLE_LANGOPT(CPlusPlusModules, 1, 0, "C++ modules syntax") -BENIGN_ENUM_LANGOPT(CompilingModule, CompilingModuleKind, 2, CMK_None, +BENIGN_ENUM_LANGOPT(CompilingModule, CompilingModuleKind, 3, CMK_None, "compiling a module interface") BENIGN_LANGOPT(CompilingPCH, 1, 0, "building a pch") BENIGN_LANGOPT(BuildingPCHWithObjectFile, 1, 0, "building a pch which has a corresponding object file") @@ -241,13 +247,18 @@ LANGOPT(OpenMPCUDAForceFullRuntime , 1, 0, "Force to use full runtime in all con LANGOPT(OpenMPCUDANumSMs , 32, 0, "Number of SMs for CUDA devices.") LANGOPT(OpenMPCUDABlocksPerSM , 32, 0, "Number of blocks per SM for CUDA devices.") LANGOPT(OpenMPCUDAReductionBufNum , 32, 1024, "Number of the reduction records in the intermediate reduction buffer used for the teams reductions.") -LANGOPT(OpenMPTargetNewRuntime , 1, 0, "Use the new bitcode library for OpenMP offloading") LANGOPT(OpenMPTargetDebug , 32, 0, "Enable debugging in the OpenMP offloading device RTL") LANGOPT(OpenMPOptimisticCollapse , 1, 0, "Use at most 32 bits to represent the collapsed loop nest counter.") LANGOPT(OpenMPThreadSubscription , 1, 0, "Assume work-shared loops do not have more iterations than participating threads.") LANGOPT(OpenMPTeamSubscription , 1, 0, "Assume distributed loops do not have more iterations than participating teams.") +LANGOPT(OpenMPNoThreadState , 1, 0, "Assume that no thread in a parallel region will modify an ICV.") +LANGOPT(OpenMPOffloadMandatory , 1, 0, "Assert that offloading is mandatory and do not create a host fallback.") +LANGOPT(NoGPULib , 1, 0, "Indicate a build without the standard GPU libraries.") LANGOPT(RenderScript , 1, 0, "RenderScript") +LANGOPT(HLSL, 1, 0, "HLSL") +ENUM_LANGOPT(HLSLVersion, HLSLLangStd, 16, HLSL_Unset, "HLSL Version") + LANGOPT(CUDAIsDevice , 1, 0, "compiling for CUDA device") LANGOPT(CUDAAllowVariadicFunctions, 1, 0, "allowing variadic functions in CUDA device code") LANGOPT(CUDAHostDeviceConstexpr, 1, 1, "treating unattributed constexpr functions as __host__ __device__") @@ -257,6 +268,7 @@ LANGOPT(GPUAllowDeviceInit, 1, 0, "allowing device side global init functions fo LANGOPT(GPUMaxThreadsPerBlock, 32, 1024, "default max threads per block for kernel launch bounds for HIP") LANGOPT(GPUDeferDiag, 1, 0, "defer host/device related diagnostic messages for CUDA/HIP") LANGOPT(GPUExcludeWrongSideOverloads, 1, 0, "always exclude wrong side overloads in overloading resolution for CUDA/HIP") +LANGOPT(OffloadingNewDriver, 1, 0, "use the new driver for generating offloading code.") LANGOPT(SYCLIsDevice , 1, 0, "Generate code for SYCL device") LANGOPT(SYCLIsHost , 1, 0, "SYCL host compilation") @@ -268,7 +280,6 @@ LANGOPT(SizedDeallocation , 1, 0, "sized deallocation") LANGOPT(AlignedAllocation , 1, 0, "aligned allocation") LANGOPT(AlignedAllocationUnavailable, 1, 0, "aligned allocation functions are unavailable") LANGOPT(NewAlignOverride , 32, 0, "maximum alignment guaranteed by '::operator new(size_t)'") -LANGOPT(ConceptSatisfactionCaching , 1, 1, "enable satisfaction caching for C++20 Concepts") BENIGN_LANGOPT(ModulesCodegen , 1, 0, "Modules code generation") BENIGN_LANGOPT(ModulesDebugInfo , 1, 0, "Modules debug info") BENIGN_LANGOPT(ElideConstructors , 1, 1, "C++ copy constructor elision") @@ -279,6 +290,7 @@ BENIGN_LANGOPT(DumpRecordLayoutsComplete , 1, 0, "dumping the AST layout of all BENIGN_LANGOPT(DumpVTableLayouts , 1, 0, "dumping the layouts of emitted vtables") LANGOPT(NoConstantCFStrings , 1, 0, "no constant CoreFoundation strings") BENIGN_LANGOPT(InlineVisibilityHidden , 1, 0, "hidden visibility for inline C++ methods") +BENIGN_ENUM_LANGOPT(DefaultVisibilityExportMapping, DefaultVisiblityExportMapping, 2, DefaultVisiblityExportMapping::None, "controls mapping of default visibility to dllexport") BENIGN_LANGOPT(IgnoreXCOFFVisibility, 1, 0, "All the visibility attributes that are specified in the source code are ignored in aix XCOFF.") BENIGN_LANGOPT(VisibilityInlinesHiddenStaticLocalVar, 1, 0, "hidden visibility for static local variables in inline C++ " @@ -299,8 +311,9 @@ COMPATIBLE_LANGOPT(CLFiniteMathOnly , 1, 0, "__FINITE_MATH_ONLY__ predefined mac /// FP_CONTRACT mode (on/off/fast). BENIGN_ENUM_LANGOPT(DefaultFPContractMode, FPModeKind, 2, FPM_Off, "FP contraction type") COMPATIBLE_LANGOPT(ExpStrictFP, 1, false, "Enable experimental strict floating point") -BENIGN_ENUM_LANGOPT(FPRoundingMode, RoundingMode, 3, RoundingMode::NearestTiesToEven, "FP Rounding Mode type") -BENIGN_ENUM_LANGOPT(FPExceptionMode, FPExceptionModeKind, 2, FPE_Ignore, "FP Exception Behavior Mode type") +BENIGN_LANGOPT(RoundingMath, 1, false, "Do not assume default floating-point rounding behavior") +BENIGN_ENUM_LANGOPT(FPExceptionMode, FPExceptionModeKind, 2, FPE_Default, "FP Exception Behavior Mode type") +BENIGN_ENUM_LANGOPT(FPEvalMethod, FPEvalMethodKind, 2, FEM_UnsetOnCommandLine, "FP type used for floating point arithmetic") LANGOPT(NoBitFieldTypeAlign , 1, 0, "bit-field type alignment") LANGOPT(HexagonQdsp6Compat , 1, 0, "hexagon-qdsp6 backward compatibility") LANGOPT(ObjCAutoRefCount , 1, 0, "Objective-C automated reference counting") @@ -434,6 +447,11 @@ ENUM_LANGOPT(ExtendIntArgs, ExtendArgsKind, 1, ExtendArgsKind::ExtendTo32, VALUE_LANGOPT(FuchsiaAPILevel, 32, 0, "Fuchsia API level") +// This option will be removed in the future once the backend +// supports all operations (like division or float-to-integer conversion) +// on large _BitInts. +BENIGN_VALUE_LANGOPT(MaxBitIntWidth, 32, 128, "Maximum width of a _BitInt") + #undef LANGOPT #undef COMPATIBLE_LANGOPT #undef BENIGN_LANGOPT diff --git a/clang/include/clang/Basic/LangOptions.h b/clang/include/clang/Basic/LangOptions.h index 50c7f038fc6b..3a1c13dd7256 100644 --- a/clang/include/clang/Basic/LangOptions.h +++ b/clang/include/clang/Basic/LangOptions.h @@ -53,6 +53,26 @@ protected: /// members used to implement virtual inheritance. enum class MSVtorDispMode { Never, ForVBaseOverride, ForVFTable }; +/// Shader programs run in specific pipeline stages. +enum class ShaderStage { + Pixel = 0, + Vertex, + Geometry, + Hull, + Domain, + Compute, + Library, + RayGeneration, + Intersection, + AnyHit, + ClosestHit, + Miss, + Callable, + Mesh, + Amplification, + Invalid, +}; + /// Keeps track of the various options that can be /// enabled, which controls the dialect of C or C++ that is accepted. class LangOptions : public LangOptionsBase { @@ -90,6 +110,9 @@ public: /// Compiling a module from a list of header files. CMK_HeaderModule, + /// Compiling a module header unit. + CMK_HeaderUnit, + /// Compiling a C++ modules TS module interface unit. CMK_ModuleInterface, }; @@ -137,6 +160,16 @@ public: SYCL_Default = SYCL_2020 }; + enum HLSLLangStd { + HLSL_Unset = 0, + HLSL_2015 = 2015, + HLSL_2016 = 2016, + HLSL_2017 = 2017, + HLSL_2018 = 2018, + HLSL_2021 = 2021, + HLSL_202x = 2029, + }; + /// Clang versions with different platform ABI conformance. enum class ClangABI { /// Attempt to be ABI-compatible with code generated by Clang 3.8.x @@ -181,9 +214,14 @@ public: /// global-scope inline variables incorrectly. Ver12, - /// Attempt to be ABI-compatible with code generated by Clang 13.0.x. - /// This causes clang to not pack non-POD members of packed structs. - Ver13, + /// Attempt to be ABI-compatible with code generated by Clang 14.0.x. + /// This causes clang to: + /// - mangle dependent nested names incorrectly. + /// - pack non-POD members of packed structs. + /// - make trivial only those defaulted copy constructors with a + /// parameter-type-list equivalent to the parameter-type-list of an + /// implicit declaration. + Ver14, /// Conform to the underlying platform's C and C++ ABIs as closely /// as we can. @@ -221,10 +259,6 @@ public: FPM_FastHonorPragmas }; - /// Alias for RoundingMode::NearestTiesToEven. - static constexpr unsigned FPR_ToNearest = - static_cast(llvm::RoundingMode::NearestTiesToEven); - /// Possible floating point exception behavior. enum FPExceptionModeKind { /// Assume that floating-point exceptions are masked. @@ -232,7 +266,27 @@ public: /// Transformations do not cause new exceptions but may hide some. FPE_MayTrap, /// Strictly preserve the floating-point exception semantics. - FPE_Strict + FPE_Strict, + /// Used internally to represent initial unspecified value. + FPE_Default + }; + + /// Possible float expression evaluation method choices. + enum FPEvalMethodKind { + /// The evaluation method cannot be determined or is inconsistent for this + /// target. + FEM_Indeterminable = -1, + /// Use the declared type for fp arithmetic. + FEM_Source = 0, + /// Use the type double for fp arithmetic. + FEM_Double = 1, + /// Use extended type for fp arithmetic. + FEM_Extended = 2, + /// Used only for FE option processing; this is only used to indicate that + /// the user did not specify an explicit evaluation method on the command + /// line and so the target should be queried for its default evaluation + /// method instead. + FEM_UnsetOnCommandLine = 3 }; /// Possible exception handling behavior. @@ -291,6 +345,21 @@ public: ExtendTo64 }; + enum class GPUDefaultStreamKind { + /// Legacy default stream + Legacy, + /// Per-thread default stream + PerThread, + }; + + enum class DefaultVisiblityExportMapping { + None, + /// map only explicit default visibilities to exported + Explicit, + /// map all default visibilities to exported + All, + }; + public: /// The used language standard. LangStandard::Kind LangStd; @@ -384,8 +453,36 @@ public: /// input is a header file (i.e. -x c-header). bool IsHeaderFile = false; + /// The default stream kind used for HIP kernel launching. + GPUDefaultStreamKind GPUDefaultStream; + + /// The seed used by the randomize structure layout feature. + std::string RandstructSeed; + + /// Indicates whether the __FILE__ macro should use the target's + /// platform-specific file separator or whether it should use the build + /// environment's platform-specific file separator. + /// + /// The plaform-specific path separator is the backslash(\) for Windows and + /// forward slash (/) elsewhere. + bool UseTargetPathSeparator = false; + LangOptions(); + /// Set language defaults for the given input language and + /// language standard in the given LangOptions object. + /// + /// \param Opts - The LangOptions object to set up. + /// \param Lang - The input language. + /// \param T - The target triple. + /// \param Includes - If the language requires extra headers to be implicitly + /// included, they will be appended to this list. + /// \param LangStd - The input language standard. + static void + setLangDefaults(LangOptions &Opts, Language Lang, const llvm::Triple &T, + std::vector &Includes, + LangStandard::Kind LangStd = LangStandard::lang_unspecified); + // Define accessors/mutators for language options of enumeration type. #define LANGOPT(Name, Bits, Default, Description) #define ENUM_LANGOPT(Name, Type, Bits, Default, Description) \ @@ -443,6 +540,24 @@ public: /// as a string. std::string getOpenCLVersionString() const; + /// Returns true if functions without prototypes or functions with an + /// identifier list (aka K&R C functions) are not allowed. + bool requiresStrictPrototypes() const { + return CPlusPlus || C2x || DisableKNRFunctions; + } + + /// Returns true if implicit function declarations are allowed in the current + /// language mode. + bool implicitFunctionsAllowed() const { + return !requiresStrictPrototypes() && !OpenCL; + } + + /// Returns true if implicit int is part of the language requirements. + bool isImplicitIntRequired() const { return !CPlusPlus && !C99; } + + /// Returns true if implicit int is supported at all. + bool isImplicitIntAllowed() const { return !CPlusPlus && !C2x; } + /// Check if return address signing is enabled. bool hasSignReturnAddress() const { return getSignReturnAddressScope() != SignReturnAddressScopeKind::None; @@ -476,8 +591,35 @@ public: bool isSYCL() const { return SYCLIsDevice || SYCLIsHost; } + bool hasDefaultVisibilityExportMapping() const { + return getDefaultVisibilityExportMapping() != + DefaultVisiblityExportMapping::None; + } + + bool isExplicitDefaultVisibilityExportMapping() const { + return getDefaultVisibilityExportMapping() == + DefaultVisiblityExportMapping::Explicit; + } + + bool isAllDefaultVisibilityExportMapping() const { + return getDefaultVisibilityExportMapping() == + DefaultVisiblityExportMapping::All; + } + /// Remap path prefix according to -fmacro-prefix-path option. - void remapPathPrefix(SmallString<256> &Path) const; + void remapPathPrefix(SmallVectorImpl &Path) const; + + RoundingMode getDefaultRoundingMode() const { + return RoundingMath ? RoundingMode::Dynamic + : RoundingMode::NearestTiesToEven; + } + + FPExceptionModeKind getDefaultExceptionMode() const { + FPExceptionModeKind EM = getFPExceptionMode(); + if (EM == FPExceptionModeKind::FPE_Default) + return FPExceptionModeKind::FPE_Ignore; + return EM; + } }; /// Floating point control options @@ -485,7 +627,7 @@ class FPOptionsOverride; class FPOptions { public: // We start by defining the layout. - using storage_type = uint16_t; + using storage_type = uint32_t; using RoundingMode = llvm::RoundingMode; @@ -511,11 +653,13 @@ public: private: storage_type Value; + FPOptionsOverride getChangesSlow(const FPOptions &Base) const; + public: FPOptions() : Value(0) { setFPContractMode(LangOptions::FPM_Off); - setRoundingMode(static_cast(LangOptions::FPR_ToNearest)); - setFPExceptionMode(LangOptions::FPE_Ignore); + setConstRoundingMode(RoundingMode::Dynamic); + setSpecifiedExceptionMode(LangOptions::FPE_Default); } explicit FPOptions(const LangOptions &LO) { Value = 0; @@ -526,8 +670,9 @@ public: if (LangOptContractMode == LangOptions::FPM_FastHonorPragmas) LangOptContractMode = LangOptions::FPM_Fast; setFPContractMode(LangOptContractMode); - setRoundingMode(LO.getFPRoundingMode()); - setFPExceptionMode(LO.getFPExceptionMode()); + setRoundingMath(LO.RoundingMath); + setConstRoundingMode(LangOptions::RoundingMode::Dynamic); + setSpecifiedExceptionMode(LO.getFPExceptionMode()); setAllowFPReassociate(LO.AllowFPReassoc); setNoHonorNaNs(LO.NoHonorNaNs); setNoHonorInfs(LO.NoHonorInfs); @@ -536,7 +681,7 @@ public: setAllowApproxFunc(LO.ApproxFunc); if (getFPContractMode() == LangOptions::FPM_On && getRoundingMode() == llvm::RoundingMode::Dynamic && - getFPExceptionMode() == LangOptions::FPE_Strict) + getExceptionMode() == LangOptions::FPE_Strict) // If the FP settings are set to the "strict" model, then // FENV access is set to true. (ffp-model=strict) setAllowFEnvAccess(true); @@ -560,10 +705,33 @@ public: bool isFPConstrained() const { return getRoundingMode() != llvm::RoundingMode::NearestTiesToEven || - getFPExceptionMode() != LangOptions::FPE_Ignore || + getExceptionMode() != LangOptions::FPE_Ignore || getAllowFEnvAccess(); } + RoundingMode getRoundingMode() const { + RoundingMode RM = getConstRoundingMode(); + if (RM == RoundingMode::Dynamic) { + // C2x: 7.6.2p3 If the FE_DYNAMIC mode is specified and FENV_ACCESS is + // "off", the translator may assume that the default rounding mode is in + // effect. + if (!getAllowFEnvAccess() && !getRoundingMath()) + RM = RoundingMode::NearestTiesToEven; + } + return RM; + } + + LangOptions::FPExceptionModeKind getExceptionMode() const { + LangOptions::FPExceptionModeKind EM = getSpecifiedExceptionMode(); + if (EM == LangOptions::FPExceptionModeKind::FPE_Default) { + if (getAllowFEnvAccess()) + return LangOptions::FPExceptionModeKind::FPE_Strict; + else + return LangOptions::FPExceptionModeKind::FPE_Ignore; + } + return EM; + } + bool operator==(FPOptions other) const { return Value == other.Value; } /// Return the default value of FPOptions that's used when trailing @@ -577,6 +745,9 @@ public: return Opts; } + /// Return difference with the given option set. + FPOptionsOverride getChangesFrom(const FPOptions &Base) const; + // We can define most of the accessors automatically: #define OPTION(NAME, TYPE, WIDTH, PREVIOUS) \ TYPE get##NAME() const { \ @@ -611,7 +782,7 @@ public: /// The type suitable for storing values of FPOptionsOverride. Must be twice /// as wide as bit size of FPOption. - using storage_type = uint32_t; + using storage_type = uint64_t; static_assert(sizeof(storage_type) >= 2 * sizeof(FPOptions::storage_type), "Too short type for FPOptionsOverride"); @@ -625,6 +796,8 @@ public: : Options(LO), OverrideMask(OverrideMaskBits) {} FPOptionsOverride(FPOptions FPO) : Options(FPO), OverrideMask(OverrideMaskBits) {} + FPOptionsOverride(FPOptions FPO, FPOptions::storage_type Mask) + : Options(FPO), OverrideMask(Mask) {} bool requiresTrailingStorage() const { return OverrideMask != 0; } @@ -705,6 +878,12 @@ public: LLVM_DUMP_METHOD void dump(); }; +inline FPOptionsOverride FPOptions::getChangesFrom(const FPOptions &Base) const { + if (Value == Base.Value) + return FPOptionsOverride(); + return getChangesSlow(Base); +} + /// Describes the kind of translation unit being processed. enum TranslationUnitKind { /// The translation unit is a complete translation unit. diff --git a/clang/include/clang/Basic/LangStandard.h b/clang/include/clang/Basic/LangStandard.h index b0785409628c..4e78570ff733 100644 --- a/clang/include/clang/Basic/LangStandard.h +++ b/clang/include/clang/Basic/LangStandard.h @@ -12,6 +12,10 @@ #include "clang/Basic/LLVM.h" #include "llvm/ADT/StringRef.h" +namespace llvm { +class Triple; +} + namespace clang { /// The language for the input, used to select and validate the language @@ -36,6 +40,7 @@ enum class Language : uint8_t { CUDA, RenderScript, HIP, + HLSL, ///@} }; @@ -54,8 +59,8 @@ enum LangFeatures { Digraphs = (1 << 11), GNUMode = (1 << 12), HexFloat = (1 << 13), - ImplicitInt = (1 << 14), - OpenCL = (1 << 15) + OpenCL = (1 << 14), + HLSL = (1 << 15) }; /// LangStandard - Information about the properties of a particular language @@ -125,9 +130,6 @@ public: /// hasHexFloats - Language supports hexadecimal float constants. bool hasHexFloats() const { return Flags & HexFloat; } - /// hasImplicitInt - Language allows variables to be typed as int implicitly. - bool hasImplicitInt() const { return Flags & ImplicitInt; } - /// isOpenCL - Language is a OpenCL variant. bool isOpenCL() const { return Flags & OpenCL; } @@ -136,6 +138,9 @@ public: static const LangStandard *getLangStandardForName(StringRef Name); }; +LangStandard::Kind getDefaultLanguageStandard(clang::Language Lang, + const llvm::Triple &T); + } // end namespace clang #endif diff --git a/clang/include/clang/Basic/LangStandards.def b/clang/include/clang/Basic/LangStandards.def index 6056cfd65bbb..323032f41da0 100644 --- a/clang/include/clang/Basic/LangStandards.def +++ b/clang/include/clang/Basic/LangStandards.def @@ -36,18 +36,17 @@ // C89-ish modes. LANGSTANDARD(c89, "c89", - C, "ISO C 1990", - ImplicitInt) + C, "ISO C 1990", 0) LANGSTANDARD_ALIAS(c89, "c90") LANGSTANDARD_ALIAS(c89, "iso9899:1990") LANGSTANDARD(c94, "iso9899:199409", C, "ISO C 1990 with amendment 1", - Digraphs | ImplicitInt) + Digraphs) LANGSTANDARD(gnu89, "gnu89", C, "ISO C 1990 with GNU extensions", - LineComment | Digraphs | GNUMode | ImplicitInt) + LineComment | Digraphs | GNUMode) LANGSTANDARD_ALIAS(gnu89, "gnu90") // C99-ish modes @@ -209,6 +208,36 @@ LANGSTANDARD(cuda, "cuda", CUDA, "NVIDIA CUDA(tm)", LANGSTANDARD(hip, "hip", HIP, "HIP", LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | Digraphs) +// HLSL +LANGSTANDARD(hlsl, "hlsl", + HLSL, "High Level Shader Language", + LineComment | HLSL | CPlusPlus ) + +LANGSTANDARD(hlsl2015, "hlsl2015", + HLSL, "High Level Shader Language 2015", + LineComment | HLSL | CPlusPlus ) + +LANGSTANDARD(hlsl2016, "hlsl2016", + HLSL, "High Level Shader Language 2016", + LineComment | HLSL | CPlusPlus ) + +LANGSTANDARD(hlsl2017, "hlsl2017", + HLSL, "High Level Shader Language 2017", + LineComment | HLSL | CPlusPlus ) + +LANGSTANDARD(hlsl2018, "hlsl2018", + HLSL, "High Level Shader Language 2018", + LineComment | HLSL | CPlusPlus ) + +LANGSTANDARD(hlsl2021, "hlsl2021", + HLSL, "High Level Shader Language 2021", + LineComment | HLSL | CPlusPlus ) + +LANGSTANDARD(hlsl202x, "hlsl202x", + HLSL, "High Level Shader Language 202x", + LineComment | HLSL | CPlusPlus | CPlusPlus11) + + #undef LANGSTANDARD #undef LANGSTANDARD_ALIAS #undef LANGSTANDARD_ALIAS_DEPR diff --git a/clang/include/clang/Basic/Module.h b/clang/include/clang/Basic/Module.h index de7857347bc2..a1778baa0453 100644 --- a/clang/include/clang/Basic/Module.h +++ b/clang/include/clang/Basic/Module.h @@ -71,8 +71,8 @@ struct ASTFileSignature : std::array { return Value; } - static ASTFileSignature create(StringRef Bytes) { - return create(Bytes.bytes_begin(), Bytes.bytes_end()); + static ASTFileSignature create(std::array Bytes) { + return ASTFileSignature(std::move(Bytes)); } static ASTFileSignature createDISentinel() { @@ -106,9 +106,18 @@ public: /// of header files. ModuleMapModule, - /// This is a C++ Modules TS module interface unit. + /// This is a C++20 module interface unit. ModuleInterfaceUnit, + /// This is a C++ 20 header unit. + ModuleHeaderUnit, + + /// This is a C++ 20 module partition interface. + ModulePartitionInterface, + + /// This is a C++ 20 module partition implementation. + ModulePartitionImplementation, + /// This is a fragment of the global module within some C++ module. GlobalModuleFragment, @@ -150,13 +159,19 @@ public: /// Does this Module scope describe part of the purview of a named C++ module? bool isModulePurview() const { - return Kind == ModuleInterfaceUnit || Kind == PrivateModuleFragment; + return Kind == ModuleInterfaceUnit || Kind == ModulePartitionInterface || + Kind == ModulePartitionImplementation || + Kind == PrivateModuleFragment; } /// Does this Module scope describe a fragment of the global module within /// some C++ module. bool isGlobalModule() const { return Kind == GlobalModuleFragment; } + bool isPrivateModule() const { return Kind == PrivateModuleFragment; } + + bool isModuleMapModule() const { return Kind == ModuleMapModule; } + private: /// The submodules of this module, indexed by name. std::vector SubModules; @@ -363,6 +378,10 @@ public: /// The set of use declarations that have yet to be resolved. SmallVector UnresolvedDirectUses; + /// When \c NoUndeclaredIncludes is true, the set of modules this module tried + /// to import but didn't because they are not direct uses. + llvm::SmallSetVector UndeclaredUses; + /// A library or framework to link against when an entity from this /// module is used. struct LinkLibrary { @@ -506,6 +525,45 @@ public: Parent->SubModules.push_back(this); } + /// Is this a module partition. + bool isModulePartition() const { + return Kind == ModulePartitionInterface || + Kind == ModulePartitionImplementation; + } + + /// Is this module a header unit. + bool isHeaderUnit() const { return Kind == ModuleHeaderUnit; } + // Is this a C++20 module interface or a partition. + bool isInterfaceOrPartition() const { + return Kind == ModuleInterfaceUnit || isModulePartition(); + } + + bool isModuleInterfaceUnit() const { + return Kind == ModuleInterfaceUnit || Kind == ModulePartitionInterface; + } + + /// Get the primary module interface name from a partition. + StringRef getPrimaryModuleInterfaceName() const { + // Technically, global module fragment belongs to global module. And global + // module has no name: [module.unit]p6: + // The global module has no name, no module interface unit, and is not + // introduced by any module-declaration. + // + // is the default name showed in module map. + if (isGlobalModule()) + return ""; + + if (isModulePartition()) { + auto pos = Name.find(':'); + return StringRef(Name.data(), pos); + } + + if (isPrivateModule()) + return getTopLevelModuleName(); + + return Name; + } + /// Retrieve the full name of this module, including the path from /// its top-level module. /// \param AllowStringLiterals If \c true, components that might not be @@ -578,7 +636,7 @@ public: /// Determine whether this module has declared its intention to /// directly use another module. - bool directlyUses(const Module *Requested) const; + bool directlyUses(const Module *Requested); /// Add the given feature requirement to the list of features /// required by this module. diff --git a/clang/include/clang/Basic/OpenCLOptions.h b/clang/include/clang/Basic/OpenCLOptions.h index 512bcb1e6ef1..d6cb1a210519 100644 --- a/clang/include/clang/Basic/OpenCLOptions.h +++ b/clang/include/clang/Basic/OpenCLOptions.h @@ -212,15 +212,6 @@ private: bool isEnabled(llvm::StringRef Ext) const; OpenCLOptionInfoMap OptMap; - - // First feature in a pair requires the second one to be supported. - using FeatureDepEntry = std::pair; - using FeatureDepList = llvm::SmallVector; - - static const FeatureDepList DependentFeaturesList; - - // Extensions and equivalent feature pairs. - static const llvm::StringMap FeatureExtensionMap; }; } // end namespace clang diff --git a/clang/include/clang/Basic/OpenMPKinds.def b/clang/include/clang/Basic/OpenMPKinds.def index 80ebda917945..4c0884e0a642 100644 --- a/clang/include/clang/Basic/OpenMPKinds.def +++ b/clang/include/clang/Basic/OpenMPKinds.def @@ -105,6 +105,9 @@ OPENMP_DEPEND_KIND(mutexinoutset) OPENMP_DEPEND_KIND(depobj) OPENMP_DEPEND_KIND(source) OPENMP_DEPEND_KIND(sink) +OPENMP_DEPEND_KIND(inoutset) +OPENMP_DEPEND_KIND(outallmemory) +OPENMP_DEPEND_KIND(inoutallmemory) // Modifiers for 'linear' clause. OPENMP_LINEAR_KIND(val) diff --git a/clang/include/clang/Basic/Sanitizers.def b/clang/include/clang/Basic/Sanitizers.def index 9b8936cc520c..8e7b6cd0a7e2 100644 --- a/clang/include/clang/Basic/Sanitizers.def +++ b/clang/include/clang/Basic/Sanitizers.def @@ -56,7 +56,10 @@ SANITIZER("hwaddress", HWAddress) SANITIZER("kernel-hwaddress", KernelHWAddress) // A variant of AddressSanitizer using AArch64 MTE extension. -SANITIZER("memtag", MemTag) +SANITIZER("memtag-stack", MemtagStack) +SANITIZER("memtag-heap", MemtagHeap) +SANITIZER("memtag-globals", MemtagGlobals) +SANITIZER_GROUP("memtag", MemTag, MemtagStack | MemtagHeap | MemtagGlobals) // MemorySanitizer SANITIZER("memory", Memory) diff --git a/clang/include/clang/Basic/SourceLocation.h b/clang/include/clang/Basic/SourceLocation.h index 543245a811db..4451523bc945 100644 --- a/clang/include/clang/Basic/SourceLocation.h +++ b/clang/include/clang/Basic/SourceLocation.h @@ -24,7 +24,7 @@ namespace llvm { class FoldingSetNodeID; -template struct FoldingSetTrait; +template struct FoldingSetTrait; } // namespace llvm @@ -87,7 +87,7 @@ class SourceLocation { friend class ASTReader; friend class ASTWriter; friend class SourceManager; - friend struct llvm::FoldingSetTrait; + friend struct llvm::FoldingSetTrait; public: using UIntTy = uint32_t; @@ -507,7 +507,7 @@ namespace llvm { }; // Allow calling FoldingSetNodeID::Add with SourceLocation object as parameter - template <> struct FoldingSetTrait { + template <> struct FoldingSetTrait { static void Profile(const clang::SourceLocation &X, FoldingSetNodeID &ID); }; diff --git a/clang/include/clang/Basic/SourceManager.h b/clang/include/clang/Basic/SourceManager.h index cc29c24f5a35..5bdeecb07cd9 100644 --- a/clang/include/clang/Basic/SourceManager.h +++ b/clang/include/clang/Basic/SourceManager.h @@ -36,6 +36,7 @@ #include "clang/Basic/Diagnostic.h" #include "clang/Basic/FileEntry.h" +#include "clang/Basic/FileManager.h" #include "clang/Basic/SourceLocation.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/BitVector.h" @@ -899,22 +900,26 @@ public: FileID getOrCreateFileID(const FileEntry *SourceFile, SrcMgr::CharacteristicKind FileCharacter); - /// Return a new SourceLocation that encodes the - /// fact that a token from SpellingLoc should actually be referenced from - /// ExpansionLoc, and that it represents the expansion of a macro argument - /// into the function-like macro body. - SourceLocation createMacroArgExpansionLoc(SourceLocation Loc, + /// Creates an expansion SLocEntry for the substitution of an argument into a + /// function-like macro's body. Returns the start of the expansion. + /// + /// The macro argument was written at \p SpellingLoc with length \p Length. + /// \p ExpansionLoc is the parameter name in the (expanded) macro body. + SourceLocation createMacroArgExpansionLoc(SourceLocation SpellingLoc, SourceLocation ExpansionLoc, - unsigned TokLength); + unsigned Length); - /// Return a new SourceLocation that encodes the fact - /// that a token from SpellingLoc should actually be referenced from - /// ExpansionLoc. - SourceLocation - createExpansionLoc(SourceLocation Loc, SourceLocation ExpansionLocStart, - SourceLocation ExpansionLocEnd, unsigned TokLength, - bool ExpansionIsTokenRange = true, int LoadedID = 0, - SourceLocation::UIntTy LoadedOffset = 0); + /// Creates an expansion SLocEntry for a macro use. Returns its start. + /// + /// The macro body begins at \p SpellingLoc with length \p Length. + /// The macro use spans [ExpansionLocStart, ExpansionLocEnd]. + SourceLocation createExpansionLoc(SourceLocation SpellingLoc, + SourceLocation ExpansionLocStart, + SourceLocation ExpansionLocEnd, + unsigned Length, + bool ExpansionIsTokenRange = true, + int LoadedID = 0, + SourceLocation::UIntTy LoadedOffset = 0); /// Return a new SourceLocation that encodes that the token starting /// at \p TokenStart ends prematurely at \p TokenEnd. @@ -1468,24 +1473,35 @@ public: /// Returns whether \p Loc is located in a file. bool isWrittenInBuiltinFile(SourceLocation Loc) const { - StringRef Filename(getPresumedLoc(Loc).getFilename()); + PresumedLoc Presumed = getPresumedLoc(Loc); + if (Presumed.isInvalid()) + return false; + StringRef Filename(Presumed.getFilename()); return Filename.equals(""); } /// Returns whether \p Loc is located in a file. bool isWrittenInCommandLineFile(SourceLocation Loc) const { - StringRef Filename(getPresumedLoc(Loc).getFilename()); + PresumedLoc Presumed = getPresumedLoc(Loc); + if (Presumed.isInvalid()) + return false; + StringRef Filename(Presumed.getFilename()); return Filename.equals(""); } /// Returns whether \p Loc is located in a file. bool isWrittenInScratchSpace(SourceLocation Loc) const { - StringRef Filename(getPresumedLoc(Loc).getFilename()); + PresumedLoc Presumed = getPresumedLoc(Loc); + if (Presumed.isInvalid()) + return false; + StringRef Filename(Presumed.getFilename()); return Filename.equals(""); } /// Returns if a SourceLocation is in a system header. bool isInSystemHeader(SourceLocation Loc) const { + if (Loc.isInvalid()) + return false; return isSystem(getFileCharacteristic(Loc)); } @@ -1802,7 +1818,7 @@ private: /// the SLocEntry table and producing a source location that refers to it. SourceLocation createExpansionLocImpl(const SrcMgr::ExpansionInfo &Expansion, - unsigned TokLength, int LoadedID = 0, + unsigned Length, int LoadedID = 0, SourceLocation::UIntTy LoadedOffset = 0); /// Return true if the specified FileID contains the diff --git a/clang/include/clang/Basic/Specifiers.h b/clang/include/clang/Basic/Specifiers.h index 82b3c1f3c274..7657ae36d21b 100644 --- a/clang/include/clang/Basic/Specifiers.h +++ b/clang/include/clang/Basic/Specifiers.h @@ -280,6 +280,8 @@ namespace clang { CC_PreserveMost, // __attribute__((preserve_most)) CC_PreserveAll, // __attribute__((preserve_all)) CC_AArch64VectorCall, // __attribute__((aarch64_vector_pcs)) + CC_AArch64SVEPCS, // __attribute__((aarch64_sve_pcs)) + CC_AMDGPUKernelCall, // __attribute__((amdgpu_kernel)) }; /// Checks whether the given calling convention supports variadic @@ -324,7 +326,7 @@ namespace clang { Unspecified, // Generally behaves like Nullable, except when used in a block parameter // that was imported into a swift async method. There, swift will assume - // that the parameter can get null even if no error occured. _Nullable + // that the parameter can get null even if no error occurred. _Nullable // parameters are assumed to only get null on error. NullableResult, }; diff --git a/clang/include/clang/Basic/StmtNodes.td b/clang/include/clang/Basic/StmtNodes.td index ab31c544ea9d..ebbd8db31342 100644 --- a/clang/include/clang/Basic/StmtNodes.td +++ b/clang/include/clang/Basic/StmtNodes.td @@ -264,6 +264,10 @@ def OMPMasterTaskLoopDirective : StmtNode; def OMPMasterTaskLoopSimdDirective : StmtNode; def OMPParallelMasterTaskLoopDirective : StmtNode; def OMPParallelMasterTaskLoopSimdDirective : StmtNode; +def OMPMaskedTaskLoopDirective : StmtNode; +def OMPMaskedTaskLoopSimdDirective : StmtNode; +def OMPParallelMaskedTaskLoopDirective : StmtNode; +def OMPParallelMaskedTaskLoopSimdDirective : StmtNode; def OMPDistributeDirective : StmtNode; def OMPDistributeParallelForDirective : StmtNode; def OMPDistributeParallelForSimdDirective : StmtNode; @@ -282,4 +286,9 @@ def OMPTargetTeamsDistributeSimdDirective : StmtNode; def OMPInteropDirective : StmtNode; def OMPDispatchDirective : StmtNode; def OMPMaskedDirective : StmtNode; +def OMPParallelMaskedDirective : StmtNode; def OMPGenericLoopDirective : StmtNode; +def OMPTeamsGenericLoopDirective : StmtNode; +def OMPTargetTeamsGenericLoopDirective : StmtNode; +def OMPParallelGenericLoopDirective : StmtNode; +def OMPTargetParallelGenericLoopDirective : StmtNode; diff --git a/clang/include/clang/Basic/TargetBuiltins.h b/clang/include/clang/Basic/TargetBuiltins.h index d4ea8e98b2e3..d8ad9858d8c8 100644 --- a/clang/include/clang/Basic/TargetBuiltins.h +++ b/clang/include/clang/Basic/TargetBuiltins.h @@ -121,7 +121,12 @@ namespace clang { /// VE builtins namespace VE { - enum { LastTIBuiltin = clang::Builtin::FirstTSBuiltin - 1, LastTSBuiltin }; + enum { + LastTIBuiltin = clang::Builtin::FirstTSBuiltin - 1, +#define BUILTIN(ID, TYPE, ATTRS) BI##ID, +#include "clang/Basic/BuiltinsVE.def" + LastTSBuiltin + }; } namespace RISCVVector { diff --git a/clang/include/clang/Basic/TargetInfo.h b/clang/include/clang/Basic/TargetInfo.h index a49342a34f3e..0ab3e9b67dfe 100644 --- a/clang/include/clang/Basic/TargetInfo.h +++ b/clang/include/clang/Basic/TargetInfo.h @@ -15,6 +15,7 @@ #define LLVM_CLANG_BASIC_TARGETINFO_H #include "clang/Basic/AddressSpaces.h" +#include "clang/Basic/BitmaskEnum.h" #include "clang/Basic/CodeGenOptions.h" #include "clang/Basic/LLVM.h" #include "clang/Basic/LangOptions.h" @@ -31,6 +32,7 @@ #include "llvm/ADT/StringRef.h" #include "llvm/ADT/Triple.h" #include "llvm/Frontend/OpenMP/OMPGridValues.h" +#include "llvm/IR/DerivedTypes.h" #include "llvm/Support/DataTypes.h" #include "llvm/Support/Error.h" #include "llvm/Support/VersionTuple.h" @@ -51,12 +53,14 @@ class MacroBuilder; namespace Builtin { struct Info; } enum class FloatModeKind { - NoFloat = 255, - Float = 0, - Double, - LongDouble, - Float128, - Ibm128 + NoFloat = 0, + Half = 1 << 0, + Float = 1 << 1, + Double = 1 << 2, + LongDouble = 1 << 3, + Float128 = 1 << 4, + Ibm128 = 1 << 5, + LLVM_MARK_AS_BITMASK_ENUM(Ibm128) }; /// Fields controlling how types are laid out in memory; these may need to @@ -101,10 +105,10 @@ struct TransferrableTargetInfo { unsigned char AccumScale; unsigned char LongAccumScale; - unsigned char SuitableAlign; unsigned char DefaultAlignForAttributeAligned; unsigned char MinGlobalAlign; + unsigned short SuitableAlign; unsigned short NewAlign; unsigned MaxVectorAlign; unsigned MaxTLSAlign; @@ -218,7 +222,9 @@ protected: mutable VersionTuple PlatformMinVersion; unsigned HasAlignMac68kSupport : 1; - unsigned RealTypeUsesObjCFPRet : 3; + unsigned RealTypeUsesObjCFPRetMask + : llvm::BitmaskEnumDetail::bitWidth( + (int)FloatModeKind::LLVM_BITMASK_LARGEST_ENUMERATOR); unsigned ComplexLongDoubleUsesFP2Ret : 1; unsigned HasBuiltinMSVaList : 1; @@ -235,6 +241,10 @@ protected: unsigned MaxOpenCLWorkGroupSize; + Optional MaxBitIntWidth; + + Optional DarwinTargetVariantTriple; + // TargetInfo Constructor. Default initializes all fields. TargetInfo(const llvm::Triple &T); @@ -593,11 +603,16 @@ public: // Different targets may support a different maximum width for the _BitInt // type, depending on what operations are supported. virtual size_t getMaxBitIntWidth() const { + // Consider -fexperimental-max-bitint-width= first. + if (MaxBitIntWidth) + return std::min(*MaxBitIntWidth, llvm::IntegerType::MAX_INT_BITS); + // FIXME: this value should be llvm::IntegerType::MAX_INT_BITS, which is // maximum bit width that LLVM claims its IR can support. However, most - // backends currently have a bug where they only support division - // operations on types that are <= 128 bits and crash otherwise. We're - // setting the max supported value to 128 to be conservative. + // backends currently have a bug where they only support float to int + // conversion (and vice versa) on types that are <= 128 bits and crash + // otherwise. We're setting the max supported value to 128 to be + // conservative. return 128; } @@ -644,8 +659,8 @@ public: } /// Return the largest alignment for which a suitably-sized allocation with - /// '::operator new(size_t)' or 'malloc' is guaranteed to produce a - /// correctly-aligned pointer. + /// '::operator new(size_t)' is guaranteed to produce a correctly-aligned + /// pointer. unsigned getNewAlign() const { return NewAlign ? NewAlign : std::max(LongDoubleAlign, LongLongAlign); } @@ -724,7 +739,11 @@ public: } /// Return the value for the C99 FLT_EVAL_METHOD macro. - virtual unsigned getFloatEvalMethod() const { return 0; } + virtual LangOptions::FPEvalMethodKind getFPEvalMethod() const { + return LangOptions::FPEvalMethodKind::FEM_Source; + } + + virtual bool supportSourceEvalMethod() const { return true; } // getLargeArrayMinWidth/Align - Return the minimum array size that is // 'large' and its alignment. @@ -874,7 +893,7 @@ public: /// Check whether the given real type should use the "fpret" flavor of /// Objective-C message passing on this target. bool useObjCFPRetForRealType(FloatModeKind T) const { - return RealTypeUsesObjCFPRet & (1 << (int)T); + return RealTypeUsesObjCFPRetMask & llvm::BitmaskEnumDetail::Underlying(T); } /// Check whether _Complex long double should use the "fp2ret" flavor @@ -1189,12 +1208,12 @@ public: /// Microsoft C++ code using dllimport/export attributes? virtual bool shouldDLLImportComdatSymbols() const { return getTriple().isWindowsMSVCEnvironment() || - getTriple().isWindowsItaniumEnvironment() || getTriple().isPS4CPU(); + getTriple().isWindowsItaniumEnvironment() || getTriple().isPS(); } // Does this target have PS4 specific dllimport/export handling? virtual bool hasPS4DLLImportExport() const { - return getTriple().isPS4CPU() || + return getTriple().isPS() || // Windows Itanium support allows for testing the SCEI flavour of // dllimport/export handling on a Windows system. (getTriple().isWindowsItaniumEnvironment() && @@ -1341,7 +1360,9 @@ public: bool supportsMultiVersioning() const { return getTriple().isX86(); } /// Identify whether this target supports IFuncs. - bool supportsIFunc() const { return getTriple().isOSBinFormatELF(); } + bool supportsIFunc() const { + return getTriple().isOSBinFormatELF() && !getTriple().isOSFuchsia(); + } // Validate the contents of the __builtin_cpu_supports(const char*) // argument. @@ -1369,6 +1390,13 @@ public: "cpu_specific Multiversioning not implemented on this target"); } + // Get the value for the 'tune-cpu' flag for a cpu_specific variant with the + // programmer-specified 'Name'. + virtual StringRef getCPUSpecificTuneName(StringRef Name) const { + llvm_unreachable( + "cpu_specific Multiversioning not implemented on this target"); + } + // Get a list of the features that make up the CPU option for // cpu_specific/cpu_dispatch so that it can be passed to llvm as optimization // options. @@ -1608,6 +1636,21 @@ public: /// Whether target allows debuginfo types for decl only variables/functions. virtual bool allowDebugInfoForExternalRef() const { return false; } + /// Returns the darwin target variant triple, the variant of the deployment + /// target for which the code is being compiled. + const llvm::Triple *getDarwinTargetVariantTriple() const { + return DarwinTargetVariantTriple ? DarwinTargetVariantTriple.getPointer() + : nullptr; + } + + /// Returns the version of the darwin target variant SDK which was used during + /// the compilation if one was specified, or an empty version otherwise. + const Optional getDarwinTargetVariantSDKVersion() const { + return !getTargetOpts().DarwinTargetVariantSDKVersion.empty() + ? getTargetOpts().DarwinTargetVariantSDKVersion + : Optional(); + } + protected: /// Copy type and layout related info. void copyAuxTarget(const TargetInfo *Aux); diff --git a/clang/include/clang/Basic/TargetOptions.h b/clang/include/clang/Basic/TargetOptions.h index 81c15adb8248..611add6f9268 100644 --- a/clang/include/clang/Basic/TargetOptions.h +++ b/clang/include/clang/Basic/TargetOptions.h @@ -78,6 +78,18 @@ public: /// \brief If enabled, allow AMDGPU unsafe floating point atomics. bool AllowAMDGPUUnsafeFPAtomics = false; + /// \brief Enumeration value for AMDGPU code object version, which is the + /// code object version times 100. + enum CodeObjectVersionKind { + COV_None, + COV_2 = 200, + COV_3 = 300, + COV_4 = 400, + COV_5 = 500, + }; + /// \brief Code object version for AMDGPU. + CodeObjectVersionKind CodeObjectVersion; + // The code model to be used as specified by the user. Corresponds to // CodeModel::Model enum defined in include/llvm/Support/CodeGen.h, plus // "default" for the case when the user has not explicitly specified a @@ -91,8 +103,18 @@ public: /// * CUDA compilation uses it to control parts of CUDA compilation /// in clang that depend on specific version of the CUDA SDK. llvm::VersionTuple SDKVersion; + + /// The name of the darwin target- ariant triple to compile for. + std::string DarwinTargetVariantTriple; + + /// The version of the darwin target variant SDK which was used during the + /// compilation. + llvm::VersionTuple DarwinTargetVariantSDKVersion; + + /// The validator version for dxil. + std::string DxilValidatorVersion; }; -} // end namespace clang +} // end namespace clang #endif diff --git a/clang/include/clang/Basic/TokenKinds.def b/clang/include/clang/Basic/TokenKinds.def index e55244e1c3ac..7b65a1537805 100644 --- a/clang/include/clang/Basic/TokenKinds.def +++ b/clang/include/clang/Basic/TokenKinds.def @@ -432,6 +432,7 @@ KEYWORD(__builtin_FILE , KEYALL) KEYWORD(__builtin_FUNCTION , KEYALL) KEYWORD(__builtin_LINE , KEYALL) KEYWORD(__builtin_COLUMN , KEYALL) +KEYWORD(__builtin_source_location , KEYCXX) // __builtin_types_compatible_p is a GNU C extension that we handle like a C++ // type trait. @@ -510,6 +511,7 @@ TYPE_TRAIT_1(__has_unique_object_representations, KEYWORD(__underlying_type , KEYCXX) // Clang-only C++ Type Traits +TYPE_TRAIT_1(__is_trivially_relocatable, IsTriviallyRelocatable, KEYCXX) TYPE_TRAIT_2(__reference_binds_to_temporary, ReferenceBindsToTemporary, KEYCXX) // Embarcadero Expression Traits @@ -597,6 +599,9 @@ KEYWORD(pipe , KEYOPENCLC | KEYOPENCLCXX) // C++ for OpenCL s2.3.1: addrspace_cast operator KEYWORD(addrspace_cast , KEYOPENCLCXX) +// CUDA/HIP function attributes +KEYWORD(__noinline__ , KEYCUDA) + // OpenMP Type Traits UNARY_EXPR_OR_TYPE_TRAIT(__builtin_omp_required_simd_align, OpenMPRequiredSimdAlign, KEYALL) @@ -675,24 +680,39 @@ KEYWORD(__multiple_inheritance , KEYMS) KEYWORD(__virtual_inheritance , KEYMS) KEYWORD(__interface , KEYMS) ALIAS("__int8" , char , KEYMS) -ALIAS("_int8" , char , KEYMS) ALIAS("__int16" , short , KEYMS) -ALIAS("_int16" , short , KEYMS) ALIAS("__int32" , int , KEYMS) -ALIAS("_int32" , int , KEYMS) -ALIAS("_int64" , __int64 , KEYMS) ALIAS("__wchar_t" , wchar_t , KEYMS) -ALIAS("_asm" , asm , KEYMS) -ALIAS("_alignof" , __alignof , KEYMS) ALIAS("__builtin_alignof", __alignof , KEYMS) -ALIAS("_cdecl" , __cdecl , KEYMS | KEYBORLAND) -ALIAS("_fastcall" , __fastcall , KEYMS | KEYBORLAND) -ALIAS("_stdcall" , __stdcall , KEYMS | KEYBORLAND) -ALIAS("_thiscall" , __thiscall , KEYMS) -ALIAS("_vectorcall" , __vectorcall, KEYMS) -ALIAS("_uuidof" , __uuidof , KEYMS | KEYBORLAND) -ALIAS("_inline" , inline , KEYMS) -ALIAS("_declspec" , __declspec , KEYMS) + +// Microsoft single-underscore prefixed aliases for double-underscore prefixed +// keywords. +ALIAS("_asm" , asm , KEYMS) +ALIAS("_alignof" , __alignof , KEYMS) +ALIAS("_cdecl" , __cdecl , KEYMS | KEYBORLAND) +ALIAS("_declspec" , __declspec , KEYMS) +ALIAS("_fastcall" , __fastcall , KEYMS | KEYBORLAND) +ALIAS("_finally" , __finally , KEYMSCOMPAT) +ALIAS("_forceinline" , __forceinline, KEYMSCOMPAT) +ALIAS("_inline" , inline , KEYMS) +ALIAS("_int8" , char , KEYMS) +ALIAS("_int16" , short , KEYMS) +ALIAS("_int32" , int , KEYMS) +ALIAS("_int64" , __int64 , KEYMS) +ALIAS("_leave" , __leave , KEYMSCOMPAT) +ALIAS("_multiple_inheritance", __multiple_inheritance, KEYMSCOMPAT) +ALIAS("_ptr32" , __ptr32 , KEYMSCOMPAT) +ALIAS("_ptr64" , __ptr64 , KEYMSCOMPAT) +ALIAS("_restrict" , restrict , KEYMSCOMPAT) +ALIAS("_stdcall" , __stdcall , KEYMS | KEYBORLAND) +ALIAS("_thiscall" , __thiscall , KEYMS) +ALIAS("_try" , __try , KEYMSCOMPAT) +ALIAS("_vectorcall" , __vectorcall , KEYMS) +ALIAS("_unaligned" , __unaligned , KEYMSCOMPAT) +ALIAS("_uptr" , __uptr , KEYMSCOMPAT) +ALIAS("_uuidof" , __uuidof , KEYMS | KEYBORLAND) +ALIAS("_virtual_inheritance", __virtual_inheritance, KEYMSCOMPAT) +ALIAS("_w64" , __w64 , KEYMSCOMPAT) // Borland Extensions which should be disabled in strict conformance mode. ALIAS("_pascal" , __pascal , KEYBORLAND) diff --git a/clang/include/clang/Basic/TokenKinds.h b/clang/include/clang/Basic/TokenKinds.h index 4e66aa1c8c2d..6b7006651f4e 100644 --- a/clang/include/clang/Basic/TokenKinds.h +++ b/clang/include/clang/Basic/TokenKinds.h @@ -68,6 +68,9 @@ const char *getPunctuatorSpelling(TokenKind Kind) LLVM_READNONE; /// tokens like 'int' and 'dynamic_cast'. Returns NULL for other token kinds. const char *getKeywordSpelling(TokenKind Kind) LLVM_READNONE; +/// Returns the spelling of preprocessor keywords, such as "else". +const char *getPPKeywordSpelling(PPKeywordKind Kind) LLVM_READNONE; + /// Return true if this is a raw identifier or an identifier kind. inline bool isAnyIdentifier(TokenKind K) { return (K == tok::identifier) || (K == tok::raw_identifier); diff --git a/clang/include/clang/Basic/TypeNodes.td b/clang/include/clang/Basic/TypeNodes.td index b65e8ab521c0..f8557d02e5bd 100644 --- a/clang/include/clang/Basic/TypeNodes.td +++ b/clang/include/clang/Basic/TypeNodes.td @@ -91,6 +91,7 @@ def RecordType : TypeNode, LeafType; def EnumType : TypeNode, LeafType; def ElaboratedType : TypeNode, NeverCanonical; def AttributedType : TypeNode, NeverCanonical; +def BTFTagAttributedType : TypeNode, NeverCanonical; def TemplateTypeParmType : TypeNode, AlwaysDependent, LeafType; def SubstTemplateTypeParmType : TypeNode, NeverCanonical; def SubstTemplateTypeParmPackType : TypeNode, AlwaysDependent; diff --git a/clang/include/clang/Basic/arm_sve.td b/clang/include/clang/Basic/arm_sve.td index 5e9d1c96558b..220b830c368f 100644 --- a/clang/include/clang/Basic/arm_sve.td +++ b/clang/include/clang/Basic/arm_sve.td @@ -1263,10 +1263,10 @@ def SVZIP2_B : SInst<"svzip2_{d}", "PPP", "PcPsPiPl", MergeNone, "aarch64_ //////////////////////////////////////////////////////////////////////////////// // Predicate creation -def SVPFALSE : SInst<"svpfalse[_b]", "P", "", MergeNone, "", [IsOverloadNone]>; +def SVPFALSE : SInst<"svpfalse[_b]", "Pv", "", MergeNone, "", [IsOverloadNone]>; def SVPTRUE_PAT : SInst<"svptrue_pat_{d}", "PI", "PcPsPiPl", MergeNone, "aarch64_sve_ptrue">; -def SVPTRUE : SInst<"svptrue_{d}", "P", "PcPsPiPl", MergeNone, "aarch64_sve_ptrue", [IsAppendSVALL]>; +def SVPTRUE : SInst<"svptrue_{d}", "Pv", "PcPsPiPl", MergeNone, "aarch64_sve_ptrue", [IsAppendSVALL]>; def SVDUPQ_B8 : SInst<"svdupq[_n]_{d}", "Pssssssssssssssss", "Pc", MergeNone>; def SVDUPQ_B16 : SInst<"svdupq[_n]_{d}", "Pssssssss", "Ps", MergeNone>; @@ -1309,9 +1309,9 @@ def SVPTEST_LAST : SInst<"svptest_last", "sPP", "Pc", MergeNone, "aarch64_sve_ //////////////////////////////////////////////////////////////////////////////// // FFR manipulation -def SVRDFFR : SInst<"svrdffr", "P", "Pc", MergeNone, "", [IsOverloadNone]>; +def SVRDFFR : SInst<"svrdffr", "Pv", "Pc", MergeNone, "", [IsOverloadNone]>; def SVRDFFR_Z : SInst<"svrdffr_z", "PP", "Pc", MergeNone, "", [IsOverloadNone]>; -def SVSETFFR : SInst<"svsetffr", "v", "", MergeNone, "", [IsOverloadNone]>; +def SVSETFFR : SInst<"svsetffr", "vv", "", MergeNone, "", [IsOverloadNone]>; def SVWRFFR : SInst<"svwrffr", "vP", "Pc", MergeNone, "", [IsOverloadNone]>; //////////////////////////////////////////////////////////////////////////////// @@ -1322,10 +1322,10 @@ def SVCNTH_PAT : SInst<"svcnth_pat", "nI", "", MergeNone, "aarch64_sve_cnth", [I def SVCNTW_PAT : SInst<"svcntw_pat", "nI", "", MergeNone, "aarch64_sve_cntw", [IsOverloadNone]>; def SVCNTD_PAT : SInst<"svcntd_pat", "nI", "", MergeNone, "aarch64_sve_cntd", [IsOverloadNone]>; -def SVCNTB : SInst<"svcntb", "n", "", MergeNone, "aarch64_sve_cntb", [IsAppendSVALL, IsOverloadNone]>; -def SVCNTH : SInst<"svcnth", "n", "", MergeNone, "aarch64_sve_cnth", [IsAppendSVALL, IsOverloadNone]>; -def SVCNTW : SInst<"svcntw", "n", "", MergeNone, "aarch64_sve_cntw", [IsAppendSVALL, IsOverloadNone]>; -def SVCNTD : SInst<"svcntd", "n", "", MergeNone, "aarch64_sve_cntd", [IsAppendSVALL, IsOverloadNone]>; +def SVCNTB : SInst<"svcntb", "nv", "", MergeNone, "aarch64_sve_cntb", [IsAppendSVALL, IsOverloadNone]>; +def SVCNTH : SInst<"svcnth", "nv", "", MergeNone, "aarch64_sve_cnth", [IsAppendSVALL, IsOverloadNone]>; +def SVCNTW : SInst<"svcntw", "nv", "", MergeNone, "aarch64_sve_cntw", [IsAppendSVALL, IsOverloadNone]>; +def SVCNTD : SInst<"svcntd", "nv", "", MergeNone, "aarch64_sve_cntd", [IsAppendSVALL, IsOverloadNone]>; def SVCNTP : SInst<"svcntp_{d}", "nPP", "PcPsPiPl", MergeNone, "aarch64_sve_cntp">; def SVLEN : SInst<"svlen[_{d}]", "nd", "csilUcUsUiUlhfd", MergeNone>; @@ -1435,20 +1435,20 @@ def SVZIP2Q_BF16 : SInst<"svzip2q[_{d}]", "ddd", "b", MergeNone, "aarc //////////////////////////////////////////////////////////////////////////////// // Vector creation -def SVUNDEF_1 : SInst<"svundef_{d}", "d", "csilUcUsUiUlhfd", MergeNone, "", [IsUndef]>; -def SVUNDEF_2 : SInst<"svundef2_{d}", "2", "csilUcUsUiUlhfd", MergeNone, "", [IsUndef]>; -def SVUNDEF_3 : SInst<"svundef3_{d}", "3", "csilUcUsUiUlhfd", MergeNone, "", [IsUndef]>; -def SVUNDEF_4 : SInst<"svundef4_{d}", "4", "csilUcUsUiUlhfd", MergeNone, "", [IsUndef]>; +def SVUNDEF_1 : SInst<"svundef_{d}", "dv", "csilUcUsUiUlhfd", MergeNone, "", [IsUndef]>; +def SVUNDEF_2 : SInst<"svundef2_{d}", "2v", "csilUcUsUiUlhfd", MergeNone, "", [IsUndef]>; +def SVUNDEF_3 : SInst<"svundef3_{d}", "3v", "csilUcUsUiUlhfd", MergeNone, "", [IsUndef]>; +def SVUNDEF_4 : SInst<"svundef4_{d}", "4v", "csilUcUsUiUlhfd", MergeNone, "", [IsUndef]>; def SVCREATE_2 : SInst<"svcreate2[_{d}]", "2dd", "csilUcUsUiUlhfd", MergeNone, "aarch64_sve_tuple_create2", [IsTupleCreate]>; def SVCREATE_3 : SInst<"svcreate3[_{d}]", "3ddd", "csilUcUsUiUlhfd", MergeNone, "aarch64_sve_tuple_create3", [IsTupleCreate]>; def SVCREATE_4 : SInst<"svcreate4[_{d}]", "4dddd", "csilUcUsUiUlhfd", MergeNone, "aarch64_sve_tuple_create4", [IsTupleCreate]>; let ArchGuard = "defined(__ARM_FEATURE_SVE_BF16)" in { -def SVUNDEF_1_BF16 : SInst<"svundef_{d}", "d", "b", MergeNone, "", [IsUndef]>; -def SVUNDEF_2_BF16 : SInst<"svundef2_{d}", "2", "b", MergeNone, "", [IsUndef]>; -def SVUNDEF_3_BF16 : SInst<"svundef3_{d}", "3", "b", MergeNone, "", [IsUndef]>; -def SVUNDEF_4_BF16 : SInst<"svundef4_{d}", "4", "b", MergeNone, "", [IsUndef]>; +def SVUNDEF_1_BF16 : SInst<"svundef_{d}", "dv", "b", MergeNone, "", [IsUndef]>; +def SVUNDEF_2_BF16 : SInst<"svundef2_{d}", "2v", "b", MergeNone, "", [IsUndef]>; +def SVUNDEF_3_BF16 : SInst<"svundef3_{d}", "3v", "b", MergeNone, "", [IsUndef]>; +def SVUNDEF_4_BF16 : SInst<"svundef4_{d}", "4v", "b", MergeNone, "", [IsUndef]>; def SVCREATE_2_BF16 : SInst<"svcreate2[_{d}]", "2dd", "b", MergeNone, "aarch64_sve_tuple_create2", [IsTupleCreate]>; def SVCREATE_3_BF16 : SInst<"svcreate3[_{d}]", "3ddd", "b", MergeNone, "aarch64_sve_tuple_create3", [IsTupleCreate]>; diff --git a/clang/include/clang/Basic/riscv_vector.td b/clang/include/clang/Basic/riscv_vector.td index 6451e77e77f6..b11b780ec1f7 100644 --- a/clang/include/clang/Basic/riscv_vector.td +++ b/clang/include/clang/Basic/riscv_vector.td @@ -130,8 +130,16 @@ // // There are a number of attributes that are used to constraint the number and // shape of the builtins generated. Refer to the comments below for them. + +class Policy{ + int Value = val; +} +def NonePolicy : Policy<0>; +def HasPassthruOperand : Policy<1>; +def HasPolicyOperand : Policy<2>; + class RVVBuiltin { + string overloaded_suffix = ""> { // Base name that will be prepended in __builtin_rvv_ and appended the // computed Suffix. string Name = NAME; @@ -140,14 +148,14 @@ class RVVBuiltin Log2LMUL = [0, 1, 2, 3, -1, -2, -3]; // Manual code in clang codegen riscv_vector_builtin_cg.inc code ManualCodegen = [{}]; - code ManualCodegenMask = [{}]; + code MaskedManualCodegen = [{}]; // When emit the automatic clang codegen, it describes what types we have to use // to obtain the specific LLVM intrinsic. -1 means the return type, otherwise, @@ -208,12 +217,11 @@ class RVVBuiltin RequiredFeatures = []; @@ -222,8 +230,8 @@ class RVVBuiltin multiclass RVVBuiltinSet> suffixes_prototypes, list intrinsic_types> { - let IRName = intrinsic_name, IRNameMask = intrinsic_name # "_mask", + let IRName = intrinsic_name, MaskedIRName = intrinsic_name # "_mask", IntrinsicTypes = intrinsic_types in { foreach s_p = suffixes_prototypes in { let Name = NAME # "_" # s_p[0] in { @@ -369,8 +377,8 @@ class RVVIntExt : RVVBuiltin { let IRName = intrinsic_name; - let IRNameMask = intrinsic_name # "_mask"; - let MangledName = NAME; + let MaskedIRName = intrinsic_name # "_mask"; + let OverloadedName = NAME; let IntrinsicTypes = [-1, 0]; } @@ -417,7 +425,7 @@ multiclass RVVFloatingMaskOutVFBuiltinSet class RVVMaskBinBuiltin : RVVOutBuiltin<"m", "mmm", "c"> { let Name = NAME # "_mm"; - let HasMask = false; + let HasMasked = false; } class RVVMaskUnaryBuiltin : RVVOutBuiltin<"m", "mm", "c"> { @@ -426,8 +434,8 @@ class RVVMaskUnaryBuiltin : RVVOutBuiltin<"m", "mm", "c"> { class RVVMaskNullaryBuiltin : RVVOutBuiltin<"m", "m", "c"> { let Name = NAME # "_m"; - let HasMask = false; - let HasNoMaskedOverloaded = false; + let HasMasked = false; + let HasUnMaskedOverloaded = false; } class RVVMaskOp0Builtin : RVVOp0Builtin<"m", prototype, "c"> { @@ -435,7 +443,8 @@ class RVVMaskOp0Builtin : RVVOp0Builtin<"m", prototype, "c"> { let HasMaskedOffOperand = false; } -let HasMaskedOffOperand = false in { +let UnMaskedPolicy = HasPolicyOperand, + HasMaskedOffOperand = false in { multiclass RVVSlideBuiltinSet { defm "" : RVVOutBuiltinSet; @@ -453,29 +462,29 @@ class RVVFloatingUnaryBuiltin; class RVVConvBuiltin + string overloaded_name> : RVVBuiltin { let IntrinsicTypes = [-1, 0]; - let MangledName = mangled_name; + let OverloadedName = overloaded_name; } -class RVVConvToSignedBuiltin - : RVVConvBuiltin<"Iv", "Ivv", "xfd", mangled_name>; +class RVVConvToSignedBuiltin + : RVVConvBuiltin<"Iv", "Ivv", "xfd", overloaded_name>; -class RVVConvToUnsignedBuiltin - : RVVConvBuiltin<"Uv", "Uvv", "xfd", mangled_name>; +class RVVConvToUnsignedBuiltin + : RVVConvBuiltin<"Uv", "Uvv", "xfd", overloaded_name>; -class RVVConvToWidenSignedBuiltin - : RVVConvBuiltin<"Iw", "Iwv", "xf", mangled_name>; +class RVVConvToWidenSignedBuiltin + : RVVConvBuiltin<"Iw", "Iwv", "xf", overloaded_name>; -class RVVConvToWidenUnsignedBuiltin - : RVVConvBuiltin<"Uw", "Uwv", "xf", mangled_name>; +class RVVConvToWidenUnsignedBuiltin + : RVVConvBuiltin<"Uw", "Uwv", "xf", overloaded_name>; -class RVVConvToNarrowingSignedBuiltin - : RVVConvBuiltin<"Iv", "IvFw", "csi", mangled_name>; +class RVVConvToNarrowingSignedBuiltin + : RVVConvBuiltin<"Iv", "IvFw", "csi", overloaded_name>; -class RVVConvToNarrowingUnsignedBuiltin - : RVVConvBuiltin<"Uv", "UvFw", "csi", mangled_name>; +class RVVConvToNarrowingUnsignedBuiltin + : RVVConvBuiltin<"Uv", "UvFw", "csi", overloaded_name>; let HasMaskedOffOperand = false in { multiclass RVVSignedReductionBuiltin { @@ -504,10 +513,10 @@ multiclass RVVIntReductionBuiltinSet multiclass RVVWidenBuiltinSet> suffixes_prototypes> { let Log2LMUL = [-3, -2, -1, 0, 1, 2], - IRName = intrinsic_name, IRNameMask = intrinsic_name # "_mask" in { + IRName = intrinsic_name, MaskedIRName = intrinsic_name # "_mask" in { foreach s_p = suffixes_prototypes in { let Name = NAME # "_" # s_p[0], - MangledName = NAME # "_" # s_p[0] in { + OverloadedName = NAME # "_" # s_p[0] in { defvar suffix = s_p[1]; defvar prototype = s_p[2]; def : RVVOutOp0Op1Builtin; @@ -520,10 +529,10 @@ multiclass RVVWidenBuiltinSet> suffixes_prototypes> { let Log2LMUL = [-3, -2, -1, 0, 1, 2], - IRName = intrinsic_name, IRNameMask = intrinsic_name # "_mask" in { + IRName = intrinsic_name, MaskedIRName = intrinsic_name # "_mask" in { foreach s_p = suffixes_prototypes in { let Name = NAME # "_" # s_p[0], - MangledName = NAME # "_" # s_p[0] in { + OverloadedName = NAME # "_" # s_p[0] in { defvar suffix = s_p[1]; defvar prototype = s_p[2]; def : RVVOutOp1Builtin; @@ -572,13 +581,13 @@ class IsFloat { bit val = !or(!eq(type, "x"), !eq(type, "f"), !eq(type, "d")); } -let HasNoMaskedOverloaded = false, - HasPolicy = false, +let HasUnMaskedOverloaded = false, + MaskedPolicy = NonePolicy, ManualCodegen = [{ IntrinsicTypes = {ResultType, Ops[1]->getType()}; Ops[0] = Builder.CreateBitCast(Ops[0], ResultType->getPointerTo()); }], - ManualCodegenMask= [{ + MaskedManualCodegen= [{ // Move mask to right before vl. std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); IntrinsicTypes = {ResultType, Ops[3]->getType()}; @@ -587,17 +596,17 @@ let HasNoMaskedOverloaded = false, class RVVVLEMaskBuiltin : RVVBuiltin<"m", "mPCUe", "c"> { let Name = "vlm_v"; let IRName = "vlm"; - let HasMask = false; + let HasMasked = false; } } -let HasNoMaskedOverloaded = false, +let HasUnMaskedOverloaded = false, ManualCodegen = [{ IntrinsicTypes = {ResultType, Ops[1]->getType()}; Ops[0] = Builder.CreateBitCast(Ops[0], ResultType->getPointerTo()); Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); }], - ManualCodegenMask= [{ + MaskedManualCodegen= [{ // Move mask to right before vl. std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); Ops.push_back(ConstantInt::get(Ops.back()->getType(), TAIL_UNDISTURBED)); @@ -607,7 +616,7 @@ let HasNoMaskedOverloaded = false, multiclass RVVVLEBuiltin types> { let Name = NAME # "_v", IRName = "vle", - IRNameMask ="vle_mask" in { + MaskedIRName ="vle_mask" in { foreach type = types in { def : RVVBuiltin<"v", "vPCe", type>; if !not(IsFloat.val) then { @@ -621,8 +630,8 @@ let HasNoMaskedOverloaded = false, multiclass RVVVLEFFBuiltin types> { let Name = NAME # "_v", IRName = "vleff", - IRNameMask = "vleff_mask", - HasNoMaskedOverloaded = false, + MaskedIRName = "vleff_mask", + HasUnMaskedOverloaded = false, ManualCodegen = [{ { IntrinsicTypes = {ResultType, Ops[2]->getType()}; @@ -636,12 +645,12 @@ multiclass RVVVLEFFBuiltin types> { // Store new_vl. clang::CharUnits Align = CGM.getNaturalPointeeTypeAlignment(E->getArg(1)->getType()); - Builder.CreateStore(Builder.CreateExtractValue(LoadValue, {1}), - Address(NewVL, Align)); + llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {1}); + Builder.CreateStore(Val, Address(NewVL, Val->getType(), Align)); return V; } }], - ManualCodegenMask = [{ + MaskedManualCodegen = [{ { // Move mask to right before vl. std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); @@ -656,8 +665,8 @@ multiclass RVVVLEFFBuiltin types> { // Store new_vl. clang::CharUnits Align = CGM.getNaturalPointeeTypeAlignment(E->getArg(3)->getType()); - Builder.CreateStore(Builder.CreateExtractValue(LoadValue, {1}), - Address(NewVL, Align)); + llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {1}); + Builder.CreateStore(Val, Address(NewVL, Val->getType(), Align)); return V; } }] in { @@ -674,14 +683,14 @@ multiclass RVVVLEFFBuiltin types> { multiclass RVVVLSEBuiltin types> { let Name = NAME # "_v", IRName = "vlse", - IRNameMask ="vlse_mask", - HasNoMaskedOverloaded = false, + MaskedIRName ="vlse_mask", + HasUnMaskedOverloaded = false, ManualCodegen = [{ IntrinsicTypes = {ResultType, Ops[2]->getType()}; Ops[0] = Builder.CreateBitCast(Ops[0], ResultType->getPointerTo()); Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); }], - ManualCodegenMask= [{ + MaskedManualCodegen= [{ // Move mask to right before vl. std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); Ops.push_back(ConstantInt::get(Ops.back()->getType(), TAIL_UNDISTURBED)); @@ -703,7 +712,7 @@ multiclass RVVIndexedLoad { Ops[0] = Builder.CreateBitCast(Ops[0], ResultType->getPointerTo()); Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); }], - ManualCodegenMask = [{ + MaskedManualCodegen = [{ // Move mask to right before vl. std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); Ops.push_back(ConstantInt::get(Ops.back()->getType(), TAIL_UNDISTURBED)); @@ -714,7 +723,7 @@ multiclass RVVIndexedLoad { foreach eew_list = EEWList[0-2] in { defvar eew = eew_list[0]; defvar eew_type = eew_list[1]; - let Name = op # eew # "_v", IRName = op, IRNameMask = op # "_mask" in { + let Name = op # eew # "_v", IRName = op, MaskedIRName = op # "_mask" in { def: RVVBuiltin<"v", "vPCe" # eew_type # "Uv", type>; if !not(IsFloat.val) then { def: RVVBuiltin<"Uv", "UvPCUe" # eew_type # "Uv", type>; @@ -723,7 +732,7 @@ multiclass RVVIndexedLoad { } defvar eew64 = "64"; defvar eew64_type = "(Log2EEW:6)"; - let Name = op # eew64 # "_v", IRName = op, IRNameMask = op # "_mask", + let Name = op # eew64 # "_v", IRName = op, MaskedIRName = op # "_mask", RequiredFeatures = ["RV64"] in { def: RVVBuiltin<"v", "vPCe" # eew64_type # "Uv", type>; if !not(IsFloat.val) then { @@ -735,14 +744,14 @@ multiclass RVVIndexedLoad { } let HasMaskedOffOperand = false, - HasPolicy = false, + MaskedPolicy = NonePolicy, ManualCodegen = [{ // Builtin: (ptr, value, vl). Intrinsic: (value, ptr, vl) std::swap(Ops[0], Ops[1]); Ops[1] = Builder.CreateBitCast(Ops[1], Ops[0]->getType()->getPointerTo()); IntrinsicTypes = {Ops[0]->getType(), Ops[2]->getType()}; }], - ManualCodegenMask= [{ + MaskedManualCodegen= [{ // Builtin: (mask, ptr, value, vl). Intrinsic: (value, ptr, mask, vl) std::swap(Ops[0], Ops[2]); Ops[1] = Builder.CreateBitCast(Ops[1], Ops[0]->getType()->getPointerTo()); @@ -751,12 +760,12 @@ let HasMaskedOffOperand = false, class RVVVSEMaskBuiltin : RVVBuiltin<"m", "0PUem", "c"> { let Name = "vsm_v"; let IRName = "vsm"; - let HasMask = false; + let HasMasked = false; } multiclass RVVVSEBuiltin types> { let Name = NAME # "_v", IRName = "vse", - IRNameMask = "vse_mask" in { + MaskedIRName = "vse_mask" in { foreach type = types in { def : RVVBuiltin<"v", "0Pev", type>; if !not(IsFloat.val) then { @@ -770,16 +779,16 @@ let HasMaskedOffOperand = false, multiclass RVVVSSEBuiltin types> { let Name = NAME # "_v", IRName = "vsse", - IRNameMask = "vsse_mask", + MaskedIRName = "vsse_mask", HasMaskedOffOperand = false, - HasPolicy = false, + MaskedPolicy = NonePolicy, ManualCodegen = [{ // Builtin: (ptr, stride, value, vl). Intrinsic: (value, ptr, stride, vl) std::rotate(Ops.begin(), Ops.begin() + 2, Ops.begin() + 3); Ops[1] = Builder.CreateBitCast(Ops[1], Ops[0]->getType()->getPointerTo()); IntrinsicTypes = {Ops[0]->getType(), Ops[3]->getType()}; }], - ManualCodegenMask= [{ + MaskedManualCodegen= [{ // Builtin: (mask, ptr, stride, value, vl). Intrinsic: (value, ptr, stride, mask, vl) std::swap(Ops[0], Ops[3]); Ops[1] = Builder.CreateBitCast(Ops[1], Ops[0]->getType()->getPointerTo()); @@ -796,14 +805,14 @@ multiclass RVVVSSEBuiltin types> { multiclass RVVIndexedStore { let HasMaskedOffOperand = false, - HasPolicy = false, + MaskedPolicy = NonePolicy, ManualCodegen = [{ // Builtin: (ptr, index, value, vl). Intrinsic: (value, ptr, index, vl) std::rotate(Ops.begin(), Ops.begin() + 2, Ops.begin() + 3); Ops[1] = Builder.CreateBitCast(Ops[1],Ops[0]->getType()->getPointerTo()); IntrinsicTypes = {Ops[0]->getType(), Ops[2]->getType(), Ops[3]->getType()}; }], - ManualCodegenMask= [{ + MaskedManualCodegen= [{ // Builtin: (mask, ptr, index, value, vl). Intrinsic: (value, ptr, index, mask, vl) std::swap(Ops[0], Ops[3]); Ops[1] = Builder.CreateBitCast(Ops[1], Ops[0]->getType()->getPointerTo()); @@ -813,7 +822,7 @@ multiclass RVVIndexedStore { foreach eew_list = EEWList[0-2] in { defvar eew = eew_list[0]; defvar eew_type = eew_list[1]; - let Name = op # eew # "_v", IRName = op, IRNameMask = op # "_mask" in { + let Name = op # eew # "_v", IRName = op, MaskedIRName = op # "_mask" in { def : RVVBuiltin<"v", "0Pe" # eew_type # "Uvv", type>; if !not(IsFloat.val) then { def : RVVBuiltin<"Uv", "0PUe" # eew_type # "UvUv", type>; @@ -822,7 +831,7 @@ multiclass RVVIndexedStore { } defvar eew64 = "64"; defvar eew64_type = "(Log2EEW:6)"; - let Name = op # eew64 # "_v", IRName = op, IRNameMask = op # "_mask", + let Name = op # eew64 # "_v", IRName = op, MaskedIRName = op # "_mask", RequiredFeatures = ["RV64"] in { def : RVVBuiltin<"v", "0Pe" # eew64_type # "Uvv", type>; if !not(IsFloat.val) then { @@ -858,29 +867,33 @@ multiclass RVVUnitStridedSegLoad { foreach nf = NFList in { let Name = op # nf # "e" # eew # "_v", IRName = op # nf, - IRNameMask = op # nf # "_mask", + MaskedIRName = op # nf # "_mask", NF = nf, - HasNoMaskedOverloaded = false, + HasUnMaskedOverloaded = false, ManualCodegen = [{ { // builtin: (val0 address, val1 address, ..., ptr, vl) - IntrinsicTypes = {ConvertType(E->getArg(0)->getType()->getPointeeType()), - Ops[NF + 1]->getType()}; - // intrinsic: (ptr, vl) - llvm::Value *Operands[] = {Ops[NF], Ops[NF + 1]}; + ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); + IntrinsicTypes = {ResultType, Ops[NF + 1]->getType()}; + // intrinsic: (passthru0, passthru1, ..., ptr, vl) + SmallVector Operands; + for (unsigned I = 0; I < NF; ++I) + Operands.push_back(llvm::UndefValue::get(ResultType)); + Operands.push_back(Ops[NF]); + Operands.push_back(Ops[NF + 1]); llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); clang::CharUnits Align = - CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); + CGM.getNaturalPointeeTypeAlignment(E->getArg(NF)->getType()); llvm::Value *V; for (unsigned I = 0; I < NF; ++I) { - V = Builder.CreateStore(Builder.CreateExtractValue(LoadValue, {I}), - Address(Ops[I], Align)); + llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); + V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); } return V; } }], - ManualCodegenMask = [{ + MaskedManualCodegen = [{ { // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, vl) // intrinsic: (maskedoff0, ..., ptr, mask, vl) @@ -900,8 +913,8 @@ multiclass RVVUnitStridedSegLoad { CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); llvm::Value *V; for (unsigned I = 0; I < NF; ++I) { - V = Builder.CreateStore(Builder.CreateExtractValue(LoadValue, {I}), - Address(Ops[I], Align)); + llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); + V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); } return V; } @@ -929,31 +942,35 @@ multiclass RVVUnitStridedSegLoadFF { foreach nf = NFList in { let Name = op # nf # "e" # eew # "ff_v", IRName = op # nf # "ff", - IRNameMask = op # nf # "ff_mask", + MaskedIRName = op # nf # "ff_mask", NF = nf, - HasNoMaskedOverloaded = false, + HasUnMaskedOverloaded = false, ManualCodegen = [{ { // builtin: (val0 address, val1 address, ..., ptr, new_vl, vl) - IntrinsicTypes = {ConvertType(E->getArg(0)->getType()->getPointeeType()), - Ops[NF + 2]->getType()}; - // intrinsic: (ptr, vl) - llvm::Value *Operands[] = {Ops[NF], Ops[NF + 2]}; + ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); + IntrinsicTypes = {ResultType, Ops[NF + 2]->getType()}; + // intrinsic: (passthru0, passthru1, ..., ptr, vl) + SmallVector Operands; + for (unsigned I = 0; I < NF; ++I) + Operands.push_back(llvm::UndefValue::get(ResultType)); + Operands.push_back(Ops[NF]); + Operands.push_back(Ops[NF + 2]); Value *NewVL = Ops[NF + 1]; llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); clang::CharUnits Align = CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); for (unsigned I = 0; I < NF; ++I) { - Builder.CreateStore(Builder.CreateExtractValue(LoadValue, {I}), - Address(Ops[I], Align)); + llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); + Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); } // Store new_vl. - return Builder.CreateStore(Builder.CreateExtractValue(LoadValue, {NF}), - Address(NewVL, Align)); + llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {NF}); + return Builder.CreateStore(Val, Address(NewVL, Val->getType(), Align)); } }], - ManualCodegenMask = [{ + MaskedManualCodegen = [{ { // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, new_vl, vl) // intrinsic: (maskedoff0, ..., ptr, mask, vl) @@ -973,12 +990,12 @@ multiclass RVVUnitStridedSegLoadFF { clang::CharUnits Align = CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); for (unsigned I = 0; I < NF; ++I) { - Builder.CreateStore(Builder.CreateExtractValue(LoadValue, {I}), - Address(Ops[I], Align)); + llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); + Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); } // Store new_vl. - return Builder.CreateStore(Builder.CreateExtractValue(LoadValue, {NF}), - Address(NewVL, Align)); + llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {NF}); + return Builder.CreateStore(Val, Address(NewVL, Val->getType(), Align)); } }] in { defvar PV = PVString.S; @@ -1004,29 +1021,34 @@ multiclass RVVStridedSegLoad { foreach nf = NFList in { let Name = op # nf # "e" # eew # "_v", IRName = op # nf, - IRNameMask = op # nf # "_mask", + MaskedIRName = op # nf # "_mask", NF = nf, - HasNoMaskedOverloaded = false, + HasUnMaskedOverloaded = false, ManualCodegen = [{ { // builtin: (val0 address, val1 address, ..., ptr, stride, vl) - IntrinsicTypes = {ConvertType(E->getArg(0)->getType()->getPointeeType()), - Ops[NF + 2]->getType()}; - // intrinsic: (ptr, stride, vl) - llvm::Value *Operands[] = {Ops[NF], Ops[NF + 1], Ops[NF + 2]}; + ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); + IntrinsicTypes = {ResultType, Ops[NF + 2]->getType()}; + // intrinsic: (passthru0, passthru1, ..., ptr, stride, vl) + SmallVector Operands; + for (unsigned I = 0; I < NF; ++I) + Operands.push_back(llvm::UndefValue::get(ResultType)); + Operands.push_back(Ops[NF]); + Operands.push_back(Ops[NF + 1]); + Operands.push_back(Ops[NF + 2]); llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); clang::CharUnits Align = CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); llvm::Value *V; for (unsigned I = 0; I < NF; ++I) { - V = Builder.CreateStore(Builder.CreateExtractValue(LoadValue, {I}), - Address(Ops[I], Align)); + llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); + V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); } return V; } }], - ManualCodegenMask = [{ + MaskedManualCodegen = [{ { // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, stride, vl) // intrinsic: (maskedoff0, ..., ptr, stride, mask, vl) @@ -1047,8 +1069,8 @@ multiclass RVVStridedSegLoad { CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); llvm::Value *V; for (unsigned I = 0; I < NF; ++I) { - V = Builder.CreateStore(Builder.CreateExtractValue(LoadValue, {I}), - Address(Ops[I], Align)); + llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); + V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); } return V; } @@ -1072,28 +1094,33 @@ multiclass RVVIndexedSegLoad { foreach nf = NFList in { let Name = op # nf # "ei" # eew # "_v", IRName = op # nf, - IRNameMask = op # nf # "_mask", + MaskedIRName = op # nf # "_mask", NF = nf, ManualCodegen = [{ { // builtin: (val0 address, val1 address, ..., ptr, index, vl) - IntrinsicTypes = {ConvertType(E->getArg(0)->getType()->getPointeeType()), - Ops[NF + 1]->getType(), Ops[NF + 2]->getType()}; - // intrinsic: (ptr, index, vl) - llvm::Value *Operands[] = {Ops[NF], Ops[NF + 1], Ops[NF + 2]}; + ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); + IntrinsicTypes = {ResultType, Ops[NF + 1]->getType(), Ops[NF + 2]->getType()}; + // intrinsic: (passthru0, passthru1, ..., ptr, index, vl) + SmallVector Operands; + for (unsigned I = 0; I < NF; ++I) + Operands.push_back(llvm::UndefValue::get(ResultType)); + Operands.push_back(Ops[NF]); + Operands.push_back(Ops[NF + 1]); + Operands.push_back(Ops[NF + 2]); llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); clang::CharUnits Align = CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); llvm::Value *V; for (unsigned I = 0; I < NF; ++I) { - V = Builder.CreateStore(Builder.CreateExtractValue(LoadValue, {I}), - Address(Ops[I], Align)); + llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); + V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); } return V; } }], - ManualCodegenMask = [{ + MaskedManualCodegen = [{ { // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, index, vl) IntrinsicTypes = {ConvertType(E->getArg(0)->getType()->getPointeeType()), @@ -1114,8 +1141,8 @@ multiclass RVVIndexedSegLoad { CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); llvm::Value *V; for (unsigned I = 0; I < NF; ++I) { - V = Builder.CreateStore(Builder.CreateExtractValue(LoadValue, {I}), - Address(Ops[I], Align)); + llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); + V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); } return V; } @@ -1154,10 +1181,10 @@ multiclass RVVUnitStridedSegStore { foreach nf = NFList in { let Name = op # nf # "e" # eew # "_v", IRName = op # nf, - IRNameMask = op # nf # "_mask", + MaskedIRName = op # nf # "_mask", NF = nf, HasMaskedOffOperand = false, - HasPolicy = false, + MaskedPolicy = NonePolicy, ManualCodegen = [{ { // Builtin: (ptr, val0, val1, ..., vl) @@ -1167,7 +1194,7 @@ multiclass RVVUnitStridedSegStore { assert(Ops.size() == NF + 2); } }], - ManualCodegenMask = [{ + MaskedManualCodegen = [{ { // Builtin: (mask, ptr, val0, val1, ..., vl) // Intrinsic: (val0, val1, ..., ptr, mask, vl) @@ -1200,10 +1227,10 @@ multiclass RVVStridedSegStore { foreach nf = NFList in { let Name = op # nf # "e" # eew # "_v", IRName = op # nf, - IRNameMask = op # nf # "_mask", + MaskedIRName = op # nf # "_mask", NF = nf, HasMaskedOffOperand = false, - HasPolicy = false, + MaskedPolicy = NonePolicy, ManualCodegen = [{ { // Builtin: (ptr, stride, val0, val1, ..., vl). @@ -1213,7 +1240,7 @@ multiclass RVVStridedSegStore { assert(Ops.size() == NF + 3); } }], - ManualCodegenMask = [{ + MaskedManualCodegen = [{ { // Builtin: (mask, ptr, stride, val0, val1, ..., vl). // Intrinsic: (val0, val1, ..., ptr, stride, mask, vl) @@ -1242,10 +1269,10 @@ multiclass RVVIndexedSegStore { foreach nf = NFList in { let Name = op # nf # "ei" # eew # "_v", IRName = op # nf, - IRNameMask = op # nf # "_mask", + MaskedIRName = op # nf # "_mask", NF = nf, HasMaskedOffOperand = false, - HasPolicy = false, + MaskedPolicy = NonePolicy, ManualCodegen = [{ { // Builtin: (ptr, index, val0, val1, ..., vl) @@ -1256,7 +1283,7 @@ multiclass RVVIndexedSegStore { assert(Ops.size() == NF + 3); } }], - ManualCodegenMask = [{ + MaskedManualCodegen = [{ { // Builtin: (mask, ptr, index, val0, val1, ..., vl) // Intrinsic: (val0, val1, ..., ptr, index, mask, vl) @@ -1282,7 +1309,7 @@ multiclass RVVIndexedSegStore { multiclass RVVPseudoUnaryBuiltin { let Name = NAME, IRName = IR, - IRNameMask = IR # "_mask", + MaskedIRName = IR # "_mask", ManualCodegen = [{ { // op1, vl @@ -1290,10 +1317,12 @@ multiclass RVVPseudoUnaryBuiltin { cast(ResultType)->getElementType(), Ops[1]->getType()}; Ops.insert(Ops.begin() + 1, llvm::Constant::getNullValue(IntrinsicTypes[1])); + // insert undef passthru + Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); break; } }], - ManualCodegenMask = [{ + MaskedManualCodegen = [{ { std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); Ops.push_back(ConstantInt::get(Ops.back()->getType(), TAIL_UNDISTURBED)); @@ -1312,7 +1341,7 @@ multiclass RVVPseudoUnaryBuiltin { multiclass RVVPseudoVNotBuiltin { let Name = NAME, IRName = IR, - IRNameMask = IR # "_mask", + MaskedIRName = IR # "_mask", ManualCodegen = [{ { // op1, vl @@ -1321,10 +1350,12 @@ multiclass RVVPseudoVNotBuiltin { Ops[1]->getType()}; Ops.insert(Ops.begin() + 1, llvm::Constant::getAllOnesValue(IntrinsicTypes[1])); + // insert undef passthru + Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); break; } }], - ManualCodegenMask = [{ + MaskedManualCodegen = [{ { std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); Ops.push_back(ConstantInt::get(Ops.back()->getType(), TAIL_UNDISTURBED)); @@ -1345,7 +1376,7 @@ multiclass RVVPseudoVNotBuiltin { multiclass RVVPseudoMaskBuiltin { let Name = NAME, IRName = IR, - HasMask = false, + HasMasked = false, ManualCodegen = [{ { // op1, vl @@ -1362,17 +1393,19 @@ multiclass RVVPseudoMaskBuiltin { multiclass RVVPseudoVFUnaryBuiltin { let Name = NAME, IRName = IR, - IRNameMask = IR # "_mask", + MaskedIRName = IR # "_mask", ManualCodegen = [{ { // op1, vl IntrinsicTypes = {ResultType, Ops[0]->getType(), Ops[1]->getType()}; Ops.insert(Ops.begin() + 1, Ops[0]); + // insert undef passthru + Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); break; } }], - ManualCodegenMask = [{ + MaskedManualCodegen = [{ { std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); Ops.push_back(ConstantInt::get(Ops.back()->getType(), TAIL_UNDISTURBED)); @@ -1391,9 +1424,9 @@ multiclass RVVPseudoVFUnaryBuiltin { multiclass RVVPseudoVWCVTBuiltin> suffixes_prototypes> { let Name = NAME, - MangledName = MName, + OverloadedName = MName, IRName = IR, - IRNameMask = IR # "_mask", + MaskedIRName = IR # "_mask", ManualCodegen = [{ { // op1, vl @@ -1402,10 +1435,12 @@ multiclass RVVPseudoVWCVTBuiltin(Ops[0]->getType())->getElementType(), Ops[1]->getType()}; Ops.insert(Ops.begin() + 1, llvm::Constant::getNullValue(IntrinsicTypes[2])); + // insert undef passthru + Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); break; } }], - ManualCodegenMask = [{ + MaskedManualCodegen = [{ { std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); Ops.push_back(ConstantInt::get(Ops.back()->getType(), TAIL_UNDISTURBED)); @@ -1427,9 +1462,9 @@ multiclass RVVPseudoVWCVTBuiltin> suffixes_prototypes> { let Name = NAME, - MangledName = MName, + OverloadedName = MName, IRName = IR, - IRNameMask = IR # "_mask", + MaskedIRName = IR # "_mask", ManualCodegen = [{ { // op1, vl @@ -1438,10 +1473,12 @@ multiclass RVVPseudoVNCVTBuiltingetType(), Ops[1]->getType()}; Ops.insert(Ops.begin() + 1, llvm::Constant::getNullValue(IntrinsicTypes[2])); + // insert undef passthru + Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); break; } }], - ManualCodegenMask = [{ + MaskedManualCodegen = [{ { std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); Ops.push_back(ConstantInt::get(Ops.back()->getType(), TAIL_UNDISTURBED)); @@ -1460,16 +1497,62 @@ multiclass RVVPseudoVNCVTBuiltin; - - let HeaderCode = -[{ #define vsetvlmax_e8mf8() __builtin_rvv_vsetvlimax(0, 5) #define vsetvlmax_e8mf4() __builtin_rvv_vsetvlimax(0, 6) #define vsetvlmax_e8mf2() __builtin_rvv_vsetvlimax(0, 7) @@ -1527,8 +1605,17 @@ let HasVL = false, #define vsetvlmax_e64m2() __builtin_rvv_vsetvlimax(3, 1) #define vsetvlmax_e64m4() __builtin_rvv_vsetvlimax(3, 2) #define vsetvlmax_e64m8() __builtin_rvv_vsetvlimax(3, 3) - }] in +def vsetvl_macro: RVVHeader; + +let HasBuiltinAlias = false, + HasVL = false, + HasMasked = false, + MaskedPolicy = NonePolicy, + Log2LMUL = [0], + ManualCodegen = [{IntrinsicTypes = {ResultType};}] in // Set XLEN type +{ + def vsetvli : RVVBuiltin<"", "zzKzKz", "i">; def vsetvlimax : RVVBuiltin<"", "zKzKz", "i">; } @@ -1583,15 +1670,18 @@ defm : RVVIndexedSegStore<"vsoxseg">; // 12. Vector Integer Arithmetic Instructions // 12.1. Vector Single-Width Integer Add and Subtract +let UnMaskedPolicy = HasPassthruOperand in { defm vadd : RVVIntBinBuiltinSet; defm vsub : RVVIntBinBuiltinSet; defm vrsub : RVVOutOp1BuiltinSet<"vrsub", "csil", [["vx", "v", "vve"], ["vx", "Uv", "UvUvUe"]]>; +} defm vneg_v : RVVPseudoUnaryBuiltin<"vrsub", "csil">; // 12.2. Vector Widening Integer Add/Subtract // Widening unsigned integer add/subtract, 2*SEW = SEW +/- SEW +let UnMaskedPolicy = HasPassthruOperand in { defm vwaddu : RVVUnsignedWidenBinBuiltinSet; defm vwsubu : RVVUnsignedWidenBinBuiltinSet; // Widening signed integer add/subtract, 2*SEW = SEW +/- SEW @@ -1603,12 +1693,14 @@ defm vwsubu : RVVUnsignedWidenOp0BinBuiltinSet; // Widening signed integer add/subtract, 2*SEW = 2*SEW +/- SEW defm vwadd : RVVSignedWidenOp0BinBuiltinSet; defm vwsub : RVVSignedWidenOp0BinBuiltinSet; +} defm vwcvtu_x_x_v : RVVPseudoVWCVTBuiltin<"vwaddu", "vwcvtu_x", "csi", [["Uw", "UwUv"]]>; defm vwcvt_x_x_v : RVVPseudoVWCVTBuiltin<"vwadd", "vwcvt_x", "csi", [["w", "wv"]]>; // 12.3. Vector Integer Extension +let UnMaskedPolicy = HasPassthruOperand in { let Log2LMUL = [-3, -2, -1, 0, 1, 2] in { def vsext_vf2 : RVVIntExt<"vsext", "w", "wv", "csi">; def vzext_vf2 : RVVIntExt<"vzext", "Uw", "UwUv", "csi">; @@ -1621,24 +1713,30 @@ let Log2LMUL = [-3, -2, -1, 0] in { def vsext_vf8 : RVVIntExt<"vsext", "o", "ov", "c">; def vzext_vf8 : RVVIntExt<"vzext", "Uo", "UoUv", "c">; } +} // 12.4. Vector Integer Add-with-Carry / Subtract-with-Borrow Instructions -let HasMask = false, HasPolicy = false in { - defm vadc : RVVCarryinBuiltinSet; +let HasMasked = false, MaskedPolicy = NonePolicy in { + let UnMaskedPolicy = HasPassthruOperand in { + defm vadc : RVVCarryinBuiltinSet; + defm vsbc : RVVCarryinBuiltinSet; + } defm vmadc : RVVCarryOutInBuiltinSet<"vmadc_carry_in">; defm vmadc : RVVIntMaskOutBuiltinSet; - defm vsbc : RVVCarryinBuiltinSet; defm vmsbc : RVVCarryOutInBuiltinSet<"vmsbc_borrow_in">; defm vmsbc : RVVIntMaskOutBuiltinSet; } // 12.5. Vector Bitwise Logical Instructions +let UnMaskedPolicy = HasPassthruOperand in { defm vand : RVVIntBinBuiltinSet; defm vxor : RVVIntBinBuiltinSet; defm vor : RVVIntBinBuiltinSet; +} defm vnot_v : RVVPseudoVNotBuiltin<"vxor", "csil">; // 12.6. Vector Single-Width Bit Shift Instructions +let UnMaskedPolicy = HasPassthruOperand in { defm vsll : RVVShiftBuiltinSet; defm vsrl : RVVUnsignedShiftBuiltinSet; defm vsra : RVVSignedShiftBuiltinSet; @@ -1646,12 +1744,13 @@ defm vsra : RVVSignedShiftBuiltinSet; // 12.7. Vector Narrowing Integer Right Shift Instructions defm vnsrl : RVVUnsignedNShiftBuiltinSet; defm vnsra : RVVSignedNShiftBuiltinSet; +} defm vncvt_x_x_w : RVVPseudoVNCVTBuiltin<"vnsrl", "vncvt_x", "csi", [["v", "vw"], ["Uv", "UvUw"]]>; // 12.8. Vector Integer Comparison Instructions -let HasPolicy = false in { +let MaskedPolicy = NonePolicy in { defm vmseq : RVVIntMaskOutBuiltinSet; defm vmsne : RVVIntMaskOutBuiltinSet; defm vmsltu : RVVUnsignedMaskOutBuiltinSet; @@ -1665,6 +1764,7 @@ defm vmsge : RVVSignedMaskOutBuiltinSet; } // 12.9. Vector Integer Min/Max Instructions +let UnMaskedPolicy = HasPassthruOperand in { defm vminu : RVVUnsignedBinBuiltinSet; defm vmin : RVVSignedBinBuiltinSet; defm vmaxu : RVVUnsignedBinBuiltinSet; @@ -1685,9 +1785,10 @@ defm vdivu : RVVUnsignedBinBuiltinSet; defm vdiv : RVVSignedBinBuiltinSet; defm vremu : RVVUnsignedBinBuiltinSet; defm vrem : RVVSignedBinBuiltinSet; +} // 12.12. Vector Widening Integer Multiply Instructions -let Log2LMUL = [-3, -2, -1, 0, 1, 2] in { +let Log2LMUL = [-3, -2, -1, 0, 1, 2], UnMaskedPolicy = HasPassthruOperand in { defm vwmul : RVVOutOp0Op1BuiltinSet<"vwmul", "csi", [["vv", "w", "wvv"], ["vx", "w", "wve"]]>; @@ -1700,7 +1801,7 @@ defm vwmulsu : RVVOutOp0Op1BuiltinSet<"vwmulsu", "csi", } // 12.13. Vector Single-Width Integer Multiply-Add Instructions -let HasPolicy = false in { +let UnMaskedPolicy = HasPolicyOperand in { defm vmacc : RVVIntTerBuiltinSet; defm vnmsac : RVVIntTerBuiltinSet; defm vmadd : RVVIntTerBuiltinSet; @@ -1725,10 +1826,12 @@ defm vwmaccus : RVVOutOp1Op2BuiltinSet<"vwmaccus", "csi", // 12.15. Vector Integer Merge Instructions // C/C++ Operand: (mask, op1, op2, vl), Intrinsic: (op1, op2, mask, vl) -let HasMask = false, HasPolicy = false, +let HasMasked = false, MaskedPolicy = NonePolicy, ManualCodegen = [{ std::rotate(Ops.begin(), Ops.begin() + 1, Ops.begin() + 3); IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[3]->getType()}; + // insert undef passthru + Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); }] in { defm vmerge : RVVOutOp1BuiltinSet<"vmerge", "csil", [["vvm", "v", "vmvv"], @@ -1738,14 +1841,14 @@ let HasMask = false, HasPolicy = false, } // 12.16. Vector Integer Move Instructions -let HasMask = false, HasPolicy = false in { - let MangledName = "vmv_v" in { +let HasMasked = false, UnMaskedPolicy = HasPassthruOperand, MaskedPolicy = NonePolicy in { + let OverloadedName = "vmv_v" in { defm vmv_v : RVVOutBuiltinSet<"vmv_v_v", "csil", [["v", "Uv", "UvUv"]]>; defm vmv_v : RVVOutBuiltinSet<"vmv_v_v", "csilxfd", [["v", "v", "vv"]]>; } - let HasNoMaskedOverloaded = false in + let HasUnMaskedOverloaded = false in defm vmv_v : RVVOutBuiltinSet<"vmv_v_x", "csil", [["x", "v", "ve"], ["x", "Uv", "UvUe"]]>; @@ -1753,6 +1856,7 @@ let HasMask = false, HasPolicy = false in { // 13. Vector Fixed-Point Arithmetic Instructions // 13.1. Vector Single-Width Saturating Add and Subtract +let UnMaskedPolicy = HasPassthruOperand in { defm vsaddu : RVVUnsignedBinBuiltinSet; defm vsadd : RVVSignedBinBuiltinSet; defm vssubu : RVVUnsignedBinBuiltinSet; @@ -1802,9 +1906,10 @@ let Log2LMUL = [-2, -1, 0, 1, 2] in { [["vv", "w", "wvv"], ["vf", "w", "wve"]]>; } +} // 14.6. Vector Single-Width Floating-Point Fused Multiply-Add Instructions -let HasPolicy = false in { +let UnMaskedPolicy = HasPolicyOperand in { defm vfmacc : RVVFloatingTerBuiltinSet; defm vfnmacc : RVVFloatingTerBuiltinSet; defm vfmsac : RVVFloatingTerBuiltinSet; @@ -1822,6 +1927,7 @@ defm vfwnmsac : RVVFloatingWidenTerBuiltinSet; } // 14.8. Vector Floating-Point Square-Root Instruction +let UnMaskedPolicy = HasPassthruOperand in { def vfsqrt : RVVFloatingUnaryVVBuiltin; // 14.9. Vector Floating-Point Reciprocal Square-Root Estimate Instruction @@ -1838,11 +1944,12 @@ defm vfmax : RVVFloatingBinBuiltinSet; defm vfsgnj : RVVFloatingBinBuiltinSet; defm vfsgnjn : RVVFloatingBinBuiltinSet; defm vfsgnjx : RVVFloatingBinBuiltinSet; +} defm vfneg_v : RVVPseudoVFUnaryBuiltin<"vfsgnjn", "xfd">; defm vfabs_v : RVVPseudoVFUnaryBuiltin<"vfsgnjx", "xfd">; // 14.13. Vector Floating-Point Compare Instructions -let HasPolicy = false in { +let MaskedPolicy = NonePolicy in { defm vmfeq : RVVFloatingMaskOutBuiltinSet; defm vmfne : RVVFloatingMaskOutBuiltinSet; defm vmflt : RVVFloatingMaskOutBuiltinSet; @@ -1852,15 +1959,17 @@ defm vmfge : RVVFloatingMaskOutBuiltinSet; } // 14.14. Vector Floating-Point Classify Instruction -let Name = "vfclass_v", HasPolicy = false in +let Name = "vfclass_v", UnMaskedPolicy = HasPassthruOperand in def vfclass : RVVOp0Builtin<"Uv", "Uvv", "xfd">; // 14.15. Vector Floating-Point Merge Instructio // C/C++ Operand: (mask, op1, op2, vl), Builtin: (op1, op2, mask, vl) -let HasMask = false, HasPolicy = false, +let HasMasked = false, MaskedPolicy = NonePolicy, ManualCodegen = [{ std::rotate(Ops.begin(), Ops.begin() + 1, Ops.begin() + 3); IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[3]->getType()}; + // insert undef passthru + Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); }] in { defm vmerge : RVVOutOp1BuiltinSet<"vmerge", "xfd", [["vvm", "v", "vmvv"]]>; @@ -1869,11 +1978,13 @@ let HasMask = false, HasPolicy = false, } // 14.16. Vector Floating-Point Move Instruction -let HasMask = false, HasNoMaskedOverloaded = false, HasPolicy = false in +let HasMasked = false, UnMaskedPolicy = HasPassthruOperand, + HasUnMaskedOverloaded = false, MaskedPolicy = NonePolicy in defm vfmv_v : RVVOutBuiltinSet<"vfmv_v_f", "xfd", [["f", "v", "ve"]]>; // 14.17. Single-Width Floating-Point/Integer Type-Convert Instructions +let UnMaskedPolicy = HasPassthruOperand in { def vfcvt_xu_f_v : RVVConvToUnsignedBuiltin<"vfcvt_xu">; def vfcvt_x_f_v : RVVConvToSignedBuiltin<"vfcvt_x">; def vfcvt_rtz_xu_f_v : RVVConvToUnsignedBuiltin<"vfcvt_rtz_xu">; @@ -1903,10 +2014,11 @@ let Log2LMUL = [-3, -2, -1, 0, 1, 2] in { def vfncvt_f_f_w : RVVConvBuiltin<"v", "vw", "xf", "vfncvt_f">; def vfncvt_rod_f_f_w : RVVConvBuiltin<"v", "vw", "xf", "vfncvt_rod_f">; } +} // 15. Vector Reduction Operations // 15.1. Vector Single-Width Integer Reduction Instructions -let HasPolicy = false in { +let MaskedPolicy = NonePolicy in { defm vredsum : RVVIntReductionBuiltinSet; defm vredmaxu : RVVUnsignedReductionBuiltin; defm vredmax : RVVSignedReductionBuiltin; @@ -1952,7 +2064,7 @@ def vmset : RVVMaskNullaryBuiltin; defm vmmv_m : RVVPseudoMaskBuiltin<"vmand", "c">; defm vmnot_m : RVVPseudoMaskBuiltin<"vmnand", "c">; -let HasPolicy = false in { +let MaskedPolicy = NonePolicy in { // 16.2. Vector count population in mask vcpop.m def vcpop : RVVMaskOp0Builtin<"um">; @@ -1967,8 +2079,9 @@ def vmsif : RVVMaskUnaryBuiltin; // 16.6. vmsof.m set-only-first mask bit def vmsof : RVVMaskUnaryBuiltin; +} -let HasNoMaskedOverloaded = false in { +let UnMaskedPolicy = HasPassthruOperand, HasUnMaskedOverloaded = false in { // 16.8. Vector Iota Instruction defm viota : RVVOutBuiltinSet<"viota", "csil", [["m", "Uv", "Uvm"]]>; @@ -1976,41 +2089,39 @@ let HasNoMaskedOverloaded = false in { defm vid : RVVOutBuiltinSet<"vid", "csil", [["v", "v", "v"], ["v", "Uv", "Uv"]]>; } -} // 17. Vector Permutation Instructions // 17.1. Integer Scalar Move Instructions -let HasMask = false, HasPolicy = false in { - let HasVL = false, MangledName = "vmv_x" in +let HasMasked = false, MaskedPolicy = NonePolicy in { + let HasVL = false, OverloadedName = "vmv_x" in defm vmv_x : RVVOp0BuiltinSet<"vmv_x_s", "csil", [["s", "ve", "ev"], ["s", "UvUe", "UeUv"]]>; - let MangledName = "vmv_s" in + let OverloadedName = "vmv_s" in defm vmv_s : RVVOutBuiltinSet<"vmv_s_x", "csil", [["x", "v", "vve"], ["x", "Uv", "UvUvUe"]]>; } // 17.2. Floating-Point Scalar Move Instructions -let HasMask = false, HasPolicy = false in { - let HasVL = false, MangledName = "vfmv_f" in +let HasMasked = false, MaskedPolicy = NonePolicy in { + let HasVL = false, OverloadedName = "vfmv_f" in defm vfmv_f : RVVOp0BuiltinSet<"vfmv_f_s", "xfd", [["s", "ve", "ev"]]>; - let MangledName = "vfmv_s" in + let OverloadedName = "vfmv_s" in defm vfmv_s : RVVOutBuiltinSet<"vfmv_s_f", "xfd", [["f", "v", "vve"], ["x", "Uv", "UvUvUe"]]>; } // 17.3. Vector Slide Instructions -let HasPolicy = false in { // 17.3.1. Vector Slideup Instructions defm vslideup : RVVSlideBuiltinSet; // 17.3.2. Vector Slidedown Instructions defm vslidedown : RVVSlideBuiltinSet; -} // 17.3.3. Vector Slide1up Instructions +let UnMaskedPolicy = HasPassthruOperand in { defm vslide1up : RVVSlideOneBuiltinSet; defm vfslide1up : RVVFloatingBinVFBuiltinSet; @@ -2033,9 +2144,10 @@ defm vrgather : RVVOutBuiltinSet<"vrgather_vx", "csil", [["vx", "Uv", "UvUvz"]]>; defm vrgatherei16 : RVVOutBuiltinSet<"vrgatherei16_vv", "csil", [["vv", "Uv", "UvUv(Log2EEW:4)Uv"]]>; +} // 17.5. Vector Compress Instruction -let HasMask = false, HasPolicy = false, +let HasMasked = false, MaskedPolicy = NonePolicy, ManualCodegen = [{ std::rotate(Ops.begin(), Ops.begin() + 1, Ops.begin() + 3); IntrinsicTypes = {ResultType, Ops[3]->getType()}; @@ -2049,8 +2161,8 @@ let HasMask = false, HasPolicy = false, } // Miscellaneous -let HasMask = false, HasVL = false, IRName = "" in { - let Name = "vreinterpret_v", HasPolicy = false, +let HasMasked = false, HasVL = false, IRName = "" in { + let Name = "vreinterpret_v", MaskedPolicy = NonePolicy, ManualCodegen = [{ return Builder.CreateBitCast(Ops[0], ResultType); }] in { @@ -2072,7 +2184,7 @@ let HasMask = false, HasVL = false, IRName = "" in { } } - let Name = "vundefined", HasNoMaskedOverloaded = false, HasPolicy = false, + let Name = "vundefined", HasUnMaskedOverloaded = false, MaskedPolicy = NonePolicy, ManualCodegen = [{ return llvm::UndefValue::get(ResultType); }] in { @@ -2082,9 +2194,9 @@ let HasMask = false, HasVL = false, IRName = "" in { // LMUL truncation // C/C++ Operand: VecTy, IR Operand: VecTy, Index - let Name = "vlmul_trunc_v", MangledName = "vlmul_trunc", HasPolicy = false, + let Name = "vlmul_trunc_v", OverloadedName = "vlmul_trunc", MaskedPolicy = NonePolicy, ManualCodegen = [{ { - ID = Intrinsic::experimental_vector_extract; + ID = Intrinsic::vector_extract; IntrinsicTypes = {ResultType, Ops[0]->getType()}; Ops.push_back(ConstantInt::get(Int64Ty, 0)); return Builder.CreateCall(CGM.getIntrinsic(ID, IntrinsicTypes), Ops, ""); @@ -2100,9 +2212,9 @@ let HasMask = false, HasVL = false, IRName = "" in { // LMUL extension // C/C++ Operand: SubVecTy, IR Operand: VecTy, SubVecTy, Index - let Name = "vlmul_ext_v", MangledName = "vlmul_ext", HasPolicy = false, + let Name = "vlmul_ext_v", OverloadedName = "vlmul_ext", MaskedPolicy = NonePolicy, ManualCodegen = [{ - ID = Intrinsic::experimental_vector_insert; + ID = Intrinsic::vector_insert; IntrinsicTypes = {ResultType, Ops[0]->getType()}; Ops.push_back(llvm::UndefValue::get(ResultType)); std::swap(Ops[0], Ops[1]); @@ -2118,15 +2230,16 @@ let HasMask = false, HasVL = false, IRName = "" in { } } - let Name = "vget_v", HasPolicy = false, + let Name = "vget_v", MaskedPolicy = NonePolicy, ManualCodegen = [{ { - ID = Intrinsic::experimental_vector_extract; + ID = Intrinsic::vector_extract; auto *VecTy = cast(ResultType); auto *OpVecTy = cast(Ops[0]->getType()); // Mask to only valid indices. unsigned MaxIndex = OpVecTy->getMinNumElements() / VecTy->getMinNumElements(); assert(isPowerOf2_32(MaxIndex)); + Ops[1] = Builder.CreateZExt(Ops[1], Builder.getInt64Ty()); Ops[1] = Builder.CreateAnd(Ops[1], MaxIndex - 1); Ops[1] = Builder.CreateMul(Ops[1], ConstantInt::get(Ops[1]->getType(), @@ -2141,16 +2254,17 @@ let HasMask = false, HasVL = false, IRName = "" in { } } - let Name = "vset_v", Log2LMUL = [0, 1, 2], HasPolicy = false, + let Name = "vset_v", Log2LMUL = [0, 1, 2], MaskedPolicy = NonePolicy, ManualCodegen = [{ { - ID = Intrinsic::experimental_vector_insert; + ID = Intrinsic::vector_insert; IntrinsicTypes = {ResultType, Ops[2]->getType()}; auto *ResVecTy = cast(ResultType); auto *VecTy = cast(Ops[2]->getType()); // Mask to only valid indices. unsigned MaxIndex = ResVecTy->getMinNumElements() / VecTy->getMinNumElements(); assert(isPowerOf2_32(MaxIndex)); + Ops[1] = Builder.CreateZExt(Ops[1], Builder.getInt64Ty()); Ops[1] = Builder.CreateAnd(Ops[1], MaxIndex - 1); Ops[1] = Builder.CreateMul(Ops[1], ConstantInt::get(Ops[1]->getType(), @@ -2165,9 +2279,3 @@ let HasMask = false, HasVL = false, IRName = "" in { } } } - -let HeaderCode = [{ -#define VE_TAIL_UNDISTURBED 0 -#define VE_TAIL_AGNOSTIC 1 -}] in -def policy : RVVHeader; diff --git a/clang/include/clang/CodeGen/CGFunctionInfo.h b/clang/include/clang/CodeGen/CGFunctionInfo.h index cd6c7e2e3128..288097b0dc89 100644 --- a/clang/include/clang/CodeGen/CGFunctionInfo.h +++ b/clang/include/clang/CodeGen/CGFunctionInfo.h @@ -586,6 +586,9 @@ class CGFunctionInfo final /// Whether this function has nocf_check attribute. unsigned NoCfCheck : 1; + /// Log 2 of the maximum vector width. + unsigned MaxVectorWidth : 4; + RequiredArgs Required; /// The struct representing all arguments passed in memory. Only used when @@ -731,6 +734,17 @@ public: ArgStructAlign = Align.getQuantity(); } + /// Return the maximum vector width in the arguments. + unsigned getMaxVectorWidth() const { + return MaxVectorWidth ? 1U << (MaxVectorWidth - 1) : 0; + } + + /// Set the maximum vector width in the arguments. + void setMaxVectorWidth(unsigned Width) { + assert(llvm::isPowerOf2_32(Width) && "Expected power of 2 vector"); + MaxVectorWidth = llvm::countTrailingZeros(Width) + 1; + } + void Profile(llvm::FoldingSetNodeID &ID) { ID.AddInteger(getASTCallingConvention()); ID.AddBoolean(InstanceMethod); diff --git a/clang/include/clang/CrossTU/CrossTranslationUnit.h b/clang/include/clang/CrossTU/CrossTranslationUnit.h index d9f9c51fccd9..3a0178ad651a 100644 --- a/clang/include/clang/CrossTU/CrossTranslationUnit.h +++ b/clang/include/clang/CrossTU/CrossTranslationUnit.h @@ -109,8 +109,10 @@ llvm::Expected parseInvocationList( StringRef FileContent, llvm::sys::path::Style PathStyle = llvm::sys::path::Style::posix); -// Returns true if the variable or any field of a record variable is const. -bool containsConst(const VarDecl *VD, const ASTContext &ACtx); +/// Returns true if it makes sense to import a foreign variable definition. +/// For instance, we don't want to import variables that have non-trivial types +/// because the constructor might have side-effects. +bool shouldImport(const VarDecl *VD, const ASTContext &ACtx); /// This class is used for tools that requires cross translation /// unit capability. @@ -195,6 +197,14 @@ public: getMacroExpansionContextForSourceLocation( const clang::SourceLocation &ToLoc) const; + /// Returns true if the given Decl is newly created during the import. + bool isImportedAsNew(const Decl *ToDecl) const; + + /// Returns true if the given Decl is mapped (or created) during an import + /// but there was an unrecoverable error (the AST node cannot be erased, it + /// is marked with an Error object in this case). + bool hasError(const Decl *ToDecl) const; + private: void lazyInitImporterSharedSt(TranslationUnitDecl *ToTU); ASTImporter &getOrCreateASTImporter(ASTUnit *Unit); @@ -226,7 +236,7 @@ private: StringRef InvocationListFilePath); /// Load the ASTUnit by its identifier found in the index file. If the - /// indentifier is suffixed with '.ast' it is considered a dump. Otherwise + /// identifier is suffixed with '.ast' it is considered a dump. Otherwise /// it is treated as source-file, and on-demand parsed. Relative paths are /// prefixed with CTUDir. LoadResultTy load(StringRef Identifier); @@ -291,7 +301,7 @@ private: /// \param DisplayCTUProgress Display a message about loading new ASTs. /// /// \return An Expected instance which contains the ASTUnit pointer or the - /// error occured during the load. + /// error occurred during the load. llvm::Expected getASTUnitForFunction(StringRef FunctionName, StringRef CrossTUDir, StringRef IndexName, diff --git a/clang/include/clang/Driver/Action.h b/clang/include/clang/Driver/Action.h index 3b6c9e31faa3..684ccd358275 100644 --- a/clang/include/clang/Driver/Action.h +++ b/clang/include/clang/Driver/Action.h @@ -59,6 +59,7 @@ public: PreprocessJobClass, PrecompileJobClass, HeaderModulePrecompileJobClass, + ExtractAPIJobClass, AnalyzeJobClass, MigrateJobClass, CompileJobClass, @@ -73,6 +74,7 @@ public: OffloadBundlingJobClass, OffloadUnbundlingJobClass, OffloadWrapperJobClass, + OffloadPackagerJobClass, LinkerWrapperJobClass, StaticLibJobClass, @@ -127,6 +129,9 @@ protected: /// The Offloading architecture associated with this action. const char *OffloadingArch = nullptr; + /// The Offloading toolchain associated with this device action. + const ToolChain *OffloadingToolChain = nullptr; + Action(ActionClass Kind, types::ID Type) : Action(Kind, ActionList(), Type) {} Action(ActionClass Kind, Action *Input, types::ID Type) : Action(Kind, ActionList({Input}), Type) {} @@ -183,12 +188,18 @@ public: /// Set the device offload info of this action and propagate it to its /// dependences. - void propagateDeviceOffloadInfo(OffloadKind OKind, const char *OArch); + void propagateDeviceOffloadInfo(OffloadKind OKind, const char *OArch, + const ToolChain *OToolChain); /// Append the host offload info of this action and propagate it to its /// dependences. void propagateHostOffloadInfo(unsigned OKinds, const char *OArch); + void setHostOffloadInfo(unsigned OKinds, const char *OArch) { + ActiveOffloadKindMask |= OKinds; + OffloadingArch = OArch; + } + /// Set the offload info of this action to be the same as the provided action, /// and propagate it to its dependences. void propagateOffloadInfo(const Action *A); @@ -199,10 +210,13 @@ public: OffloadKind getOffloadingDeviceKind() const { return OffloadingDeviceKind; } const char *getOffloadingArch() const { return OffloadingArch; } + const ToolChain *getOffloadingToolChain() const { + return OffloadingToolChain; + } /// Check if this action have any offload kinds. Note that host offload kinds /// are only set if the action is a dependence to a host offload action. - bool isHostOffloading(OffloadKind OKind) const { + bool isHostOffloading(unsigned int OKind) const { return ActiveOffloadKindMask & OKind; } bool isDeviceOffloading(OffloadKind OKind) const { @@ -438,6 +452,19 @@ public: const char *getModuleName() const { return ModuleName; } }; +class ExtractAPIJobAction : public JobAction { + void anchor() override; + +public: + ExtractAPIJobAction(Action *Input, types::ID OutputType); + + static bool classof(const Action *A) { + return A->getKind() == ExtractAPIJobClass; + } + + void addHeaderInput(Action *Input) { getInputs().push_back(Input); } +}; + class AnalyzeJobAction : public JobAction { void anchor() override; @@ -643,6 +670,17 @@ public: } }; +class OffloadPackagerJobAction : public JobAction { + void anchor() override; + +public: + OffloadPackagerJobAction(ActionList &Inputs, types::ID Type); + + static bool classof(const Action *A) { + return A->getKind() == OffloadPackagerJobClass; + } +}; + class LinkerWrapperJobAction : public JobAction { void anchor() override; diff --git a/clang/include/clang/Driver/Compilation.h b/clang/include/clang/Driver/Compilation.h index 89a43b5b7dc0..c5714d320888 100644 --- a/clang/include/clang/Driver/Compilation.h +++ b/clang/include/clang/Driver/Compilation.h @@ -143,6 +143,8 @@ public: return ActiveOffloadMask & Kind; } + unsigned getActiveOffloadKinds() const { return ActiveOffloadMask; } + /// Iterator that visits device toolchains of a given kind. using const_offload_toolchains_iterator = const std::multimap bool hasOffloadToolChain() const { return OrderedOffloadingToolchains.find(Kind) != @@ -288,16 +295,22 @@ public: /// /// \param FailingCommand - For non-zero results, this will be set to the /// Command which failed, if any. + /// \param LogOnly - When true, only tries to log the command, not actually + /// execute it. /// \return The result code of the subprocess. - int ExecuteCommand(const Command &C, const Command *&FailingCommand) const; + int ExecuteCommand(const Command &C, const Command *&FailingCommand, + bool LogOnly = false) const; /// ExecuteJob - Execute a single job. /// /// \param FailingCommands - For non-zero results, this will be a vector of /// failing commands and their associated result code. - void ExecuteJobs( - const JobList &Jobs, - SmallVectorImpl> &FailingCommands) const; + /// \param LogOnly - When true, only tries to log the command, not actually + /// execute it. + void + ExecuteJobs(const JobList &Jobs, + SmallVectorImpl> &FailingCommands, + bool LogOnly = false) const; /// initCompilationForDiagnostics - Remove stale state and suppress output /// so compilation can be reexecuted to generate additional diagnostic diff --git a/clang/include/clang/Driver/Distro.h b/clang/include/clang/Driver/Distro.h index 2723f75e8945..01d66b30b038 100644 --- a/clang/include/clang/Driver/Distro.h +++ b/clang/include/clang/Driver/Distro.h @@ -38,6 +38,7 @@ public: DebianBuster, DebianBullseye, DebianBookworm, + DebianTrixie, Exherbo, RHEL5, RHEL6, @@ -74,6 +75,7 @@ public: UbuntuHirsute, UbuntuImpish, UbuntuJammy, + UbuntuKinetic, UnknownDistro }; @@ -121,11 +123,11 @@ public: bool IsOpenSUSE() const { return DistroVal == OpenSUSE; } bool IsDebian() const { - return DistroVal >= DebianLenny && DistroVal <= DebianBookworm; + return DistroVal >= DebianLenny && DistroVal <= DebianTrixie; } bool IsUbuntu() const { - return DistroVal >= UbuntuHardy && DistroVal <= UbuntuJammy; + return DistroVal >= UbuntuHardy && DistroVal <= UbuntuKinetic; } bool IsAlpineLinux() const { return DistroVal == AlpineLinux; } diff --git a/clang/include/clang/Driver/Driver.h b/clang/include/clang/Driver/Driver.h index 93e1eca6a981..774eac613a10 100644 --- a/clang/include/clang/Driver/Driver.h +++ b/clang/include/clang/Driver/Driver.h @@ -12,6 +12,7 @@ #include "clang/Basic/Diagnostic.h" #include "clang/Basic/LLVM.h" #include "clang/Driver/Action.h" +#include "clang/Driver/DriverDiagnostic.h" #include "clang/Driver/InputInfo.h" #include "clang/Driver/Options.h" #include "clang/Driver/Phases.h" @@ -56,6 +57,16 @@ enum LTOKind { LTOK_Unknown }; +/// Whether headers used to construct C++20 module units should be looked +/// up by the path supplied on the command line, or in the user or system +/// search paths. +enum ModuleHeaderMode { + HeaderMode_None, + HeaderMode_Default, + HeaderMode_User, + HeaderMode_System +}; + /// Driver - Encapsulate logic for constructing compilation processes /// from a set of gcc-driver-like command line arguments. class Driver { @@ -68,7 +79,8 @@ class Driver { GXXMode, CPPMode, CLMode, - FlangMode + FlangMode, + DXCMode } Mode; enum SaveTempsMode { @@ -83,6 +95,19 @@ class Driver { EmbedBitcode } BitcodeEmbed; + enum OffloadMode { + OffloadHostDevice, + OffloadHost, + OffloadDevice, + } Offload; + + /// Header unit mode set by -fmodule-header={user,system}. + ModuleHeaderMode CXX20HeaderType; + + /// Set if we should process inputs and jobs with C++20 module + /// interpretation. + bool ModulesModeCXX20; + /// LTO mode selected via -f(no-)?lto(=.*)? options. LTOKind LTOMode; @@ -195,6 +220,9 @@ public: /// Other modes fall back to calling gcc which in turn calls gfortran. bool IsFlangMode() const { return Mode == FlangMode; } + /// Whether the driver should follow dxc.exe like behavior. + bool IsDXCMode() const { return Mode == DXCMode; } + /// Only print tool bindings, don't build any jobs. unsigned CCCPrintBindings : 1; @@ -250,13 +278,11 @@ private: /// Whether to check that input files exist when constructing compilation /// jobs. unsigned CheckInputsExist : 1; + /// Whether to probe for PCH files on disk, in order to upgrade + /// -include foo.h to -include-pch foo.h.pch. + unsigned ProbePrecompiled : 1; public: - /// Force clang to emit reproducer for driver invocation. This is enabled - /// indirectly by setting FORCE_CLANG_DIAGNOSTICS_CRASH environment variable - /// or when using the -gen-reproducer driver flag. - unsigned GenReproducer : 1; - // getFinalPhase - Determine which compilation mode we are in and record // which option we used to determine the final phase. // TODO: Much of what getFinalPhase returns are not actually true compiler @@ -276,6 +302,11 @@ private: /// stored in it, and will clean them up when torn down. mutable llvm::StringMap> ToolChains; + /// Cache of known offloading architectures for the ToolChain already derived. + /// This should only be modified when we first initialize the offloading + /// toolchains. + llvm::DenseMap> KnownArchs; + private: /// TranslateInputArgs - Create a new derived argument list from the input /// arguments, after applying the standard argument translations. @@ -336,6 +367,9 @@ public: void setCheckInputsExist(bool Value) { CheckInputsExist = Value; } + bool getProbePrecompiled() const { return ProbePrecompiled; } + void setProbePrecompiled(bool Value) { ProbePrecompiled = Value; } + void setTargetAndMode(const ParsedClangName &TM) { ClangNameParts = TM; } const std::string &getTitle() { return DriverTitle; } @@ -363,6 +397,9 @@ public: bool embedBitcodeInObject() const { return (BitcodeEmbed == EmbedBitcode); } bool embedBitcodeMarkerOnly() const { return (BitcodeEmbed == EmbedMarker); } + bool offloadHostOnly() const { return Offload == OffloadHost; } + bool offloadDeviceOnly() const { return Offload == OffloadDevice; } + /// Compute the desired OpenMP runtime from the flags provided. OpenMPRuntimeKind getOpenMPRuntime(const llvm::opt::ArgList &Args) const; @@ -429,6 +466,13 @@ public: const InputTy &Input, Action *HostAction) const; + /// Returns the set of bound architectures active for this offload kind. + /// If there are no bound architctures we return a set containing only the + /// empty string. + llvm::DenseSet + getOffloadArchs(Compilation &C, const llvm::opt::DerivedArgList &Args, + Action::OffloadKind Kind, const ToolChain *TC) const; + /// Check that the file referenced by Value exists. If it doesn't, /// issue a diagnostic and return false. /// If TypoCorrect is true and the file does not exist, see if it looks @@ -466,6 +510,35 @@ public: StringRef AdditionalInformation = "", CompilationDiagnosticReport *GeneratedReport = nullptr); + enum class CommandStatus { + Crash = 1, + Error, + Ok, + }; + + enum class ReproLevel { + Off = 0, + OnCrash = static_cast(CommandStatus::Crash), + OnError = static_cast(CommandStatus::Error), + Always = static_cast(CommandStatus::Ok), + }; + + bool maybeGenerateCompilationDiagnostics( + CommandStatus CS, ReproLevel Level, Compilation &C, + const Command &FailingCommand, StringRef AdditionalInformation = "", + CompilationDiagnosticReport *GeneratedReport = nullptr) { + if (static_cast(CS) > static_cast(Level)) + return false; + if (CS != CommandStatus::Crash) + Diags.Report(diag::err_drv_force_crash) + << !::getenv("FORCE_CLANG_DIAGNOSTICS_CRASH"); + // Hack to ensure that diagnostic notes get emitted. + Diags.setLastDiagnosticIgnored(false); + generateCompilationDiagnostics(C, FailingCommand, AdditionalInformation, + GeneratedReport); + return true; + } + /// @} /// @name Helper Methods /// @{ @@ -570,6 +643,12 @@ public: /// ShouldEmitStaticLibrary - Should the linker emit a static library. bool ShouldEmitStaticLibrary(const llvm::opt::ArgList &Args) const; + /// Returns true if the user has indicated a C++20 header unit mode. + bool hasHeaderMode() const { return CXX20HeaderType != HeaderMode_None; } + + /// Get the mode for handling headers as set by fmodule-header{=}. + ModuleHeaderMode getModuleHeaderMode() const { return CXX20HeaderType; } + /// Returns true if we are performing any kind of LTO. bool isUsingLTO(bool IsOffload = false) const { return getLTOMode(IsOffload) != LTOK_None; @@ -614,9 +693,9 @@ private: /// /// \param[in] HostTC is the host ToolChain paired with the device /// - /// \param[in] Action (e.g. OFK_Cuda/OFK_OpenMP/OFK_SYCL) is an Offloading - /// action that is optionally passed to a ToolChain (used by CUDA, to specify - /// if it's used in conjunction with OpenMP) + /// \param[in] TargetDeviceOffloadKind (e.g. OFK_Cuda/OFK_OpenMP/OFK_SYCL) is + /// an Offloading action that is optionally passed to a ToolChain (used by + /// CUDA, to specify if it's used in conjunction with OpenMP) /// /// Will cache ToolChains for the life of the driver object, and create them /// on-demand. diff --git a/clang/include/clang/Driver/Options.h b/clang/include/clang/Driver/Options.h index 056660192ac5..f9b9632ee7cb 100644 --- a/clang/include/clang/Driver/Options.h +++ b/clang/include/clang/Driver/Options.h @@ -35,7 +35,8 @@ enum ClangFlags { FlangOption = (1 << 14), FC1Option = (1 << 15), FlangOnlyOption = (1 << 16), - Ignored = (1 << 17), + DXCOption = (1 << 17), + Ignored = (1 << 18), }; enum ID { diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td index 53e68ed2cef9..f4fe08aa1a5b 100644 --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -49,6 +49,10 @@ def CC1Option : OptionFlag; // CC1AsOption - This option should be accepted by clang -cc1as. def CC1AsOption : OptionFlag; +// DXCOption - This is a dxc.exe compatibility option. Options with this flag +// are made available when the driver is running in DXC compatibility mode. +def DXCOption : OptionFlag; + // NoDriverOption - This option should not be accepted by the driver. def NoDriverOption : OptionFlag; @@ -554,7 +558,10 @@ def arcmt_migrate_report_output : Separate<["-"], "arcmt-migrate-report-output"> def arcmt_migrate_emit_arc_errors : Flag<["-"], "arcmt-migrate-emit-errors">, HelpText<"Emit ARC errors even if the migrator can fix them">, Flags<[CC1Option]>, MarshallingInfoFlag>; +def gen_reproducer_eq: Joined<["-"], "gen-reproducer=">, Flags<[NoArgumentUnused, CoreOption]>, + HelpText<"Emit reproducer on (option: off, crash (default), error, always)">; def gen_reproducer: Flag<["-"], "gen-reproducer">, InternalDebugOpt, + Alias, AliasArgs<["always"]>, HelpText<"Auto-generates preprocessed source files and a reproduction script">; def gen_cdb_fragment_path: Separate<["-"], "gen-cdb-fragment-path">, InternalDebugOpt, HelpText<"Emit a compilation database fragment to the specified directory">; @@ -714,14 +721,14 @@ def MV : Flag<["-"], "MV">, Group, Flags<[CC1Option]>, MarshallingInfoFlag, "DependencyOutputFormat::Make">, Normalizer<"makeFlagToValueNormalizer(DependencyOutputFormat::NMake)">; def Mach : Flag<["-"], "Mach">, Group; -def O0 : Flag<["-"], "O0">, Group, Flags<[CC1Option, HelpHidden]>; -def O4 : Flag<["-"], "O4">, Group, Flags<[CC1Option, HelpHidden]>; +def O0 : Flag<["-"], "O0">, Group, Flags<[CC1Option, FC1Option, HelpHidden]>; +def O4 : Flag<["-"], "O4">, Group, Flags<[CC1Option, FC1Option, HelpHidden]>; def ObjCXX : Flag<["-"], "ObjC++">, Flags<[NoXarchOption]>, HelpText<"Treat source input files as Objective-C++ inputs">; def ObjC : Flag<["-"], "ObjC">, Flags<[NoXarchOption]>, HelpText<"Treat source input files as Objective-C inputs">; -def O : Joined<["-"], "O">, Group, Flags<[CC1Option]>; -def O_flag : Flag<["-"], "O">, Flags<[CC1Option]>, Alias, AliasArgs<["1"]>; +def O : Joined<["-"], "O">, Group, Flags<[CC1Option,FC1Option]>; +def O_flag : Flag<["-"], "O">, Flags<[CC1Option,FC1Option]>, Alias, AliasArgs<["1"]>; def Ofast : Joined<["-"], "Ofast">, Group, Flags<[CC1Option]>; def P : Flag<["-"], "P">, Flags<[CC1Option,FlangOption,FC1Option]>, Group, HelpText<"Disable linemarker output in -E mode">, @@ -750,7 +757,7 @@ def Rpass_analysis_EQ : Joined<["-"], "Rpass-analysis=">, Group, "name matches the given POSIX regular expression">; def R_Joined : Joined<["-"], "R">, Group, Flags<[CC1Option, CoreOption]>, MetaVarName<"">, HelpText<"Enable the specified remark">; -def S : Flag<["-"], "S">, Flags<[NoXarchOption,CC1Option]>, Group, +def S : Flag<["-"], "S">, Flags<[NoXarchOption,CC1Option,FlangOption,FC1Option]>, Group, HelpText<"Only run preprocess and compilation steps">; def Tbss : JoinedOrSeparate<["-"], "Tbss">, Group, MetaVarName<"">, HelpText<"Set starting address of BSS to ">; @@ -768,6 +775,8 @@ def Wa_COMMA : CommaJoined<["-"], "Wa,">, MetaVarName<"">; def Wall : Flag<["-"], "Wall">, Group, Flags<[CC1Option, HelpHidden]>; def WCL4 : Flag<["-"], "WCL4">, Group, Flags<[CC1Option, HelpHidden]>; +def Wsystem_headers : Flag<["-"], "Wsystem-headers">, Group, Flags<[CC1Option, HelpHidden]>; +def Wno_system_headers : Flag<["-"], "Wno-system-headers">, Group, Flags<[CC1Option, HelpHidden]>; def Wdeprecated : Flag<["-"], "Wdeprecated">, Group, Flags<[CC1Option]>, HelpText<"Enable warnings for deprecated constructs and define __DEPRECATED">; def Wno_deprecated : Flag<["-"], "Wno-deprecated">, Group, Flags<[CC1Option]>; @@ -808,17 +817,22 @@ def Xcuda_fatbinary : Separate<["-"], "Xcuda-fatbinary">, HelpText<"Pass to fatbinary invocation">, MetaVarName<"">; def Xcuda_ptxas : Separate<["-"], "Xcuda-ptxas">, HelpText<"Pass to the ptxas assembler">, MetaVarName<"">; -def Xopenmp_target : Separate<["-"], "Xopenmp-target">, +def Xopenmp_target : Separate<["-"], "Xopenmp-target">, Group, HelpText<"Pass to the target offloading toolchain.">, MetaVarName<"">; -def Xopenmp_target_EQ : JoinedAndSeparate<["-"], "Xopenmp-target=">, +def Xopenmp_target_EQ : JoinedAndSeparate<["-"], "Xopenmp-target=">, Group, HelpText<"Pass to the target offloading toolchain identified by .">, MetaVarName<" ">; def z : Separate<["-"], "z">, Flags<[LinkerInput, RenderAsInput]>, HelpText<"Pass -z to the linker">, MetaVarName<"">, Group; +def offload_link : Flag<["--"], "offload-link">, Group, + HelpText<"Use the new offloading linker to perform the link job.">; def Xlinker : Separate<["-"], "Xlinker">, Flags<[LinkerInput, RenderAsInput]>, HelpText<"Pass to the linker">, MetaVarName<"">, Group; +def Xoffload_linker : JoinedAndSeparate<["-"], "Xoffload-linker">, + HelpText<"Pass to the offload linkers or the ones idenfied by -">, + MetaVarName<" ">, Group; def Xpreprocessor : Separate<["-"], "Xpreprocessor">, Group, HelpText<"Pass to the preprocessor">, MetaVarName<"">; def X_Flag : Flag<["-"], "X">, Group; @@ -840,6 +854,7 @@ def bundle : Flag<["-"], "bundle">; def b : JoinedOrSeparate<["-"], "b">, Flags<[LinkerInput, RenderAsInput]>, HelpText<"Pass -b to the linker on AIX (only).">, MetaVarName<"">, Group; +// OpenCL-only Options def cl_opt_disable : Flag<["-"], "cl-opt-disable">, Group, Flags<[CC1Option]>, HelpText<"OpenCL only. This option disables all optimizations. By default optimizations are enabled.">; def cl_strict_aliasing : Flag<["-"], "cl-strict-aliasing">, Group, Flags<[CC1Option]>, @@ -879,6 +894,11 @@ def cl_uniform_work_group_size : Flag<["-"], "cl-uniform-work-group-size">, Grou MarshallingInfoFlag>; def cl_no_stdinc : Flag<["-"], "cl-no-stdinc">, Group, HelpText<"OpenCL only. Disables all standard includes containing non-native compiler types and functions.">; +def cl_ext_EQ : CommaJoined<["-"], "cl-ext=">, Group, Flags<[CC1Option]>, + HelpText<"OpenCL only. Enable or disable OpenCL extensions/optional features. The argument is a comma-separated " + "sequence of one or more extension names, each prefixed by '+' or '-'.">, + MarshallingInfoStringVector>; + def client__name : JoinedOrSeparate<["-"], "client_name">; def combine : Flag<["-", "--"], "combine">, Flags<[NoXarchOption, Unsupported]>; def compatibility__version : JoinedOrSeparate<["-"], "compatibility_version">; @@ -902,14 +922,6 @@ def fconvergent_functions : Flag<["-"], "fconvergent-functions">, Group def gpu_use_aux_triple_only : Flag<["--"], "gpu-use-aux-triple-only">, InternalDriverOpt, HelpText<"Prepare '-aux-triple' only without populating " "'-aux-target-cpu' and '-aux-target-feature'.">; -def cuda_device_only : Flag<["--"], "cuda-device-only">, - HelpText<"Compile CUDA code for device only">; -def cuda_host_only : Flag<["--"], "cuda-host-only">, - HelpText<"Compile CUDA code for host only. Has no effect on non-CUDA " - "compilations.">; -def cuda_compile_host_device : Flag<["--"], "cuda-compile-host-device">, - HelpText<"Compile CUDA code for both host and device (default). Has no " - "effect on non-CUDA compilations.">; def cuda_include_ptx_EQ : Joined<["--"], "cuda-include-ptx=">, Flags<[NoXarchOption]>, HelpText<"Include PTX for the following GPU architecture (e.g. sm_35) or 'all'. May be specified more than once.">; def no_cuda_include_ptx_EQ : Joined<["--"], "no-cuda-include-ptx=">, Flags<[NoXarchOption]>, @@ -921,8 +933,11 @@ def offload_arch_EQ : Joined<["--"], "offload-arch=">, Flags<[NoXarchOption]>, "specified more than once.">; def cuda_gpu_arch_EQ : Joined<["--"], "cuda-gpu-arch=">, Flags<[NoXarchOption]>, Alias; +def cuda_feature_EQ : Joined<["--"], "cuda-feature=">, HelpText<"Manually specify the CUDA feature to use">; def hip_link : Flag<["--"], "hip-link">, HelpText<"Link clang-offload-bundler bundles for HIP">; +def no_hip_rt: Flag<["-"], "no-hip-rt">, + HelpText<"Do not link against HIP runtime libraries">; def no_offload_arch_EQ : Joined<["--"], "no-offload-arch=">, Flags<[NoXarchOption]>, HelpText<"Remove CUDA/HIP offloading device architecture (e.g. sm_35, gfx906) from the list of devices to compile for. " "'all' resets the list to its default value.">; @@ -959,6 +974,13 @@ defm cuda_short_ptr : BoolFOption<"cuda-short-ptr", TargetOpts<"NVPTXUseShortPointers">, DefaultFalse, PosFlag, NegFlag>; +def fgpu_default_stream_EQ : Joined<["-"], "fgpu-default-stream=">, + HelpText<"Specify default stream. The default value is 'legacy'. (HIP only)">, + Flags<[CC1Option]>, + Values<"legacy,per-thread">, + NormalizedValuesScope<"LangOptions::GPUDefaultStreamKind">, + NormalizedValues<["Legacy", "PerThread"]>, + MarshallingInfoEnum, "Legacy">; def rocm_path_EQ : Joined<["--"], "rocm-path=">, Group, HelpText<"ROCm installation path, used for finding and automatically linking required bitcode libraries.">; def hip_path_EQ : Joined<["--"], "hip-path=">, Group, @@ -985,6 +1007,12 @@ defm hip_fp32_correctly_rounded_divide_sqrt : BoolFOption<"hip-fp32-correctly-ro BothFlags<[], " that single precision floating-point divide and sqrt used in " "the program source are correctly rounded (HIP device compilation only)">>, ShouldParseIf; +defm hip_kernel_arg_name : BoolFOption<"hip-kernel-arg-name", + CodeGenOpts<"HIPSaveKernelArgName">, DefaultFalse, + PosFlag, + NegFlag, + BothFlags<[], " that kernel argument names are preserved (HIP only)">>, + ShouldParseIf; def hipspv_pass_plugin_EQ : Joined<["--"], "hipspv-pass-plugin=">, Group, MetaVarName<"">, HelpText<"path to a pass plugin for HIP to SPIR-V passes.">; @@ -1033,8 +1061,10 @@ def fuse_cuid_EQ : Joined<["-"], "fuse-cuid=">, "file path and command line options) | 'random' (ID's generated as " "random numbers) | 'none' (disabled). Default is 'hash'. This option " "will be overridden by option '-cuid=[ID]' if it is specified." >; -def libomptarget_amdgcn_bc_path_EQ : Joined<["--"], "libomptarget-amdgcn-bc-path=">, Group, +def libomptarget_amdgpu_bc_path_EQ : Joined<["--"], "libomptarget-amdgpu-bc-path=">, Group, HelpText<"Path to libomptarget-amdgcn bitcode library">; +def libomptarget_amdgcn_bc_path_EQ : Joined<["--"], "libomptarget-amdgcn-bc-path=">, Group, + HelpText<"Path to libomptarget-amdgcn bitcode library">, Alias; def libomptarget_nvptx_bc_path_EQ : Joined<["--"], "libomptarget-nvptx-bc-path=">, Group, HelpText<"Path to libomptarget-nvptx bitcode library">; def dD : Flag<["-"], "dD">, Group, Flags<[CC1Option]>, @@ -1067,9 +1097,9 @@ def dynamiclib : Flag<["-"], "dynamiclib">; def dynamic : Flag<["-"], "dynamic">, Flags<[NoArgumentUnused]>; def d_Flag : Flag<["-"], "d">, Group; def d_Joined : Joined<["-"], "d">, Group; -def emit_ast : Flag<["-"], "emit-ast">, +def emit_ast : Flag<["-"], "emit-ast">, Flags<[CoreOption]>, HelpText<"Emit Clang AST files for source inputs">; -def emit_llvm : Flag<["-"], "emit-llvm">, Flags<[CC1Option]>, Group, +def emit_llvm : Flag<["-"], "emit-llvm">, Flags<[CC1Option, FC1Option, FlangOption]>, Group, HelpText<"Use the LLVM representation for assembler and object files">; def emit_interface_stubs : Flag<["-"], "emit-interface-stubs">, Flags<[CC1Option]>, Group, HelpText<"Generate Interface Stub Files.">; @@ -1082,6 +1112,8 @@ def interface_stub_version_EQ : JoinedOrSeparate<["-"], "interface-stub-version= def exported__symbols__list : Separate<["-"], "exported_symbols_list">; def extract_api : Flag<["-"], "extract-api">, Flags<[CC1Option]>, Group, HelpText<"Extract API information">; +def product_name_EQ: Joined<["--"], "product-name=">, Flags<[CC1Option]>, + MarshallingInfoString>; def e : JoinedOrSeparate<["-"], "e">, Flags<[LinkerInput]>, Group; def fmax_tokens_EQ : Joined<["-"], "fmax-tokens=">, Group, Flags<[CC1Option]>, HelpText<"Max total number of preprocessed tokens for -Wmax-tokens.">, @@ -1151,13 +1183,18 @@ defm coroutines_ts : BoolFOption<"coroutines-ts", PosFlag, NegFlag>; +defm unstable : BoolFOption<"unstable", + LangOpts<"Unstable">, DefaultFalse, + PosFlag, + NegFlag>; + def fembed_offload_object_EQ : Joined<["-"], "fembed-offload-object=">, Group, Flags<[NoXarchOption, CC1Option]>, HelpText<"Embed Offloading device-side binary into host object file as a section.">, MarshallingInfoStringVector>; def fembed_bitcode_EQ : Joined<["-"], "fembed-bitcode=">, Group, Flags<[NoXarchOption, CC1Option, CC1AsOption]>, MetaVarName<"