/// @name Utility functions for querying and setting PGO summary
/// @{
- /// \brief Set maximum function count in PGO mode
- void setMaximumFunctionCount(uint64_t);
-
- /// \brief Returns maximum function count in PGO mode
- Optional<uint64_t> getMaximumFunctionCount();
-
/// \brief Attach profile summary metadata to this module.
void setProfileSummary(Metadata *M);
addModuleFlag(ModFlagBehavior::Error, "PIE Level", PL);
}
-void Module::setMaximumFunctionCount(uint64_t Count) {
- addModuleFlag(ModFlagBehavior::Error, "MaxFunctionCount", Count);
-}
-
-Optional<uint64_t> Module::getMaximumFunctionCount() {
- auto *Val =
- cast_or_null<ConstantAsMetadata>(getModuleFlag("MaxFunctionCount"));
- if (!Val)
- return None;
- return cast<ConstantInt>(Val->getValue())->getZExtValue();
-}
-
void Module::setProfileSummary(Metadata *M) {
addModuleFlag(ModFlagBehavior::Error, "ProfileSummary", M);
}