]> granicus.if.org Git - clang/commitdiff
silence release-assert warnings.
authorChris Lattner <sabre@nondot.org>
Sun, 12 Oct 2008 00:31:50 +0000 (00:31 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 12 Oct 2008 00:31:50 +0000 (00:31 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57392 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGExprConstant.cpp
lib/CodeGen/CGObjC.cpp
lib/CodeGen/CGStmt.cpp
lib/CodeGen/CodeGenTypes.cpp

index 69abbcc984c1b7a66b8b0e4ad451e8c903a6e5d2..783bb1c67ad7f10c2c4bdc2d9c7794234a03bfb5 100644 (file)
@@ -695,8 +695,8 @@ public:
     
     // A scalar source can be splatted to a vector of the same element type
     if (isa<llvm::VectorType>(DstTy) && !isa<VectorType>(SrcType)) {
-      const llvm::VectorType *VT = cast<llvm::VectorType>(DstTy);
-      assert((VT->getElementType() == Src->getType()) &&
+      assert((cast<llvm::VectorType>(DstTy)->getElementType()
+              == Src->getType()) &&
              "Vector element type must match scalar type to splat.");
       unsigned NumElements = DstType->getAsVectorType()->getNumElements();
       llvm::SmallVector<llvm::Constant*, 16> Elements;
index 9849fb61b6b50b93f01ece66bf2c7935606e8064..0c45c555544fccbfadf6ffce9634989344c12299 100644 (file)
@@ -72,9 +72,9 @@ RValue CodeGenFunction::EmitObjCMessageExpr(const ObjCMessageExpr *E) {
     }
     
     isClassMessage = true;
-  } else if (const PredefinedExpr *PDE =
-               dyn_cast<PredefinedExpr>(E->getReceiver())) {
-    assert(PDE->getIdentType() == PredefinedExpr::ObjCSuper);
+  } else if (isa<PredefinedExpr>(E->getReceiver())) {
+    assert(cast<PredefinedExpr>(E->getReceiver())->getIdentType() == 
+             PredefinedExpr::ObjCSuper);
     isSuperMessage = true;
     Receiver = LoadObjCSelf();
   } else {
index 024fb0a6599d6560a38c16a1406817ad04f2a379..fed0eee7f0ffb937b8215ba07fc6eb91fce1a548 100644 (file)
@@ -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 += ',';
index c156f7f7a9b2bc79cd0dc830e3caf388fc6ecfbf..4734d28207399a4a31022837e57a670ed8d935aa 100644 (file)
@@ -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