diff options
author | Reid Spencer <reid@x10sys.com> | 2007-07-23 23:46:43 +0000 |
---|---|---|
committer | Reid Spencer <reid@x10sys.com> | 2007-07-23 23:46:43 +0000 |
commit | 0bc5b11b52bf80485e38cf5f70d37307100f090f (patch) | |
tree | 480a0c177f233282a7aee76d607439dc391d547c /lib | |
parent | bb511f889f060d856764bede28bff03a3bd25b59 (diff) | |
download | external_llvm-0bc5b11b52bf80485e38cf5f70d37307100f090f.zip external_llvm-0bc5b11b52bf80485e38cf5f70d37307100f090f.tar.gz external_llvm-0bc5b11b52bf80485e38cf5f70d37307100f090f.tar.bz2 |
1. Make sure we print the Function Value for parameter attribute errors
2. Fold an if statement into the Assert1 macro call.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40455 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/VMCore/Verifier.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp index 6da3645..8bebcdd 100644 --- a/lib/VMCore/Verifier.cpp +++ b/lib/VMCore/Verifier.cpp @@ -362,12 +362,12 @@ void Verifier::visitFunction(Function &F) { if (const ParamAttrsList *Attrs = FT->getParamAttrs()) { unsigned Idx = 1; - Assert(!Attrs->paramHasAttr(0, ParamAttr::ByVal), - "Attribute ByVal should not apply to functions!"); - Assert(!Attrs->paramHasAttr(0, ParamAttr::StructRet), - "Attribute SRet should not apply to functions!"); - Assert(!Attrs->paramHasAttr(0, ParamAttr::InReg), - "Attribute SRet should not apply to functions!"); + Assert1(!Attrs->paramHasAttr(0, ParamAttr::ByVal), + "Attribute ByVal should not apply to functions!", &F); + Assert1(!Attrs->paramHasAttr(0, ParamAttr::StructRet), + "Attribute SRet should not apply to functions!", &F); + Assert1(!Attrs->paramHasAttr(0, ParamAttr::InReg), + "Attribute SRet should not apply to functions!", &F); for (FunctionType::param_iterator I = FT->param_begin(), E = FT->param_end(); I != E; ++I, ++Idx) { @@ -391,10 +391,10 @@ void Verifier::visitFunction(Function &F) { "Attribute ByVal should only apply to pointer to structs!", &F); } - if (Attrs->paramHasAttr(Idx, ParamAttr::NoReturn)) - Assert1(0, "Attribute NoReturn should only be applied to function", &F); - if (Attrs->paramHasAttr(Idx, ParamAttr::NoUnwind)) - Assert1(0, "Attribute NoUnwind should only be applied to function", &F); + Assert1(!Attrs->paramHasAttr(Idx, ParamAttr::NoReturn), + "Attribute NoReturn should only be applied to function", &F); + Assert1(!Attrs->paramHasAttr(Idx, ParamAttr::NoUnwind), + "Attribute NoUnwind should only be applied to function", &F); } } |