[llvm-dev] How to get list of supported CPUs and features?

Antoine Pitrou via llvm-dev llvm-dev at lists.llvm.org
Tue Mar 15 11:42:26 PDT 2016


Hi,

I'm looking for a way to programmatically get the list of supported CPU
and feature strings for a given architecture (say the current triple).
As far as I've been able to find, the CLI dumping of that information
(when using "-mcpu=help") is done in SubtargetFeatures::getFeatureBits
(which seems a weird place to do that), but that relies on private
fields (ProcDesc, ProcFeatures) tucked in the MCSubtargetInfo class,
therefore I don't know how to fetch that information.

Is there an easy way to do what I'm looking to do? (short of
redirecting stderr and intercepting /parsing the help output...)

Regards

Antoine.




More information about the llvm-dev mailing list