blob: efc1e3c5d5427ae0474e5d3d4499117c87b20634 [file] [log] [blame]
# 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"
}
}