This is an archive of the discontinued LLVM Phabricator instance.

Add isValidCPUName and isValidFeature to TargetInfo
ClosedPublic

Authored by erichkeane on Jul 18 2017, 10:39 AM.

Details

Summary

These two functions are really useful for implementations of attributes (including attribute-target), so add the functionality.

Diff Detail

Event Timeline

echristo edited edge metadata.Jul 18 2017, 12:18 PM

Can you update the code in CGBuiltin to use this as part of this patch? :)

Thanks!

Can you update the code in CGBuiltin to use this as part of this patch? :)

Thanks!

I'm not sure which you're referring to? I don't see a bit in CGBuiltin that checks for a subset of the "Features", however it is a much smaller list (since it is only things that the compiler-rt can check). Is it perhaps more closely related to that one?

Fixed a rebase issue, didn't do anything in CGBuiltin yet.

craig.topper added inline comments.Jul 18 2017, 9:50 PM
lib/Basic/Targets.cpp
2931

Use LLVM_FALLTHROUGH?

erichkeane marked an inline comment as done.

Changed fallthrough for Craig

Can you update the code in CGBuiltin to use this as part of this patch? :)

Thanks!

I'm not sure which you're referring to? I don't see a bit in CGBuiltin that checks for a subset of the "Features", however it is a much smaller list (since it is only things that the compiler-rt can check). Is it perhaps more closely related to that one?

It's currently checking for a subset, but that's just because it was the subset that the compiler-rt support supported. After Craig's patch I think we can just support them all unless I'm misreading something.

<insert comment about offline discussion about the two lists unfortunately not syncing>

LGTM.

-eric

echristo accepted this revision.Jul 19 2017, 2:37 PM
This revision is now accepted and ready to land.Jul 19 2017, 2:37 PM
erichkeane closed this revision.Jul 19 2017, 2:57 PM

Forgot the svn commit message part, but closed by the related revision. r308530