Use the enum instead of 'unsigned'.
authorBill Wendling <isanbard@gmail.com>
Wed, 15 Feb 2012 23:27:50 +0000 (23:27 +0000)
committerBill Wendling <isanbard@gmail.com>
Wed, 15 Feb 2012 23:27:50 +0000 (23:27 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150632 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Module.h
lib/VMCore/Module.cpp

index e068f93deb39f58f4020cc8fe9c7a801d0df4fce..c331837f818878a189be3381d87ba2fec997b8d7 100644 (file)
@@ -180,10 +180,10 @@ public:
   enum ModAttrBehavior { Error = 1, Warning  = 2, Require = 3, Override = 4 };
 
   struct ModuleFlagEntry {
-    unsigned Behavior;
+    ModAttrBehavior Behavior;
     MDString *Key;
     Value *Val;
-    ModuleFlagEntry(unsigned B, MDString *K, Value *V)
+    ModuleFlagEntry(ModAttrBehavior B, MDString *K, Value *V)
       : Behavior(B), Key(K), Val(V) {}
   };
 
index 9de5db5a2b255b6ff5cc6ba39c52ff37264fab47..cc6ae0e000f76f09cfc21402d5e8cf7daa5621c1 100644 (file)
@@ -339,7 +339,8 @@ getModuleFlagsMetadata(SmallVectorImpl<ModuleFlagEntry> &Flags) const {
     ConstantInt *Behavior = cast<ConstantInt>(Flag->getOperand(0));
     MDString *Key = cast<MDString>(Flag->getOperand(1));
     Value *Val = Flag->getOperand(2);
-    Flags.push_back(ModuleFlagEntry(Behavior->getZExtValue(), Key, Val));
+    Flags.push_back(ModuleFlagEntry(ModAttrBehavior(Behavior->getZExtValue()),
+                                    Key, Val));
   }
 }