Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
clang/lib/AST/TypePrinter.cpp
Show First 20 Lines • Show All 687 Lines • ▼ Show 20 Lines | else | ||||
OS << T->getNumElements(); | OS << T->getNumElements(); | ||||
OS << " * sizeof("; | OS << " * sizeof("; | ||||
print(T->getElementType(), OS, StringRef()); | print(T->getElementType(), OS, StringRef()); | ||||
// Multiply by 8 for the number of bits. | // Multiply by 8 for the number of bits. | ||||
OS << ") * 8))) "; | OS << ") * 8))) "; | ||||
printBefore(T->getElementType(), OS); | printBefore(T->getElementType(), OS); | ||||
break; | break; | ||||
case VectorType::RVVFixedLengthDataVector: | |||||
// FIXME: We prefer to print the size directly here, but have no way | |||||
// to get the size of the type. | |||||
OS << "__attribute__((__riscv_rvv_vector_bits__("; | |||||
OS << T->getNumElements(); | |||||
OS << " * sizeof("; | |||||
print(T->getElementType(), OS, StringRef()); | |||||
// Multiply by 8 for the number of bits. | |||||
OS << ") * 8))) "; | |||||
aaron.ballman: Bummer we don't have an `ASTContext` handy so we could call `getTypeSizeInChars()`... | |||||
printBefore(T->getElementType(), OS); | |||||
break; | |||||
} | } | ||||
} | } | ||||
void TypePrinter::printVectorAfter(const VectorType *T, raw_ostream &OS) { | void TypePrinter::printVectorAfter(const VectorType *T, raw_ostream &OS) { | ||||
printAfter(T->getElementType(), OS); | printAfter(T->getElementType(), OS); | ||||
} | } | ||||
void TypePrinter::printDependentVectorBefore( | void TypePrinter::printDependentVectorBefore( | ||||
▲ Show 20 Lines • Show All 50 Lines • ▼ Show 20 Lines | if (T->getSizeExpr()) { | ||||
OS << " * sizeof("; | OS << " * sizeof("; | ||||
print(T->getElementType(), OS, StringRef()); | print(T->getElementType(), OS, StringRef()); | ||||
// Multiply by 8 for the number of bits. | // Multiply by 8 for the number of bits. | ||||
OS << ") * 8"; | OS << ") * 8"; | ||||
} | } | ||||
OS << "))) "; | OS << "))) "; | ||||
printBefore(T->getElementType(), OS); | printBefore(T->getElementType(), OS); | ||||
break; | break; | ||||
case VectorType::RVVFixedLengthDataVector: | |||||
// FIXME: We prefer to print the size directly here, but have no way | |||||
// to get the size of the type. | |||||
OS << "__attribute__((__riscv_rvv_vector_bits__("; | |||||
if (T->getSizeExpr()) { | |||||
T->getSizeExpr()->printPretty(OS, nullptr, Policy); | |||||
OS << " * sizeof("; | |||||
print(T->getElementType(), OS, StringRef()); | |||||
// Multiply by 8 for the number of bits. | |||||
OS << ") * 8"; | |||||
} | |||||
OS << "))) "; | |||||
printBefore(T->getElementType(), OS); | |||||
break; | |||||
} | } | ||||
} | } | ||||
void TypePrinter::printDependentVectorAfter( | void TypePrinter::printDependentVectorAfter( | ||||
const DependentVectorType *T, raw_ostream &OS) { | const DependentVectorType *T, raw_ostream &OS) { | ||||
printAfter(T->getElementType(), OS); | printAfter(T->getElementType(), OS); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 1,621 Lines • Show Last 20 Lines |
Bummer we don't have an ASTContext handy so we could call getTypeSizeInChars()...