/// @brief Attributes that only apply to function parameters.
const Attributes ParameterOnly = ByVal | Nest | StructRet;
-/// @brief Attributes that only apply to function return values.
-const Attributes ReturnOnly = NoReturn | NoUnwind | ReadNone | ReadOnly;
+/// @brief Attributes that only apply to function.
+const Attributes FunctionOnly = NoReturn | NoUnwind | ReadNone | ReadOnly;
/// @brief Parameter attributes that do not apply to vararg call arguments.
const Attributes VarArgsIncompatible = StructRet;
Assert1(!RetI, "Attribute " + Attribute::getAsString(RetI) +
" does not apply to return values!", V);
} else {
- Attributes ParmI = Attrs & Attribute::ReturnOnly;
+ Attributes ParmI = Attrs & Attribute::FunctionOnly;
Assert1(!ParmI, "Attribute " + Attribute::getAsString(ParmI) +
" only applies to return values!", V);
}
}
Attributes FAttrs = Attrs.getFnAttributes();
+ Assert1(!(FAttrs & (!Attribute::FunctionOnly)),
+ "Attribute " + Attribute::getAsString(FAttrs) +
+ " does not apply to function!", V);
+
for (unsigned i = 0;
i < array_lengthof(Attribute::MutuallyIncompatible); ++i) {
Attributes MutI = FAttrs & Attribute::MutuallyIncompatible[i];