Parse a function string attribute on CB as a decimal integer.

Synopsis

Declared in <llvm/Analysis/InlineCost.h>

std::optional<int>
getStringFnAttrAsInt(
    CallBase& CB,
    StringRef AttrKind);

Return Value

The parsed integer, or std::nullopt if the attribute is missing or not a valid integer.

Parameters

Name

Description

CB

Call site whose function attributes are inspected.

AttrKind

Name of the string attribute to parse.

Created with MrDocs