zero-size arrays

Hi all,
I’m new to LLVM. I’m trying to write a backend for a custom CPU ABC. I have these errors when I build the project.

ABCGenSubtargetInfo.inc:25:39: error: zero-size array ‘llvm::ABCSubTypeKV’
extern const llvm::SubtargetFeatureKV ABCSubTypeKV[] = {

ABCGenSubtargetInfo.inc:69:36: error: zero-size array ‘llvm::ABCProcSchedKV’
extern const llvm::SubtargetInfoKV ABCProcSchedKV[] = {

My understanding is that those arrays are auto-generated from the .td files but I do not know why they are empty.

Any help would be appreciated.
Thanks.

Hi,

My understanding is that those arrays are auto-generated from the .td files but I do not know why they are empty.

I think you populate them by instantiating SubtargetFeature in your
.td files. Most real targets have at least some variation in permitted
configurations that these represent: variation in the instruction set
the CPU supports or which instructions are fast on a particular CPU,
or even soft vs hard-float.

If yours doesn't have such variation yet you might need to add a dummy
feature for now. It'll probably also need to be put into ABCSubtarget,
but the new and interesting error messages should guide you on that
front.

Cheers.

Tim.