[llvm] r261155 - Fix warning on build without asserts

Tim Northover via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 17 13:17:00 PST 2016


Author: tnorthover
Date: Wed Feb 17 15:16:59 2016
New Revision: 261155

URL: http://llvm.org/viewvc/llvm-project?rev=261155&view=rev
Log:
Fix warning on build without asserts

Modified:
    llvm/trunk/lib/IR/IRBuilder.cpp

Modified: llvm/trunk/lib/IR/IRBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/IRBuilder.cpp?rev=261155&r1=261154&r2=261155&view=diff
==============================================================================
--- llvm/trunk/lib/IR/IRBuilder.cpp (original)
+++ llvm/trunk/lib/IR/IRBuilder.cpp Wed Feb 17 15:16:59 2016
@@ -284,13 +284,14 @@ CallInst *IRBuilderBase::CreateMaskedSca
                                              unsigned Align, Value *Mask) {
   auto PtrsTy = cast<VectorType>(Ptrs->getType());
   auto DataTy = cast<VectorType>(Data->getType());
-
-  auto PtrTy = cast<PointerType>(PtrsTy->getElementType());
   unsigned NumElts = PtrsTy->getVectorNumElements();
 
+#ifndef NDEBUG
+  auto PtrTy = cast<PointerType>(PtrsTy->getElementType());
   assert(NumElts == DataTy->getVectorNumElements() &&
-         PtrTy->getElementType() ==  DataTy->getElementType() &&
-        "Incompatible pointer and data types");
+         PtrTy->getElementType() == DataTy->getElementType() &&
+         "Incompatible pointer and data types");
+#endif
 
   if (!Mask)
     Mask = Constant::getAllOnesValue(VectorType::get(Type::getInt1Ty(Context),




More information about the llvm-commits mailing list