Skip to content

Commit

Permalink
gn build: Add SystemZ target
Browse files Browse the repository at this point in the history
llvm-svn: 363170
  • Loading branch information
nico committed Jun 12, 2019
1 parent f29366b commit cae2c85
Show file tree
Hide file tree
Showing 7 changed files with 194 additions and 1 deletion.
2 changes: 1 addition & 1 deletion llvm/utils/gn/TODO.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Ideas for things to do:
- once there are more projects, have an llvm_enable_projects arg, modeled
after llvm_targets_to_build in the GN build
- a check-all build target that runs test of all projects
- more targets (AMDGPU ARC AVR MSP430 NVPTX SystemZ XCore)
- more targets (AMDGPU ARC AVR MSP430 NVPTX XCore)
- example: https://reviews.llvm.org/D56416
- investigate feasibility of working `gn check`

Expand Down
23 changes: 23 additions & 0 deletions llvm/utils/gn/secondary/llvm/lib/Target/SystemZ/AsmParser/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import("//llvm/utils/TableGen/tablegen.gni")

tablegen("SystemZGenAsmMatcher") {
visibility = [ ":AsmParser" ]
args = [ "-gen-asm-matcher" ]
td_file = "../SystemZ.td"
}

static_library("AsmParser") {
output_name = "LLVMSystemZAsmParser"
deps = [
":SystemZGenAsmMatcher",
"//llvm/lib/MC",
"//llvm/lib/MC/MCParser",
"//llvm/lib/Support",
"//llvm/lib/Target/SystemZ/MCTargetDesc",
"//llvm/lib/Target/SystemZ/TargetInfo",
]
include_dirs = [ ".." ]
sources = [
"SystemZAsmParser.cpp",
]
}
74 changes: 74 additions & 0 deletions llvm/utils/gn/secondary/llvm/lib/Target/SystemZ/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import("//llvm/utils/TableGen/tablegen.gni")

tablegen("SystemZGenCallingConv") {
visibility = [ ":LLVMSystemZCodeGen" ]
args = [ "-gen-callingconv" ]
td_file = "SystemZ.td"
}

tablegen("SystemZGenDAGISel") {
visibility = [ ":LLVMSystemZCodeGen" ]
args = [ "-gen-dag-isel" ]
td_file = "SystemZ.td"
}

static_library("LLVMSystemZCodeGen") {
deps = [
":SystemZGenCallingConv",
":SystemZGenDAGISel",
"MCTargetDesc",
"TargetInfo",
"//llvm/include/llvm/Config:llvm-config",
"//llvm/lib/Analysis",
"//llvm/lib/CodeGen",
"//llvm/lib/CodeGen/AsmPrinter",
"//llvm/lib/CodeGen/SelectionDAG",
"//llvm/lib/IR",
"//llvm/lib/MC",
"//llvm/lib/Support",
"//llvm/lib/Target",
"//llvm/lib/Transforms/Scalar",
]
include_dirs = [ "." ]
sources = [
"SystemZAsmPrinter.cpp",
"SystemZCallingConv.cpp",
"SystemZConstantPoolValue.cpp",
"SystemZElimCompare.cpp",
"SystemZExpandPseudo.cpp",
"SystemZFrameLowering.cpp",
"SystemZHazardRecognizer.cpp",
"SystemZISelDAGToDAG.cpp",
"SystemZISelLowering.cpp",
"SystemZInstrInfo.cpp",
"SystemZLDCleanup.cpp",
"SystemZLongBranch.cpp",
"SystemZMCInstLower.cpp",
"SystemZMachineFunctionInfo.cpp",
"SystemZMachineScheduler.cpp",
"SystemZPostRewrite.cpp",
"SystemZRegisterInfo.cpp",
"SystemZSelectionDAGInfo.cpp",
"SystemZShortenInst.cpp",
"SystemZSubtarget.cpp",
"SystemZTDC.cpp",
"SystemZTargetMachine.cpp",
"SystemZTargetTransformInfo.cpp",
]
}

# This is a bit different from most build files: Due to this group
# having the directory's name, "//llvm/lib/Target/SystemZ" 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("SystemZ") {
deps = [
":LLVMSystemZCodeGen",
"AsmParser",
"Disassembler",
"MCTargetDesc",
"TargetInfo",
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import("//llvm/utils/TableGen/tablegen.gni")

tablegen("SystemZGenDisassemblerTables") {
visibility = [ ":Disassembler" ]
args = [ "-gen-disassembler" ]
td_file = "../SystemZ.td"
}

static_library("Disassembler") {
output_name = "LLVMSystemZDisassembler"
deps = [
":SystemZGenDisassemblerTables",
"//llvm/lib/MC",
"//llvm/lib/MC/MCDisassembler",
"//llvm/lib/Support",
"//llvm/lib/Target/SystemZ/MCTargetDesc",
"//llvm/lib/Target/SystemZ/TargetInfo",
]
include_dirs = [ ".." ]
sources = [
"SystemZDisassembler.cpp",
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import("//llvm/utils/TableGen/tablegen.gni")

tablegen("SystemZGenAsmWriter") {
visibility = [ ":MCTargetDesc" ]
args = [ "-gen-asm-writer" ]
td_file = "../SystemZ.td"
}

tablegen("SystemZGenInstrInfo") {
visibility = [ ":MCTargetDesc" ]
args = [ "-gen-instr-info" ]
td_file = "../SystemZ.td"
}

tablegen("SystemZGenMCCodeEmitter") {
visibility = [ ":MCTargetDesc" ]
args = [ "-gen-emitter" ]
td_file = "../SystemZ.td"
}

tablegen("SystemZGenRegisterInfo") {
visibility = [ ":MCTargetDesc" ]
args = [ "-gen-register-info" ]
td_file = "../SystemZ.td"
}

tablegen("SystemZGenSubtargetInfo") {
visibility = [ ":MCTargetDesc" ]
args = [ "-gen-subtarget" ]
td_file = "../SystemZ.td"
}

static_library("MCTargetDesc") {
output_name = "LLVMSystemZDesc"

# 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.
public_deps = [
":SystemZGenInstrInfo",
":SystemZGenRegisterInfo",
":SystemZGenSubtargetInfo",
]
deps = [
":SystemZGenAsmWriter",
":SystemZGenMCCodeEmitter",
"//llvm/lib/MC",
"//llvm/lib/Support",
"//llvm/lib/Target/SystemZ/TargetInfo",
]
include_dirs = [ ".." ]
sources = [
"SystemZInstPrinter.cpp",
"SystemZMCAsmBackend.cpp",
"SystemZMCAsmInfo.cpp",
"SystemZMCCodeEmitter.cpp",
"SystemZMCObjectWriter.cpp",
"SystemZMCTargetDesc.cpp",
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
static_library("TargetInfo") {
output_name = "LLVMSystemZInfo"
deps = [
"//llvm/lib/Support",
]
include_dirs = [ ".." ]
sources = [
"SystemZTargetInfo.cpp",
]
}
3 changes: 3 additions & 0 deletions llvm/utils/gn/secondary/llvm/lib/Target/targets.gni
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ if (llvm_targets_to_build == "host") {
"Mips",
"PowerPC",
"Sparc",
"SystemZ",
"WebAssembly",
"X86",
]
Expand Down Expand Up @@ -60,6 +61,8 @@ foreach(target, llvm_targets_to_build) {
# Nothing to do.
} else if (target == "Sparc") {
# Nothing to do.
} else if (target == "SystemZ") {
# Nothing to do.
} else if (target == "WebAssembly") {
llvm_build_WebAssembly = true
} else if (target == "X86") {
Expand Down

0 comments on commit cae2c85

Please sign in to comment.