1# Modified `clang/cutils/TableGen/clang_tablegen.gni` to suit the clspv build 2# structure. 3 4import("//build_overrides/clspv.gni") 5 6# This file introduces a template for running clang-tblgen. 7# 8# Parameters: 9# 10# args (required) 11# [list of strings] Flags to pass to clang-tblgen. 12# 13# output_name (optional) 14# Basename of the generated output file. 15# Defaults to target name with ".inc" appended. 16# 17# td_file (optional) 18# The .td file to pass to llvm-tblgen. 19# Defaults to target name with ".td" appended. 20# 21# visibility (optional) 22# GN's regular visibility attribute, see `gn help visibility`. 23# 24# Example of usage: 25# 26# clang_tablegen("DiagnosticGroups") { 27# args = [ "-gen-clang-diag-groups" ] 28# td_file = "Diagnostic.td" 29# } 30 31import("tablegen.gni") 32 33template("clang_tablegen") { 34 tablegen(target_name) { 35 forward_variables_from(invoker, 36 [ 37 "output_path", 38 "output_name", 39 "td_file", 40 "visibility", 41 ]) 42 43 args = [ 44 "-I", 45 rebase_path("//$clspv_llvm_dir/clang/include", root_build_dir), 46 ] + invoker.args 47 tblgen_target = "../tools:clspv-tool-clang-tblgen" 48 } 49} 50