diff options
author | Fangrui Song <maskray@google.com> | 2018-07-30 19:24:48 +0000 |
---|---|---|
committer | Fangrui Song <maskray@google.com> | 2018-07-30 19:24:48 +0000 |
commit | abdbb605f2c3cbe63cd589da230f648535dff76b (patch) | |
tree | 5f8677c5a6cdf9e4aebd71560932f399f956f7cc /lib/AST/ASTContext.cpp | |
parent | 19e630a4739c684e5848d2f926d0beb114bbce7b (diff) |
Remove trailing space
sed -Ei 's/[[:space:]]+$//' include/**/*.{def,h,td} lib/**/*.{cpp,h}
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@338291 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ASTContext.cpp')
-rw-r--r-- | lib/AST/ASTContext.cpp | 344 |
1 files changed, 172 insertions, 172 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index ab428e3fc5..996b80b9c5 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -492,11 +492,11 @@ comments::FullComment *ASTContext::getCommentForDecl( if (D->isInvalidDecl()) return nullptr; D = adjustDeclToTemplate(D); - + const Decl *Canonical = D->getCanonicalDecl(); llvm::DenseMap<const Decl *, comments::FullComment *>::iterator Pos = ParsedComments.find(Canonical); - + if (Pos != ParsedComments.end()) { if (Canonical != D) { comments::FullComment *FC = Pos->second; @@ -505,9 +505,9 @@ comments::FullComment *ASTContext::getCommentForDecl( } return Pos->second; } - + const Decl *OriginalDecl; - + const RawComment *RC = getRawCommentForAnyRedecl(D, &OriginalDecl); if (!RC) { if (isa<ObjCMethodDecl>(D) || isa<FunctionDecl>(D)) { @@ -558,7 +558,7 @@ comments::FullComment *ASTContext::getCommentForDecl( if (const CXXRecordDecl *NonVirtualBase = Ty->getAsCXXRecordDecl()) { if (!(NonVirtualBase= NonVirtualBase->getDefinition())) continue; - + if (comments::FullComment *FC = getCommentForDecl((NonVirtualBase), PP)) return cloneFullComment(FC, D); } @@ -580,7 +580,7 @@ comments::FullComment *ASTContext::getCommentForDecl( } return nullptr; } - + // If the RawComment was attached to other redeclaration of this Decl, we // should parse the comment in context of that other Decl. This is important // because comments can contain references to parameter names which can be @@ -593,8 +593,8 @@ comments::FullComment *ASTContext::getCommentForDecl( return FC; } -void -ASTContext::CanonicalTemplateTemplateParm::Profile(llvm::FoldingSetNodeID &ID, +void +ASTContext::CanonicalTemplateTemplateParm::Profile(llvm::FoldingSetNodeID &ID, TemplateTemplateParmDecl *Parm) { ID.AddInteger(Parm->getDepth()); ID.AddInteger(Parm->getPosition()); @@ -602,7 +602,7 @@ ASTContext::CanonicalTemplateTemplateParm::Profile(llvm::FoldingSetNodeID &ID, TemplateParameterList *Params = Parm->getTemplateParameters(); ID.AddInteger(Params->size()); - for (TemplateParameterList::const_iterator P = Params->begin(), + for (TemplateParameterList::const_iterator P = Params->begin(), PEnd = Params->end(); P != PEnd; ++P) { if (const auto *TTP = dyn_cast<TemplateTypeParmDecl>(*P)) { @@ -610,7 +610,7 @@ ASTContext::CanonicalTemplateTemplateParm::Profile(llvm::FoldingSetNodeID &ID, ID.AddBoolean(TTP->isParameterPack()); continue; } - + if (const auto *NTTP = dyn_cast<NonTypeTemplateParmDecl>(*P)) { ID.AddInteger(1); ID.AddBoolean(NTTP->isParameterPack()); @@ -622,11 +622,11 @@ ASTContext::CanonicalTemplateTemplateParm::Profile(llvm::FoldingSetNodeID &ID, QualType T = NTTP->getExpansionType(I); ID.AddPointer(T.getCanonicalType().getAsOpaquePtr()); } - } else + } else ID.AddBoolean(false); continue; } - + auto *TTP = cast<TemplateTemplateParmDecl>(*P); ID.AddInteger(2); Profile(ID, TTP); @@ -644,17 +644,17 @@ ASTContext::getCanonicalTemplateTemplateParmDecl( = CanonTemplateTemplateParms.FindNodeOrInsertPos(ID, InsertPos); if (Canonical) return Canonical->getParam(); - + // Build a canonical template parameter list. TemplateParameterList *Params = TTP->getTemplateParameters(); SmallVector<NamedDecl *, 4> CanonParams; CanonParams.reserve(Params->size()); - for (TemplateParameterList::const_iterator P = Params->begin(), + for (TemplateParameterList::const_iterator P = Params->begin(), PEnd = Params->end(); P != PEnd; ++P) { if (const auto *TTP = dyn_cast<TemplateTypeParmDecl>(*P)) CanonParams.push_back( - TemplateTypeParmDecl::Create(*this, getTranslationUnitDecl(), + TemplateTypeParmDecl::Create(*this, getTranslationUnitDecl(), SourceLocation(), SourceLocation(), TTP->getDepth(), @@ -672,7 +672,7 @@ ASTContext::getCanonicalTemplateTemplateParmDecl( ExpandedTInfos.push_back( getTrivialTypeSourceInfo(ExpandedTypes.back())); } - + Param = NonTypeTemplateParmDecl::Create(*this, getTranslationUnitDecl(), SourceLocation(), SourceLocation(), @@ -704,9 +704,9 @@ ASTContext::getCanonicalTemplateTemplateParmDecl( Expr *const CanonRequiresClause = nullptr; TemplateTemplateParmDecl *CanonTTP - = TemplateTemplateParmDecl::Create(*this, getTranslationUnitDecl(), + = TemplateTemplateParmDecl::Create(*this, getTranslationUnitDecl(), SourceLocation(), TTP->getDepth(), - TTP->getPosition(), + TTP->getPosition(), TTP->isParameterPack(), nullptr, TemplateParameterList::Create(*this, SourceLocation(), @@ -823,7 +823,7 @@ ASTContext::~ASTContext() { if (auto *R = const_cast<ASTRecordLayout *>((I++)->second)) R->Destroy(*this); } - + for (llvm::DenseMap<const Decl*, AttrVec*>::iterator A = DeclAttrs.begin(), AEnd = DeclAttrs.end(); A != AEnd; ++A) @@ -1001,7 +1001,7 @@ void ASTContext::addLazyModuleInitializers(Module *M, ArrayRef<uint32_t> IDs) { ArrayRef<Decl *> ASTContext::getModuleInitializers(Module *M) { auto It = ModuleInitializers.find(M); - if (It == ModuleInitializers.end()) + if (It == ModuleInitializers.end()) return None; auto *Inits = It->second; @@ -1098,7 +1098,7 @@ void ASTContext::InitBuiltinTypes(const TargetInfo &Target, ABI.reset(createCXXABI(Target)); AddrSpaceMap = getAddressSpaceMap(Target, LangOpts); AddrSpaceMapMangling = isAddrSpaceMapManglingEnabled(Target, LangOpts); - + // C99 6.2.5p19. InitBuiltinType(VoidTy, BuiltinType::Void); @@ -1242,13 +1242,13 @@ void ASTContext::InitBuiltinTypes(const TargetInfo &Target, InitBuiltinType(OCLQueueTy, BuiltinType::OCLQueue); InitBuiltinType(OCLReserveIDTy, BuiltinType::OCLReserveID); } - + // Builtin type for __objc_yes and __objc_no ObjCBuiltinBoolTy = (Target.useSignedCharForObjCBool() ? SignedCharTy : BoolTy); - + ObjCConstantStringType = QualType(); - + ObjCSuperType = QualType(); // void * type @@ -1281,7 +1281,7 @@ AttrVec& ASTContext::getDeclAttrs(const Decl *D) { void *Mem = Allocate(sizeof(AttrVec)); Result = new (Mem) AttrVec; } - + return *Result; } @@ -1361,11 +1361,11 @@ void ASTContext::setInstantiatedFromUsingDecl(NamedDecl *Inst, NamedDecl *Pattern) { assert((isa<UsingDecl>(Pattern) || isa<UnresolvedUsingValueDecl>(Pattern) || - isa<UnresolvedUsingTypenameDecl>(Pattern)) && + isa<UnresolvedUsingTypenameDecl>(Pattern)) && "pattern decl is not a using decl"); assert((isa<UsingDecl>(Inst) || isa<UnresolvedUsingValueDecl>(Inst) || - isa<UnresolvedUsingTypenameDecl>(Inst)) && + isa<UnresolvedUsingTypenameDecl>(Inst)) && "instantiation did not produce a using decl"); assert(!InstantiatedFromUsingDecl[Inst] && "pattern already exists"); InstantiatedFromUsingDecl[Inst] = Pattern; @@ -1432,7 +1432,7 @@ ASTContext::overridden_methods(const CXXMethodDecl *Method) const { return overridden_method_range(Pos->second.begin(), Pos->second.end()); } -void ASTContext::addOverriddenMethod(const CXXMethodDecl *Method, +void ASTContext::addOverriddenMethod(const CXXMethodDecl *Method, const CXXMethodDecl *Overridden) { assert(Method->isCanonicalDecl() && Overridden->isCanonicalDecl()); OverriddenMethods[Method].push_back(Overridden); @@ -1466,7 +1466,7 @@ void ASTContext::addedLocalImportDecl(ImportDecl *Import) { LastLocalImport = Import; return; } - + LastLocalImport->NextLocalImport = Import; LastLocalImport = Import; } @@ -1513,7 +1513,7 @@ CharUnits ASTContext::getDeclAlign(const Decl *D, bool ForAlignof) const { } } else if (isa<FieldDecl>(D)) - UseAlignAttrOnly = + UseAlignAttrOnly = D->hasAttr<PackedAttr>() || cast<FieldDecl>(D)->getParent()->hasAttr<PackedAttr>(); @@ -1881,7 +1881,7 @@ TypeInfo ASTContext::getTypeInfoImpl(const Type *T) const { case BuiltinType::ObjCId: case BuiltinType::ObjCClass: case BuiltinType::ObjCSel: - Width = Target->getPointerWidth(0); + Width = Target->getPointerWidth(0); Align = Target->getPointerAlign(0); break; case BuiltinType::OCLSampler: @@ -2107,7 +2107,7 @@ CharUnits ASTContext::getTypeSizeInChars(const Type *T) const { return getTypeInfoInChars(T).first; } -/// getTypeAlignInChars - Return the ABI-specified alignment of a type, in +/// getTypeAlignInChars - Return the ABI-specified alignment of a type, in /// characters. This method does not work on incomplete types. CharUnits ASTContext::getTypeAlignInChars(QualType T) const { return toCharUnitsFromBits(getTypeAlign(T)); @@ -2203,7 +2203,7 @@ void ASTContext::DeepCollectObjCIvars(const ObjCInterfaceDecl *OI, Ivars.push_back(I); } else { auto *IDecl = const_cast<ObjCInterfaceDecl *>(OI); - for (const ObjCIvarDecl *Iv = IDecl->all_declared_ivar_begin(); Iv; + for (const ObjCIvarDecl *Iv = IDecl->all_declared_ivar_begin(); Iv; Iv= Iv->getNextIvar()) Ivars.push_back(Iv); } @@ -2215,11 +2215,11 @@ void ASTContext::CollectInheritedProtocols(const Decl *CDecl, llvm::SmallPtrSet<ObjCProtocolDecl*, 8> &Protocols) { if (const auto *OI = dyn_cast<ObjCInterfaceDecl>(CDecl)) { // We can use protocol_iterator here instead of - // all_referenced_protocol_iterator since we are walking all categories. + // all_referenced_protocol_iterator since we are walking all categories. for (auto *Proto : OI->all_referenced_protocols()) { CollectInheritedProtocols(Proto, Protocols); } - + // Categories of this Interface. for (const auto *Cat : OI->visible_categories()) CollectInheritedProtocols(Cat, Protocols); @@ -2410,11 +2410,11 @@ bool ASTContext::hasUniqueObjectRepresentations(QualType Ty) const { } unsigned ASTContext::CountNonClassIvars(const ObjCInterfaceDecl *OI) const { - unsigned count = 0; + unsigned count = 0; // Count ivars declared in class extension. for (const auto *Ext : OI->known_extensions()) count += Ext->ivar_size(); - + // Count ivar defined in this class's implementation. This // includes synthesized ivars. if (ObjCImplementationDecl *ImplDecl = OI->getImplementation()) @@ -2502,7 +2502,7 @@ const ObjCInterfaceDecl *ASTContext::getObjContainingInterface( /// none exists. Expr *ASTContext::getBlockVarCopyInits(const VarDecl*VD) { assert(VD && "Passed null params"); - assert(VD->hasAttr<BlocksAttr>() && + assert(VD->hasAttr<BlocksAttr>() && "getBlockVarCopyInits - not __block var"); llvm::DenseMap<const VarDecl*, Expr*>::iterator I = BlockVarCopyInits.find(VD); @@ -2512,7 +2512,7 @@ Expr *ASTContext::getBlockVarCopyInits(const VarDecl*VD) { /// Set the copy inialization expression of a block var decl. void ASTContext::setBlockVarCopyInits(VarDecl*VD, Expr* Init) { assert(VD && Init && "Passed null params"); - assert(VD->hasAttr<BlocksAttr>() && + assert(VD->hasAttr<BlocksAttr>() && "setBlockVarCopyInits - not __block var"); BlockVarCopyInits[VD] = Init; } @@ -2899,9 +2899,9 @@ QualType ASTContext::getBlockPointerType(QualType T) const { /// lvalue reference to the specified type. QualType ASTContext::getLValueReferenceType(QualType T, bool SpelledAsLValue) const { - assert(getCanonicalType(T) != OverloadTy && + assert(getCanonicalType(T) != OverloadTy && "Unresolved overloaded function type"); - + // Unique pointers, to guarantee there is only one pointer of a particular // structure. llvm::FoldingSetNodeID ID; @@ -3190,7 +3190,7 @@ QualType ASTContext::getVariableArrayType(QualType EltTy, // Since we don't unique expressions, it isn't possible to unique VLA's // that have an expression provided for their size. QualType Canon; - + // Be sure to pull qualifiers off the element type. if (!EltTy.isCanonical() || EltTy.hasLocalQualifiers()) { SplitQualType canonSplit = getCanonicalType(EltTy).split(); @@ -3198,7 +3198,7 @@ QualType ASTContext::getVariableArrayType(QualType EltTy, IndexTypeQuals, Brackets); Canon = getQualifiedType(Canon, canonSplit.Quals); } - + auto *New = new (*this, TypeAlignment) VariableArrayType(EltTy, Canon, NumElts, ASM, IndexTypeQuals, Brackets); @@ -3215,7 +3215,7 @@ QualType ASTContext::getDependentSizedArrayType(QualType elementType, ArrayType::ArraySizeModifier ASM, unsigned elementTypeQuals, SourceRange brackets) const { - assert((!numElements || numElements->isTypeDependent() || + assert((!numElements || numElements->isTypeDependent() || numElements->isValueDependent()) && "Size must be type- or value-dependent!"); @@ -3448,7 +3448,7 @@ ASTContext::getDependentSizedExtVectorType(QualType vecType, } else { QualType Canon = getDependentSizedExtVectorType(CanonVecTy, SizeExpr, SourceLocation()); - New = new (*this, TypeAlignment) + New = new (*this, TypeAlignment) DependentSizedExtVectorType(*this, vecType, Canon, SizeExpr, AttrLoc); } } @@ -3457,10 +3457,10 @@ ASTContext::getDependentSizedExtVectorType(QualType vecType, return QualType(New, 0); } -QualType ASTContext::getDependentAddressSpaceType(QualType PointeeType, - Expr *AddrSpaceExpr, +QualType ASTContext::getDependentAddressSpaceType(QualType PointeeType, + Expr *AddrSpaceExpr, SourceLocation AttrLoc) const { - assert(AddrSpaceExpr->isInstantiationDependent()); + assert(AddrSpaceExpr->isInstantiationDependent()); QualType canonPointeeType = getCanonicalType(PointeeType); @@ -3474,22 +3474,22 @@ QualType ASTContext::getDependentAddressSpaceType(QualType PointeeType, if (!canonTy) { canonTy = new (*this, TypeAlignment) - DependentAddressSpaceType(*this, canonPointeeType, + DependentAddressSpaceType(*this, canonPointeeType, QualType(), AddrSpaceExpr, AttrLoc); DependentAddressSpaceTypes.InsertNode(canonTy, insertPos); Types.push_back(canonTy); } - + if (canonPointeeType == PointeeType && canonTy->getAddrSpaceExpr() == AddrSpaceExpr) - return QualType(canonTy, 0); + return QualType(canonTy, 0); auto *sugaredType = new (*this, TypeAlignment) - DependentAddressSpaceType(*this, PointeeType, QualType(canonTy, 0), + DependentAddressSpaceType(*this, PointeeType, QualType(canonTy, 0), AddrSpaceExpr, AttrLoc); Types.push_back(sugaredType); - return QualType(sugaredType, 0); + return QualType(sugaredType, 0); } /// Determine whether \p T is canonical as the result type of a function. @@ -3849,7 +3849,7 @@ QualType ASTContext::getRecordType(const RecordDecl *Decl) const { if (const RecordDecl *PrevDecl = Decl->getPreviousDecl()) if (PrevDecl->TypeForDecl) - return QualType(Decl->TypeForDecl = PrevDecl->TypeForDecl, 0); + return QualType(Decl->TypeForDecl = PrevDecl->TypeForDecl, 0); auto *newType = new (*this, TypeAlignment) RecordType(Decl); Decl->TypeForDecl = newType; @@ -3862,7 +3862,7 @@ QualType ASTContext::getEnumType(const EnumDecl *Decl) const { if (const EnumDecl *PrevDecl = Decl->getPreviousDecl()) if (PrevDecl->TypeForDecl) - return QualType(Decl->TypeForDecl = PrevDecl->TypeForDecl, 0); + return QualType(Decl->TypeForDecl = PrevDecl->TypeForDecl, 0); auto *newType = new (*this, TypeAlignment) EnumType(Decl); Decl->TypeForDecl = newType; @@ -3913,7 +3913,7 @@ ASTContext::getSubstTemplateTypeParmType(const TemplateTypeParmType *Parm, return QualType(SubstParm, 0); } -/// Retrieve a +/// Retrieve a QualType ASTContext::getSubstTemplateTypeParmPackType( const TemplateTypeParmType *Parm, const TemplateArgument &ArgPack) { @@ -3923,14 +3923,14 @@ QualType ASTContext::getSubstTemplateTypeParmPackType( assert(P.getAsType().isCanonical() && "Pack contains non-canonical type"); } #endif - + llvm::FoldingSetNodeID ID; SubstTemplateTypeParmPackType::Profile(ID, Parm, ArgPack); void *InsertPos = nullptr; if (SubstTemplateTypeParmPackType *SubstParm = SubstTemplateTypeParmPackTypes.FindNodeOrInsertPos(ID, InsertPos)) return QualType(SubstParm, 0); - + QualType Canon; if (!Parm->isCanonicalUnqualified()) { Canon = getCanonicalType(QualType(Parm, 0)); @@ -3944,7 +3944,7 @@ QualType ASTContext::getSubstTemplateTypeParmPackType( ArgPack); Types.push_back(SubstParm); SubstTemplateTypeParmPackTypes.InsertNode(SubstParm, InsertPos); - return QualType(SubstParm, 0); + return QualType(SubstParm, 0); } /// Retrieve the template type parameter type for a template @@ -3966,7 +3966,7 @@ QualType ASTContext::getTemplateTypeParmType(unsigned Depth, unsigned Index, QualType Canon = getTemplateTypeParmType(Depth, Index, ParameterPack); TypeParm = new (*this, TypeAlignment) TemplateTypeParmType(TTPDecl, Canon); - TemplateTypeParmType *TypeCheck + TemplateTypeParmType *TypeCheck = TemplateTypeParmTypes.FindNodeOrInsertPos(ID, InsertPos); assert(!TypeCheck && "Template type parameter canonical type broken"); (void)TypeCheck; @@ -3985,7 +3985,7 @@ ASTContext::getTemplateSpecializationTypeInfo(TemplateName Name, SourceLocation NameLoc, const TemplateArgumentListInfo &Args, QualType Underlying) const { - assert(!Name.getAsDependentTemplateName() && + assert(!Name.getAsDependentTemplateName() && "No dependent template names here!"); QualType TST = getTemplateSpecializationType(Name, Args, Underlying); @@ -4005,7 +4005,7 @@ QualType ASTContext::getTemplateSpecializationType(TemplateName Template, const TemplateArgumentListInfo &Args, QualType Underlying) const { - assert(!Template.getAsDependentTemplateName() && + assert(!Template.getAsDependentTemplateName() && "No dependent template names here!"); SmallVector<TemplateArgument, 4> ArgVec; @@ -4021,7 +4021,7 @@ static bool hasAnyPackExpansions(ArrayRef<TemplateArgument> Args) { for (const TemplateArgument &Arg : Args) if (Arg.isPackExpansion()) return true; - + return true; } #endif @@ -4030,13 +4030,13 @@ QualType ASTContext::getTemplateSpecializationType(TemplateName Template, ArrayRef<TemplateArgument> Args, QualType Underlying) const { - assert(!Template.getAsDependentTemplateName() && + assert(!Template.getAsDependentTemplateName() && "No dependent template names here!"); // Look through qualified template names. if (QualifiedTemplateName *QTN = Template.getAsQualifiedTemplateName()) Template = TemplateName(QTN->getTemplateDecl()); - - bool IsTypeAlias = + + bool IsTypeAlias = Template.getAsTemplateDecl() && isa<TypeAliasTemplateDecl>(Template.getAsTemplateDecl()); QualType CanonType; @@ -4068,13 +4068,13 @@ ASTContext::getTemplateSpecializationType(TemplateName Template, QualType ASTContext::getCanonicalTemplateSpecializationType( TemplateName Template, ArrayRef<TemplateArgument> Args) const { - assert(!Template.getAsDependentTemplateName() && + assert(!Template.getAsDependentTemplateName() && "No dependent template names here!"); // Look through qualified template names. if (QualifiedTemplateName *QTN = Template.getAsQualifiedTemplateName()) Template = TemplateName(QTN->getTemplateDecl()); - + // Build the canonical template specialization type. TemplateName CanonTemplate = getCanonicalTemplateName(Template); SmallVector<TemplateArgument, 4> CanonArgs; @@ -4205,7 +4205,7 @@ ASTContext::getDependentTemplateSpecializationType( NestedNameSpecifier *NNS, const IdentifierInfo *Name, ArrayRef<TemplateArgument> Args) const { - assert((!NNS || NNS->isDependent()) && + assert((!NNS || NNS->isDependent()) && "nested-name-specifier must be dependent"); llvm::FoldingSetNodeID ID; @@ -4340,7 +4340,7 @@ static bool areSortedAndUniqued(ArrayRef<ObjCProtocolDecl *> Protocols) { if (Protocols[0]->getCanonicalDecl() != Protocols[0]) return false; - + for (unsigned i = 1; i != Protocols.size(); ++i) if (CmpProtocolNames(&Protocols[i - 1], &Protocols[i]) >= 0 || Protocols[i]->getCanonicalDecl() != Protocols[i]) @@ -4565,7 +4565,7 @@ bool ASTContext::ObjCObjectAdoptsQTypeProtocols(QualType QT, ObjCInterfaceDecl *IC) { if (!QT->isObjCQualifiedIdType()) return false; - + if (const auto *OPT = QT->getAs<ObjCObjectPointerType>()) { // If both the right and left sides have qualifiers. for (auto *Proto : OPT->quals()) { @@ -4609,7 +4609,7 @@ bool ASTContext::QIdProtocolsAdoptObjCObjectProtocols(QualType QT, } if (Conforms) return true; - + for (auto *PI : InheritedProtocols) { // If both the right and left sides have qualifiers. bool Adopts = false; @@ -4670,7 +4670,7 @@ QualType ASTContext::getObjCInterfaceType(const ObjCInterfaceDecl *Decl, // Prefer the definition, if there is one. if (const ObjCInterfaceDecl *Def = Decl->getDefinition()) Decl = Def; - + void *Mem = Allocate(sizeof(ObjCInterfaceType), TypeAlignment); auto *T = new (Mem) ObjCInterfaceType(Decl); Decl->TypeForDecl = T; @@ -4901,7 +4901,7 @@ CanQualType ASTContext::getSizeType() const { return getFromTargetType(Target->getSizeType()); } -/// Return the unique signed counterpart of the integer type +/// Return the unique signed counterpart of the integer type /// corresponding to size_t. CanQualType ASTContext::getSignedSizeType() const { return getFromTargetType(Target->getSignedSizeType()); @@ -5090,14 +5090,14 @@ bool ASTContext::UnwrapSimilarTypes(QualType &T1, QualType &T2) { const auto *T1MPType = T1->getAs<MemberPointerType>(); const auto *T2MPType = T2->getAs<MemberPointerType>(); - if (T1MPType && T2MPType && - hasSameUnqualifiedType(QualType(T1MPType->getClass(), 0), + if (T1MPType && T2MPType && + hasSameUnqualifiedType(QualType(T1MPType->getClass(), 0), QualType(T2MPType->getClass(), 0))) { T1 = T1MPType->getPointeeType(); T2 = T2MPType->getPointeeType(); return true; } - + if (getLangOpts().ObjC1) { const auto *T1OPType = T1->getAs<ObjCObjectPointerType>(); const auto *T2OPType = T2->getAs<ObjCObjectPointerType>(); @@ -5107,9 +5107,9 @@ bool ASTContext::UnwrapSimilarTypes(QualType &T1, QualType &T2) { return true; } } - + // FIXME: Block pointers, too? - + return false; } @@ -5201,7 +5201,7 @@ TemplateName ASTContext::getCanonicalTemplateName(TemplateName Name) const { TemplateDecl *Template = Name.getAsTemplateDecl(); if (auto *TTP = dyn_cast<TemplateTemplateParmDecl>(Template)) Template = getCanonicalTemplateTemplateParmDecl(TTP); - + // The canonical template name is the canonical template declaration. return TemplateName(cast<TemplateDecl>(Template->getCanonicalDecl())); } @@ -5276,7 +5276,7 @@ ASTContext::getCanonicalTemplateArgument(const TemplateArgument &Arg) const { case TemplateArgument::Pack: { if (Arg.pack_size() == 0) return Arg; - + auto *CanonArgs = new (*this) TemplateArgument[Arg.pack_size()]; unsigned Idx = 0; for (TemplateArgument::pack_iterator A = Arg.pack_begin(), @@ -5320,7 +5320,7 @@ ASTContext::getCanonicalNestedNameSpecifier(NestedNameSpecifier *NNS) const { case NestedNameSpecifier::TypeSpec: case NestedNameSpecifier::TypeSpecWithTemplate: { QualType T = getCanonicalType(QualType(NNS->getAsType(), 0)); - + // If we have some kind of dependent-named type (e.g., "typename T::type"), // break it apart into its prefix and identifier, then reconsititute those // as the canonical nested-name-specifier. This is required to canonicalize @@ -5329,7 +5329,7 @@ ASTContext::getCanonicalNestedNameSpecifier(NestedNameSpecifier *NNS) const { // typedef typename T::type T1; // typedef typename T1::type T2; if (const auto *DNT = T->getAs<DependentNameType>()) - return NestedNameSpecifier::Create(*this, DNT->getQualifier(), + return NestedNameSpecifier::Create(*this, DNT->getQualifier(), const_cast<IdentifierInfo *>(DNT->getIdentifier())); // Otherwise, just canonicalize the type, and force it to be a TypeSpec. @@ -5961,24 +5961,24 @@ bool ASTContext::BlockRequiresCopying(QualType Ty, if (const CXXRecordDecl *record = Ty->getAsCXXRecordDecl()) { const Expr *copyExpr = getBlockVarCopyInits(D); if (!copyExpr && record->hasTrivialDestructor()) return false; - + return true; } - + // The block needs copy/destroy helpers if Ty is non-trivial to destructively // move or destroy. if (Ty.isNonTrivialToPrimitiveDestructiveMove() || Ty.isDestructedType()) return true; if (!Ty->isObjCRetainableType()) return false; - + Qualifiers qs = Ty.getQualifiers(); - + // If we have lifetime, that dominates. if (Qualifiers::ObjCLifetime lifetime = qs.getObjCLifetime()) { switch (lifetime) { case Qualifiers::OCL_None: llvm_unreachable("impossible"); - + // These are just bits as far as the runtime is concerned. case Qualifiers::OCL_ExplicitNone: case Qualifiers::OCL_Autoreleasing: @@ -6002,7 +6002,7 @@ bool ASTContext::getByrefLifetime(QualType Ty, if (!getLangOpts().ObjC1 || getLangOpts().getGC() != LangOptions::NonGC) return false; - + HasByrefExtendedLayout = false; if (Ty->isRecordType()) { HasByrefExtendedLayout = true; @@ -6040,7 +6040,7 @@ static bool isTypeTypedefedAsBOOL(QualType T) { CharUnits ASTContext::getObjCEncodingTypeSize(QualType type) const { if (!type->isIncompleteArrayType() && type->isIncompleteType()) return CharUnits::Zero(); - + CharUnits sz = getTypeSizeInChars(type); // Make all integer and enum types at least as large as an int @@ -6116,11 +6116,11 @@ std::string ASTContext::getObjCEncodingForBlock(const BlockExpr *Expr) const { S += charUnitsToString(ParmOffset); // Block pointer and offset. S += "@?0"; - + // Argument types. ParmOffset = PtrSize; for (auto PVDecl : Decl->parameters()) { - QualType PType = PVDecl->getOriginalType(); + QualType PType = PVDecl->getOriginalType(); if (const auto *AT = dyn_cast<ArrayType>(PType->getCanonicalTypeInternal())) { // Use array's original type only if it has known number of @@ -6153,8 +6153,8 @@ ASTContext::getObjCEncodingForFunctionDecl(const FunctionDecl *Decl) const { CharUnits sz = getObjCEncodingTypeSize(PType); if (sz.isZero()) continue; - - assert(sz.isPositive() && + + assert(sz.isPositive() && "getObjCEncodingForFunctionDecl - Incomplete param type"); ParmOffset += sz; } @@ -6176,12 +6176,12 @@ ASTContext::getObjCEncodingForFunctionDecl(const FunctionDecl *Decl) const { S += charUnitsToString(ParmOffset); ParmOffset += getObjCEncodingTypeSize(PType); } - + return S; } /// getObjCEncodingForMethodParameter - Return the encoded type for a single -/// method parameter or return type. If Extended, include class names and +/// method parameter or return type. If Extended, include class names and /// block object types. void ASTContext::getObjCEncodingForMethodParameter(Decl::ObjCDeclQualifier QT, QualType T, std::string& S, @@ -6191,9 +6191,9 @@ void ASTContext::getObjCEncodingForMethodParameter(Decl::ObjCDeclQualifier QT, // Encode parameter type. getObjCEncodingForTypeImpl(T, S, true, true, nullptr, true /*OutermostType*/, - false /*EncodingProperty*/, - false /*StructField*/, - Extended /*EncodeBlockParameters*/, + false /*EncodingProperty*/, + false /*StructField*/, + Extended /*EncodeBlockParameters*/, Extended /*EncodeClassNames*/); } @@ -6219,8 +6219,8 @@ std::string ASTContext::getObjCEncodingForMethodDecl(const ObjCMethodDecl *Decl, CharUnits sz = getObjCEncodingTypeSize(PType); if (sz.isZero()) continue; - - assert(sz.isPositive() && + + assert(sz.isPositive() && "getObjCEncodingForMethodDecl - Incomplete param type"); ParmOffset += sz; } @@ -6242,12 +6242,12 @@ std::string ASTContext::getObjCEncodingForMethodDecl(const ObjCMethodDecl *Decl, PType = PVDecl->getType(); } else if (PType->isFunctionType()) PType = PVDecl->getType(); - getObjCEncodingForMethodParameter(PVDecl->getObjCDeclQualifier(), + getObjCEncodingForMethodParameter(PVDecl->getObjCDeclQualifier(), PType, S, Extended); S += charUnitsToString(ParmOffset); ParmOffset += getObjCEncodingTypeSize(PType); } - + return S; } @@ -6488,11 +6488,11 @@ static char getObjCEncodingForPrimitiveKind(const ASTContext *C, static char ObjCEncodingForEnumType(const ASTContext *C, const EnumType *ET) { EnumDecl *Enum = ET->getDecl(); - + // The encoding of an non-fixed enum type is always 'i', regardless of size. if (!Enum->isFixed()) return 'i'; - + // The encoding of a fixed enum type matches its fixed underlying type. const auto *BT = Enum->getIntegerType()->castAs<BuiltinType>(); return getObjCEncodingForPrimitiveKind(C, BT->getKind()); @@ -6740,7 +6740,7 @@ void ASTContext::getObjCEncodingForTypeImpl(QualType T, std::string& S, S += "@?"; // Unlike a pointer-to-function, which is "^?". if (EncodeBlockParameters) { const auto *FT = BT->getPointeeType()->castAs<FunctionType>(); - + S += '<'; // Block return type getObjCEncodingForTypeImpl( @@ -6778,7 +6778,7 @@ void ASTContext::getObjCEncodingForTypeImpl(QualType T, std::string& S, // TODO: Double check to make sure this intentionally falls through. LLVM_FALLTHROUGH; } - + case Type::ObjCInterface: { // Ignore protocol qualifiers when mangling at this level. // @encode(class_name) @@ -6868,7 +6868,7 @@ void ASTContext::getObjCEncodingForTypeImpl(QualType T, std::string& S, } S += '@'; - if (OPT->getInterfaceDecl() && + if (OPT->getInterfaceDecl() && (FD || EncodingProperty || EncodeClassNames)) { S += '"'; S += OPT->getInterfaceDecl()->getObjCRuntimeNameAsString(); @@ -6893,7 +6893,7 @@ void ASTContext::getObjCEncodingForTypeImpl(QualType T, std::string& S, if (NotEncodedT) *NotEncodedT = T; return; - + // We could see an undeduced auto type here during error recovery. // Just ignore it. case Type::Auto: @@ -6941,7 +6941,7 @@ void ASTContext::getObjCEncodingForStructureImpl(RecordDecl *RDecl, } } } - + unsigned i = 0; for (auto *Field : RDecl->fields()) { uint64_t offs = layout.getFieldOffset(i); @@ -7002,7 +7002,7 @@ void ASTContext::getObjCEncodingForStructureImpl(RecordDecl *RDecl, #ifndef NDEBUG assert(CurOffs <= CurLayObj->first); if (CurOffs < CurLayObj->first) { - uint64_t padding = CurLayObj->first - CurOffs; + uint64_t padding = CurLayObj->first - CurOffs; // FIXME: There doesn't seem to be a way to indicate in the encoding that // packing/alignment of members is different that normal, in which case // the encoding will be out-of-sync with the real layout. @@ -7102,15 +7102,15 @@ TypedefDecl *ASTContext::getObjCClassDecl() const { ObjCInterfaceDecl *ASTContext::getObjCProtocolDecl() const { if (!ObjCProtocolClassDecl) { - ObjCProtocolClassDecl - = ObjCInterfaceDecl::Create(*this, getTranslationUnitDecl(), + ObjCProtocolClassDecl + = ObjCInterfaceDecl::Create(*this, getTranslationUnitDecl(), SourceLocation(), &Idents.get("Protocol"), /*typeParamList=*/nullptr, /*PrevDecl=*/nullptr, - SourceLocation(), true); + SourceLocation(), true); } - + return ObjCProtocolClassDecl; } @@ -7516,7 +7516,7 @@ ASTContext::getQualifiedTemplateName(NestedNameSpecifier *NNS, bool TemplateKeyword, TemplateDecl *Template) const { assert(NNS && "Missing nested-name-specifier in qualified template name"); - + // FIXME: Canonicalization? llvm::FoldingSetNodeID ID; QualifiedTemplateName::Profile(ID, NNS, TemplateKeyword, Template); @@ -7571,22 +7571,22 @@ ASTContext::getDependentTemplateName(NestedNameSpecifier *NNS, /// Retrieve the template name that represents a dependent /// template name such as \c MetaFun::template operator+. -TemplateName +TemplateName ASTContext::getDependentTemplateName(NestedNameSpecifier *NNS, OverloadedOperatorKind Operator) const { assert((!NNS || NNS->isDependent()) && "Nested name specifier must be dependent"); - + llvm::FoldingSetNodeID ID; DependentTemplateName::Profile(ID, NNS, Operator); void *InsertPos = nullptr; DependentTemplateName *QTN = DependentTemplateNames.FindNodeOrInsertPos(ID, InsertPos); - + if (QTN) return TemplateName(QTN); - + NestedNameSpecifier *CanonNNS = getCanonicalNestedNameSpecifier(NNS); if (CanonNNS == NNS) { QTN = new (*this, alignof(DependentTemplateName)) @@ -7601,12 +7601,12 @@ ASTContext::getDependentTemplateName(NestedNameSpecifier *NNS, assert(!CheckQTN && "Dependent template name canonicalization broken"); (void)CheckQTN; } - + DependentTemplateNames.InsertNode(QTN, InsertPos); return TemplateName(QTN); } -TemplateName +TemplateName ASTContext::getSubstTemplateTemplateParm(TemplateTemplateParmDecl *param, TemplateName replacement) const { llvm::FoldingSetNodeID ID; @@ -7615,7 +7615,7 @@ ASTContext::getSubstTemplateTemplateParm(TemplateTemplateParmDecl *param, void *insertPos = nullptr; SubstTemplateTemplateParmStorage *subst = SubstTemplateTemplateParms.FindNodeOrInsertPos(ID, insertPos); - + if (!subst) { subst = new (*this) SubstTemplateTemplateParmStorage(param, replacement); SubstTemplateTemplateParms.InsertNode(subst, insertPos); @@ -7624,7 +7624,7 @@ ASTContext::getSubstTemplateTemplateParm(TemplateTemplateParmDecl *param, return TemplateName(subst); } -TemplateName +TemplateName ASTContext::getSubstTemplateTemplateParmPack(TemplateTemplateParmDecl *Param, const TemplateArgument &ArgPack) const { auto &Self = const_cast<ASTContext &>(*this); @@ -7634,9 +7634,9 @@ ASTContext::getSubstTemplateTemplateParmPack(TemplateTemplateParmDecl *Param, void *InsertPos = nullptr; SubstTemplateTemplateParmPackStorage *Subst = SubstTemplateTemplateParmPacks.FindNodeOrInsertPos(ID, InsertPos); - + if (!Subst) { - Subst = new (*this) SubstTemplateTemplateParmPackStorage(Param, + Subst = new (*this) SubstTemplateTemplateParmPackStorage(Param, ArgPack.pack_size(), ArgPack.pack_begin()); SubstTemplateTemplateParmPacks.InsertNode(Subst, InsertPos); @@ -7756,12 +7756,12 @@ ASTContext::ProtocolCompatibleWithProtocol(ObjCProtocolDecl *lProto, /// ObjCQualifiedClassTypesAreCompatible - compare Class<pr,...> and /// Class<pr1, ...>. -bool ASTContext::ObjCQualifiedClassTypesAreCompatible(QualType lhs, +bool ASTContext::ObjCQualifiedClassTypesAreCompatible(QualType lhs, QualType rhs) { const auto *lhsQID = lhs->getAs<ObjCObjectPointerType>(); const auto *rhsOPT = rhs->getAs<ObjCObjectPointerType>(); assert((lhsQID && rhsOPT) && "ObjCQualifiedClassTypesAreCompatible"); - + for (auto *lhsProto : lhsQID->quals()) { bool match = false; for (auto *rhsProto : rhsOPT->quals()) { @@ -7866,7 +7866,7 @@ bool ASTContext::ObjCQualifiedIdTypesAreCompatible(QualType lhs, QualType rhs, if (!match) return false; } - + // Static class's protocols, or its super class or category protocols // must be found, direct or indirect in rhs's qualifier list or it is a mismatch. if (ObjCInterfaceDecl *lhsID = lhsOPT->getInterfaceDecl()) { @@ -7928,12 +7928,12 @@ bool ASTContext::canAssignObjCInterfaces(const ObjCObjectPointerType *LHSOPT, QualType(RHSOPT,0), false)); } - + if (LHS->isObjCQualifiedClass() && RHS->isObjCQualifiedClass()) { return finish(ObjCQualifiedClassTypesAreCompatible(QualType(LHSOPT,0), QualType(RHSOPT,0))); } - + // If we have 2 user-defined types, fall into that path. if (LHS->getInterface() && RHS->getInterface()) { return finish(canAssignObjCInterfaces(LHS, RHS)); @@ -7943,7 +7943,7 @@ bool ASTContext::canAssignObjCInterfaces(const ObjCObjectPointerType *LHSOPT, } /// canAssignObjCInterfacesInBlockPointer - This routine is specifically written -/// for providing type-safety for objective-c pointers used to pass/return +/// for providing type-safety for objective-c pointers used to pass/return /// arguments in block literals. When passed as arguments, passing 'A*' where /// 'id' is expected is not OK. Passing 'Sub *" where 'Super *" is expected is /// not OK. For the return type, the opposite is not OK. @@ -7972,17 +7972,17 @@ bool ASTContext::canAssignObjCInterfacesInBlockPointer( if (RHSOPT->isObjCBuiltinType() || LHSOPT->isObjCIdType()) return true; - + if (LHSOPT->isObjCBuiltinType()) { return finish(RHSOPT->isObjCBuiltinType() || RHSOPT->isObjCQualifiedIdType()); } - + if (LHSOPT->isObjCQualifiedIdType() || RHSOPT->isObjCQualifiedIdType()) return finish(ObjCQualifiedIdTypesAreCompatible(QualType(LHSOPT,0), QualType(RHSOPT,0), false)); - + const ObjCInterfaceType* LHS = LHSOPT->getInterfaceType(); const ObjCInterfaceType* RHS = RHSOPT->getInterfaceType(); if (LHS && RHS) { // We have 2 user-defined types. @@ -8010,13 +8010,13 @@ static int compareObjCProtocolsByName(ObjCProtocolDecl * const *lhs, /// the given common base. /// It is used to build composite qualifier list of the composite type of /// the conditional expression involving two objective-c pointer objects. -static +static void getIntersectionOfProtocols(ASTContext &Context, const ObjCInterfaceDecl *CommonBase, const ObjCObjectPointerType *LHSOPT, const ObjCObjectPointerType *RHSOPT, SmallVectorImpl<ObjCProtocolDecl *> &IntersectionSet) { - + const ObjCObjectType* LHS = LHSOPT->getObjectType(); const ObjCObjectType* RHS = RHSOPT->getObjectType(); assert(LHS->getInterface() && "LHS must have an interface base"); @@ -8285,7 +8285,7 @@ bool ASTContext::canAssignObjCInterfaces(const ObjCObjectType *LHS, // If there is no protocols associated with RHS, it is not a match. if (SuperClassInheritedProtocols.empty()) return false; - + for (const auto *LHSProto : LHS->quals()) { bool SuperImplementsProtocol = false; for (auto *SuperClassProto : SuperClassInheritedProtocols) @@ -8398,7 +8398,7 @@ QualType ASTContext::mergeFunctionParameterTypes(QualType lhs, QualType rhs, return mergeTypes(lhs, rhs, OfBlockPointer, Unqualified); } -QualType ASTContext::mergeFunctionTypes(QualType lhs, QualType rhs, +QualType ASTContext::mergeFunctionTypes(QualType lhs, QualType rhs, bool OfBlockPointer, bool Unqualified) { const auto *lbase = lhs->getAs<FunctionType>(); @@ -8423,7 +8423,7 @@ QualType ASTContext::mergeFunctionTypes(QualType lhs, QualType rhs, Unqualified); if (retType.isNull()) return {}; - + if (Unqualified) retType = retType.getUnqualifiedType(); @@ -8433,7 +8433,7 @@ QualType ASTContext::mergeFunctionTypes(QualType lhs, QualType rhs, LRetType = LRetType.getUnqualifiedType(); RRetType = RRetType.getUnqualifiedType(); } - + if (getCanonicalType(retType) != LRetType) allLTypes = false; if (getCanonicalType(retType) != RRetType) @@ -8522,7 +8522,7 @@ QualType ASTContext::mergeFunctionTypes(QualType lhs, QualType rhs, if (getCanonicalType(paramType) != getCanonicalType(rParamType)) allRTypes = false; } - + if (allLTypes) return lhs; if (allRTypes) return rhs; @@ -8597,7 +8597,7 @@ static QualType mergeEnumWithInteger(ASTContext &Context, const EnumType *ET, return {}; } -QualType ASTContext::mergeTypes(QualType LHS, QualType RHS, +QualType ASTContext::mergeTypes(QualType LHS, QualType RHS, bool OfBlockPointer, bool Unqualified, bool BlockReturnType) { // C++ [expr]: If an expression initially has the type "reference to T", the @@ -8612,7 +8612,7 @@ QualType ASTContext::mergeTypes(QualType LHS, QualType RHS, LHS = LHS.getUnqualifiedType(); RHS = RHS.getUnqualifiedType(); } - + QualType LHSCan = getCanonicalType(LHS), RHSCan = getCanonicalType(RHS); @@ -8694,7 +8694,7 @@ QualType ASTContext::mergeTypes(QualType LHS, QualType RHS, if (RHS->isObjCIdType() && LHS->isBlockPointerType()) return RHS; } - + return {}; } @@ -8731,7 +8731,7 @@ QualType ASTContext::mergeTypes(QualType LHS, QualType RHS, LHSPointee = LHSPointee.getUnqualifiedType(); RHSPointee = RHSPointee.getUnqualifiedType(); } - QualType ResultType = mergeTypes(LHSPointee, RHSPointee, false, + QualType ResultType = mergeTypes(LHSPointee, RHSPointee, false, Unqualified); if (ResultType.isNull()) return {}; @@ -8783,7 +8783,7 @@ QualType ASTContext::mergeTypes(QualType LHS, QualType RHS, LHSValue = LHSValue.getUnqualifiedType(); RHSValue = RHSValue.getUnqualifiedType(); } - QualType ResultType = mergeTypes(LHSValue, RHSValue, false, + QualType ResultType = mergeTypes(LHSValue, RHSValue, false, Unqualified); if (ResultType.isNull()) return {}; @@ -8806,7 +8806,7 @@ QualType ASTContext::mergeTypes(QualType LHS, QualType RHS, LHSElem = LHSElem.getUnqualifiedType(); RHSElem = RHSElem.getUnqualifiedType(); } - + QualType ResultType = mergeTypes(LHSElem, RHSElem, false, Unqualified); if (ResultType.isNull()) return {}; @@ -8989,7 +8989,7 @@ QualType ASTContext::mergeObjCGCQualifiers(QualType LHS, QualType RHS) { cast<FunctionType>(RHSCan.getTypePtr())->getReturnType(); QualType NewReturnType = cast<FunctionType>(LHSCan.getTypePtr())->getReturnType(); - QualType ResReturnType = + QualType ResReturnType = mergeObjCGCQualifiers(NewReturnType, OldReturnType); if (ResReturnType.isNull()) return {}; @@ -9007,7 +9007,7 @@ QualType ASTContext::mergeObjCGCQualifiers(QualType LHS, QualType RHS) { } return {}; } - + // If the qualifiers are different, the types can still be merged. Qualifiers LQuals = LHSCan.getLocalQualifiers(); Qualifiers RQuals = RHSCan.getLocalQualifiers(); @@ -9016,7 +9016,7 @@ QualType ASTContext::mergeObjCGCQualifiers(QualType LHS, QualType RHS) { if (LQuals.getCVRQualifiers() != RQuals.getCVRQualifiers() || LQuals.getAddressSpace() != RQuals.getAddressSpace()) return {}; - + // Exactly one GC qualifier difference is allowed: __strong is // okay if the other type has no GC qualifier but is an Objective // C object pointer (i.e. implicitly strong by default). We fix @@ -9025,17 +9025,17 @@ QualType ASTContext::mergeObjCGCQualifiers(QualType LHS, QualType RHS) { Qualifiers::GC GC_L = LQuals.getObjCGCAttr(); Qualifiers::GC GC_R = RQuals.getObjCGCAttr(); assert((GC_L != GC_R) && "unequal qualifier sets had only equal elements"); - + if (GC_L == Qualifiers::Weak || GC_R == Qualifiers::Weak) return {}; - + if (GC_L == Qualifiers::Strong) return LHS; if (GC_R == Qualifiers::Strong) return RHS; return {}; } - + if (LHSCan->isObjCObjectPointerType() && RHSCan->isObjCObjectPointerType()) { QualType LHSBaseQT = LHS->getAs<ObjCObjectPointerType>()->getPointeeType(); QualType RHSBaseQT = RHS->getAs<ObjCObjectPointerType>()->getPointeeType(); @@ -9064,7 +9064,7 @@ unsigned ASTContext::getIntWidth(QualType T) const { QualType ASTContext::getCorrespondingUnsignedType(QualType T) const { assert((T->hasSignedIntegerRepresentation() || T->isSignedFixedPointType()) && "Unexpected type"); - + // Turn <4 x signed int> -> <4 x unsigned int> if (const auto *VTy = T->getAs<VectorType>()) return getVectorType(getCorrespondingUnsignedType(VTy->getElementType()), @@ -9073,7 +9073,7 @@ QualType ASTContext::getCorrespondingUnsignedType(QualType T) const { // For enums, we return the unsigned version of the base type. if (const auto *ETy = T->getAs<EnumType>()) T = ETy->getDecl()->getIntegerType(); - + const auto *BTy = T->getAs<BuiltinType>(); assert(BTy && "Unexpected signed integer or fixed point type"); switch (BTy->getKind()) { @@ -9145,7 +9145,7 @@ static QualType DecodeTypeFromStr(const char *&Str, const ASTContext &Context, int HowLong = 0; bool Signed = false, Unsigned = false; RequiresICE = false; - + // Read the prefixed modifiers first. bool Done = false; #ifndef NDEBUG @@ -9309,10 +9309,10 @@ static QualType DecodeTypeFromStr(const char *&Str, const ASTContext &Context, assert(End != Str && "Missing vector size"); Str = End; - QualType ElementType = DecodeTypeFromStr(Str, Context, Error, + QualType ElementType = DecodeTypeFromStr(Str, Context, Error, RequiresICE, false); assert(!RequiresICE && "Can't require vector ICE"); - + // TODO: No way to make AltiVec vectors in builtins yet. Type = Context.getVectorType(ElementType, NumElements, VectorType::GenericVector); @@ -9320,16 +9320,16 @@ static QualType DecodeTypeFromStr(const char *&Str, const ASTContext &Context, } case 'E': { char *End; - + unsigned NumElements = strtoul(Str, &End, 10); assert(End != Str && "Missing vector size"); - + Str = End; - + QualType ElementType = DecodeTypeFromStr(Str, Context, Error, RequiresICE, false); Type = Context.getExtVectorType(ElementType, NumElements); - break; + break; } case 'X': { QualType ElementType = DecodeTypeFromStr(Str, Context, Error, RequiresICE, @@ -9337,7 +9337,7 @@ static QualType DecodeTypeFromStr(const char *&Str, const ASTContext &Context, assert(!RequiresICE && "Can't require complex ICE"); Type = Context.getComplexType(ElementType); break; - } + } case 'Y': Type = Context.getPointerDiffType(); break; @@ -9407,9 +9407,9 @@ static QualType DecodeTypeFromStr(const char *&Str, const ASTContext &Context, break; } } - + assert((!RequiresICE || Type->isIntegralOrEnumerationType()) && - "Integer constant 'I' type must be an integer"); + "Integer constant 'I' type must be an integer"); return Type; } @@ -9428,9 +9428,9 @@ QualType ASTContext::GetBuiltinType(unsigned Id, RequiresICE, true); if (Error != GE_None) return {}; - + assert(!RequiresICE && "Result of intrinsic cannot be required to be an ICE"); - + while (TypeStr[0] && TypeStr[0] != '.') { QualType Ty = DecodeTypeFromStr(TypeStr, *this, Error, RequiresICE, true); if (Error != GE_None) @@ -9440,7 +9440,7 @@ QualType ASTContext::GetBuiltinType(unsigned Id, // caller cares, fill in the bitmask we return. if (RequiresICE && IntegerConstantArgs) *IntegerConstantArgs |= 1 << ArgTypes.size(); - + // Do array -> pointer decay. The builtin should use the decayed type. if (Ty->isArrayType()) Ty = getArrayDecayedType(Ty); @@ -10037,7 +10037,7 @@ void ASTContext::setParameterIndex(const ParmVarDecl *D, unsigned int index) { unsigned ASTContext::getParameterIndex(const ParmVarDecl *D) const { ParameterIndexTable::const_iterator I = ParamIndices.find(D); - assert(I != ParamIndices.end() && + assert(I != ParamIndices.end() && "ParmIndices lacks entry set by ParmVarDecl"); return I->second; } @@ -10271,10 +10271,10 @@ ASTContext::ObjCMethodsAreEqual(const ObjCMethodDecl *MethodDecl, return false; if (!hasSameType(MethodDecl->getReturnType(), MethodImpl->getReturnType())) return false; - + if (MethodDecl->param_size() != MethodImpl->param_size()) return false; - + for (ObjCMethodDecl::param_const_iterator IM = MethodImpl->param_begin(), IF = MethodDecl->param_begin(), EM = MethodImpl->param_end(), EF = MethodDecl->param_end(); |