[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.

llvm-svn: 235831

clang/lib/AST/MicrosoftMangle.cpp

index 613f2c5..791573f 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,