This is an archive of the discontinued LLVM Phabricator instance.

Filter out invalid 'target' items from being passed to LLVM
ClosedPublic

Authored by erichkeane on Oct 26 2017, 6:34 PM.

Details

Summary

Craig noticed that CodeGen wasn't properly ignoring the
values sent to the target attribute. This patch ignores
them.

This patch also sets the 'default' for this checking to
'supported', since only X86 has implemented the support
for checking valid CPU names and Feature Names.

One test was changed to i686, since it uses a lakemont,
which would otherwise be prohibited in x86_64.

Diff Detail

Repository
rL LLVM

Event Timeline

erichkeane created this revision.Oct 26 2017, 6:34 PM
erichkeane added inline comments.
lib/Basic/Targets/X86.cpp
1173 ↗(On Diff #120528)

A test also revealed that we forgot this as well. Craig just added sse4, which was also missing.

craig.topper added inline comments.Oct 27 2017, 11:08 AM
lib/CodeGen/CodeGenModule.cpp
4586 ↗(On Diff #120528)

Use llvm::remove_if which takes a type that has a range?

Switched to llvm::remove_if(RANGE, lambda) instead of std::remove_if with begin/end per Craig's suggestion.

This revision is now accepted and ready to land.Oct 27 2017, 11:26 AM
This revision was automatically updated to reflect the committed changes.