]> granicus.if.org Git - clang/commitdiff
[MS ABI] Rephrase the mangling of array types in parameters
authorDavid Majnemer <david.majnemer@gmail.com>
Mon, 27 Apr 2015 03:07:47 +0000 (03:07 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Mon, 27 Apr 2015 03:07:47 +0000 (03:07 +0000)
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

index 613f2c51c2b79c45ea551ff853a4cdf7bcb2b568..791573feef6c2c022eb6ccf3273be209fc638bbd 100644 (file)
@@ -1379,13 +1379,12 @@ void MicrosoftCXXNameMangler::mangleArgumentType(QualType T,
   void *TypePtr;
   if (const auto *DT = T->getAs<DecayedType>()) {
     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,