diff options
Diffstat (limited to 'clang/lib/AST/ASTContext.cpp')
-rw-r--r-- | clang/lib/AST/ASTContext.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index 4af1599b94a..b80142fef30 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -222,7 +222,7 @@ const llvm::fltSemantics &ASTContext::getFloatTypeSemantics(QualType T) const { unsigned ASTContext::getDeclAlignInBytes(const Decl *D) { unsigned Align = Target.getCharWidth(); - if (const AlignedAttr* AA = D->getAttr<AlignedAttr>()) + if (const AlignedAttr* AA = D->getAttr<AlignedAttr>(*this)) Align = std::max(Align, AA->getAlignment()); if (const ValueDecl *VD = dyn_cast<ValueDecl>(D)) { @@ -445,7 +445,7 @@ ASTContext::getTypeInfo(const Type *T) { case Type::Typedef: { const TypedefDecl *Typedef = cast<TypedefType>(T)->getDecl(); - if (const AlignedAttr *Aligned = Typedef->getAttr<AlignedAttr>()) { + if (const AlignedAttr *Aligned = Typedef->getAttr<AlignedAttr>(*this)) { Align = Aligned->getAlignment(); Width = getTypeSize(Typedef->getUnderlyingType().getTypePtr()); } else @@ -505,7 +505,7 @@ void ASTRecordLayout::LayoutField(const FieldDecl *FD, unsigned FieldNo, // FIXME: Should this override struct packing? Probably we want to // take the minimum? - if (const PackedAttr *PA = FD->getAttr<PackedAttr>()) + if (const PackedAttr *PA = FD->getAttr<PackedAttr>(Context)) FieldPacking = PA->getAlignment(); if (const Expr *BitWidthExpr = FD->getBitWidth()) { @@ -525,7 +525,7 @@ void ASTRecordLayout::LayoutField(const FieldDecl *FD, unsigned FieldNo, FieldAlign = FieldInfo.second; if (FieldPacking) FieldAlign = std::min(FieldAlign, FieldPacking); - if (const AlignedAttr *AA = FD->getAttr<AlignedAttr>()) + if (const AlignedAttr *AA = FD->getAttr<AlignedAttr>(Context)) FieldAlign = std::max(FieldAlign, AA->getAlignment()); // Check if we need to add padding to give the field the correct @@ -565,7 +565,7 @@ void ASTRecordLayout::LayoutField(const FieldDecl *FD, unsigned FieldNo, // is smaller than the specified packing? if (FieldPacking) FieldAlign = std::min(FieldAlign, std::max(8U, FieldPacking)); - if (const AlignedAttr *AA = FD->getAttr<AlignedAttr>()) + if (const AlignedAttr *AA = FD->getAttr<AlignedAttr>(Context)) FieldAlign = std::max(FieldAlign, AA->getAlignment()); // Round up the current record size to the field's alignment boundary. @@ -731,10 +731,10 @@ ASTContext::getObjCLayout(const ObjCInterfaceDecl *D, } unsigned StructPacking = 0; - if (const PackedAttr *PA = D->getAttr<PackedAttr>()) + if (const PackedAttr *PA = D->getAttr<PackedAttr>(*this)) StructPacking = PA->getAlignment(); - if (const AlignedAttr *AA = D->getAttr<AlignedAttr>()) + if (const AlignedAttr *AA = D->getAttr<AlignedAttr>(*this)) NewEntry->SetAlignment(std::max(NewEntry->getAlignment(), AA->getAlignment())); @@ -783,10 +783,10 @@ const ASTRecordLayout &ASTContext::getASTRecordLayout(const RecordDecl *D) { bool IsUnion = D->isUnion(); unsigned StructPacking = 0; - if (const PackedAttr *PA = D->getAttr<PackedAttr>()) + if (const PackedAttr *PA = D->getAttr<PackedAttr>(*this)) StructPacking = PA->getAlignment(); - if (const AlignedAttr *AA = D->getAttr<AlignedAttr>()) + if (const AlignedAttr *AA = D->getAttr<AlignedAttr>(*this)) NewEntry->SetAlignment(std::max(NewEntry->getAlignment(), AA->getAlignment())); @@ -2782,7 +2782,7 @@ QualType ASTContext::getFromTargetType(unsigned Type) const { bool ASTContext::isObjCNSObjectType(QualType Ty) const { if (TypedefType *TDT = dyn_cast<TypedefType>(Ty)) { if (TypedefDecl *TD = TDT->getDecl()) - if (TD->getAttr<ObjCNSObjectAttr>()) + if (TD->getAttr<ObjCNSObjectAttr>(*const_cast<ASTContext*>(this))) return true; } return false; |