| # This file introduces a templates for running clang-tblgen. |
| # |
| # Parameters: |
| # |
| # args (required) |
| # [list of strings] Flags to pass to llvm-tblgen. |
| # |
| # output_name (optional) |
| # Basename of the generated output file. |
| # Defaults to target name with ".inc" appended. |
| # |
| # td_file (optional) |
| # The .td file to pass to llvm-tblgen. |
| # Defaults to target name with ".td" appended. |
| # |
| # visibility (optional) |
| # GN's regular visibility attribute, see `gn help visibility`. |
| # |
| # Example of usage: |
| # |
| # clang_tablegen("DiagnosticGroups") { |
| # args = [ "-gen-clang-diag-groups" ] |
| # td_file = "Diagnostic.td" |
| # } |
| |
| import("//llvm/utils/TableGen/tablegen.gni") |
| |
| template("clang_tablegen") { |
| tablegen(target_name) { |
| forward_variables_from(invoker, |
| [ |
| "args", |
| "output_name", |
| "td_file", |
| "visibility", |
| ]) |
| |
| tblgen_target = "//clang/utils/TableGen:clang-tblgen" |
| } |
| } |