1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00

Fix function attribute verification check.

Thanks Duncan!

llvm-svn: 57029
This commit is contained in:
Devang Patel 2008-10-03 21:11:02 +00:00
parent 27d8955b8f
commit 0d22d8ebdb
2 changed files with 7 additions and 7 deletions

View File

@ -54,7 +54,8 @@ const Attributes Alignment = 0xffff<<16; ///< Alignment of parameter (16 bits)
const Attributes ParameterOnly = ByVal | Nest | StructRet;
/// @brief Attributes that only apply to function.
const Attributes FunctionOnly = NoReturn | NoUnwind | ReadNone | ReadOnly;
const Attributes FunctionOnly = NoReturn | NoUnwind | ReadNone | ReadOnly |
NoInline | AlwaysInline | OptimizeForSize;
/// @brief Parameter attributes that do not apply to vararg call arguments.
const Attributes VarArgsIncompatible = StructRet;

View File

@ -415,12 +415,11 @@ void Verifier::VerifyAttrs(Attributes Attrs, const Type *Ty,
Attributes RetI = Attrs & Attribute::ParameterOnly;
Assert1(!RetI, "Attribute " + Attribute::getAsString(RetI) +
" does not apply to return values!", V);
} else {
Attributes ParmI = Attrs & Attribute::FunctionOnly;
Assert1(!ParmI, "Attribute " + Attribute::getAsString(ParmI) +
" only applies to return values!", V);
}
Attributes FnCheckAttr = Attrs & Attribute::FunctionOnly;
Assert1(!FnCheckAttr, "Attribute " + Attribute::getAsString(FnCheckAttr) +
" only applies to return values!", V);
for (unsigned i = 0;
i < array_lengthof(Attribute::MutuallyIncompatible); ++i) {
Attributes MutI = Attrs & Attribute::MutuallyIncompatible[i];
@ -477,7 +476,7 @@ void Verifier::VerifyFunctionAttrs(const FunctionType *FT,
}
Attributes FAttrs = Attrs.getFnAttributes();
Assert1(!(FAttrs & (!Attribute::FunctionOnly)),
Assert1(!(FAttrs & (~Attribute::FunctionOnly)),
"Attribute " + Attribute::getAsString(FAttrs) +
" does not apply to function!", V);