Method CreateAttribute
CreateAttribute(LazyEncodedString)
Creates a simple attribute without arguments
public AttributeValue CreateAttribute(LazyEncodedString name)
Parameters
nameLazyEncodedStringname of the attribute
Returns
- AttributeValue
AttributeValue of the attribute
CreateAttribute(LazyEncodedString, ulong)
Creates an attribute with an integer value parameter
public AttributeValue CreateAttribute(LazyEncodedString name, ulong value)
Parameters
nameLazyEncodedStringname of the attribute
valueulongValue for the attribute
Returns
- AttributeValue
AttributeValue with the specified kind and value
Remarks
Not all attributes support a value and those that do don't all support a full 64bit value. Se the LLVM docs for details.
CreateAttribute(LazyEncodedString, ITypeRef)
Create an attribute that accepts a type value
public AttributeValue CreateAttribute(LazyEncodedString name, ITypeRef value)
Parameters
nameLazyEncodedStringname of the attribute
valueITypeRefType value to create the attribute with
Returns
- AttributeValue
Attribute value
Exceptions
- ArgumentException
The
nameattribute does not accept a type argument
CreateAttribute(LazyEncodedString, uint, ulong[], ulong[])
Create an attribute that accepts a constant range value
public AttributeValue CreateAttribute(LazyEncodedString name, uint numBits, ulong[] lowWords, ulong[] upperWords)
Parameters
nameLazyEncodedStringname of the attribute
numBitsuintNumber of valid bits in the range values
lowWordsulong[]Array of bits composing the low end value of the range
upperWordsulong[]Array of bits composing the upper end value of the range
Returns
- AttributeValue
Attribute value
Remarks
A constant range, as the name implies, contains a range of constant values that are a lower bound
and upper bound for a range. The values of each end are an arbitrary precision integer (APInt)
and thus numBits indicates the total bit width of the values in the range.
Exceptions
- ArgumentException
The
namedoes not accept a constant range value
CreateAttribute(LazyEncodedString, LazyEncodedString)
Creates a string attribute with a value
public AttributeValue CreateAttribute(LazyEncodedString name, LazyEncodedString value)
Parameters
nameLazyEncodedStringAttribute name
valueLazyEncodedStringValue of the property
Returns
- AttributeValue
AttributeValue with the specified name