-
Notifications
You must be signed in to change notification settings - Fork 12.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Patch from David L. Jones <dlj@google.com>, with minor tweaks by me. Differential Revision: https://reviews.llvm.org/D61821 llvm-svn: 363154
- Loading branch information
Showing
7 changed files
with
234 additions
and
0 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
llvm/utils/gn/secondary/llvm/lib/Target/RISCV/AsmParser/BUILD.gn
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| import("//llvm/utils/TableGen/tablegen.gni") | ||
|
|
||
| tablegen("RISCVGenAsmMatcher") { | ||
| visibility = [ ":AsmParser" ] | ||
| args = [ "-gen-asm-matcher" ] | ||
| td_file = "../RISCV.td" | ||
| } | ||
|
|
||
| static_library("AsmParser") { | ||
| output_name = "LLVMRISCVAsmParser" | ||
| deps = [ | ||
| ":RISCVGenAsmMatcher", | ||
| "//llvm/lib/MC", | ||
| "//llvm/lib/MC/MCParser", | ||
| "//llvm/lib/Support", | ||
| "//llvm/lib/Target/RISCV:RISCVGenCompressInstEmitter", | ||
| "//llvm/lib/Target/RISCV/MCTargetDesc", | ||
| "//llvm/lib/Target/RISCV/Utils", | ||
| ] | ||
| include_dirs = [ ".." ] | ||
| sources = [ | ||
| "RISCVAsmParser.cpp", | ||
| ] | ||
| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| import("//llvm/utils/TableGen/tablegen.gni") | ||
|
|
||
| # RISCV is the only target that has a "compress instr emitter", and it's | ||
| # a bit strange in that it defines static functions depending on which | ||
| # defines are set. Instead of housing these functions in one library, | ||
| # various libraries include the generated .inc file with different defines set. | ||
| tablegen("RISCVGenCompressInstEmitter") { | ||
| visibility = [ | ||
| ":LLVMRISCVCodeGen", | ||
| "AsmParser", | ||
| "MCTargetDesc", | ||
| ] | ||
| args = [ "-gen-compress-inst-emitter" ] | ||
| td_file = "RISCV.td" | ||
| } | ||
|
|
||
| tablegen("RISCVGenDAGISel") { | ||
| visibility = [ ":LLVMRISCVCodeGen" ] | ||
| args = [ "-gen-dag-isel" ] | ||
| td_file = "RISCV.td" | ||
| } | ||
|
|
||
| tablegen("RISCVGenMCPseudoLowering") { | ||
| visibility = [ ":LLVMRISCVCodeGen" ] | ||
| args = [ "-gen-pseudo-lowering" ] | ||
| td_file = "RISCV.td" | ||
| } | ||
|
|
||
| static_library("LLVMRISCVCodeGen") { | ||
| deps = [ | ||
| ":RISCVGenCompressInstEmitter", | ||
| ":RISCVGenDAGISel", | ||
| ":RISCVGenMCPseudoLowering", | ||
| "MCTargetDesc", | ||
| "TargetInfo", | ||
| "Utils", | ||
| "//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 = [ | ||
| "RISCVAsmPrinter.cpp", | ||
| "RISCVExpandPseudoInsts.cpp", | ||
| "RISCVFrameLowering.cpp", | ||
| "RISCVISelDAGToDAG.cpp", | ||
| "RISCVISelLowering.cpp", | ||
| "RISCVInstrInfo.cpp", | ||
| "RISCVMCInstLower.cpp", | ||
| "RISCVMergeBaseOffset.cpp", | ||
| "RISCVRegisterInfo.cpp", | ||
| "RISCVSubtarget.cpp", | ||
| "RISCVTargetMachine.cpp", | ||
| "RISCVTargetObjectFile.cpp", | ||
| ] | ||
| } | ||
|
|
||
| # This is a bit different from most build files: Due to this group | ||
| # having the directory's name, "//llvm/lib/Target/RISCV" 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("RISCV") { | ||
| deps = [ | ||
| ":LLVMRISCVCodeGen", | ||
| "AsmParser", | ||
| "Disassembler", | ||
| "MCTargetDesc", | ||
| "TargetInfo", | ||
| "Utils", | ||
| ] | ||
| } |
22 changes: 22 additions & 0 deletions
22
llvm/utils/gn/secondary/llvm/lib/Target/RISCV/Disassembler/BUILD.gn
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| import("//llvm/utils/TableGen/tablegen.gni") | ||
|
|
||
| tablegen("RISCVGenDisassemblerTables") { | ||
| visibility = [ ":Disassembler" ] | ||
| args = [ "-gen-disassembler" ] | ||
| td_file = "../RISCV.td" | ||
| } | ||
|
|
||
| static_library("Disassembler") { | ||
| output_name = "LLVMRISCVDisassembler" | ||
| deps = [ | ||
| ":RISCVGenDisassemblerTables", | ||
| "//llvm/lib/MC/MCDisassembler", | ||
| "//llvm/lib/Support", | ||
| "//llvm/lib/Target/RISCV/MCTargetDesc", | ||
| "//llvm/lib/Target/RISCV/Utils", | ||
| ] | ||
| include_dirs = [ ".." ] | ||
| sources = [ | ||
| "RISCVDisassembler.cpp", | ||
| ] | ||
| } |
73 changes: 73 additions & 0 deletions
73
llvm/utils/gn/secondary/llvm/lib/Target/RISCV/MCTargetDesc/BUILD.gn
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| import("//llvm/utils/TableGen/tablegen.gni") | ||
|
|
||
| tablegen("RISCVGenAsmWriter") { | ||
| visibility = [ ":MCTargetDesc" ] | ||
| args = [ "-gen-asm-writer" ] | ||
| td_file = "../RISCV.td" | ||
| } | ||
|
|
||
| tablegen("RISCVGenInstrInfo") { | ||
| visibility = [ ":tablegen" ] | ||
| args = [ "-gen-instr-info" ] | ||
| td_file = "../RISCV.td" | ||
| } | ||
|
|
||
| tablegen("RISCVGenMCCodeEmitter") { | ||
| visibility = [ ":MCTargetDesc" ] | ||
| args = [ "-gen-emitter" ] | ||
| td_file = "../RISCV.td" | ||
| } | ||
|
|
||
| tablegen("RISCVGenRegisterInfo") { | ||
| visibility = [ ":tablegen" ] | ||
| args = [ "-gen-register-info" ] | ||
| td_file = "../RISCV.td" | ||
| } | ||
|
|
||
| tablegen("RISCVGenSubtargetInfo") { | ||
| visibility = [ ":tablegen" ] | ||
| args = [ "-gen-subtarget" ] | ||
| td_file = "../RISCV.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", | ||
| "../Utils", | ||
| ] | ||
| public_deps = [ | ||
| ":RISCVGenInstrInfo", | ||
| ":RISCVGenRegisterInfo", | ||
| ":RISCVGenSubtargetInfo", | ||
| ] | ||
| } | ||
|
|
||
| static_library("MCTargetDesc") { | ||
| output_name = "LLVMRISCVDesc" | ||
| public_deps = [ | ||
| ":tablegen", | ||
| ] | ||
| deps = [ | ||
| ":RISCVGenAsmWriter", | ||
| ":RISCVGenMCCodeEmitter", | ||
| "//llvm/lib/MC", | ||
| "//llvm/lib/Support", | ||
| "//llvm/lib/Target/RISCV:RISCVGenCompressInstEmitter", | ||
| "//llvm/lib/Target/RISCV/Utils", | ||
| ] | ||
| include_dirs = [ ".." ] | ||
| sources = [ | ||
| "RISCVAsmBackend.cpp", | ||
| "RISCVELFObjectWriter.cpp", | ||
| "RISCVELFStreamer.cpp", | ||
| "RISCVInstPrinter.cpp", | ||
| "RISCVMCAsmInfo.cpp", | ||
| "RISCVMCCodeEmitter.cpp", | ||
| "RISCVMCExpr.cpp", | ||
| "RISCVMCTargetDesc.cpp", | ||
| "RISCVTargetStreamer.cpp", | ||
| ] | ||
| } |
10 changes: 10 additions & 0 deletions
10
llvm/utils/gn/secondary/llvm/lib/Target/RISCV/TargetInfo/BUILD.gn
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| static_library("TargetInfo") { | ||
| output_name = "LLVMRISCVInfo" | ||
| deps = [ | ||
| "//llvm/lib/Support", | ||
| ] | ||
| include_dirs = [ ".." ] | ||
| sources = [ | ||
| "RISCVTargetInfo.cpp", | ||
| ] | ||
| } |
25 changes: 25 additions & 0 deletions
25
llvm/utils/gn/secondary/llvm/lib/Target/RISCV/Utils/BUILD.gn
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| import("//llvm/utils/TableGen/tablegen.gni") | ||
|
|
||
| tablegen("RISCVGenSystemOperands") { | ||
| visibility = [ ":Utils" ] | ||
| args = [ "-gen-searchable-tables" ] | ||
| td_file = "../RISCV.td" | ||
| } | ||
|
|
||
| static_library("Utils") { | ||
| output_name = "LLVMRISCVUtils" | ||
| public_deps = [ | ||
| ":RISCVGenSystemOperands", | ||
| ] | ||
| deps = [ | ||
| "//llvm/lib/MC", | ||
| "//llvm/lib/Support", | ||
| "//llvm/lib/Target/RISCV/MCTargetDesc:tablegen", | ||
| ] | ||
|
|
||
| include_dirs = [ ".." ] | ||
| sources = [ | ||
| "RISCVBaseInfo.cpp", | ||
| "RISCVMatInt.cpp", | ||
| ] | ||
| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters