Return the corresponding value if Key appears in module flags, otherwise return null.
| 310 | /// Return the corresponding value if Key appears in module flags, otherwise |
| 311 | /// return null. |
| 312 | Metadata *Module::getModuleFlag(StringRef Key) const { |
| 313 | SmallVector<Module::ModuleFlagEntry, 8> ModuleFlags; |
| 314 | getModuleFlagsMetadata(ModuleFlags); |
| 315 | for (const ModuleFlagEntry &MFE : ModuleFlags) { |
| 316 | if (Key == MFE.Key->getString()) |
| 317 | return MFE.Val; |
| 318 | } |
| 319 | return nullptr; |
| 320 | } |
| 321 | |
| 322 | /// getModuleFlagsMetadata - Returns the NamedMDNode in the module that |
| 323 | /// represents module-level flags. This method returns null if there are no |