]> granicus.if.org Git - llvm/commitdiff
[DataLayout] Removed default value from a variable that isn't used without being...
authorCraig Topper <craig.topper@gmail.com>
Wed, 19 Apr 2017 00:31:38 +0000 (00:31 +0000)
committerCraig Topper <craig.topper@gmail.com>
Wed, 19 Apr 2017 00:31:38 +0000 (00:31 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300634 91177308-0d34-0410-b5e6-96231b3b80d8

lib/IR/DataLayout.cpp

index c72057ed146b7c80c87038c53def6363bbe85b0b..93bacdd2e80fedfa7a5026b9b6b599df869f09c3 100644 (file)
@@ -621,7 +621,7 @@ unsigned DataLayout::getPointerTypeSizeInBits(Type *Ty) const {
   == false) for the requested type \a Ty.
  */
 unsigned DataLayout::getAlignment(Type *Ty, bool abi_or_pref) const {
-  int AlignType = -1;
+  AlignTypeEnum AlignType;
 
   assert(Ty->isSized() && "Cannot getTypeInfo() on a type that is unsized!");
   switch (Ty->getTypeID()) {
@@ -670,8 +670,7 @@ unsigned DataLayout::getAlignment(Type *Ty, bool abi_or_pref) const {
     llvm_unreachable("Bad type for getAlignment!!!");
   }
 
-  return getAlignmentInfo((AlignTypeEnum)AlignType, getTypeSizeInBits(Ty),
-                          abi_or_pref, Ty);
+  return getAlignmentInfo(AlignType, getTypeSizeInBits(Ty), abi_or_pref, Ty);
 }
 
 unsigned DataLayout::getABITypeAlignment(Type *Ty) const {