diff options
author | Devang Patel <dpatel@apple.com> | 2008-10-03 17:50:00 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2008-10-03 17:50:00 +0000 |
commit | 6d1b8a5911b98b49c3a17874f8a9cc3dfa9fa6f0 (patch) | |
tree | acae823e91acc483f89569817dd0c5edafe646fc /lib | |
parent | 17a82eaeb6339b184acb2f8bf0f314d69ad2e1d3 (diff) |
Verify function attributes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57020 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/VMCore/Verifier.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp index a3d33176ef..f8cd7780ae 100644 --- a/lib/VMCore/Verifier.cpp +++ b/lib/VMCore/Verifier.cpp @@ -416,7 +416,7 @@ void Verifier::VerifyAttrs(Attributes Attrs, const Type *Ty, 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); } @@ -477,6 +477,10 @@ void Verifier::VerifyFunctionAttrs(const FunctionType *FT, } 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]; |