Be more careful in parsing Module::ModFlagBehavior value
[oota-llvm.git] / include / llvm / IR / Module.h
index 51d43af6365ffbaa28781314a5062748dc2aeedc..76ec1fd1ec802d161a91fef62c5249ee7ce2d3fd 100644 (file)
@@ -182,9 +182,17 @@ public:
     /// Appends the two values, which are required to be metadata
     /// nodes. However, duplicate entries in the second list are dropped
     /// during the append operation.
-    AppendUnique = 6
+    AppendUnique = 6,
+
+    // Markers:
+    ModFlagBehaviorFirstVal = Error,
+    ModFlagBehaviorLastVal = AppendUnique
   };
 
+  /// Checks if Value represents a valid ModFlagBehavior, and stores the
+  /// converted result in MFB.
+  static bool isValidModFlagBehavior(Value *V, ModFlagBehavior &MFB);
+
   struct ModuleFlagEntry {
     ModFlagBehavior Behavior;
     MDString *Key;