diff --git a/bolt/lib/Core/CMakeLists.txt b/bolt/lib/Core/CMakeLists.txt --- a/bolt/lib/Core/CMakeLists.txt +++ b/bolt/lib/Core/CMakeLists.txt @@ -5,6 +5,7 @@ MCDisassembler Object Support + TargetParser ) add_llvm_library(LLVMBOLTCore diff --git a/bolt/lib/Passes/CMakeLists.txt b/bolt/lib/Passes/CMakeLists.txt --- a/bolt/lib/Passes/CMakeLists.txt +++ b/bolt/lib/Passes/CMakeLists.txt @@ -56,6 +56,7 @@ AsmPrinter MC Support + TargetParser TransformUtils ) diff --git a/bolt/lib/Rewrite/CMakeLists.txt b/bolt/lib/Rewrite/CMakeLists.txt --- a/bolt/lib/Rewrite/CMakeLists.txt +++ b/bolt/lib/Rewrite/CMakeLists.txt @@ -5,6 +5,7 @@ MC Object Support + TargetParser ) set(TARGET_LINK_LIBRARIES diff --git a/clang-tools-extra/clang-tidy/portability/CMakeLists.txt b/clang-tools-extra/clang-tidy/portability/CMakeLists.txt --- a/clang-tools-extra/clang-tidy/portability/CMakeLists.txt +++ b/clang-tools-extra/clang-tidy/portability/CMakeLists.txt @@ -1,6 +1,7 @@ set(LLVM_LINK_COMPONENTS FrontendOpenMP Support + TargetParser ) add_clang_library(clangTidyPortabilityModule diff --git a/clang-tools-extra/clangd/CMakeLists.txt b/clang-tools-extra/clangd/CMakeLists.txt --- a/clang-tools-extra/clangd/CMakeLists.txt +++ b/clang-tools-extra/clangd/CMakeLists.txt @@ -44,6 +44,7 @@ AllTargetsInfos FrontendOpenMP Option + TargetParser ) set(COMPLETIONMODEL_SOURCES) diff --git a/clang-tools-extra/modularize/CMakeLists.txt b/clang-tools-extra/modularize/CMakeLists.txt --- a/clang-tools-extra/modularize/CMakeLists.txt +++ b/clang-tools-extra/modularize/CMakeLists.txt @@ -1,6 +1,7 @@ set(LLVM_LINK_COMPONENTS Option Support + TargetParser ) add_clang_tool(modularize diff --git a/clang/docs/tools/clang-formatted-files.txt b/clang/docs/tools/clang-formatted-files.txt --- a/clang/docs/tools/clang-formatted-files.txt +++ b/clang/docs/tools/clang-formatted-files.txt @@ -5484,7 +5484,7 @@ llvm/include/llvm/Support/CRC.h llvm/include/llvm/Support/CSKYAttributeParser.h llvm/include/llvm/Support/CSKYAttributes.h -llvm/include/llvm/Support/CSKYTargetParser.h +llvm/include/llvm/TargetParser/CSKYTargetParser.h llvm/include/llvm/Support/DataTypes.h llvm/include/llvm/Support/DebugCounter.h llvm/include/llvm/Support/Discriminator.h @@ -5511,7 +5511,7 @@ llvm/include/llvm/Support/PointerLikeTypeTraits.h llvm/include/llvm/Support/RISCVAttributeParser.h llvm/include/llvm/Support/RISCVAttributes.h -llvm/include/llvm/Support/RISCVISAInfo.h +llvm/include/llvm/TargetParser/RISCVISAInfo.h llvm/include/llvm/Support/RWMutex.h llvm/include/llvm/Support/ScopedPrinter.h llvm/include/llvm/Support/SHA256.h @@ -5523,7 +5523,7 @@ llvm/include/llvm/Support/SuffixTree.h llvm/include/llvm/Support/SymbolRemappingReader.h llvm/include/llvm/Support/SystemUtils.h -llvm/include/llvm/Support/TargetParser.h +llvm/include/llvm/TargetParser/TargetParser.h llvm/include/llvm/Support/TrailingObjects.h llvm/include/llvm/Support/Unicode.h llvm/include/llvm/Support/UnicodeCharRanges.h diff --git a/clang/lib/ARCMigrate/CMakeLists.txt b/clang/lib/ARCMigrate/CMakeLists.txt --- a/clang/lib/ARCMigrate/CMakeLists.txt +++ b/clang/lib/ARCMigrate/CMakeLists.txt @@ -1,5 +1,6 @@ set(LLVM_LINK_COMPONENTS Support + TargetParser ) # By default MSVC has a 2^16 limit on the number of sections in an object diff --git a/clang/lib/AST/CMakeLists.txt b/clang/lib/AST/CMakeLists.txt --- a/clang/lib/AST/CMakeLists.txt +++ b/clang/lib/AST/CMakeLists.txt @@ -3,6 +3,7 @@ Core FrontendOpenMP Support + TargetParser ) # FIXME: the entry points to the interpreter should be moved out of clangAST diff --git a/clang/lib/Basic/CMakeLists.txt b/clang/lib/Basic/CMakeLists.txt --- a/clang/lib/Basic/CMakeLists.txt +++ b/clang/lib/Basic/CMakeLists.txt @@ -1,5 +1,6 @@ set(LLVM_LINK_COMPONENTS Support + TargetParser ) find_first_existing_vc_file("${LLVM_MAIN_SRC_DIR}" llvm_vc) diff --git a/clang/lib/CodeGen/CMakeLists.txt b/clang/lib/CodeGen/CMakeLists.txt --- a/clang/lib/CodeGen/CMakeLists.txt +++ b/clang/lib/CodeGen/CMakeLists.txt @@ -26,6 +26,7 @@ ScalarOpts Support Target + TargetParser TransformUtils ) diff --git a/clang/lib/CrossTU/CMakeLists.txt b/clang/lib/CrossTU/CMakeLists.txt --- a/clang/lib/CrossTU/CMakeLists.txt +++ b/clang/lib/CrossTU/CMakeLists.txt @@ -1,5 +1,6 @@ set(LLVM_LINK_COMPONENTS Support + TargetParser ) add_clang_library(clangCrossTU diff --git a/clang/lib/Driver/CMakeLists.txt b/clang/lib/Driver/CMakeLists.txt --- a/clang/lib/Driver/CMakeLists.txt +++ b/clang/lib/Driver/CMakeLists.txt @@ -5,6 +5,7 @@ Option ProfileData Support + TargetParser WindowsDriver ) diff --git a/clang/lib/ExtractAPI/CMakeLists.txt b/clang/lib/ExtractAPI/CMakeLists.txt --- a/clang/lib/ExtractAPI/CMakeLists.txt +++ b/clang/lib/ExtractAPI/CMakeLists.txt @@ -1,5 +1,6 @@ set(LLVM_LINK_COMPONENTS Support + TargetParser ) add_clang_library(clangExtractAPI diff --git a/clang/lib/Frontend/CMakeLists.txt b/clang/lib/Frontend/CMakeLists.txt --- a/clang/lib/Frontend/CMakeLists.txt +++ b/clang/lib/Frontend/CMakeLists.txt @@ -6,6 +6,7 @@ Option ProfileData Support + TargetParser ) add_clang_library(clangFrontend diff --git a/clang/lib/Interpreter/CMakeLists.txt b/clang/lib/Interpreter/CMakeLists.txt --- a/clang/lib/Interpreter/CMakeLists.txt +++ b/clang/lib/Interpreter/CMakeLists.txt @@ -5,6 +5,7 @@ OrcJit Support Target + TargetParser ) add_clang_library(clangInterpreter diff --git a/clang/lib/Lex/CMakeLists.txt b/clang/lib/Lex/CMakeLists.txt --- a/clang/lib/Lex/CMakeLists.txt +++ b/clang/lib/Lex/CMakeLists.txt @@ -1,6 +1,9 @@ # TODO: Add -maltivec when ARCH is PowerPC. -set(LLVM_LINK_COMPONENTS support) +set(LLVM_LINK_COMPONENTS + Support + TargetParser + ) add_clang_library(clangLex DependencyDirectivesScanner.cpp diff --git a/clang/lib/Parse/CMakeLists.txt b/clang/lib/Parse/CMakeLists.txt --- a/clang/lib/Parse/CMakeLists.txt +++ b/clang/lib/Parse/CMakeLists.txt @@ -3,6 +3,7 @@ MC MCParser Support + TargetParser ) add_clang_library(clangParse diff --git a/clang/lib/Sema/CMakeLists.txt b/clang/lib/Sema/CMakeLists.txt --- a/clang/lib/Sema/CMakeLists.txt +++ b/clang/lib/Sema/CMakeLists.txt @@ -4,6 +4,7 @@ FrontendOpenMP MC Support + TargetParser ) clang_tablegen(OpenCLBuiltins.inc -gen-clang-opencl-builtins diff --git a/clang/lib/Serialization/CMakeLists.txt b/clang/lib/Serialization/CMakeLists.txt --- a/clang/lib/Serialization/CMakeLists.txt +++ b/clang/lib/Serialization/CMakeLists.txt @@ -2,6 +2,7 @@ BitReader BitstreamReader Support + TargetParser ) diff --git a/clang/lib/StaticAnalyzer/Checkers/CMakeLists.txt b/clang/lib/StaticAnalyzer/Checkers/CMakeLists.txt --- a/clang/lib/StaticAnalyzer/Checkers/CMakeLists.txt +++ b/clang/lib/StaticAnalyzer/Checkers/CMakeLists.txt @@ -1,6 +1,7 @@ set(LLVM_LINK_COMPONENTS FrontendOpenMP Support + TargetParser ) add_clang_library(clangStaticAnalyzerCheckers diff --git a/clang/lib/Tooling/CMakeLists.txt b/clang/lib/Tooling/CMakeLists.txt --- a/clang/lib/Tooling/CMakeLists.txt +++ b/clang/lib/Tooling/CMakeLists.txt @@ -2,6 +2,7 @@ Option FrontendOpenMP Support + TargetParser ) add_subdirectory(Core) diff --git a/clang/lib/Tooling/DependencyScanning/CMakeLists.txt b/clang/lib/Tooling/DependencyScanning/CMakeLists.txt --- a/clang/lib/Tooling/DependencyScanning/CMakeLists.txt +++ b/clang/lib/Tooling/DependencyScanning/CMakeLists.txt @@ -3,6 +3,7 @@ Core Option Support + TargetParser ) add_clang_library(clangDependencyScanning diff --git a/clang/tools/clang-fuzzer/handle-llvm/CMakeLists.txt b/clang/tools/clang-fuzzer/handle-llvm/CMakeLists.txt --- a/clang/tools/clang-fuzzer/handle-llvm/CMakeLists.txt +++ b/clang/tools/clang-fuzzer/handle-llvm/CMakeLists.txt @@ -14,6 +14,7 @@ SelectionDAG Support Target + TargetParser TransformUtils native ) diff --git a/clang/tools/clang-import-test/CMakeLists.txt b/clang/tools/clang-import-test/CMakeLists.txt --- a/clang/tools/clang-import-test/CMakeLists.txt +++ b/clang/tools/clang-import-test/CMakeLists.txt @@ -1,6 +1,7 @@ set(LLVM_LINK_COMPONENTS Core Support + TargetParser ) add_clang_executable(clang-import-test diff --git a/clang/tools/clang-linker-wrapper/CMakeLists.txt b/clang/tools/clang-linker-wrapper/CMakeLists.txt --- a/clang/tools/clang-linker-wrapper/CMakeLists.txt +++ b/clang/tools/clang-linker-wrapper/CMakeLists.txt @@ -1,6 +1,6 @@ include(GNUInstallDirs) -set(LLVM_LINK_COMPONENTS +set(LLVM_LINK_COMPONENTS ${LLVM_TARGETS_TO_BUILD} BitWriter Core @@ -14,8 +14,10 @@ Object Option Support + TargetParser CodeGen - LTO) + LTO + ) set(LLVM_TARGET_DEFINITIONS LinkerWrapperOpts.td) tablegen(LLVM LinkerWrapperOpts.inc -gen-opt-parser-defs) diff --git a/clang/tools/clang-offload-bundler/CMakeLists.txt b/clang/tools/clang-offload-bundler/CMakeLists.txt --- a/clang/tools/clang-offload-bundler/CMakeLists.txt +++ b/clang/tools/clang-offload-bundler/CMakeLists.txt @@ -1,4 +1,8 @@ -set(LLVM_LINK_COMPONENTS Object Support) +set(LLVM_LINK_COMPONENTS + Object + Support + TargetParser + ) add_clang_tool(clang-offload-bundler ClangOffloadBundler.cpp diff --git a/clang/tools/driver/CMakeLists.txt b/clang/tools/driver/CMakeLists.txt --- a/clang/tools/driver/CMakeLists.txt +++ b/clang/tools/driver/CMakeLists.txt @@ -13,6 +13,7 @@ Option ScalarOpts Support + TargetParser TransformUtils Vectorize ) diff --git a/clang/tools/libclang/CMakeLists.txt b/clang/tools/libclang/CMakeLists.txt --- a/clang/tools/libclang/CMakeLists.txt +++ b/clang/tools/libclang/CMakeLists.txt @@ -149,6 +149,7 @@ ${LLVM_TARGETS_TO_BUILD} Core Support + TargetParser ) if(ENABLE_STATIC) diff --git a/clang/unittests/AST/CMakeLists.txt b/clang/unittests/AST/CMakeLists.txt --- a/clang/unittests/AST/CMakeLists.txt +++ b/clang/unittests/AST/CMakeLists.txt @@ -1,6 +1,7 @@ set(LLVM_LINK_COMPONENTS FrontendOpenMP Support + TargetParser ) diff --git a/clang/unittests/ASTMatchers/CMakeLists.txt b/clang/unittests/ASTMatchers/CMakeLists.txt --- a/clang/unittests/ASTMatchers/CMakeLists.txt +++ b/clang/unittests/ASTMatchers/CMakeLists.txt @@ -1,6 +1,7 @@ set(LLVM_LINK_COMPONENTS FrontendOpenMP Support + TargetParser ) add_clang_unittest(ASTMatchersTests diff --git a/clang/unittests/CodeGen/CMakeLists.txt b/clang/unittests/CodeGen/CMakeLists.txt --- a/clang/unittests/CodeGen/CMakeLists.txt +++ b/clang/unittests/CodeGen/CMakeLists.txt @@ -1,6 +1,7 @@ set(LLVM_LINK_COMPONENTS Core Support + TargetParser ) add_clang_unittest(ClangCodeGenTests diff --git a/clang/unittests/Driver/CMakeLists.txt b/clang/unittests/Driver/CMakeLists.txt --- a/clang/unittests/Driver/CMakeLists.txt +++ b/clang/unittests/Driver/CMakeLists.txt @@ -3,6 +3,7 @@ MC Option Support + TargetParser ) add_clang_unittest(ClangDriverTests diff --git a/clang/unittests/Frontend/CMakeLists.txt b/clang/unittests/Frontend/CMakeLists.txt --- a/clang/unittests/Frontend/CMakeLists.txt +++ b/clang/unittests/Frontend/CMakeLists.txt @@ -1,5 +1,6 @@ set(LLVM_LINK_COMPONENTS Support + TargetParser ) add_clang_unittest(FrontendTests diff --git a/clang/unittests/Interpreter/CMakeLists.txt b/clang/unittests/Interpreter/CMakeLists.txt --- a/clang/unittests/Interpreter/CMakeLists.txt +++ b/clang/unittests/Interpreter/CMakeLists.txt @@ -3,6 +3,7 @@ Core OrcJIT Support + TargetParser ) add_clang_unittest(ClangReplInterpreterTests diff --git a/clang/unittests/Tooling/CMakeLists.txt b/clang/unittests/Tooling/CMakeLists.txt --- a/clang/unittests/Tooling/CMakeLists.txt +++ b/clang/unittests/Tooling/CMakeLists.txt @@ -4,6 +4,7 @@ Option FrontendOpenMP Support + TargetParser ) diff --git a/flang/lib/Frontend/CMakeLists.txt b/flang/lib/Frontend/CMakeLists.txt --- a/flang/lib/Frontend/CMakeLists.txt +++ b/flang/lib/Frontend/CMakeLists.txt @@ -48,6 +48,7 @@ Option Support Target + TargetParser FrontendOpenACC FrontendOpenMP ) diff --git a/flang/lib/Optimizer/CodeGen/CMakeLists.txt b/flang/lib/Optimizer/CodeGen/CMakeLists.txt --- a/flang/lib/Optimizer/CodeGen/CMakeLists.txt +++ b/flang/lib/Optimizer/CodeGen/CMakeLists.txt @@ -30,4 +30,5 @@ AsmParser AsmPrinter Remarks + TargetParser ) diff --git a/flang/lib/Optimizer/Support/CMakeLists.txt b/flang/lib/Optimizer/Support/CMakeLists.txt --- a/flang/lib/Optimizer/Support/CMakeLists.txt +++ b/flang/lib/Optimizer/Support/CMakeLists.txt @@ -17,4 +17,7 @@ MLIROpenMPToLLVMIRTranslation MLIRLLVMToLLVMIRTranslation MLIRTargetLLVMIRExport + + LINK_COMPONENTS + TargetParser ) diff --git a/flang/tools/bbc/CMakeLists.txt b/flang/tools/bbc/CMakeLists.txt --- a/flang/tools/bbc/CMakeLists.txt +++ b/flang/tools/bbc/CMakeLists.txt @@ -1,5 +1,6 @@ set(LLVM_LINK_COMPONENTS Passes +TargetParser ) add_flang_tool(bbc bbc.cpp diff --git a/flang/tools/flang-driver/CMakeLists.txt b/flang/tools/flang-driver/CMakeLists.txt --- a/flang/tools/flang-driver/CMakeLists.txt +++ b/flang/tools/flang-driver/CMakeLists.txt @@ -8,6 +8,7 @@ ${LLVM_TARGETS_TO_BUILD} Option Support + TargetParser ) add_flang_tool(flang-new diff --git a/flang/unittests/Frontend/CMakeLists.txt b/flang/unittests/Frontend/CMakeLists.txt --- a/flang/unittests/Frontend/CMakeLists.txt +++ b/flang/unittests/Frontend/CMakeLists.txt @@ -1,5 +1,6 @@ set(LLVM_LINK_COMPONENTS ${LLVM_TARGETS_TO_BUILD} + TargetParser ) add_flang_unittest(FlangFrontendTests diff --git a/flang/unittests/Optimizer/CMakeLists.txt b/flang/unittests/Optimizer/CMakeLists.txt --- a/flang/unittests/Optimizer/CMakeLists.txt +++ b/flang/unittests/Optimizer/CMakeLists.txt @@ -7,6 +7,7 @@ FIRSupport HLFIRDialect ${dialect_libs} + LLVMTargetParser ) add_flang_unittest(FlangOptimizerTests diff --git a/libc/benchmarks/CMakeLists.txt b/libc/benchmarks/CMakeLists.txt --- a/libc/benchmarks/CMakeLists.txt +++ b/libc/benchmarks/CMakeLists.txt @@ -1,6 +1,9 @@ find_package(Threads) -set(LLVM_LINK_COMPONENTS Support) +set(LLVM_LINK_COMPONENTS + Support + TargetParser + ) #============================================================================== # Add Unit Testing Support diff --git a/lld/COFF/CMakeLists.txt b/lld/COFF/CMakeLists.txt --- a/lld/COFF/CMakeLists.txt +++ b/lld/COFF/CMakeLists.txt @@ -38,6 +38,7 @@ Option Passes Support + TargetParser WindowsDriver WindowsManifest diff --git a/lld/Common/CMakeLists.txt b/lld/Common/CMakeLists.txt --- a/lld/Common/CMakeLists.txt +++ b/lld/Common/CMakeLists.txt @@ -46,6 +46,7 @@ Option Support Target + TargetParser LINK_LIBS ${LLVM_PTHREAD_LIB} diff --git a/lld/ELF/CMakeLists.txt b/lld/ELF/CMakeLists.txt --- a/lld/ELF/CMakeLists.txt +++ b/lld/ELF/CMakeLists.txt @@ -71,6 +71,7 @@ Option Passes Support + TargetParser LINK_LIBS lldCommon diff --git a/lld/MachO/CMakeLists.txt b/lld/MachO/CMakeLists.txt --- a/lld/MachO/CMakeLists.txt +++ b/lld/MachO/CMakeLists.txt @@ -48,6 +48,7 @@ Option Passes Support + TargetParser TextAPI LINK_LIBS diff --git a/lld/MinGW/CMakeLists.txt b/lld/MinGW/CMakeLists.txt --- a/lld/MinGW/CMakeLists.txt +++ b/lld/MinGW/CMakeLists.txt @@ -8,6 +8,7 @@ LINK_COMPONENTS Option Support + TargetParser LINK_LIBS lldCOFF diff --git a/lld/tools/lld/CMakeLists.txt b/lld/tools/lld/CMakeLists.txt --- a/lld/tools/lld/CMakeLists.txt +++ b/lld/tools/lld/CMakeLists.txt @@ -1,5 +1,6 @@ set(LLVM_LINK_COMPONENTS Support + TargetParser ) add_lld_tool(lld diff --git a/lld/wasm/CMakeLists.txt b/lld/wasm/CMakeLists.txt --- a/lld/wasm/CMakeLists.txt +++ b/lld/wasm/CMakeLists.txt @@ -29,6 +29,7 @@ Option Passes Support + TargetParser LINK_LIBS lldCommon diff --git a/lldb/source/Core/CMakeLists.txt b/lldb/source/Core/CMakeLists.txt --- a/lldb/source/Core/CMakeLists.txt +++ b/lldb/source/Core/CMakeLists.txt @@ -94,6 +94,7 @@ LINK_COMPONENTS Support Demangle + TargetParser ) add_dependencies(lldbCore diff --git a/lldb/source/Host/macosx/objcxx/CMakeLists.txt b/lldb/source/Host/macosx/objcxx/CMakeLists.txt --- a/lldb/source/Host/macosx/objcxx/CMakeLists.txt +++ b/lldb/source/Host/macosx/objcxx/CMakeLists.txt @@ -13,6 +13,7 @@ LINK_COMPONENTS Support + TargetParser ) target_compile_options(lldbHostMacOSXObjCXX PRIVATE -fno-objc-exceptions) diff --git a/lldb/source/Plugins/ABI/AArch64/CMakeLists.txt b/lldb/source/Plugins/ABI/AArch64/CMakeLists.txt --- a/lldb/source/Plugins/ABI/AArch64/CMakeLists.txt +++ b/lldb/source/Plugins/ABI/AArch64/CMakeLists.txt @@ -9,4 +9,5 @@ lldbTarget LINK_COMPONENTS Support + TargetParser ) diff --git a/lldb/source/Plugins/ABI/ARC/CMakeLists.txt b/lldb/source/Plugins/ABI/ARC/CMakeLists.txt --- a/lldb/source/Plugins/ABI/ARC/CMakeLists.txt +++ b/lldb/source/Plugins/ABI/ARC/CMakeLists.txt @@ -8,4 +8,5 @@ lldbPluginProcessUtility LINK_COMPONENTS Support + TargetParser ) diff --git a/lldb/source/Plugins/ABI/ARM/CMakeLists.txt b/lldb/source/Plugins/ABI/ARM/CMakeLists.txt --- a/lldb/source/Plugins/ABI/ARM/CMakeLists.txt +++ b/lldb/source/Plugins/ABI/ARM/CMakeLists.txt @@ -10,4 +10,5 @@ lldbPluginProcessUtility LINK_COMPONENTS Support + TargetParser ) diff --git a/lldb/source/Plugins/ABI/Hexagon/CMakeLists.txt b/lldb/source/Plugins/ABI/Hexagon/CMakeLists.txt --- a/lldb/source/Plugins/ABI/Hexagon/CMakeLists.txt +++ b/lldb/source/Plugins/ABI/Hexagon/CMakeLists.txt @@ -7,4 +7,5 @@ lldbTarget LINK_COMPONENTS Support + TargetParser ) diff --git a/lldb/source/Plugins/ABI/Mips/CMakeLists.txt b/lldb/source/Plugins/ABI/Mips/CMakeLists.txt --- a/lldb/source/Plugins/ABI/Mips/CMakeLists.txt +++ b/lldb/source/Plugins/ABI/Mips/CMakeLists.txt @@ -9,4 +9,5 @@ lldbTarget LINK_COMPONENTS Support + TargetParser ) diff --git a/lldb/source/Plugins/ABI/PowerPC/CMakeLists.txt b/lldb/source/Plugins/ABI/PowerPC/CMakeLists.txt --- a/lldb/source/Plugins/ABI/PowerPC/CMakeLists.txt +++ b/lldb/source/Plugins/ABI/PowerPC/CMakeLists.txt @@ -10,4 +10,5 @@ lldbPluginTypeSystemClang LINK_COMPONENTS Support + TargetParser ) diff --git a/lldb/source/Plugins/ABI/SystemZ/CMakeLists.txt b/lldb/source/Plugins/ABI/SystemZ/CMakeLists.txt --- a/lldb/source/Plugins/ABI/SystemZ/CMakeLists.txt +++ b/lldb/source/Plugins/ABI/SystemZ/CMakeLists.txt @@ -7,4 +7,5 @@ lldbTarget LINK_COMPONENTS Support + TargetParser ) diff --git a/lldb/source/Plugins/ABI/X86/CMakeLists.txt b/lldb/source/Plugins/ABI/X86/CMakeLists.txt --- a/lldb/source/Plugins/ABI/X86/CMakeLists.txt +++ b/lldb/source/Plugins/ABI/X86/CMakeLists.txt @@ -12,4 +12,5 @@ lldbTarget LINK_COMPONENTS Support + TargetParser ) diff --git a/lldb/source/Plugins/Disassembler/LLVMC/CMakeLists.txt b/lldb/source/Plugins/Disassembler/LLVMC/CMakeLists.txt --- a/lldb/source/Plugins/Disassembler/LLVMC/CMakeLists.txt +++ b/lldb/source/Plugins/Disassembler/LLVMC/CMakeLists.txt @@ -11,4 +11,5 @@ MCDisassembler RuntimeDyld Support + TargetParser ) diff --git a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/CMakeLists.txt b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/CMakeLists.txt --- a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/CMakeLists.txt +++ b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/CMakeLists.txt @@ -14,4 +14,5 @@ lldbPluginTypeSystemClang LINK_COMPONENTS Support + TargetParser ) diff --git a/lldb/source/Plugins/DynamicLoader/Windows-DYLD/CMakeLists.txt b/lldb/source/Plugins/DynamicLoader/Windows-DYLD/CMakeLists.txt --- a/lldb/source/Plugins/DynamicLoader/Windows-DYLD/CMakeLists.txt +++ b/lldb/source/Plugins/DynamicLoader/Windows-DYLD/CMakeLists.txt @@ -6,4 +6,5 @@ lldbTarget LINK_COMPONENTS Support + TargetParser ) diff --git a/lldb/source/Plugins/ExpressionParser/Clang/CMakeLists.txt b/lldb/source/Plugins/ExpressionParser/Clang/CMakeLists.txt --- a/lldb/source/Plugins/ExpressionParser/Clang/CMakeLists.txt +++ b/lldb/source/Plugins/ExpressionParser/Clang/CMakeLists.txt @@ -59,4 +59,5 @@ ipo MCJIT Support + TargetParser ) diff --git a/lldb/source/Plugins/ObjectFile/Breakpad/CMakeLists.txt b/lldb/source/Plugins/ObjectFile/Breakpad/CMakeLists.txt --- a/lldb/source/Plugins/ObjectFile/Breakpad/CMakeLists.txt +++ b/lldb/source/Plugins/ObjectFile/Breakpad/CMakeLists.txt @@ -9,4 +9,5 @@ lldbUtility LINK_COMPONENTS Support + TargetParser ) diff --git a/lldb/source/Plugins/ObjectFile/PECOFF/CMakeLists.txt b/lldb/source/Plugins/ObjectFile/PECOFF/CMakeLists.txt --- a/lldb/source/Plugins/ObjectFile/PECOFF/CMakeLists.txt +++ b/lldb/source/Plugins/ObjectFile/PECOFF/CMakeLists.txt @@ -27,6 +27,7 @@ LINK_COMPONENTS BinaryFormat Support + TargetParser ) add_dependencies(lldbPluginObjectFilePECOFF diff --git a/lldb/source/Plugins/Platform/FreeBSD/CMakeLists.txt b/lldb/source/Plugins/Platform/FreeBSD/CMakeLists.txt --- a/lldb/source/Plugins/Platform/FreeBSD/CMakeLists.txt +++ b/lldb/source/Plugins/Platform/FreeBSD/CMakeLists.txt @@ -6,4 +6,7 @@ lldbCore lldbHost lldbTarget + + LINK_COMPONENTS + TargetParser ) diff --git a/lldb/source/Plugins/Platform/MacOSX/CMakeLists.txt b/lldb/source/Plugins/Platform/MacOSX/CMakeLists.txt --- a/lldb/source/Plugins/Platform/MacOSX/CMakeLists.txt +++ b/lldb/source/Plugins/Platform/MacOSX/CMakeLists.txt @@ -52,6 +52,7 @@ clangBasic LINK_COMPONENTS Support + TargetParser ) add_dependencies(lldbPluginPlatformMacOSX diff --git a/lldb/source/Plugins/Process/Linux/CMakeLists.txt b/lldb/source/Plugins/Process/Linux/CMakeLists.txt --- a/lldb/source/Plugins/Process/Linux/CMakeLists.txt +++ b/lldb/source/Plugins/Process/Linux/CMakeLists.txt @@ -28,4 +28,5 @@ lldbPluginProcessUtility LINK_COMPONENTS Support + TargetParser ) diff --git a/lldb/source/Plugins/Process/Utility/CMakeLists.txt b/lldb/source/Plugins/Process/Utility/CMakeLists.txt --- a/lldb/source/Plugins/Process/Utility/CMakeLists.txt +++ b/lldb/source/Plugins/Process/Utility/CMakeLists.txt @@ -67,4 +67,5 @@ lldbUtility LINK_COMPONENTS Support + TargetParser ) diff --git a/lldb/source/Plugins/Process/gdb-remote/CMakeLists.txt b/lldb/source/Plugins/Process/gdb-remote/CMakeLists.txt --- a/lldb/source/Plugins/Process/gdb-remote/CMakeLists.txt +++ b/lldb/source/Plugins/Process/gdb-remote/CMakeLists.txt @@ -47,6 +47,7 @@ ${LIBCOMPRESSION} LINK_COMPONENTS Support + TargetParser ) add_dependencies(lldbPluginProcessGDBRemote diff --git a/lldb/source/Plugins/SymbolFile/NativePDB/CMakeLists.txt b/lldb/source/Plugins/SymbolFile/NativePDB/CMakeLists.txt --- a/lldb/source/Plugins/SymbolFile/NativePDB/CMakeLists.txt +++ b/lldb/source/Plugins/SymbolFile/NativePDB/CMakeLists.txt @@ -23,4 +23,5 @@ DebugInfoCodeView DebugInfoPDB Support + TargetParser ) diff --git a/lldb/source/Utility/CMakeLists.txt b/lldb/source/Utility/CMakeLists.txt --- a/lldb/source/Utility/CMakeLists.txt +++ b/lldb/source/Utility/CMakeLists.txt @@ -81,4 +81,5 @@ LINK_COMPONENTS BinaryFormat Support + TargetParser ) diff --git a/lldb/test/Shell/Commands/command-disassemble-aarch64-extensions.s b/lldb/test/Shell/Commands/command-disassemble-aarch64-extensions.s --- a/lldb/test/Shell/Commands/command-disassemble-aarch64-extensions.s +++ b/lldb/test/Shell/Commands/command-disassemble-aarch64-extensions.s @@ -9,7 +9,7 @@ .globl fn .type fn, @function fn: - // These are in the same order as llvm/include/llvm/Support/AArch64TargetParser.def + // These are in the same order as llvm/include/llvm/TargetParser/AArch64TargetParser.def crc32b w0, w0, w0 // CRC ldaddab w0, w0, [sp] // LSE sqrdmlah v0.4h, v1.4h, v2.4h // RDM diff --git a/lldb/tools/intel-features/intel-mpx/CMakeLists.txt b/lldb/tools/intel-features/intel-mpx/CMakeLists.txt --- a/lldb/tools/intel-features/intel-mpx/CMakeLists.txt +++ b/lldb/tools/intel-features/intel-mpx/CMakeLists.txt @@ -6,4 +6,5 @@ LINK_COMPONENTS Support + TargetParser ) diff --git a/lldb/unittests/Host/CMakeLists.txt b/lldb/unittests/Host/CMakeLists.txt --- a/lldb/unittests/Host/CMakeLists.txt +++ b/lldb/unittests/Host/CMakeLists.txt @@ -36,4 +36,5 @@ lldbUtilityHelpers lldbHostHelpers LLVMTestingSupport + LLVMTargetParser ) diff --git a/lldb/unittests/Utility/CMakeLists.txt b/lldb/unittests/Utility/CMakeLists.txt --- a/lldb/unittests/Utility/CMakeLists.txt +++ b/lldb/unittests/Utility/CMakeLists.txt @@ -52,6 +52,7 @@ LLVMTestingSupport LINK_COMPONENTS Support + TargetParser ) set(test_inputs diff --git a/lldb/utils/lit-cpuid/CMakeLists.txt b/lldb/utils/lit-cpuid/CMakeLists.txt --- a/lldb/utils/lit-cpuid/CMakeLists.txt +++ b/lldb/utils/lit-cpuid/CMakeLists.txt @@ -2,5 +2,5 @@ lit-cpuid.cpp ) -target_link_libraries(lit-cpuid PRIVATE LLVMSupport) +target_link_libraries(lit-cpuid PRIVATE LLVMSupport LLVMTargetParser) set_target_properties(lit-cpuid PROPERTIES FOLDER "lldb utils") diff --git a/llvm/examples/Kaleidoscope/Chapter9/CMakeLists.txt b/llvm/examples/Kaleidoscope/Chapter9/CMakeLists.txt --- a/llvm/examples/Kaleidoscope/Chapter9/CMakeLists.txt +++ b/llvm/examples/Kaleidoscope/Chapter9/CMakeLists.txt @@ -4,6 +4,7 @@ Object OrcJIT Support + TargetParser native ) diff --git a/llvm/include/llvm/ADT/Triple.h b/llvm/include/llvm/ADT/Triple.h --- a/llvm/include/llvm/ADT/Triple.h +++ b/llvm/include/llvm/ADT/Triple.h @@ -1,1091 +1,15 @@ -//===-- llvm/ADT/Triple.h - Target triple helper class ----------*- C++ -*-===// +//===-- llvm/ADT/Triple.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 // //===----------------------------------------------------------------------===// - -#ifndef LLVM_ADT_TRIPLE_H -#define LLVM_ADT_TRIPLE_H - -#include "llvm/ADT/Twine.h" -#include "llvm/Support/VersionTuple.h" - -// Some system headers or GCC predefined macros conflict with identifiers in -// this file. Undefine them here. -#undef NetBSD -#undef mips -#undef sparc - -namespace llvm { - -/// Triple - Helper class for working with autoconf configuration names. For -/// historical reasons, we also call these 'triples' (they used to contain -/// exactly three fields). -/// -/// Configuration names are strings in the canonical form: -/// ARCHITECTURE-VENDOR-OPERATING_SYSTEM -/// or -/// ARCHITECTURE-VENDOR-OPERATING_SYSTEM-ENVIRONMENT -/// -/// This class is used for clients which want to support arbitrary -/// configuration names, but also want to implement certain special -/// behavior for particular configurations. This class isolates the mapping -/// from the components of the configuration name to well known IDs. /// -/// At its core the Triple class is designed to be a wrapper for a triple -/// string; the constructor does not change or normalize the triple string. -/// Clients that need to handle the non-canonical triples that users often -/// specify should use the normalize method. +/// \file +/// This header is deprecated in favour of +/// `llvm/TargetParser/AArch64TargetParser.h`. /// -/// See autoconf/config.guess for a glimpse into what configuration names -/// look like in practice. -class Triple { -public: - enum ArchType { - UnknownArch, - - arm, // ARM (little endian): arm, armv.*, xscale - armeb, // ARM (big endian): armeb - aarch64, // AArch64 (little endian): aarch64 - aarch64_be, // AArch64 (big endian): aarch64_be - aarch64_32, // AArch64 (little endian) ILP32: aarch64_32 - arc, // ARC: Synopsys ARC - avr, // AVR: Atmel AVR microcontroller - bpfel, // eBPF or extended BPF or 64-bit BPF (little endian) - bpfeb, // eBPF or extended BPF or 64-bit BPF (big endian) - csky, // CSKY: csky - dxil, // DXIL 32-bit DirectX bytecode - hexagon, // Hexagon: hexagon - loongarch32, // LoongArch (32-bit): loongarch32 - loongarch64, // LoongArch (64-bit): loongarch64 - m68k, // M68k: Motorola 680x0 family - mips, // MIPS: mips, mipsallegrex, mipsr6 - mipsel, // MIPSEL: mipsel, mipsallegrexe, mipsr6el - mips64, // MIPS64: mips64, mips64r6, mipsn32, mipsn32r6 - mips64el, // MIPS64EL: mips64el, mips64r6el, mipsn32el, mipsn32r6el - msp430, // MSP430: msp430 - ppc, // PPC: powerpc - ppcle, // PPCLE: powerpc (little endian) - ppc64, // PPC64: powerpc64, ppu - ppc64le, // PPC64LE: powerpc64le - r600, // R600: AMD GPUs HD2XXX - HD6XXX - amdgcn, // AMDGCN: AMD GCN GPUs - riscv32, // RISC-V (32-bit): riscv32 - riscv64, // RISC-V (64-bit): riscv64 - sparc, // Sparc: sparc - sparcv9, // Sparcv9: Sparcv9 - sparcel, // Sparc: (endianness = little). NB: 'Sparcle' is a CPU variant - systemz, // SystemZ: s390x - tce, // TCE (http://tce.cs.tut.fi/): tce - tcele, // TCE little endian (http://tce.cs.tut.fi/): tcele - thumb, // Thumb (little endian): thumb, thumbv.* - thumbeb, // Thumb (big endian): thumbeb - x86, // X86: i[3-9]86 - x86_64, // X86-64: amd64, x86_64 - xcore, // XCore: xcore - nvptx, // NVPTX: 32-bit - nvptx64, // NVPTX: 64-bit - le32, // le32: generic little-endian 32-bit CPU (PNaCl) - le64, // le64: generic little-endian 64-bit CPU (PNaCl) - amdil, // AMDIL - amdil64, // AMDIL with 64-bit pointers - hsail, // AMD HSAIL - hsail64, // AMD HSAIL with 64-bit pointers - spir, // SPIR: standard portable IR for OpenCL 32-bit version - spir64, // SPIR: standard portable IR for OpenCL 64-bit version - spirv32, // SPIR-V with 32-bit pointers - spirv64, // SPIR-V with 64-bit pointers - kalimba, // Kalimba: generic kalimba - shave, // SHAVE: Movidius vector VLIW processors - lanai, // Lanai: Lanai 32-bit - wasm32, // WebAssembly with 32-bit pointers - wasm64, // WebAssembly with 64-bit pointers - renderscript32, // 32-bit RenderScript - renderscript64, // 64-bit RenderScript - ve, // NEC SX-Aurora Vector Engine - LastArchType = ve - }; - enum SubArchType { - NoSubArch, - - ARMSubArch_v9_4a, - ARMSubArch_v9_3a, - ARMSubArch_v9_2a, - ARMSubArch_v9_1a, - ARMSubArch_v9, - ARMSubArch_v8_9a, - ARMSubArch_v8_8a, - ARMSubArch_v8_7a, - ARMSubArch_v8_6a, - ARMSubArch_v8_5a, - ARMSubArch_v8_4a, - ARMSubArch_v8_3a, - ARMSubArch_v8_2a, - ARMSubArch_v8_1a, - ARMSubArch_v8, - ARMSubArch_v8r, - ARMSubArch_v8m_baseline, - ARMSubArch_v8m_mainline, - ARMSubArch_v8_1m_mainline, - ARMSubArch_v7, - ARMSubArch_v7em, - ARMSubArch_v7m, - ARMSubArch_v7s, - ARMSubArch_v7k, - ARMSubArch_v7ve, - ARMSubArch_v6, - ARMSubArch_v6m, - ARMSubArch_v6k, - ARMSubArch_v6t2, - ARMSubArch_v5, - ARMSubArch_v5te, - ARMSubArch_v4t, - - AArch64SubArch_arm64e, - AArch64SubArch_arm64ec, - - KalimbaSubArch_v3, - KalimbaSubArch_v4, - KalimbaSubArch_v5, - - MipsSubArch_r6, - - PPCSubArch_spe, - - // SPIR-V sub-arch corresponds to its version. - SPIRVSubArch_v10, - SPIRVSubArch_v11, - SPIRVSubArch_v12, - SPIRVSubArch_v13, - SPIRVSubArch_v14, - SPIRVSubArch_v15, - }; - enum VendorType { - UnknownVendor, - - Apple, - PC, - SCEI, - Freescale, - IBM, - ImaginationTechnologies, - MipsTechnologies, - NVIDIA, - CSR, - Myriad, - AMD, - Mesa, - SUSE, - OpenEmbedded, - LastVendorType = OpenEmbedded - }; - enum OSType { - UnknownOS, - - Ananas, - CloudABI, - Darwin, - DragonFly, - FreeBSD, - Fuchsia, - IOS, - KFreeBSD, - Linux, - Lv2, // PS3 - MacOSX, - NetBSD, - OpenBSD, - Solaris, - Win32, - ZOS, - Haiku, - Minix, - RTEMS, - NaCl, // Native Client - AIX, - CUDA, // NVIDIA CUDA - NVCL, // NVIDIA OpenCL - AMDHSA, // AMD HSA Runtime - PS4, - PS5, - ELFIAMCU, - TvOS, // Apple tvOS - WatchOS, // Apple watchOS - DriverKit, // Apple DriverKit - Mesa3D, - Contiki, - AMDPAL, // AMD PAL Runtime - HermitCore, // HermitCore Unikernel/Multikernel - Hurd, // GNU/Hurd - WASI, // Experimental WebAssembly OS - Emscripten, - ShaderModel, // DirectX ShaderModel - LastOSType = ShaderModel - }; - enum EnvironmentType { - UnknownEnvironment, - - GNU, - GNUABIN32, - GNUABI64, - GNUEABI, - GNUEABIHF, - GNUF32, - GNUF64, - GNUSF, - GNUX32, - GNUILP32, - CODE16, - EABI, - EABIHF, - Android, - Musl, - MuslEABI, - MuslEABIHF, - MuslX32, - - MSVC, - Itanium, - Cygnus, - CoreCLR, - Simulator, // Simulator variants of other systems, e.g., Apple's iOS - MacABI, // Mac Catalyst variant of Apple's iOS deployment target. - - // Shader Stages - // The order of these values matters, and must be kept in sync with the - // language options enum in Clang. The ordering is enforced in - // static_asserts in Triple.cpp and in Clang. - Pixel, - Vertex, - Geometry, - Hull, - Domain, - Compute, - Library, - RayGeneration, - Intersection, - AnyHit, - ClosestHit, - Miss, - Callable, - Mesh, - Amplification, - - LastEnvironmentType = Amplification - }; - enum ObjectFormatType { - UnknownObjectFormat, - - COFF, - DXContainer, - ELF, - GOFF, - MachO, - SPIRV, - Wasm, - XCOFF, - }; - -private: - std::string Data; - - /// The parsed arch type. - ArchType Arch{}; - - /// The parsed subarchitecture type. - SubArchType SubArch{}; - - /// The parsed vendor type. - VendorType Vendor{}; - - /// The parsed OS type. - OSType OS{}; - - /// The parsed Environment type. - EnvironmentType Environment{}; - - /// The object format type. - ObjectFormatType ObjectFormat{}; - -public: - /// @name Constructors - /// @{ - - /// Default constructor is the same as an empty string and leaves all - /// triple fields unknown. - Triple() = default; - - explicit Triple(const Twine &Str); - Triple(const Twine &ArchStr, const Twine &VendorStr, const Twine &OSStr); - Triple(const Twine &ArchStr, const Twine &VendorStr, const Twine &OSStr, - const Twine &EnvironmentStr); - - bool operator==(const Triple &Other) const { - return Arch == Other.Arch && SubArch == Other.SubArch && - Vendor == Other.Vendor && OS == Other.OS && - Environment == Other.Environment && - ObjectFormat == Other.ObjectFormat; - } - - bool operator!=(const Triple &Other) const { - return !(*this == Other); - } - - /// @} - /// @name Normalization - /// @{ - - /// Turn an arbitrary machine specification into the canonical triple form (or - /// something sensible that the Triple class understands if nothing better can - /// reasonably be done). In particular, it handles the common case in which - /// otherwise valid components are in the wrong order. - static std::string normalize(StringRef Str); - - /// Return the normalized form of this triple's string. - std::string normalize() const { return normalize(Data); } - - /// @} - /// @name Typed Component Access - /// @{ - - /// Get the parsed architecture type of this triple. - ArchType getArch() const { return Arch; } - - /// get the parsed subarchitecture type for this triple. - SubArchType getSubArch() const { return SubArch; } - - /// Get the parsed vendor type of this triple. - VendorType getVendor() const { return Vendor; } - - /// Get the parsed operating system type of this triple. - OSType getOS() const { return OS; } - - /// Does this triple have the optional environment (fourth) component? - bool hasEnvironment() const { - return getEnvironmentName() != ""; - } - - /// Get the parsed environment type of this triple. - EnvironmentType getEnvironment() const { return Environment; } - - /// Parse the version number from the OS name component of the - /// triple, if present. - /// - /// For example, "fooos1.2.3" would return (1, 2, 3). - VersionTuple getEnvironmentVersion() const; - - /// Get the object format for this triple. - ObjectFormatType getObjectFormat() const { return ObjectFormat; } - - /// Parse the version number from the OS name component of the triple, if - /// present. - /// - /// For example, "fooos1.2.3" would return (1, 2, 3). - VersionTuple getOSVersion() const; - - /// Return just the major version number, this is specialized because it is a - /// common query. - unsigned getOSMajorVersion() const { return getOSVersion().getMajor(); } - - /// Parse the version number as with getOSVersion and then translate generic - /// "darwin" versions to the corresponding OS X versions. This may also be - /// called with IOS triples but the OS X version number is just set to a - /// constant 10.4.0 in that case. Returns true if successful. - bool getMacOSXVersion(VersionTuple &Version) const; - - /// Parse the version number as with getOSVersion. This should only be called - /// with IOS or generic triples. - VersionTuple getiOSVersion() const; - - /// Parse the version number as with getOSVersion. This should only be called - /// with WatchOS or generic triples. - VersionTuple getWatchOSVersion() const; - - /// Parse the version number as with getOSVersion. - VersionTuple getDriverKitVersion() const; - - /// @} - /// @name Direct Component Access - /// @{ - - const std::string &str() const { return Data; } - - const std::string &getTriple() const { return Data; } - - /// Get the architecture (first) component of the triple. - StringRef getArchName() const; - - /// Get the architecture name based on Kind and SubArch. - StringRef getArchName(ArchType Kind, SubArchType SubArch = NoSubArch) const; - - /// Get the vendor (second) component of the triple. - StringRef getVendorName() const; - - /// Get the operating system (third) component of the triple. - StringRef getOSName() const; - - /// Get the optional environment (fourth) component of the triple, or "" if - /// empty. - StringRef getEnvironmentName() const; - - /// Get the operating system and optional environment components as a single - /// string (separated by a '-' if the environment component is present). - StringRef getOSAndEnvironmentName() const; - - /// @} - /// @name Convenience Predicates - /// @{ - - /// Test whether the architecture is 64-bit - /// - /// Note that this tests for 64-bit pointer width, and nothing else. Note - /// that we intentionally expose only three predicates, 64-bit, 32-bit, and - /// 16-bit. The inner details of pointer width for particular architectures - /// is not summed up in the triple, and so only a coarse grained predicate - /// system is provided. - bool isArch64Bit() const; - - /// Test whether the architecture is 32-bit - /// - /// Note that this tests for 32-bit pointer width, and nothing else. - bool isArch32Bit() const; - - /// Test whether the architecture is 16-bit - /// - /// Note that this tests for 16-bit pointer width, and nothing else. - bool isArch16Bit() const; - - /// Helper function for doing comparisons against version numbers included in - /// the target triple. - bool isOSVersionLT(unsigned Major, unsigned Minor = 0, - unsigned Micro = 0) const { - if (Minor == 0) { - return getOSVersion() < VersionTuple(Major); - } - if (Micro == 0) { - return getOSVersion() < VersionTuple(Major, Minor); - } - return getOSVersion() < VersionTuple(Major, Minor, Micro); - } - - bool isOSVersionLT(const Triple &Other) const { - return getOSVersion() < Other.getOSVersion(); - } - - /// Comparison function for checking OS X version compatibility, which handles - /// supporting skewed version numbering schemes used by the "darwin" triples. - bool isMacOSXVersionLT(unsigned Major, unsigned Minor = 0, - unsigned Micro = 0) const; - - /// Is this a Mac OS X triple. For legacy reasons, we support both "darwin" - /// and "osx" as OS X triples. - bool isMacOSX() const { - return getOS() == Triple::Darwin || getOS() == Triple::MacOSX; - } - - /// Is this an iOS triple. - /// Note: This identifies tvOS as a variant of iOS. If that ever - /// changes, i.e., if the two operating systems diverge or their version - /// numbers get out of sync, that will need to be changed. - /// watchOS has completely different version numbers so it is not included. - bool isiOS() const { - return getOS() == Triple::IOS || isTvOS(); - } - - /// Is this an Apple tvOS triple. - bool isTvOS() const { - return getOS() == Triple::TvOS; - } - - /// Is this an Apple watchOS triple. - bool isWatchOS() const { - return getOS() == Triple::WatchOS; - } - - bool isWatchABI() const { - return getSubArch() == Triple::ARMSubArch_v7k; - } - - /// Is this an Apple DriverKit triple. - bool isDriverKit() const { return getOS() == Triple::DriverKit; } - - bool isOSzOS() const { return getOS() == Triple::ZOS; } - - /// Is this a "Darwin" OS (macOS, iOS, tvOS, watchOS, or DriverKit). - bool isOSDarwin() const { - return isMacOSX() || isiOS() || isWatchOS() || isDriverKit(); - } - - bool isSimulatorEnvironment() const { - return getEnvironment() == Triple::Simulator; - } - - bool isMacCatalystEnvironment() const { - return getEnvironment() == Triple::MacABI; - } - - /// Returns true for targets that run on a macOS machine. - bool isTargetMachineMac() const { - return isMacOSX() || (isOSDarwin() && (isSimulatorEnvironment() || - isMacCatalystEnvironment())); - } - - bool isOSNetBSD() const { - return getOS() == Triple::NetBSD; - } - - bool isOSOpenBSD() const { - return getOS() == Triple::OpenBSD; - } - - bool isOSFreeBSD() const { - return getOS() == Triple::FreeBSD; - } - - bool isOSFuchsia() const { - return getOS() == Triple::Fuchsia; - } - - bool isOSDragonFly() const { return getOS() == Triple::DragonFly; } - - bool isOSSolaris() const { - return getOS() == Triple::Solaris; - } - - bool isOSIAMCU() const { - return getOS() == Triple::ELFIAMCU; - } - - bool isOSUnknown() const { return getOS() == Triple::UnknownOS; } - - bool isGNUEnvironment() const { - EnvironmentType Env = getEnvironment(); - return Env == Triple::GNU || Env == Triple::GNUABIN32 || - Env == Triple::GNUABI64 || Env == Triple::GNUEABI || - Env == Triple::GNUEABIHF || Env == Triple::GNUF32 || - Env == Triple::GNUF64 || Env == Triple::GNUSF || - Env == Triple::GNUX32; - } - - bool isOSContiki() const { - return getOS() == Triple::Contiki; - } - - /// Tests whether the OS is Haiku. - bool isOSHaiku() const { - return getOS() == Triple::Haiku; - } - - /// Tests whether the OS is Windows. - bool isOSWindows() const { - return getOS() == Triple::Win32; - } - - /// Checks if the environment is MSVC. - bool isKnownWindowsMSVCEnvironment() const { - return isOSWindows() && getEnvironment() == Triple::MSVC; - } - - /// Checks if the environment could be MSVC. - bool isWindowsMSVCEnvironment() const { - return isKnownWindowsMSVCEnvironment() || - (isOSWindows() && getEnvironment() == Triple::UnknownEnvironment); - } - - // Checks if we're using the Windows Arm64EC ABI. - bool isWindowsArm64EC() const { - return getArch() == Triple::aarch64 && - getSubArch() == Triple::AArch64SubArch_arm64ec; - } - - bool isWindowsCoreCLREnvironment() const { - return isOSWindows() && getEnvironment() == Triple::CoreCLR; - } - - bool isWindowsItaniumEnvironment() const { - return isOSWindows() && getEnvironment() == Triple::Itanium; - } - - bool isWindowsCygwinEnvironment() const { - return isOSWindows() && getEnvironment() == Triple::Cygnus; - } - - bool isWindowsGNUEnvironment() const { - return isOSWindows() && getEnvironment() == Triple::GNU; - } - - /// Tests for either Cygwin or MinGW OS - bool isOSCygMing() const { - return isWindowsCygwinEnvironment() || isWindowsGNUEnvironment(); - } - - /// Is this a "Windows" OS targeting a "MSVCRT.dll" environment. - bool isOSMSVCRT() const { - return isWindowsMSVCEnvironment() || isWindowsGNUEnvironment() || - isWindowsItaniumEnvironment(); - } - - /// Tests whether the OS is NaCl (Native Client) - bool isOSNaCl() const { - return getOS() == Triple::NaCl; - } - - /// Tests whether the OS is Linux. - bool isOSLinux() const { - return getOS() == Triple::Linux; - } - - /// Tests whether the OS is kFreeBSD. - bool isOSKFreeBSD() const { - return getOS() == Triple::KFreeBSD; - } - - /// Tests whether the OS is Hurd. - bool isOSHurd() const { - return getOS() == Triple::Hurd; - } - - /// Tests whether the OS is WASI. - bool isOSWASI() const { - return getOS() == Triple::WASI; - } - - /// Tests whether the OS is Emscripten. - bool isOSEmscripten() const { - return getOS() == Triple::Emscripten; - } - - /// Tests whether the OS uses glibc. - bool isOSGlibc() const { - return (getOS() == Triple::Linux || getOS() == Triple::KFreeBSD || - getOS() == Triple::Hurd) && - !isAndroid(); - } - - /// Tests whether the OS is AIX. - bool isOSAIX() const { - return getOS() == Triple::AIX; - } - - /// Tests whether the OS uses the ELF binary format. - bool isOSBinFormatELF() const { - return getObjectFormat() == Triple::ELF; - } - - /// Tests whether the OS uses the COFF binary format. - bool isOSBinFormatCOFF() const { - return getObjectFormat() == Triple::COFF; - } - - /// Tests whether the OS uses the GOFF binary format. - bool isOSBinFormatGOFF() const { return getObjectFormat() == Triple::GOFF; } - - /// Tests whether the environment is MachO. - bool isOSBinFormatMachO() const { - return getObjectFormat() == Triple::MachO; - } - - /// Tests whether the OS uses the Wasm binary format. - bool isOSBinFormatWasm() const { - return getObjectFormat() == Triple::Wasm; - } - - /// Tests whether the OS uses the XCOFF binary format. - bool isOSBinFormatXCOFF() const { - return getObjectFormat() == Triple::XCOFF; - } - - /// Tests whether the OS uses the DXContainer binary format. - bool isOSBinFormatDXContainer() const { - return getObjectFormat() == Triple::DXContainer; - } - - /// Tests whether the target is the PS4 platform. - bool isPS4() const { - return getArch() == Triple::x86_64 && - getVendor() == Triple::SCEI && - getOS() == Triple::PS4; - } - - /// Tests whether the target is the PS5 platform. - bool isPS5() const { - return getArch() == Triple::x86_64 && - getVendor() == Triple::SCEI && - getOS() == Triple::PS5; - } - - /// Tests whether the target is the PS4 or PS5 platform. - bool isPS() const { return isPS4() || isPS5(); } - - /// Tests whether the target is Android - bool isAndroid() const { return getEnvironment() == Triple::Android; } - - bool isAndroidVersionLT(unsigned Major) const { - assert(isAndroid() && "Not an Android triple!"); - - VersionTuple Version = getEnvironmentVersion(); - - // 64-bit targets did not exist before API level 21 (Lollipop). - if (isArch64Bit() && Version.getMajor() < 21) - return VersionTuple(21) < VersionTuple(Major); - - return Version < VersionTuple(Major); - } - - /// Tests whether the environment is musl-libc - bool isMusl() const { - return getEnvironment() == Triple::Musl || - getEnvironment() == Triple::MuslEABI || - getEnvironment() == Triple::MuslEABIHF || - getEnvironment() == Triple::MuslX32; - } - - /// Tests whether the target is DXIL. - bool isDXIL() const { - return getArch() == Triple::dxil; - } - - /// Tests whether the target is SPIR (32- or 64-bit). - bool isSPIR() const { - return getArch() == Triple::spir || getArch() == Triple::spir64; - } - - /// Tests whether the target is SPIR-V (32/64-bit). - bool isSPIRV() const { - return getArch() == Triple::spirv32 || getArch() == Triple::spirv64; - } - - /// Tests whether the target is NVPTX (32- or 64-bit). - bool isNVPTX() const { - return getArch() == Triple::nvptx || getArch() == Triple::nvptx64; - } - - /// Tests whether the target is AMDGCN - bool isAMDGCN() const { return getArch() == Triple::amdgcn; } - - bool isAMDGPU() const { - return getArch() == Triple::r600 || getArch() == Triple::amdgcn; - } - - /// Tests whether the target is Thumb (little and big endian). - bool isThumb() const { - return getArch() == Triple::thumb || getArch() == Triple::thumbeb; - } - - /// Tests whether the target is ARM (little and big endian). - bool isARM() const { - return getArch() == Triple::arm || getArch() == Triple::armeb; - } - - /// Tests whether the target supports the EHABI exception - /// handling standard. - bool isTargetEHABICompatible() const { - return (isARM() || isThumb()) && - (getEnvironment() == Triple::EABI || - getEnvironment() == Triple::GNUEABI || - getEnvironment() == Triple::MuslEABI || - getEnvironment() == Triple::EABIHF || - getEnvironment() == Triple::GNUEABIHF || - getEnvironment() == Triple::MuslEABIHF || isAndroid()) && - isOSBinFormatELF(); - } - - /// Tests whether the target is T32. - bool isArmT32() const { - switch (getSubArch()) { - case Triple::ARMSubArch_v8m_baseline: - case Triple::ARMSubArch_v7s: - case Triple::ARMSubArch_v7k: - case Triple::ARMSubArch_v7ve: - case Triple::ARMSubArch_v6: - case Triple::ARMSubArch_v6m: - case Triple::ARMSubArch_v6k: - case Triple::ARMSubArch_v6t2: - case Triple::ARMSubArch_v5: - case Triple::ARMSubArch_v5te: - case Triple::ARMSubArch_v4t: - return false; - default: - return true; - } - } - - /// Tests whether the target is an M-class. - bool isArmMClass() const { - switch (getSubArch()) { - case Triple::ARMSubArch_v6m: - case Triple::ARMSubArch_v7m: - case Triple::ARMSubArch_v7em: - case Triple::ARMSubArch_v8m_mainline: - case Triple::ARMSubArch_v8m_baseline: - case Triple::ARMSubArch_v8_1m_mainline: - return true; - default: - return false; - } - } - - /// Tests whether the target is AArch64 (little and big endian). - bool isAArch64() const { - return getArch() == Triple::aarch64 || getArch() == Triple::aarch64_be || - getArch() == Triple::aarch64_32; - } - - /// Tests whether the target is AArch64 and pointers are the size specified by - /// \p PointerWidth. - bool isAArch64(int PointerWidth) const { - assert(PointerWidth == 64 || PointerWidth == 32); - if (!isAArch64()) - return false; - return getArch() == Triple::aarch64_32 || - getEnvironment() == Triple::GNUILP32 - ? PointerWidth == 32 - : PointerWidth == 64; - } - - /// Tests whether the target is LoongArch (32- and 64-bit). - bool isLoongArch() const { - return getArch() == Triple::loongarch32 || getArch() == Triple::loongarch64; - } - - /// Tests whether the target is MIPS 32-bit (little and big endian). - bool isMIPS32() const { - return getArch() == Triple::mips || getArch() == Triple::mipsel; - } - - /// Tests whether the target is MIPS 64-bit (little and big endian). - bool isMIPS64() const { - return getArch() == Triple::mips64 || getArch() == Triple::mips64el; - } - - /// Tests whether the target is MIPS (little and big endian, 32- or 64-bit). - bool isMIPS() const { - return isMIPS32() || isMIPS64(); - } - - /// Tests whether the target is PowerPC (32- or 64-bit LE or BE). - bool isPPC() const { - return getArch() == Triple::ppc || getArch() == Triple::ppc64 || - getArch() == Triple::ppcle || getArch() == Triple::ppc64le; - } - - /// Tests whether the target is 32-bit PowerPC (little and big endian). - bool isPPC32() const { - return getArch() == Triple::ppc || getArch() == Triple::ppcle; - } - - /// Tests whether the target is 64-bit PowerPC (little and big endian). - bool isPPC64() const { - return getArch() == Triple::ppc64 || getArch() == Triple::ppc64le; - } - - /// Tests whether the target is 32-bit RISC-V. - bool isRISCV32() const { return getArch() == Triple::riscv32; } - - /// Tests whether the target is 64-bit RISC-V. - bool isRISCV64() const { return getArch() == Triple::riscv64; } - - /// Tests whether the target is RISC-V (32- and 64-bit). - bool isRISCV() const { return isRISCV32() || isRISCV64(); } - - /// Tests whether the target is 32-bit SPARC (little and big endian). - bool isSPARC32() const { - return getArch() == Triple::sparc || getArch() == Triple::sparcel; - } - - /// Tests whether the target is 64-bit SPARC (big endian). - bool isSPARC64() const { return getArch() == Triple::sparcv9; } - - /// Tests whether the target is SPARC. - bool isSPARC() const { return isSPARC32() || isSPARC64(); } - - /// Tests whether the target is SystemZ. - bool isSystemZ() const { - return getArch() == Triple::systemz; - } - - /// Tests whether the target is x86 (32- or 64-bit). - bool isX86() const { - return getArch() == Triple::x86 || getArch() == Triple::x86_64; - } - - /// Tests whether the target is VE - bool isVE() const { - return getArch() == Triple::ve; - } - - /// Tests whether the target is wasm (32- and 64-bit). - bool isWasm() const { - return getArch() == Triple::wasm32 || getArch() == Triple::wasm64; - } - - // Tests whether the target is CSKY - bool isCSKY() const { - return getArch() == Triple::csky; - } - - /// Tests whether the target is the Apple "arm64e" AArch64 subarch. - bool isArm64e() const { - return getArch() == Triple::aarch64 && - getSubArch() == Triple::AArch64SubArch_arm64e; - } - - /// Tests whether the target is X32. - bool isX32() const { - EnvironmentType Env = getEnvironment(); - return Env == Triple::GNUX32 || Env == Triple::MuslX32; - } - - /// Tests whether the target supports comdat - bool supportsCOMDAT() const { - return !(isOSBinFormatMachO() || isOSBinFormatXCOFF() || - isOSBinFormatDXContainer()); - } - - /// Tests whether the target uses emulated TLS as default. - bool hasDefaultEmulatedTLS() const { - return isAndroid() || isOSOpenBSD() || isWindowsCygwinEnvironment(); - } - - /// Tests whether the target uses -data-sections as default. - bool hasDefaultDataSections() const { - return isOSBinFormatXCOFF() || isWasm(); - } - - /// Tests if the environment supports dllimport/export annotations. - bool hasDLLImportExport() const { return isOSWindows() || isPS(); } - - /// @} - /// @name Mutators - /// @{ - - /// Set the architecture (first) component of the triple to a known type. - void setArch(ArchType Kind, SubArchType SubArch = NoSubArch); - - /// Set the vendor (second) component of the triple to a known type. - void setVendor(VendorType Kind); - - /// Set the operating system (third) component of the triple to a known type. - void setOS(OSType Kind); - - /// Set the environment (fourth) component of the triple to a known type. - void setEnvironment(EnvironmentType Kind); - - /// Set the object file format. - void setObjectFormat(ObjectFormatType Kind); - - /// Set all components to the new triple \p Str. - void setTriple(const Twine &Str); - - /// Set the architecture (first) component of the triple by name. - void setArchName(StringRef Str); - - /// Set the vendor (second) component of the triple by name. - void setVendorName(StringRef Str); - - /// Set the operating system (third) component of the triple by name. - void setOSName(StringRef Str); - - /// Set the optional environment (fourth) component of the triple by name. - void setEnvironmentName(StringRef Str); - - /// Set the operating system and optional environment components with a single - /// string. - void setOSAndEnvironmentName(StringRef Str); - - /// @} - /// @name Helpers to build variants of a particular triple. - /// @{ - - /// Form a triple with a 32-bit variant of the current architecture. - /// - /// This can be used to move across "families" of architectures where useful. - /// - /// \returns A new triple with a 32-bit architecture or an unknown - /// architecture if no such variant can be found. - llvm::Triple get32BitArchVariant() const; - - /// Form a triple with a 64-bit variant of the current architecture. - /// - /// This can be used to move across "families" of architectures where useful. - /// - /// \returns A new triple with a 64-bit architecture or an unknown - /// architecture if no such variant can be found. - llvm::Triple get64BitArchVariant() const; - - /// Form a triple with a big endian variant of the current architecture. - /// - /// This can be used to move across "families" of architectures where useful. - /// - /// \returns A new triple with a big endian architecture or an unknown - /// architecture if no such variant can be found. - llvm::Triple getBigEndianArchVariant() const; - - /// Form a triple with a little endian variant of the current architecture. - /// - /// This can be used to move across "families" of architectures where useful. - /// - /// \returns A new triple with a little endian architecture or an unknown - /// architecture if no such variant can be found. - llvm::Triple getLittleEndianArchVariant() const; - - /// Tests whether the target triple is little endian. - /// - /// \returns true if the triple is little endian, false otherwise. - bool isLittleEndian() const; - - /// Test whether target triples are compatible. - bool isCompatibleWith(const Triple &Other) const; - - /// Merge target triples. - std::string merge(const Triple &Other) const; - - /// Some platforms have different minimum supported OS versions that - /// varies by the architecture specified in the triple. This function - /// returns the minimum supported OS version for this triple if one an exists, - /// or an invalid version tuple if this triple doesn't have one. - VersionTuple getMinimumSupportedOSVersion() const; - - /// @} - /// @name Static helpers for IDs. - /// @{ - - /// Get the canonical name for the \p Kind architecture. - static StringRef getArchTypeName(ArchType Kind); - - /// Get the "prefix" canonical name for the \p Kind architecture. This is the - /// prefix used by the architecture specific builtins, and is suitable for - /// passing to \see Intrinsic::getIntrinsicForClangBuiltin(). - /// - /// \return - The architecture prefix, or 0 if none is defined. - static StringRef getArchTypePrefix(ArchType Kind); - - /// Get the canonical name for the \p Kind vendor. - static StringRef getVendorTypeName(VendorType Kind); - - /// Get the canonical name for the \p Kind operating system. - static StringRef getOSTypeName(OSType Kind); - - /// Get the canonical name for the \p Kind environment. - static StringRef getEnvironmentTypeName(EnvironmentType Kind); - - /// @} - /// @name Static helpers for converting alternate architecture names. - /// @{ - - /// The canonical type for the given LLVM architecture name (e.g., "x86"). - static ArchType getArchTypeForLLVMName(StringRef Str); - - /// @} - - /// Returns a canonicalized OS version number for the specified OS. - static VersionTuple getCanonicalVersionForOS(OSType OSKind, - const VersionTuple &Version); -}; - -} // End llvm namespace - +//===----------------------------------------------------------------------===// -#endif +#include "llvm/TargetParser/Triple.h" diff --git a/llvm/include/llvm/Support/AArch64TargetParser.h b/llvm/include/llvm/Support/AArch64TargetParser.h --- a/llvm/include/llvm/Support/AArch64TargetParser.h +++ b/llvm/include/llvm/Support/AArch64TargetParser.h @@ -1,192 +1,15 @@ -//===-- AArch64TargetParser - Parser for AArch64 features -------*- C++ -*-===// +//===-- llvm/Support/AArch64TargetParser.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 implements a target parser to recognise AArch64 hardware features -// such as FPU/CPU/ARCH and extension names. -// +/// +/// \file +/// This header is deprecated in favour of +/// `llvm/TargetParser/AArch64TargetParser.h`. +/// //===----------------------------------------------------------------------===// -#ifndef LLVM_SUPPORT_AARCH64TARGETPARSER_H -#define LLVM_SUPPORT_AARCH64TARGETPARSER_H - -#include "llvm/ADT/StringRef.h" -#include - -// FIXME:This should be made into class design,to avoid dupplication. -namespace llvm { - -class Triple; - -namespace AArch64 { - -// Arch extension modifiers for CPUs. These are labelled with their Arm ARM -// feature name (though the canonical reference for those is AArch64.td) -// clang-format off -enum ArchExtKind : uint64_t { - AEK_INVALID = 0, - AEK_NONE = 1, - AEK_CRC = 1 << 1, // FEAT_CRC32 - AEK_CRYPTO = 1 << 2, - AEK_FP = 1 << 3, // FEAT_FP - AEK_SIMD = 1 << 4, // FEAT_AdvSIMD - AEK_FP16 = 1 << 5, // FEAT_FP16 - AEK_PROFILE = 1 << 6, // FEAT_SPE - AEK_RAS = 1 << 7, // FEAT_RAS, FEAT_RASv1p1 - AEK_LSE = 1 << 8, // FEAT_LSE - AEK_SVE = 1 << 9, // FEAT_SVE - AEK_DOTPROD = 1 << 10, // FEAT_DotProd - AEK_RCPC = 1 << 11, // FEAT_LRCPC - AEK_RDM = 1 << 12, // FEAT_RDM - AEK_SM4 = 1 << 13, // FEAT_SM4, FEAT_SM3 - AEK_SHA3 = 1 << 14, // FEAT_SHA3, FEAT_SHA512 - AEK_SHA2 = 1 << 15, // FEAT_SHA1, FEAT_SHA256 - AEK_AES = 1 << 16, // FEAT_AES, FEAT_PMULL - AEK_FP16FML = 1 << 17, // FEAT_FHM - AEK_RAND = 1 << 18, // FEAT_RNG - AEK_MTE = 1 << 19, // FEAT_MTE, FEAT_MTE2 - AEK_SSBS = 1 << 20, // FEAT_SSBS, FEAT_SSBS2 - AEK_SB = 1 << 21, // FEAT_SB - AEK_PREDRES = 1 << 22, // FEAT_SPECRES - AEK_SVE2 = 1 << 23, // FEAT_SVE2 - AEK_SVE2AES = 1 << 24, // FEAT_SVE_AES, FEAT_SVE_PMULL128 - AEK_SVE2SM4 = 1 << 25, // FEAT_SVE_SM4 - AEK_SVE2SHA3 = 1 << 26, // FEAT_SVE_SHA3 - AEK_SVE2BITPERM = 1 << 27, // FEAT_SVE_BitPerm - AEK_TME = 1 << 28, // FEAT_TME - AEK_BF16 = 1 << 29, // FEAT_BF16 - AEK_I8MM = 1 << 30, // FEAT_I8MM - AEK_F32MM = 1ULL << 31, // FEAT_F32MM - AEK_F64MM = 1ULL << 32, // FEAT_F64MM - AEK_LS64 = 1ULL << 33, // FEAT_LS64, FEAT_LS64_V, FEAT_LS64_ACCDATA - AEK_BRBE = 1ULL << 34, // FEAT_BRBE - AEK_PAUTH = 1ULL << 35, // FEAT_PAuth - AEK_FLAGM = 1ULL << 36, // FEAT_FlagM - AEK_SME = 1ULL << 37, // FEAT_SME - AEK_SMEF64F64 = 1ULL << 38, // FEAT_SME_F64F64 - AEK_SMEI16I64 = 1ULL << 39, // FEAT_SME_I16I64 - AEK_HBC = 1ULL << 40, // FEAT_HBC - AEK_MOPS = 1ULL << 41, // FEAT_MOPS - AEK_PERFMON = 1ULL << 42, // FEAT_PMUv3 - AEK_SME2 = 1ULL << 43, // FEAT_SME2 - AEK_SVE2p1 = 1ULL << 44, // FEAT_SVE2p1 - AEK_SME2p1 = 1ULL << 45, // FEAT_SME2p1 - AEK_B16B16 = 1ULL << 46, // FEAT_B16B16 - AEK_SMEF16F16 = 1ULL << 47, // FEAT_SMEF16F16 - AEK_CSSC = 1ULL << 48, // FEAT_CSSC - AEK_RCPC3 = 1ULL << 49, // FEAT_LRCPC3 - AEK_THE = 1ULL << 50, // FEAT_THE - AEK_D128 = 1ULL << 51, // FEAT_D128 - AEK_LSE128 = 1ULL << 52, // FEAT_LSE128 - AEK_SPECRES2 = 1ULL << 53, // FEAT_SPECRES2 -}; -// clang-format on - -enum class ArchKind { -#define AARCH64_ARCH(NAME, ID, ARCH_FEATURE, ARCH_BASE_EXT) ID, -#include "AArch64TargetParser.def" -}; - -struct ArchNames { - StringRef Name; - StringRef ArchFeature; - uint64_t ArchBaseExtensions; - ArchKind ID; - - // Return ArchFeature without the leading "+". - StringRef getSubArch() const { return ArchFeature.substr(1); } -}; - -const ArchNames AArch64ARCHNames[] = { -#define AARCH64_ARCH(NAME, ID, ARCH_FEATURE, ARCH_BASE_EXT) \ - {NAME, ARCH_FEATURE, ARCH_BASE_EXT, AArch64::ArchKind::ID}, -#include "AArch64TargetParser.def" -}; - -// List of Arch Extension names. -struct ExtName { - StringRef Name; - uint64_t ID; - StringRef Feature; - StringRef NegFeature; -}; - -const ExtName AArch64ARCHExtNames[] = { -#define AARCH64_ARCH_EXT_NAME(NAME, ID, FEATURE, NEGFEATURE) \ - {NAME, ID, FEATURE, NEGFEATURE}, -#include "AArch64TargetParser.def" -}; - -// List of CPU names and their arches. -// The same CPU can have multiple arches and can be default on multiple arches. -// When finding the Arch for a CPU, first-found prevails. Sort them accordingly. -// When this becomes table-generated, we'd probably need two tables. -struct CpuNames { - StringRef Name; - ArchKind ArchID; - uint64_t DefaultExtensions; -}; - -const CpuNames AArch64CPUNames[] = { -#define AARCH64_CPU_NAME(NAME, ID, DEFAULT_EXT) \ - {NAME, AArch64::ArchKind::ID, DEFAULT_EXT}, -#include "AArch64TargetParser.def" -}; - -const struct { - StringRef Alias; - StringRef Name; -} AArch64CPUAliases[] = { -#define AARCH64_CPU_ALIAS(ALIAS, NAME) {ALIAS, NAME}, -#include "AArch64TargetParser.def" -}; - -const ArchKind ArchKinds[] = { -#define AARCH64_ARCH(NAME, ID, ARCH_FEATURE, ARCH_BASE_EXT) ArchKind::ID, -#include "AArch64TargetParser.def" -}; - -inline ArchKind &operator--(ArchKind &Kind) { - if ((Kind == ArchKind::INVALID) || (Kind == ArchKind::ARMV8A) || - (Kind == ArchKind::ARMV9A) || (Kind == ArchKind::ARMV8R)) - Kind = ArchKind::INVALID; - else { - unsigned KindAsInteger = static_cast(Kind); - Kind = static_cast(--KindAsInteger); - } - return Kind; -} - -bool getExtensionFeatures(uint64_t Extensions, - std::vector &Features); -StringRef getArchFeature(ArchKind AK); - -StringRef getArchName(ArchKind AK); -StringRef getSubArch(ArchKind AK); -StringRef getArchExtName(unsigned ArchExtKind); -StringRef getArchExtFeature(StringRef ArchExt); -ArchKind convertV9toV8(ArchKind AK); -StringRef resolveCPUAlias(StringRef CPU); - -// Information by Name -uint64_t getDefaultExtensions(StringRef CPU, ArchKind AK); -ArchKind getCPUArchKind(StringRef CPU); -ArchKind getSubArchArchKind(StringRef SubArch); - -// Parser -ArchKind parseArch(StringRef Arch); -ArchExtKind parseArchExt(StringRef ArchExt); -ArchKind parseCPUArch(StringRef CPU); -// Used by target parser tests -void fillValidCPUArchList(SmallVectorImpl &Values); - -bool isX18ReservedByDefault(const Triple &TT); - -} // namespace AArch64 -} // namespace llvm - -#endif +#include "llvm/TargetParser/AArch64TargetParser.h" diff --git a/llvm/include/llvm/Support/ARMTargetParser.h b/llvm/include/llvm/Support/ARMTargetParser.h --- a/llvm/include/llvm/Support/ARMTargetParser.h +++ b/llvm/include/llvm/Support/ARMTargetParser.h @@ -1,265 +1,15 @@ -//===-- ARMTargetParser - Parser for ARM target features --------*- C++ -*-===// +//===-- llvm/Support/ARMTargetParser.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 implements a target parser to recognise ARM hardware features -// such as FPU/CPU/ARCH/extensions and specific support such as HWDIV. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_SUPPORT_ARMTARGETPARSER_H -#define LLVM_SUPPORT_ARMTARGETPARSER_H - -#include "llvm/ADT/StringRef.h" -#include "llvm/Support/ARMBuildAttributes.h" -#include "llvm/Support/ARMTargetParserCommon.h" -#include - -namespace llvm { - -class Triple; - -namespace ARM { - -// Arch extension modifiers for CPUs. -// Note that this is not the same as the AArch64 list -enum ArchExtKind : uint64_t { - AEK_INVALID = 0, - AEK_NONE = 1, - AEK_CRC = 1 << 1, - AEK_CRYPTO = 1 << 2, - AEK_FP = 1 << 3, - AEK_HWDIVTHUMB = 1 << 4, - AEK_HWDIVARM = 1 << 5, - AEK_MP = 1 << 6, - AEK_SIMD = 1 << 7, - AEK_SEC = 1 << 8, - AEK_VIRT = 1 << 9, - AEK_DSP = 1 << 10, - AEK_FP16 = 1 << 11, - AEK_RAS = 1 << 12, - AEK_DOTPROD = 1 << 13, - AEK_SHA2 = 1 << 14, - AEK_AES = 1 << 15, - AEK_FP16FML = 1 << 16, - AEK_SB = 1 << 17, - AEK_FP_DP = 1 << 18, - AEK_LOB = 1 << 19, - AEK_BF16 = 1 << 20, - AEK_I8MM = 1 << 21, - AEK_CDECP0 = 1 << 22, - AEK_CDECP1 = 1 << 23, - AEK_CDECP2 = 1 << 24, - AEK_CDECP3 = 1 << 25, - AEK_CDECP4 = 1 << 26, - AEK_CDECP5 = 1 << 27, - AEK_CDECP6 = 1 << 28, - AEK_CDECP7 = 1 << 29, - AEK_PACBTI = 1 << 30, - // Unsupported extensions. - AEK_OS = 1ULL << 59, - AEK_IWMMXT = 1ULL << 60, - AEK_IWMMXT2 = 1ULL << 61, - AEK_MAVERICK = 1ULL << 62, - AEK_XSCALE = 1ULL << 63, -}; - -// List of Arch Extension names. -struct ExtName { - StringRef Name; - uint64_t ID; - StringRef Feature; - StringRef NegFeature; -}; - -const ExtName ARCHExtNames[] = { -#define ARM_ARCH_EXT_NAME(NAME, ID, FEATURE, NEGFEATURE) \ - {NAME, ID, FEATURE, NEGFEATURE}, -#include "ARMTargetParser.def" -}; - -// List of HWDiv names (use getHWDivSynonym) and which architectural -// features they correspond to (use getHWDivFeatures). -const struct { - StringRef Name; - uint64_t ID; -} HWDivNames[] = { -#define ARM_HW_DIV_NAME(NAME, ID) {NAME, ID}, -#include "ARMTargetParser.def" -}; - -// Arch names. -enum class ArchKind { -#define ARM_ARCH(NAME, ID, CPU_ATTR, ARCH_FEATURE, ARCH_ATTR, ARCH_FPU, \ - ARCH_BASE_EXT) \ - ID, -#include "ARMTargetParser.def" -}; - -// List of CPU names and their arches. -// The same CPU can have multiple arches and can be default on multiple arches. -// When finding the Arch for a CPU, first-found prevails. Sort them accordingly. -// When this becomes table-generated, we'd probably need two tables. -struct CpuNames { - StringRef Name; - ArchKind ArchID; - bool Default; // is $Name the default CPU for $ArchID ? - uint64_t DefaultExtensions; -}; - -const CpuNames CPUNames[] = { -#define ARM_CPU_NAME(NAME, ID, DEFAULT_FPU, IS_DEFAULT, DEFAULT_EXT) \ - {NAME, ARM::ArchKind::ID, IS_DEFAULT, DEFAULT_EXT}, -#include "ARMTargetParser.def" -}; - -// FPU names. -enum FPUKind { -#define ARM_FPU(NAME, KIND, VERSION, NEON_SUPPORT, RESTRICTION) KIND, -#include "ARMTargetParser.def" - FK_LAST -}; - -// FPU Version -enum class FPUVersion { - NONE, - VFPV2, - VFPV3, - VFPV3_FP16, - VFPV4, - VFPV5, - VFPV5_FULLFP16, -}; - -// An FPU name restricts the FPU in one of three ways: -enum class FPURestriction { - None = 0, ///< No restriction - D16, ///< Only 16 D registers - SP_D16 ///< Only single-precision instructions, with 16 D registers -}; - -// An FPU name implies one of three levels of Neon support: -enum class NeonSupportLevel { - None = 0, ///< No Neon - Neon, ///< Neon - Crypto ///< Neon with Crypto -}; - -// v6/v7/v8 Profile -enum class ProfileKind { INVALID = 0, A, R, M }; - -// List of canonical FPU names (use getFPUSynonym) and which architectural -// features they correspond to (use getFPUFeatures). -// The entries must appear in the order listed in ARM::FPUKind for correct -// indexing -struct FPUName { - StringRef Name; - FPUKind ID; - FPUVersion FPUVer; - NeonSupportLevel NeonSupport; - FPURestriction Restriction; -}; - -static const FPUName FPUNames[] = { -#define ARM_FPU(NAME, KIND, VERSION, NEON_SUPPORT, RESTRICTION) \ - {NAME, KIND, VERSION, NEON_SUPPORT, RESTRICTION}, -#include "llvm/Support/ARMTargetParser.def" -}; - -// List of canonical arch names (use getArchSynonym). -// This table also provides the build attribute fields for CPU arch -// and Arch ID, according to the Addenda to the ARM ABI, chapters -// 2.4 and 2.3.5.2 respectively. -// FIXME: SubArch values were simplified to fit into the expectations -// of the triples and are not conforming with their official names. -// Check to see if the expectation should be changed. -struct ArchNames { - StringRef Name; - StringRef CPUAttr; // CPU class in build attributes. - StringRef ArchFeature; - unsigned DefaultFPU; - uint64_t ArchBaseExtensions; - ArchKind ID; - ARMBuildAttrs::CPUArch ArchAttr; // Arch ID in build attributes. - - // Return ArchFeature without the leading "+". - StringRef getSubArch() const { return ArchFeature.substr(1); } -}; - -static const ArchNames ARMArchNames[] = { -#define ARM_ARCH(NAME, ID, CPU_ATTR, ARCH_FEATURE, ARCH_ATTR, ARCH_FPU, \ - ARCH_BASE_EXT) \ - {NAME, CPU_ATTR, ARCH_FEATURE, ARCH_FPU, \ - ARCH_BASE_EXT, ArchKind::ID, ARCH_ATTR}, -#include "llvm/Support/ARMTargetParser.def" -}; - -inline ArchKind &operator--(ArchKind &Kind) { - assert((Kind >= ArchKind::ARMV8A && Kind <= ArchKind::ARMV9_3A) && - "We only expect operator-- to be called with ARMV8/V9"); - if (Kind == ArchKind::INVALID || Kind == ArchKind::ARMV8A || - Kind == ArchKind::ARMV8_1A || Kind == ArchKind::ARMV9A || - Kind == ArchKind::ARMV8R) - Kind = ArchKind::INVALID; - else { - unsigned KindAsInteger = static_cast(Kind); - Kind = static_cast(--KindAsInteger); - } - return Kind; -} - -// Information by ID -StringRef getFPUName(unsigned FPUKind); -FPUVersion getFPUVersion(unsigned FPUKind); -NeonSupportLevel getFPUNeonSupportLevel(unsigned FPUKind); -FPURestriction getFPURestriction(unsigned FPUKind); - -bool getFPUFeatures(unsigned FPUKind, std::vector &Features); -bool getHWDivFeatures(uint64_t HWDivKind, std::vector &Features); -bool getExtensionFeatures(uint64_t Extensions, - std::vector &Features); - -StringRef getArchName(ArchKind AK); -unsigned getArchAttr(ArchKind AK); -StringRef getCPUAttr(ArchKind AK); -StringRef getSubArch(ArchKind AK); -StringRef getArchExtName(uint64_t ArchExtKind); -StringRef getArchExtFeature(StringRef ArchExt); -bool appendArchExtFeatures(StringRef CPU, ARM::ArchKind AK, StringRef ArchExt, - std::vector &Features, - unsigned &ArgFPUKind); -ArchKind convertV9toV8(ArchKind AK); - -// Information by Name -unsigned getDefaultFPU(StringRef CPU, ArchKind AK); -uint64_t getDefaultExtensions(StringRef CPU, ArchKind AK); -StringRef getDefaultCPU(StringRef Arch); -StringRef getCanonicalArchName(StringRef Arch); -StringRef getFPUSynonym(StringRef FPU); - -// Parser -uint64_t parseHWDiv(StringRef HWDiv); -unsigned parseFPU(StringRef FPU); -ArchKind parseArch(StringRef Arch); -uint64_t parseArchExt(StringRef ArchExt); -ArchKind parseCPUArch(StringRef CPU); -ProfileKind parseArchProfile(StringRef Arch); -unsigned parseArchVersion(StringRef Arch); - -void fillValidCPUArchList(SmallVectorImpl &Values); -StringRef computeDefaultTargetABI(const Triple &TT, StringRef CPU); - -/// Get the (LLVM) name of the minimum ARM CPU for the arch we are targeting. /// -/// \param Arch the architecture name (e.g., "armv7s"). If it is an empty -/// string then the triple's arch name is used. -StringRef getARMCPUForArch(const llvm::Triple &Triple, StringRef MArch = {}); - -} // namespace ARM -} // namespace llvm +/// \file +/// This header is deprecated in favour of +/// `llvm/TargetParser/ARMTargetParser.h`. +/// +//===----------------------------------------------------------------------===// -#endif +#include "llvm/TargetParser/ARMTargetParser.h" diff --git a/llvm/include/llvm/Support/ARMTargetParserCommon.h b/llvm/include/llvm/Support/ARMTargetParserCommon.h --- a/llvm/include/llvm/Support/ARMTargetParserCommon.h +++ b/llvm/include/llvm/Support/ARMTargetParserCommon.h @@ -1,51 +1,15 @@ -//===---------------- ARMTargetParserCommon ---------------------*- C++ -*-===// +//===-- llvm/Support/ARMTargetParserCommon.def ------------------*- 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 // //===----------------------------------------------------------------------===// -// -// Code that is common to ARMTargetParser and AArch64TargetParser. -// +/// +/// \file +/// This header is deprecated in favour of +/// `llvm/TargetParser/ARMTargetParserCommon.h`. +/// //===----------------------------------------------------------------------===// -#ifndef LLVM_SUPPORT_ARMTARGETPARSERCOMMON_H -#define LLVM_SUPPORT_ARMTARGETPARSERCOMMON_H - -#include "llvm/ADT/StringRef.h" - -namespace llvm { -namespace ARM { - -enum class ISAKind { INVALID = 0, ARM, THUMB, AARCH64 }; - -enum class EndianKind { INVALID = 0, LITTLE, BIG }; - -/// Converts e.g. "armv8" -> "armv8-a" -StringRef getArchSynonym(StringRef Arch); - -/// MArch is expected to be of the form (arm|thumb)?(eb)?(v.+)?(eb)?, but -/// (iwmmxt|xscale)(eb)? is also permitted. If the former, return -/// "v.+", if the latter, return unmodified string, minus 'eb'. -/// If invalid, return empty string. -StringRef getCanonicalArchName(StringRef Arch); - -// ARM, Thumb, AArch64 -ISAKind parseArchISA(StringRef Arch); - -// Little/Big endian -EndianKind parseArchEndian(StringRef Arch); - -struct ParsedBranchProtection { - StringRef Scope; - StringRef Key; - bool BranchTargetEnforcement; -}; - -bool parseBranchProtection(StringRef Spec, ParsedBranchProtection &PBP, - StringRef &Err); - -} // namespace ARM -} // namespace llvm -#endif +#include "llvm/TargetParser/ARMTargetParserCommon.h" diff --git a/llvm/include/llvm/Support/CSKYTargetParser.h b/llvm/include/llvm/Support/CSKYTargetParser.h --- a/llvm/include/llvm/Support/CSKYTargetParser.h +++ b/llvm/include/llvm/Support/CSKYTargetParser.h @@ -1,203 +1,15 @@ -//===-- CSKYTargetParser - Parser for CSKY target features --------*- C++ -//-*-===// +//===-- llvm/Support/CSKYTargetParser.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 implements a target parser to recognise CSKY hardware features -// such as FPU/CPU/ARCH/extensions and specific support such as HWDIV. -// +/// +/// \file +/// This header is deprecated in favour of +/// `llvm/TargetParser/CSKYTargetParser.h`. +/// //===----------------------------------------------------------------------===// -#ifndef LLVM_SUPPORT_CSKYTARGETPARSER_H -#define LLVM_SUPPORT_CSKYTARGETPARSER_H - -#include "llvm/ADT/Triple.h" -#include - -namespace llvm { -class StringRef; - -namespace CSKY { - -// Arch extension modifiers for CPUs. -enum ArchExtKind : uint64_t { - AEK_INVALID = 0, - AEK_NONE = 1, - AEK_FPUV2SF = 1 << 1, - AEK_FPUV2DF = 1 << 2, - AEK_FDIVDU = 1 << 3, - AEK_FPUV3HI = 1 << 4, - AEK_FPUV3HF = 1 << 5, - AEK_FPUV3SF = 1 << 6, - AEK_FPUV3DF = 1 << 7, - AEK_FLOATE1 = 1 << 8, - AEK_FLOAT1E2 = 1 << 9, - AEK_FLOAT1E3 = 1 << 10, - AEK_FLOAT3E4 = 1 << 11, - AEK_FLOAT7E60 = 1 << 12, - AEK_HWDIV = 1 << 13, - AEK_STLD = 1 << 14, - AEK_PUSHPOP = 1 << 15, - AEK_EDSP = 1 << 16, - AEK_DSP1E2 = 1 << 17, - AEK_DSPE60 = 1 << 18, - AEK_DSPV2 = 1 << 19, - AEK_DSPSILAN = 1 << 20, - AEK_ELRW = 1 << 21, - AEK_TRUST = 1 << 22, - AEK_JAVA = 1 << 23, - AEK_CACHE = 1 << 24, - AEK_NVIC = 1 << 25, - AEK_DOLOOP = 1 << 26, - AEK_HIGHREG = 1 << 27, - AEK_SMART = 1 << 28, - AEK_VDSP2E3 = 1 << 29, - AEK_VDSP2E60F = 1 << 30, - AEK_VDSPV2 = 1ULL << 31, - AEK_HARDTP = 1ULL << 32, - AEK_SOFTTP = 1ULL << 33, - AEK_ISTACK = 1ULL << 34, - AEK_CONSTPOOL = 1ULL << 35, - AEK_STACKSIZE = 1ULL << 36, - AEK_CCRT = 1ULL << 37, - AEK_VDSPV1 = 1ULL << 38, - AEK_E1 = 1ULL << 39, - AEK_E2 = 1ULL << 40, - AEK_2E3 = 1ULL << 41, - AEK_MP = 1ULL << 42, - AEK_3E3R1 = 1ULL << 43, - AEK_3E3R2 = 1ULL << 44, - AEK_3E3R3 = 1ULL << 45, - AEK_3E7 = 1ULL << 46, - AEK_MP1E2 = 1ULL << 47, - AEK_7E10 = 1ULL << 48, - AEK_10E60 = 1ULL << 49 - -}; - -// Arch extension modifiers for CPUs. -enum MultiArchExtKind : uint64_t { - MAEK_E1 = CSKY::AEK_E1 | CSKY::AEK_ELRW, - MAEK_E2 = CSKY::AEK_E2 | CSKY::MAEK_E1, - MAEK_2E3 = CSKY::AEK_2E3 | CSKY::MAEK_E2, - MAEK_MP = CSKY::AEK_MP | CSKY::MAEK_2E3, - MAEK_3E3R1 = CSKY::AEK_3E3R1, - MAEK_3E3R2 = CSKY::AEK_3E3R1 | CSKY::AEK_3E3R2 | CSKY::AEK_DOLOOP, - MAEK_3E7 = CSKY::AEK_3E7 | CSKY::MAEK_2E3, - MAEK_MP1E2 = CSKY::AEK_MP1E2 | CSKY::MAEK_3E7, - MAEK_7E10 = CSKY::AEK_7E10 | CSKY::MAEK_3E7, - MAEK_10E60 = CSKY::AEK_10E60 | CSKY::MAEK_7E10, -}; -// FPU names. -enum CSKYFPUKind { -#define CSKY_FPU(NAME, KIND, VERSION) KIND, -#include "CSKYTargetParser.def" - FK_LAST -}; - -// FPU Version -enum class FPUVersion { - NONE, - FPV2, - FPV3, -}; - -// Arch names. -enum class ArchKind { -#define CSKY_ARCH(NAME, ID, ARCH_BASE_EXT) ID, -#include "CSKYTargetParser.def" -}; - -// List of Arch Extension names. -// FIXME: TableGen this. -struct ExtName { - const char *NameCStr; - size_t NameLength; - uint64_t ID; - const char *Feature; - const char *NegFeature; - - StringRef getName() const { return StringRef(NameCStr, NameLength); } -}; - -const CSKY::ExtName CSKYARCHExtNames[] = { -#define CSKY_ARCH_EXT_NAME(NAME, ID, FEATURE, NEGFEATURE) \ - {NAME, sizeof(NAME) - 1, ID, FEATURE, NEGFEATURE}, -#include "CSKYTargetParser.def" -}; - -// List of CPU names and their arches. -template struct CpuNames { - const char *NameCStr; - size_t NameLength; - T ArchID; - uint64_t defaultExt; - - StringRef getName() const { return StringRef(NameCStr, NameLength); } -}; -const CpuNames CPUNames[] = { -#define CSKY_CPU_NAME(NAME, ARCH_ID, DEFAULT_EXT) \ - {NAME, sizeof(NAME) - 1, CSKY::ArchKind::ARCH_ID, DEFAULT_EXT}, -#include "llvm/Support/CSKYTargetParser.def" -}; - -// FIXME: TableGen this. -// The entries must appear in the order listed in CSKY::CSKYFPUKind for correct -// indexing -struct FPUName { - const char *NameCStr; - size_t NameLength; - CSKYFPUKind ID; - FPUVersion FPUVer; - - StringRef getName() const { return StringRef(NameCStr, NameLength); } -}; - -static const FPUName FPUNames[] = { -#define CSKY_FPU(NAME, KIND, VERSION) {NAME, sizeof(NAME) - 1, KIND, VERSION}, -#include "llvm/Support/CSKYTargetParser.def" -}; - -// List of canonical arch names. -template struct ArchNames { - const char *NameCStr; - size_t NameLength; - T ID; - uint64_t archBaseExt; - StringRef getName() const { return StringRef(NameCStr, NameLength); } -}; -const ArchNames ARCHNames[] = { -#define CSKY_ARCH(NAME, ID, ARCH_BASE_EXT) \ - {NAME, sizeof(NAME) - 1, CSKY::ArchKind::ID, ARCH_BASE_EXT}, -#include "llvm/Support/CSKYTargetParser.def" -}; - -StringRef getArchName(ArchKind AK); -StringRef getDefaultCPU(StringRef Arch); -StringRef getArchExtName(uint64_t ArchExtKind); -StringRef getArchExtFeature(StringRef ArchExt); -uint64_t getDefaultExtensions(StringRef CPU); -bool getExtensionFeatures(uint64_t Extensions, - std::vector &Features); - -// Information by ID -StringRef getFPUName(unsigned FPUKind); -FPUVersion getFPUVersion(unsigned FPUKind); - -bool getFPUFeatures(CSKYFPUKind Kind, std::vector &Features); - -// Parser -ArchKind parseArch(StringRef Arch); -ArchKind parseCPUArch(StringRef CPU); -uint64_t parseArchExt(StringRef ArchExt); -void fillValidCPUArchList(SmallVectorImpl &Values); - -} // namespace CSKY - -} // namespace llvm - -#endif +#include "llvm/TargetParser/CSKYTargetParser.h" diff --git a/llvm/include/llvm/Support/Host.h b/llvm/include/llvm/Support/Host.h --- a/llvm/include/llvm/Support/Host.h +++ b/llvm/include/llvm/Support/Host.h @@ -1,88 +1,14 @@ -//===- llvm/Support/Host.h - Host machine characteristics --------*- C++ -*-===// +//===-- llvm/Support/Host.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 // //===----------------------------------------------------------------------===// -// -// Methods for querying the nature of the host machine. -// +/// +/// \file +/// This header is deprecated in favour of `llvm/TargetParser/Host.h`. +/// //===----------------------------------------------------------------------===// -#ifndef LLVM_SUPPORT_HOST_H -#define LLVM_SUPPORT_HOST_H - -#include - -namespace llvm { -class MallocAllocator; -class StringRef; -template class StringMap; -class raw_ostream; - -namespace sys { - - /// getDefaultTargetTriple() - Return the default target triple the compiler - /// has been configured to produce code for. - /// - /// The target triple is a string in the format of: - /// CPU_TYPE-VENDOR-OPERATING_SYSTEM - /// or - /// CPU_TYPE-VENDOR-KERNEL-OPERATING_SYSTEM - std::string getDefaultTargetTriple(); - - /// getProcessTriple() - Return an appropriate target triple for generating - /// code to be loaded into the current process, e.g. when using the JIT. - std::string getProcessTriple(); - - /// getHostCPUName - Get the LLVM name for the host CPU. The particular format - /// of the name is target dependent, and suitable for passing as -mcpu to the - /// target which matches the host. - /// - /// \return - The host CPU name, or empty if the CPU could not be determined. - StringRef getHostCPUName(); - - /// getHostCPUFeatures - Get the LLVM names for the host CPU features. - /// The particular format of the names are target dependent, and suitable for - /// passing as -mattr to the target which matches the host. - /// - /// \param Features - A string mapping feature names to either - /// true (if enabled) or false (if disabled). This routine makes no guarantees - /// about exactly which features may appear in this map, except that they are - /// all valid LLVM feature names. - /// - /// \return - True on success. - bool getHostCPUFeatures(StringMap &Features); - - /// This is a function compatible with cl::AddExtraVersionPrinter, which adds - /// info about the current target triple and detected CPU. - void printDefaultTargetAndDetectedCPU(raw_ostream &OS); - - namespace detail { - /// Helper functions to extract HostCPUName from /proc/cpuinfo on linux. - StringRef getHostCPUNameForPowerPC(StringRef ProcCpuinfoContent); - StringRef getHostCPUNameForARM(StringRef ProcCpuinfoContent); - StringRef getHostCPUNameForS390x(StringRef ProcCpuinfoContent); - StringRef getHostCPUNameForRISCV(StringRef ProcCpuinfoContent); - StringRef getHostCPUNameForSPARC(StringRef ProcCpuinfoContent); - StringRef getHostCPUNameForBPF(); - - /// Helper functions to extract CPU details from CPUID on x86. - namespace x86 { - enum class VendorSignatures { - UNKNOWN, - GENUINE_INTEL, - AUTHENTIC_AMD, - }; - - /// Returns the host CPU's vendor. - /// MaxLeaf: if a non-nullptr pointer is specified, the EAX value will be - /// assigned to its pointee. - VendorSignatures getVendorSignature(unsigned *MaxLeaf = nullptr); - } // namespace x86 - } -} -} - -#endif +#include "llvm/TargetParser/Host.h" diff --git a/llvm/include/llvm/Support/LoongArchTargetParser.h b/llvm/include/llvm/Support/LoongArchTargetParser.h --- a/llvm/include/llvm/Support/LoongArchTargetParser.h +++ b/llvm/include/llvm/Support/LoongArchTargetParser.h @@ -1,74 +1,15 @@ -//==-- LoongArch64TargetParser - Parser for LoongArch64 features --*- C++ -*-=// +//===-- llvm/Support/LoongArchTargetParser.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 implements a target parser to recognise LoongArch hardware features -// such as CPU/ARCH and extension names. -// +/// +/// \file +/// This header is deprecated in favour of +/// `llvm/TargetParser/LoongArchTargetParser.h`. +/// //===----------------------------------------------------------------------===// -#ifndef LLVM_SUPPORT_LOONGARCHTARGETPARSER_H -#define LLVM_SUPPORT_LOONGARCHTARGETPARSER_H - -#include "llvm/ADT/Triple.h" -#include - -namespace llvm { -class StringRef; - -namespace LoongArch { - -enum FeatureKind : uint32_t { - FK_INVALID = 0, - FK_NONE = 1, - - // 64-bit ISA is available. - FK_64BIT = 1 << 1, - - // Single-precision floating-point instructions are available. - FK_FP32 = 1 << 2, - - // Double-precision floating-point instructions are available. - FK_FP64 = 1 << 3, - - // Loongson SIMD Extension is available. - FK_LSX = 1 << 4, - - // Loongson Advanced SIMD Extension is available. - FK_LASX = 1 << 5, - - // Loongson Binary Translation Extension is available. - FK_LBT = 1 << 6, - - // Loongson Virtualization Extension is available. - FK_LVZ = 1 << 7, -}; - -struct FeatureInfo { - StringRef Name; - FeatureKind Kind; -}; - -enum class ArchKind { -#define LOONGARCH_ARCH(NAME, KIND, FEATURES) KIND, -#include "LoongArchTargetParser.def" -}; - -struct ArchInfo { - StringRef Name; - ArchKind Kind; - uint32_t Features; -}; - -ArchKind parseArch(StringRef Arch); -bool getArchFeatures(StringRef Arch, std::vector &Features); - -} // namespace LoongArch - -} // namespace llvm - -#endif // LLVM_SUPPORT_LOONGARCHTARGETPARSER_H +#include "llvm/TargetParser/LoongArchTargetParser.h" diff --git a/llvm/include/llvm/Support/RISCVISAInfo.h b/llvm/include/llvm/Support/RISCVISAInfo.h --- a/llvm/include/llvm/Support/RISCVISAInfo.h +++ b/llvm/include/llvm/Support/RISCVISAInfo.h @@ -1,107 +1,14 @@ -//===-- RISCVISAInfo.h - RISCV ISA Information ------*- C++ -*-===// +//===-- llvm/Support/RISCVISAInfo.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 // //===----------------------------------------------------------------------===// +/// +/// \file +/// This header is deprecated in favour of `llvm/Support/RISCVISAInfo.h`. +/// +//===----------------------------------------------------------------------===// -#ifndef LLVM_SUPPORT_RISCVISAINFO_H -#define LLVM_SUPPORT_RISCVISAINFO_H - -#include "llvm/ADT/StringRef.h" -#include "llvm/Support/Error.h" - -#include -#include -#include - -namespace llvm { -struct RISCVExtensionInfo { - std::string ExtName; - unsigned MajorVersion; - unsigned MinorVersion; -}; - -class RISCVISAInfo { -public: - RISCVISAInfo(const RISCVISAInfo &) = delete; - RISCVISAInfo &operator=(const RISCVISAInfo &) = delete; - - static bool compareExtension(const std::string &LHS, const std::string &RHS); - - /// Helper class for OrderedExtensionMap. - struct ExtensionComparator { - bool operator()(const std::string &LHS, const std::string &RHS) const { - return compareExtension(LHS, RHS); - } - }; - - /// OrderedExtensionMap is std::map, it's specialized to keep entries - /// in canonical order of extension. - typedef std::map - OrderedExtensionMap; - - RISCVISAInfo(unsigned XLen, OrderedExtensionMap &Exts) - : XLen(XLen), FLen(0), MinVLen(0), MaxELen(0), MaxELenFp(0), Exts(Exts) {} - - /// Parse RISCV ISA info from arch string. - static llvm::Expected> - parseArchString(StringRef Arch, bool EnableExperimentalExtension, - bool ExperimentalExtensionVersionCheck = true); - - /// Parse RISCV ISA info from feature vector. - static llvm::Expected> - parseFeatures(unsigned XLen, const std::vector &Features); - - /// Convert RISCV ISA info to a feature vector. - void toFeatures(std::vector &Features, - std::function StrAlloc) const; - - const OrderedExtensionMap &getExtensions() const { return Exts; }; - - unsigned getXLen() const { return XLen; }; - unsigned getFLen() const { return FLen; }; - unsigned getMinVLen() const { return MinVLen; } - unsigned getMaxVLen() const { return 65536; } - unsigned getMaxELen() const { return MaxELen; } - unsigned getMaxELenFp() const { return MaxELenFp; } - - bool hasExtension(StringRef Ext) const; - std::string toString() const; - std::vector toFeatureVector() const; - StringRef computeDefaultABI() const; - - static bool isSupportedExtensionFeature(StringRef Ext); - static bool isSupportedExtension(StringRef Ext); - static bool isSupportedExtension(StringRef Ext, unsigned MajorVersion, - unsigned MinorVersion); - static llvm::Expected> - postProcessAndChecking(std::unique_ptr &&ISAInfo); - -private: - RISCVISAInfo(unsigned XLen) - : XLen(XLen), FLen(0), MinVLen(0), MaxELen(0), MaxELenFp(0) {} - - unsigned XLen; - unsigned FLen; - unsigned MinVLen; - unsigned MaxELen, MaxELenFp; - - OrderedExtensionMap Exts; - - void addExtension(StringRef ExtName, unsigned MajorVersion, - unsigned MinorVersion); - - Error checkDependency(); - - void updateImplication(); - void updateCombination(); - void updateFLen(); - void updateMinVLen(); - void updateMaxELen(); -}; - -} // namespace llvm - -#endif +#include "llvm/TargetParser/RISCVISAInfo.h" diff --git a/llvm/include/llvm/Support/TargetParser.h b/llvm/include/llvm/Support/TargetParser.h --- a/llvm/include/llvm/Support/TargetParser.h +++ b/llvm/include/llvm/Support/TargetParser.h @@ -1,187 +1,14 @@ -//===-- TargetParser - Parser for target features ---------------*- C++ -*-===// +//===-- llvm/Support/TargetParser.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 implements a target parser to recognise hardware features such as -// FPU/CPU/ARCH names as well as specific support such as HDIV, etc. -// +/// +/// \file +/// This header is deprecated in favour of `llvm/TargetParser/TargetParser.h`. +/// //===----------------------------------------------------------------------===// -#ifndef LLVM_SUPPORT_TARGETPARSER_H -#define LLVM_SUPPORT_TARGETPARSER_H - -#include "llvm/ADT/StringRef.h" -#include -// FIXME: vector is used because that's what clang uses for subtarget feature -// lists, but SmallVector would probably be better -#include - -namespace llvm { - -template class SmallVectorImpl; -class Triple; - -// Target specific information in their own namespaces. -// (ARM/AArch64/X86 are declared in ARM/AArch64/X86TargetParser.h) -// These should be generated from TableGen because the information is already -// there, and there is where new information about targets will be added. -// FIXME: To TableGen this we need to make some table generated files available -// even if the back-end is not compiled with LLVM, plus we need to create a new -// back-end to TableGen to create these clean tables. -namespace AMDGPU { - -/// GPU kinds supported by the AMDGPU target. -enum GPUKind : uint32_t { - // Not specified processor. - GK_NONE = 0, - - // R600-based processors. - GK_R600 = 1, - GK_R630 = 2, - GK_RS880 = 3, - GK_RV670 = 4, - GK_RV710 = 5, - GK_RV730 = 6, - GK_RV770 = 7, - GK_CEDAR = 8, - GK_CYPRESS = 9, - GK_JUNIPER = 10, - GK_REDWOOD = 11, - GK_SUMO = 12, - GK_BARTS = 13, - GK_CAICOS = 14, - GK_CAYMAN = 15, - GK_TURKS = 16, - - GK_R600_FIRST = GK_R600, - GK_R600_LAST = GK_TURKS, - - // AMDGCN-based processors. - GK_GFX600 = 32, - GK_GFX601 = 33, - GK_GFX602 = 34, - - GK_GFX700 = 40, - GK_GFX701 = 41, - GK_GFX702 = 42, - GK_GFX703 = 43, - GK_GFX704 = 44, - GK_GFX705 = 45, - - GK_GFX801 = 50, - GK_GFX802 = 51, - GK_GFX803 = 52, - GK_GFX805 = 53, - GK_GFX810 = 54, - - GK_GFX900 = 60, - GK_GFX902 = 61, - GK_GFX904 = 62, - GK_GFX906 = 63, - GK_GFX908 = 64, - GK_GFX909 = 65, - GK_GFX90A = 66, - GK_GFX90C = 67, - GK_GFX940 = 68, - - GK_GFX1010 = 71, - GK_GFX1011 = 72, - GK_GFX1012 = 73, - GK_GFX1013 = 74, - GK_GFX1030 = 75, - GK_GFX1031 = 76, - GK_GFX1032 = 77, - GK_GFX1033 = 78, - GK_GFX1034 = 79, - GK_GFX1035 = 80, - GK_GFX1036 = 81, - - GK_GFX1100 = 90, - GK_GFX1101 = 91, - GK_GFX1102 = 92, - GK_GFX1103 = 93, - - GK_AMDGCN_FIRST = GK_GFX600, - GK_AMDGCN_LAST = GK_GFX1103, -}; - -/// Instruction set architecture version. -struct IsaVersion { - unsigned Major; - unsigned Minor; - unsigned Stepping; -}; - -// This isn't comprehensive for now, just things that are needed from the -// frontend driver. -enum ArchFeatureKind : uint32_t { - FEATURE_NONE = 0, - - // These features only exist for r600, and are implied true for amdgcn. - FEATURE_FMA = 1 << 1, - FEATURE_LDEXP = 1 << 2, - FEATURE_FP64 = 1 << 3, - - // Common features. - FEATURE_FAST_FMA_F32 = 1 << 4, - FEATURE_FAST_DENORMAL_F32 = 1 << 5, - - // Wavefront 32 is available. - FEATURE_WAVE32 = 1 << 6, - - // Xnack is available. - FEATURE_XNACK = 1 << 7, - - // Sram-ecc is available. - FEATURE_SRAMECC = 1 << 8, -}; - -StringRef getArchNameAMDGCN(GPUKind AK); -StringRef getArchNameR600(GPUKind AK); -StringRef getCanonicalArchName(const Triple &T, StringRef Arch); -GPUKind parseArchAMDGCN(StringRef CPU); -GPUKind parseArchR600(StringRef CPU); -unsigned getArchAttrAMDGCN(GPUKind AK); -unsigned getArchAttrR600(GPUKind AK); - -void fillValidArchListAMDGCN(SmallVectorImpl &Values); -void fillValidArchListR600(SmallVectorImpl &Values); - -IsaVersion getIsaVersion(StringRef GPU); - -} // namespace AMDGPU - -namespace RISCV { - -// We use 64 bits as the known part in the scalable vector types. -static constexpr unsigned RVVBitsPerBlock = 64; - -enum CPUKind : unsigned { -#define PROC(ENUM, NAME, FEATURES, DEFAULT_MARCH) CK_##ENUM, -#define TUNE_PROC(ENUM, NAME) CK_##ENUM, -#include "RISCVTargetParser.def" -}; - -enum FeatureKind : unsigned { - FK_INVALID = 0, - FK_NONE = 1, - FK_64BIT = 1 << 2, -}; - -bool checkCPUKind(CPUKind Kind, bool IsRV64); -bool checkTuneCPUKind(CPUKind Kind, bool IsRV64); -CPUKind parseCPUKind(StringRef CPU); -CPUKind parseTuneCPUKind(StringRef CPU, bool IsRV64); -StringRef getMArchFromMcpu(StringRef CPU); -void fillValidCPUArchList(SmallVectorImpl &Values, bool IsRV64); -void fillValidTuneCPUArchList(SmallVectorImpl &Values, bool IsRV64); -bool getCPUFeaturesExceptStdExt(CPUKind Kind, std::vector &Features); - -} // namespace RISCV -} // namespace llvm - -#endif +#include "llvm/TargetParser/TargetParser.h" diff --git a/llvm/include/llvm/Support/X86TargetParser.h b/llvm/include/llvm/Support/X86TargetParser.h --- a/llvm/include/llvm/Support/X86TargetParser.h +++ b/llvm/include/llvm/Support/X86TargetParser.h @@ -1,169 +1,15 @@ -//===-- X86TargetParser - Parser for X86 features ---------------*- C++ -*-===// +//===-- llvm/Support/X86TargetParser.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 implements a target parser to recognise X86 hardware features. -// +/// +/// \file +/// This header is deprecated in favour of +/// `llvm/TargetParser/X86TargetParser.h`. +/// //===----------------------------------------------------------------------===// -#ifndef LLVM_SUPPORT_X86TARGETPARSER_H -#define LLVM_SUPPORT_X86TARGETPARSER_H - -#include "llvm/ADT/ArrayRef.h" -#include "llvm/ADT/StringMap.h" - -namespace llvm { -template class SmallVectorImpl; -class StringRef; - -namespace X86 { - -// This should be kept in sync with libcc/compiler-rt as its included by clang -// as a proxy for what's in libgcc/compiler-rt. -enum ProcessorVendors : unsigned { - VENDOR_DUMMY, -#define X86_VENDOR(ENUM, STRING) \ - ENUM, -#include "llvm/Support/X86TargetParser.def" - VENDOR_OTHER -}; - -// This should be kept in sync with libcc/compiler-rt as its included by clang -// as a proxy for what's in libgcc/compiler-rt. -enum ProcessorTypes : unsigned { - CPU_TYPE_DUMMY, -#define X86_CPU_TYPE(ENUM, STRING) \ - ENUM, -#include "llvm/Support/X86TargetParser.def" - CPU_TYPE_MAX -}; - -// This should be kept in sync with libcc/compiler-rt as its included by clang -// as a proxy for what's in libgcc/compiler-rt. -enum ProcessorSubtypes : unsigned { - CPU_SUBTYPE_DUMMY, -#define X86_CPU_SUBTYPE(ENUM, STRING) \ - ENUM, -#include "llvm/Support/X86TargetParser.def" - CPU_SUBTYPE_MAX -}; - -// This should be kept in sync with libcc/compiler-rt as it should be used -// by clang as a proxy for what's in libgcc/compiler-rt. -enum ProcessorFeatures { -#define X86_FEATURE(ENUM, STRING) FEATURE_##ENUM, -#include "llvm/Support/X86TargetParser.def" - CPU_FEATURE_MAX -}; - -enum CPUKind { - CK_None, - CK_i386, - CK_i486, - CK_WinChipC6, - CK_WinChip2, - CK_C3, - CK_i586, - CK_Pentium, - CK_PentiumMMX, - CK_PentiumPro, - CK_i686, - CK_Pentium2, - CK_Pentium3, - CK_PentiumM, - CK_C3_2, - CK_Yonah, - CK_Pentium4, - CK_Prescott, - CK_Nocona, - CK_Core2, - CK_Penryn, - CK_Bonnell, - CK_Silvermont, - CK_Goldmont, - CK_GoldmontPlus, - CK_Tremont, - CK_Nehalem, - CK_Westmere, - CK_SandyBridge, - CK_IvyBridge, - CK_Haswell, - CK_Broadwell, - CK_SkylakeClient, - CK_SkylakeServer, - CK_Cascadelake, - CK_Cooperlake, - CK_Cannonlake, - CK_IcelakeClient, - CK_Rocketlake, - CK_IcelakeServer, - CK_Tigerlake, - CK_SapphireRapids, - CK_Alderlake, - CK_Raptorlake, - CK_Meteorlake, - CK_Sierraforest, - CK_Grandridge, - CK_Graniterapids, - CK_KNL, - CK_KNM, - CK_Lakemont, - CK_K6, - CK_K6_2, - CK_K6_3, - CK_Athlon, - CK_AthlonXP, - CK_K8, - CK_K8SSE3, - CK_AMDFAM10, - CK_BTVER1, - CK_BTVER2, - CK_BDVER1, - CK_BDVER2, - CK_BDVER3, - CK_BDVER4, - CK_ZNVER1, - CK_ZNVER2, - CK_ZNVER3, - CK_x86_64, - CK_x86_64_v2, - CK_x86_64_v3, - CK_x86_64_v4, - CK_Geode, -}; - -/// Parse \p CPU string into a CPUKind. Will only accept 64-bit capable CPUs if -/// \p Only64Bit is true. -CPUKind parseArchX86(StringRef CPU, bool Only64Bit = false); -CPUKind parseTuneCPU(StringRef CPU, bool Only64Bit = false); - -/// Provide a list of valid CPU names. If \p Only64Bit is true, the list will -/// only contain 64-bit capable CPUs. -void fillValidCPUArchList(SmallVectorImpl &Values, - bool Only64Bit = false); -/// Provide a list of valid -mtune names. -void fillValidTuneCPUList(SmallVectorImpl &Values, - bool Only64Bit = false); - -/// Get the key feature prioritizing target multiversioning. -ProcessorFeatures getKeyFeature(CPUKind Kind); - -/// Fill in the features that \p CPU supports into \p Features. -void getFeaturesForCPU(StringRef CPU, SmallVectorImpl &Features); - -/// Set or clear entries in \p Features that are implied to be enabled/disabled -/// by the provided \p Feature. -void updateImpliedFeatures(StringRef Feature, bool Enabled, - StringMap &Features); - -uint64_t getCpuSupportsMask(ArrayRef FeatureStrs); -unsigned getFeaturePriority(ProcessorFeatures Feat); - -} // namespace X86 -} // namespace llvm - -#endif +#include "llvm/TargetParser/X86TargetParser.h" diff --git a/llvm/include/llvm/Support/X86TargetParser.def b/llvm/include/llvm/Support/X86TargetParser.def --- a/llvm/include/llvm/Support/X86TargetParser.def +++ b/llvm/include/llvm/Support/X86TargetParser.def @@ -1,281 +1,15 @@ -//===- X86TargetParser.def - X86 target parsing defines ---------*- C++ -*-===// +//===-- llvm/Support/X86TargetParser.def ------------------------*- 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 provides defines to build up the X86 target parser's logic. -// +/// +/// \file +/// This header is deprecated in favour of +/// `llvm/TargetParser/X86TargetParser.def`. +/// //===----------------------------------------------------------------------===// -// NOTE: NO INCLUDE GUARD DESIRED! - -#ifndef X86_VENDOR -#define X86_VENDOR(ENUM, STR) -#endif -X86_VENDOR(VENDOR_INTEL, "intel") -X86_VENDOR(VENDOR_AMD, "amd") -#undef X86_VENDOR - -// This macro is used for cpu types present in compiler-rt/libgcc. -#ifndef X86_CPU_TYPE -#define X86_CPU_TYPE(ENUM, STR) -#endif - -#ifndef X86_CPU_TYPE_ALIAS -#define X86_CPU_TYPE_ALIAS(ENUM, STR) -#endif - -// This list must match what is implemented in libgcc and compilert-rt. Clang -// uses this to know how to implement __builtin_cpu_is. -X86_CPU_TYPE(INTEL_BONNELL, "bonnell") -X86_CPU_TYPE(INTEL_CORE2, "core2") -X86_CPU_TYPE(INTEL_COREI7, "corei7") -X86_CPU_TYPE(AMDFAM10H, "amdfam10h") -X86_CPU_TYPE(AMDFAM15H, "amdfam15h") -X86_CPU_TYPE(INTEL_SILVERMONT, "silvermont") -X86_CPU_TYPE(INTEL_KNL, "knl") -X86_CPU_TYPE(AMD_BTVER1, "btver1") -X86_CPU_TYPE(AMD_BTVER2, "btver2") -X86_CPU_TYPE(AMDFAM17H, "amdfam17h") -X86_CPU_TYPE(INTEL_KNM, "knm") -X86_CPU_TYPE(INTEL_GOLDMONT, "goldmont") -X86_CPU_TYPE(INTEL_GOLDMONT_PLUS, "goldmont-plus") -X86_CPU_TYPE(INTEL_TREMONT, "tremont") -X86_CPU_TYPE(AMDFAM19H, "amdfam19h") -X86_CPU_TYPE(ZHAOXIN_FAM7H, "zhaoxin_fam7h") -X86_CPU_TYPE(INTEL_SIERRAFOREST, "sierraforest") -X86_CPU_TYPE(INTEL_GRANDRIDGE, "grandridge") - -// Alternate names supported by __builtin_cpu_is and target multiversioning. -X86_CPU_TYPE_ALIAS(INTEL_BONNELL, "atom") -X86_CPU_TYPE_ALIAS(AMDFAM10H, "amdfam10") -X86_CPU_TYPE_ALIAS(AMDFAM15H, "amdfam15") -X86_CPU_TYPE_ALIAS(INTEL_SILVERMONT, "slm") - -#undef X86_CPU_TYPE_ALIAS -#undef X86_CPU_TYPE - -// This macro is used for cpu subtypes present in compiler-rt/libgcc. -#ifndef X86_CPU_SUBTYPE -#define X86_CPU_SUBTYPE(ENUM, STR) -#endif - -#ifndef X86_CPU_SUBTYPE_ALIAS -#define X86_CPU_SUBTYPE_ALIAS(ENUM, STR) -#endif - -// This list must match what is implemented in libgcc and compilert-rt. Clang -// uses this to know how to implement __builtin_cpu_is. -X86_CPU_SUBTYPE(INTEL_COREI7_NEHALEM, "nehalem") -X86_CPU_SUBTYPE(INTEL_COREI7_WESTMERE, "westmere") -X86_CPU_SUBTYPE(INTEL_COREI7_SANDYBRIDGE, "sandybridge") -X86_CPU_SUBTYPE(AMDFAM10H_BARCELONA, "barcelona") -X86_CPU_SUBTYPE(AMDFAM10H_SHANGHAI, "shanghai") -X86_CPU_SUBTYPE(AMDFAM10H_ISTANBUL, "istanbul") -X86_CPU_SUBTYPE(AMDFAM15H_BDVER1, "bdver1") -X86_CPU_SUBTYPE(AMDFAM15H_BDVER2, "bdver2") -X86_CPU_SUBTYPE(AMDFAM15H_BDVER3, "bdver3") -X86_CPU_SUBTYPE(AMDFAM15H_BDVER4, "bdver4") -X86_CPU_SUBTYPE(AMDFAM17H_ZNVER1, "znver1") -X86_CPU_SUBTYPE(INTEL_COREI7_IVYBRIDGE, "ivybridge") -X86_CPU_SUBTYPE(INTEL_COREI7_HASWELL, "haswell") -X86_CPU_SUBTYPE(INTEL_COREI7_BROADWELL, "broadwell") -X86_CPU_SUBTYPE(INTEL_COREI7_SKYLAKE, "skylake") -X86_CPU_SUBTYPE(INTEL_COREI7_SKYLAKE_AVX512, "skylake-avx512") -X86_CPU_SUBTYPE(INTEL_COREI7_CANNONLAKE, "cannonlake") -X86_CPU_SUBTYPE(INTEL_COREI7_ICELAKE_CLIENT, "icelake-client") -X86_CPU_SUBTYPE(INTEL_COREI7_ICELAKE_SERVER, "icelake-server") -X86_CPU_SUBTYPE(AMDFAM17H_ZNVER2, "znver2") -X86_CPU_SUBTYPE(INTEL_COREI7_CASCADELAKE, "cascadelake") -X86_CPU_SUBTYPE(INTEL_COREI7_TIGERLAKE, "tigerlake") -X86_CPU_SUBTYPE(INTEL_COREI7_COOPERLAKE, "cooperlake") -X86_CPU_SUBTYPE(INTEL_COREI7_SAPPHIRERAPIDS, "sapphirerapids") -X86_CPU_SUBTYPE(INTEL_COREI7_ALDERLAKE, "alderlake") -X86_CPU_SUBTYPE(AMDFAM19H_ZNVER3, "znver3") -X86_CPU_SUBTYPE(INTEL_COREI7_ROCKETLAKE, "rocketlake") -X86_CPU_SUBTYPE(ZHAOXIN_FAM7H_LUJIAZUI, "zhaoxin_fam7h_lujiazui") -X86_CPU_SUBTYPE(AMDFAM19H_ZNVER4, "znver4") -X86_CPU_SUBTYPE(INTEL_COREI7_GRANITERAPIDS, "graniterapids") - -// Alternate names supported by __builtin_cpu_is and target multiversioning. -X86_CPU_SUBTYPE_ALIAS(INTEL_COREI7_ALDERLAKE, "raptorlake") -X86_CPU_SUBTYPE_ALIAS(INTEL_COREI7_ALDERLAKE, "meteorlake") - -#undef X86_CPU_SUBTYPE_ALIAS -#undef X86_CPU_SUBTYPE - -// This macro is used for cpu types present in compiler-rt/libgcc. The third -// parameter PRIORITY is as required by the attribute 'target' checking. Note -// that not all are supported/prioritized by GCC, so synchronization with GCC's -// implementation may require changing some existing values. -// -// We cannot just re-sort the list though because its order is dictated by the -// order of bits in CodeGenFunction::GetX86CpuSupportsMask. -#ifndef X86_FEATURE_COMPAT -#define X86_FEATURE_COMPAT(ENUM, STR, PRIORITY) X86_FEATURE(ENUM, STR) -#endif - -#ifndef X86_FEATURE -#define X86_FEATURE(ENUM, STR) -#endif - -X86_FEATURE_COMPAT(CMOV, "cmov", 0) -X86_FEATURE_COMPAT(MMX, "mmx", 1) -X86_FEATURE_COMPAT(POPCNT, "popcnt", 9) -X86_FEATURE_COMPAT(SSE, "sse", 2) -X86_FEATURE_COMPAT(SSE2, "sse2", 3) -X86_FEATURE_COMPAT(SSE3, "sse3", 4) -X86_FEATURE_COMPAT(SSSE3, "ssse3", 5) -X86_FEATURE_COMPAT(SSE4_1, "sse4.1", 7) -X86_FEATURE_COMPAT(SSE4_2, "sse4.2", 8) -X86_FEATURE_COMPAT(AVX, "avx", 12) -X86_FEATURE_COMPAT(AVX2, "avx2", 18) -X86_FEATURE_COMPAT(SSE4_A, "sse4a", 6) -X86_FEATURE_COMPAT(FMA4, "fma4", 14) -X86_FEATURE_COMPAT(XOP, "xop", 15) -X86_FEATURE_COMPAT(FMA, "fma", 16) -X86_FEATURE_COMPAT(AVX512F, "avx512f", 19) -X86_FEATURE_COMPAT(BMI, "bmi", 13) -X86_FEATURE_COMPAT(BMI2, "bmi2", 17) -X86_FEATURE_COMPAT(AES, "aes", 10) -X86_FEATURE_COMPAT(PCLMUL, "pclmul", 11) -X86_FEATURE_COMPAT(AVX512VL, "avx512vl", 20) -X86_FEATURE_COMPAT(AVX512BW, "avx512bw", 21) -X86_FEATURE_COMPAT(AVX512DQ, "avx512dq", 22) -X86_FEATURE_COMPAT(AVX512CD, "avx512cd", 23) -X86_FEATURE_COMPAT(AVX512ER, "avx512er", 24) -X86_FEATURE_COMPAT(AVX512PF, "avx512pf", 25) -X86_FEATURE_COMPAT(AVX512VBMI, "avx512vbmi", 26) -X86_FEATURE_COMPAT(AVX512IFMA, "avx512ifma", 27) -X86_FEATURE_COMPAT(AVX5124VNNIW, "avx5124vnniw", 28) -X86_FEATURE_COMPAT(AVX5124FMAPS, "avx5124fmaps", 29) -X86_FEATURE_COMPAT(AVX512VPOPCNTDQ, "avx512vpopcntdq", 30) -X86_FEATURE_COMPAT(AVX512VBMI2, "avx512vbmi2", 31) -X86_FEATURE_COMPAT(GFNI, "gfni", 32) -X86_FEATURE_COMPAT(VPCLMULQDQ, "vpclmulqdq", 33) -X86_FEATURE_COMPAT(AVX512VNNI, "avx512vnni", 34) -X86_FEATURE_COMPAT(AVX512BITALG, "avx512bitalg", 35) -X86_FEATURE_COMPAT(AVX512BF16, "avx512bf16", 36) -X86_FEATURE_COMPAT(AVX512VP2INTERSECT, "avx512vp2intersect", 37) -// Features below here are not in libgcc/compiler-rt. -X86_FEATURE (3DNOW, "3dnow") -X86_FEATURE (3DNOWA, "3dnowa") -X86_FEATURE (64BIT, "64bit") -X86_FEATURE (ADX, "adx") -X86_FEATURE (AMX_BF16, "amx-bf16") -X86_FEATURE (AMX_INT8, "amx-int8") -X86_FEATURE (AMX_TILE, "amx-tile") -X86_FEATURE (CLDEMOTE, "cldemote") -X86_FEATURE (CLFLUSHOPT, "clflushopt") -X86_FEATURE (CLWB, "clwb") -X86_FEATURE (CLZERO, "clzero") -X86_FEATURE (CMPXCHG16B, "cx16") -X86_FEATURE (CMPXCHG8B, "cx8") -X86_FEATURE (CRC32, "crc32") -X86_FEATURE (ENQCMD, "enqcmd") -X86_FEATURE (F16C, "f16c") -X86_FEATURE (FSGSBASE, "fsgsbase") -X86_FEATURE (FXSR, "fxsr") -X86_FEATURE (INVPCID, "invpcid") -X86_FEATURE (KL, "kl") -X86_FEATURE (WIDEKL, "widekl") -X86_FEATURE (LWP, "lwp") -X86_FEATURE (LZCNT, "lzcnt") -X86_FEATURE (MOVBE, "movbe") -X86_FEATURE (MOVDIR64B, "movdir64b") -X86_FEATURE (MOVDIRI, "movdiri") -X86_FEATURE (MWAITX, "mwaitx") -X86_FEATURE (PCONFIG, "pconfig") -X86_FEATURE (PKU, "pku") -X86_FEATURE (PREFETCHI, "prefetchi") -X86_FEATURE (PREFETCHWT1, "prefetchwt1") -X86_FEATURE (PRFCHW, "prfchw") -X86_FEATURE (PTWRITE, "ptwrite") -X86_FEATURE (RDPID, "rdpid") -X86_FEATURE (RDPRU, "rdpru") -X86_FEATURE (RDRND, "rdrnd") -X86_FEATURE (RDSEED, "rdseed") -X86_FEATURE (RTM, "rtm") -X86_FEATURE (SAHF, "sahf") -X86_FEATURE (SERIALIZE, "serialize") -X86_FEATURE (SGX, "sgx") -X86_FEATURE (SHA, "sha") -X86_FEATURE (SHSTK, "shstk") -X86_FEATURE (TBM, "tbm") -X86_FEATURE (TSXLDTRK, "tsxldtrk") -X86_FEATURE (UINTR, "uintr") -X86_FEATURE (VAES, "vaes") -X86_FEATURE (VZEROUPPER, "vzeroupper") -X86_FEATURE (WAITPKG, "waitpkg") -X86_FEATURE (WBNOINVD, "wbnoinvd") -X86_FEATURE (X87, "x87") -X86_FEATURE (XSAVE, "xsave") -X86_FEATURE (XSAVEC, "xsavec") -X86_FEATURE (XSAVEOPT, "xsaveopt") -X86_FEATURE (XSAVES, "xsaves") -X86_FEATURE (HRESET, "hreset") -X86_FEATURE (RAOINT, "raoint") -X86_FEATURE (AVX512FP16, "avx512fp16") -X86_FEATURE (AMX_FP16, "amx-fp16") -X86_FEATURE (CMPCCXADD, "cmpccxadd") -X86_FEATURE (AVXNECONVERT, "avxneconvert") -X86_FEATURE (AVXVNNI, "avxvnni") -X86_FEATURE (AVXIFMA, "avxifma") -X86_FEATURE (AVXVNNIINT8, "avxvnniint8") -// These features aren't really CPU features, but the frontend can set them. -X86_FEATURE (RETPOLINE_EXTERNAL_THUNK, "retpoline-external-thunk") -X86_FEATURE (RETPOLINE_INDIRECT_BRANCHES, "retpoline-indirect-branches") -X86_FEATURE (RETPOLINE_INDIRECT_CALLS, "retpoline-indirect-calls") -X86_FEATURE (LVI_CFI, "lvi-cfi") -X86_FEATURE (LVI_LOAD_HARDENING, "lvi-load-hardening") -#undef X86_FEATURE_COMPAT -#undef X86_FEATURE - -#ifndef CPU_SPECIFIC -#define CPU_SPECIFIC(NAME, TUNE_NAME, MANGLING, FEATURES) -#endif - -#ifndef CPU_SPECIFIC_ALIAS -#define CPU_SPECIFIC_ALIAS(NEW_NAME, TUNE_NAME, NAME) -#endif - -CPU_SPECIFIC("generic", "generic", 'A', "") -CPU_SPECIFIC("pentium", "pentium", 'B', "") -CPU_SPECIFIC("pentium_pro", "pentiumpro", 'C', "+cmov") -CPU_SPECIFIC("pentium_mmx", "pentium-mmx", 'D', "+mmx") -CPU_SPECIFIC("pentium_ii", "pentium2", 'E', "+cmov,+mmx") -CPU_SPECIFIC("pentium_iii", "pentium3", 'H', "+cmov,+mmx,+sse") -CPU_SPECIFIC_ALIAS("pentium_iii_no_xmm_regs", "pentium3", "pentium_iii") -CPU_SPECIFIC("pentium_4", "pentium4", 'J', "+cmov,+mmx,+sse,+sse2") -CPU_SPECIFIC("pentium_m", "pentium-m", 'K', "+cmov,+mmx,+sse,+sse2") -CPU_SPECIFIC("pentium_4_sse3", "prescott", 'L', "+cmov,+mmx,+sse,+sse2,+sse3") -CPU_SPECIFIC("core_2_duo_ssse3", "core2", 'M', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3") -CPU_SPECIFIC("core_2_duo_sse4_1", "penryn", 'N', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1") -CPU_SPECIFIC("atom", "atom", 'O', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+movbe") -CPU_SPECIFIC("atom_sse4_2", "silvermont", 'c', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+popcnt") -CPU_SPECIFIC("core_i7_sse4_2", "nehalem", 'P', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+popcnt") -CPU_SPECIFIC("core_aes_pclmulqdq", "westmere", 'Q', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+popcnt") -CPU_SPECIFIC("atom_sse4_2_movbe", "silvermont", 'd', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+movbe,+popcnt") -CPU_SPECIFIC("goldmont", "goldmont", 'i', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+movbe,+popcnt") -CPU_SPECIFIC("sandybridge", "sandybridge", 'R', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+popcnt,+avx") -CPU_SPECIFIC_ALIAS("core_2nd_gen_avx", "sandybridge", "sandybridge") -CPU_SPECIFIC("ivybridge", "ivybridge", 'S', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+popcnt,+f16c,+avx") -CPU_SPECIFIC_ALIAS("core_3rd_gen_avx", "ivybridge", "ivybridge") -CPU_SPECIFIC("haswell", "haswell", 'V', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+movbe,+popcnt,+f16c,+avx,+fma,+bmi,+lzcnt,+avx2") -CPU_SPECIFIC_ALIAS("core_4th_gen_avx", "haswell", "haswell") -CPU_SPECIFIC("core_4th_gen_avx_tsx", "haswell", 'W', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+movbe,+popcnt,+f16c,+avx,+fma,+bmi,+lzcnt,+avx2") -CPU_SPECIFIC("broadwell", "broadwell", 'X', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+movbe,+popcnt,+f16c,+avx,+fma,+bmi,+lzcnt,+avx2,+adx") -CPU_SPECIFIC_ALIAS("core_5th_gen_avx", "broadwell", "broadwell") -CPU_SPECIFIC("core_5th_gen_avx_tsx", "broadwell", 'Y', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+movbe,+popcnt,+f16c,+avx,+fma,+bmi,+lzcnt,+avx2,+adx") -CPU_SPECIFIC("knl", "knl", 'Z', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+movbe,+popcnt,+f16c,+avx,+fma,+bmi,+lzcnt,+avx2,+avx512f,+adx,+avx512er,+avx512pf,+avx512cd") -CPU_SPECIFIC_ALIAS("mic_avx512", "knl", "knl") -CPU_SPECIFIC("skylake", "skylake", 'b', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+movbe,+popcnt,+f16c,+avx,+fma,+bmi,+lzcnt,+avx2,+adx,+mpx") -CPU_SPECIFIC( "skylake_avx512", "skylake-avx512", 'a', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+movbe,+popcnt,+f16c,+avx,+fma,+bmi,+lzcnt,+avx2,+avx512dq,+avx512f,+adx,+avx512cd,+avx512bw,+avx512vl,+clwb") -CPU_SPECIFIC("cannonlake", "cannonlake", 'e', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+movbe,+popcnt,+f16c,+avx,+fma,+bmi,+lzcnt,+avx2,+avx512dq,+avx512f,+adx,+avx512ifma,+avx512cd,+avx512bw,+avx512vl,+avx512vbmi") -CPU_SPECIFIC("knm", "knm", 'j', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+movbe,+popcnt,+f16c,+avx,+fma,+bmi,+lzcnt,+avx2,+avx512f,+adx,+avx512er,+avx512pf,+avx512cd,+avx5124fmaps,+avx5124vnniw,+avx512vpopcntdq") - -#undef CPU_SPECIFIC_ALIAS -#undef CPU_SPECIFIC +#include "llvm/TargetParser/X86TargetParser.def" diff --git a/llvm/include/llvm/Support/AArch64TargetParser.h b/llvm/include/llvm/TargetParser/AArch64TargetParser.h copy from llvm/include/llvm/Support/AArch64TargetParser.h copy to llvm/include/llvm/TargetParser/AArch64TargetParser.h --- a/llvm/include/llvm/Support/AArch64TargetParser.h +++ b/llvm/include/llvm/TargetParser/AArch64TargetParser.h @@ -11,8 +11,8 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_SUPPORT_AARCH64TARGETPARSER_H -#define LLVM_SUPPORT_AARCH64TARGETPARSER_H +#ifndef LLVM_TARGETPARSER_AARCH64TARGETPARSER_H +#define LLVM_TARGETPARSER_AARCH64TARGETPARSER_H #include "llvm/ADT/StringRef.h" #include diff --git a/llvm/include/llvm/Support/AArch64TargetParser.def b/llvm/include/llvm/TargetParser/AArch64TargetParser.def rename from llvm/include/llvm/Support/AArch64TargetParser.def rename to llvm/include/llvm/TargetParser/AArch64TargetParser.def diff --git a/llvm/include/llvm/Support/ARMTargetParser.h b/llvm/include/llvm/TargetParser/ARMTargetParser.h copy from llvm/include/llvm/Support/ARMTargetParser.h copy to llvm/include/llvm/TargetParser/ARMTargetParser.h --- a/llvm/include/llvm/Support/ARMTargetParser.h +++ b/llvm/include/llvm/TargetParser/ARMTargetParser.h @@ -11,12 +11,12 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_SUPPORT_ARMTARGETPARSER_H -#define LLVM_SUPPORT_ARMTARGETPARSER_H +#ifndef LLVM_TARGETPARSER_ARMTARGETPARSER_H +#define LLVM_TARGETPARSER_ARMTARGETPARSER_H #include "llvm/ADT/StringRef.h" #include "llvm/Support/ARMBuildAttributes.h" -#include "llvm/Support/ARMTargetParserCommon.h" +#include "llvm/TargetParser/ARMTargetParserCommon.h" #include namespace llvm { @@ -167,7 +167,7 @@ static const FPUName FPUNames[] = { #define ARM_FPU(NAME, KIND, VERSION, NEON_SUPPORT, RESTRICTION) \ {NAME, KIND, VERSION, NEON_SUPPORT, RESTRICTION}, -#include "llvm/Support/ARMTargetParser.def" +#include "llvm/TargetParser/ARMTargetParser.def" }; // List of canonical arch names (use getArchSynonym). @@ -195,7 +195,7 @@ ARCH_BASE_EXT) \ {NAME, CPU_ATTR, ARCH_FEATURE, ARCH_FPU, \ ARCH_BASE_EXT, ArchKind::ID, ARCH_ATTR}, -#include "llvm/Support/ARMTargetParser.def" +#include "llvm/TargetParser/ARMTargetParser.def" }; inline ArchKind &operator--(ArchKind &Kind) { diff --git a/llvm/include/llvm/Support/ARMTargetParser.def b/llvm/include/llvm/TargetParser/ARMTargetParser.def rename from llvm/include/llvm/Support/ARMTargetParser.def rename to llvm/include/llvm/TargetParser/ARMTargetParser.def diff --git a/llvm/include/llvm/Support/ARMTargetParserCommon.h b/llvm/include/llvm/TargetParser/ARMTargetParserCommon.h copy from llvm/include/llvm/Support/ARMTargetParserCommon.h copy to llvm/include/llvm/TargetParser/ARMTargetParserCommon.h --- a/llvm/include/llvm/Support/ARMTargetParserCommon.h +++ b/llvm/include/llvm/TargetParser/ARMTargetParserCommon.h @@ -10,8 +10,8 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_SUPPORT_ARMTARGETPARSERCOMMON_H -#define LLVM_SUPPORT_ARMTARGETPARSERCOMMON_H +#ifndef LLVM_TARGETPARSER_ARMTARGETPARSERCOMMON_H +#define LLVM_TARGETPARSER_ARMTARGETPARSERCOMMON_H #include "llvm/ADT/StringRef.h" diff --git a/llvm/include/llvm/Support/CSKYTargetParser.h b/llvm/include/llvm/TargetParser/CSKYTargetParser.h copy from llvm/include/llvm/Support/CSKYTargetParser.h copy to llvm/include/llvm/TargetParser/CSKYTargetParser.h --- a/llvm/include/llvm/Support/CSKYTargetParser.h +++ b/llvm/include/llvm/TargetParser/CSKYTargetParser.h @@ -12,10 +12,10 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_SUPPORT_CSKYTARGETPARSER_H -#define LLVM_SUPPORT_CSKYTARGETPARSER_H +#ifndef LLVM_TARGETPARSER_CSKYTARGETPARSER_H +#define LLVM_TARGETPARSER_CSKYTARGETPARSER_H -#include "llvm/ADT/Triple.h" +#include "llvm/TargetParser/Triple.h" #include namespace llvm { @@ -142,7 +142,7 @@ const CpuNames CPUNames[] = { #define CSKY_CPU_NAME(NAME, ARCH_ID, DEFAULT_EXT) \ {NAME, sizeof(NAME) - 1, CSKY::ArchKind::ARCH_ID, DEFAULT_EXT}, -#include "llvm/Support/CSKYTargetParser.def" +#include "llvm/TargetParser/CSKYTargetParser.def" }; // FIXME: TableGen this. @@ -159,7 +159,7 @@ static const FPUName FPUNames[] = { #define CSKY_FPU(NAME, KIND, VERSION) {NAME, sizeof(NAME) - 1, KIND, VERSION}, -#include "llvm/Support/CSKYTargetParser.def" +#include "llvm/TargetParser/CSKYTargetParser.def" }; // List of canonical arch names. @@ -173,7 +173,7 @@ const ArchNames ARCHNames[] = { #define CSKY_ARCH(NAME, ID, ARCH_BASE_EXT) \ {NAME, sizeof(NAME) - 1, CSKY::ArchKind::ID, ARCH_BASE_EXT}, -#include "llvm/Support/CSKYTargetParser.def" +#include "llvm/TargetParser/CSKYTargetParser.def" }; StringRef getArchName(ArchKind AK); diff --git a/llvm/include/llvm/Support/CSKYTargetParser.def b/llvm/include/llvm/TargetParser/CSKYTargetParser.def rename from llvm/include/llvm/Support/CSKYTargetParser.def rename to llvm/include/llvm/TargetParser/CSKYTargetParser.def diff --git a/llvm/include/llvm/Support/Host.h b/llvm/include/llvm/TargetParser/Host.h copy from llvm/include/llvm/Support/Host.h copy to llvm/include/llvm/TargetParser/Host.h --- a/llvm/include/llvm/Support/Host.h +++ b/llvm/include/llvm/TargetParser/Host.h @@ -1,4 +1,4 @@ -//===- llvm/Support/Host.h - Host machine characteristics --------*- C++ -*-===// +//===- llvm/TargetParser/Host.h - Host machine detection -------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -10,8 +10,8 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_SUPPORT_HOST_H -#define LLVM_SUPPORT_HOST_H +#ifndef LLVM_TARGETPARSER_HOST_H +#define LLVM_TARGETPARSER_HOST_H #include diff --git a/llvm/include/llvm/Support/LoongArchTargetParser.h b/llvm/include/llvm/TargetParser/LoongArchTargetParser.h copy from llvm/include/llvm/Support/LoongArchTargetParser.h copy to llvm/include/llvm/TargetParser/LoongArchTargetParser.h --- a/llvm/include/llvm/Support/LoongArchTargetParser.h +++ b/llvm/include/llvm/TargetParser/LoongArchTargetParser.h @@ -11,10 +11,10 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_SUPPORT_LOONGARCHTARGETPARSER_H -#define LLVM_SUPPORT_LOONGARCHTARGETPARSER_H +#ifndef LLVM_TARGETPARSER_LOONGARCHTARGETPARSER_H +#define LLVM_TARGETPARSER_LOONGARCHTARGETPARSER_H -#include "llvm/ADT/Triple.h" +#include "llvm/TargetParser/Triple.h" #include namespace llvm { diff --git a/llvm/include/llvm/Support/LoongArchTargetParser.def b/llvm/include/llvm/TargetParser/LoongArchTargetParser.def rename from llvm/include/llvm/Support/LoongArchTargetParser.def rename to llvm/include/llvm/TargetParser/LoongArchTargetParser.def diff --git a/llvm/include/llvm/Support/RISCVISAInfo.h b/llvm/include/llvm/TargetParser/RISCVISAInfo.h copy from llvm/include/llvm/Support/RISCVISAInfo.h copy to llvm/include/llvm/TargetParser/RISCVISAInfo.h --- a/llvm/include/llvm/Support/RISCVISAInfo.h +++ b/llvm/include/llvm/TargetParser/RISCVISAInfo.h @@ -1,4 +1,4 @@ -//===-- RISCVISAInfo.h - RISCV ISA Information ------*- C++ -*-===// +//===-- RISCVISAInfo.h - RISCV ISA Information ------------------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -6,8 +6,8 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_SUPPORT_RISCVISAINFO_H -#define LLVM_SUPPORT_RISCVISAINFO_H +#ifndef LLVM_TARGETPARSER_RISCVISAINFO_H +#define LLVM_TARGETPARSER_RISCVISAINFO_H #include "llvm/ADT/StringRef.h" #include "llvm/Support/Error.h" diff --git a/llvm/include/llvm/Support/RISCVTargetParser.def b/llvm/include/llvm/TargetParser/RISCVTargetParser.def rename from llvm/include/llvm/Support/RISCVTargetParser.def rename to llvm/include/llvm/TargetParser/RISCVTargetParser.def diff --git a/llvm/include/llvm/Support/TargetParser.h b/llvm/include/llvm/TargetParser/TargetParser.h copy from llvm/include/llvm/Support/TargetParser.h copy to llvm/include/llvm/TargetParser/TargetParser.h --- a/llvm/include/llvm/Support/TargetParser.h +++ b/llvm/include/llvm/TargetParser/TargetParser.h @@ -11,8 +11,8 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_SUPPORT_TARGETPARSER_H -#define LLVM_SUPPORT_TARGETPARSER_H +#ifndef LLVM_TARGETPARSER_TARGETPARSER_H +#define LLVM_TARGETPARSER_TARGETPARSER_H #include "llvm/ADT/StringRef.h" #include diff --git a/llvm/include/llvm/ADT/Triple.h b/llvm/include/llvm/TargetParser/Triple.h copy from llvm/include/llvm/ADT/Triple.h copy to llvm/include/llvm/TargetParser/Triple.h --- a/llvm/include/llvm/ADT/Triple.h +++ b/llvm/include/llvm/TargetParser/Triple.h @@ -1,4 +1,4 @@ -//===-- llvm/ADT/Triple.h - Target triple helper class ----------*- C++ -*-===// +//===-- llvm/TargetParser/Triple.h - Target triple helper class--*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -6,8 +6,8 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_ADT_TRIPLE_H -#define LLVM_ADT_TRIPLE_H +#ifndef LLVM_TARGETPARSER_TRIPLE_H +#define LLVM_TARGETPARSER_TRIPLE_H #include "llvm/ADT/Twine.h" #include "llvm/Support/VersionTuple.h" @@ -252,7 +252,7 @@ CoreCLR, Simulator, // Simulator variants of other systems, e.g., Apple's iOS MacABI, // Mac Catalyst variant of Apple's iOS deployment target. - + // Shader Stages // The order of these values matters, and must be kept in sync with the // language options enum in Clang. The ordering is enforced in diff --git a/llvm/include/llvm/Support/X86TargetParser.h b/llvm/include/llvm/TargetParser/X86TargetParser.h copy from llvm/include/llvm/Support/X86TargetParser.h copy to llvm/include/llvm/TargetParser/X86TargetParser.h --- a/llvm/include/llvm/Support/X86TargetParser.h +++ b/llvm/include/llvm/TargetParser/X86TargetParser.h @@ -10,8 +10,8 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_SUPPORT_X86TARGETPARSER_H -#define LLVM_SUPPORT_X86TARGETPARSER_H +#ifndef LLVM_TARGETPARSER_X86TARGETPARSER_H +#define LLVM_TARGETPARSER_X86TARGETPARSER_H #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/StringMap.h" @@ -28,7 +28,7 @@ VENDOR_DUMMY, #define X86_VENDOR(ENUM, STRING) \ ENUM, -#include "llvm/Support/X86TargetParser.def" +#include "llvm/TargetParser/X86TargetParser.def" VENDOR_OTHER }; @@ -38,7 +38,7 @@ CPU_TYPE_DUMMY, #define X86_CPU_TYPE(ENUM, STRING) \ ENUM, -#include "llvm/Support/X86TargetParser.def" +#include "llvm/TargetParser/X86TargetParser.def" CPU_TYPE_MAX }; @@ -48,7 +48,7 @@ CPU_SUBTYPE_DUMMY, #define X86_CPU_SUBTYPE(ENUM, STRING) \ ENUM, -#include "llvm/Support/X86TargetParser.def" +#include "llvm/TargetParser/X86TargetParser.def" CPU_SUBTYPE_MAX }; @@ -56,7 +56,7 @@ // by clang as a proxy for what's in libgcc/compiler-rt. enum ProcessorFeatures { #define X86_FEATURE(ENUM, STRING) FEATURE_##ENUM, -#include "llvm/Support/X86TargetParser.def" +#include "llvm/TargetParser/X86TargetParser.def" CPU_FEATURE_MAX }; diff --git a/llvm/include/llvm/Support/X86TargetParser.def b/llvm/include/llvm/TargetParser/X86TargetParser.def copy from llvm/include/llvm/Support/X86TargetParser.def copy to llvm/include/llvm/TargetParser/X86TargetParser.def diff --git a/llvm/lib/Analysis/CMakeLists.txt b/llvm/lib/Analysis/CMakeLists.txt --- a/llvm/lib/Analysis/CMakeLists.txt +++ b/llvm/lib/Analysis/CMakeLists.txt @@ -170,4 +170,5 @@ Object ProfileData Support + TargetParser ) diff --git a/llvm/lib/BinaryFormat/CMakeLists.txt b/llvm/lib/BinaryFormat/CMakeLists.txt --- a/llvm/lib/BinaryFormat/CMakeLists.txt +++ b/llvm/lib/BinaryFormat/CMakeLists.txt @@ -19,4 +19,5 @@ LINK_COMPONENTS Support + TargetParser ) diff --git a/llvm/lib/Bitcode/Reader/CMakeLists.txt b/llvm/lib/Bitcode/Reader/CMakeLists.txt --- a/llvm/lib/Bitcode/Reader/CMakeLists.txt +++ b/llvm/lib/Bitcode/Reader/CMakeLists.txt @@ -15,4 +15,5 @@ BitstreamReader Core Support + TargetParser ) diff --git a/llvm/lib/Bitcode/Writer/CMakeLists.txt b/llvm/lib/Bitcode/Writer/CMakeLists.txt --- a/llvm/lib/Bitcode/Writer/CMakeLists.txt +++ b/llvm/lib/Bitcode/Writer/CMakeLists.txt @@ -13,4 +13,5 @@ MC Object Support + TargetParser ) diff --git a/llvm/lib/CMakeLists.txt b/llvm/lib/CMakeLists.txt --- a/llvm/lib/CMakeLists.txt +++ b/llvm/lib/CMakeLists.txt @@ -36,6 +36,7 @@ add_subdirectory(LineEditor) add_subdirectory(ProfileData) add_subdirectory(Passes) +add_subdirectory(TargetParser) add_subdirectory(TextAPI) add_subdirectory(ToolDrivers) add_subdirectory(XRay) diff --git a/llvm/lib/CodeGen/AsmPrinter/CMakeLists.txt b/llvm/lib/CodeGen/AsmPrinter/CMakeLists.txt --- a/llvm/lib/CodeGen/AsmPrinter/CMakeLists.txt +++ b/llvm/lib/CodeGen/AsmPrinter/CMakeLists.txt @@ -43,4 +43,5 @@ Remarks Support Target + TargetParser ) diff --git a/llvm/lib/CodeGen/CMakeLists.txt b/llvm/lib/CodeGen/CMakeLists.txt --- a/llvm/lib/CodeGen/CMakeLists.txt +++ b/llvm/lib/CodeGen/CMakeLists.txt @@ -265,6 +265,7 @@ Scalar Support Target + TargetParser TransformUtils ) diff --git a/llvm/lib/CodeGen/SelectionDAG/CMakeLists.txt b/llvm/lib/CodeGen/SelectionDAG/CMakeLists.txt --- a/llvm/lib/CodeGen/SelectionDAG/CMakeLists.txt +++ b/llvm/lib/CodeGen/SelectionDAG/CMakeLists.txt @@ -35,5 +35,6 @@ MC Support Target + TargetParser TransformUtils ) diff --git a/llvm/lib/DWARFLinker/CMakeLists.txt b/llvm/lib/DWARFLinker/CMakeLists.txt --- a/llvm/lib/DWARFLinker/CMakeLists.txt +++ b/llvm/lib/DWARFLinker/CMakeLists.txt @@ -18,4 +18,5 @@ MC Object Support + TargetParser ) diff --git a/llvm/lib/DebugInfo/DWARF/CMakeLists.txt b/llvm/lib/DebugInfo/DWARF/CMakeLists.txt --- a/llvm/lib/DebugInfo/DWARF/CMakeLists.txt +++ b/llvm/lib/DebugInfo/DWARF/CMakeLists.txt @@ -38,4 +38,5 @@ Object MC Support + TargetParser ) diff --git a/llvm/lib/DebugInfo/GSYM/CMakeLists.txt b/llvm/lib/DebugInfo/GSYM/CMakeLists.txt --- a/llvm/lib/DebugInfo/GSYM/CMakeLists.txt +++ b/llvm/lib/DebugInfo/GSYM/CMakeLists.txt @@ -22,5 +22,6 @@ MC Object Support + TargetParser DebugInfoDWARF ) diff --git a/llvm/lib/DebugInfo/LogicalView/CMakeLists.txt b/llvm/lib/DebugInfo/LogicalView/CMakeLists.txt --- a/llvm/lib/DebugInfo/LogicalView/CMakeLists.txt +++ b/llvm/lib/DebugInfo/LogicalView/CMakeLists.txt @@ -42,5 +42,6 @@ Object MC Support + TargetParser DebugInfoDWARF ) diff --git a/llvm/lib/DebugInfo/Symbolize/CMakeLists.txt b/llvm/lib/DebugInfo/Symbolize/CMakeLists.txt --- a/llvm/lib/DebugInfo/Symbolize/CMakeLists.txt +++ b/llvm/lib/DebugInfo/Symbolize/CMakeLists.txt @@ -14,4 +14,5 @@ Object Support Demangle + TargetParser ) diff --git a/llvm/lib/ExecutionEngine/CMakeLists.txt b/llvm/lib/ExecutionEngine/CMakeLists.txt --- a/llvm/lib/ExecutionEngine/CMakeLists.txt +++ b/llvm/lib/ExecutionEngine/CMakeLists.txt @@ -21,6 +21,7 @@ RuntimeDyld Support Target + TargetParser ) if(BUILD_SHARED_LIBS) diff --git a/llvm/lib/ExecutionEngine/JITLink/CMakeLists.txt b/llvm/lib/ExecutionEngine/JITLink/CMakeLists.txt --- a/llvm/lib/ExecutionEngine/JITLink/CMakeLists.txt +++ b/llvm/lib/ExecutionEngine/JITLink/CMakeLists.txt @@ -50,6 +50,7 @@ Option OrcTargetProcess Support + TargetParser ) target_link_libraries(LLVMJITLink @@ -58,4 +59,5 @@ LLVMOrcShared LLVMOrcTargetProcess LLVMSupport + LLVMTargetParser ) diff --git a/llvm/lib/ExecutionEngine/Orc/CMakeLists.txt b/llvm/lib/ExecutionEngine/Orc/CMakeLists.txt --- a/llvm/lib/ExecutionEngine/Orc/CMakeLists.txt +++ b/llvm/lib/ExecutionEngine/Orc/CMakeLists.txt @@ -68,6 +68,7 @@ RuntimeDyld Support Target + TargetParser TransformUtils ) diff --git a/llvm/lib/ExecutionEngine/Orc/TargetProcess/CMakeLists.txt b/llvm/lib/ExecutionEngine/Orc/TargetProcess/CMakeLists.txt --- a/llvm/lib/ExecutionEngine/Orc/TargetProcess/CMakeLists.txt +++ b/llvm/lib/ExecutionEngine/Orc/TargetProcess/CMakeLists.txt @@ -22,4 +22,5 @@ LINK_COMPONENTS OrcShared Support + TargetParser ) diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/CMakeLists.txt b/llvm/lib/ExecutionEngine/RuntimeDyld/CMakeLists.txt --- a/llvm/lib/ExecutionEngine/RuntimeDyld/CMakeLists.txt +++ b/llvm/lib/ExecutionEngine/RuntimeDyld/CMakeLists.txt @@ -17,4 +17,5 @@ MC Object Support + TargetParser ) diff --git a/llvm/lib/Frontend/OpenMP/CMakeLists.txt b/llvm/lib/Frontend/OpenMP/CMakeLists.txt --- a/llvm/lib/Frontend/OpenMP/CMakeLists.txt +++ b/llvm/lib/Frontend/OpenMP/CMakeLists.txt @@ -14,6 +14,7 @@ LINK_COMPONENTS Core Support + TargetParser TransformUtils Analysis MC diff --git a/llvm/lib/FuzzMutate/CMakeLists.txt b/llvm/lib/FuzzMutate/CMakeLists.txt --- a/llvm/lib/FuzzMutate/CMakeLists.txt +++ b/llvm/lib/FuzzMutate/CMakeLists.txt @@ -9,6 +9,7 @@ LINK_COMPONENTS Support + TargetParser ) # Library for using LLVM IR together with fuzzers. @@ -33,5 +34,6 @@ Scalar Support Target + TargetParser TransformUtils ) diff --git a/llvm/lib/IR/CMakeLists.txt b/llvm/lib/IR/CMakeLists.txt --- a/llvm/lib/IR/CMakeLists.txt +++ b/llvm/lib/IR/CMakeLists.txt @@ -79,4 +79,5 @@ BinaryFormat Remarks Support + TargetParser ) diff --git a/llvm/lib/InterfaceStub/CMakeLists.txt b/llvm/lib/InterfaceStub/CMakeLists.txt --- a/llvm/lib/InterfaceStub/CMakeLists.txt +++ b/llvm/lib/InterfaceStub/CMakeLists.txt @@ -8,4 +8,5 @@ MC Object Support + TargetParser ) diff --git a/llvm/lib/LTO/CMakeLists.txt b/llvm/lib/LTO/CMakeLists.txt --- a/llvm/lib/LTO/CMakeLists.txt +++ b/llvm/lib/LTO/CMakeLists.txt @@ -34,5 +34,6 @@ Scalar Support Target + TargetParser TransformUtils ) diff --git a/llvm/lib/Linker/CMakeLists.txt b/llvm/lib/Linker/CMakeLists.txt --- a/llvm/lib/Linker/CMakeLists.txt +++ b/llvm/lib/Linker/CMakeLists.txt @@ -13,4 +13,5 @@ Object Support TransformUtils + TargetParser ) diff --git a/llvm/lib/MC/CMakeLists.txt b/llvm/lib/MC/CMakeLists.txt --- a/llvm/lib/MC/CMakeLists.txt +++ b/llvm/lib/MC/CMakeLists.txt @@ -75,6 +75,7 @@ LINK_COMPONENTS Support + TargetParser BinaryFormat DebugInfoCodeView ) diff --git a/llvm/lib/MC/MCDisassembler/CMakeLists.txt b/llvm/lib/MC/MCDisassembler/CMakeLists.txt --- a/llvm/lib/MC/MCDisassembler/CMakeLists.txt +++ b/llvm/lib/MC/MCDisassembler/CMakeLists.txt @@ -8,4 +8,5 @@ LINK_COMPONENTS MC Support + TargetParser ) diff --git a/llvm/lib/MC/MCParser/CMakeLists.txt b/llvm/lib/MC/MCParser/CMakeLists.txt --- a/llvm/lib/MC/MCParser/CMakeLists.txt +++ b/llvm/lib/MC/MCParser/CMakeLists.txt @@ -20,4 +20,5 @@ LINK_COMPONENTS MC Support + TargetParser ) diff --git a/llvm/lib/Object/CMakeLists.txt b/llvm/lib/Object/CMakeLists.txt --- a/llvm/lib/Object/CMakeLists.txt +++ b/llvm/lib/Object/CMakeLists.txt @@ -48,5 +48,6 @@ BinaryFormat MCParser Support + TargetParser TextAPI ) diff --git a/llvm/lib/ObjectYAML/CMakeLists.txt b/llvm/lib/ObjectYAML/CMakeLists.txt --- a/llvm/lib/ObjectYAML/CMakeLists.txt +++ b/llvm/lib/ObjectYAML/CMakeLists.txt @@ -34,6 +34,7 @@ BinaryFormat Object Support + TargetParser DebugInfoCodeView MC ) diff --git a/llvm/lib/ProfileData/CMakeLists.txt b/llvm/lib/ProfileData/CMakeLists.txt --- a/llvm/lib/ProfileData/CMakeLists.txt +++ b/llvm/lib/ProfileData/CMakeLists.txt @@ -24,6 +24,7 @@ Demangle Symbolize DebugInfoDWARF + TargetParser ) add_subdirectory(Coverage) diff --git a/llvm/lib/ProfileData/Coverage/CMakeLists.txt b/llvm/lib/ProfileData/Coverage/CMakeLists.txt --- a/llvm/lib/ProfileData/Coverage/CMakeLists.txt +++ b/llvm/lib/ProfileData/Coverage/CMakeLists.txt @@ -14,4 +14,5 @@ Object ProfileData Support + TargetParser ) diff --git a/llvm/lib/Support/CMakeLists.txt b/llvm/lib/Support/CMakeLists.txt --- a/llvm/lib/Support/CMakeLists.txt +++ b/llvm/lib/Support/CMakeLists.txt @@ -118,10 +118,7 @@ add_llvm_component_library(LLVMSupport AddressRanges.cpp - AArch64TargetParser.cpp ABIBreak.cpp - ARMTargetParser.cpp - ARMTargetParserCommon.cpp AMDGPUMetadata.cpp APFixedPoint.cpp APFloat.cpp @@ -154,7 +151,6 @@ CrashRecoveryContext.cpp CSKYAttributes.cpp CSKYAttributeParser.cpp - CSKYTargetParser.cpp DataExtractor.cpp Debug.cpp DebugCounter.cpp @@ -187,7 +183,6 @@ LineIterator.cpp Locale.cpp LockFileManager.cpp - LoongArchTargetParser.cpp LowLevelType.cpp ManagedStatic.cpp MathExtras.cpp @@ -207,7 +202,6 @@ Regex.cpp RISCVAttributes.cpp RISCVAttributeParser.cpp - RISCVISAInfo.cpp ScaledNumber.cpp ScopedPrinter.cpp SHA1.cpp @@ -226,13 +220,11 @@ SymbolRemappingReader.cpp SystemUtils.cpp TarWriter.cpp - TargetParser.cpp ThreadPool.cpp TimeProfiler.cpp Timer.cpp ToolOutputFile.cpp TrigramIndex.cpp - Triple.cpp Twine.cpp TypeSize.cpp Unicode.cpp @@ -242,7 +234,6 @@ VersionTuple.cpp VirtualFileSystem.cpp WithColor.cpp - X86TargetParser.cpp YAMLParser.cpp YAMLTraits.cpp raw_os_ostream.cpp @@ -262,7 +253,6 @@ Atomic.cpp DynamicLibrary.cpp Errno.cpp - Host.cpp Memory.cpp Path.cpp Process.cpp diff --git a/llvm/lib/Target/AArch64/AsmParser/CMakeLists.txt b/llvm/lib/Target/AArch64/AsmParser/CMakeLists.txt --- a/llvm/lib/Target/AArch64/AsmParser/CMakeLists.txt +++ b/llvm/lib/Target/AArch64/AsmParser/CMakeLists.txt @@ -10,6 +10,7 @@ MC MCParser Support + TargetParser ADD_TO_COMPONENT AArch64 diff --git a/llvm/lib/Target/AArch64/CMakeLists.txt b/llvm/lib/Target/AArch64/CMakeLists.txt --- a/llvm/lib/Target/AArch64/CMakeLists.txt +++ b/llvm/lib/Target/AArch64/CMakeLists.txt @@ -103,6 +103,7 @@ SelectionDAG Support Target + TargetParser TransformUtils GlobalISel CFGuard diff --git a/llvm/lib/Target/AArch64/MCTargetDesc/CMakeLists.txt b/llvm/lib/Target/AArch64/MCTargetDesc/CMakeLists.txt --- a/llvm/lib/Target/AArch64/MCTargetDesc/CMakeLists.txt +++ b/llvm/lib/Target/AArch64/MCTargetDesc/CMakeLists.txt @@ -18,6 +18,7 @@ MC BinaryFormat Support + TargetParser ADD_TO_COMPONENT AArch64 diff --git a/llvm/lib/Target/AMDGPU/AsmParser/CMakeLists.txt b/llvm/lib/Target/AMDGPU/AsmParser/CMakeLists.txt --- a/llvm/lib/Target/AMDGPU/AsmParser/CMakeLists.txt +++ b/llvm/lib/Target/AMDGPU/AsmParser/CMakeLists.txt @@ -8,6 +8,7 @@ AMDGPUInfo AMDGPUUtils Support + TargetParser ADD_TO_COMPONENT AMDGPU diff --git a/llvm/lib/Target/AMDGPU/CMakeLists.txt b/llvm/lib/Target/AMDGPU/CMakeLists.txt --- a/llvm/lib/Target/AMDGPU/CMakeLists.txt +++ b/llvm/lib/Target/AMDGPU/CMakeLists.txt @@ -177,6 +177,7 @@ SelectionDAG Support Target + TargetParser TransformUtils Vectorize GlobalISel diff --git a/llvm/lib/Target/AMDGPU/MCA/CMakeLists.txt b/llvm/lib/Target/AMDGPU/MCA/CMakeLists.txt --- a/llvm/lib/Target/AMDGPU/MCA/CMakeLists.txt +++ b/llvm/lib/Target/AMDGPU/MCA/CMakeLists.txt @@ -8,6 +8,7 @@ AMDGPUInfo AMDGPUUtils Support + TargetParser MCA ADD_TO_COMPONENT diff --git a/llvm/lib/Target/AMDGPU/MCTargetDesc/CMakeLists.txt b/llvm/lib/Target/AMDGPU/MCTargetDesc/CMakeLists.txt --- a/llvm/lib/Target/AMDGPU/MCTargetDesc/CMakeLists.txt +++ b/llvm/lib/Target/AMDGPU/MCTargetDesc/CMakeLists.txt @@ -19,6 +19,7 @@ AMDGPUUtils Support BinaryFormat + TargetParser ADD_TO_COMPONENT AMDGPU diff --git a/llvm/lib/Target/AMDGPU/Utils/CMakeLists.txt b/llvm/lib/Target/AMDGPU/Utils/CMakeLists.txt --- a/llvm/lib/Target/AMDGPU/Utils/CMakeLists.txt +++ b/llvm/lib/Target/AMDGPU/Utils/CMakeLists.txt @@ -11,6 +11,7 @@ MC BinaryFormat Support + TargetParser ADD_TO_COMPONENT AMDGPU diff --git a/llvm/lib/Target/ARM/AsmParser/CMakeLists.txt b/llvm/lib/Target/ARM/AsmParser/CMakeLists.txt --- a/llvm/lib/Target/ARM/AsmParser/CMakeLists.txt +++ b/llvm/lib/Target/ARM/AsmParser/CMakeLists.txt @@ -7,6 +7,7 @@ MC MCParser Support + TargetParser ARMUtils ADD_TO_COMPONENT diff --git a/llvm/lib/Target/ARM/CMakeLists.txt b/llvm/lib/Target/ARM/CMakeLists.txt --- a/llvm/lib/Target/ARM/CMakeLists.txt +++ b/llvm/lib/Target/ARM/CMakeLists.txt @@ -82,6 +82,7 @@ SelectionDAG Support Target + TargetParser GlobalISel ARMUtils TransformUtils diff --git a/llvm/lib/Target/ARM/MCTargetDesc/CMakeLists.txt b/llvm/lib/Target/ARM/MCTargetDesc/CMakeLists.txt --- a/llvm/lib/Target/ARM/MCTargetDesc/CMakeLists.txt +++ b/llvm/lib/Target/ARM/MCTargetDesc/CMakeLists.txt @@ -21,6 +21,7 @@ MCDisassembler Support BinaryFormat + TargetParser ADD_TO_COMPONENT ARM diff --git a/llvm/lib/Target/AVR/MCTargetDesc/CMakeLists.txt b/llvm/lib/Target/AVR/MCTargetDesc/CMakeLists.txt --- a/llvm/lib/Target/AVR/MCTargetDesc/CMakeLists.txt +++ b/llvm/lib/Target/AVR/MCTargetDesc/CMakeLists.txt @@ -14,6 +14,7 @@ MC AVRInfo Support + TargetParser ADD_TO_COMPONENT AVR diff --git a/llvm/lib/Target/BPF/CMakeLists.txt b/llvm/lib/Target/BPF/CMakeLists.txt --- a/llvm/lib/Target/BPF/CMakeLists.txt +++ b/llvm/lib/Target/BPF/CMakeLists.txt @@ -48,6 +48,7 @@ SelectionDAG Support Target + TargetParser TransformUtils ADD_TO_COMPONENT diff --git a/llvm/lib/Target/BPF/MCTargetDesc/CMakeLists.txt b/llvm/lib/Target/BPF/MCTargetDesc/CMakeLists.txt --- a/llvm/lib/Target/BPF/MCTargetDesc/CMakeLists.txt +++ b/llvm/lib/Target/BPF/MCTargetDesc/CMakeLists.txt @@ -9,6 +9,7 @@ MC BPFInfo Support + TargetParser ADD_TO_COMPONENT BPF diff --git a/llvm/lib/Target/CMakeLists.txt b/llvm/lib/Target/CMakeLists.txt --- a/llvm/lib/Target/CMakeLists.txt +++ b/llvm/lib/Target/CMakeLists.txt @@ -17,6 +17,7 @@ Core MC Support + TargetParser ) # When building shared objects for each target there are some internal APIs diff --git a/llvm/lib/Target/CSKY/AsmParser/CMakeLists.txt b/llvm/lib/Target/CSKY/AsmParser/CMakeLists.txt --- a/llvm/lib/Target/CSKY/AsmParser/CMakeLists.txt +++ b/llvm/lib/Target/CSKY/AsmParser/CMakeLists.txt @@ -7,6 +7,7 @@ MC MCParser Support + TargetParser ADD_TO_COMPONENT CSKY diff --git a/llvm/lib/Target/CSKY/MCTargetDesc/CMakeLists.txt b/llvm/lib/Target/CSKY/MCTargetDesc/CMakeLists.txt --- a/llvm/lib/Target/CSKY/MCTargetDesc/CMakeLists.txt +++ b/llvm/lib/Target/CSKY/MCTargetDesc/CMakeLists.txt @@ -13,6 +13,7 @@ CSKYInfo MC Support + TargetParser ADD_TO_COMPONENT CSKY diff --git a/llvm/lib/Target/DirectX/CMakeLists.txt b/llvm/lib/Target/DirectX/CMakeLists.txt --- a/llvm/lib/Target/DirectX/CMakeLists.txt +++ b/llvm/lib/Target/DirectX/CMakeLists.txt @@ -35,6 +35,7 @@ CodeGen SelectionDAG Support + TargetParser DirectXDesc DirectXInfo DirectXPointerTypeAnalysis diff --git a/llvm/lib/Target/DirectX/DXILWriter/CMakeLists.txt b/llvm/lib/Target/DirectX/DXILWriter/CMakeLists.txt --- a/llvm/lib/Target/DirectX/DXILWriter/CMakeLists.txt +++ b/llvm/lib/Target/DirectX/DXILWriter/CMakeLists.txt @@ -16,5 +16,6 @@ MC Object Support + TargetParser TransformUtils ) diff --git a/llvm/lib/Target/DirectX/MCTargetDesc/CMakeLists.txt b/llvm/lib/Target/DirectX/MCTargetDesc/CMakeLists.txt --- a/llvm/lib/Target/DirectX/MCTargetDesc/CMakeLists.txt +++ b/llvm/lib/Target/DirectX/MCTargetDesc/CMakeLists.txt @@ -6,6 +6,7 @@ DirectXInfo MC Support + TargetParser ADD_TO_COMPONENT DirectX diff --git a/llvm/lib/Target/DirectX/TargetInfo/CMakeLists.txt b/llvm/lib/Target/DirectX/TargetInfo/CMakeLists.txt --- a/llvm/lib/Target/DirectX/TargetInfo/CMakeLists.txt +++ b/llvm/lib/Target/DirectX/TargetInfo/CMakeLists.txt @@ -4,6 +4,7 @@ LINK_COMPONENTS MC Support + TargetParser ADD_TO_COMPONENT DirectX diff --git a/llvm/lib/Target/Hexagon/CMakeLists.txt b/llvm/lib/Target/Hexagon/CMakeLists.txt --- a/llvm/lib/Target/Hexagon/CMakeLists.txt +++ b/llvm/lib/Target/Hexagon/CMakeLists.txt @@ -82,6 +82,7 @@ SelectionDAG Support Target + TargetParser TransformUtils ADD_TO_COMPONENT diff --git a/llvm/lib/Target/Lanai/CMakeLists.txt b/llvm/lib/Target/Lanai/CMakeLists.txt --- a/llvm/lib/Target/Lanai/CMakeLists.txt +++ b/llvm/lib/Target/Lanai/CMakeLists.txt @@ -42,6 +42,7 @@ SelectionDAG Support Target + TargetParser TransformUtils ADD_TO_COMPONENT diff --git a/llvm/lib/Target/Lanai/MCTargetDesc/CMakeLists.txt b/llvm/lib/Target/Lanai/MCTargetDesc/CMakeLists.txt --- a/llvm/lib/Target/Lanai/MCTargetDesc/CMakeLists.txt +++ b/llvm/lib/Target/Lanai/MCTargetDesc/CMakeLists.txt @@ -12,6 +12,7 @@ MC MCDisassembler Support + TargetParser ADD_TO_COMPONENT Lanai diff --git a/llvm/lib/Target/LoongArch/MCTargetDesc/CMakeLists.txt b/llvm/lib/Target/LoongArch/MCTargetDesc/CMakeLists.txt --- a/llvm/lib/Target/LoongArch/MCTargetDesc/CMakeLists.txt +++ b/llvm/lib/Target/LoongArch/MCTargetDesc/CMakeLists.txt @@ -15,6 +15,7 @@ MC LoongArchInfo Support + TargetParser ADD_TO_COMPONENT LoongArch diff --git a/llvm/lib/Target/M68k/MCTargetDesc/CMakeLists.txt b/llvm/lib/Target/M68k/MCTargetDesc/CMakeLists.txt --- a/llvm/lib/Target/M68k/MCTargetDesc/CMakeLists.txt +++ b/llvm/lib/Target/M68k/MCTargetDesc/CMakeLists.txt @@ -10,6 +10,7 @@ MC MCDisassembler Support + TargetParser M68kInfo ADD_TO_COMPONENT diff --git a/llvm/lib/Target/Mips/AsmParser/CMakeLists.txt b/llvm/lib/Target/Mips/AsmParser/CMakeLists.txt --- a/llvm/lib/Target/Mips/AsmParser/CMakeLists.txt +++ b/llvm/lib/Target/Mips/AsmParser/CMakeLists.txt @@ -7,6 +7,7 @@ MipsDesc MipsInfo Support + TargetParser ADD_TO_COMPONENT Mips diff --git a/llvm/lib/Target/Mips/CMakeLists.txt b/llvm/lib/Target/Mips/CMakeLists.txt --- a/llvm/lib/Target/Mips/CMakeLists.txt +++ b/llvm/lib/Target/Mips/CMakeLists.txt @@ -76,6 +76,7 @@ SelectionDAG Support Target + TargetParser GlobalISel ADD_TO_COMPONENT diff --git a/llvm/lib/Target/Mips/MCTargetDesc/CMakeLists.txt b/llvm/lib/Target/Mips/MCTargetDesc/CMakeLists.txt --- a/llvm/lib/Target/Mips/MCTargetDesc/CMakeLists.txt +++ b/llvm/lib/Target/Mips/MCTargetDesc/CMakeLists.txt @@ -17,6 +17,7 @@ MC MipsInfo Support + TargetParser ADD_TO_COMPONENT Mips diff --git a/llvm/lib/Target/NVPTX/CMakeLists.txt b/llvm/lib/Target/NVPTX/CMakeLists.txt --- a/llvm/lib/Target/NVPTX/CMakeLists.txt +++ b/llvm/lib/Target/NVPTX/CMakeLists.txt @@ -54,6 +54,7 @@ SelectionDAG Support Target + TargetParser TransformUtils Vectorize diff --git a/llvm/lib/Target/NVPTX/MCTargetDesc/CMakeLists.txt b/llvm/lib/Target/NVPTX/MCTargetDesc/CMakeLists.txt --- a/llvm/lib/Target/NVPTX/MCTargetDesc/CMakeLists.txt +++ b/llvm/lib/Target/NVPTX/MCTargetDesc/CMakeLists.txt @@ -8,6 +8,7 @@ MC NVPTXInfo Support + TargetParser ADD_TO_COMPONENT NVPTX diff --git a/llvm/lib/Target/PowerPC/CMakeLists.txt b/llvm/lib/Target/PowerPC/CMakeLists.txt --- a/llvm/lib/Target/PowerPC/CMakeLists.txt +++ b/llvm/lib/Target/PowerPC/CMakeLists.txt @@ -74,6 +74,7 @@ SelectionDAG Support Target + TargetParser TransformUtils GlobalISel diff --git a/llvm/lib/Target/PowerPC/MCTargetDesc/CMakeLists.txt b/llvm/lib/Target/PowerPC/MCTargetDesc/CMakeLists.txt --- a/llvm/lib/Target/PowerPC/MCTargetDesc/CMakeLists.txt +++ b/llvm/lib/Target/PowerPC/MCTargetDesc/CMakeLists.txt @@ -16,6 +16,7 @@ PowerPCInfo Support BinaryFormat + TargetParser ADD_TO_COMPONENT PowerPC diff --git a/llvm/lib/Target/RISCV/AsmParser/CMakeLists.txt b/llvm/lib/Target/RISCV/AsmParser/CMakeLists.txt --- a/llvm/lib/Target/RISCV/AsmParser/CMakeLists.txt +++ b/llvm/lib/Target/RISCV/AsmParser/CMakeLists.txt @@ -7,6 +7,7 @@ RISCVDesc RISCVInfo Support + TargetParser ADD_TO_COMPONENT RISCV diff --git a/llvm/lib/Target/RISCV/CMakeLists.txt b/llvm/lib/Target/RISCV/CMakeLists.txt --- a/llvm/lib/Target/RISCV/CMakeLists.txt +++ b/llvm/lib/Target/RISCV/CMakeLists.txt @@ -58,6 +58,7 @@ SelectionDAG Support Target + TargetParser TransformUtils GlobalISel diff --git a/llvm/lib/Target/RISCV/MCTargetDesc/CMakeLists.txt b/llvm/lib/Target/RISCV/MCTargetDesc/CMakeLists.txt --- a/llvm/lib/Target/RISCV/MCTargetDesc/CMakeLists.txt +++ b/llvm/lib/Target/RISCV/MCTargetDesc/CMakeLists.txt @@ -16,6 +16,7 @@ MC RISCVInfo Support + TargetParser ADD_TO_COMPONENT RISCV diff --git a/llvm/lib/Target/SPIRV/CMakeLists.txt b/llvm/lib/Target/SPIRV/CMakeLists.txt --- a/llvm/lib/Target/SPIRV/CMakeLists.txt +++ b/llvm/lib/Target/SPIRV/CMakeLists.txt @@ -48,6 +48,7 @@ SelectionDAG Support Target + TargetParser TransformUtils ADD_TO_COMPONENT diff --git a/llvm/lib/Target/SPIRV/MCTargetDesc/CMakeLists.txt b/llvm/lib/Target/SPIRV/MCTargetDesc/CMakeLists.txt --- a/llvm/lib/Target/SPIRV/MCTargetDesc/CMakeLists.txt +++ b/llvm/lib/Target/SPIRV/MCTargetDesc/CMakeLists.txt @@ -12,6 +12,7 @@ MC SPIRVInfo Support + TargetParser ADD_TO_COMPONENT SPIRV diff --git a/llvm/lib/Target/Sparc/AsmParser/CMakeLists.txt b/llvm/lib/Target/Sparc/AsmParser/CMakeLists.txt --- a/llvm/lib/Target/Sparc/AsmParser/CMakeLists.txt +++ b/llvm/lib/Target/Sparc/AsmParser/CMakeLists.txt @@ -7,6 +7,7 @@ SparcDesc SparcInfo Support + TargetParser ADD_TO_COMPONENT Sparc diff --git a/llvm/lib/Target/Sparc/CMakeLists.txt b/llvm/lib/Target/Sparc/CMakeLists.txt --- a/llvm/lib/Target/Sparc/CMakeLists.txt +++ b/llvm/lib/Target/Sparc/CMakeLists.txt @@ -39,6 +39,7 @@ SparcInfo Support Target + TargetParser ADD_TO_COMPONENT Sparc diff --git a/llvm/lib/Target/Sparc/MCTargetDesc/CMakeLists.txt b/llvm/lib/Target/Sparc/MCTargetDesc/CMakeLists.txt --- a/llvm/lib/Target/Sparc/MCTargetDesc/CMakeLists.txt +++ b/llvm/lib/Target/Sparc/MCTargetDesc/CMakeLists.txt @@ -12,6 +12,7 @@ MC SparcInfo Support + TargetParser ADD_TO_COMPONENT Sparc diff --git a/llvm/lib/Target/SystemZ/CMakeLists.txt b/llvm/lib/Target/SystemZ/CMakeLists.txt --- a/llvm/lib/Target/SystemZ/CMakeLists.txt +++ b/llvm/lib/Target/SystemZ/CMakeLists.txt @@ -51,6 +51,7 @@ SystemZDesc SystemZInfo Target + TargetParser ADD_TO_COMPONENT SystemZ diff --git a/llvm/lib/Target/VE/MCTargetDesc/CMakeLists.txt b/llvm/lib/Target/VE/MCTargetDesc/CMakeLists.txt --- a/llvm/lib/Target/VE/MCTargetDesc/CMakeLists.txt +++ b/llvm/lib/Target/VE/MCTargetDesc/CMakeLists.txt @@ -12,6 +12,7 @@ MC VEInfo Support + TargetParser ADD_TO_COMPONENT VE diff --git a/llvm/lib/Target/WebAssembly/AsmParser/CMakeLists.txt b/llvm/lib/Target/WebAssembly/AsmParser/CMakeLists.txt --- a/llvm/lib/Target/WebAssembly/AsmParser/CMakeLists.txt +++ b/llvm/lib/Target/WebAssembly/AsmParser/CMakeLists.txt @@ -8,6 +8,7 @@ WebAssemblyInfo WebAssemblyUtils Support + TargetParser ADD_TO_COMPONENT WebAssembly diff --git a/llvm/lib/Target/WebAssembly/CMakeLists.txt b/llvm/lib/Target/WebAssembly/CMakeLists.txt --- a/llvm/lib/Target/WebAssembly/CMakeLists.txt +++ b/llvm/lib/Target/WebAssembly/CMakeLists.txt @@ -72,6 +72,7 @@ SelectionDAG Support Target + TargetParser TransformUtils WebAssemblyDesc WebAssemblyInfo diff --git a/llvm/lib/Target/WebAssembly/MCTargetDesc/CMakeLists.txt b/llvm/lib/Target/WebAssembly/MCTargetDesc/CMakeLists.txt --- a/llvm/lib/Target/WebAssembly/MCTargetDesc/CMakeLists.txt +++ b/llvm/lib/Target/WebAssembly/MCTargetDesc/CMakeLists.txt @@ -10,6 +10,7 @@ LINK_COMPONENTS MC Support + TargetParser WebAssemblyInfo WebAssemblyUtils diff --git a/llvm/lib/Target/X86/CMakeLists.txt b/llvm/lib/Target/X86/CMakeLists.txt --- a/llvm/lib/Target/X86/CMakeLists.txt +++ b/llvm/lib/Target/X86/CMakeLists.txt @@ -101,6 +101,7 @@ SelectionDAG Support Target + TargetParser TransformUtils X86Desc X86Info diff --git a/llvm/lib/Target/X86/MCA/CMakeLists.txt b/llvm/lib/Target/X86/MCA/CMakeLists.txt --- a/llvm/lib/Target/X86/MCA/CMakeLists.txt +++ b/llvm/lib/Target/X86/MCA/CMakeLists.txt @@ -7,6 +7,7 @@ X86Desc X86Info Support + TargetParser MCA ADD_TO_COMPONENT diff --git a/llvm/lib/Target/X86/MCTargetDesc/CMakeLists.txt b/llvm/lib/Target/X86/MCTargetDesc/CMakeLists.txt --- a/llvm/lib/Target/X86/MCTargetDesc/CMakeLists.txt +++ b/llvm/lib/Target/X86/MCTargetDesc/CMakeLists.txt @@ -20,6 +20,7 @@ MC MCDisassembler Support + TargetParser X86Info BinaryFormat diff --git a/llvm/lib/Target/XCore/CMakeLists.txt b/llvm/lib/Target/XCore/CMakeLists.txt --- a/llvm/lib/Target/XCore/CMakeLists.txt +++ b/llvm/lib/Target/XCore/CMakeLists.txt @@ -37,6 +37,7 @@ SelectionDAG Support Target + TargetParser TransformUtils XCoreDesc XCoreInfo diff --git a/llvm/lib/Support/AArch64TargetParser.cpp b/llvm/lib/TargetParser/AArch64TargetParser.cpp rename from llvm/lib/Support/AArch64TargetParser.cpp rename to llvm/lib/TargetParser/AArch64TargetParser.cpp --- a/llvm/lib/Support/AArch64TargetParser.cpp +++ b/llvm/lib/TargetParser/AArch64TargetParser.cpp @@ -11,10 +11,10 @@ // //===----------------------------------------------------------------------===// -#include "llvm/Support/AArch64TargetParser.h" +#include "llvm/TargetParser/AArch64TargetParser.h" #include "llvm/ADT/StringSwitch.h" -#include "llvm/ADT/Triple.h" -#include "llvm/Support/ARMTargetParserCommon.h" +#include "llvm/TargetParser/ARMTargetParserCommon.h" +#include "llvm/TargetParser/Triple.h" #include using namespace llvm; @@ -34,7 +34,7 @@ .Case(NAME, AArch64ARCHNames[static_cast(ArchKind::ID)] \ .ArchBaseExtensions | \ DEFAULT_EXT) -#include "../../include/llvm/Support/AArch64TargetParser.def" +#include "../../include/llvm/TargetParser/AArch64TargetParser.def" .Default(AArch64::AEK_INVALID); } @@ -44,7 +44,7 @@ return StringSwitch(CPU) #define AARCH64_CPU_NAME(NAME, ID, DEFAULT_EXT) .Case(NAME, ArchKind::ID) -#include "../../include/llvm/Support/AArch64TargetParser.def" +#include "../../include/llvm/TargetParser/AArch64TargetParser.def" .Default(ArchKind::INVALID); } @@ -67,7 +67,7 @@ if (feature) \ Features.push_back(feature); \ } -#include "../../include/llvm/Support/AArch64TargetParser.def" +#include "llvm/TargetParser/AArch64TargetParser.def" return true; } @@ -75,7 +75,7 @@ StringRef AArch64::resolveCPUAlias(StringRef CPU) { return StringSwitch(CPU) #define AARCH64_CPU_ALIAS(ALIAS, NAME) .Case(ALIAS, NAME) -#include "../../include/llvm/Support/AArch64TargetParser.def" +#include "../../include/llvm/TargetParser/AArch64TargetParser.def" .Default(CPU); } diff --git a/llvm/lib/Support/ARMTargetParser.cpp b/llvm/lib/TargetParser/ARMTargetParser.cpp rename from llvm/lib/Support/ARMTargetParser.cpp rename to llvm/lib/TargetParser/ARMTargetParser.cpp --- a/llvm/lib/Support/ARMTargetParser.cpp +++ b/llvm/lib/TargetParser/ARMTargetParser.cpp @@ -11,10 +11,10 @@ // //===----------------------------------------------------------------------===// -#include "llvm/Support/ARMTargetParser.h" +#include "llvm/TargetParser/ARMTargetParser.h" #include "llvm/ADT/StringSwitch.h" -#include "llvm/ADT/Triple.h" -#include "llvm/Support/ARMTargetParserCommon.h" +#include "llvm/TargetParser/ARMTargetParserCommon.h" +#include "llvm/TargetParser/Triple.h" #include using namespace llvm; @@ -268,7 +268,7 @@ return StringSwitch(CPU) #define ARM_CPU_NAME(NAME, ID, DEFAULT_FPU, IS_DEFAULT, DEFAULT_EXT) \ .Case(NAME, DEFAULT_FPU) -#include "llvm/Support/ARMTargetParser.def" +#include "llvm/TargetParser/ARMTargetParser.def" .Default(ARM::FK_INVALID); } @@ -281,7 +281,7 @@ .Case(NAME, \ ARMArchNames[static_cast(ArchKind::ID)].ArchBaseExtensions | \ DEFAULT_EXT) -#include "llvm/Support/ARMTargetParser.def" +#include "llvm/TargetParser/ARMTargetParser.def" .Default(ARM::AEK_INVALID); } diff --git a/llvm/lib/Support/ARMTargetParserCommon.cpp b/llvm/lib/TargetParser/ARMTargetParserCommon.cpp rename from llvm/lib/Support/ARMTargetParserCommon.cpp rename to llvm/lib/TargetParser/ARMTargetParserCommon.cpp --- a/llvm/lib/Support/ARMTargetParserCommon.cpp +++ b/llvm/lib/TargetParser/ARMTargetParserCommon.cpp @@ -10,7 +10,7 @@ // //===----------------------------------------------------------------------===// -#include "llvm/Support/ARMTargetParserCommon.h" +#include "llvm/TargetParser/ARMTargetParserCommon.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringSwitch.h" diff --git a/llvm/lib/TargetParser/CMakeLists.txt b/llvm/lib/TargetParser/CMakeLists.txt new file mode 100644 --- /dev/null +++ b/llvm/lib/TargetParser/CMakeLists.txt @@ -0,0 +1,20 @@ + +add_llvm_component_library(LLVMTargetParser + AArch64TargetParser.cpp + ARMTargetParserCommon.cpp + ARMTargetParser.cpp + CSKYTargetParser.cpp + Host.cpp + LoongArchTargetParser.cpp + RISCVISAInfo.cpp + TargetParser.cpp + Triple.cpp + X86TargetParser.cpp + + ADDITIONAL_HEADER_DIRS + Unix + Windows + + LINK_COMPONENTS + Support + ) diff --git a/llvm/lib/Support/CSKYTargetParser.cpp b/llvm/lib/TargetParser/CSKYTargetParser.cpp rename from llvm/lib/Support/CSKYTargetParser.cpp rename to llvm/lib/TargetParser/CSKYTargetParser.cpp --- a/llvm/lib/Support/CSKYTargetParser.cpp +++ b/llvm/lib/TargetParser/CSKYTargetParser.cpp @@ -12,7 +12,7 @@ // //===----------------------------------------------------------------------===// -#include "llvm/Support/CSKYTargetParser.h" +#include "llvm/TargetParser/CSKYTargetParser.h" #include "llvm/ADT/StringSwitch.h" using namespace llvm; @@ -138,7 +138,7 @@ #define CSKY_CPU_NAME(NAME, ID, DEFAULT_EXT) \ .Case(NAME, ARCHNames[static_cast(ArchKind::ID)].archBaseExt | \ DEFAULT_EXT) -#include "llvm/Support/CSKYTargetParser.def" +#include "llvm/TargetParser/CSKYTargetParser.def" .Default(CSKY::AEK_INVALID); } diff --git a/llvm/lib/Support/Host.cpp b/llvm/lib/TargetParser/Host.cpp rename from llvm/lib/Support/Host.cpp rename to llvm/lib/TargetParser/Host.cpp --- a/llvm/lib/Support/Host.cpp +++ b/llvm/lib/TargetParser/Host.cpp @@ -1,4 +1,4 @@ -//===-- Host.cpp - Implement OS Host Concept --------------------*- C++ -*-===// +//===-- Host.cpp - Implement OS Host Detection ------------------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -6,20 +6,20 @@ // //===----------------------------------------------------------------------===// // -// This file implements the operating system Host concept. +// This file implements the operating system Host detection. // //===----------------------------------------------------------------------===// -#include "llvm/Support/Host.h" +#include "llvm/TargetParser/Host.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringMap.h" #include "llvm/ADT/StringRef.h" #include "llvm/ADT/StringSwitch.h" -#include "llvm/ADT/Triple.h" #include "llvm/Config/llvm-config.h" #include "llvm/Support/MemoryBuffer.h" -#include "llvm/Support/X86TargetParser.h" #include "llvm/Support/raw_ostream.h" +#include "llvm/TargetParser/Triple.h" +#include "llvm/TargetParser/X86TargetParser.h" #include // Include the platform-specific parts of this class. diff --git a/llvm/lib/Support/LoongArchTargetParser.cpp b/llvm/lib/TargetParser/LoongArchTargetParser.cpp rename from llvm/lib/Support/LoongArchTargetParser.cpp rename to llvm/lib/TargetParser/LoongArchTargetParser.cpp --- a/llvm/lib/Support/LoongArchTargetParser.cpp +++ b/llvm/lib/TargetParser/LoongArchTargetParser.cpp @@ -11,20 +11,20 @@ // //===----------------------------------------------------------------------===// -#include "llvm/Support/LoongArchTargetParser.h" +#include "llvm/TargetParser/LoongArchTargetParser.h" using namespace llvm; using namespace llvm::LoongArch; const FeatureInfo AllFeatures[] = { #define LOONGARCH_FEATURE(NAME, KIND) {NAME, KIND}, -#include "llvm/Support/LoongArchTargetParser.def" +#include "llvm/TargetParser/LoongArchTargetParser.def" }; const ArchInfo AllArchs[] = { #define LOONGARCH_ARCH(NAME, KIND, FEATURES) \ {NAME, LoongArch::ArchKind::KIND, FEATURES}, -#include "llvm/Support/LoongArchTargetParser.def" +#include "llvm/TargetParser/LoongArchTargetParser.def" }; LoongArch::ArchKind LoongArch::parseArch(StringRef Arch) { diff --git a/llvm/lib/Support/RISCVISAInfo.cpp b/llvm/lib/TargetParser/RISCVISAInfo.cpp rename from llvm/lib/Support/RISCVISAInfo.cpp rename to llvm/lib/TargetParser/RISCVISAInfo.cpp --- a/llvm/lib/Support/RISCVISAInfo.cpp +++ b/llvm/lib/TargetParser/RISCVISAInfo.cpp @@ -1,4 +1,4 @@ -//===-- RISCVISAInfo.cpp - RISCV Arch String Parser --------------===// +//===-- RISCVISAInfo.cpp - RISCV Arch String Parser -------------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -#include "llvm/Support/RISCVISAInfo.h" +#include "llvm/TargetParser/RISCVISAInfo.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/SetVector.h" #include "llvm/ADT/StringExtras.h" diff --git a/llvm/lib/Support/TargetParser.cpp b/llvm/lib/TargetParser/TargetParser.cpp rename from llvm/lib/Support/TargetParser.cpp rename to llvm/lib/TargetParser/TargetParser.cpp --- a/llvm/lib/Support/TargetParser.cpp +++ b/llvm/lib/TargetParser/TargetParser.cpp @@ -11,10 +11,10 @@ // //===----------------------------------------------------------------------===// -#include "llvm/Support/TargetParser.h" +#include "llvm/TargetParser/TargetParser.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/StringSwitch.h" -#include "llvm/ADT/Triple.h" +#include "llvm/TargetParser/Triple.h" using namespace llvm; using namespace AMDGPU; @@ -266,7 +266,7 @@ constexpr CPUInfo RISCVCPUInfo[] = { #define PROC(ENUM, NAME, FEATURES, DEFAULT_MARCH) \ {NAME, CK_##ENUM, FEATURES, DEFAULT_MARCH}, -#include "llvm/Support/RISCVTargetParser.def" +#include "llvm/TargetParser/RISCVTargetParser.def" }; bool checkCPUKind(CPUKind Kind, bool IsRV64) { @@ -279,14 +279,14 @@ if (Kind == CK_INVALID) return false; #define TUNE_PROC(ENUM, NAME) if (Kind == CK_##ENUM) return true; -#include "llvm/Support/RISCVTargetParser.def" +#include "llvm/TargetParser/RISCVTargetParser.def" return RISCVCPUInfo[static_cast(Kind)].is64Bit() == IsRV64; } CPUKind parseCPUKind(StringRef CPU) { return llvm::StringSwitch(CPU) #define PROC(ENUM, NAME, FEATURES, DEFAULT_MARCH) .Case(NAME, CK_##ENUM) -#include "llvm/Support/RISCVTargetParser.def" +#include "llvm/TargetParser/RISCVTargetParser.def" .Default(CK_INVALID); } @@ -294,7 +294,7 @@ return llvm::StringSwitch(TuneCPU) #define PROC(ENUM, NAME, FEATURES, DEFAULT_MARCH) .Case(NAME, CK_##ENUM) #define TUNE_PROC(ENUM, NAME) .Case(NAME, CK_##ENUM) -#include "llvm/Support/RISCVTargetParser.def" +#include "llvm/TargetParser/RISCVTargetParser.def" .Default(CK_INVALID); } @@ -316,7 +316,7 @@ Values.emplace_back(C.Name); } #define TUNE_PROC(ENUM, NAME) Values.emplace_back(StringRef(NAME)); -#include "llvm/Support/RISCVTargetParser.def" +#include "llvm/TargetParser/RISCVTargetParser.def" } // Get all features except standard extension feature diff --git a/llvm/lib/Support/Triple.cpp b/llvm/lib/TargetParser/Triple.cpp rename from llvm/lib/Support/Triple.cpp rename to llvm/lib/TargetParser/Triple.cpp --- a/llvm/lib/Support/Triple.cpp +++ b/llvm/lib/TargetParser/Triple.cpp @@ -6,16 +6,16 @@ // //===----------------------------------------------------------------------===// -#include "llvm/ADT/Triple.h" +#include "llvm/TargetParser/Triple.h" #include "llvm/ADT/SmallString.h" #include "llvm/ADT/StringExtras.h" #include "llvm/ADT/StringSwitch.h" -#include "llvm/Support/ARMTargetParser.h" -#include "llvm/Support/ARMTargetParserCommon.h" #include "llvm/Support/ErrorHandling.h" -#include "llvm/Support/Host.h" #include "llvm/Support/SwapByteOrder.h" #include "llvm/Support/VersionTuple.h" +#include "llvm/TargetParser/ARMTargetParser.h" +#include "llvm/TargetParser/ARMTargetParserCommon.h" +#include "llvm/TargetParser/Host.h" #include #include using namespace llvm; diff --git a/llvm/lib/Support/Unix/Host.inc b/llvm/lib/TargetParser/Unix/Host.inc rename from llvm/lib/Support/Unix/Host.inc rename to llvm/lib/TargetParser/Unix/Host.inc --- a/llvm/lib/Support/Unix/Host.inc +++ b/llvm/lib/TargetParser/Unix/Host.inc @@ -1,4 +1,4 @@ -//===- llvm/Support/Unix/Host.inc -------------------------------*- C++ -*-===// +//===- llvm/TargetParser/Unix/Host.inc --------------------------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -15,13 +15,16 @@ //=== is guaranteed to work on *all* UNIX variants. //===----------------------------------------------------------------------===// -#include "Unix.h" #include "llvm/ADT/StringRef.h" #include "llvm/Config/config.h" #include #include #include +#ifdef HAVE_UNISTD_H +#include +#endif + using namespace llvm; static std::string getOSVersion() { diff --git a/llvm/lib/Support/Windows/Host.inc b/llvm/lib/TargetParser/Windows/Host.inc rename from llvm/lib/Support/Windows/Host.inc rename to llvm/lib/TargetParser/Windows/Host.inc --- a/llvm/lib/Support/Windows/Host.inc +++ b/llvm/lib/TargetParser/Windows/Host.inc @@ -1,4 +1,4 @@ -//===- llvm/Support/Win32/Host.inc ------------------------------*- C++ -*-===// +//===- llvm/TargetParser/Win32/Host.inc -------------------------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. diff --git a/llvm/lib/Support/X86TargetParser.cpp b/llvm/lib/TargetParser/X86TargetParser.cpp rename from llvm/lib/Support/X86TargetParser.cpp rename to llvm/lib/TargetParser/X86TargetParser.cpp --- a/llvm/lib/Support/X86TargetParser.cpp +++ b/llvm/lib/TargetParser/X86TargetParser.cpp @@ -10,7 +10,7 @@ // //===----------------------------------------------------------------------===// -#include "llvm/Support/X86TargetParser.h" +#include "llvm/TargetParser/X86TargetParser.h" #include "llvm/ADT/StringSwitch.h" #include @@ -118,7 +118,7 @@ #define X86_FEATURE(ENUM, STRING) \ constexpr FeatureBitset Feature##ENUM = {X86::FEATURE_##ENUM}; -#include "llvm/Support/X86TargetParser.def" +#include "llvm/TargetParser/X86TargetParser.def" // Pentium with MMX. constexpr FeatureBitset FeaturesPentiumMMX = @@ -616,7 +616,7 @@ constexpr FeatureInfo FeatureInfos[X86::CPU_FEATURE_MAX] = { #define X86_FEATURE(ENUM, STR) {{STR}, ImpliedFeatures##ENUM}, -#include "llvm/Support/X86TargetParser.def" +#include "llvm/TargetParser/X86TargetParser.def" }; void llvm::X86::getFeaturesForCPU(StringRef CPU, @@ -699,7 +699,7 @@ unsigned Feature = StringSwitch(FeatureStr) #define X86_FEATURE_COMPAT(ENUM, STR, PRIORITY) \ .Case(STR, llvm::X86::FEATURE_##ENUM) -#include "llvm/Support/X86TargetParser.def" +#include "llvm/TargetParser/X86TargetParser.def" ; FeaturesMask |= (1ULL << Feature); } @@ -713,7 +713,7 @@ // starting from zero (0, 1, ..., num_features - 1). #define X86_FEATURE_COMPAT(ENUM, STR, PRIORITY) PRIORITY, unsigned Priorities[] = { -#include "llvm/Support/X86TargetParser.def" +#include "llvm/TargetParser/X86TargetParser.def" std::numeric_limits::max() // Need to consume last comma. }; std::array HelperList; @@ -728,7 +728,7 @@ #define X86_FEATURE_COMPAT(ENUM, STR, PRIORITY) \ case X86::FEATURE_##ENUM: \ return PRIORITY; -#include "llvm/Support/X86TargetParser.def" +#include "llvm/TargetParser/X86TargetParser.def" default: llvm_unreachable("No Feature Priority for non-CPUSupports Features"); } diff --git a/llvm/lib/TextAPI/CMakeLists.txt b/llvm/lib/TextAPI/CMakeLists.txt --- a/llvm/lib/TextAPI/CMakeLists.txt +++ b/llvm/lib/TextAPI/CMakeLists.txt @@ -15,4 +15,5 @@ LINK_COMPONENTS Support BinaryFormat + TargetParser ) diff --git a/llvm/lib/ToolDrivers/llvm-dlltool/CMakeLists.txt b/llvm/lib/ToolDrivers/llvm-dlltool/CMakeLists.txt --- a/llvm/lib/ToolDrivers/llvm-dlltool/CMakeLists.txt +++ b/llvm/lib/ToolDrivers/llvm-dlltool/CMakeLists.txt @@ -9,6 +9,7 @@ Object Option Support + TargetParser ) add_dependencies(LLVMDlltoolDriver DllOptionsTableGen) diff --git a/llvm/lib/ToolDrivers/llvm-lib/CMakeLists.txt b/llvm/lib/ToolDrivers/llvm-lib/CMakeLists.txt --- a/llvm/lib/ToolDrivers/llvm-lib/CMakeLists.txt +++ b/llvm/lib/ToolDrivers/llvm-lib/CMakeLists.txt @@ -22,5 +22,6 @@ Object Option Support + TargetParser ) add_dependencies(LLVMLibDriver LibOptionsTableGen) diff --git a/llvm/lib/Transforms/CFGuard/CMakeLists.txt b/llvm/lib/Transforms/CFGuard/CMakeLists.txt --- a/llvm/lib/Transforms/CFGuard/CMakeLists.txt +++ b/llvm/lib/Transforms/CFGuard/CMakeLists.txt @@ -10,4 +10,5 @@ LINK_COMPONENTS Core Support + TargetParser ) diff --git a/llvm/lib/Transforms/IPO/CMakeLists.txt b/llvm/lib/Transforms/IPO/CMakeLists.txt --- a/llvm/lib/Transforms/IPO/CMakeLists.txt +++ b/llvm/lib/Transforms/IPO/CMakeLists.txt @@ -68,6 +68,7 @@ ProfileData Scalar Support + TargetParser TransformUtils Vectorize Instrumentation diff --git a/llvm/lib/Transforms/Instrumentation/CMakeLists.txt b/llvm/lib/Transforms/Instrumentation/CMakeLists.txt --- a/llvm/lib/Transforms/Instrumentation/CMakeLists.txt +++ b/llvm/lib/Transforms/Instrumentation/CMakeLists.txt @@ -33,6 +33,7 @@ Demangle MC Support + TargetParser TransformUtils ProfileData ) diff --git a/llvm/lib/Transforms/Utils/CMakeLists.txt b/llvm/lib/Transforms/Utils/CMakeLists.txt --- a/llvm/lib/Transforms/Utils/CMakeLists.txt +++ b/llvm/lib/Transforms/Utils/CMakeLists.txt @@ -92,4 +92,5 @@ Analysis Core Support + TargetParser ) diff --git a/llvm/lib/WindowsDriver/CMakeLists.txt b/llvm/lib/WindowsDriver/CMakeLists.txt --- a/llvm/lib/WindowsDriver/CMakeLists.txt +++ b/llvm/lib/WindowsDriver/CMakeLists.txt @@ -10,4 +10,5 @@ LINK_COMPONENTS Option Support + TargetParser ) diff --git a/llvm/lib/XRay/CMakeLists.txt b/llvm/lib/XRay/CMakeLists.txt --- a/llvm/lib/XRay/CMakeLists.txt +++ b/llvm/lib/XRay/CMakeLists.txt @@ -21,4 +21,5 @@ LINK_COMPONENTS Support Object + TargetParser ) diff --git a/llvm/tools/bugpoint/CMakeLists.txt b/llvm/tools/bugpoint/CMakeLists.txt --- a/llvm/tools/bugpoint/CMakeLists.txt +++ b/llvm/tools/bugpoint/CMakeLists.txt @@ -18,6 +18,7 @@ ScalarOpts Support Target + TargetParser TransformUtils Vectorize ) diff --git a/llvm/tools/dsymutil/CMakeLists.txt b/llvm/tools/dsymutil/CMakeLists.txt --- a/llvm/tools/dsymutil/CMakeLists.txt +++ b/llvm/tools/dsymutil/CMakeLists.txt @@ -16,6 +16,7 @@ Remarks Support Target + TargetParser ) add_llvm_tool(dsymutil diff --git a/llvm/tools/gold/CMakeLists.txt b/llvm/tools/gold/CMakeLists.txt --- a/llvm/tools/gold/CMakeLists.txt +++ b/llvm/tools/gold/CMakeLists.txt @@ -9,6 +9,7 @@ LTO BitWriter IPO + TargetParser ) add_llvm_library(LLVMgold MODULE diff --git a/llvm/tools/llc/CMakeLists.txt b/llvm/tools/llc/CMakeLists.txt --- a/llvm/tools/llc/CMakeLists.txt +++ b/llvm/tools/llc/CMakeLists.txt @@ -16,6 +16,7 @@ SelectionDAG Support Target + TargetParser TransformUtils Vectorize ) diff --git a/llvm/tools/lli/CMakeLists.txt b/llvm/tools/lli/CMakeLists.txt --- a/llvm/tools/lli/CMakeLists.txt +++ b/llvm/tools/lli/CMakeLists.txt @@ -20,6 +20,7 @@ SelectionDAG Support Target + TargetParser TransformUtils native ) diff --git a/llvm/tools/llvm-ar/CMakeLists.txt b/llvm/tools/llvm-ar/CMakeLists.txt --- a/llvm/tools/llvm-ar/CMakeLists.txt +++ b/llvm/tools/llvm-ar/CMakeLists.txt @@ -8,6 +8,7 @@ LibDriver Object Support + TargetParser TextAPI ) diff --git a/llvm/tools/llvm-cfi-verify/lib/CMakeLists.txt b/llvm/tools/llvm-cfi-verify/lib/CMakeLists.txt --- a/llvm/tools/llvm-cfi-verify/lib/CMakeLists.txt +++ b/llvm/tools/llvm-cfi-verify/lib/CMakeLists.txt @@ -5,6 +5,7 @@ Object Support Symbolize + TargetParser ) add_llvm_library(LLVMCFIVerify diff --git a/llvm/tools/llvm-config/CMakeLists.txt b/llvm/tools/llvm-config/CMakeLists.txt --- a/llvm/tools/llvm-config/CMakeLists.txt +++ b/llvm/tools/llvm-config/CMakeLists.txt @@ -1,4 +1,7 @@ -set(LLVM_LINK_COMPONENTS support) +set(LLVM_LINK_COMPONENTS + Support + TargetParser + ) set(BUILDVARIABLES_SRCPATH ${CMAKE_CURRENT_SOURCE_DIR}/BuildVariables.inc.in) set(BUILDVARIABLES_OBJPATH ${CMAKE_CURRENT_BINARY_DIR}/BuildVariables.inc) diff --git a/llvm/tools/llvm-cov/CMakeLists.txt b/llvm/tools/llvm-cov/CMakeLists.txt --- a/llvm/tools/llvm-cov/CMakeLists.txt +++ b/llvm/tools/llvm-cov/CMakeLists.txt @@ -1,4 +1,11 @@ -set(LLVM_LINK_COMPONENTS core support object coverage profiledata) +set(LLVM_LINK_COMPONENTS + Core + Support + Object + Coverage + ProfileData + TargetParser + ) add_llvm_tool(llvm-cov llvm-cov.cpp diff --git a/llvm/tools/llvm-cxxfilt/CMakeLists.txt b/llvm/tools/llvm-cxxfilt/CMakeLists.txt --- a/llvm/tools/llvm-cxxfilt/CMakeLists.txt +++ b/llvm/tools/llvm-cxxfilt/CMakeLists.txt @@ -2,6 +2,7 @@ Demangle Option Support + TargetParser ) set(LLVM_TARGET_DEFINITIONS Opts.td) diff --git a/llvm/tools/llvm-dwarfdump/CMakeLists.txt b/llvm/tools/llvm-dwarfdump/CMakeLists.txt --- a/llvm/tools/llvm-dwarfdump/CMakeLists.txt +++ b/llvm/tools/llvm-dwarfdump/CMakeLists.txt @@ -5,6 +5,7 @@ MC Object Support + TargetParser ) add_llvm_tool(llvm-dwarfdump diff --git a/llvm/tools/llvm-dwarfutil/CMakeLists.txt b/llvm/tools/llvm-dwarfutil/CMakeLists.txt --- a/llvm/tools/llvm-dwarfutil/CMakeLists.txt +++ b/llvm/tools/llvm-dwarfutil/CMakeLists.txt @@ -11,6 +11,7 @@ Option Support Target + TargetParser AllTargetsCodeGens AllTargetsDescs AllTargetsInfos diff --git a/llvm/tools/llvm-dwp/CMakeLists.txt b/llvm/tools/llvm-dwp/CMakeLists.txt --- a/llvm/tools/llvm-dwp/CMakeLists.txt +++ b/llvm/tools/llvm-dwp/CMakeLists.txt @@ -7,6 +7,7 @@ MC Object Support + TargetParser ) add_llvm_tool(llvm-dwp diff --git a/llvm/tools/llvm-exegesis/lib/CMakeLists.txt b/llvm/tools/llvm-exegesis/lib/CMakeLists.txt --- a/llvm/tools/llvm-exegesis/lib/CMakeLists.txt +++ b/llvm/tools/llvm-exegesis/lib/CMakeLists.txt @@ -34,6 +34,7 @@ ObjectYAML RuntimeDyld Support + TargetParser ) set(libs) diff --git a/llvm/tools/llvm-exegesis/lib/Mips/CMakeLists.txt b/llvm/tools/llvm-exegesis/lib/Mips/CMakeLists.txt --- a/llvm/tools/llvm-exegesis/lib/Mips/CMakeLists.txt +++ b/llvm/tools/llvm-exegesis/lib/Mips/CMakeLists.txt @@ -8,6 +8,7 @@ Exegesis Core Support + TargetParser MC ) diff --git a/llvm/tools/llvm-exegesis/lib/PowerPC/CMakeLists.txt b/llvm/tools/llvm-exegesis/lib/PowerPC/CMakeLists.txt --- a/llvm/tools/llvm-exegesis/lib/PowerPC/CMakeLists.txt +++ b/llvm/tools/llvm-exegesis/lib/PowerPC/CMakeLists.txt @@ -8,6 +8,7 @@ Exegesis Core Support + TargetParser MC ) diff --git a/llvm/tools/llvm-exegesis/lib/X86/CMakeLists.txt b/llvm/tools/llvm-exegesis/lib/X86/CMakeLists.txt --- a/llvm/tools/llvm-exegesis/lib/X86/CMakeLists.txt +++ b/llvm/tools/llvm-exegesis/lib/X86/CMakeLists.txt @@ -8,6 +8,7 @@ Exegesis Core Support + TargetParser CodeGen MC ) diff --git a/llvm/tools/llvm-gsymutil/CMakeLists.txt b/llvm/tools/llvm-gsymutil/CMakeLists.txt --- a/llvm/tools/llvm-gsymutil/CMakeLists.txt +++ b/llvm/tools/llvm-gsymutil/CMakeLists.txt @@ -6,6 +6,7 @@ Object Support Target + TargetParser ) add_llvm_tool(llvm-gsymutil diff --git a/llvm/tools/llvm-ifs/CMakeLists.txt b/llvm/tools/llvm-ifs/CMakeLists.txt --- a/llvm/tools/llvm-ifs/CMakeLists.txt +++ b/llvm/tools/llvm-ifs/CMakeLists.txt @@ -3,6 +3,7 @@ InterfaceStub Object Support + TargetParser TextAPI ObjectYAML Option diff --git a/llvm/tools/llvm-isel-fuzzer/CMakeLists.txt b/llvm/tools/llvm-isel-fuzzer/CMakeLists.txt --- a/llvm/tools/llvm-isel-fuzzer/CMakeLists.txt +++ b/llvm/tools/llvm-isel-fuzzer/CMakeLists.txt @@ -17,6 +17,7 @@ SelectionDAG Support Target + TargetParser ) add_llvm_fuzzer(llvm-isel-fuzzer llvm-isel-fuzzer.cpp diff --git a/llvm/tools/llvm-jitlink/CMakeLists.txt b/llvm/tools/llvm-jitlink/CMakeLists.txt --- a/llvm/tools/llvm-jitlink/CMakeLists.txt +++ b/llvm/tools/llvm-jitlink/CMakeLists.txt @@ -16,6 +16,7 @@ OrcTargetProcess RuntimeDyld Support + TargetParser ) add_llvm_tool(llvm-jitlink diff --git a/llvm/tools/llvm-jitlistener/CMakeLists.txt b/llvm/tools/llvm-jitlistener/CMakeLists.txt --- a/llvm/tools/llvm-jitlistener/CMakeLists.txt +++ b/llvm/tools/llvm-jitlistener/CMakeLists.txt @@ -15,6 +15,7 @@ object selectiondag Support + TargetParser ExecutionEngine RuntimeDyld Core diff --git a/llvm/tools/llvm-libtool-darwin/CMakeLists.txt b/llvm/tools/llvm-libtool-darwin/CMakeLists.txt --- a/llvm/tools/llvm-libtool-darwin/CMakeLists.txt +++ b/llvm/tools/llvm-libtool-darwin/CMakeLists.txt @@ -3,6 +3,7 @@ Core Object Support + TargetParser TextAPI ${LLVM_TARGETS_TO_BUILD} ) diff --git a/llvm/tools/llvm-lipo/CMakeLists.txt b/llvm/tools/llvm-lipo/CMakeLists.txt --- a/llvm/tools/llvm-lipo/CMakeLists.txt +++ b/llvm/tools/llvm-lipo/CMakeLists.txt @@ -3,6 +3,7 @@ Object Option Support + TargetParser TextAPI Core BinaryFormat diff --git a/llvm/tools/llvm-lto/CMakeLists.txt b/llvm/tools/llvm-lto/CMakeLists.txt --- a/llvm/tools/llvm-lto/CMakeLists.txt +++ b/llvm/tools/llvm-lto/CMakeLists.txt @@ -14,6 +14,7 @@ Object Support Target + TargetParser ) add_llvm_tool(llvm-lto diff --git a/llvm/tools/llvm-lto2/CMakeLists.txt b/llvm/tools/llvm-lto2/CMakeLists.txt --- a/llvm/tools/llvm-lto2/CMakeLists.txt +++ b/llvm/tools/llvm-lto2/CMakeLists.txt @@ -13,6 +13,7 @@ Passes Support Target + TargetParser ) add_llvm_tool(llvm-lto2 diff --git a/llvm/tools/llvm-mc-assemble-fuzzer/CMakeLists.txt b/llvm/tools/llvm-mc-assemble-fuzzer/CMakeLists.txt --- a/llvm/tools/llvm-mc-assemble-fuzzer/CMakeLists.txt +++ b/llvm/tools/llvm-mc-assemble-fuzzer/CMakeLists.txt @@ -5,6 +5,7 @@ MC MCParser Support + TargetParser ) add_llvm_fuzzer(llvm-mc-assemble-fuzzer diff --git a/llvm/tools/llvm-mc-disassemble-fuzzer/CMakeLists.txt b/llvm/tools/llvm-mc-disassemble-fuzzer/CMakeLists.txt --- a/llvm/tools/llvm-mc-disassemble-fuzzer/CMakeLists.txt +++ b/llvm/tools/llvm-mc-disassemble-fuzzer/CMakeLists.txt @@ -6,6 +6,7 @@ MCDisassembler MCParser Support + TargetParser ) add_llvm_fuzzer(llvm-mc-disassemble-fuzzer llvm-mc-disassemble-fuzzer.cpp diff --git a/llvm/tools/llvm-mc/CMakeLists.txt b/llvm/tools/llvm-mc/CMakeLists.txt --- a/llvm/tools/llvm-mc/CMakeLists.txt +++ b/llvm/tools/llvm-mc/CMakeLists.txt @@ -6,6 +6,7 @@ MC MCParser Support + TargetParser ) add_llvm_tool(llvm-mc diff --git a/llvm/tools/llvm-mca/CMakeLists.txt b/llvm/tools/llvm-mca/CMakeLists.txt --- a/llvm/tools/llvm-mca/CMakeLists.txt +++ b/llvm/tools/llvm-mca/CMakeLists.txt @@ -10,6 +10,7 @@ MC MCParser Support + TargetParser ) add_llvm_tool(llvm-mca diff --git a/llvm/tools/llvm-ml/CMakeLists.txt b/llvm/tools/llvm-ml/CMakeLists.txt --- a/llvm/tools/llvm-ml/CMakeLists.txt +++ b/llvm/tools/llvm-ml/CMakeLists.txt @@ -7,6 +7,7 @@ MCParser Option Support + TargetParser ) set(LLVM_TARGET_DEFINITIONS Opts.td) diff --git a/llvm/tools/llvm-nm/CMakeLists.txt b/llvm/tools/llvm-nm/CMakeLists.txt --- a/llvm/tools/llvm-nm/CMakeLists.txt +++ b/llvm/tools/llvm-nm/CMakeLists.txt @@ -8,6 +8,7 @@ Object Option Support + TargetParser TextAPI ) diff --git a/llvm/tools/llvm-objcopy/CMakeLists.txt b/llvm/tools/llvm-objcopy/CMakeLists.txt --- a/llvm/tools/llvm-objcopy/CMakeLists.txt +++ b/llvm/tools/llvm-objcopy/CMakeLists.txt @@ -3,6 +3,7 @@ ObjCopy Option Support + TargetParser MC BinaryFormat ) diff --git a/llvm/tools/llvm-objdump/CMakeLists.txt b/llvm/tools/llvm-objdump/CMakeLists.txt --- a/llvm/tools/llvm-objdump/CMakeLists.txt +++ b/llvm/tools/llvm-objdump/CMakeLists.txt @@ -12,6 +12,7 @@ Option Support Symbolize + TargetParser ) set(LLVM_TARGET_DEFINITIONS ObjdumpOpts.td) diff --git a/llvm/tools/llvm-opt-fuzzer/CMakeLists.txt b/llvm/tools/llvm-opt-fuzzer/CMakeLists.txt --- a/llvm/tools/llvm-opt-fuzzer/CMakeLists.txt +++ b/llvm/tools/llvm-opt-fuzzer/CMakeLists.txt @@ -21,6 +21,7 @@ ScalarOpts Support Target + TargetParser TransformUtils Vectorize Passes diff --git a/llvm/tools/llvm-profgen/CMakeLists.txt b/llvm/tools/llvm-profgen/CMakeLists.txt --- a/llvm/tools/llvm-profgen/CMakeLists.txt +++ b/llvm/tools/llvm-profgen/CMakeLists.txt @@ -12,6 +12,7 @@ ProfileData Support Symbolize + TargetParser ) add_llvm_tool(llvm-profgen diff --git a/llvm/tools/llvm-rc/CMakeLists.txt b/llvm/tools/llvm-rc/CMakeLists.txt --- a/llvm/tools/llvm-rc/CMakeLists.txt +++ b/llvm/tools/llvm-rc/CMakeLists.txt @@ -2,6 +2,7 @@ Object Option Support + TargetParser ) set(LLVM_TARGET_DEFINITIONS Opts.td) diff --git a/llvm/tools/llvm-readobj/CMakeLists.txt b/llvm/tools/llvm-readobj/CMakeLists.txt --- a/llvm/tools/llvm-readobj/CMakeLists.txt +++ b/llvm/tools/llvm-readobj/CMakeLists.txt @@ -6,6 +6,7 @@ BinaryFormat Option Support + TargetParser DebugInfoCodeView DebugInfoMSF DebugInfoPDB diff --git a/llvm/tools/llvm-reduce/CMakeLists.txt b/llvm/tools/llvm-reduce/CMakeLists.txt --- a/llvm/tools/llvm-reduce/CMakeLists.txt +++ b/llvm/tools/llvm-reduce/CMakeLists.txt @@ -14,6 +14,7 @@ Passes Support Target + TargetParser TransformUtils IPO ) diff --git a/llvm/tools/llvm-rtdyld/CMakeLists.txt b/llvm/tools/llvm-rtdyld/CMakeLists.txt --- a/llvm/tools/llvm-rtdyld/CMakeLists.txt +++ b/llvm/tools/llvm-rtdyld/CMakeLists.txt @@ -8,6 +8,7 @@ Object RuntimeDyld Support + TargetParser ) add_llvm_tool(llvm-rtdyld diff --git a/llvm/tools/llvm-size/CMakeLists.txt b/llvm/tools/llvm-size/CMakeLists.txt --- a/llvm/tools/llvm-size/CMakeLists.txt +++ b/llvm/tools/llvm-size/CMakeLists.txt @@ -2,6 +2,7 @@ Object Option Support + TargetParser ) set(LLVM_TARGET_DEFINITIONS Opts.td) diff --git a/llvm/tools/llvm-tli-checker/CMakeLists.txt b/llvm/tools/llvm-tli-checker/CMakeLists.txt --- a/llvm/tools/llvm-tli-checker/CMakeLists.txt +++ b/llvm/tools/llvm-tli-checker/CMakeLists.txt @@ -11,6 +11,7 @@ Option Remarks Support + TargetParser TextAPI ) diff --git a/llvm/tools/opt/CMakeLists.txt b/llvm/tools/opt/CMakeLists.txt --- a/llvm/tools/opt/CMakeLists.txt +++ b/llvm/tools/opt/CMakeLists.txt @@ -23,6 +23,7 @@ ScalarOpts Support Target + TargetParser TransformUtils Vectorize Passes diff --git a/llvm/tools/sancov/CMakeLists.txt b/llvm/tools/sancov/CMakeLists.txt --- a/llvm/tools/sancov/CMakeLists.txt +++ b/llvm/tools/sancov/CMakeLists.txt @@ -8,6 +8,7 @@ MCDisassembler Object Support + TargetParser Symbolize ) diff --git a/llvm/unittests/ADT/CMakeLists.txt b/llvm/unittests/ADT/CMakeLists.txt --- a/llvm/unittests/ADT/CMakeLists.txt +++ b/llvm/unittests/ADT/CMakeLists.txt @@ -79,7 +79,6 @@ StringSetTest.cpp StringSwitchTest.cpp TinyPtrVectorTest.cpp - TripleTest.cpp TwineTest.cpp TypeSwitchTest.cpp TypeTraitsTest.cpp diff --git a/llvm/unittests/Analysis/CMakeLists.txt b/llvm/unittests/Analysis/CMakeLists.txt --- a/llvm/unittests/Analysis/CMakeLists.txt +++ b/llvm/unittests/Analysis/CMakeLists.txt @@ -3,6 +3,7 @@ AsmParser Core Support + TargetParser TransformUtils ) diff --git a/llvm/unittests/BinaryFormat/CMakeLists.txt b/llvm/unittests/BinaryFormat/CMakeLists.txt --- a/llvm/unittests/BinaryFormat/CMakeLists.txt +++ b/llvm/unittests/BinaryFormat/CMakeLists.txt @@ -1,5 +1,6 @@ set(LLVM_LINK_COMPONENTS BinaryFormat + TargetParser ) add_llvm_unittest(BinaryFormatTests diff --git a/llvm/unittests/CMakeLists.txt b/llvm/unittests/CMakeLists.txt --- a/llvm/unittests/CMakeLists.txt +++ b/llvm/unittests/CMakeLists.txt @@ -45,6 +45,7 @@ add_subdirectory(Support) add_subdirectory(TableGen) add_subdirectory(Target) +add_subdirectory(TargetParser) add_subdirectory(Testing) add_subdirectory(TextAPI) add_subdirectory(Transforms) diff --git a/llvm/unittests/CodeGen/CMakeLists.txt b/llvm/unittests/CodeGen/CMakeLists.txt --- a/llvm/unittests/CodeGen/CMakeLists.txt +++ b/llvm/unittests/CodeGen/CMakeLists.txt @@ -12,6 +12,7 @@ SelectionDAG Support Target + TargetParser ) add_llvm_unittest(CodeGenTests diff --git a/llvm/unittests/CodeGen/GlobalISel/CMakeLists.txt b/llvm/unittests/CodeGen/GlobalISel/CMakeLists.txt --- a/llvm/unittests/CodeGen/GlobalISel/CMakeLists.txt +++ b/llvm/unittests/CodeGen/GlobalISel/CMakeLists.txt @@ -8,6 +8,7 @@ MIRParser Support Target + TargetParser ) add_llvm_unittest(GlobalISelTests diff --git a/llvm/unittests/DebugInfo/DWARF/CMakeLists.txt b/llvm/unittests/DebugInfo/DWARF/CMakeLists.txt --- a/llvm/unittests/DebugInfo/DWARF/CMakeLists.txt +++ b/llvm/unittests/DebugInfo/DWARF/CMakeLists.txt @@ -7,6 +7,7 @@ Object ObjectYAML Support + TargetParser ) add_llvm_unittest(DebugInfoDWARFTests diff --git a/llvm/unittests/DebugInfo/LogicalView/CMakeLists.txt b/llvm/unittests/DebugInfo/LogicalView/CMakeLists.txt --- a/llvm/unittests/DebugInfo/LogicalView/CMakeLists.txt +++ b/llvm/unittests/DebugInfo/LogicalView/CMakeLists.txt @@ -5,6 +5,7 @@ DebugInfoLogicalView MC MCDisassembler + TargetParser ) add_llvm_unittest_with_input_files(DebugInfoLogicalViewTests diff --git a/llvm/unittests/ExecutionEngine/JITLink/CMakeLists.txt b/llvm/unittests/ExecutionEngine/JITLink/CMakeLists.txt --- a/llvm/unittests/ExecutionEngine/JITLink/CMakeLists.txt +++ b/llvm/unittests/ExecutionEngine/JITLink/CMakeLists.txt @@ -7,6 +7,7 @@ OrcTargetProcess RuntimeDyld Support + TargetParser ) add_llvm_unittest(JITLinkTests diff --git a/llvm/unittests/ExecutionEngine/MCJIT/CMakeLists.txt b/llvm/unittests/ExecutionEngine/MCJIT/CMakeLists.txt --- a/llvm/unittests/ExecutionEngine/MCJIT/CMakeLists.txt +++ b/llvm/unittests/ExecutionEngine/MCJIT/CMakeLists.txt @@ -9,6 +9,7 @@ ScalarOpts Support Target + TargetParser nativecodegen ) diff --git a/llvm/unittests/ExecutionEngine/Orc/CMakeLists.txt b/llvm/unittests/ExecutionEngine/Orc/CMakeLists.txt --- a/llvm/unittests/ExecutionEngine/Orc/CMakeLists.txt +++ b/llvm/unittests/ExecutionEngine/Orc/CMakeLists.txt @@ -11,6 +11,7 @@ Passes RuntimeDyld Support + TargetParser native ) diff --git a/llvm/unittests/Frontend/CMakeLists.txt b/llvm/unittests/Frontend/CMakeLists.txt --- a/llvm/unittests/Frontend/CMakeLists.txt +++ b/llvm/unittests/Frontend/CMakeLists.txt @@ -5,6 +5,7 @@ FrontendOpenACC Support Passes + TargetParser TransformUtils ) diff --git a/llvm/unittests/MC/AMDGPU/CMakeLists.txt b/llvm/unittests/MC/AMDGPU/CMakeLists.txt --- a/llvm/unittests/MC/AMDGPU/CMakeLists.txt +++ b/llvm/unittests/MC/AMDGPU/CMakeLists.txt @@ -4,6 +4,7 @@ AMDGPUInfo MC Support + TargetParser ) add_llvm_unittest(AMDGPUDwarfTests diff --git a/llvm/unittests/MC/CMakeLists.txt b/llvm/unittests/MC/CMakeLists.txt --- a/llvm/unittests/MC/CMakeLists.txt +++ b/llvm/unittests/MC/CMakeLists.txt @@ -10,6 +10,7 @@ MCDisassembler Object Support + TargetParser ) add_llvm_unittest(MCTests diff --git a/llvm/unittests/MC/SystemZ/CMakeLists.txt b/llvm/unittests/MC/SystemZ/CMakeLists.txt --- a/llvm/unittests/MC/SystemZ/CMakeLists.txt +++ b/llvm/unittests/MC/SystemZ/CMakeLists.txt @@ -7,6 +7,7 @@ MCParser MC Support + TargetParser ) add_llvm_unittest(SystemZAsmLexerTests diff --git a/llvm/unittests/MC/X86/CMakeLists.txt b/llvm/unittests/MC/X86/CMakeLists.txt --- a/llvm/unittests/MC/X86/CMakeLists.txt +++ b/llvm/unittests/MC/X86/CMakeLists.txt @@ -2,6 +2,7 @@ MC MCDisassembler Target + TargetParser X86Desc X86Disassembler X86Info diff --git a/llvm/unittests/MI/CMakeLists.txt b/llvm/unittests/MI/CMakeLists.txt --- a/llvm/unittests/MI/CMakeLists.txt +++ b/llvm/unittests/MI/CMakeLists.txt @@ -6,6 +6,7 @@ MIRParser Support Target + TargetParser ) add_llvm_unittest(MITests diff --git a/llvm/unittests/MIR/CMakeLists.txt b/llvm/unittests/MIR/CMakeLists.txt --- a/llvm/unittests/MIR/CMakeLists.txt +++ b/llvm/unittests/MIR/CMakeLists.txt @@ -7,6 +7,7 @@ MIRParser Support Target + TargetParser ) add_llvm_unittest(MIRTests diff --git a/llvm/unittests/Object/CMakeLists.txt b/llvm/unittests/Object/CMakeLists.txt --- a/llvm/unittests/Object/CMakeLists.txt +++ b/llvm/unittests/Object/CMakeLists.txt @@ -2,6 +2,7 @@ BinaryFormat Object ObjectYAML + TargetParser ) add_llvm_unittest(ObjectTests diff --git a/llvm/unittests/Support/CMakeLists.txt b/llvm/unittests/Support/CMakeLists.txt --- a/llvm/unittests/Support/CMakeLists.txt +++ b/llvm/unittests/Support/CMakeLists.txt @@ -1,5 +1,6 @@ set(LLVM_LINK_COMPONENTS Support + TargetParser ) add_llvm_unittest(SupportTests @@ -25,7 +26,6 @@ ConvertUTFTest.cpp CRCTest.cpp CSKYAttributeParserTest.cpp - CSKYTargetParserTest.cpp DataExtractorTest.cpp DebugTest.cpp DebugCounterTest.cpp @@ -44,7 +44,6 @@ FSUniqueIDTest.cpp GlobPatternTest.cpp HashBuilderTest.cpp - Host.cpp IndexedAccessorTest.cpp InstructionCostTest.cpp ItaniumManglingCanonicalizerTest.cpp @@ -80,7 +79,6 @@ SwapByteOrderTest.cpp SymbolRemappingReaderTest.cpp TarWriterTest.cpp - TargetParserTest.cpp TaskQueueTest.cpp ThreadLocalTest.cpp ThreadPool.cpp diff --git a/llvm/unittests/Target/AArch64/CMakeLists.txt b/llvm/unittests/Target/AArch64/CMakeLists.txt --- a/llvm/unittests/Target/AArch64/CMakeLists.txt +++ b/llvm/unittests/Target/AArch64/CMakeLists.txt @@ -17,6 +17,7 @@ SelectionDAG Support Target + TargetParser ) add_llvm_target_unittest(AArch64Tests diff --git a/llvm/unittests/Target/AMDGPU/CMakeLists.txt b/llvm/unittests/Target/AMDGPU/CMakeLists.txt --- a/llvm/unittests/Target/AMDGPU/CMakeLists.txt +++ b/llvm/unittests/Target/AMDGPU/CMakeLists.txt @@ -12,6 +12,7 @@ Core MC Support + TargetParser ) add_llvm_target_unittest(AMDGPUTests diff --git a/llvm/unittests/Target/ARM/CMakeLists.txt b/llvm/unittests/Target/ARM/CMakeLists.txt --- a/llvm/unittests/Target/ARM/CMakeLists.txt +++ b/llvm/unittests/Target/ARM/CMakeLists.txt @@ -15,6 +15,7 @@ SelectionDAG Support Target + TargetParser ) add_llvm_target_unittest(ARMTests diff --git a/llvm/unittests/Target/PowerPC/CMakeLists.txt b/llvm/unittests/Target/PowerPC/CMakeLists.txt --- a/llvm/unittests/Target/PowerPC/CMakeLists.txt +++ b/llvm/unittests/Target/PowerPC/CMakeLists.txt @@ -7,6 +7,7 @@ MC Support Target + TargetParser PowerPCCodeGen PowerPCDesc PowerPCInfo diff --git a/llvm/unittests/Target/WebAssembly/CMakeLists.txt b/llvm/unittests/Target/WebAssembly/CMakeLists.txt --- a/llvm/unittests/Target/WebAssembly/CMakeLists.txt +++ b/llvm/unittests/Target/WebAssembly/CMakeLists.txt @@ -8,6 +8,7 @@ Core MC MIRParser + TargetParser WebAssemblyCodeGen WebAssemblyDesc WebAssemblyInfo diff --git a/llvm/unittests/Target/X86/CMakeLists.txt b/llvm/unittests/Target/X86/CMakeLists.txt --- a/llvm/unittests/Target/X86/CMakeLists.txt +++ b/llvm/unittests/Target/X86/CMakeLists.txt @@ -11,6 +11,7 @@ MIRParser Support Target + TargetParser X86CodeGen X86Desc X86Info diff --git a/llvm/unittests/TargetParser/CMakeLists.txt b/llvm/unittests/TargetParser/CMakeLists.txt new file mode 100644 --- /dev/null +++ b/llvm/unittests/TargetParser/CMakeLists.txt @@ -0,0 +1,13 @@ +set(LLVM_LINK_COMPONENTS + Support + TargetParser + ) + +add_llvm_unittest(TargetParserTests + CSKYTargetParserTest.cpp + Host.cpp + TargetParserTest.cpp + TripleTest.cpp + ) + +target_link_libraries(TargetParserTests PRIVATE LLVMTestingSupport) diff --git a/llvm/unittests/Support/CSKYTargetParserTest.cpp b/llvm/unittests/TargetParser/CSKYTargetParserTest.cpp rename from llvm/unittests/Support/CSKYTargetParserTest.cpp rename to llvm/unittests/TargetParser/CSKYTargetParserTest.cpp --- a/llvm/unittests/Support/CSKYTargetParserTest.cpp +++ b/llvm/unittests/TargetParser/CSKYTargetParserTest.cpp @@ -6,12 +6,12 @@ // //===----------------------------------------------------------------------===// -#include "llvm/Support/CSKYTargetParser.h" +#include "llvm/TargetParser/CSKYTargetParser.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/StringExtras.h" #include "llvm/Support/CSKYAttributes.h" #include "llvm/Support/FormatVariadic.h" -#include "llvm/Support/TargetParser.h" +#include "llvm/TargetParser/TargetParser.h" #include "gtest/gtest.h" #include diff --git a/llvm/unittests/Support/Host.cpp b/llvm/unittests/TargetParser/Host.cpp rename from llvm/unittests/Support/Host.cpp rename to llvm/unittests/TargetParser/Host.cpp --- a/llvm/unittests/Support/Host.cpp +++ b/llvm/unittests/TargetParser/Host.cpp @@ -6,14 +6,14 @@ // //===----------------------------------------------------------------------===// -#include "llvm/Support/Host.h" +#include "llvm/TargetParser/Host.h" #include "llvm/ADT/SmallVector.h" -#include "llvm/ADT/Triple.h" #include "llvm/Config/config.h" #include "llvm/Support/FileSystem.h" #include "llvm/Support/Path.h" #include "llvm/Support/Program.h" #include "llvm/Support/Threading.h" +#include "llvm/TargetParser/Triple.h" #include "gtest/gtest.h" diff --git a/llvm/unittests/Support/TargetParserTest.cpp b/llvm/unittests/TargetParser/TargetParserTest.cpp rename from llvm/unittests/Support/TargetParserTest.cpp rename to llvm/unittests/TargetParser/TargetParserTest.cpp --- a/llvm/unittests/Support/TargetParserTest.cpp +++ b/llvm/unittests/TargetParser/TargetParserTest.cpp @@ -6,14 +6,15 @@ // //===----------------------------------------------------------------------===// -#include "llvm/Support/TargetParser.h" +#include "llvm/TargetParser/TargetParser.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/StringExtras.h" -#include "llvm/ADT/Triple.h" -#include "llvm/Support/AArch64TargetParser.h" #include "llvm/Support/ARMBuildAttributes.h" -#include "llvm/Support/ARMTargetParser.h" #include "llvm/Support/FormatVariadic.h" +#include "llvm/TargetParser/AArch64TargetParser.h" +#include "llvm/TargetParser/ARMTargetParser.h" +#include "llvm/TargetParser/ARMTargetParserCommon.h" +#include "llvm/TargetParser/Triple.h" #include "gmock/gmock.h" #include "gtest/gtest.h" #include diff --git a/llvm/unittests/ADT/TripleTest.cpp b/llvm/unittests/TargetParser/TripleTest.cpp rename from llvm/unittests/ADT/TripleTest.cpp rename to llvm/unittests/TargetParser/TripleTest.cpp --- a/llvm/unittests/ADT/TripleTest.cpp +++ b/llvm/unittests/TargetParser/TripleTest.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -#include "llvm/ADT/Triple.h" +#include "llvm/TargetParser/Triple.h" #include "llvm/Support/VersionTuple.h" #include "gtest/gtest.h" @@ -849,7 +849,7 @@ EXPECT_EQ(Triple::ShaderModel, T.getOS()); EXPECT_EQ(Triple::Callable, T.getEnvironment()); EXPECT_FALSE(T.supportsCOMDAT()); - + T = Triple("dxil-unknown-shadermodel-mesh"); EXPECT_EQ(Triple::dxil, T.getArch()); EXPECT_EQ(Triple::UnknownVendor, T.getVendor()); diff --git a/llvm/unittests/Transforms/IPO/CMakeLists.txt b/llvm/unittests/Transforms/IPO/CMakeLists.txt --- a/llvm/unittests/Transforms/IPO/CMakeLists.txt +++ b/llvm/unittests/Transforms/IPO/CMakeLists.txt @@ -4,6 +4,7 @@ Core IPO Support + TargetParser TransformUtils ) diff --git a/llvm/unittests/Transforms/Vectorize/CMakeLists.txt b/llvm/unittests/Transforms/Vectorize/CMakeLists.txt --- a/llvm/unittests/Transforms/Vectorize/CMakeLists.txt +++ b/llvm/unittests/Transforms/Vectorize/CMakeLists.txt @@ -3,6 +3,7 @@ Core Vectorize AsmParser + TargetParser ) add_llvm_unittest(VectorizeTests diff --git a/llvm/unittests/tools/llvm-cfi-verify/CMakeLists.txt b/llvm/unittests/tools/llvm-cfi-verify/CMakeLists.txt --- a/llvm/unittests/tools/llvm-cfi-verify/CMakeLists.txt +++ b/llvm/unittests/tools/llvm-cfi-verify/CMakeLists.txt @@ -8,6 +8,7 @@ Object Support Symbolize + TargetParser ) add_llvm_unittest(CFIVerifyTests diff --git a/llvm/unittests/tools/llvm-exegesis/CMakeLists.txt b/llvm/unittests/tools/llvm-exegesis/CMakeLists.txt --- a/llvm/unittests/tools/llvm-exegesis/CMakeLists.txt +++ b/llvm/unittests/tools/llvm-exegesis/CMakeLists.txt @@ -8,6 +8,7 @@ Object Support Symbolize + TargetParser ) set(exegesis_sources diff --git a/llvm/unittests/tools/llvm-mca/CMakeLists.txt b/llvm/unittests/tools/llvm-mca/CMakeLists.txt --- a/llvm/unittests/tools/llvm-mca/CMakeLists.txt +++ b/llvm/unittests/tools/llvm-mca/CMakeLists.txt @@ -3,6 +3,7 @@ MCA Object Support + TargetParser ) set(mca_root ${LLVM_MAIN_SRC_DIR}/tools/llvm-mca) diff --git a/mlir/lib/ExecutionEngine/CMakeLists.txt b/mlir/lib/ExecutionEngine/CMakeLists.txt --- a/mlir/lib/ExecutionEngine/CMakeLists.txt +++ b/mlir/lib/ExecutionEngine/CMakeLists.txt @@ -37,6 +37,7 @@ TransformUtils IPO Passes + TargetParser ) if(NOT MLIR_ENABLE_EXECUTION_ENGINE) diff --git a/mlir/lib/Target/LLVMIR/CMakeLists.txt b/mlir/lib/Target/LLVMIR/CMakeLists.txt --- a/mlir/lib/Target/LLVMIR/CMakeLists.txt +++ b/mlir/lib/Target/LLVMIR/CMakeLists.txt @@ -26,6 +26,7 @@ Core FrontendOpenMP TransformUtils + TargetParser LINK_LIBS PUBLIC MLIRDLTIDialect diff --git a/polly/lib/CMakeLists.txt b/polly/lib/CMakeLists.txt --- a/polly/lib/CMakeLists.txt +++ b/polly/lib/CMakeLists.txt @@ -40,6 +40,7 @@ Object ProfileData Target + TargetParser Vectorize )