aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/clang/include/clang/AST/TypeProperties.td
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project/clang/include/clang/AST/TypeProperties.td')
-rw-r--r--contrib/llvm-project/clang/include/clang/AST/TypeProperties.td95
1 files changed, 65 insertions, 30 deletions
diff --git a/contrib/llvm-project/clang/include/clang/AST/TypeProperties.td b/contrib/llvm-project/clang/include/clang/AST/TypeProperties.td
index 8cbb67589b94..682c869b0c58 100644
--- a/contrib/llvm-project/clang/include/clang/AST/TypeProperties.td
+++ b/contrib/llvm-project/clang/include/clang/AST/TypeProperties.td
@@ -11,7 +11,7 @@ include "clang/Basic/TypeNodes.td"
let Class = ComplexType in {
def : Property<"elementType", QualType> {
- let Read = [{ node->getElementType() }];
+ let Read = [{ node->getElementType() }];
}
def : Creator<[{ return ctx.getComplexType(elementType); }]>;
@@ -323,6 +323,9 @@ let Class = FunctionProtoType in {
? node->getExtParameterInfos()
: llvm::ArrayRef<FunctionProtoType::ExtParameterInfo>() }];
}
+ def : Property<"AArch64SMEAttributes", UInt32> {
+ let Read = [{ node->getAArch64SMEAttributes() }];
+ }
def : Creator<[{
auto extInfo = FunctionType::ExtInfo(noReturn, hasRegParm, regParm,
@@ -338,6 +341,7 @@ let Class = FunctionProtoType in {
epi.ExceptionSpec = exceptionSpecifier;
epi.ExtParameterInfos =
extParameterInfo.empty() ? nullptr : extParameterInfo.data();
+ epi.AArch64SMEAttributes = AArch64SMEAttributes;
return ctx.getFunctionType(returnType, parameters, epi);
}]>;
}
@@ -379,16 +383,12 @@ let Class = TypedefType in {
def : Property<"declaration", DeclRef> {
let Read = [{ node->getDecl() }];
}
- def : Property<"canonicalType", Optional<QualType>> {
- let Read = [{ makeOptionalFromNullable(node->getCanonicalTypeInternal()) }];
+ def : Property<"underlyingType", QualType> {
+ let Read = [{ node->desugar() }];
}
def : Creator<[{
- QualType finalCanonicalType =
- canonicalType ? ctx.getCanonicalType(*canonicalType)
- : QualType();
- return ctx.getTypedefType(cast<TypedefNameDecl>(declaration),
- finalCanonicalType);
+ return ctx.getTypedefType(cast<TypedefNameDecl>(declaration), underlyingType);
}]>;
}
@@ -397,18 +397,26 @@ let Class = TypeOfExprType in {
let Read = [{ node->getUnderlyingExpr() }];
}
+ def : Property<"kind", TypeOfKind> {
+ let Read = [{ node->getKind() }];
+ }
+
def : Creator<[{
- return ctx.getTypeOfExprType(expression);
+ return ctx.getTypeOfExprType(expression, kind);
}]>;
}
let Class = TypeOfType in {
- def : Property<"underlyingType", QualType> {
- let Read = [{ node->getUnderlyingType() }];
+ def : Property<"unmodifiedType", QualType> {
+ let Read = [{ node->getUnmodifiedType() }];
+ }
+
+ def : Property<"kind", TypeOfKind> {
+ let Read = [{ node->getKind() }];
}
def : Creator<[{
- return ctx.getTypeOfType(underlyingType);
+ return ctx.getTypeOfType(unmodifiedType, kind);
}]>;
}
@@ -587,7 +595,7 @@ let Class = ParenType in {
def : Creator<[{
return ctx.getParenType(innerType);
- }]>;
+ }]>;
}
let Class = MacroQualifiedType in {
@@ -619,6 +627,19 @@ let Class = AttributedType in {
}]>;
}
+let Class = BTFTagAttributedType in {
+ def : Property<"attr", BTFTypeTagAttr> {
+ let Read = [{ node->getAttr() }];
+ }
+ def : Property<"wrappedType", QualType> {
+ let Read = [{ node->getWrappedType() }];
+ }
+
+ def : Creator<[{
+ return ctx.getBTFTagAttributedType(attr, wrappedType);
+ }]>;
+}
+
let Class = DependentAddressSpaceType in {
def : Property<"pointeeType", QualType> {
let Read = [{ node->getPointeeType() }];
@@ -649,16 +670,16 @@ let Class = TemplateSpecializationType in {
def : Property<"underlyingType", Optional<QualType>> {
let Read = [{
node->isTypeAlias()
- ? llvm::Optional<QualType>(node->getAliasedType())
+ ? std::optional<QualType>(node->getAliasedType())
: node->isCanonicalUnqualified()
- ? llvm::None
- : llvm::Optional<QualType>(node->getCanonicalTypeInternal())
+ ? std::nullopt
+ : std::optional<QualType>(node->getCanonicalTypeInternal())
}];
}
def : Creator<[{
QualType result;
- if (!underlyingType.hasValue()) {
+ if (!underlyingType) {
result = ctx.getCanonicalTemplateSpecializationType(templateName,
templateArguments);
} else {
@@ -715,18 +736,23 @@ let Class = TemplateTypeParmType in {
}
let Class = SubstTemplateTypeParmType in {
- def : Property<"replacedParameter", QualType> {
- let Read = [{ QualType(node->getReplacedParameter(), 0) }];
- }
def : Property<"replacementType", QualType> {
let Read = [{ node->getReplacementType() }];
}
+ def : Property<"associatedDecl", DeclRef> {
+ let Read = [{ node->getAssociatedDecl() }];
+ }
+ def : Property<"Index", UInt32> {
+ let Read = [{ node->getIndex() }];
+ }
+ def : Property<"PackIndex", Optional<UInt32>> {
+ let Read = [{ node->getPackIndex() }];
+ }
+ // The call to getCanonicalType here existed in ASTReader.cpp, too.
def : Creator<[{
- // The call to getCanonicalType here existed in ASTReader.cpp, too.
return ctx.getSubstTemplateTypeParmType(
- cast<TemplateTypeParmType>(replacedParameter),
- ctx.getCanonicalType(replacementType));
+ replacementType, associatedDecl, Index, PackIndex);
}]>;
}
@@ -745,8 +771,14 @@ let Class = PackExpansionType in {
}
let Class = SubstTemplateTypeParmPackType in {
- def : Property<"replacedParameter", QualType> {
- let Read = [{ QualType(node->getReplacedParameter(), 0) }];
+ def : Property<"associatedDecl", DeclRef> {
+ let Read = [{ node->getAssociatedDecl() }];
+ }
+ def : Property<"Index", UInt32> {
+ let Read = [{ node->getIndex() }];
+ }
+ def : Property<"Final", Bool> {
+ let Read = [{ node->getFinal() }];
}
def : Property<"replacementPack", TemplateArgument> {
let Read = [{ node->getArgumentPack() }];
@@ -754,8 +786,7 @@ let Class = SubstTemplateTypeParmPackType in {
def : Creator<[{
return ctx.getSubstTemplateTypeParmPackType(
- cast<TemplateTypeParmType>(replacedParameter),
- replacementPack);
+ associatedDecl, Index, Final, replacementPack);
}]>;
}
@@ -786,6 +817,10 @@ let Class = BuiltinType in {
case BuiltinType::ID: return ctx.SINGLETON_ID;
#include "clang/Basic/RISCVVTypes.def"
+#define WASM_TYPE(NAME, ID, SINGLETON_ID) \
+ case BuiltinType::ID: return ctx.SINGLETON_ID;
+#include "clang/Basic/WebAssemblyReferenceTypes.def"
+
#define BUILTIN_TYPE(ID, SINGLETON_ID) \
case BuiltinType::ID: return ctx.SINGLETON_ID;
#include "clang/AST/BuiltinTypes.def"
@@ -807,8 +842,8 @@ let Class = DependentNameType in {
def : Property<"underlyingType", Optional<QualType>> {
let Read = [{
node->isCanonicalUnqualified()
- ? llvm::None
- : llvm::Optional<QualType>(node->getCanonicalTypeInternal())
+ ? std::nullopt
+ : std::optional<QualType>(node->getCanonicalTypeInternal())
}];
}
@@ -862,7 +897,7 @@ let Class = ObjCInterfaceType in {
let Class = ObjCTypeParamType in {
def : Property<"declaration", ObjCTypeParamDeclRef> {
let Read = [{ node->getDecl() }];
- }
+ }
def : Property<"qualifiers", Array<ObjCProtocolDeclRef>> {
let Read = [{ node->getProtocols() }];
}