diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2018-08-02 17:33:11 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2018-08-02 17:33:11 +0000 |
| commit | c7e70c433efc6953dc3888b9fbf9f3512d7da2b0 (patch) | |
| tree | 27425930fc0c91650a7f3527fcac8e0f92907b90 /lib/AST/TypePrinter.cpp | |
| parent | 486754660bb926339aefcf012a3f848592babb8b (diff) | |
Notes
Diffstat (limited to 'lib/AST/TypePrinter.cpp')
| -rw-r--r-- | lib/AST/TypePrinter.cpp | 216 |
1 files changed, 102 insertions, 114 deletions
diff --git a/lib/AST/TypePrinter.cpp b/lib/AST/TypePrinter.cpp index c5e2244e26c5..e032c312aa12 100644 --- a/lib/AST/TypePrinter.cpp +++ b/lib/AST/TypePrinter.cpp @@ -52,14 +52,14 @@ namespace { class IncludeStrongLifetimeRAII { PrintingPolicy &Policy; bool Old; - + public: - explicit IncludeStrongLifetimeRAII(PrintingPolicy &Policy) + explicit IncludeStrongLifetimeRAII(PrintingPolicy &Policy) : Policy(Policy), Old(Policy.SuppressStrongLifetime) { if (!Policy.SuppressLifetimeQualifiers) Policy.SuppressStrongLifetime = false; } - + ~IncludeStrongLifetimeRAII() { Policy.SuppressStrongLifetime = Old; } @@ -68,13 +68,13 @@ namespace { class ParamPolicyRAII { PrintingPolicy &Policy; bool Old; - + public: - explicit ParamPolicyRAII(PrintingPolicy &Policy) + explicit ParamPolicyRAII(PrintingPolicy &Policy) : Policy(Policy), Old(Policy.SuppressSpecifiers) { Policy.SuppressSpecifiers = false; } - + ~ParamPolicyRAII() { Policy.SuppressSpecifiers = Old; } @@ -84,7 +84,7 @@ namespace { PrintingPolicy &Policy; bool SuppressTagKeyword; bool SuppressScope; - + public: explicit ElaboratedTypePolicyRAII(PrintingPolicy &Policy) : Policy(Policy) { SuppressTagKeyword = Policy.SuppressTagKeyword; @@ -92,13 +92,13 @@ namespace { Policy.SuppressTagKeyword = true; Policy.SuppressScope = true; } - + ~ElaboratedTypePolicyRAII() { Policy.SuppressTagKeyword = SuppressTagKeyword; Policy.SuppressScope = SuppressScope; } }; - + class TypePrinter { PrintingPolicy Policy; unsigned Indentation; @@ -193,7 +193,7 @@ bool TypePrinter::canPrefixQualifiers(const Type *T, TC = AT->desugar()->getTypeClass(); if (const auto *Subst = dyn_cast<SubstTemplateTypeParmType>(T)) TC = Subst->getReplacementType()->getTypeClass(); - + switch (TC) { case Type::Auto: case Type::Builtin: @@ -221,19 +221,19 @@ bool TypePrinter::canPrefixQualifiers(const Type *T, case Type::Pipe: CanPrefixQualifiers = true; break; - + case Type::ObjCObjectPointer: CanPrefixQualifiers = T->isObjCIdType() || T->isObjCClassType() || T->isObjCQualifiedIdType() || T->isObjCQualifiedClassType(); break; - + case Type::ConstantArray: case Type::IncompleteArray: case Type::VariableArray: case Type::DependentSizedArray: NeedARCStrongQualifier = true; LLVM_FALLTHROUGH; - + case Type::Adjusted: case Type::Decayed: case Type::Pointer: @@ -444,8 +444,8 @@ void TypePrinter::printRValueReferenceAfter(const RValueReferenceType *T, printAfter(Inner, OS); } -void TypePrinter::printMemberPointerBefore(const MemberPointerType *T, - raw_ostream &OS) { +void TypePrinter::printMemberPointerBefore(const MemberPointerType *T, + raw_ostream &OS) { IncludeStrongLifetimeRAII Strong(Policy); SaveAndRestore<bool> NonEmptyPH(HasEmptyPlaceHolder, false); printBefore(T->getPointeeType(), OS); @@ -461,8 +461,8 @@ void TypePrinter::printMemberPointerBefore(const MemberPointerType *T, OS << "::*"; } -void TypePrinter::printMemberPointerAfter(const MemberPointerType *T, - raw_ostream &OS) { +void TypePrinter::printMemberPointerAfter(const MemberPointerType *T, + raw_ostream &OS) { IncludeStrongLifetimeRAII Strong(Policy); SaveAndRestore<bool> NonEmptyPH(HasEmptyPlaceHolder, false); // Handle things like 'int (Cls::*A)[4];' correctly. @@ -472,14 +472,14 @@ void TypePrinter::printMemberPointerAfter(const MemberPointerType *T, printAfter(T->getPointeeType(), OS); } -void TypePrinter::printConstantArrayBefore(const ConstantArrayType *T, +void TypePrinter::printConstantArrayBefore(const ConstantArrayType *T, raw_ostream &OS) { IncludeStrongLifetimeRAII Strong(Policy); SaveAndRestore<bool> NonEmptyPH(HasEmptyPlaceHolder, false); printBefore(T->getElementType(), OS); } -void TypePrinter::printConstantArrayAfter(const ConstantArrayType *T, +void TypePrinter::printConstantArrayAfter(const ConstantArrayType *T, raw_ostream &OS) { OS << '['; if (T->getIndexTypeQualifiers().hasQualifiers()) { @@ -495,27 +495,27 @@ void TypePrinter::printConstantArrayAfter(const ConstantArrayType *T, printAfter(T->getElementType(), OS); } -void TypePrinter::printIncompleteArrayBefore(const IncompleteArrayType *T, +void TypePrinter::printIncompleteArrayBefore(const IncompleteArrayType *T, raw_ostream &OS) { IncludeStrongLifetimeRAII Strong(Policy); SaveAndRestore<bool> NonEmptyPH(HasEmptyPlaceHolder, false); printBefore(T->getElementType(), OS); } -void TypePrinter::printIncompleteArrayAfter(const IncompleteArrayType *T, +void TypePrinter::printIncompleteArrayAfter(const IncompleteArrayType *T, raw_ostream &OS) { OS << "[]"; printAfter(T->getElementType(), OS); } -void TypePrinter::printVariableArrayBefore(const VariableArrayType *T, +void TypePrinter::printVariableArrayBefore(const VariableArrayType *T, raw_ostream &OS) { IncludeStrongLifetimeRAII Strong(Policy); SaveAndRestore<bool> NonEmptyPH(HasEmptyPlaceHolder, false); printBefore(T->getElementType(), OS); } -void TypePrinter::printVariableArrayAfter(const VariableArrayType *T, +void TypePrinter::printVariableArrayAfter(const VariableArrayType *T, raw_ostream &OS) { OS << '['; if (T->getIndexTypeQualifiers().hasQualifiers()) { @@ -555,7 +555,7 @@ void TypePrinter::printDecayedAfter(const DecayedType *T, raw_ostream &OS) { } void TypePrinter::printDependentSizedArrayBefore( - const DependentSizedArrayType *T, + const DependentSizedArrayType *T, raw_ostream &OS) { IncludeStrongLifetimeRAII Strong(Policy); SaveAndRestore<bool> NonEmptyPH(HasEmptyPlaceHolder, false); @@ -563,7 +563,7 @@ void TypePrinter::printDependentSizedArrayBefore( } void TypePrinter::printDependentSizedArrayAfter( - const DependentSizedArrayType *T, + const DependentSizedArrayType *T, raw_ostream &OS) { OS << '['; if (T->getSizeExpr()) @@ -587,22 +587,22 @@ void TypePrinter::printDependentAddressSpaceAfter( } void TypePrinter::printDependentSizedExtVectorBefore( - const DependentSizedExtVectorType *T, - raw_ostream &OS) { + const DependentSizedExtVectorType *T, + raw_ostream &OS) { printBefore(T->getElementType(), OS); } void TypePrinter::printDependentSizedExtVectorAfter( - const DependentSizedExtVectorType *T, - raw_ostream &OS) { + const DependentSizedExtVectorType *T, + raw_ostream &OS) { OS << " __attribute__((ext_vector_type("; if (T->getSizeExpr()) T->getSizeExpr()->printPretty(OS, nullptr, Policy); - OS << ")))"; + OS << ")))"; printAfter(T->getElementType(), OS); } -void TypePrinter::printVectorBefore(const VectorType *T, raw_ostream &OS) { +void TypePrinter::printVectorBefore(const VectorType *T, raw_ostream &OS) { switch (T->getVectorKind()) { case VectorType::AltiVecPixel: OS << "__vector __pixel "; @@ -632,7 +632,7 @@ void TypePrinter::printVectorBefore(const VectorType *T, raw_ostream &OS) { << T->getNumElements() << " * sizeof("; print(T->getElementType(), OS, StringRef()); - OS << ")))) "; + OS << ")))) "; printBefore(T->getElementType(), OS); break; } @@ -692,19 +692,19 @@ void TypePrinter::printDependentVectorAfter( } void TypePrinter::printExtVectorBefore(const ExtVectorType *T, - raw_ostream &OS) { + raw_ostream &OS) { printBefore(T->getElementType(), OS); } -void TypePrinter::printExtVectorAfter(const ExtVectorType *T, raw_ostream &OS) { +void TypePrinter::printExtVectorAfter(const ExtVectorType *T, raw_ostream &OS) { printAfter(T->getElementType(), OS); OS << " __attribute__((ext_vector_type("; OS << T->getNumElements(); OS << ")))"; } -void -FunctionProtoType::printExceptionSpecification(raw_ostream &OS, +void +FunctionProtoType::printExceptionSpecification(raw_ostream &OS, const PrintingPolicy &Policy) const { if (hasDynamicExceptionSpec()) { @@ -715,7 +715,7 @@ FunctionProtoType::printExceptionSpecification(raw_ostream &OS, for (unsigned I = 0, N = getNumExceptions(); I != N; ++I) { if (I) OS << ", "; - + OS << getExceptionType(I).stream(Policy); } OS << ')'; @@ -732,7 +732,7 @@ FunctionProtoType::printExceptionSpecification(raw_ostream &OS, } } -void TypePrinter::printFunctionProtoBefore(const FunctionProtoType *T, +void TypePrinter::printFunctionProtoBefore(const FunctionProtoType *T, raw_ostream &OS) { if (T->hasTrailingReturn()) { OS << "auto "; @@ -761,8 +761,8 @@ StringRef clang::getParameterABISpelling(ParameterABI ABI) { llvm_unreachable("bad parameter ABI kind"); } -void TypePrinter::printFunctionProtoAfter(const FunctionProtoType *T, - raw_ostream &OS) { +void TypePrinter::printFunctionProtoAfter(const FunctionProtoType *T, + raw_ostream &OS) { // If needed for precedence reasons, wrap the inner part in grouping parens. if (!HasEmptyPlaceHolder) OS << ')'; @@ -785,7 +785,7 @@ void TypePrinter::printFunctionProtoAfter(const FunctionProtoType *T, print(T->getParamType(i), OS, StringRef()); } } - + if (T->isVariadic()) { if (T->getNumParams()) OS << ", "; @@ -794,7 +794,7 @@ void TypePrinter::printFunctionProtoAfter(const FunctionProtoType *T, // Do not emit int() if we have a proto, emit 'int(void)'. OS << "void"; } - + OS << ')'; FunctionType::ExtInfo Info = T->getExtInfo(); @@ -902,8 +902,8 @@ void TypePrinter::printFunctionAfter(const FunctionType::ExtInfo &Info, OS << " __attribute__((nocf_check))"; } -void TypePrinter::printFunctionNoProtoBefore(const FunctionNoProtoType *T, - raw_ostream &OS) { +void TypePrinter::printFunctionNoProtoBefore(const FunctionNoProtoType *T, + raw_ostream &OS) { // If needed for precedence reasons, wrap the inner part in grouping parens. SaveAndRestore<bool> PrevPHIsEmpty(HasEmptyPlaceHolder, false); printBefore(T->getReturnType(), OS); @@ -911,13 +911,13 @@ void TypePrinter::printFunctionNoProtoBefore(const FunctionNoProtoType *T, OS << '('; } -void TypePrinter::printFunctionNoProtoAfter(const FunctionNoProtoType *T, +void TypePrinter::printFunctionNoProtoAfter(const FunctionNoProtoType *T, raw_ostream &OS) { // If needed for precedence reasons, wrap the inner part in grouping parens. if (!HasEmptyPlaceHolder) OS << ')'; SaveAndRestore<bool> NonEmptyPH(HasEmptyPlaceHolder, false); - + OS << "()"; printFunctionAfter(T->getExtInfo(), OS); printAfter(T->getReturnType(), OS); @@ -944,7 +944,7 @@ void TypePrinter::printUnresolvedUsingBefore(const UnresolvedUsingType *T, void TypePrinter::printUnresolvedUsingAfter(const UnresolvedUsingType *T, raw_ostream &OS) {} -void TypePrinter::printTypedefBefore(const TypedefType *T, raw_ostream &OS) { +void TypePrinter::printTypedefBefore(const TypedefType *T, raw_ostream &OS) { printTypeSpec(T->getDecl(), OS); } @@ -961,7 +961,7 @@ void TypePrinter::printTypeOfExprBefore(const TypeOfExprType *T, void TypePrinter::printTypeOfExprAfter(const TypeOfExprType *T, raw_ostream &OS) {} -void TypePrinter::printTypeOfBefore(const TypeOfType *T, raw_ostream &OS) { +void TypePrinter::printTypeOfBefore(const TypeOfType *T, raw_ostream &OS) { OS << "typeof("; print(T->getUnderlyingType(), OS, StringRef()); OS << ')'; @@ -970,7 +970,7 @@ void TypePrinter::printTypeOfBefore(const TypeOfType *T, raw_ostream &OS) { void TypePrinter::printTypeOfAfter(const TypeOfType *T, raw_ostream &OS) {} -void TypePrinter::printDecltypeBefore(const DecltypeType *T, raw_ostream &OS) { +void TypePrinter::printDecltypeBefore(const DecltypeType *T, raw_ostream &OS) { OS << "decltype("; if (T->getUnderlyingExpr()) T->getUnderlyingExpr()->printPretty(OS, nullptr, Policy); @@ -1008,7 +1008,7 @@ void TypePrinter::printUnaryTransformAfter(const UnaryTransformType *T, printAfter(T->getBaseType(), OS); } -void TypePrinter::printAutoBefore(const AutoType *T, raw_ostream &OS) { +void TypePrinter::printAutoBefore(const AutoType *T, raw_ostream &OS) { // If the type has been deduced, do not print 'auto'. if (!T->getDeducedType().isNull()) { printBefore(T->getDeducedType(), OS); @@ -1022,7 +1022,7 @@ void TypePrinter::printAutoBefore(const AutoType *T, raw_ostream &OS) { } } -void TypePrinter::printAutoAfter(const AutoType *T, raw_ostream &OS) { +void TypePrinter::printAutoAfter(const AutoType *T, raw_ostream &OS) { // If the type has been deduced, do not print 'auto'. if (!T->getDeducedType().isNull()) printAfter(T->getDeducedType(), OS); @@ -1079,7 +1079,7 @@ void TypePrinter::AppendScope(DeclContext *DC, raw_ostream &OS) { AppendScope(DC->getParent(), OS); if (const auto *NS = dyn_cast<NamespaceDecl>(DC)) { - if (Policy.SuppressUnwrittenScope && + if (Policy.SuppressUnwrittenScope && (NS->isAnonymousNamespace() || NS->isInline())) return; if (NS->getIdentifier()) @@ -1143,7 +1143,7 @@ void TypePrinter::printTag(TagDecl *D, raw_ostream &OS) { } else { OS << "anonymous"; } - + if (Policy.AnonymousTagLocations) { // Suppress the redundant tag keyword if we just printed one. // We don't have to worry about ElaboratedTypes here because you can't @@ -1188,14 +1188,14 @@ void TypePrinter::printRecordBefore(const RecordType *T, raw_ostream &OS) { void TypePrinter::printRecordAfter(const RecordType *T, raw_ostream &OS) {} -void TypePrinter::printEnumBefore(const EnumType *T, raw_ostream &OS) { +void TypePrinter::printEnumBefore(const EnumType *T, raw_ostream &OS) { printTag(T->getDecl(), OS); } void TypePrinter::printEnumAfter(const EnumType *T, raw_ostream &OS) {} -void TypePrinter::printTemplateTypeParmBefore(const TemplateTypeParmType *T, - raw_ostream &OS) { +void TypePrinter::printTemplateTypeParmBefore(const TemplateTypeParmType *T, + raw_ostream &OS) { if (IdentifierInfo *Id = T->getIdentifier()) OS << Id->getName(); else @@ -1203,40 +1203,40 @@ void TypePrinter::printTemplateTypeParmBefore(const TemplateTypeParmType *T, spaceBeforePlaceHolder(OS); } -void TypePrinter::printTemplateTypeParmAfter(const TemplateTypeParmType *T, +void TypePrinter::printTemplateTypeParmAfter(const TemplateTypeParmType *T, raw_ostream &OS) {} void TypePrinter::printSubstTemplateTypeParmBefore( - const SubstTemplateTypeParmType *T, - raw_ostream &OS) { + const SubstTemplateTypeParmType *T, + raw_ostream &OS) { IncludeStrongLifetimeRAII Strong(Policy); printBefore(T->getReplacementType(), OS); } void TypePrinter::printSubstTemplateTypeParmAfter( - const SubstTemplateTypeParmType *T, - raw_ostream &OS) { + const SubstTemplateTypeParmType *T, + raw_ostream &OS) { IncludeStrongLifetimeRAII Strong(Policy); printAfter(T->getReplacementType(), OS); } void TypePrinter::printSubstTemplateTypeParmPackBefore( - const SubstTemplateTypeParmPackType *T, - raw_ostream &OS) { + const SubstTemplateTypeParmPackType *T, + raw_ostream &OS) { IncludeStrongLifetimeRAII Strong(Policy); printTemplateTypeParmBefore(T->getReplacedParameter(), OS); } void TypePrinter::printSubstTemplateTypeParmPackAfter( - const SubstTemplateTypeParmPackType *T, - raw_ostream &OS) { + const SubstTemplateTypeParmPackType *T, + raw_ostream &OS) { IncludeStrongLifetimeRAII Strong(Policy); printTemplateTypeParmAfter(T->getReplacedParameter(), OS); } void TypePrinter::printTemplateSpecializationBefore( - const TemplateSpecializationType *T, - raw_ostream &OS) { + const TemplateSpecializationType *T, + raw_ostream &OS) { IncludeStrongLifetimeRAII Strong(Policy); T->getTemplateName().print(OS, Policy); @@ -1245,7 +1245,7 @@ void TypePrinter::printTemplateSpecializationBefore( } void TypePrinter::printTemplateSpecializationAfter( - const TemplateSpecializationType *T, + const TemplateSpecializationType *T, raw_ostream &OS) {} void TypePrinter::printInjectedClassNameBefore(const InjectedClassNameType *T, @@ -1279,7 +1279,7 @@ void TypePrinter::printElaboratedBefore(const ElaboratedType *T, if (Qualifier) Qualifier->print(OS, Policy); } - + ElaboratedTypePolicyRAII PolicyRAII(Policy); printBefore(T->getNamedType(), OS); } @@ -1309,13 +1309,13 @@ void TypePrinter::printParenAfter(const ParenType *T, raw_ostream &OS) { } void TypePrinter::printDependentNameBefore(const DependentNameType *T, - raw_ostream &OS) { + raw_ostream &OS) { OS << TypeWithKeyword::getKeywordName(T->getKeyword()); if (T->getKeyword() != ETK_None) OS << " "; - + T->getQualifier()->print(OS, Policy); - + OS << T->getIdentifier()->getName(); spaceBeforePlaceHolder(OS); } @@ -1324,7 +1324,7 @@ void TypePrinter::printDependentNameAfter(const DependentNameType *T, raw_ostream &OS) {} void TypePrinter::printDependentTemplateSpecializationBefore( - const DependentTemplateSpecializationType *T, raw_ostream &OS) { + const DependentTemplateSpecializationType *T, raw_ostream &OS) { IncludeStrongLifetimeRAII Strong(Policy); OS << TypeWithKeyword::getKeywordName(T->getKeyword()); @@ -1341,12 +1341,12 @@ void TypePrinter::printDependentTemplateSpecializationBefore( void TypePrinter::printDependentTemplateSpecializationAfter( const DependentTemplateSpecializationType *T, raw_ostream &OS) {} -void TypePrinter::printPackExpansionBefore(const PackExpansionType *T, +void TypePrinter::printPackExpansionBefore(const PackExpansionType *T, raw_ostream &OS) { printBefore(T->getPattern(), OS); } -void TypePrinter::printPackExpansionAfter(const PackExpansionType *T, +void TypePrinter::printPackExpansionAfter(const PackExpansionType *T, raw_ostream &OS) { printAfter(T->getPattern(), OS); OS << "..."; @@ -1443,9 +1443,27 @@ void TypePrinter::printAttributedAfter(const AttributedType *T, return; } + if (T->getAttrKind() == AttributedType::attr_lifetimebound) { + OS << " [[clang::lifetimebound]]"; + return; + } + OS << " __attribute__(("; switch (T->getAttrKind()) { - default: llvm_unreachable("This attribute should have been handled already"); + case AttributedType::attr_lifetimebound: + case AttributedType::attr_nonnull: + case AttributedType::attr_nullable: + case AttributedType::attr_null_unspecified: + case AttributedType::attr_objc_gc: + case AttributedType::attr_objc_inert_unsafe_unretained: + case AttributedType::attr_objc_kindof: + case AttributedType::attr_objc_ownership: + case AttributedType::attr_ptr32: + case AttributedType::attr_ptr64: + case AttributedType::attr_sptr: + case AttributedType::attr_uptr: + llvm_unreachable("This attribute should have been handled already"); + case AttributedType::attr_address_space: OS << "address_space("; // FIXME: printing the raw LangAS value is wrong. This should probably @@ -1489,36 +1507,6 @@ void TypePrinter::printAttributedAfter(const AttributedType *T, break; } - case AttributedType::attr_objc_gc: { - OS << "objc_gc("; - - QualType tmp = T->getEquivalentType(); - while (tmp.getObjCGCAttr() == Qualifiers::GCNone) { - QualType next = tmp->getPointeeType(); - if (next == tmp) break; - tmp = next; - } - - if (tmp.isObjCGCWeak()) - OS << "weak"; - else - OS << "strong"; - OS << ')'; - break; - } - - case AttributedType::attr_objc_ownership: - OS << "objc_ownership("; - switch (T->getEquivalentType().getObjCLifetime()) { - case Qualifiers::OCL_None: llvm_unreachable("no ownership!"); - case Qualifiers::OCL_ExplicitNone: OS << "none"; break; - case Qualifiers::OCL_Strong: OS << "strong"; break; - case Qualifiers::OCL_Weak: OS << "weak"; break; - case Qualifiers::OCL_Autoreleasing: OS << "autoreleasing"; break; - } - OS << ')'; - break; - case AttributedType::attr_ns_returns_retained: OS << "ns_returns_retained"; break; @@ -1561,13 +1549,13 @@ void TypePrinter::printAttributedAfter(const AttributedType *T, OS << "))"; } -void TypePrinter::printObjCInterfaceBefore(const ObjCInterfaceType *T, - raw_ostream &OS) { +void TypePrinter::printObjCInterfaceBefore(const ObjCInterfaceType *T, + raw_ostream &OS) { OS << T->getDecl()->getName(); spaceBeforePlaceHolder(OS); } -void TypePrinter::printObjCInterfaceAfter(const ObjCInterfaceType *T, +void TypePrinter::printObjCInterfaceAfter(const ObjCInterfaceType *T, raw_ostream &OS) {} void TypePrinter::printObjCTypeParamBefore(const ObjCTypeParamType *T, @@ -1640,7 +1628,7 @@ void TypePrinter::printObjCObjectAfter(const ObjCObjectType *T, return printAfter(T->getBaseType(), OS); } -void TypePrinter::printObjCObjectPointerBefore(const ObjCObjectPointerType *T, +void TypePrinter::printObjCObjectPointerBefore(const ObjCObjectPointerType *T, raw_ostream &OS) { printBefore(T->getPointeeType(), OS); @@ -1653,7 +1641,7 @@ void TypePrinter::printObjCObjectPointerBefore(const ObjCObjectPointerType *T, } } -void TypePrinter::printObjCObjectPointerAfter(const ObjCObjectPointerType *T, +void TypePrinter::printObjCObjectPointerAfter(const ObjCObjectPointerType *T, raw_ostream &OS) {} static @@ -1832,11 +1820,11 @@ void Qualifiers::print(raw_ostream &OS, const PrintingPolicy& Policy, switch (lifetime) { case Qualifiers::OCL_None: llvm_unreachable("none but true"); case Qualifiers::OCL_ExplicitNone: OS << "__unsafe_unretained"; break; - case Qualifiers::OCL_Strong: + case Qualifiers::OCL_Strong: if (!Policy.SuppressStrongLifetime) - OS << "__strong"; + OS << "__strong"; break; - + case Qualifiers::OCL_Weak: OS << "__weak"; break; case Qualifiers::OCL_Autoreleasing: OS << "__autoreleasing"; break; } |
