Add a module flags accessor method which returns the flags in a vector.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150623 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Bill Wendling
2012-02-15 22:34:20 +00:00
parent 01d53ec176
commit f20f281368
2 changed files with 26 additions and 0 deletions

View File

@@ -179,6 +179,14 @@ public:
/// values.
enum ModAttrBehavior { Error = 1, Warning = 2, Require = 3, Override = 4 };
struct ModuleFlagEntry {
unsigned Behavior;
MDString *Key;
Value *Val;
ModuleFlagEntry(unsigned B, MDString *K, Value *V)
: Behavior(B), Key(K), Val(V) {}
};
/// @}
/// @name Member Variables
/// @{
@@ -401,6 +409,9 @@ public:
/// @name Module Flags Accessors
/// @{
/// getModuleFlagsMetadata - Returns the module flags in the provided vector.
void getModuleFlagsMetadata(SmallVectorImpl<ModuleFlagEntry> &Flags) const;
/// getModuleFlagsMetadata - Returns the NamedMDNode in the module that
/// represents module-level flags. This method returns null if there are no
/// module-level flags.