From 4fb6fcacf49687d49dfde824d484a7de7a70b208 Mon Sep 17 00:00:00 2001 From: "David L. Jones" Date: Tue, 14 May 2019 04:02:50 +0000 Subject: [PATCH] gn build: add Sparc target llvm-svn: 360645 --- .../llvm/lib/Target/Sparc/AsmParser/BUILD.gn | 22 ++++++ .../secondary/llvm/lib/Target/Sparc/BUILD.gn | 62 ++++++++++++++++ .../lib/Target/Sparc/Disassembler/BUILD.gn | 21 ++++++ .../lib/Target/Sparc/MCTargetDesc/BUILD.gn | 70 +++++++++++++++++++ .../llvm/lib/Target/Sparc/TargetInfo/BUILD.gn | 12 ++++ .../gn/secondary/llvm/lib/Target/targets.gni | 5 ++ 6 files changed, 192 insertions(+) create mode 100644 llvm/utils/gn/secondary/llvm/lib/Target/Sparc/AsmParser/BUILD.gn create mode 100644 llvm/utils/gn/secondary/llvm/lib/Target/Sparc/BUILD.gn create mode 100644 llvm/utils/gn/secondary/llvm/lib/Target/Sparc/Disassembler/BUILD.gn create mode 100644 llvm/utils/gn/secondary/llvm/lib/Target/Sparc/MCTargetDesc/BUILD.gn create mode 100644 llvm/utils/gn/secondary/llvm/lib/Target/Sparc/TargetInfo/BUILD.gn diff --git a/llvm/utils/gn/secondary/llvm/lib/Target/Sparc/AsmParser/BUILD.gn b/llvm/utils/gn/secondary/llvm/lib/Target/Sparc/AsmParser/BUILD.gn new file mode 100644 index 000000000000..aaae105d8726 --- /dev/null +++ b/llvm/utils/gn/secondary/llvm/lib/Target/Sparc/AsmParser/BUILD.gn @@ -0,0 +1,22 @@ +import("//llvm/utils/TableGen/tablegen.gni") + +tablegen("SparcGenAsmMatcher") { + visibility = [ ":AsmParser" ] + args = [ "-gen-asm-matcher" ] + td_file = "../Sparc.td" +} + +static_library("AsmParser") { + output_name = "LLVMSparcAsmParser" + deps = [ + ":SparcGenAsmMatcher", + "//llvm/lib/MC", + "//llvm/lib/MC/MCParser", + "//llvm/lib/Support", + "//llvm/lib/Target/Sparc/MCTargetDesc", + ] + include_dirs = [ ".." ] + sources = [ + "SparcAsmParser.cpp", + ] +} diff --git a/llvm/utils/gn/secondary/llvm/lib/Target/Sparc/BUILD.gn b/llvm/utils/gn/secondary/llvm/lib/Target/Sparc/BUILD.gn new file mode 100644 index 000000000000..de51b1006b33 --- /dev/null +++ b/llvm/utils/gn/secondary/llvm/lib/Target/Sparc/BUILD.gn @@ -0,0 +1,62 @@ +import("//llvm/utils/TableGen/tablegen.gni") + +tablegen("SparcGenCallingConv") { + visibility = [ ":LLVMSparcCodeGen" ] + args = [ "-gen-callingconv" ] + td_file = "Sparc.td" +} + +tablegen("SparcGenDAGISel") { + visibility = [ ":LLVMSparcCodeGen" ] + args = [ "-gen-dag-isel" ] + td_file = "Sparc.td" +} + +static_library("LLVMSparcCodeGen") { + deps = [ + ":SparcGenCallingConv", + ":SparcGenDAGISel", + "MCTargetDesc", + "TargetInfo", + "//llvm/include/llvm/Config:llvm-config", + "//llvm/lib/CodeGen", + "//llvm/lib/CodeGen/AsmPrinter", + "//llvm/lib/CodeGen/SelectionDAG", + "//llvm/lib/IR", + "//llvm/lib/MC", + "//llvm/lib/Support", + "//llvm/lib/Target", + ] + include_dirs = [ "." ] + sources = [ + "DelaySlotFiller.cpp", + "LeonPasses.cpp", + "SparcAsmPrinter.cpp", + "SparcInstrInfo.cpp", + "SparcISelDAGToDAG.cpp", + "SparcISelLowering.cpp", + "SparcFrameLowering.cpp", + "SparcMachineFunctionInfo.cpp", + "SparcRegisterInfo.cpp", + "SparcSubtarget.cpp", + "SparcTargetMachine.cpp", + "SparcMCInstLower.cpp", + "SparcTargetObjectFile.cpp", + ] +} + +# This is a bit different from most build files: Due to this group +# having the directory's name, "//llvm/lib/Target/Sparc" will refer to this +# target, which pulls in the code in this directory *and all subdirectories*. +# For most other directories, "//llvm/lib/Foo" only pulls in the code directly +# in "llvm/lib/Foo". The forwarding targets in //llvm/lib/Target expect this +# different behavior. +group("Sparc") { + deps = [ + ":LLVMSparcCodeGen", + "AsmParser", + "Disassembler", + "MCTargetDesc", + "TargetInfo", + ] +} diff --git a/llvm/utils/gn/secondary/llvm/lib/Target/Sparc/Disassembler/BUILD.gn b/llvm/utils/gn/secondary/llvm/lib/Target/Sparc/Disassembler/BUILD.gn new file mode 100644 index 000000000000..22a712d4d04c --- /dev/null +++ b/llvm/utils/gn/secondary/llvm/lib/Target/Sparc/Disassembler/BUILD.gn @@ -0,0 +1,21 @@ +import("//llvm/utils/TableGen/tablegen.gni") + +tablegen("SparcGenDisassemblerTables") { + visibility = [ ":Disassembler" ] + args = [ "-gen-disassembler" ] + td_file = "../Sparc.td" +} + +static_library("Disassembler") { + output_name = "LLVMSparcDisassembler" + deps = [ + ":SparcGenDisassemblerTables", + "//llvm/lib/MC/MCDisassembler", + "//llvm/lib/Support", + "//llvm/lib/Target/Sparc/MCTargetDesc", + ] + include_dirs = [ ".." ] + sources = [ + "SparcDisassembler.cpp", + ] +} diff --git a/llvm/utils/gn/secondary/llvm/lib/Target/Sparc/MCTargetDesc/BUILD.gn b/llvm/utils/gn/secondary/llvm/lib/Target/Sparc/MCTargetDesc/BUILD.gn new file mode 100644 index 000000000000..27e5a778a6b5 --- /dev/null +++ b/llvm/utils/gn/secondary/llvm/lib/Target/Sparc/MCTargetDesc/BUILD.gn @@ -0,0 +1,70 @@ +import("//llvm/utils/TableGen/tablegen.gni") + +tablegen("SparcGenAsmWriter") { + visibility = [ ":MCTargetDesc" ] + args = [ "-gen-asm-writer" ] + td_file = "../Sparc.td" +} + +tablegen("SparcGenInstrInfo") { + visibility = [ ":tablegen" ] + args = [ "-gen-instr-info" ] + td_file = "../Sparc.td" +} + +tablegen("SparcGenMCCodeEmitter") { + visibility = [ ":MCTargetDesc" ] + args = [ "-gen-emitter" ] + td_file = "../Sparc.td" +} + +tablegen("SparcGenRegisterInfo") { + visibility = [ ":tablegen" ] + args = [ "-gen-register-info" ] + td_file = "../Sparc.td" +} + +tablegen("SparcGenSubtargetInfo") { + visibility = [ ":tablegen" ] + args = [ "-gen-subtarget" ] + td_file = "../Sparc.td" +} + +# This should contain tablegen targets generating .inc files included +# by other targets. .inc files only used by .cpp files in this directory +# should be in deps on the static_library instead. +group("tablegen") { + visibility = [ + ":MCTargetDesc", + "../TargetInfo", + ] + public_deps = [ + ":SparcGenInstrInfo", + ":SparcGenRegisterInfo", + ":SparcGenSubtargetInfo", + ] +} + +static_library("MCTargetDesc") { + output_name = "LLVMSparcDesc" + public_deps = [ + ":tablegen", + ] + deps = [ + ":SparcGenAsmWriter", + ":SparcGenMCCodeEmitter", + "//llvm/lib/MC", + "//llvm/lib/Support", + ] + include_dirs = [ ".." ] + sources = [ + "SparcAsmBackend.cpp", + "SparcELFObjectWriter.cpp", + "SparcInstPrinter.cpp", + "SparcMCAsmInfo.cpp", + "SparcMCCodeEmitter.cpp", + "SparcMCTargetDesc.cpp", + "SparcMCExpr.cpp", + "SparcTargetStreamer.cpp", + ] +} diff --git a/llvm/utils/gn/secondary/llvm/lib/Target/Sparc/TargetInfo/BUILD.gn b/llvm/utils/gn/secondary/llvm/lib/Target/Sparc/TargetInfo/BUILD.gn new file mode 100644 index 000000000000..908d66202de9 --- /dev/null +++ b/llvm/utils/gn/secondary/llvm/lib/Target/Sparc/TargetInfo/BUILD.gn @@ -0,0 +1,12 @@ +static_library("TargetInfo") { + output_name = "LLVMSparcInfo" + deps = [ + "//llvm/lib/IR", + "//llvm/lib/Support", + "//llvm/lib/Target/Sparc/MCTargetDesc", + ] + include_dirs = [ ".." ] + sources = [ + "SparcTargetInfo.cpp", + ] +} diff --git a/llvm/utils/gn/secondary/llvm/lib/Target/targets.gni b/llvm/utils/gn/secondary/llvm/lib/Target/targets.gni index c2a1ec6223ad..c9959ade5b36 100644 --- a/llvm/utils/gn/secondary/llvm/lib/Target/targets.gni +++ b/llvm/utils/gn/secondary/llvm/lib/Target/targets.gni @@ -25,6 +25,7 @@ if (llvm_targets_to_build == "host") { "BPF", "Lanai", "PowerPC", + "Sparc", "WebAssembly", "X86", ] @@ -45,8 +46,12 @@ foreach(target, llvm_targets_to_build) { llvm_build_ARM = true } else if (target == "BPF") { llvm_build_BPF = true + } else if (target == "Lanai") { + # Nothing to do. } else if (target == "PowerPC") { llvm_build_PowerPC = true + } else if (target == "Sparc") { + # Nothing to do. } else if (target == "WebAssembly") { llvm_build_WebAssembly = true } else if (target == "X86") {