From 0a3d4d971de92ef6d78d642609c4cc32b458a954 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 2 Mar 2008 03:18:46 +0000 Subject: [PATCH] rename PT -> VT for VectorTypes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47805 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/CBackend/CBackend.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp index c1a101475c7..3b28484a906 100644 --- a/lib/Target/CBackend/CBackend.cpp +++ b/lib/Target/CBackend/CBackend.cpp @@ -518,10 +518,9 @@ std::ostream &CWriter::printType(std::ostream &Out, const Type *Ty, } case Type::VectorTyID: { - const VectorType *PTy = cast(Ty); - unsigned NumElements = PTy->getNumElements(); - if (NumElements == 0) NumElements = 1; - return printType(Out, PTy->getElementType(), false, + const VectorType *VTy = cast(Ty); + unsigned NumElements = VTy->getNumElements(); + return printType(Out, VTy->getElementType(), false, NameSoFar + "[" + utostr(NumElements) + "]"); } @@ -972,8 +971,8 @@ void CWriter::printConstant(Constant *CPV) { } case Type::ArrayTyID: - if (const ConstantArray *CA = cast(CPV)) { - printConstantVector(CA); + if (ConstantArray *CA = cast(CPV)) { + printConstantArray(CA); } else { assert(isa(CPV) || isa(CPV)); const ArrayType *AT = cast(CPV->getType()); @@ -992,7 +991,7 @@ void CWriter::printConstant(Constant *CPV) { break; case Type::VectorTyID: - if (const ConstantVector *CV = cast(CPV)) { + if (ConstantVector *CV = cast(CPV)) { printConstantVector(CV); } else { assert(isa(CPV) || isa(CPV)); @@ -1000,7 +999,7 @@ void CWriter::printConstant(Constant *CPV) { Out << "{ "; Constant *CZ = Constant::getNullValue(VT->getElementType()); printConstant(CZ); - for (unsigned i = 1, e = AT->getNumElements(); i != e; ++i) { + for (unsigned i = 1, e = VT->getNumElements(); i != e; ++i) { Out << ", "; printConstant(CZ); } -- 2.34.1