MachineFunction: Make LastProperty an alias of the last property
authorMatthias Braun <matze@braunis.de>
Fri, 19 Aug 2016 22:31:42 +0000 (22:31 +0000)
committerMatthias Braun <matze@braunis.de>
Fri, 19 Aug 2016 22:31:42 +0000 (22:31 +0000)
This avoids unnecessary cases in switch statements covering all
properties.

llvm-svn: 279337

llvm/include/llvm/CodeGen/MachineFunction.h
llvm/lib/CodeGen/MachineFunction.cpp

index b349785..e0c7dd2 100644 (file)
@@ -127,7 +127,7 @@ public:
     Legalized,
     RegBankSelected,
     Selected,
-    LastProperty,
+    LastProperty = Selected,
   };
 
   bool hasProperty(Property P) const {
@@ -161,7 +161,7 @@ public:
 
 private:
   BitVector Properties =
-      BitVector(static_cast<unsigned>(Property::LastProperty));
+      BitVector(static_cast<unsigned>(Property::LastProperty)+1);
 };
 
 class MachineFunction {
index c84faaf..4cdb6c8 100644 (file)
@@ -85,8 +85,6 @@ void MachineFunctionProperties::print(raw_ostream &ROS, bool OnlySet) const {
       case Property::Selected:
         ROS << (HasProperty ? "" : "not ") << "selected";
         break;
-      default:
-        break;
     }
   }
 #endif