diff options
author | Devang Patel <dpatel@apple.com> | 2008-10-03 21:11:02 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2008-10-03 21:11:02 +0000 |
commit | 3afba0ae416acd62aca0ddda454538fbe99d1571 (patch) | |
tree | 034f06efb093b8e518a890dd9e1e50f9496630bc /lib/VMCore/Verifier.cpp | |
parent | 1b54c7fe9b034a6450af8596231ad5368b617725 (diff) | |
download | external_llvm-3afba0ae416acd62aca0ddda454538fbe99d1571.zip external_llvm-3afba0ae416acd62aca0ddda454538fbe99d1571.tar.gz external_llvm-3afba0ae416acd62aca0ddda454538fbe99d1571.tar.bz2 |
Fix function attribute verification check.
Thanks Duncan!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57029 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Verifier.cpp')
-rw-r--r-- | lib/VMCore/Verifier.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp index f8cd778..820bf33 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); |