[llvm-dev] zero-size arrays

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[llvm-dev] zero-size arrays

David Jones via llvm-dev

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.


_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] zero-size arrays

David Jones via llvm-dev
Hi,

On Wed, 17 Oct 2018 at 10:07, m m via llvm-dev <[hidden email]> wrote:
> 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.
_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev