From: Chris Lattner Date: Sun, 12 Oct 2008 00:31:50 +0000 (+0000) Subject: silence release-assert warnings. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3304e55f613ce34d9a14c3aaf06f5949408b3092;p=clang silence release-assert warnings. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57392 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGExprConstant.cpp b/lib/CodeGen/CGExprConstant.cpp index 69abbcc984..783bb1c67a 100644 --- a/lib/CodeGen/CGExprConstant.cpp +++ b/lib/CodeGen/CGExprConstant.cpp @@ -695,8 +695,8 @@ public: // A scalar source can be splatted to a vector of the same element type if (isa(DstTy) && !isa(SrcType)) { - const llvm::VectorType *VT = cast(DstTy); - assert((VT->getElementType() == Src->getType()) && + assert((cast(DstTy)->getElementType() + == Src->getType()) && "Vector element type must match scalar type to splat."); unsigned NumElements = DstType->getAsVectorType()->getNumElements(); llvm::SmallVector Elements; diff --git a/lib/CodeGen/CGObjC.cpp b/lib/CodeGen/CGObjC.cpp index 9849fb61b6..0c45c55554 100644 --- a/lib/CodeGen/CGObjC.cpp +++ b/lib/CodeGen/CGObjC.cpp @@ -72,9 +72,9 @@ RValue CodeGenFunction::EmitObjCMessageExpr(const ObjCMessageExpr *E) { } isClassMessage = true; - } else if (const PredefinedExpr *PDE = - dyn_cast(E->getReceiver())) { - assert(PDE->getIdentType() == PredefinedExpr::ObjCSuper); + } else if (isa(E->getReceiver())) { + assert(cast(E->getReceiver())->getIdentType() == + PredefinedExpr::ObjCSuper); isSuperMessage = true; Receiver = LoadObjCSelf(); } else { diff --git a/lib/CodeGen/CGStmt.cpp b/lib/CodeGen/CGStmt.cpp index 024fb0a659..fed0eee7f0 100644 --- a/lib/CodeGen/CGStmt.cpp +++ b/lib/CodeGen/CGStmt.cpp @@ -761,7 +761,7 @@ void CodeGenFunction::EmitAsmStmt(const AsmStmt &S) { TargetInfo::ConstraintInfo Info; bool result = Target.validateOutputConstraint(OutputConstraint.c_str(), Info); - assert(result && "Failed to parse output constraint"); + assert(result && "Failed to parse output constraint"); result=result; // Simplify the output constraint. OutputConstraint = SimplifyConstraint(OutputConstraint.c_str() + 1, Target); @@ -821,9 +821,8 @@ void CodeGenFunction::EmitAsmStmt(const AsmStmt &S) { TargetInfo::ConstraintInfo Info; bool result = Target.validateInputConstraint(InputConstraint.c_str(), - NumConstraints, - Info); - assert(result && "Failed to parse input constraint"); + NumConstraints, Info); + assert(result && "Failed to parse input constraint"); result=result; if (i != 0 || S.getNumOutputs() > 0) Constraints += ','; diff --git a/lib/CodeGen/CodeGenTypes.cpp b/lib/CodeGen/CodeGenTypes.cpp index c156f7f7a9..4734d28207 100644 --- a/lib/CodeGen/CodeGenTypes.cpp +++ b/lib/CodeGen/CodeGenTypes.cpp @@ -405,6 +405,7 @@ const llvm::Type *CodeGenTypes::ConvertTagDeclType(const TagDecl *TD) { } } else { assert(0 && "FIXME: Unknown tag decl kind!"); + abort(); } // Refine our Opaque type to ResultType. This can invalidate ResultType, so @@ -487,8 +488,9 @@ void RecordOrganizer::layoutStructFields(const ASTRecordLayout &RL) { llvm::APSInt FieldSize(32); bool isBitField = BitWidth->isIntegerConstantExpr(FieldSize, CGT.getContext()); - assert (isBitField && "Invalid BitField size expression"); - uint64_t BitFieldSize = FieldSize.getZExtValue(); + assert(isBitField && "Invalid BitField size expression"); + isBitField=isBitField; // silence warning. + uint64_t BitFieldSize = FieldSize.getZExtValue(); // Bitfield field info is different from other field info; // it actually ignores the underlying LLVM struct because