[PowerPC] Change PPCTargetInfo::hasFeature() to use StringSwitch
authorBill Schmidt <wschmidt@linux.vnet.ibm.com>
Sun, 2 Nov 2014 14:56:41 +0000 (14:56 +0000)
committerBill Schmidt <wschmidt@linux.vnet.ibm.com>
Sun, 2 Nov 2014 14:56:41 +0000 (14:56 +0000)
Implement post-commit comment on r220989 from Eric Christopher.

llvm-svn: 221099

clang/lib/Basic/Targets.cpp

index c9c05b8..261b441 100644 (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);
 }