aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-02-28 20:35:42 +0000
committerChris Lattner <sabre@nondot.org>2009-02-28 20:35:42 +0000
commit36942d7383df0ab00f7f5b16c04f330aedf5c9f1 (patch)
treef0710dd55462aed25f72f44fd0789ebf97cc8245 /lib
parentb840cace77b2c6afe9106698b1cb003a04e53b41 (diff)
downloadexternal_llvm-36942d7383df0ab00f7f5b16c04f330aedf5c9f1.zip
external_llvm-36942d7383df0ab00f7f5b16c04f330aedf5c9f1.tar.gz
external_llvm-36942d7383df0ab00f7f5b16c04f330aedf5c9f1.tar.bz2
fix indentation, remove dead integer case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65714 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/VMCore/AsmWriter.cpp123
1 files changed, 59 insertions, 64 deletions
diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp
index fcb6bbb..d67b2a2 100644
--- a/lib/VMCore/AsmWriter.cpp
+++ b/lib/VMCore/AsmWriter.cpp
@@ -216,73 +216,68 @@ void TypePrinting::calcTypeName(const Type *Ty,
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::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::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::ArrayTyID: {
- const ArrayType *ATy = cast<ArrayType>(Ty);
- Result += "[" + utostr(ATy->getNumElements()) + " x ";
- calcTypeName(ATy->getElementType(), TypeStack, Result);
- Result += "]";
- break;
+ if (FTy->isVarArg()) {
+ if (FTy->getNumParams()) Result += ", ";
+ Result += "...";
}
- case Type::VectorTyID: {
- const VectorType *PTy = cast<VectorType>(Ty);
- Result += "<" + utostr(PTy->getNumElements()) + " x ";
- calcTypeName(PTy->getElementType(), TypeStack, Result);
- Result += ">";
- break;
+ 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 += ' ';
}
- case Type::OpaqueTyID:
- Result += "opaque";
- break;
- default:
- Result += "<unrecognized-type>";
- break;
+ 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...