From 41d935f2c619821f4cde05ad779265ebaac5fcd7 Mon Sep 17 00:00:00 2001 From: John McCall Date: Sun, 15 Dec 2019 23:51:44 -0500 Subject: [PATCH] Replace tabs with spaces. --- clang/include/clang/AST/PropertiesBase.td | 152 +++++++++++++++--------------- clang/include/clang/AST/TypeProperties.td | 108 ++++++++++----------- 2 files changed, 130 insertions(+), 130 deletions(-) diff --git a/clang/include/clang/AST/PropertiesBase.td b/clang/include/clang/AST/PropertiesBase.td index c38bf7c..7d804e4 100644 --- a/clang/include/clang/AST/PropertiesBase.td +++ b/clang/include/clang/AST/PropertiesBase.td @@ -10,26 +10,26 @@ class ASTNode; /// The type of the property. class PropertyType { - /// The C++ type name for the type. - string CXXName = !if(!ne(typeName, ""), typeName, NAME); + /// The C++ type name for the type. + string CXXName = !if(!ne(typeName, ""), typeName, NAME); - /// Whether the C++ type should generally be passed around by reference. - bit PassByReference = 0; + /// Whether the C++ type should generally be passed around by reference. + bit PassByReference = 0; - /// Whether `const` should be prepended to the type when writing. - bit ConstWhenWriting = 0; + /// Whether `const` should be prepended to the type when writing. + bit ConstWhenWriting = 0; - /// Given a value of type Optional bound as 'value', yield a - /// CXXName that can be serialized into a DataStreamTypeWriter. - string PackOptional = ""; + /// Given a value of type Optional bound as 'value', yield a + /// CXXName that can be serialized into a DataStreamTypeWriter. + string PackOptional = ""; - /// Given a value of type CXXName bound as 'value' that was deserialized - /// by a DataStreamTypeReader, yield an Optional. - string UnpackOptional = ""; + /// Given a value of type CXXName bound as 'value' that was deserialized + /// by a DataStreamTypeReader, yield an Optional. + string UnpackOptional = ""; - /// A list of types for which buffeers must be passed to the read - /// operations. - list BufferElementTypes = []; + /// A list of types for which buffeers must be passed to the read + /// operations. + list BufferElementTypes = []; } /// Property types that correspond to specific C++ enums. @@ -38,36 +38,36 @@ class EnumPropertyType : PropertyType {} /// Property types that correspond to a specific C++ class. /// Supports optional values by using the null representation. class RefPropertyType : PropertyType { - let PackOptional = - "value ? *value : nullptr"; - let UnpackOptional = - "value ? llvm::Optional<" # CXXName # ">(value) : llvm::None"; + let PackOptional = + "value ? *value : nullptr"; + let UnpackOptional = + "value ? llvm::Optional<" # CXXName # ">(value) : llvm::None"; } /// Property types that correspond to a specific subclass of another type. class SubclassPropertyType - : RefPropertyType { - PropertyType Base = base; - string SubclassName = className; - let ConstWhenWriting = base.ConstWhenWriting; + : RefPropertyType { + PropertyType Base = base; + string SubclassName = className; + let ConstWhenWriting = base.ConstWhenWriting; } /// Property types that support optional values by using their /// default value. class DefaultValuePropertyType : PropertyType { - let PackOptional = - "value ? *value : " # CXXName # "()"; - let UnpackOptional = - "value.isNull() ? llvm::None : llvm::Optional<" # CXXName # ">(value)"; + let PackOptional = + "value ? *value : " # CXXName # "()"; + let UnpackOptional = + "value.isNull() ? llvm::None : llvm::Optional<" # CXXName # ">(value)"; } /// Property types that correspond to integer types and support optional /// values by shifting the value over by 1. class CountPropertyType : PropertyType { - let PackOptional = - "value ? *value + 1 : 0"; - let UnpackOptional = - "value ? llvm::Optional<" # CXXName # ">(value - 1) : llvm::None"; + let PackOptional = + "value ? *value + 1 : 0"; + let UnpackOptional = + "value ? llvm::Optional<" # CXXName # ">(value - 1) : llvm::None"; } def APInt : PropertyType<"llvm::APInt"> { let PassByReference = 1; } @@ -81,36 +81,36 @@ def CallingConv : EnumPropertyType; def DeclarationName : PropertyType; def DeclarationNameKind : EnumPropertyType<"DeclarationName::NameKind">; def DeclRef : RefPropertyType<"Decl"> { let ConstWhenWriting = 1; } - def CXXRecordDeclRef : - SubclassPropertyType<"CXXRecordDecl", DeclRef>; - def FunctionDeclRef : - SubclassPropertyType<"FunctionDecl", DeclRef>; - def NamedDeclRef : - SubclassPropertyType<"NamedDecl", DeclRef>; - def NamespaceDeclRef : - SubclassPropertyType<"NamespaceDecl", DeclRef>; - def NamespaceAliasDeclRef : - SubclassPropertyType<"NamespaceAliasDecl", DeclRef>; - def ObjCProtocolDeclRef : - SubclassPropertyType<"ObjCProtocolDecl", DeclRef>; - def ObjCTypeParamDeclRef : - SubclassPropertyType<"ObjCTypeParamDecl", DeclRef>; - def TagDeclRef : - SubclassPropertyType<"TagDecl", DeclRef>; - def TemplateDeclRef : - SubclassPropertyType<"TemplateDecl", DeclRef>; - def TemplateTypeParmDeclRef : - SubclassPropertyType<"TemplateTypeParmDecl", DeclRef>; - def TemplateTemplateParmDeclRef : - SubclassPropertyType<"TemplateTemplateParmDecl", DeclRef>; - def ValueDeclRef : - SubclassPropertyType<"ValueDecl", DeclRef>; + def CXXRecordDeclRef : + SubclassPropertyType<"CXXRecordDecl", DeclRef>; + def FunctionDeclRef : + SubclassPropertyType<"FunctionDecl", DeclRef>; + def NamedDeclRef : + SubclassPropertyType<"NamedDecl", DeclRef>; + def NamespaceDeclRef : + SubclassPropertyType<"NamespaceDecl", DeclRef>; + def NamespaceAliasDeclRef : + SubclassPropertyType<"NamespaceAliasDecl", DeclRef>; + def ObjCProtocolDeclRef : + SubclassPropertyType<"ObjCProtocolDecl", DeclRef>; + def ObjCTypeParamDeclRef : + SubclassPropertyType<"ObjCTypeParamDecl", DeclRef>; + def TagDeclRef : + SubclassPropertyType<"TagDecl", DeclRef>; + def TemplateDeclRef : + SubclassPropertyType<"TemplateDecl", DeclRef>; + def TemplateTypeParmDeclRef : + SubclassPropertyType<"TemplateTypeParmDecl", DeclRef>; + def TemplateTemplateParmDeclRef : + SubclassPropertyType<"TemplateTemplateParmDecl", DeclRef>; + def ValueDeclRef : + SubclassPropertyType<"ValueDecl", DeclRef>; def ElaboratedTypeKeyword : EnumPropertyType; def ExtParameterInfo : PropertyType<"FunctionProtoType::ExtParameterInfo">; def Identifier : PropertyType<"IdentifierInfo*">; def NestedNameSpecifier : PropertyType<"NestedNameSpecifier *">; def NestedNameSpecifierKind : - EnumPropertyType<"NestedNameSpecifier::SpecifierKind">; + EnumPropertyType<"NestedNameSpecifier::SpecifierKind">; def OverloadedOperatorKind : EnumPropertyType; def Qualifiers : PropertyType; def QualType : DefaultValuePropertyType; @@ -118,7 +118,7 @@ def RefQualifierKind : EnumPropertyType; def Selector : PropertyType; def SourceLocation : PropertyType; def StmtRef : RefPropertyType<"Stmt"> { let ConstWhenWriting = 1; } - def ExprRef : SubclassPropertyType<"Expr", StmtRef>; + def ExprRef : SubclassPropertyType<"Expr", StmtRef>; def TemplateArgument : PropertyType; def TemplateArgumentKind : EnumPropertyType<"TemplateArgument::ArgKind">; def TemplateName : DefaultValuePropertyType; @@ -129,14 +129,14 @@ def UnaryTypeTransformKind : EnumPropertyType<"UnaryTransformType::UTTKind">; def VectorKind : EnumPropertyType<"VectorType::VectorKind">; def ExceptionSpecInfo : PropertyType<"FunctionProtoType::ExceptionSpecInfo"> { - let BufferElementTypes = [ QualType ]; + let BufferElementTypes = [ QualType ]; } /// Arrays. The corresponding C++ type is ArrayRef of the corresponding /// C++ type of the element. class Array : PropertyType { - PropertyType Element = element; - let BufferElementTypes = [ element ]; + PropertyType Element = element; + let BufferElementTypes = [ element ]; } /// llvm::Optional. The corresponding C++ type is generally just the @@ -145,35 +145,35 @@ class Array : PropertyType { /// Optional may restrict the range of the operand for some /// serialization clients. class Optional : PropertyType { - PropertyType Element = element; - let PassByReference = element.PassByReference; + PropertyType Element = element; + let PassByReference = element.PassByReference; } /// A property of an AST node. class Property { - ASTNode Class; - string Name = name; - PropertyType Type = type; + ASTNode Class; + string Name = name; + PropertyType Type = type; - /// A function for reading the property, expressed in terms of a variable - /// "node". - code Read; + /// A function for reading the property, expressed in terms of a variable + /// "node". + code Read; } /// A rule for creating objects of this type. class Creator { - ASTNode Class; + ASTNode Class; - /// A function for creating values of this kind, expressed in terms of a - /// variable `ctx` of type `ASTContext &`. Must also refer to all of the - /// properties by name. - code Create = create; + /// A function for creating values of this kind, expressed in terms of a + /// variable `ctx` of type `ASTContext &`. Must also refer to all of the + /// properties by name. + code Create = create; } /// A rule which overrides some of the normal rules. class Override { - ASTNode Class; + ASTNode Class; - /// Properties from base classes that should be ignored. - list IgnoredProperties = []; + /// Properties from base classes that should be ignored. + list IgnoredProperties = []; } diff --git a/clang/include/clang/AST/TypeProperties.td b/clang/include/clang/AST/TypeProperties.td index abb6053..0f02e0c 100644 --- a/clang/include/clang/AST/TypeProperties.td +++ b/clang/include/clang/AST/TypeProperties.td @@ -38,8 +38,8 @@ let Class = AdjustedType in { let Class = DecayedType in { def : Override { - // We don't need to serialize the adjusted type because we can always - // derive it by decaying the original type. + // We don't need to serialize the adjusted type because we can always + // derive it by decaying the original type. let IgnoredProperties = [ "adjustedType" ]; } @@ -139,7 +139,7 @@ let Class = VariableArrayType in { return ctx.getVariableArrayType(elementType, size, sizeModifier, indexQualifiers.getCVRQualifiers(), SourceRange(leftBracketLoc, - rightBracketLoc)); + rightBracketLoc)); }]>; } @@ -157,8 +157,8 @@ let Class = DependentSizedArrayType in { def : Creator<[{ return ctx.getDependentSizedArrayType(elementType, size, sizeModifier, indexQualifiers.getCVRQualifiers(), - SourceRange(leftBracketLoc, - rightBracketLoc)); + SourceRange(leftBracketLoc, + rightBracketLoc)); }]>; } @@ -194,7 +194,7 @@ let Class = DependentVectorType in { def : Creator<[{ return ctx.getDependentVectorType(elementType, size, attributeLoc, - vectorKind); + vectorKind); }]>; } @@ -274,7 +274,7 @@ let Class = FunctionProtoType in { let Read = [{ node->getRefQualifier() }]; } def : Property<"exceptionSpecifier", ExceptionSpecInfo> { - let Read = [{ node->getExceptionSpecInfo() }]; + let Read = [{ node->getExceptionSpecInfo() }]; } def : Property<"parameters", Array> { let Read = [{ node->getParamTypes() }]; @@ -331,9 +331,9 @@ let Class = TypedefType in { } def : Creator<[{ - QualType finalCanonicalType = - canonicalType ? ctx.getCanonicalType(*canonicalType) - : QualType(); + QualType finalCanonicalType = + canonicalType ? ctx.getCanonicalType(*canonicalType) + : QualType(); return ctx.getTypedefType(cast(declaration), finalCanonicalType); }]>; @@ -425,8 +425,8 @@ let Class = DeducedTemplateSpecializationType in { def : Creator<[{ return ctx.getDeducedTemplateSpecializationType( - makeNullableFromOptional(templateName), - deducedType, dependent); + makeNullableFromOptional(templateName), + deducedType, dependent); }]>; } @@ -435,8 +435,8 @@ let Class = TagType in { let Read = [{ node->isDependentType() }]; } def : Property<"declaration", DeclRef> { - // Serializing a reference to the canonical declaration is apparently - // necessary to make module-merging work. + // Serializing a reference to the canonical declaration is apparently + // necessary to make module-merging work. let Read = [{ node->getDecl()->getCanonicalDecl() }]; } } @@ -451,7 +451,7 @@ let Class = EnumType in { let Class = RecordType in { def : Creator<[{ - auto record = cast(declaration); + auto record = cast(declaration); QualType result = ctx.getRecordType(record); const_cast(result.getTypePtr())->setDependent(dependent); return result; @@ -474,7 +474,7 @@ let Class = ElaboratedType in { def : Creator<[{ return ctx.getElaboratedType(keyword, qualifier, namedType, - makePointerFromOptional(ownedTag)); + makePointerFromOptional(ownedTag)); }]>; } @@ -577,11 +577,11 @@ let Class = TemplateSpecializationType in { } def : Property<"underlyingType", Optional> { let Read = [{ - node->isTypeAlias() - ? llvm::Optional(node->getAliasedType()) - : node->isCanonicalUnqualified() - ? llvm::None - : llvm::Optional(node->getCanonicalTypeInternal()) + node->isTypeAlias() + ? llvm::Optional(node->getAliasedType()) + : node->isCanonicalUnqualified() + ? llvm::None + : llvm::Optional(node->getCanonicalTypeInternal()) }]; } @@ -592,8 +592,8 @@ let Class = TemplateSpecializationType in { templateArguments); } else { result = ctx.getTemplateSpecializationType(templateName, - templateArguments, - *underlyingType); + templateArguments, + *underlyingType); } const_cast(result.getTypePtr())->setDependent(dependent); return result; @@ -615,8 +615,8 @@ let Class = DependentTemplateSpecializationType in { } def : Creator<[{ - return ctx.getDependentTemplateSpecializationType(keyword, qualifier, - name, templateArguments); + return ctx.getDependentTemplateSpecializationType(keyword, qualifier, + name, templateArguments); }]>; } @@ -635,8 +635,8 @@ let Class = TemplateTypeParmType in { } def : Creator<[{ - return ctx.getTemplateTypeParmType(depth, index, isParameterPack, - makePointerFromOptional(declaration)); + return ctx.getTemplateTypeParmType(depth, index, isParameterPack, + makePointerFromOptional(declaration)); }]>; } @@ -649,7 +649,7 @@ let Class = SubstTemplateTypeParmType in { } def : Creator<[{ - // The call to getCanonicalType here existed in ASTReader.cpp, too. + // The call to getCanonicalType here existed in ASTReader.cpp, too. return ctx.getSubstTemplateTypeParmType( cast(replacedParameter), ctx.getCanonicalType(replacementType)); @@ -665,7 +665,7 @@ let Class = PackExpansionType in { } def : Creator<[{ - return ctx.getPackExpansionType(pattern, numExpansions); + return ctx.getPackExpansionType(pattern, numExpansions); }]>; } @@ -678,8 +678,8 @@ let Class = SubstTemplateTypeParmPackType in { } def : Creator<[{ - return ctx.getSubstTemplateTypeParmPackType( - cast(replacedParameter), + return ctx.getSubstTemplateTypeParmPackType( + cast(replacedParameter), replacementPack); }]>; } @@ -689,7 +689,7 @@ let Class = BuiltinType in { let Read = [{ node->getKind() }]; } - def : Creator<[{ + def : Creator<[{ switch (kind) { #define IMAGE_TYPE(IMGTYPE, ID, SINGLETON_ID, ACCESS, SUFFIX) \ case BuiltinType::ID: return ctx.SINGLETON_ID; @@ -708,7 +708,7 @@ let Class = BuiltinType in { #include "clang/AST/BuiltinTypes.def" } llvm_unreachable("unreachable builtin case"); - }]>; + }]>; } let Class = DependentNameType in { @@ -723,18 +723,18 @@ let Class = DependentNameType in { } def : Property<"underlyingType", Optional> { let Read = [{ - node->isCanonicalUnqualified() - ? llvm::None - : llvm::Optional(node->getCanonicalTypeInternal()) + node->isCanonicalUnqualified() + ? llvm::None + : llvm::Optional(node->getCanonicalTypeInternal()) }]; } - def : Creator<[{ - QualType canon = (underlyingType - ? ctx.getCanonicalType(*underlyingType) - : QualType()); - return ctx.getDependentNameType(keyword, qualifier, name, canon); - }]>; + def : Creator<[{ + QualType canon = (underlyingType + ? ctx.getCanonicalType(*underlyingType) + : QualType()); + return ctx.getDependentNameType(keyword, qualifier, name, canon); + }]>; } let Class = ObjCObjectType in { @@ -752,9 +752,9 @@ let Class = ObjCObjectType in { } def : Creator<[{ - return ctx.getObjCObjectType(baseType, typeArgsAsWritten, qualifiers, - isKindOfTypeAsWritten); - }]>; + return ctx.getObjCObjectType(baseType, typeArgsAsWritten, qualifiers, + isKindOfTypeAsWritten); + }]>; } let Class = ObjCInterfaceType in { @@ -771,9 +771,9 @@ let Class = ObjCInterfaceType in { } def : Creator<[{ - return ctx.getObjCInterfaceType( - cast(declaration->getCanonicalDecl())); - }]>; + return ctx.getObjCInterfaceType( + cast(declaration->getCanonicalDecl())); + }]>; } let Class = ObjCTypeParamType in { @@ -785,8 +785,8 @@ let Class = ObjCTypeParamType in { } def : Creator<[{ - return ctx.getObjCTypeParamType(declaration, qualifiers); - }]>; + return ctx.getObjCTypeParamType(declaration, qualifiers); + }]>; } let Class = ObjCObjectPointerType in { @@ -795,8 +795,8 @@ let Class = ObjCObjectPointerType in { } def : Creator<[{ - return ctx.getObjCObjectPointerType(pointeeType); - }]>; + return ctx.getObjCObjectPointerType(pointeeType); + }]>; } let Class = PipeType in { @@ -808,6 +808,6 @@ let Class = PipeType in { } def : Creator<[{ - return ctx.getPipeType(elementType, isReadOnly); - }]>; + return ctx.getPipeType(elementType, isReadOnly); + }]>; } -- 2.7.4