aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/AST/Type.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/AST/Type.cpp')
-rw-r--r--clang/lib/AST/Type.cpp27
1 files changed, 21 insertions, 6 deletions
diff --git a/clang/lib/AST/Type.cpp b/clang/lib/AST/Type.cpp
index 034e175f1352..4a2fc5219ef0 100644
--- a/clang/lib/AST/Type.cpp
+++ b/clang/lib/AST/Type.cpp
@@ -1801,6 +1801,9 @@ namespace {
}
// Only these types can contain the desired 'auto' type.
+ Type *VisitSubstTemplateTypeParmType(const SubstTemplateTypeParmType *T) {
+ return Visit(T->getReplacementType());
+ }
Type *VisitElaboratedType(const ElaboratedType *T) {
return Visit(T->getNamedType());
@@ -2086,8 +2089,9 @@ bool Type::isUnsignedIntegerOrEnumerationType() const {
bool Type::hasUnsignedIntegerRepresentation() const {
if (const auto *VT = dyn_cast<VectorType>(CanonicalType))
return VT->getElementType()->isUnsignedIntegerOrEnumerationType();
- else
- return isUnsignedIntegerOrEnumerationType();
+ if (const auto *VT = dyn_cast<MatrixType>(CanonicalType))
+ return VT->getElementType()->isUnsignedIntegerOrEnumerationType();
+ return isUnsignedIntegerOrEnumerationType();
}
bool Type::isFloatingType() const {
@@ -2228,10 +2232,11 @@ bool Type::isIncompleteType(NamedDecl **Def) const {
return !Rec->isCompleteDefinition();
}
case ConstantArray:
+ case VariableArray:
// An array is incomplete if its element type is incomplete
// (C++ [dcl.array]p1).
- // We don't handle variable arrays (they're not allowed in C++) or
- // dependent-sized arrays (dependent types are never treated as incomplete).
+ // We don't handle dependent-sized arrays (dependent types are never treated
+ // as incomplete).
return cast<ArrayType>(CanonicalType)->getElementType()
->isIncompleteType(Def);
case IncompleteArray:
@@ -2279,6 +2284,8 @@ bool Type::isSizelessBuiltinType() const {
// SVE Types
#define SVE_TYPE(Name, Id, SingletonId) case BuiltinType::Id:
#include "clang/Basic/AArch64SVEACLETypes.def"
+#define RVV_TYPE(Name, Id, SingletonId) case BuiltinType::Id:
+#include "clang/Basic/RISCVVTypes.def"
return true;
default:
return false;
@@ -3088,6 +3095,10 @@ StringRef BuiltinType::getName(const PrintingPolicy &Policy) const {
case Id: \
return #Name;
#include "clang/Basic/PPCTypes.def"
+#define RVV_TYPE(Name, Id, SingletonId) \
+ case Id: \
+ return Name;
+#include "clang/Basic/RISCVVTypes.def"
}
llvm_unreachable("Invalid builtin type.");
@@ -3134,6 +3145,7 @@ StringRef FunctionType::getNameForCallConv(CallingConv CC) {
case CC_SpirFunction: return "spir_function";
case CC_OpenCLKernel: return "opencl_kernel";
case CC_Swift: return "swiftcall";
+ case CC_SwiftAsync: return "swiftasynccall";
case CC_PreserveMost: return "preserve_most";
case CC_PreserveAll: return "preserve_all";
}
@@ -3550,6 +3562,7 @@ bool AttributedType::isCallingConv() const {
case attr::ThisCall:
case attr::RegCall:
case attr::SwiftCall:
+ case attr::SwiftAsyncCall:
case attr::VectorCall:
case attr::AArch64VectorPcs:
case attr::Pascal:
@@ -4110,6 +4123,8 @@ bool Type::canHaveNullability(bool ResultIfUnknown) const {
#define PPC_VECTOR_TYPE(Name, Id, Size) \
case BuiltinType::Id:
#include "clang/Basic/PPCTypes.def"
+#define RVV_TYPE(Name, Id, SingletonId) case BuiltinType::Id:
+#include "clang/Basic/RISCVVTypes.def"
case BuiltinType::BuiltinFn:
case BuiltinType::NullPtr:
case BuiltinType::IncompleteMatrixIdx:
@@ -4387,8 +4402,8 @@ AutoType::AutoType(QualType DeducedAsType, AutoTypeKeyword Keyword,
if (TypeConstraintConcept) {
TemplateArgument *ArgBuffer = getArgBuffer();
for (const TemplateArgument &Arg : TypeConstraintArgs) {
- addDependence(toTypeDependence(
- Arg.getDependence() & TemplateArgumentDependence::UnexpandedPack));
+ addDependence(
+ toSyntacticDependence(toTypeDependence(Arg.getDependence())));
new (ArgBuffer++) TemplateArgument(Arg);
}