The problem is as follows:
Say I have created a file file.td, where I need to include the Target.td
file:
(adapted from this stackoverflow post)
include "/<user-home>/llvm-project/llvm/include/llvm/Target/Target.td"
class Test<bits<3> num, string n, list<string> altNames> : Register<n, altNames> {
field bits<3> Num = num;
let Namespace = "Test";
}
foreach num = 0-9 in
def Z#num : Test<num, "Z"#num>;
def Zrc : RegisterClass<"Test", [i32, f32], 32,
(sequence "Z%u", 0, 9)>;
Now, to generate the record, I am using the following command:
llvm-tblgen -print-records file.td -I /<user-home>/llvm-project/llvm/include/llvm/Target/ -I /<user-home>/llvm-project/llvm/include/llvm/IR/
The above command generates the following error:
/<user-home>/llvm-project/llvm/include/llvm/Target/Target.td:15:9: error: Could not find include file 'llvm/IR/Intrinsics.td'
include "llvm/IR/Intrinsics.td"
^
So, the question is, while using the llvm-tblgen
command, is there a way to handle the relative include paths defined in the system .td
files?