r235831 - [MS ABI] Rephrase the mangling of array types in parameters

David Majnemer david.majnemer at gmail.com
Sun Apr 26 20:07:47 PDT 2015


Author: majnemer
Date: Sun Apr 26 22:07:47 2015
New Revision: 235831

URL: http://llvm.org/viewvc/llvm-project?rev=235831&view=rev
Log:
[MS ABI] Rephrase the mangling of array types in parameters

Make the canonicalization of array types more consistent.

Modified:
    cfe/trunk/lib/AST/MicrosoftMangle.cpp

Modified: cfe/trunk/lib/AST/MicrosoftMangle.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/MicrosoftMangle.cpp?rev=235831&r1=235830&r2=235831&view=diff
==============================================================================
--- cfe/trunk/lib/AST/MicrosoftMangle.cpp (original)
+++ cfe/trunk/lib/AST/MicrosoftMangle.cpp Sun Apr 26 22:07:47 2015
@@ -1379,13 +1379,12 @@ void MicrosoftCXXNameMangler::mangleArgu
   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,





More information about the cfe-commits mailing list