[PowerPC] Change PPCTargetInfo::hasFeature() to use StringSwitch

Implement post-commit comment on r220989 from Eric Christopher.

llvm-svn: 221099
This commit is contained in:
Bill Schmidt 2014-11-02 14:56:41 +00:00
parent 778fcc770b
commit e6e9d15d5f
1 changed files with 5 additions and 3 deletions

View File

@ -1136,9 +1136,11 @@ void PPCTargetInfo::getDefaultFeatures(llvm::StringMap<bool> &Features) const {
}
bool PPCTargetInfo::hasFeature(StringRef Feature) const {
return (Feature == "powerpc" ||
(Feature == "vsx" && HasVSX) ||
(Feature == "power8-vector" && HasP8Vector));
return llvm::StringSwitch<bool>(Feature)
.Case("powerpc", true)
.Case("vsx", HasVSX)
.Case("power8-vector", HasP8Vector)
.Default(false);
}