From: David Majnemer Date: Mon, 27 Apr 2015 03:07:47 +0000 (+0000) Subject: [MS ABI] Rephrase the mangling of array types in parameters X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8e9cfe287c29039331e4b1a656a56a64f7527a62;p=clang [MS ABI] Rephrase the mangling of array types in parameters Make the canonicalization of array types more consistent. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@235831 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/MicrosoftMangle.cpp b/lib/AST/MicrosoftMangle.cpp index 613f2c51c2..791573feef 100644 --- a/lib/AST/MicrosoftMangle.cpp +++ b/lib/AST/MicrosoftMangle.cpp @@ -1379,13 +1379,12 @@ void MicrosoftCXXNameMangler::mangleArgumentType(QualType T, void *TypePtr; if (const auto *DT = T->getAs()) { QualType OriginalType = DT->getOriginalType(); - // Decayed ConstantArrayType should be treated identically to decayed - // IncompleteArrayType. - if (const auto *CAT = - getASTContext().getAsConstantArrayType(OriginalType)) + // All decayed ArrayTypes should be treated identically; as-if they were + // a decayed IncompleteArrayType. + if (const auto *AT = getASTContext().getAsArrayType(OriginalType)) OriginalType = getASTContext().getIncompleteArrayType( - CAT->getElementType(), CAT->getSizeModifier(), - CAT->getIndexTypeCVRQualifiers()); + AT->getElementType(), AT->getSizeModifier(), + AT->getIndexTypeCVRQualifiers()); TypePtr = OriginalType.getCanonicalType().getAsOpaquePtr(); // If the original parameter was textually written as an array,