mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-17 21:29:20 +00:00
Print vector types appropriately. This gets basic vector code working
(PR1126) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47806 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
0a3d4d971d
commit
85feab6c57
@ -519,9 +519,9 @@ std::ostream &CWriter::printType(std::ostream &Out, const Type *Ty,
|
||||
|
||||
case Type::VectorTyID: {
|
||||
const VectorType *VTy = cast<VectorType>(Ty);
|
||||
unsigned NumElements = VTy->getNumElements();
|
||||
return printType(Out, VTy->getElementType(), false,
|
||||
NameSoFar + "[" + utostr(NumElements) + "]");
|
||||
NameSoFar + " __attribute__((vector_size(" +
|
||||
utostr(TD->getABITypeSize(VTy)) + " ))) ");
|
||||
}
|
||||
|
||||
case Type::OpaqueTyID: {
|
||||
@ -991,6 +991,10 @@ void CWriter::printConstant(Constant *CPV) {
|
||||
break;
|
||||
|
||||
case Type::VectorTyID:
|
||||
// Use C99 compound expression literal initializer syntax.
|
||||
Out << "(";
|
||||
printType(Out, CPV->getType());
|
||||
Out << ")";
|
||||
if (ConstantVector *CV = cast<ConstantVector>(CPV)) {
|
||||
printConstantVector(CV);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user