aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/llvm/Attributes.h3
-rw-r--r--lib/VMCore/Verifier.cpp11
2 files changed, 7 insertions, 7 deletions
diff --git a/include/llvm/Attributes.h b/include/llvm/Attributes.h
index 50a4cef9ea..685ee2767b 100644
--- a/include/llvm/Attributes.h
+++ b/include/llvm/Attributes.h
@@ -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;
diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp
index f8cd7780ae..820bf33bc9 100644
--- a/lib/VMCore/Verifier.cpp
+++ b/lib/VMCore/Verifier.cpp
@@ -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);