Remove attribution from file headers, per discussion on llvmdev.
[oota-llvm.git] / lib / Target / TargetData.cpp
index 5a189205ed9348af44a6cb09fa37334042b32c8e..8cef53de12130a23a1e4b24eebae1e4b94941bcc 100644 (file)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file was developed by the LLVM research group and is distributed under
-// the University of Illinois Open Source License. See LICENSE.TXT for details.
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 //
@@ -211,7 +211,7 @@ void TargetData::init(const std::string &TargetDescription) {
     case 'f':
     case 'a':
     case 's': {
-      AlignTypeEnum align_type;
+      AlignTypeEnum align_type = STACK_ALIGN; // Dummy init, silence warning
       switch(*p) {
         case 'i': align_type = INTEGER_ALIGN; break;
         case 'v': align_type = VECTOR_ALIGN; break;
@@ -268,15 +268,14 @@ unsigned TargetData::getAlignmentInfo(AlignTypeEnum AlignType,
       return ABIInfo ? Alignments[i].ABIAlign : Alignments[i].PrefAlign;
     
     // The best match so far depends on what we're looking for.
-    if (AlignType == VECTOR_ALIGN) {
+    if (AlignType == VECTOR_ALIGN && Alignments[i].AlignType == VECTOR_ALIGN) {
       // If this is a specification for a smaller vector type, we will fall back
       // to it.  This happens because <128 x double> can be implemented in terms
       // of 64 <2 x double>.
-      if (Alignments[i].AlignType == VECTOR_ALIGN && 
-          Alignments[i].TypeBitWidth < BitWidth) {
+      if (Alignments[i].TypeBitWidth < BitWidth) {
         // Verify that we pick the biggest of the fallbacks.
         if (BestMatchIdx == -1 ||
-            Alignments[BestMatchIdx].TypeBitWidth < BitWidth)
+            Alignments[BestMatchIdx].TypeBitWidth < Alignments[i].TypeBitWidth)
           BestMatchIdx = i;
       }
     } else if (AlignType == INTEGER_ALIGN &&