[llvm-commits] [llvm] r65714 - /llvm/trunk/lib/VMCore/AsmWriter.cpp

Chris Lattner sabre at nondot.org
Sat Feb 28 12:35:42 PST 2009


Author: lattner
Date: Sat Feb 28 14:35:42 2009
New Revision: 65714

URL: http://llvm.org/viewvc/llvm-project?rev=65714&view=rev
Log:
fix indentation, remove dead integer case.

Modified:
    llvm/trunk/lib/VMCore/AsmWriter.cpp

Modified: llvm/trunk/lib/VMCore/AsmWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/AsmWriter.cpp?rev=65714&r1=65713&r2=65714&view=diff

==============================================================================
--- llvm/trunk/lib/VMCore/AsmWriter.cpp (original)
+++ llvm/trunk/lib/VMCore/AsmWriter.cpp Sat Feb 28 14:35:42 2009
@@ -216,73 +216,68 @@
   TypeStack.push_back(Ty);    // Recursive case: Add us to the stack..
   
   switch (Ty->getTypeID()) {
-    case Type::IntegerTyID: {
-      unsigned BitWidth = cast<IntegerType>(Ty)->getBitWidth();
-      Result += "i" + utostr(BitWidth);
-      break;
-    }
-    case Type::FunctionTyID: {
-      const FunctionType *FTy = cast<FunctionType>(Ty);
-      calcTypeName(FTy->getReturnType(), TypeStack, Result);
-      Result += " (";
-      for (FunctionType::param_iterator I = FTy->param_begin(),
-           E = FTy->param_end(); I != E; ++I) {
-        if (I != FTy->param_begin())
-          Result += ", ";
-        calcTypeName(*I, TypeStack, Result);
-      }
-      if (FTy->isVarArg()) {
-        if (FTy->getNumParams()) Result += ", ";
-        Result += "...";
-      }
-      Result += ")";
-      break;
+  case Type::FunctionTyID: {
+    const FunctionType *FTy = cast<FunctionType>(Ty);
+    calcTypeName(FTy->getReturnType(), TypeStack, Result);
+    Result += " (";
+    for (FunctionType::param_iterator I = FTy->param_begin(),
+         E = FTy->param_end(); I != E; ++I) {
+      if (I != FTy->param_begin())
+        Result += ", ";
+      calcTypeName(*I, TypeStack, Result);
     }
-    case Type::StructTyID: {
-      const StructType *STy = cast<StructType>(Ty);
-      if (STy->isPacked())
-        Result += '<';
-      Result += "{ ";
-      for (StructType::element_iterator I = STy->element_begin(),
-           E = STy->element_end(); I != E; ++I) {
-        calcTypeName(*I, TypeStack, Result);
-        if (next(I) != STy->element_end())
-          Result += ',';
-        Result += ' ';
-      }
-      Result += '}';
-      if (STy->isPacked())
-        Result += '>';
-      break;
-    }
-    case Type::PointerTyID: {
-      const PointerType *PTy = cast<PointerType>(Ty);
-      calcTypeName(PTy->getElementType(), TypeStack, Result);
-      if (unsigned AddressSpace = PTy->getAddressSpace())
-        Result += " addrspace(" + utostr(AddressSpace) + ")";
-      Result += "*";
-      break;
-    }
-    case Type::ArrayTyID: {
-      const ArrayType *ATy = cast<ArrayType>(Ty);
-      Result += "[" + utostr(ATy->getNumElements()) + " x ";
-      calcTypeName(ATy->getElementType(), TypeStack, Result);
-      Result += "]";
-      break;
-    }
-    case Type::VectorTyID: {
-      const VectorType *PTy = cast<VectorType>(Ty);
-      Result += "<" + utostr(PTy->getNumElements()) + " x ";
-      calcTypeName(PTy->getElementType(), TypeStack, Result);
-      Result += ">";
-      break;
-    }
-    case Type::OpaqueTyID:
-      Result += "opaque";
-      break;
-    default:
-      Result += "<unrecognized-type>";
-      break;
+    if (FTy->isVarArg()) {
+      if (FTy->getNumParams()) Result += ", ";
+      Result += "...";
+    }
+    Result += ")";
+    break;
+  }
+  case Type::StructTyID: {
+    const StructType *STy = cast<StructType>(Ty);
+    if (STy->isPacked())
+      Result += '<';
+    Result += "{ ";
+    for (StructType::element_iterator I = STy->element_begin(),
+         E = STy->element_end(); I != E; ++I) {
+      calcTypeName(*I, TypeStack, Result);
+      if (next(I) != STy->element_end())
+        Result += ',';
+      Result += ' ';
+    }
+    Result += '}';
+    if (STy->isPacked())
+      Result += '>';
+    break;
+  }
+  case Type::PointerTyID: {
+    const PointerType *PTy = cast<PointerType>(Ty);
+    calcTypeName(PTy->getElementType(), TypeStack, Result);
+    if (unsigned AddressSpace = PTy->getAddressSpace())
+      Result += " addrspace(" + utostr(AddressSpace) + ")";
+    Result += "*";
+    break;
+  }
+  case Type::ArrayTyID: {
+    const ArrayType *ATy = cast<ArrayType>(Ty);
+    Result += "[" + utostr(ATy->getNumElements()) + " x ";
+    calcTypeName(ATy->getElementType(), TypeStack, Result);
+    Result += "]";
+    break;
+  }
+  case Type::VectorTyID: {
+    const VectorType *PTy = cast<VectorType>(Ty);
+    Result += "<" + utostr(PTy->getNumElements()) + " x ";
+    calcTypeName(PTy->getElementType(), TypeStack, Result);
+    Result += ">";
+    break;
+  }
+  case Type::OpaqueTyID:
+    Result += "opaque";
+    break;
+  default:
+    Result += "<unrecognized-type>";
+    break;
   }
   
   TypeStack.pop_back();       // Remove self from stack...





More information about the llvm-commits mailing list