diff options
author | Chris Lattner <sabre@nondot.org> | 2008-06-28 23:36:30 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-06-28 23:36:30 +0000 |
commit | 545dd3401e7f31c256d69cb948a45d5ca781064c (patch) | |
tree | 4dd83c9a5643f680a09448e0344f6904e50671c2 /lib/Sema/SemaType.cpp | |
parent | 3a9fdb4742b21c0a3c27f18c5e4e94bab6f9e64c (diff) |
adjust the prototypes of a bunch of decl processing methods to take
the single attribute they look at by reference instead of by pointer.
This is a subtle indicator that they take the specified attribute, not
a whole list of them.
This also make HandleExtVectorTypeAttribute work the same way as the rest
of the attributes, adds some comments etc. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52871 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaType.cpp')
-rw-r--r-- | lib/Sema/SemaType.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp index 8fd72a0195..bf023394f3 100644 --- a/lib/Sema/SemaType.cpp +++ b/lib/Sema/SemaType.cpp @@ -524,7 +524,7 @@ void Sema::ProcessTypeAttributes(QualType &Result, const AttributeList *AL) { switch (AL->getKind()) { default: break; case AttributeList::AT_address_space: - Result = HandleAddressSpaceTypeAttribute(Result, AL); + Result = HandleAddressSpaceTypeAttribute(Result, *AL); continue; } } @@ -533,25 +533,25 @@ void Sema::ProcessTypeAttributes(QualType &Result, const AttributeList *AL) { /// HandleAddressSpaceTypeAttribute - Process an address_space attribute on the /// specified type. QualType Sema::HandleAddressSpaceTypeAttribute(QualType Type, - const AttributeList *Attr) { + const AttributeList &Attr) { // If this type is already address space qualified, reject it. // Clause 6.7.3 - Type qualifiers: "No type shall be qualified by qualifiers // for two or more different address spaces." if (Type.getAddressSpace()) { - Diag(Attr->getLoc(), diag::err_attribute_address_multiple_qualifiers); + Diag(Attr.getLoc(), diag::err_attribute_address_multiple_qualifiers); return Type; } // Check the attribute arguments. - if (Attr->getNumArgs() != 1) { - Diag(Attr->getLoc(), diag::err_attribute_wrong_number_arguments, + if (Attr.getNumArgs() != 1) { + Diag(Attr.getLoc(), diag::err_attribute_wrong_number_arguments, std::string("1")); return Type; } - Expr *ASArgExpr = static_cast<Expr *>(Attr->getArg(0)); + Expr *ASArgExpr = static_cast<Expr *>(Attr.getArg(0)); llvm::APSInt addrSpace(32); if (!ASArgExpr->isIntegerConstantExpr(addrSpace, Context)) { - Diag(Attr->getLoc(), diag::err_attribute_address_space_not_int, + Diag(Attr.getLoc(), diag::err_attribute_address_space_not_int, ASArgExpr->getSourceRange()); return Type; } |