Method CreateAttribute
CreateAttribute(LazyEncodedString)
Creates a simple attribute without arguments
public AttributeValue CreateAttribute(LazyEncodedString name)
Parameters
name
LazyEncodedStringname 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
name
LazyEncodedStringname of the attribute
value
ulongValue 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
name
LazyEncodedStringname of the attribute
value
ITypeRefType value to create the attribute with
Returns
- AttributeValue
Attribute value
Exceptions
- ArgumentException
The
name
attribute 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
name
LazyEncodedStringname of the attribute
numBits
uintNumber of valid bits in the range values
lowWords
ulong[]Array of bits composing the low end value of the range
upperWords
ulong[]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
name
does not accept a constant range value
CreateAttribute(LazyEncodedString, LazyEncodedString)
Creates a string attribute with a value
public AttributeValue CreateAttribute(LazyEncodedString name, LazyEncodedString value)
Parameters
name
LazyEncodedStringAttribute name
value
LazyEncodedStringValue of the property
Returns
- AttributeValue
AttributeValue with the specified name