From 4b4fe385e49bd883fd183b5f21c1ea486c722e61 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 24 Jul 2022 17:03:44 +0200 Subject: Vendor import of llvm-project main llvmorg-15-init-17485-ga3e38b4a206b. --- clang/include/clang/APINotes/Types.h | 2 +- clang/include/clang/AST/ASTContext.h | 9 + clang/include/clang/AST/Decl.h | 27 +- clang/include/clang/AST/DeclBase.h | 10 +- clang/include/clang/ASTMatchers/ASTMatchers.h | 33 +- .../clang/Analysis/Analyses/ThreadSafetyTIL.h | 8 +- .../Analysis/FlowSensitive/DataflowAnalysis.h | 6 + .../FlowSensitive/DataflowAnalysisContext.h | 3 + .../Analysis/FlowSensitive/DataflowEnvironment.h | 3 +- .../clang/Analysis/FlowSensitive/DebugSupport.h | 23 +- .../clang/Analysis/FlowSensitive/NoopAnalysis.h | 47 + .../FlowSensitive/TypeErasedDataflowAnalysis.h | 25 +- clang/include/clang/Basic/Attr.td | 2 +- clang/include/clang/Basic/BuiltinsAMDGPU.def | 25 + clang/include/clang/Basic/CodeGenOptions.def | 4 + clang/include/clang/Basic/DiagnosticDriverKinds.td | 7 + clang/include/clang/Basic/DiagnosticGroups.td | 3 +- clang/include/clang/Basic/DiagnosticLexKinds.td | 14 +- clang/include/clang/Basic/DiagnosticOptions.h | 2 +- clang/include/clang/Basic/DiagnosticSemaKinds.td | 42 +- clang/include/clang/Basic/Features.def | 2 +- clang/include/clang/Basic/LangOptions.def | 3 +- clang/include/clang/Basic/Module.h | 12 + clang/include/clang/Basic/NoSanitizeList.h | 2 + clang/include/clang/Basic/Sarif.h | 440 ++++ clang/include/clang/Driver/Options.h | 3 +- clang/include/clang/Driver/Options.td | 49 +- clang/include/clang/Format/Format.h | 2 +- clang/include/clang/Frontend/FrontendOptions.h | 3 + clang/include/clang/Sema/CodeCompleteConsumer.h | 18 + clang/include/clang/Sema/Sema.h | 5 + .../Core/PathSensitive/ConstraintManager.h | 3 + .../StaticAnalyzer/Core/PathSensitive/ExprEngine.h | 64 +- .../StaticAnalyzer/Core/PathSensitive/MemRegion.h | 1 + .../Core/PathSensitive/SValBuilder.h | 33 - .../StaticAnalyzer/Core/PathSensitive/SVals.h | 5 + .../DependencyScanning/DependencyScanningTool.h | 4 +- .../DependencyScanning/DependencyScanningWorker.h | 3 +- .../clang/Tooling/Inclusions/IncludeStyle.h | 8 +- clang/include/clang/Tooling/Syntax/BuildTree.h | 18 +- clang/include/clang/Tooling/Syntax/Mutations.h | 6 +- clang/include/clang/Tooling/Syntax/Nodes.h | 7 +- .../clang/Tooling/Syntax/TokenBufferTokenManager.h | 70 + clang/include/clang/Tooling/Syntax/TokenManager.h | 47 + clang/include/clang/Tooling/Syntax/Tokens.h | 1 - clang/include/clang/Tooling/Syntax/Tree.h | 49 +- clang/include/clang/module.modulemap | 14 +- clang/lib/AST/ASTImporter.cpp | 5 + clang/lib/AST/Decl.cpp | 24 +- clang/lib/AST/DeclBase.cpp | 5 +- clang/lib/AST/DeclCXX.cpp | 2 +- clang/lib/AST/DeclPrinter.cpp | 8 +- clang/lib/AST/ExprConstant.cpp | 6 + clang/lib/AST/TextNodeDumper.cpp | 3 + .../FlowSensitive/DataflowAnalysisContext.cpp | 13 + .../Analysis/FlowSensitive/DataflowEnvironment.cpp | 6 +- clang/lib/Analysis/FlowSensitive/DebugSupport.cpp | 83 +- clang/lib/Analysis/ThreadSafety.cpp | 11 + clang/lib/Basic/MakeSupport.cpp | 2 +- clang/lib/Basic/NoSanitizeList.cpp | 5 + clang/lib/Basic/Sarif.cpp | 389 ++++ clang/lib/Basic/Targets/AMDGPU.cpp | 1 + clang/lib/Basic/Targets/RISCV.cpp | 4 +- clang/lib/CodeGen/ABIInfo.h | 4 - clang/lib/CodeGen/CGBuiltin.cpp | 1 + clang/lib/CodeGen/CGCall.h | 3 - clang/lib/CodeGen/CGDeclCXX.cpp | 185 +- clang/lib/CodeGen/CGExpr.cpp | 25 +- clang/lib/CodeGen/CGObjCRuntime.h | 3 +- clang/lib/CodeGen/CGStmt.cpp | 7 +- clang/lib/CodeGen/CGStmtOpenMP.cpp | 23 +- clang/lib/CodeGen/CodeGenFunction.cpp | 2 +- clang/lib/CodeGen/CodeGenModule.cpp | 137 +- clang/lib/CodeGen/CodeGenModule.h | 49 +- clang/lib/CodeGen/SwiftCallingConv.cpp | 3 +- clang/lib/CodeGen/TargetInfo.cpp | 14 +- clang/lib/CodeGen/TargetInfo.h | 4 +- clang/lib/Driver/Driver.cpp | 36 +- clang/lib/Driver/Multilib.cpp | 7 +- clang/lib/Driver/ToolChain.cpp | 2 + clang/lib/Driver/ToolChains/AIX.cpp | 10 +- clang/lib/Driver/ToolChains/Ananas.cpp | 2 +- clang/lib/Driver/ToolChains/Arch/RISCV.cpp | 12 +- clang/lib/Driver/ToolChains/BareMetal.cpp | 2 + clang/lib/Driver/ToolChains/Clang.cpp | 103 +- clang/lib/Driver/ToolChains/Clang.h | 6 + clang/lib/Driver/ToolChains/CloudABI.cpp | 2 + clang/lib/Driver/ToolChains/CrossWindows.cpp | 5 +- clang/lib/Driver/ToolChains/Darwin.cpp | 30 +- clang/lib/Driver/ToolChains/DragonFly.cpp | 2 +- clang/lib/Driver/ToolChains/FreeBSD.cpp | 16 +- clang/lib/Driver/ToolChains/Fuchsia.cpp | 4 +- clang/lib/Driver/ToolChains/Hexagon.cpp | 2 + clang/lib/Driver/ToolChains/MipsLinux.cpp | 2 + clang/lib/Driver/ToolChains/NaCl.cpp | 2 + clang/lib/Driver/ToolChains/NetBSD.cpp | 2 +- clang/lib/Driver/ToolChains/OpenBSD.cpp | 11 +- clang/lib/Driver/ToolChains/VEToolchain.cpp | 2 + clang/lib/Driver/ToolChains/WebAssembly.cpp | 2 + clang/lib/ExtractAPI/ExtractAPIConsumer.cpp | 1 + clang/lib/Format/ContinuationIndenter.cpp | 11 +- clang/lib/Format/Format.cpp | 39 +- clang/lib/Format/TokenAnnotator.cpp | 13 +- clang/lib/Format/UnwrappedLineParser.cpp | 3 +- clang/lib/Frontend/FrontendAction.cpp | 3 +- clang/lib/Frontend/InitPreprocessor.cpp | 21 +- clang/lib/Frontend/TextDiagnostic.cpp | 2 + clang/lib/Headers/__clang_cuda_intrinsics.h | 8 +- clang/lib/Headers/ppc_wrappers/emmintrin.h | 7 +- clang/lib/Headers/ppc_wrappers/mm_malloc.h | 3 +- clang/lib/Headers/ppc_wrappers/mmintrin.h | 7 +- clang/lib/Headers/ppc_wrappers/pmmintrin.h | 7 +- clang/lib/Headers/ppc_wrappers/smmintrin.h | 7 +- clang/lib/Headers/ppc_wrappers/tmmintrin.h | 7 +- clang/lib/Headers/ppc_wrappers/xmmintrin.h | 7 +- clang/lib/Headers/x86gprintrin.h | 28 +- clang/lib/Lex/Lexer.cpp | 6 +- clang/lib/Lex/ModuleMap.cpp | 6 +- clang/lib/Lex/PPDirectives.cpp | 29 +- clang/lib/Parse/ParseAST.cpp | 23 + clang/lib/Sema/AnalysisBasedWarnings.cpp | 3 +- clang/lib/Sema/CodeCompleteConsumer.cpp | 15 +- clang/lib/Sema/SemaCUDA.cpp | 2 +- clang/lib/Sema/SemaChecking.cpp | 49 +- clang/lib/Sema/SemaCodeComplete.cpp | 72 +- clang/lib/Sema/SemaDecl.cpp | 37 +- clang/lib/Sema/SemaExpr.cpp | 11 +- clang/lib/Sema/SemaExprCXX.cpp | 16 +- clang/lib/Sema/SemaLookup.cpp | 15 +- clang/lib/Sema/SemaModule.cpp | 10 + clang/lib/Sema/SemaTemplate.cpp | 6 +- clang/lib/Sema/SemaTemplateInstantiateDecl.cpp | 5 + clang/lib/Sema/SemaType.cpp | 3 +- clang/lib/Serialization/ASTReader.cpp | 502 +++-- clang/lib/Serialization/ASTReaderDecl.cpp | 4 + clang/lib/Serialization/ASTWriterDecl.cpp | 3 + .../Checkers/ExprInspectionChecker.cpp | 60 +- clang/lib/StaticAnalyzer/Core/ExprEngine.cpp | 156 +- clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp | 77 +- .../Core/ExprEngineCallAndReturn.cpp | 61 +- clang/lib/StaticAnalyzer/Core/MemRegion.cpp | 4 + .../StaticAnalyzer/Core/RangeConstraintManager.cpp | 133 +- clang/lib/StaticAnalyzer/Core/SValBuilder.cpp | 870 ++++---- clang/lib/StaticAnalyzer/Core/SVals.cpp | 10 + .../DependencyScanning/DependencyScanningTool.cpp | 5 +- .../DependencyScanningWorker.cpp | 7 +- clang/lib/Tooling/Syntax/BuildTree.cpp | 57 +- clang/lib/Tooling/Syntax/ComputeReplacements.cpp | 37 +- clang/lib/Tooling/Syntax/Mutations.cpp | 5 +- clang/lib/Tooling/Syntax/Nodes.cpp | 2 +- clang/lib/Tooling/Syntax/Synthesis.cpp | 34 +- .../lib/Tooling/Syntax/TokenBufferTokenManager.cpp | 25 + clang/lib/Tooling/Syntax/Tree.cpp | 52 +- clang/tools/driver/cc1_main.cpp | 11 +- clang/utils/TableGen/ClangOptionDocEmitter.cpp | 28 + compiler-rt/lib/asan/asan_interceptors.cpp | 35 +- compiler-rt/lib/asan/asan_interceptors_vfork.S | 1 + compiler-rt/lib/asan/asan_internal.h | 1 + compiler-rt/lib/asan/asan_linux.cpp | 12 +- compiler-rt/lib/asan/asan_mac.cpp | 2 + compiler-rt/lib/asan/asan_mapping.h | 9 + compiler-rt/lib/asan/asan_win.cpp | 2 + compiler-rt/lib/hwasan/hwasan_linux.cpp | 13 +- compiler-rt/lib/lsan/lsan_common.cpp | 2 +- compiler-rt/lib/memprof/memprof_internal.h | 2 - compiler-rt/lib/memprof/memprof_linux.cpp | 6 - compiler-rt/lib/msan/msan.h | 21 + ...zer_common_interceptors_vfork_loongarch64.inc.S | 63 + .../sanitizer_coverage_interface.inc | 10 + .../sanitizer_coverage_libcdep_new.cpp | 10 + .../sanitizer_interface_internal.h | 20 + .../lib/sanitizer_common/sanitizer_linux.cpp | 104 +- .../sanitizer_common/sanitizer_linux_libcdep.cpp | 52 +- compiler-rt/lib/sanitizer_common/sanitizer_mac.cpp | 56 + compiler-rt/lib/sanitizer_common/sanitizer_mac.h | 11 + .../lib/sanitizer_common/sanitizer_platform.h | 6 + .../sanitizer_platform_limits_linux.cpp | 3 +- .../sanitizer_platform_limits_posix.cpp | 6 +- .../sanitizer_platform_limits_posix.h | 12 +- .../sanitizer_procmaps_solaris.cpp | 58 +- .../lib/sanitizer_common/sanitizer_solaris.h | 56 + .../lib/sanitizer_common/sanitizer_stacktrace.cpp | 4 +- .../sanitizer_stoptheworld_mac.cpp | 2 +- .../sanitizer_symbolizer_posix_libcdep.cpp | 1 - .../sanitizer_syscall_linux_loongarch64.inc | 167 ++ compiler-rt/lib/tsan/rtl/tsan_dense_alloc.h | 115 +- compiler-rt/lib/tsan/rtl/tsan_platform_mac.cpp | 59 +- compiler-rt/lib/tsan/rtl/tsan_rtl.cpp | 29 +- compiler-rt/lib/ubsan/ubsan_value.cpp | 6 +- libcxx/include/__algorithm/equal_range.h | 87 +- libcxx/include/__algorithm/includes.h | 58 +- libcxx/include/__algorithm/inplace_merge.h | 48 +- libcxx/include/__algorithm/iterator_operations.h | 28 +- libcxx/include/__algorithm/make_heap.h | 7 +- libcxx/include/__algorithm/make_projected.h | 15 + libcxx/include/__algorithm/min_element.h | 44 +- libcxx/include/__algorithm/nth_element.h | 36 +- libcxx/include/__algorithm/partial_sort.h | 71 +- libcxx/include/__algorithm/partial_sort_copy.h | 12 +- libcxx/include/__algorithm/partition.h | 49 +- libcxx/include/__algorithm/pop_heap.h | 17 +- libcxx/include/__algorithm/push_heap.h | 17 +- libcxx/include/__algorithm/ranges_equal_range.h | 41 +- libcxx/include/__algorithm/ranges_fill.h | 2 +- libcxx/include/__algorithm/ranges_find_end.h | 18 +- libcxx/include/__algorithm/ranges_for_each_n.h | 1 - libcxx/include/__algorithm/ranges_generate_n.h | 1 - libcxx/include/__algorithm/ranges_includes.h | 60 +- libcxx/include/__algorithm/ranges_is_heap.h | 1 - .../include/__algorithm/ranges_iterator_concept.h | 51 + libcxx/include/__algorithm/ranges_make_heap.h | 3 +- libcxx/include/__algorithm/ranges_min_element.h | 1 + libcxx/include/__algorithm/ranges_nth_element.h | 3 +- libcxx/include/__algorithm/ranges_partial_sort.h | 77 + libcxx/include/__algorithm/ranges_partition.h | 22 +- libcxx/include/__algorithm/ranges_partition_copy.h | 36 +- .../include/__algorithm/ranges_partition_point.h | 37 +- libcxx/include/__algorithm/ranges_pop_heap.h | 3 +- libcxx/include/__algorithm/ranges_push_heap.h | 3 +- libcxx/include/__algorithm/ranges_set_union.h | 84 +- libcxx/include/__algorithm/ranges_shuffle.h | 49 +- libcxx/include/__algorithm/ranges_sort.h | 3 +- libcxx/include/__algorithm/ranges_sort_heap.h | 3 +- .../include/__algorithm/ranges_stable_partition.h | 25 +- libcxx/include/__algorithm/ranges_stable_sort.h | 3 +- libcxx/include/__algorithm/rotate.h | 85 +- libcxx/include/__algorithm/search_n.h | 2 +- libcxx/include/__algorithm/set_union.h | 102 +- libcxx/include/__algorithm/shuffle.h | 25 +- libcxx/include/__algorithm/sift_down.h | 13 +- libcxx/include/__algorithm/sort.h | 268 ++- libcxx/include/__algorithm/sort_heap.h | 12 +- libcxx/include/__algorithm/stable_partition.h | 95 +- libcxx/include/__algorithm/stable_sort.h | 75 +- libcxx/include/__algorithm/unwrap_iter.h | 76 +- libcxx/include/__algorithm/upper_bound.h | 64 +- libcxx/include/__config | 25 +- libcxx/include/__debug_utils/randomize_range.h | 7 +- .../__format/extended_grapheme_cluster_table.h | 332 +++ libcxx/include/__format/formatter_integral.h | 2 +- libcxx/include/__format/formatter_output.h | 111 +- libcxx/include/__format/formatter_string.h | 4 +- libcxx/include/__format/parser_std_format_spec.h | 664 ++---- libcxx/include/__format/unicode.h | 339 +++ libcxx/include/__iterator/reverse_iterator.h | 39 +- libcxx/include/__locale | 9 +- libcxx/include/__random/binomial_distribution.h | 2 +- libcxx/include/__random/discrete_distribution.h | 2 +- libcxx/include/__random/geometric_distribution.h | 2 +- libcxx/include/__random/is_valid.h | 7 +- .../__random/negative_binomial_distribution.h | 8 +- libcxx/include/__random/poisson_distribution.h | 2 +- libcxx/include/__random/uniform_int_distribution.h | 2 +- libcxx/include/algorithm | 122 ++ libcxx/include/bit | 3 - libcxx/include/format | 3 +- libcxx/include/limits | 4 - libcxx/include/module.modulemap.in | 46 +- libcxx/include/ostream | 84 + libcxx/include/version | 4 +- libunwind/src/UnwindCursor.hpp | 10 +- lld/COFF/Chunks.cpp | 3 +- lld/COFF/DLL.cpp | 8 +- lld/COFF/DebugTypes.cpp | 3 +- lld/COFF/DriverUtils.cpp | 10 +- lld/COFF/PDB.cpp | 18 +- lld/ELF/Arch/RISCV.cpp | 82 +- lld/ELF/Driver.cpp | 27 +- lld/ELF/InputFiles.cpp | 37 +- lld/ELF/InputFiles.h | 10 +- lld/ELF/LTO.cpp | 4 +- lld/ELF/SyntheticSections.cpp | 8 +- lld/ELF/Writer.cpp | 4 +- lld/MachO/Arch/ARM.cpp | 34 +- lld/MachO/Arch/ARM64.cpp | 42 +- lld/MachO/Arch/ARM64_32.cpp | 39 +- lld/MachO/Arch/X86_64.cpp | 36 +- lld/MachO/Config.h | 11 +- lld/MachO/Driver.cpp | 138 +- lld/MachO/ICF.cpp | 31 +- lld/MachO/ICF.h | 2 +- lld/MachO/InputFiles.cpp | 74 +- lld/MachO/InputFiles.h | 1 + lld/MachO/InputSection.cpp | 5 + lld/MachO/InputSection.h | 3 +- lld/MachO/LTO.cpp | 25 +- lld/MachO/Options.td | 1 - lld/MachO/SectionPriorities.cpp | 2 +- lld/MachO/SymbolTable.cpp | 7 + lld/MachO/SymbolTable.h | 2 + lld/MachO/SyntheticSections.cpp | 235 ++- lld/MachO/SyntheticSections.h | 23 + lld/MachO/Target.h | 11 +- lld/MachO/UnwindInfoSection.cpp | 2 +- lld/MachO/Writer.cpp | 5 + lldb/include/lldb/Core/EmulateInstruction.h | 2 +- lldb/include/lldb/DataFormatters/TypeCategory.h | 2 +- lldb/include/lldb/DataFormatters/TypeSynthetic.h | 2 +- lldb/include/lldb/Expression/Materializer.h | 22 + lldb/include/lldb/Expression/UserExpression.h | 17 + lldb/include/lldb/Interpreter/CommandObject.h | 11 +- .../lldb/Interpreter/CommandOptionArgumentTable.h | 334 +++ lldb/include/lldb/Symbol/SymbolFile.h | 2 +- lldb/include/lldb/Target/MemoryRegionInfo.h | 2 +- lldb/include/lldb/Target/Target.h | 6 - .../lldb/Utility/StringExtractorGDBRemote.h | 1 + lldb/include/lldb/lldb-enumerations.h | 2 + lldb/include/lldb/lldb-private-enumerations.h | 23 + lldb/include/lldb/lldb-private-types.h | 6 + lldb/source/API/SBBreakpoint.cpp | 3 +- lldb/source/API/SBMemoryRegionInfo.cpp | 6 +- lldb/source/Commands/CommandObjectBreakpoint.cpp | 1 + .../Commands/CommandObjectBreakpointCommand.cpp | 31 +- lldb/source/Commands/CommandObjectCommands.cpp | 24 +- lldb/source/Commands/CommandObjectDisassemble.cpp | 1 + lldb/source/Commands/CommandObjectExpression.cpp | 18 +- lldb/source/Commands/CommandObjectFrame.cpp | 5 +- lldb/source/Commands/CommandObjectHelp.cpp | 1 + lldb/source/Commands/CommandObjectLog.cpp | 31 +- lldb/source/Commands/CommandObjectMemory.cpp | 5 +- lldb/source/Commands/CommandObjectMemoryTag.cpp | 1 + lldb/source/Commands/CommandObjectPlatform.cpp | 1 + lldb/source/Commands/CommandObjectProcess.cpp | 17 +- lldb/source/Commands/CommandObjectRegister.cpp | 1 + lldb/source/Commands/CommandObjectReproducer.cpp | 87 +- lldb/source/Commands/CommandObjectScript.cpp | 23 +- lldb/source/Commands/CommandObjectSession.cpp | 1 + lldb/source/Commands/CommandObjectSettings.cpp | 1 + lldb/source/Commands/CommandObjectSource.cpp | 1 + lldb/source/Commands/CommandObjectStats.cpp | 1 + lldb/source/Commands/CommandObjectTarget.cpp | 53 +- lldb/source/Commands/CommandObjectThread.cpp | 23 +- lldb/source/Commands/CommandObjectTrace.cpp | 1 + lldb/source/Commands/CommandObjectType.cpp | 75 +- lldb/source/Commands/CommandObjectWatchpoint.cpp | 1 + .../Commands/CommandObjectWatchpointCommand.cpp | 31 +- .../source/Commands/CommandOptionArgumentTable.cpp | 313 +++ .../Commands/CommandOptionsProcessLaunch.cpp | 2 + lldb/source/Commands/Options.td | 26 +- lldb/source/Commands/OptionsBase.td | 6 +- lldb/source/Core/DumpDataExtractor.cpp | 4 +- lldb/source/Core/ValueObjectChild.cpp | 6 +- lldb/source/Expression/DWARFExpression.cpp | 18 +- lldb/source/Expression/Materializer.cpp | 233 ++- lldb/source/Expression/UserExpression.cpp | 16 +- lldb/source/Host/common/File.cpp | 10 +- lldb/source/Host/common/Terminal.cpp | 4 +- lldb/source/Interpreter/CommandObject.cpp | 438 +--- lldb/source/Interpreter/OptionValueArray.cpp | 2 +- .../source/Interpreter/OptionValueFileSpecList.cpp | 2 +- .../source/Interpreter/OptionValuePathMappings.cpp | 2 +- lldb/source/Plugins/ABI/X86/ABIX86.cpp | 4 +- .../Disassembler/LLVMC/DisassemblerLLVMC.cpp | 6 +- .../Hexagon-DYLD/HexagonDYLDRendezvous.cpp | 4 + .../Clang/ASTResultSynthesizer.cpp | 27 +- .../ExpressionParser/Clang/ClangASTSource.cpp | 7 +- .../Clang/ClangExpressionDeclMap.cpp | 173 +- .../Clang/ClangExpressionDeclMap.h | 31 + .../Clang/ClangExpressionSourceCode.cpp | 54 +- .../Clang/ClangExpressionSourceCode.h | 16 +- .../ExpressionParser/Clang/ClangExpressionUtil.cpp | 27 + .../ExpressionParser/Clang/ClangExpressionUtil.h | 30 + .../Clang/ClangExpressionVariable.h | 8 +- .../ExpressionParser/Clang/ClangUserExpression.cpp | 38 +- .../ExpressionParser/Clang/ClangUserExpression.h | 4 + .../Instruction/ARM/EmulateInstructionARM.h | 3 +- .../Language/CPlusPlus/CPlusPlusLanguage.cpp | 18 +- .../Language/CPlusPlus/CPlusPlusNameParser.cpp | 12 +- .../Plugins/Language/CPlusPlus/LibCxxList.cpp | 10 +- .../Plugins/Language/CPlusPlus/LibCxxMap.cpp | 4 +- lldb/source/Plugins/Language/ObjC/CFBasicHash.h | 2 +- lldb/source/Plugins/Language/ObjC/NSDictionary.cpp | 2 +- lldb/source/Plugins/Language/ObjC/NSError.cpp | 2 +- lldb/source/Plugins/Language/ObjC/NSSet.cpp | 2 +- .../AppleObjCRuntime/AppleObjCClassDescriptorV2.h | 12 +- .../AppleObjCTrampolineHandler.cpp | 9 +- .../RenderScriptRuntime/RenderScriptRuntime.cpp | 4 +- .../RenderScriptRuntime/RenderScriptRuntime.h | 3 +- .../Plugins/ObjectFile/ELF/ObjectFileELF.cpp | 5 +- .../ObjectFile/Minidump/MinidumpFileBuilder.cpp | 1 + .../Process/Utility/RegisterContextPOSIX_x86.cpp | 1 + .../Process/Utility/RegisterInfoPOSIX_arm64.cpp | 8 +- .../Process/gdb-remote/GDBRemoteCommunication.cpp | 6 +- .../GDBRemoteCommunicationServerLLGS.cpp | 333 ++- .../gdb-remote/GDBRemoteCommunicationServerLLGS.h | 25 +- .../Process/gdb-remote/ProcessGDBRemote.cpp | 10 +- .../Python/ScriptInterpreterPython.cpp | 6 +- .../SymbolFile/DWARF/DWARFASTParserClang.cpp | 81 +- .../Plugins/SymbolFile/DWARF/DWARFASTParserClang.h | 16 + .../Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp | 7 +- .../Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp | 34 + .../intel-pt/CommandObjectTraceStartIntelPT.cpp | 1 + .../ctf/CommandObjectThreadTraceExportCTF.cpp | 1 + .../Plugins/TypeSystem/Clang/TypeSystemClang.cpp | 2 +- .../InstEmulation/UnwindAssemblyInstEmulation.h | 4 +- .../x86/x86AssemblyInspectionEngine.cpp | 5 +- lldb/source/Symbol/ArmUnwindInfo.cpp | 2 +- lldb/source/Symbol/CompileUnit.cpp | 2 +- lldb/source/Symbol/Symtab.cpp | 2 +- lldb/source/Target/DynamicRegisterInfo.cpp | 2 +- lldb/source/Target/Target.cpp | 2 +- lldb/source/Target/TargetList.cpp | 3 +- lldb/source/Target/Thread.cpp | 3 +- lldb/source/Target/UnixSignals.cpp | 7 +- lldb/source/Utility/ReproducerProvider.cpp | 2 +- lldb/source/Utility/SelectHelper.cpp | 4 +- lldb/source/Utility/StringExtractorGDBRemote.cpp | 2 + lldb/source/Utility/Timer.cpp | 2 +- lldb/utils/TableGen/LLDBOptionDefEmitter.cpp | 8 +- llvm/include/llvm/ADT/APInt.h | 4 +- llvm/include/llvm/ADT/APSInt.h | 4 +- llvm/include/llvm/ADT/AddressRanges.h | 82 +- llvm/include/llvm/ADT/BitVector.h | 4 +- llvm/include/llvm/ADT/EpochTracker.h | 6 +- llvm/include/llvm/ADT/IntEqClasses.h | 4 +- llvm/include/llvm/ADT/Triple.h | 14 +- .../llvm/Analysis/FunctionPropertiesAnalysis.h | 1 - llvm/include/llvm/Analysis/IVDescriptors.h | 3 - llvm/include/llvm/Analysis/LoopCacheAnalysis.h | 5 +- llvm/include/llvm/Analysis/LoopInfo.h | 15 +- llvm/include/llvm/Analysis/MemoryBuiltins.h | 39 +- llvm/include/llvm/Analysis/MemoryProfileInfo.h | 112 + llvm/include/llvm/Analysis/ScalarEvolution.h | 6 +- llvm/include/llvm/Analysis/SparsePropagation.h | 4 +- llvm/include/llvm/Analysis/TargetTransformInfo.h | 20 +- .../llvm/Analysis/TargetTransformInfoImpl.h | 2 +- llvm/include/llvm/BinaryFormat/XCOFF.h | 1 + llvm/include/llvm/CodeGen/BasicBlockSectionUtils.h | 2 + .../llvm/CodeGen/BasicBlockSectionsProfileReader.h | 6 +- llvm/include/llvm/CodeGen/BasicTTIImpl.h | 4 +- llvm/include/llvm/CodeGen/CallingConvLower.h | 4 +- .../include/llvm/CodeGen/GlobalISel/IRTranslator.h | 1 + llvm/include/llvm/CodeGen/GlobalISel/Utils.h | 1 - llvm/include/llvm/CodeGen/ISDOpcodes.h | 6 + llvm/include/llvm/CodeGen/LiveIntervals.h | 7 +- llvm/include/llvm/CodeGen/LiveRangeEdit.h | 14 +- llvm/include/llvm/CodeGen/LiveVariables.h | 6 +- llvm/include/llvm/CodeGen/MachineInstr.h | 7 +- llvm/include/llvm/CodeGen/MachineModuleInfo.h | 1 - llvm/include/llvm/CodeGen/MachinePipeliner.h | 4 +- llvm/include/llvm/CodeGen/Passes.h | 1 - llvm/include/llvm/CodeGen/RegisterScavenging.h | 12 +- llvm/include/llvm/CodeGen/ScheduleDAG.h | 5 +- llvm/include/llvm/CodeGen/SelectionDAG.h | 6 +- llvm/include/llvm/CodeGen/SelectionDAGISel.h | 4 + llvm/include/llvm/CodeGen/TargetInstrInfo.h | 13 +- llvm/include/llvm/CodeGen/TargetLowering.h | 10 +- llvm/include/llvm/DWARFLinker/DWARFLinker.h | 22 +- .../llvm/DWARFLinker/DWARFLinkerCompileUnit.h | 26 +- llvm/include/llvm/DWARFLinker/DWARFStreamer.h | 2 +- .../llvm/DebugInfo/CodeView/CodeViewRegisters.def | 76 +- llvm/include/llvm/DebugInfo/Symbolize/Markup.h | 4 + .../llvm/DebugInfo/Symbolize/MarkupFilter.h | 98 +- llvm/include/llvm/Debuginfod/HTTPServer.h | 6 +- llvm/include/llvm/Demangle/ItaniumDemangle.h | 6 +- llvm/include/llvm/Demangle/StringView.h | 4 +- llvm/include/llvm/Demangle/Utility.h | 4 +- .../Orc/MapperJITLinkMemoryManager.h | 56 + .../llvm/ExecutionEngine/Orc/MemoryMapper.h | 60 +- .../llvm/ExecutionEngine/Orc/Shared/OrcRTBridge.h | 21 + .../Orc/Shared/SimplePackedSerialization.h | 9 +- .../Orc/Shared/TargetProcessControlTypes.h | 61 +- .../ExecutorSharedMemoryMapperService.h | 78 + .../llvm/Frontend/Directive/DirectiveBase.td | 12 + llvm/include/llvm/Frontend/OpenACC/ACC.td | 7 + llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h | 9 + llvm/include/llvm/Frontend/OpenMP/OMPKinds.def | 5 +- llvm/include/llvm/IR/FixedMetadataKinds.def | 2 + llvm/include/llvm/IR/GlobalIFunc.h | 6 + llvm/include/llvm/IR/IRBuilder.h | 2 +- llvm/include/llvm/IR/InlineAsm.h | 5 +- llvm/include/llvm/IR/Instruction.h | 15 - llvm/include/llvm/IR/Instructions.h | 7 +- llvm/include/llvm/IR/IntrinsicInst.h | 2 +- llvm/include/llvm/IR/Intrinsics.td | 14 +- llvm/include/llvm/IR/IntrinsicsAMDGPU.td | 78 + llvm/include/llvm/IR/IntrinsicsSPIRV.td | 3 +- llvm/include/llvm/IR/Metadata.h | 6 +- llvm/include/llvm/IR/PatternMatch.h | 18 +- llvm/include/llvm/IR/Statepoint.h | 1 - llvm/include/llvm/InitializePasses.h | 13 - llvm/include/llvm/LinkAllPasses.h | 5 - llvm/include/llvm/MC/MCContext.h | 2 - llvm/include/llvm/MC/MCDXContainerStreamer.h | 2 - llvm/include/llvm/MC/MCMachObjectWriter.h | 4 +- llvm/include/llvm/MC/MCSPIRVStreamer.h | 2 - llvm/include/llvm/MC/MCTargetOptions.h | 1 - llvm/include/llvm/Object/Archive.h | 2 +- llvm/include/llvm/Object/DXContainer.h | 2 +- llvm/include/llvm/Object/Decompressor.h | 12 - llvm/include/llvm/Object/ELF.h | 31 +- llvm/include/llvm/Object/ELFObjectFile.h | 2 + llvm/include/llvm/Object/OffloadBinary.h | 6 +- llvm/include/llvm/ObjectYAML/OffloadYAML.h | 2 +- .../include/llvm/Passes/StandardInstrumentations.h | 6 +- llvm/include/llvm/ProfileData/InstrProfReader.h | 11 +- llvm/include/llvm/ProfileData/SampleProf.h | 18 +- llvm/include/llvm/Support/AMDHSAKernelDescriptor.h | 3 +- llvm/include/llvm/Support/Casting.h | 2 +- llvm/include/llvm/Support/Compression.h | 23 +- llvm/include/llvm/Support/DivisionByConstantInfo.h | 8 +- llvm/include/llvm/Support/JSON.h | 106 +- llvm/include/llvm/Support/SpecialCaseList.h | 7 +- llvm/include/llvm/Support/VirtualFileSystem.h | 1 - llvm/include/llvm/TableGen/DirectiveEmitter.h | 10 + llvm/include/llvm/TableGen/Record.h | 10 +- llvm/include/llvm/Target/TargetCallingConv.td | 9 + llvm/include/llvm/Target/TargetSelectionDAG.td | 3 + llvm/include/llvm/Transforms/IPO.h | 40 - llvm/include/llvm/Transforms/IPO/Attributor.h | 165 +- .../llvm/Transforms/IPO/PassManagerBuilder.h | 16 - .../llvm/Transforms/IPO/ProfiledCallGraph.h | 4 +- .../llvm/Transforms/InstCombine/InstCombiner.h | 2 +- llvm/include/llvm/Transforms/Instrumentation.h | 10 - .../Transforms/Instrumentation/AddressSanitizer.h | 5 - .../Instrumentation/HWAddressSanitizer.h | 1 - .../Transforms/Instrumentation/MemorySanitizer.h | 1 - .../Transforms/Instrumentation/SanitizerCoverage.h | 11 +- .../Transforms/Instrumentation/ThreadSanitizer.h | 1 - llvm/include/llvm/Transforms/Scalar.h | 4 - llvm/include/llvm/Transforms/Utils.h | 16 - llvm/include/llvm/Transforms/Utils/LowerAtomic.h | 6 +- llvm/include/llvm/Transforms/Utils/MisExpect.h | 5 + .../Transforms/Utils/ScalarEvolutionExpander.h | 23 +- llvm/include/llvm/WindowsDriver/MSVCPaths.h | 4 +- llvm/lib/Analysis/AliasSetTracker.cpp | 2 +- llvm/lib/Analysis/BasicAliasAnalysis.cpp | 2 +- llvm/lib/Analysis/BranchProbabilityInfo.cpp | 2 +- llvm/lib/Analysis/CFG.cpp | 2 +- llvm/lib/Analysis/CFLAndersAliasAnalysis.cpp | 2 +- llvm/lib/Analysis/CFLGraph.h | 3 +- llvm/lib/Analysis/CFLSteensAliasAnalysis.cpp | 2 +- llvm/lib/Analysis/ConstraintSystem.cpp | 2 +- llvm/lib/Analysis/CostModel.cpp | 26 +- llvm/lib/Analysis/DDG.cpp | 4 +- llvm/lib/Analysis/Delinearization.cpp | 2 +- llvm/lib/Analysis/DivergenceAnalysis.cpp | 8 +- llvm/lib/Analysis/GlobalsModRef.cpp | 4 +- llvm/lib/Analysis/IVDescriptors.cpp | 16 +- llvm/lib/Analysis/IVUsers.cpp | 2 +- .../lib/Analysis/InstructionPrecedenceTracking.cpp | 4 +- llvm/lib/Analysis/LazyValueInfo.cpp | 6 +- llvm/lib/Analysis/LegacyDivergenceAnalysis.cpp | 4 +- llvm/lib/Analysis/Lint.cpp | 2 +- llvm/lib/Analysis/LoopAccessAnalysis.cpp | 184 +- llvm/lib/Analysis/LoopCacheAnalysis.cpp | 29 +- llvm/lib/Analysis/LoopInfo.cpp | 19 +- llvm/lib/Analysis/MemoryBuiltins.cpp | 125 +- llvm/lib/Analysis/MemoryDependenceAnalysis.cpp | 10 +- llvm/lib/Analysis/MemoryProfileInfo.cpp | 226 ++ llvm/lib/Analysis/MemorySSAUpdater.cpp | 16 +- llvm/lib/Analysis/ModuleDebugInfoPrinter.cpp | 2 +- llvm/lib/Analysis/ModuleSummaryAnalysis.cpp | 32 +- llvm/lib/Analysis/MustExecute.cpp | 18 +- llvm/lib/Analysis/ScalarEvolution.cpp | 139 +- llvm/lib/Analysis/StackLifetime.cpp | 2 +- llvm/lib/Analysis/StackSafetyAnalysis.cpp | 20 +- llvm/lib/Analysis/TargetTransformInfo.cpp | 10 +- llvm/lib/Analysis/TypeBasedAliasAnalysis.cpp | 5 +- llvm/lib/Analysis/ValueTracking.cpp | 12 +- llvm/lib/Analysis/VectorUtils.cpp | 4 +- llvm/lib/BinaryFormat/AMDGPUMetadataVerifier.cpp | 3 + llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 55 + llvm/lib/Bitcode/Reader/MetadataLoader.cpp | 27 +- llvm/lib/Bitcode/Reader/ValueList.h | 1 - llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | 5 +- llvm/lib/Bitcode/Writer/ValueEnumerator.cpp | 2 +- llvm/lib/CodeGen/AsmPrinter/AccelTable.cpp | 12 +- llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 55 +- llvm/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp | 2 +- llvm/lib/CodeGen/AsmPrinter/DIEHash.cpp | 2 +- .../AsmPrinter/DbgEntityHistoryCalculator.cpp | 4 +- llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp | 2 +- llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | 6 +- llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 6 +- llvm/lib/CodeGen/AtomicExpandPass.cpp | 6 +- llvm/lib/CodeGen/BasicBlockSections.cpp | 8 +- llvm/lib/CodeGen/CalcSpillWeights.cpp | 4 +- llvm/lib/CodeGen/CodeGenPrepare.cpp | 48 +- llvm/lib/CodeGen/DFAPacketizer.cpp | 2 +- llvm/lib/CodeGen/EarlyIfConversion.cpp | 10 +- llvm/lib/CodeGen/ExpandVectorPredication.cpp | 87 +- llvm/lib/CodeGen/FaultMaps.cpp | 2 +- llvm/lib/CodeGen/GlobalISel/CSEInfo.cpp | 2 +- llvm/lib/CodeGen/GlobalISel/CallLowering.cpp | 4 +- llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp | 20 +- llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp | 89 +- llvm/lib/CodeGen/GlobalISel/InlineAsmLowering.cpp | 5 +- llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp | 30 +- llvm/lib/CodeGen/GlobalISel/LoadStoreOpt.cpp | 6 +- llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp | 2 +- llvm/lib/CodeGen/GlobalISel/Utils.cpp | 2 +- llvm/lib/CodeGen/HardwareLoops.cpp | 6 +- llvm/lib/CodeGen/ImplicitNullChecks.cpp | 2 +- llvm/lib/CodeGen/InlineSpiller.cpp | 22 +- llvm/lib/CodeGen/InterleavedAccessPass.cpp | 2 +- llvm/lib/CodeGen/InterleavedLoadCombinePass.cpp | 8 +- .../CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp | 49 +- .../CodeGen/LiveDebugValues/VarLocBasedImpl.cpp | 6 +- llvm/lib/CodeGen/LiveDebugVariables.cpp | 2 +- llvm/lib/CodeGen/LiveIntervals.cpp | 13 +- llvm/lib/CodeGen/LiveRangeEdit.cpp | 23 +- llvm/lib/CodeGen/LiveVariables.cpp | 3 +- llvm/lib/CodeGen/LowerEmuTLS.cpp | 2 +- llvm/lib/CodeGen/MIRCanonicalizerPass.cpp | 4 +- llvm/lib/CodeGen/MIRParser/MIParser.cpp | 2 +- llvm/lib/CodeGen/MIRParser/MIRParser.cpp | 4 +- llvm/lib/CodeGen/MLRegallocEvictAdvisor.cpp | 8 +- llvm/lib/CodeGen/MachineBasicBlock.cpp | 2 +- llvm/lib/CodeGen/MachineBlockPlacement.cpp | 8 +- llvm/lib/CodeGen/MachineCSE.cpp | 2 +- llvm/lib/CodeGen/MachineCombiner.cpp | 49 +- llvm/lib/CodeGen/MachineFrameInfo.cpp | 2 +- llvm/lib/CodeGen/MachineFunction.cpp | 4 +- llvm/lib/CodeGen/MachineFunctionSplitter.cpp | 2 +- llvm/lib/CodeGen/MachineInstr.cpp | 12 +- llvm/lib/CodeGen/MachineLICM.cpp | 17 +- llvm/lib/CodeGen/MachinePipeliner.cpp | 24 +- llvm/lib/CodeGen/MachineScheduler.cpp | 2 +- llvm/lib/CodeGen/MachineSink.cpp | 2 +- llvm/lib/CodeGen/MachineStableHash.cpp | 4 +- llvm/lib/CodeGen/MachineTraceMetrics.cpp | 4 +- llvm/lib/CodeGen/MachineVerifier.cpp | 4 +- llvm/lib/CodeGen/RDFGraph.cpp | 4 +- llvm/lib/CodeGen/RDFLiveness.cpp | 12 +- llvm/lib/CodeGen/ReachingDefAnalysis.cpp | 2 +- llvm/lib/CodeGen/RegAllocBase.cpp | 2 +- llvm/lib/CodeGen/RegAllocBasic.cpp | 1 + llvm/lib/CodeGen/RegAllocFast.cpp | 7 +- llvm/lib/CodeGen/RegAllocGreedy.cpp | 16 +- llvm/lib/CodeGen/RegAllocGreedy.h | 3 - llvm/lib/CodeGen/RegAllocPBQP.cpp | 2 +- llvm/lib/CodeGen/RegAllocScore.cpp | 5 +- llvm/lib/CodeGen/RegAllocScore.h | 4 +- llvm/lib/CodeGen/RegisterCoalescer.cpp | 4 +- llvm/lib/CodeGen/RegisterPressure.cpp | 6 +- llvm/lib/CodeGen/SafeStack.cpp | 4 +- llvm/lib/CodeGen/ScheduleDAGInstrs.cpp | 8 +- llvm/lib/CodeGen/SelectOptimize.cpp | 2 +- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 327 +-- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 12 +- .../CodeGen/SelectionDAG/LegalizeFloatTypes.cpp | 18 + .../CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp | 140 +- llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h | 5 + .../lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp | 24 + llvm/lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp | 2 +- .../CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp | 2 +- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 131 +- .../CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 128 +- .../CodeGen/SelectionDAG/SelectionDAGDumper.cpp | 2 + llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 95 +- .../CodeGen/SelectionDAG/StatepointLowering.cpp | 42 +- llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp | 114 +- llvm/lib/CodeGen/SlotIndexes.cpp | 11 +- llvm/lib/CodeGen/SplitKit.cpp | 14 +- llvm/lib/CodeGen/SplitKit.h | 7 +- llvm/lib/CodeGen/StackMaps.cpp | 2 +- llvm/lib/CodeGen/SwiftErrorValueTracking.cpp | 2 +- llvm/lib/CodeGen/TailDuplicator.cpp | 2 +- llvm/lib/CodeGen/TargetInstrInfo.cpp | 4 +- llvm/lib/CodeGen/TargetLoweringBase.cpp | 2 +- llvm/lib/CodeGen/TwoAddressInstructionPass.cpp | 6 +- llvm/lib/CodeGen/TypePromotion.cpp | 6 +- llvm/lib/CodeGen/VLIWMachineScheduler.cpp | 2 +- llvm/lib/DWARFLinker/DWARFLinker.cpp | 64 +- llvm/lib/DWARFLinker/DWARFLinkerCompileUnit.cpp | 6 +- llvm/lib/DWARFLinker/DWARFStreamer.cpp | 20 +- llvm/lib/DWP/DWP.cpp | 19 +- llvm/lib/DebugInfo/CodeView/TypeRecordMapping.cpp | 6 +- llvm/lib/DebugInfo/DWARF/DWARFContext.cpp | 2 +- llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp | 4 - llvm/lib/DebugInfo/Symbolize/Markup.cpp | 3 + llvm/lib/DebugInfo/Symbolize/MarkupFilter.cpp | 389 +++- .../JITLink/COFFLinkGraphBuilder.cpp | 2 +- .../JITLink/DWARFRecordSectionSplitter.cpp | 2 +- .../Orc/JITTargetMachineBuilder.cpp | 4 + .../Orc/MapperJITLinkMemoryManager.cpp | 135 ++ llvm/lib/ExecutionEngine/Orc/MemoryMapper.cpp | 254 +++ .../lib/ExecutionEngine/Orc/Shared/OrcRTBridge.cpp | 15 + .../ExecutorSharedMemoryMapperService.cpp | 341 ++++ .../TargetProcess/SimpleExecutorMemoryManager.cpp | 3 +- llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp | 31 +- llvm/lib/IR/Function.cpp | 2 + llvm/lib/IR/GCStrategy.cpp | 5 +- llvm/lib/IR/Globals.cpp | 37 +- llvm/lib/IR/InlineAsm.cpp | 20 +- llvm/lib/IR/Instructions.cpp | 13 +- llvm/lib/IR/IntrinsicInst.cpp | 22 +- llvm/lib/IR/Verifier.cpp | 110 +- llvm/lib/Linker/IRMover.cpp | 32 +- llvm/lib/MC/ELFObjectWriter.cpp | 82 +- llvm/lib/MC/MCContext.cpp | 18 - llvm/lib/MC/MCMachOStreamer.cpp | 18 +- llvm/lib/MC/MCParser/MasmParser.cpp | 33 +- llvm/lib/MC/MCPseudoProbe.cpp | 3 +- llvm/lib/MC/MachObjectWriter.cpp | 25 +- llvm/lib/MC/WinCOFFObjectWriter.cpp | 1 + llvm/lib/MC/XCOFFObjectWriter.cpp | 43 +- llvm/lib/ObjCopy/ELF/ELFObject.cpp | 3 - llvm/lib/Object/Archive.cpp | 61 +- llvm/lib/Object/Decompressor.cpp | 39 +- llvm/lib/Object/WasmObjectFile.cpp | 2 +- llvm/lib/Passes/PassBuilderPipelines.cpp | 2 +- llvm/lib/Passes/StandardInstrumentations.cpp | 84 +- llvm/lib/ProfileData/Coverage/CoverageMapping.cpp | 12 +- llvm/lib/ProfileData/InstrProfReader.cpp | 38 +- llvm/lib/Support/AddressRanges.cpp | 57 +- llvm/lib/Support/CommandLine.cpp | 2 +- llvm/lib/Support/Compression.cpp | 65 + llvm/lib/Support/DivisionByConstantInfo.cpp | 8 +- llvm/lib/Support/RISCVISAInfo.cpp | 2 + llvm/lib/TableGen/JSONBackend.cpp | 4 +- llvm/lib/TableGen/Record.cpp | 8 + llvm/lib/TableGen/TGParser.cpp | 2 + llvm/lib/Target/AArch64/AArch64.td | 2 +- llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp | 55 +- llvm/lib/Target/AArch64/AArch64ISelLowering.cpp | 119 +- llvm/lib/Target/AArch64/AArch64ISelLowering.h | 9 +- llvm/lib/Target/AArch64/AArch64InstrFormats.td | 6 + llvm/lib/Target/AArch64/AArch64InstrInfo.td | 25 + .../lib/Target/AArch64/AArch64MachineScheduler.cpp | 4 +- llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td | 36 +- llvm/lib/Target/AArch64/AArch64TargetMachine.cpp | 24 +- .../Target/AArch64/AArch64TargetTransformInfo.cpp | 86 + .../Target/AArch64/AArch64TargetTransformInfo.h | 10 + .../AArch64/MCTargetDesc/AArch64MCTargetDesc.cpp | 65 +- llvm/lib/Target/AMDGPU/AMDGPU.td | 17 +- llvm/lib/Target/AMDGPU/AMDGPUArgumentUsageInfo.cpp | 5 + llvm/lib/Target/AMDGPU/AMDGPUArgumentUsageInfo.h | 2 + llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp | 67 + llvm/lib/Target/AMDGPU/AMDGPUAsmPrinter.h | 3 + llvm/lib/Target/AMDGPU/AMDGPUAttributes.def | 1 + llvm/lib/Target/AMDGPU/AMDGPUAttributor.cpp | 19 +- llvm/lib/Target/AMDGPU/AMDGPUCallLowering.cpp | 14 +- llvm/lib/Target/AMDGPU/AMDGPUGISel.td | 4 + .../Target/AMDGPU/AMDGPUHSAMetadataStreamer.cpp | 2 + llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp | 76 +- llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.h | 14 +- .../Target/AMDGPU/AMDGPUInstructionSelector.cpp | 166 +- llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.h | 8 +- llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp | 32 + llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.h | 7 + llvm/lib/Target/AMDGPU/AMDGPULibCalls.cpp | 23 +- .../lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp | 45 +- llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.cpp | 16 + llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.h | 5 +- llvm/lib/Target/AMDGPU/AMDGPUPerfHintAnalysis.cpp | 47 +- llvm/lib/Target/AMDGPU/AMDGPUPerfHintAnalysis.h | 6 +- llvm/lib/Target/AMDGPU/AMDGPURegBankCombiner.cpp | 5 +- llvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp | 20 +- .../AMDGPU/AMDGPUReplaceLDSUseWithPointer.cpp | 2 +- llvm/lib/Target/AMDGPU/AMDGPUSearchableTables.td | 16 + llvm/lib/Target/AMDGPU/AMDGPUSubtarget.cpp | 50 +- llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp | 3 + .../Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp | 102 +- .../AMDGPU/Disassembler/AMDGPUDisassembler.cpp | 91 +- .../AMDGPU/Disassembler/AMDGPUDisassembler.h | 1 + llvm/lib/Target/AMDGPU/GCNDPPCombine.cpp | 17 + llvm/lib/Target/AMDGPU/GCNProcessors.td | 4 +- llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp | 7 +- llvm/lib/Target/AMDGPU/GCNSchedStrategy.h | 2 +- llvm/lib/Target/AMDGPU/GCNSubtarget.h | 7 +- .../AMDGPU/MCTargetDesc/AMDGPUInstPrinter.cpp | 5 +- .../AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.cpp | 2 + llvm/lib/Target/AMDGPU/SIFixSGPRCopies.cpp | 323 ++- llvm/lib/Target/AMDGPU/SIISelLowering.cpp | 40 +- llvm/lib/Target/AMDGPU/SIISelLowering.h | 1 + llvm/lib/Target/AMDGPU/SIInstrFormats.td | 2 +- llvm/lib/Target/AMDGPU/SIInstrInfo.cpp | 23 +- llvm/lib/Target/AMDGPU/SIInstrInfo.h | 3 +- llvm/lib/Target/AMDGPU/SIInstrInfo.td | 110 +- llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp | 11 + llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h | 6 + llvm/lib/Target/AMDGPU/SIOptimizeExecMasking.cpp | 309 +-- .../Target/AMDGPU/SIOptimizeExecMaskingPreRA.cpp | 82 +- llvm/lib/Target/AMDGPU/SIProgramInfo.h | 2 + llvm/lib/Target/AMDGPU/SMInstructions.td | 119 +- llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp | 4 +- llvm/lib/Target/AMDGPU/Utils/AMDGPUMemoryUtils.h | 2 +- llvm/lib/Target/AMDGPU/VOP1Instructions.td | 78 + llvm/lib/Target/AMDGPU/VOP3Instructions.td | 100 +- llvm/lib/Target/AMDGPU/VOP3PInstructions.td | 38 + llvm/lib/Target/AMDGPU/VOPCInstructions.td | 26 +- llvm/lib/Target/AMDGPU/VOPInstructions.td | 42 + llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp | 4 +- llvm/lib/Target/ARM/ARMBaseInstrInfo.h | 3 +- llvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp | 15 +- llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp | 6 +- llvm/lib/Target/ARM/ARMISelLowering.cpp | 42 + llvm/lib/Target/ARM/ARMISelLowering.h | 2 + llvm/lib/Target/ARM/ARMInstrMVE.td | 6 + llvm/lib/Target/ARM/ARMInstrThumb.td | 8 +- llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp | 14 +- llvm/lib/Target/ARM/ARMTargetTransformInfo.h | 8 +- llvm/lib/Target/AVR/AVRSubtarget.h | 14 +- llvm/lib/Target/CSKY/CSKYInstrInfo.cpp | 2 +- .../DirectX/DXILWriter/DXILBitcodeWriter.cpp | 8 +- .../DirectX/DXILWriter/DXILValueEnumerator.cpp | 2 +- llvm/lib/Target/Hexagon/HexagonVectorCombine.cpp | 1 - .../lib/Target/LoongArch/LoongArchISelLowering.cpp | 5 +- .../Target/LoongArch/LoongArchTargetMachine.cpp | 4 +- llvm/lib/Target/Mips/MipsISelLowering.cpp | 6 + llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp | 128 +- llvm/lib/Target/NVPTX/NVPTXAsmPrinter.h | 100 +- llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp | 95 +- llvm/lib/Target/NVPTX/NVPTXSubtarget.h | 1 + llvm/lib/Target/NVPTX/NVPTXUtilities.h | 10 + llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp | 25 +- llvm/lib/Target/PowerPC/PPCInstrInfo.cpp | 4 +- llvm/lib/Target/PowerPC/PPCInstrInfo.h | 3 +- llvm/lib/Target/PowerPC/PPCLoopInstrFormPrep.cpp | 13 +- llvm/lib/Target/RISCV/RISCV.h | 3 + llvm/lib/Target/RISCV/RISCV.td | 26 +- llvm/lib/Target/RISCV/RISCVCodeGenPrepare.cpp | 169 ++ llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp | 27 +- llvm/lib/Target/RISCV/RISCVISelLowering.cpp | 376 ++-- llvm/lib/Target/RISCV/RISCVInstrInfo.cpp | 112 +- llvm/lib/Target/RISCV/RISCVInstrInfo.h | 13 + llvm/lib/Target/RISCV/RISCVInstrInfo.td | 7 + llvm/lib/Target/RISCV/RISCVInstrInfoM.td | 22 +- llvm/lib/Target/RISCV/RISCVSExtWRemoval.cpp | 3 +- llvm/lib/Target/RISCV/RISCVSubtarget.cpp | 8 +- llvm/lib/Target/RISCV/RISCVSubtarget.h | 2 + llvm/lib/Target/RISCV/RISCVTargetMachine.cpp | 7 +- llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp | 5 +- .../Target/SPIRV/MCTargetDesc/SPIRVBaseInfo.cpp | 10 + llvm/lib/Target/SPIRV/MCTargetDesc/SPIRVBaseInfo.h | 13 + .../Target/SPIRV/MCTargetDesc/SPIRVInstPrinter.cpp | 15 +- llvm/lib/Target/SPIRV/SPIRV.h | 1 + llvm/lib/Target/SPIRV/SPIRVAsmPrinter.cpp | 164 +- llvm/lib/Target/SPIRV/SPIRVCallLowering.cpp | 201 +- llvm/lib/Target/SPIRV/SPIRVCallLowering.h | 6 +- llvm/lib/Target/SPIRV/SPIRVDuplicatesTracker.cpp | 2 +- llvm/lib/Target/SPIRV/SPIRVDuplicatesTracker.h | 4 +- llvm/lib/Target/SPIRV/SPIRVEmitIntrinsics.cpp | 61 +- llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.cpp | 425 +++- llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.h | 53 +- llvm/lib/Target/SPIRV/SPIRVInstrInfo.cpp | 14 +- llvm/lib/Target/SPIRV/SPIRVInstrInfo.h | 1 + llvm/lib/Target/SPIRV/SPIRVInstrInfo.td | 24 +- llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp | 252 ++- llvm/lib/Target/SPIRV/SPIRVMCInstLower.cpp | 7 +- llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.cpp | 168 +- llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.h | 8 +- llvm/lib/Target/SPIRV/SPIRVPreLegalizer.cpp | 75 +- llvm/lib/Target/SPIRV/SPIRVPrepareFunctions.cpp | 288 +++ llvm/lib/Target/SPIRV/SPIRVSubtarget.cpp | 3 +- llvm/lib/Target/SPIRV/SPIRVTargetMachine.cpp | 5 +- llvm/lib/Target/SPIRV/SPIRVUtils.cpp | 31 + llvm/lib/Target/SPIRV/SPIRVUtils.h | 6 + .../Target/Sparc/TargetInfo/SparcTargetInfo.cpp | 8 +- llvm/lib/Target/SystemZ/SystemZCallingConv.cpp | 4 - llvm/lib/Target/SystemZ/SystemZCallingConv.h | 38 - llvm/lib/Target/SystemZ/SystemZCallingConv.td | 34 +- llvm/lib/Target/SystemZ/SystemZFrameLowering.cpp | 101 +- llvm/lib/Target/SystemZ/SystemZFrameLowering.h | 2 + llvm/lib/Target/SystemZ/SystemZISelLowering.cpp | 8 +- llvm/lib/Target/VE/VEInstrInfo.cpp | 40 +- llvm/lib/Target/VE/VEInstrPatternsVec.td | 14 + llvm/lib/Target/VE/VEInstrVec.td | 27 + llvm/lib/Target/VE/VERegisterInfo.cpp | 201 ++ .../Target/WebAssembly/WebAssemblyInstrInfo.cpp | 2 +- llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.h | 3 +- .../Target/WebAssembly/WebAssemblyRegStackify.cpp | 23 +- llvm/lib/Target/X86/X86.td | 2 +- llvm/lib/Target/X86/X86FixupBWInsts.cpp | 12 +- llvm/lib/Target/X86/X86ISelLowering.cpp | 561 +++-- llvm/lib/Target/X86/X86InstrAVX512.td | 48 +- llvm/lib/Target/X86/X86InstrInfo.cpp | 12 +- llvm/lib/Target/X86/X86InstrInfo.h | 3 +- llvm/lib/Target/X86/X86InstrSSE.td | 70 + llvm/lib/Target/X86/X86TargetMachine.cpp | 8 +- llvm/lib/Target/X86/X86TargetTransformInfo.cpp | 65 +- llvm/lib/Target/XCore/XCoreFrameLowering.cpp | 2 +- llvm/lib/ToolDrivers/llvm-lib/Options.td | 1 + llvm/lib/Transforms/Coroutines/CoroCleanup.cpp | 4 +- llvm/lib/Transforms/Coroutines/CoroInternal.h | 2 - llvm/lib/Transforms/Coroutines/CoroSplit.cpp | 19 +- llvm/lib/Transforms/IPO/Attributor.cpp | 278 ++- llvm/lib/Transforms/IPO/AttributorAttributes.cpp | 2156 ++++++++++++-------- llvm/lib/Transforms/IPO/FunctionImport.cpp | 45 +- llvm/lib/Transforms/IPO/GlobalOpt.cpp | 2 +- llvm/lib/Transforms/IPO/IPO.cpp | 4 - llvm/lib/Transforms/IPO/Internalize.cpp | 36 +- llvm/lib/Transforms/IPO/LowerTypeTests.cpp | 42 - llvm/lib/Transforms/IPO/OpenMPOpt.cpp | 2 +- llvm/lib/Transforms/IPO/PassManagerBuilder.cpp | 106 +- llvm/lib/Transforms/IPO/SampleProfile.cpp | 102 +- llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp | 70 - .../Transforms/InstCombine/InstCombineAddSub.cpp | 12 +- .../Transforms/InstCombine/InstCombineAndOrXor.cpp | 45 +- .../Transforms/InstCombine/InstCombineCalls.cpp | 55 +- .../Transforms/InstCombine/InstCombineCompares.cpp | 57 +- .../Transforms/InstCombine/InstCombineInternal.h | 2 +- .../Transforms/InstCombine/InstCombineShifts.cpp | 18 + .../InstCombine/InstructionCombining.cpp | 52 +- .../Instrumentation/AddressSanitizer.cpp | 3 + llvm/lib/Transforms/Instrumentation/CGProfile.cpp | 36 - .../Instrumentation/ControlHeightReduction.cpp | 53 - .../Transforms/Instrumentation/InstrOrderFile.cpp | 31 - .../Transforms/Instrumentation/InstrProfiling.cpp | 44 - .../Transforms/Instrumentation/Instrumentation.cpp | 5 - .../Transforms/Instrumentation/MemorySanitizer.cpp | 16 + .../Instrumentation/PGOInstrumentation.cpp | 42 +- .../Instrumentation/SanitizerCoverage.cpp | 64 - .../lib/Transforms/Scalar/DeadStoreElimination.cpp | 73 +- llvm/lib/Transforms/Scalar/IndVarSimplify.cpp | 5 +- .../Scalar/InductiveRangeCheckElimination.cpp | 4 +- llvm/lib/Transforms/Scalar/LoopDataPrefetch.cpp | 6 +- llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp | 4 +- llvm/lib/Transforms/Scalar/LoopInterchange.cpp | 1 - llvm/lib/Transforms/Scalar/LoopPredication.cpp | 29 +- llvm/lib/Transforms/Scalar/LoopSimplifyCFG.cpp | 12 + llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp | 93 +- llvm/lib/Transforms/Scalar/Reassociate.cpp | 58 +- .../Transforms/Scalar/RewriteStatepointsForGC.cpp | 14 +- llvm/lib/Transforms/Scalar/Scalar.cpp | 2 - llvm/lib/Transforms/Scalar/StructurizeCFG.cpp | 59 - llvm/lib/Transforms/Utils/BasicBlockUtils.cpp | 13 +- llvm/lib/Transforms/Utils/BuildLibCalls.cpp | 228 ++- llvm/lib/Transforms/Utils/CanonicalizeAliases.cpp | 28 - llvm/lib/Transforms/Utils/CloneFunction.cpp | 19 +- .../lib/Transforms/Utils/EntryExitInstrumenter.cpp | 59 - llvm/lib/Transforms/Utils/Evaluator.cpp | 12 +- llvm/lib/Transforms/Utils/FunctionImportUtils.cpp | 7 + llvm/lib/Transforms/Utils/InlineFunction.cpp | 10 +- llvm/lib/Transforms/Utils/Local.cpp | 27 +- llvm/lib/Transforms/Utils/LoopRotationUtils.cpp | 2 +- llvm/lib/Transforms/Utils/LoopSimplify.cpp | 6 +- llvm/lib/Transforms/Utils/LoopUtils.cpp | 10 +- llvm/lib/Transforms/Utils/LowerAtomic.cpp | 2 +- llvm/lib/Transforms/Utils/NameAnonGlobals.cpp | 31 - .../Transforms/Utils/ScalarEvolutionExpander.cpp | 19 +- llvm/lib/Transforms/Utils/SimplifyCFG.cpp | 2 +- llvm/lib/Transforms/Utils/SimplifyIndVar.cpp | 105 +- llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp | 11 +- llvm/lib/Transforms/Utils/UnifyLoopExits.cpp | 46 +- llvm/lib/Transforms/Utils/Utils.cpp | 2 - llvm/lib/Transforms/Vectorize/LoopVectorize.cpp | 245 +-- llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp | 11 +- llvm/lib/Transforms/Vectorize/VPRecipeBuilder.h | 6 +- llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp | 46 + llvm/lib/Transforms/Vectorize/VPlanVerifier.cpp | 66 +- llvm/lib/Transforms/Vectorize/VectorCombine.cpp | 2 +- llvm/tools/llc/llc.cpp | 2 - llvm/tools/llvm-ar/llvm-ar.cpp | 162 +- llvm/tools/llvm-cov/CodeCoverage.cpp | 17 +- llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp | 2 +- llvm/tools/llvm-dwarfutil/DebugInfoLinker.cpp | 277 +++ llvm/tools/llvm-dwarfutil/DebugInfoLinker.h | 31 + llvm/tools/llvm-dwarfutil/Error.h | 44 + llvm/tools/llvm-dwarfutil/Options.h | 46 + llvm/tools/llvm-dwarfutil/Options.td | 65 + llvm/tools/llvm-dwarfutil/llvm-dwarfutil.cpp | 527 +++++ llvm/tools/llvm-mc/llvm-mc.cpp | 4 +- llvm/tools/llvm-objdump/llvm-objdump.cpp | 62 +- llvm/tools/llvm-objdump/llvm-objdump.h | 2 +- llvm/tools/llvm-profdata/llvm-profdata.cpp | 7 +- llvm/tools/llvm-size/llvm-size.cpp | 7 +- llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp | 15 +- llvm/tools/opt/opt.cpp | 28 - llvm/utils/TableGen/CTagsEmitter.cpp | 29 +- llvm/utils/TableGen/CallingConvEmitter.cpp | 25 +- llvm/utils/TableGen/DXILEmitter.cpp | 51 +- llvm/utils/TableGen/DirectiveEmitter.cpp | 82 + llvm/utils/TableGen/SearchableTableEmitter.cpp | 6 +- openmp/runtime/src/kmp.h | 13 + openmp/runtime/src/kmp_affinity.cpp | 152 +- openmp/runtime/src/kmp_csupport.cpp | 15 + openmp/runtime/src/kmp_ftn_entry.h | 70 +- openmp/runtime/src/kmp_global.cpp | 2 + openmp/runtime/src/kmp_os.h | 3 + openmp/runtime/src/kmp_runtime.cpp | 21 +- openmp/runtime/src/kmp_settings.cpp | 14 + openmp/runtime/src/z_Linux_util.cpp | 8 +- 975 files changed, 23821 insertions(+), 10427 deletions(-) create mode 100644 clang/include/clang/Analysis/FlowSensitive/NoopAnalysis.h create mode 100644 clang/include/clang/Basic/Sarif.h create mode 100644 clang/include/clang/Tooling/Syntax/TokenBufferTokenManager.h create mode 100644 clang/include/clang/Tooling/Syntax/TokenManager.h create mode 100644 clang/lib/Basic/Sarif.cpp create mode 100644 clang/lib/Tooling/Syntax/TokenBufferTokenManager.cpp create mode 100644 compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_vfork_loongarch64.inc.S create mode 100644 compiler-rt/lib/sanitizer_common/sanitizer_solaris.h create mode 100644 compiler-rt/lib/sanitizer_common/sanitizer_syscall_linux_loongarch64.inc create mode 100644 libcxx/include/__algorithm/ranges_iterator_concept.h create mode 100644 libcxx/include/__algorithm/ranges_partial_sort.h create mode 100644 libcxx/include/__format/extended_grapheme_cluster_table.h create mode 100644 libcxx/include/__format/unicode.h create mode 100644 lldb/include/lldb/Interpreter/CommandOptionArgumentTable.h create mode 100644 lldb/source/Commands/CommandOptionArgumentTable.cpp create mode 100644 lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionUtil.cpp create mode 100644 lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionUtil.h create mode 100644 llvm/include/llvm/Analysis/MemoryProfileInfo.h create mode 100644 llvm/include/llvm/ExecutionEngine/Orc/MapperJITLinkMemoryManager.h create mode 100644 llvm/include/llvm/ExecutionEngine/Orc/TargetProcess/ExecutorSharedMemoryMapperService.h create mode 100644 llvm/lib/Analysis/MemoryProfileInfo.cpp create mode 100644 llvm/lib/ExecutionEngine/Orc/MapperJITLinkMemoryManager.cpp create mode 100644 llvm/lib/ExecutionEngine/Orc/TargetProcess/ExecutorSharedMemoryMapperService.cpp create mode 100644 llvm/lib/Target/RISCV/RISCVCodeGenPrepare.cpp create mode 100644 llvm/lib/Target/SPIRV/SPIRVPrepareFunctions.cpp create mode 100644 llvm/tools/llvm-dwarfutil/DebugInfoLinker.cpp create mode 100644 llvm/tools/llvm-dwarfutil/DebugInfoLinker.h create mode 100644 llvm/tools/llvm-dwarfutil/Error.h create mode 100644 llvm/tools/llvm-dwarfutil/Options.h create mode 100644 llvm/tools/llvm-dwarfutil/Options.td create mode 100644 llvm/tools/llvm-dwarfutil/llvm-dwarfutil.cpp diff --git a/clang/include/clang/APINotes/Types.h b/clang/include/clang/APINotes/Types.h index 0e5b43080e4b..f155d6a06327 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.has_value(); - SwiftPrivate = Private ? *Private : 0; + SwiftPrivate = Private.value_or(0); } friend bool operator==(const CommonEntityInfo &, const CommonEntityInfo &); diff --git a/clang/include/clang/AST/ASTContext.h b/clang/include/clang/AST/ASTContext.h index 85eba45e4de6..9536b3faa02d 100644 --- a/clang/include/clang/AST/ASTContext.h +++ b/clang/include/clang/AST/ASTContext.h @@ -473,6 +473,9 @@ class ASTContext : public RefCountedBase { }; llvm::DenseMap ModuleInitializers; + /// For module code-gen cases, this is the top-level module we are building. + Module *TopLevelModule = nullptr; + static constexpr unsigned ConstantArrayTypesLog2InitSize = 8; static constexpr unsigned GeneralTypesLog2InitSize = 9; static constexpr unsigned FunctionProtoTypesLog2InitSize = 12; @@ -1076,6 +1079,12 @@ public: /// Get the initializations to perform when importing a module, if any. ArrayRef getModuleInitializers(Module *M); + /// Set the (C++20) module we are building. + void setModuleForCodeGen(Module *M) { TopLevelModule = M; } + + /// Get module under construction, nullptr if this is not a C++20 module. + Module *getModuleForCodeGen() const { return TopLevelModule; } + TranslationUnitDecl *getTranslationUnitDecl() const { return TUDecl->getMostRecentDecl(); } diff --git a/clang/include/clang/AST/Decl.h b/clang/include/clang/AST/Decl.h index 66fab94b45b8..fb87a75a1241 100644 --- a/clang/include/clang/AST/Decl.h +++ b/clang/include/clang/AST/Decl.h @@ -1890,7 +1890,10 @@ public: TK_FunctionTemplateSpecialization, // A function template specialization that hasn't yet been resolved to a // particular specialized function template. - TK_DependentFunctionTemplateSpecialization + TK_DependentFunctionTemplateSpecialization, + // A non-template function which is in a dependent scope. + TK_DependentNonTemplate + }; /// Stashed information about a defaulted function definition whose body has @@ -1939,20 +1942,21 @@ private: /// The template or declaration that this declaration /// describes or was instantiated from, respectively. /// - /// For non-templates, this value will be NULL. For function - /// declarations that describe a function template, this will be a - /// pointer to a FunctionTemplateDecl. For member functions - /// of class template specializations, this will be a MemberSpecializationInfo + /// For non-templates this value will be NULL, unless this declaration was + /// declared directly inside of a function template, in which case it will + /// have a pointer to a FunctionDecl, stored in the NamedDecl. For function + /// declarations that describe a function template, this will be a pointer to + /// a FunctionTemplateDecl, stored in the NamedDecl. For member functions of + /// class template specializations, this will be a MemberSpecializationInfo /// pointer containing information about the specialization. /// For function template specializations, this will be a /// FunctionTemplateSpecializationInfo, which contains information about /// the template being specialized and the template arguments involved in /// that specialization. - llvm::PointerUnion - TemplateOrSpecialization; + TemplateOrSpecialization; /// Provides source/type location info for the declaration name embedded in /// the DeclaratorDecl base class. @@ -2695,6 +2699,13 @@ public: setInstantiationOfMemberFunction(getASTContext(), FD, TSK); } + /// Specify that this function declaration was instantiated from a + /// FunctionDecl FD. This is only used if this is a function declaration + /// declared locally inside of a function template. + void setInstantiatedFromDecl(FunctionDecl *FD); + + FunctionDecl *getInstantiatedFromDecl() const; + /// Retrieves the function template that is described by this /// function declaration. /// diff --git a/clang/include/clang/AST/DeclBase.h b/clang/include/clang/AST/DeclBase.h index 52fe8dd6b1e5..d1193161fd75 100644 --- a/clang/include/clang/AST/DeclBase.h +++ b/clang/include/clang/AST/DeclBase.h @@ -920,10 +920,12 @@ public: /// If this decl is defined inside a function/method/block it returns /// the corresponding DeclContext, otherwise it returns null. - const DeclContext *getParentFunctionOrMethod() const; - DeclContext *getParentFunctionOrMethod() { - return const_cast( - const_cast(this)->getParentFunctionOrMethod()); + const DeclContext * + getParentFunctionOrMethod(bool LexicalParent = false) const; + DeclContext *getParentFunctionOrMethod(bool LexicalParent = false) { + return const_cast( + const_cast(this)->getParentFunctionOrMethod( + LexicalParent)); } /// Retrieves the "canonical" declaration of the given declaration. diff --git a/clang/include/clang/ASTMatchers/ASTMatchers.h b/clang/include/clang/ASTMatchers/ASTMatchers.h index ae5502d7af71..9f4d807c232d 100644 --- a/clang/include/clang/ASTMatchers/ASTMatchers.h +++ b/clang/include/clang/ASTMatchers/ASTMatchers.h @@ -3838,8 +3838,9 @@ AST_MATCHER_P(CallExpr, callee, internal::Matcher, InnerMatcher.matches(*ExprNode, Finder, Builder)); } -/// Matches if the call expression's callee's declaration matches the -/// given matcher. +/// Matches 1) if the call expression's callee's declaration matches the +/// given matcher; or 2) if the Obj-C message expression's callee's method +/// declaration matches the given matcher. /// /// Example matches y.x() (matcher = callExpr(callee( /// cxxMethodDecl(hasName("x"))))) @@ -3847,9 +3848,31 @@ AST_MATCHER_P(CallExpr, callee, internal::Matcher, /// class Y { public: void x(); }; /// void z() { Y y; y.x(); } /// \endcode -AST_MATCHER_P_OVERLOAD(CallExpr, callee, internal::Matcher, InnerMatcher, - 1) { - return callExpr(hasDeclaration(InnerMatcher)).matches(Node, Finder, Builder); +/// +/// Example 2. Matches [I foo] with +/// objcMessageExpr(callee(objcMethodDecl(hasName("foo")))) +/// +/// \code +/// @interface I: NSObject +/// +(void)foo; +/// @end +/// ... +/// [I foo] +/// \endcode +AST_POLYMORPHIC_MATCHER_P_OVERLOAD( + callee, AST_POLYMORPHIC_SUPPORTED_TYPES(ObjCMessageExpr, CallExpr), + internal::Matcher, InnerMatcher, 1) { + if (const auto *CallNode = dyn_cast(&Node)) + return callExpr(hasDeclaration(InnerMatcher)) + .matches(Node, Finder, Builder); + else { + // The dynamic cast below is guaranteed to succeed as there are only 2 + // supported return types. + const auto *MsgNode = cast(&Node); + const Decl *DeclNode = MsgNode->getMethodDecl(); + return (DeclNode != nullptr && + InnerMatcher.matches(*DeclNode, Finder, Builder)); + } } /// Matches if the expression's or declaration's type matches a type diff --git a/clang/include/clang/Analysis/Analyses/ThreadSafetyTIL.h b/clang/include/clang/Analysis/Analyses/ThreadSafetyTIL.h index 77a800c28754..65556c8d584c 100644 --- a/clang/include/clang/Analysis/Analyses/ThreadSafetyTIL.h +++ b/clang/include/clang/Analysis/Analyses/ThreadSafetyTIL.h @@ -75,7 +75,7 @@ namespace til { class BasicBlock; /// Enum for the different distinct classes of SExpr -enum TIL_Opcode { +enum TIL_Opcode : unsigned char { #define TIL_OPCODE_DEF(X) COP_##X, #include "ThreadSafetyOps.def" #undef TIL_OPCODE_DEF @@ -278,7 +278,7 @@ class SExpr { public: SExpr() = delete; - TIL_Opcode opcode() const { return static_cast(Opcode); } + TIL_Opcode opcode() const { return Opcode; } // Subclasses of SExpr must define the following: // @@ -321,7 +321,7 @@ protected: SExpr(TIL_Opcode Op) : Opcode(Op) {} SExpr(const SExpr &E) : Opcode(E.Opcode), Flags(E.Flags) {} - const unsigned char Opcode; + const TIL_Opcode Opcode; unsigned char Reserved = 0; unsigned short Flags = 0; unsigned SExprID = 0; @@ -332,7 +332,7 @@ protected: namespace ThreadSafetyTIL { inline bool isTrivial(const SExpr *E) { - unsigned Op = E->opcode(); + TIL_Opcode Op = E->opcode(); return Op == COP_Variable || Op == COP_Literal || Op == COP_LiteralPtr; } diff --git a/clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h b/clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h index 40ac95b3abdd..ef8f7a51496c 100644 --- a/clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h +++ b/clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h @@ -63,9 +63,15 @@ public: using Lattice = LatticeT; explicit DataflowAnalysis(ASTContext &Context) : Context(Context) {} + + /// Deprecated. Use the `DataflowAnalysisOptions` constructor instead. explicit DataflowAnalysis(ASTContext &Context, bool ApplyBuiltinTransfer) : TypeErasedDataflowAnalysis(ApplyBuiltinTransfer), Context(Context) {} + explicit DataflowAnalysis(ASTContext &Context, + DataflowAnalysisOptions Options) + : TypeErasedDataflowAnalysis(Options), Context(Context) {} + ASTContext &getASTContext() final { return Context; } TypeErasedLattice typeErasedInitialElement() final { diff --git a/clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h b/clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h index 358ace0430f6..abc3183e1b0b 100644 --- a/clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h +++ b/clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h @@ -23,6 +23,7 @@ #include "clang/Analysis/FlowSensitive/Value.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/DenseSet.h" +#include "llvm/Support/Compiler.h" #include #include #include @@ -251,6 +252,8 @@ public: /// `Val2` imposed by the flow condition. bool equivalentBoolValues(BoolValue &Val1, BoolValue &Val2); + LLVM_DUMP_METHOD void dumpFlowCondition(AtomicBoolValue &Token); + private: struct NullableQualTypeDenseMapInfo : private llvm::DenseMapInfo { static QualType getEmptyKey() { diff --git a/clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h b/clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h index ce195f0662f5..f17df36f6a4a 100644 --- a/clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h +++ b/clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h @@ -19,7 +19,6 @@ #include "clang/AST/DeclBase.h" #include "clang/AST/Expr.h" #include "clang/AST/Type.h" -#include "clang/AST/TypeOrdering.h" #include "clang/Analysis/FlowSensitive/DataflowAnalysisContext.h" #include "clang/Analysis/FlowSensitive/DataflowLattice.h" #include "clang/Analysis/FlowSensitive/StorageLocation.h" @@ -325,6 +324,8 @@ public: /// imply that `Val` is true. bool flowConditionImplies(BoolValue &Val) const; + LLVM_DUMP_METHOD void dump() const; + private: /// Creates a value appropriate for `Type`, if `Type` is supported, otherwise /// return null. diff --git a/clang/include/clang/Analysis/FlowSensitive/DebugSupport.h b/clang/include/clang/Analysis/FlowSensitive/DebugSupport.h index ef903d807e12..b8efdeb61d28 100644 --- a/clang/include/clang/Analysis/FlowSensitive/DebugSupport.h +++ b/clang/include/clang/Analysis/FlowSensitive/DebugSupport.h @@ -23,6 +23,13 @@ namespace clang { namespace dataflow { + +/// Returns a string representation of a boolean assignment to true or false. +std::string debugString(Solver::Result::Assignment Assignment); + +/// Returns a string representation of the result status of a SAT check. +std::string debugString(Solver::Result::Status Status); + /// Returns a string representation for the boolean value `B`. /// /// Atomic booleans appearing in the boolean value `B` are assigned to labels @@ -35,6 +42,20 @@ std::string debugString( const BoolValue &B, llvm::DenseMap AtomNames = {{}}); +/// Returns a string representation for `Constraints` - a collection of boolean +/// formulas. +/// +/// Atomic booleans appearing in the boolean value `Constraints` are assigned to +/// labels either specified in `AtomNames` or created by default rules as B0, +/// B1, ... +/// +/// Requirements: +/// +/// Names assigned to atoms should not be repeated in `AtomNames`. +std::string debugString( + const llvm::DenseSet &Constraints, + llvm::DenseMap AtomNames = {{}}); + /// Returns a string representation for `Constraints` - a collection of boolean /// formulas and the `Result` of satisfiability checking. /// @@ -46,7 +67,7 @@ std::string debugString( /// /// Names assigned to atoms should not be repeated in `AtomNames`. std::string debugString( - const std::vector &Constraints, const Solver::Result &Result, + ArrayRef Constraints, const Solver::Result &Result, llvm::DenseMap AtomNames = {{}}); inline std::string debugString( const llvm::DenseSet &Constraints, diff --git a/clang/include/clang/Analysis/FlowSensitive/NoopAnalysis.h b/clang/include/clang/Analysis/FlowSensitive/NoopAnalysis.h new file mode 100644 index 000000000000..4f05f5f4554b --- /dev/null +++ b/clang/include/clang/Analysis/FlowSensitive/NoopAnalysis.h @@ -0,0 +1,47 @@ +//===-- NoopAnalysis.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 NoopAnalysis class that just uses the builtin transfer. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_CLANG_ANALYSIS_FLOWSENSITIVE_NOOPANALYSIS_H +#define LLVM_CLANG_ANALYSIS_FLOWSENSITIVE_NOOPANALYSIS_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/NoopLattice.h" + +namespace clang { +namespace dataflow { + +class NoopAnalysis : public DataflowAnalysis { +public: + /// Deprecated. Use the `DataflowAnalysisOptions` constructor instead. + NoopAnalysis(ASTContext &Context, bool ApplyBuiltinTransfer) + : DataflowAnalysis(Context, + ApplyBuiltinTransfer) {} + + /// `ApplyBuiltinTransfer` controls whether to run the built-in transfer + /// functions that model memory during the analysis. Their results are not + /// used by `NoopAnalysis`, but tests that need to inspect the environment + /// should enable them. + NoopAnalysis(ASTContext &Context, DataflowAnalysisOptions Options) + : DataflowAnalysis(Context, Options) {} + + static NoopLattice initialElement() { return {}; } + + void transfer(const Stmt *S, NoopLattice &E, Environment &Env) {} +}; + +} // namespace dataflow +} // namespace clang + +#endif // LLVM_CLANG_ANALYSIS_FLOWSENSITIVE_NOOPANALYSIS_H diff --git a/clang/include/clang/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.h b/clang/include/clang/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.h index 5e168194064f..b043062459e4 100644 --- a/clang/include/clang/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.h +++ b/clang/include/clang/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.h @@ -30,6 +30,14 @@ namespace clang { namespace dataflow { +struct DataflowAnalysisOptions { + /// Determines whether to apply the built-in transfer functions. + // FIXME: Remove this option once the framework supports composing analyses + // (at which point the built-in transfer functions can be simply a standalone + // analysis). + bool ApplyBuiltinTransfer = true; +}; + /// Type-erased lattice element container. /// /// Requirements: @@ -42,16 +50,17 @@ struct TypeErasedLattice { /// Type-erased base class for dataflow analyses built on a single lattice type. class TypeErasedDataflowAnalysis : public Environment::ValueModel { - /// Determines whether to apply the built-in transfer functions. - // FIXME: Remove this option once the framework supports composing analyses - // (at which point the built-in transfer functions can be simply a standalone - // analysis). - bool ApplyBuiltinTransfer; + DataflowAnalysisOptions Options; public: - TypeErasedDataflowAnalysis() : ApplyBuiltinTransfer(true) {} + TypeErasedDataflowAnalysis() : Options({}) {} + + /// Deprecated. Use the `DataflowAnalysisOptions` constructor instead. TypeErasedDataflowAnalysis(bool ApplyBuiltinTransfer) - : ApplyBuiltinTransfer(ApplyBuiltinTransfer) {} + : Options({ApplyBuiltinTransfer}) {} + + TypeErasedDataflowAnalysis(DataflowAnalysisOptions Options) + : Options(Options) {} virtual ~TypeErasedDataflowAnalysis() {} @@ -80,7 +89,7 @@ public: /// Determines whether to apply the built-in transfer functions, which model /// the heap and stack in the `Environment`. - bool applyBuiltinTransfer() const { return ApplyBuiltinTransfer; } + bool applyBuiltinTransfer() const { return Options.ApplyBuiltinTransfer; } }; /// Type-erased model of the program at a given program point. diff --git a/clang/include/clang/Basic/Attr.td b/clang/include/clang/Basic/Attr.td index 78e0fce917a0..d61f3583281d 100644 --- a/clang/include/clang/Basic/Attr.td +++ b/clang/include/clang/Basic/Attr.td @@ -2703,7 +2703,7 @@ def Target : InheritableAttr { template ParsedTargetAttr parse(Compare cmp) const { ParsedTargetAttr Attrs = parse(); - llvm::sort(std::begin(Attrs.Features), std::end(Attrs.Features), cmp); + llvm::sort(Attrs.Features, cmp); return Attrs; } diff --git a/clang/include/clang/Basic/BuiltinsAMDGPU.def b/clang/include/clang/Basic/BuiltinsAMDGPU.def index 68bcf546d177..cdf5f5a85418 100644 --- a/clang/include/clang/Basic/BuiltinsAMDGPU.def +++ b/clang/include/clang/Basic/BuiltinsAMDGPU.def @@ -339,12 +339,37 @@ TARGET_BUILTIN(__builtin_amdgcn_mfma_i32_16x16x32_i8, "V4iWiWiV4iIiIiIi", "nc", 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_mfma_f32_16x16x32_bf8_bf8, "V4fWiWiV4fIiIiIi", "nc", "fp8-insts") +TARGET_BUILTIN(__builtin_amdgcn_mfma_f32_16x16x32_bf8_fp8, "V4fWiWiV4fIiIiIi", "nc", "fp8-insts") +TARGET_BUILTIN(__builtin_amdgcn_mfma_f32_16x16x32_fp8_bf8, "V4fWiWiV4fIiIiIi", "nc", "fp8-insts") +TARGET_BUILTIN(__builtin_amdgcn_mfma_f32_16x16x32_fp8_fp8, "V4fWiWiV4fIiIiIi", "nc", "fp8-insts") +TARGET_BUILTIN(__builtin_amdgcn_mfma_f32_32x32x16_bf8_bf8, "V16fWiWiV16fIiIiIi", "nc", "fp8-insts") +TARGET_BUILTIN(__builtin_amdgcn_mfma_f32_32x32x16_bf8_fp8, "V16fWiWiV16fIiIiIi", "nc", "fp8-insts") +TARGET_BUILTIN(__builtin_amdgcn_mfma_f32_32x32x16_fp8_bf8, "V16fWiWiV16fIiIiIi", "nc", "fp8-insts") +TARGET_BUILTIN(__builtin_amdgcn_mfma_f32_32x32x16_fp8_fp8, "V16fWiWiV16fIiIiIi", "nc", "fp8-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") +TARGET_BUILTIN(__builtin_amdgcn_smfmac_f32_16x16x64_bf8_bf8, "V4fV2iV4iV4fiIiIi", "nc", "fp8-insts") +TARGET_BUILTIN(__builtin_amdgcn_smfmac_f32_16x16x64_bf8_fp8, "V4fV2iV4iV4fiIiIi", "nc", "fp8-insts") +TARGET_BUILTIN(__builtin_amdgcn_smfmac_f32_16x16x64_fp8_bf8, "V4fV2iV4iV4fiIiIi", "nc", "fp8-insts") +TARGET_BUILTIN(__builtin_amdgcn_smfmac_f32_16x16x64_fp8_fp8, "V4fV2iV4iV4fiIiIi", "nc", "fp8-insts") +TARGET_BUILTIN(__builtin_amdgcn_smfmac_f32_32x32x32_bf8_bf8, "V16fV2iV4iV16fiIiIi", "nc", "fp8-insts") +TARGET_BUILTIN(__builtin_amdgcn_smfmac_f32_32x32x32_bf8_fp8, "V16fV2iV4iV16fiIiIi", "nc", "fp8-insts") +TARGET_BUILTIN(__builtin_amdgcn_smfmac_f32_32x32x32_fp8_bf8, "V16fV2iV4iV16fiIiIi", "nc", "fp8-insts") +TARGET_BUILTIN(__builtin_amdgcn_smfmac_f32_32x32x32_fp8_fp8, "V16fV2iV4iV16fiIiIi", "nc", "fp8-insts") + +TARGET_BUILTIN(__builtin_amdgcn_cvt_f32_bf8, "fiIi", "nc", "fp8-insts") +TARGET_BUILTIN(__builtin_amdgcn_cvt_f32_fp8, "fiIi", "nc", "fp8-insts") +TARGET_BUILTIN(__builtin_amdgcn_cvt_pk_f32_bf8, "V2fiIb", "nc", "fp8-insts") +TARGET_BUILTIN(__builtin_amdgcn_cvt_pk_f32_fp8, "V2fiIb", "nc", "fp8-insts") +TARGET_BUILTIN(__builtin_amdgcn_cvt_pk_bf8_f32, "iffiIb", "nc", "fp8-insts") +TARGET_BUILTIN(__builtin_amdgcn_cvt_pk_fp8_f32, "iffiIb", "nc", "fp8-insts") +TARGET_BUILTIN(__builtin_amdgcn_cvt_sr_bf8_f32, "ifiiIi", "nc", "fp8-insts") +TARGET_BUILTIN(__builtin_amdgcn_cvt_sr_fp8_f32, "ifiiIi", "nc", "fp8-insts") #undef BUILTIN #undef TARGET_BUILTIN diff --git a/clang/include/clang/Basic/CodeGenOptions.def b/clang/include/clang/Basic/CodeGenOptions.def index b1d394edd04a..ef7957979dcc 100644 --- a/clang/include/clang/Basic/CodeGenOptions.def +++ b/clang/include/clang/Basic/CodeGenOptions.def @@ -213,6 +213,10 @@ CODEGENOPT(AtomicProfileUpdate , 1, 0) ///< Set -fprofile-update=atomic ENUM_CODEGENOPT(ProfileInstr, ProfileInstrKind, 2, ProfileNone) /// Choose profile kind for PGO use compilation. ENUM_CODEGENOPT(ProfileUse, ProfileInstrKind, 2, ProfileNone) +/// Partition functions into N groups and select only functions in group i to be +/// instrumented. Selected group numbers can be 0 to N-1 inclusive. +VALUE_CODEGENOPT(ProfileTotalFunctionGroups, 32, 1) +VALUE_CODEGENOPT(ProfileSelectedFunctionGroup, 32, 0) CODEGENOPT(CoverageMapping , 1, 0) ///< Generate coverage mapping regions to ///< enable code coverage analysis. CODEGENOPT(DumpCoverageMapping , 1, 0) ///< Dump the generated coverage mapping diff --git a/clang/include/clang/Basic/DiagnosticDriverKinds.td b/clang/include/clang/Basic/DiagnosticDriverKinds.td index 68685baf7633..2f600d28fea0 100644 --- a/clang/include/clang/Basic/DiagnosticDriverKinds.td +++ b/clang/include/clang/Basic/DiagnosticDriverKinds.td @@ -678,4 +678,11 @@ def err_drv_invalid_format_dxil_validator_version : Error< 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.">; + +def warn_drv_sarif_format_unstable : Warning< + "diagnostic formatting in SARIF mode is currently unstable">, + InGroup>; + +def err_drv_riscv_unsupported_with_linker_relaxation : Error< + "%0 is unsupported with RISC-V linker relaxation (-mrelax)">; } diff --git a/clang/include/clang/Basic/DiagnosticGroups.td b/clang/include/clang/Basic/DiagnosticGroups.td index 53e246a39ed8..4412c93683ed 100644 --- a/clang/include/clang/Basic/DiagnosticGroups.td +++ b/clang/include/clang/Basic/DiagnosticGroups.td @@ -35,7 +35,7 @@ def ArrayParameter : DiagGroup<"array-parameter">; def AutoDisableVptrSanitizer : DiagGroup<"auto-disable-vptr-sanitizer">; def Availability : DiagGroup<"availability">; def Section : DiagGroup<"section">; -def AutoImport : DiagGroup<"auto-import">; +def : DiagGroup<"auto-import">; def FrameworkHdrQuotedInclude : DiagGroup<"quoted-include-in-framework-header">; def FrameworkIncludePrivateFromPublic : DiagGroup<"framework-include-private-from-public">; @@ -490,6 +490,7 @@ def ModuleBuild : DiagGroup<"module-build">; def ModuleImport : DiagGroup<"module-import">; def ModuleConflict : DiagGroup<"module-conflict">; def ModuleFileExtension : DiagGroup<"module-file-extension">; +def ModuleIncludeDirectiveTranslation : DiagGroup<"module-include-translation">; def RoundTripCC1Args : DiagGroup<"round-trip-cc1-args">; def NewlineEOF : DiagGroup<"newline-eof">; def Nullability : DiagGroup<"nullability">; diff --git a/clang/include/clang/Basic/DiagnosticLexKinds.td b/clang/include/clang/Basic/DiagnosticLexKinds.td index dd0909704492..6032fbd18d56 100644 --- a/clang/include/clang/Basic/DiagnosticLexKinds.td +++ b/clang/include/clang/Basic/DiagnosticLexKinds.td @@ -387,7 +387,15 @@ def ext_pp_include_search_ms : ExtWarn< def ext_pp_ident_directive : Extension<"#ident is a language extension">; def ext_pp_include_next_directive : Extension< "#include_next is a language extension">, InGroup; -def ext_pp_warning_directive : Extension<"#warning is a language extension">; + +def ext_pp_warning_directive : Extension< + "#warning is a %select{C2x|C++2b}0 extension">; +def warn_cxx2b_compat_warning_directive : Warning< + "#warning is incompatible with C++ standards before C++2b">, + InGroup, DefaultIgnore; +def warn_c2x_compat_warning_directive : Warning< + "#warning is incompatible with C standards before C2x">, + InGroup, DefaultIgnore; def ext_pp_extra_tokens_at_eol : ExtWarn< "extra tokens at end of #%0 directive">, InGroup; @@ -851,9 +859,9 @@ def warn_framework_include_private_from_public : Warning< "public framework header includes private framework header '%0'" >, InGroup; -def warn_auto_module_import : Warning< +def remark_pp_include_directive_modular_translation : Remark< "treating #%select{include|import|include_next|__include_macros}0 as an " - "import of module '%1'">, InGroup, DefaultIgnore; + "import of module '%1'">, InGroup; def note_implicit_top_level_module_import_here : Note< "submodule of top-level module '%0' implicitly imported here">; def warn_uncovered_module_header : Warning< diff --git a/clang/include/clang/Basic/DiagnosticOptions.h b/clang/include/clang/Basic/DiagnosticOptions.h index 17533b38ff5f..c4134835b5de 100644 --- a/clang/include/clang/Basic/DiagnosticOptions.h +++ b/clang/include/clang/Basic/DiagnosticOptions.h @@ -74,7 +74,7 @@ class DiagnosticOptions : public RefCountedBase{ friend class CompilerInvocation; public: - enum TextDiagnosticFormat { Clang, MSVC, Vi }; + enum TextDiagnosticFormat { Clang, MSVC, Vi, SARIF }; // Default values. enum { diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td index 550029f58b54..756102720049 100644 --- a/clang/include/clang/Basic/DiagnosticSemaKinds.td +++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td @@ -8037,24 +8037,6 @@ def err_incompatible_qualified_id : Error< "sending type to parameter of incompatible type}0,1" "|%diff{casting $ to incompatible type $|" "casting type to incompatible type}0,1}2">; -def ext_typecheck_convert_pointer_int : ExtWarn< - "incompatible pointer to integer conversion " - "%select{%diff{assigning to $ from $|assigning to different types}0,1" - "|%diff{passing $ to parameter of type $|" - "passing to parameter of different type}0,1" - "|%diff{returning $ from a function with result type $|" - "returning from function with different return type}0,1" - "|%diff{converting $ to type $|converting between types}0,1" - "|%diff{initializing $ with an expression of type $|" - "initializing with expression of different type}0,1" - "|%diff{sending $ to parameter of type $|" - "sending to parameter of different type}0,1" - "|%diff{casting $ to type $|casting between types}0,1}2" - "%select{|; dereference with *|" - "; take the address with &|" - "; remove *|" - "; remove &}3">, - InGroup; def err_typecheck_convert_pointer_int : Error< "incompatible pointer to integer conversion " "%select{%diff{assigning to $ from $|assigning to different types}0,1" @@ -8072,24 +8054,9 @@ def err_typecheck_convert_pointer_int : Error< "; take the address with &|" "; remove *|" "; remove &}3">; -def ext_typecheck_convert_int_pointer : ExtWarn< - "incompatible integer to pointer conversion " - "%select{%diff{assigning to $ from $|assigning to different types}0,1" - "|%diff{passing $ to parameter of type $|" - "passing to parameter of different type}0,1" - "|%diff{returning $ from a function with result type $|" - "returning from function with different return type}0,1" - "|%diff{converting $ to type $|converting between types}0,1" - "|%diff{initializing $ with an expression of type $|" - "initializing with expression of different type}0,1" - "|%diff{sending $ to parameter of type $|" - "sending to parameter of different type}0,1" - "|%diff{casting $ to type $|casting between types}0,1}2" - "%select{|; dereference with *|" - "; take the address with &|" - "; remove *|" - "; remove &}3">, - InGroup, SFINAEFailure; +def ext_typecheck_convert_pointer_int : ExtWarn< + err_typecheck_convert_pointer_int.Text>, + InGroup, DefaultError; def err_typecheck_convert_int_pointer : Error< "incompatible integer to pointer conversion " "%select{%diff{assigning to $ from $|assigning to different types}0,1" @@ -8107,6 +8074,9 @@ def err_typecheck_convert_int_pointer : Error< "; take the address with &|" "; remove *|" "; remove &}3">; +def ext_typecheck_convert_int_pointer : ExtWarn< + err_typecheck_convert_int_pointer.Text>, + InGroup, DefaultError; def ext_typecheck_convert_pointer_void_func : Extension< "%select{%diff{assigning to $ from $|assigning to different types}0,1" "|%diff{passing $ to parameter of type $|" diff --git a/clang/include/clang/Basic/Features.def b/clang/include/clang/Basic/Features.def index a7f0ae03e0be..7151e923ae9c 100644 --- a/clang/include/clang/Basic/Features.def +++ b/clang/include/clang/Basic/Features.def @@ -179,7 +179,6 @@ 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 @@ -235,6 +234,7 @@ FEATURE(shadow_call_stack, LangOpts.Sanitize.has(SanitizerKind::ShadowCallStack)) FEATURE(tls, PP.getTargetInfo().isTLSSupported()) FEATURE(underlying_type, LangOpts.CPlusPlus) +FEATURE(experimental_library, LangOpts.ExperimentalLibrary) // C11 features supported by other languages as extensions. EXTENSION(c_alignas, true) diff --git a/clang/include/clang/Basic/LangOptions.def b/clang/include/clang/Basic/LangOptions.def index c41b5ddc7fa1..6fb31c5655ab 100644 --- a/clang/include/clang/Basic/LangOptions.def +++ b/clang/include/clang/Basic/LangOptions.def @@ -155,7 +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(ExperimentalLibrary, 1, 0, "enable unstable and experimental library features") LANGOPT(DoubleSquareBracketAttributes, 1, 0, "'[[]]' attributes extension for all language standard modes") @@ -424,6 +424,7 @@ LANGOPT(PaddingOnUnsignedFixedPoint, 1, 0, LANGOPT(RegisterStaticDestructors, 1, 1, "Register C++ static destructors") LANGOPT(MatrixTypes, 1, 0, "Enable or disable the builtin matrix type") +LANGOPT(StrictFlexArrays, 2, 0, "Rely on strict definition of flexible arrays") COMPATIBLE_VALUE_LANGOPT(MaxTokens, 32, 0, "Max number of tokens per TU or 0") diff --git a/clang/include/clang/Basic/Module.h b/clang/include/clang/Basic/Module.h index a1778baa0453..47d736a3b455 100644 --- a/clang/include/clang/Basic/Module.h +++ b/clang/include/clang/Basic/Module.h @@ -665,6 +665,18 @@ public: Module *findSubmodule(StringRef Name) const; Module *findOrInferSubmodule(StringRef Name); + /// Get the Global Module Fragment (sub-module) for this module, it there is + /// one. + /// + /// \returns The GMF sub-module if found, or NULL otherwise. + Module *getGlobalModuleFragment() { return findSubmodule(""); } + + /// Get the Private Module Fragment (sub-module) for this module, it there is + /// one. + /// + /// \returns The PMF sub-module if found, or NULL otherwise. + Module *getPrivateModuleFragment() { return findSubmodule(""); } + /// Determine whether the specified module would be visible to /// a lookup at the end of this module. /// diff --git a/clang/include/clang/Basic/NoSanitizeList.h b/clang/include/clang/Basic/NoSanitizeList.h index 3f80e0fdedda..43415859fcd5 100644 --- a/clang/include/clang/Basic/NoSanitizeList.h +++ b/clang/include/clang/Basic/NoSanitizeList.h @@ -41,6 +41,8 @@ public: bool containsFunction(SanitizerMask Mask, StringRef FunctionName) const; bool containsFile(SanitizerMask Mask, StringRef FileName, StringRef Category = StringRef()) const; + bool containsMainFile(SanitizerMask Mask, StringRef FileName, + StringRef Category = StringRef()) const; bool containsLocation(SanitizerMask Mask, SourceLocation Loc, StringRef Category = StringRef()) const; }; diff --git a/clang/include/clang/Basic/Sarif.h b/clang/include/clang/Basic/Sarif.h new file mode 100644 index 000000000000..818d78668ff1 --- /dev/null +++ b/clang/include/clang/Basic/Sarif.h @@ -0,0 +1,440 @@ +//== clang/Basic/Sarif.h - SARIF Diagnostics Object Model -------*- 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 +// +//===----------------------------------------------------------------------===// +/// \file +/// Defines clang::SarifDocumentWriter, clang::SarifRule, clang::SarifResult. +/// +/// The document built can be accessed as a JSON Object. +/// Several value semantic types are also introduced which represent properties +/// of the SARIF standard, such as 'artifact', 'result', 'rule'. +/// +/// A SARIF (Static Analysis Results Interchange Format) document is JSON +/// document that describes in detail the results of running static analysis +/// tools on a project. Each (non-trivial) document consists of at least one +/// "run", which are themselves composed of details such as: +/// * Tool: The tool that was run +/// * Rules: The rules applied during the tool run, represented by +/// \c reportingDescriptor objects in SARIF +/// * Results: The matches for the rules applied against the project(s) being +/// evaluated, represented by \c result objects in SARIF +/// +/// Reference: +/// 1. The SARIF standard +/// 2. SARIF
reportingDescriptor
+/// 3. SARIF
result
+//===----------------------------------------------------------------------===// + +#ifndef LLVM_CLANG_BASIC_SARIF_H +#define LLVM_CLANG_BASIC_SARIF_H + +#include "clang/Basic/SourceLocation.h" +#include "clang/Basic/Version.h" +#include "llvm/ADT/ArrayRef.h" +#include "llvm/ADT/Optional.h" +#include "llvm/ADT/SmallVector.h" +#include "llvm/ADT/StringMap.h" +#include "llvm/ADT/StringRef.h" +#include "llvm/Support/JSON.h" +#include +#include +#include +#include +#include + +namespace clang { + +class SarifDocumentWriter; +class SourceManager; + +namespace detail { + +/// \internal +/// An artifact location is SARIF's way of describing the complete location +/// of an artifact encountered during analysis. The \c artifactLocation object +/// typically consists of a URI, and/or an index to reference the artifact it +/// locates. +/// +/// This builder makes an additional assumption: that every artifact encountered +/// by \c clang will be a physical, top-level artifact. Which is why the static +/// creation method \ref SarifArtifactLocation::create takes a mandatory URI +/// parameter. The official standard states that either a \c URI or \c Index +/// must be available in the object, \c clang picks the \c URI as a reasonable +/// default, because it intends to deal in physical artifacts for now. +/// +/// Reference: +/// 1. artifactLocation object +/// 2. \ref SarifArtifact +class SarifArtifactLocation { +private: + friend class clang::SarifDocumentWriter; + + llvm::Optional Index; + std::string URI; + + SarifArtifactLocation() = delete; + explicit SarifArtifactLocation(const std::string &URI) : URI(URI) {} + +public: + static SarifArtifactLocation create(llvm::StringRef URI) { + return SarifArtifactLocation{URI.str()}; + } + + SarifArtifactLocation setIndex(uint32_t Idx) { + Index = Idx; + return *this; + } +}; + +/// \internal +/// An artifact in SARIF is any object (a sequence of bytes) addressable by +/// a URI (RFC 3986). The most common type of artifact for clang's use-case +/// would be source files. SARIF's artifact object is described in detail in +/// section 3.24. +// +/// Since every clang artifact MUST have a location (there being no nested +/// artifacts), the creation method \ref SarifArtifact::create requires a +/// \ref SarifArtifactLocation object. +/// +/// Reference: +/// 1. artifact object +class SarifArtifact { +private: + friend class clang::SarifDocumentWriter; + + llvm::Optional Offset; + llvm::Optional Length; + std::string MimeType; + SarifArtifactLocation Location; + llvm::SmallVector Roles; + + SarifArtifact() = delete; + + explicit SarifArtifact(const SarifArtifactLocation &Loc) : Location(Loc) {} + +public: + static SarifArtifact create(const SarifArtifactLocation &Loc) { + return SarifArtifact{Loc}; + } + + SarifArtifact setOffset(uint32_t ArtifactOffset) { + Offset = ArtifactOffset; + return *this; + } + + SarifArtifact setLength(size_t NumBytes) { + Length = NumBytes; + return *this; + } + + SarifArtifact setRoles(std::initializer_list ArtifactRoles) { + Roles.assign(ArtifactRoles.begin(), ArtifactRoles.end()); + return *this; + } + + SarifArtifact setMimeType(llvm::StringRef ArtifactMimeType) { + MimeType = ArtifactMimeType.str(); + return *this; + } +}; + +} // namespace detail + +enum class ThreadFlowImportance { Important, Essential, Unimportant }; + +/// A thread flow is a sequence of code locations that specify a possible path +/// through a single thread of execution. +/// A thread flow in SARIF is related to a code flow which describes +/// the progress of one or more programs through one or more thread flows. +/// +/// Reference: +/// 1. threadFlow object +/// 2. codeFlow object +class ThreadFlow { + friend class SarifDocumentWriter; + + CharSourceRange Range; + ThreadFlowImportance Importance; + std::string Message; + + ThreadFlow() = default; + +public: + static ThreadFlow create() { return {}; } + + ThreadFlow setRange(const CharSourceRange &ItemRange) { + assert(ItemRange.isCharRange() && + "ThreadFlows require a character granular source range!"); + Range = ItemRange; + return *this; + } + + ThreadFlow setImportance(const ThreadFlowImportance &ItemImportance) { + Importance = ItemImportance; + return *this; + } + + ThreadFlow setMessage(llvm::StringRef ItemMessage) { + Message = ItemMessage.str(); + return *this; + } +}; + +/// A SARIF rule (\c reportingDescriptor object) contains information that +/// describes a reporting item generated by a tool. A reporting item is +/// either a result of analysis or notification of a condition encountered by +/// the tool. Rules are arbitrary but are identifiable by a hierarchical +/// rule-id. +/// +/// This builder provides an interface to create SARIF \c reportingDescriptor +/// objects via the \ref SarifRule::create static method. +/// +/// Reference: +/// 1. reportingDescriptor object +class SarifRule { + friend class clang::SarifDocumentWriter; + + std::string Name; + std::string Id; + std::string Description; + std::string HelpURI; + + SarifRule() = default; + +public: + static SarifRule create() { return {}; } + + SarifRule setName(llvm::StringRef RuleName) { + Name = RuleName.str(); + return *this; + } + + SarifRule setRuleId(llvm::StringRef RuleId) { + Id = RuleId.str(); + return *this; + } + + SarifRule setDescription(llvm::StringRef RuleDesc) { + Description = RuleDesc.str(); + return *this; + } + + SarifRule setHelpURI(llvm::StringRef RuleHelpURI) { + HelpURI = RuleHelpURI.str(); + return *this; + } +}; + +/// A SARIF result (also called a "reporting item") is a unit of output +/// produced when one of the tool's \c reportingDescriptor encounters a match +/// on the file being analysed by the tool. +/// +/// This builder provides a \ref SarifResult::create static method that can be +/// used to create an empty shell onto which attributes can be added using the +/// \c setX(...) methods. +/// +/// For example: +/// \code{.cpp} +/// SarifResult result = SarifResult::create(...) +/// .setRuleId(...) +/// .setDiagnosticMessage(...); +/// \endcode +/// +/// Reference: +/// 1. SARIF
result
+class SarifResult { + friend class clang::SarifDocumentWriter; + + // NOTE: + // This type cannot fit all possible indexes representable by JSON, but is + // chosen because it is the largest unsigned type that can be safely + // converted to an \c int64_t. + uint32_t RuleIdx; + std::string RuleId; + std::string DiagnosticMessage; + llvm::SmallVector Locations; + llvm::SmallVector ThreadFlows; + + SarifResult() = delete; + explicit SarifResult(uint32_t RuleIdx) : RuleIdx(RuleIdx) {} + +public: + static SarifResult create(uint32_t RuleIdx) { return SarifResult{RuleIdx}; } + + SarifResult setIndex(uint32_t Idx) { + RuleIdx = Idx; + return *this; + } + + SarifResult setRuleId(llvm::StringRef Id) { + RuleId = Id.str(); + return *this; + } + + SarifResult setDiagnosticMessage(llvm::StringRef Message) { + DiagnosticMessage = Message.str(); + return *this; + } + + SarifResult setLocations(llvm::ArrayRef DiagLocs) { +#ifndef NDEBUG + for (const auto &Loc : DiagLocs) { + assert(Loc.isCharRange() && + "SARIF Results require character granular source ranges!"); + } +#endif + Locations.assign(DiagLocs.begin(), DiagLocs.end()); + return *this; + } + SarifResult setThreadFlows(llvm::ArrayRef ThreadFlowResults) { + ThreadFlows.assign(ThreadFlowResults.begin(), ThreadFlowResults.end()); + return *this; + } +}; + +/// This class handles creating a valid SARIF document given various input +/// attributes. However, it requires an ordering among certain method calls: +/// +/// 1. Because every SARIF document must contain at least 1 \c run, callers +/// must ensure that \ref SarifDocumentWriter::createRun is is called before +/// any other methods. +/// 2. If SarifDocumentWriter::endRun is called, callers MUST call +/// SarifDocumentWriter::createRun, before invoking any of the result +/// aggregation methods such as SarifDocumentWriter::appendResult etc. +class SarifDocumentWriter { +private: + const llvm::StringRef SchemaURI{ + "https://docs.oasis-open.org/sarif/sarif/v2.1.0/cos02/schemas/" + "sarif-schema-2.1.0.json"}; + const llvm::StringRef SchemaVersion{"2.1.0"}; + + /// \internal + /// Return a pointer to the current tool. Asserts that a run exists. + llvm::json::Object &getCurrentTool(); + + /// \internal + /// Checks if there is a run associated with this document. + /// + /// \return true on success + bool hasRun() const; + + /// \internal + /// Reset portions of the internal state so that the document is ready to + /// receive data for a new run. + void reset(); + + /// \internal + /// Return a mutable reference to the current run, after asserting it exists. + /// + /// \note It is undefined behavior to call this if a run does not exist in + /// the SARIF document. + llvm::json::Object &getCurrentRun(); + + /// Create a code flow object for the given threadflows. + /// See \ref ThreadFlow. + /// + /// \note It is undefined behavior to call this if a run does not exist in + /// the SARIF document. + llvm::json::Object + createCodeFlow(const llvm::ArrayRef ThreadFlows); + + /// Add the given threadflows to the ones this SARIF document knows about. + llvm::json::Array + createThreadFlows(const llvm::ArrayRef ThreadFlows); + + /// Add the given \ref CharSourceRange to the SARIF document as a physical + /// location, with its corresponding artifact. + llvm::json::Object createPhysicalLocation(const CharSourceRange &R); + +public: + SarifDocumentWriter() = delete; + + /// Create a new empty SARIF document with the given source manager. + SarifDocumentWriter(const SourceManager &SourceMgr) : SourceMgr(SourceMgr) {} + + /// Release resources held by this SARIF document. + ~SarifDocumentWriter() = default; + + /// Create a new run with which any upcoming analysis will be associated. + /// Each run requires specifying the tool that is generating reporting items. + void createRun(const llvm::StringRef ShortToolName, + const llvm::StringRef LongToolName, + const llvm::StringRef ToolVersion = CLANG_VERSION_STRING); + + /// If there is a current run, end it. + /// + /// This method collects various book-keeping required to clear and close + /// resources associated with the current run, but may also allocate some + /// for the next run. + /// + /// Calling \ref endRun before associating a run through \ref createRun leads + /// to undefined behaviour. + void endRun(); + + /// Associate the given rule with the current run. + /// + /// Returns an integer rule index for the created rule that is unique within + /// the current run, which can then be used to create a \ref SarifResult + /// to add to the current run. Note that a rule must exist before being + /// referenced by a result. + /// + /// \pre + /// There must be a run associated with the document, failing to do so will + /// cause undefined behaviour. + size_t createRule(const SarifRule &Rule); + + /// Append a new result to the currently in-flight run. + /// + /// \pre + /// There must be a run associated with the document, failing to do so will + /// cause undefined behaviour. + /// \pre + /// \c RuleIdx used to create the result must correspond to a rule known by + /// the SARIF document. It must be the value returned by a previous call + /// to \ref createRule. + void appendResult(const SarifResult &SarifResult); + + /// Return the SARIF document in its current state. + /// Calling this will trigger a copy of the internal state including all + /// reported diagnostics, resulting in an expensive call. + llvm::json::Object createDocument(); + +private: + /// Source Manager to use for the current SARIF document. + const SourceManager &SourceMgr; + + /// Flag to track the state of this document: + /// A closed document is one on which a new runs must be created. + /// This could be a document that is freshly created, or has recently + /// finished writing to a previous run. + bool Closed = true; + + /// A sequence of SARIF runs. + /// Each run object describes a single run of an analysis tool and contains + /// the output of that run. + /// + /// Reference: run object + llvm::json::Array Runs; + + /// The list of rules associated with the most recent active run. These are + /// defined using the diagnostics passed to the SarifDocument. Each rule + /// need not be unique through the result set. E.g. there may be several + /// 'syntax' errors throughout code under analysis, each of which has its + /// own specific diagnostic message (and consequently, RuleId). Rules are + /// also known as "reportingDescriptor" objects in SARIF. + /// + /// Reference: rules property + llvm::SmallVector CurrentRules; + + /// The list of artifacts that have been encountered on the most recent active + /// run. An artifact is defined in SARIF as a sequence of bytes addressable + /// by a URI. A common example for clang's case would be files named by + /// filesystem paths. + llvm::StringMap CurrentArtifacts; +}; +} // namespace clang + +#endif // LLVM_CLANG_BASIC_SARIF_H diff --git a/clang/include/clang/Driver/Options.h b/clang/include/clang/Driver/Options.h index f9b9632ee7cb..f7ee154b7a7a 100644 --- a/clang/include/clang/Driver/Options.h +++ b/clang/include/clang/Driver/Options.h @@ -36,7 +36,8 @@ enum ClangFlags { FC1Option = (1 << 15), FlangOnlyOption = (1 << 16), DXCOption = (1 << 17), - Ignored = (1 << 18), + CLDXCOption = (1 << 18), + Ignored = (1 << 19), }; enum ID { diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td index 532d7780c529..b9c2e4d528e4 100644 --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -53,6 +53,10 @@ def CC1AsOption : OptionFlag; // are made available when the driver is running in DXC compatibility mode. def DXCOption : OptionFlag; +// CLDXCOption - This is a cl.exe/dxc.exe compatibility option. Options with this flag +// are made available when the driver is running in CL/DXC compatibility mode. +def CLDXCOption : OptionFlag; + // NoDriverOption - This option should not be accepted by the driver. def NoDriverOption : OptionFlag; @@ -1140,6 +1144,12 @@ def fallow_unsupported : Flag<["-"], "fallow-unsupported">, Group; def fapple_kext : Flag<["-"], "fapple-kext">, Group, Flags<[CC1Option]>, HelpText<"Use Apple's kernel extensions ABI">, MarshallingInfoFlag>; +def fstrict_flex_arrays_EQ : Joined<["-"], "fstrict-flex-arrays=">,Group, + MetaVarName<"">, Values<"0,1,2">, + LangOpts<"StrictFlexArrays">, + Flags<[CC1Option]>, + HelpText<"Enable optimizations based on the strict definition of flexible arrays">, + MarshallingInfoInt>; defm apple_pragma_pack : BoolFOption<"apple-pragma-pack", LangOpts<"ApplePragmaPack">, DefaultFalse, PosFlag, @@ -1183,9 +1193,13 @@ defm coroutines_ts : BoolFOption<"coroutines-ts", PosFlag, NegFlag>; -defm unstable : BoolFOption<"unstable", - LangOpts<"Unstable">, DefaultFalse, - PosFlag, +defm experimental_library : BoolFOption<"experimental-library", + LangOpts<"ExperimentalLibrary">, DefaultFalse, + PosFlag, NegFlag>; def fembed_offload_object_EQ : Joined<["-"], "fembed-offload-object=">, @@ -1333,6 +1347,15 @@ def fprofile_list_EQ : Joined<["-"], "fprofile-list=">, Group, Flags<[CC1Option, CoreOption]>, HelpText<"Filename defining the list of functions/files to instrument">, MarshallingInfoStringVector>; +def fprofile_function_groups : Joined<["-"], "fprofile-function-groups=">, + Group, Flags<[CC1Option]>, MetaVarName<"">, + HelpText<"Partition functions into N groups and select only functions in group i to be instrumented using -fprofile-selected-function-group">, + MarshallingInfoInt, "1">; +def fprofile_selected_function_group : + Joined<["-"], "fprofile-selected-function-group=">, Group, + Flags<[CC1Option]>, MetaVarName<"">, + HelpText<"Partition functions into N groups using -fprofile-function-groups and select only functions in group i to be instrumented. The valid range is 0 to N-1 inclusive">, + MarshallingInfoInt>; def fswift_async_fp_EQ : Joined<["-"], "fswift-async-fp=">, Group, Flags<[CC1Option, CC1AsOption, CoreOption]>, MetaVarName<"