Use the enum instead of 'unsigned'.

llvm-svn: 150632
This commit is contained in:
Bill Wendling 2012-02-15 23:27:50 +00:00
parent 7381907e65
commit 399eae61e9
2 changed files with 4 additions and 3 deletions

View 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) {}
};

View 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));
}
}