diff options
author | John McCall <rjmccall@apple.com> | 2011-01-19 10:06:00 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2011-01-19 10:06:00 +0000 |
commit | 3b6575108a5b6d8b92ac3a9a7794bf6c3a210907 (patch) | |
tree | d558697cf5d178aebee53e7d2d924e474e8ced1c /lib/Sema/SemaOverload.cpp | |
parent | f4c7371fb1d3cebcfb40abad4537bb82515704ea (diff) |
Change the canonical representation of array types to store qualifiers on the
outermost array types and not on the element type. Move the CanonicalType
member from Type to ExtQualsTypeCommonBase; the canonical type on an ExtQuals
node includes the qualifiers on the ExtQuals. Assorted optimizations enabled
by this change.
getQualifiers(), hasQualifiers(), etc. should all now implicitly look through
array types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123817 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaOverload.cpp')
-rw-r--r-- | lib/Sema/SemaOverload.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp index 06a34c22c5..a1b09d91f2 100644 --- a/lib/Sema/SemaOverload.cpp +++ b/lib/Sema/SemaOverload.cpp @@ -4461,17 +4461,17 @@ BuiltinCandidateTypeSet::AddTypesConvertedFrom(QualType Ty, if (const ReferenceType *RefTy = Ty->getAs<ReferenceType>()) Ty = RefTy->getPointeeType(); - // We don't care about qualifiers on the type. + // If we're dealing with an array type, decay to the pointer. + if (Ty->isArrayType()) + Ty = SemaRef.Context.getArrayDecayedType(Ty); + + // Otherwise, we don't care about qualifiers on the type. Ty = Ty.getLocalUnqualifiedType(); // Flag if we ever add a non-record type. const RecordType *TyRec = Ty->getAs<RecordType>(); HasNonRecordTypes = HasNonRecordTypes || !TyRec; - // If we're dealing with an array type, decay to the pointer. - if (Ty->isArrayType()) - Ty = SemaRef.Context.getArrayDecayedType(Ty); - // Flag if we encounter an arithmetic type. HasArithmeticOrEnumeralTypes = HasArithmeticOrEnumeralTypes || Ty->isArithmeticType(); |