From 8e9cfe287c29039331e4b1a656a56a64f7527a62 Mon Sep 17 00:00:00 2001 From: David Majnemer Date: Mon, 27 Apr 2015 03:07:47 +0000 Subject: [PATCH] [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 --- lib/AST/MicrosoftMangle.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) 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, -- 2.50.1