Canonicality is a property of qualified types, not unqualified types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84891 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp
index 7d9bc0f..292f2ac 100644
--- a/lib/AST/ASTContext.cpp
+++ b/lib/AST/ASTContext.cpp
@@ -1151,7 +1151,7 @@
   // If the pointee type isn't canonical, this won't be a canonical type either,
   // so fill in the canonical type field.
   QualType Canonical;
-  if (!T->isCanonical()) {
+  if (!T.isCanonical()) {
     Canonical = getComplexType(getCanonicalType(T));
 
     // Get the new insert position for the node we care about.
@@ -1188,7 +1188,7 @@
   // If the pointee type isn't canonical, this won't be a canonical type either,
   // so fill in the canonical type field.
   QualType Canonical;
-  if (!T->isCanonical()) {
+  if (!T.isCanonical()) {
     Canonical = getPointerType(getCanonicalType(T));
 
     // Get the new insert position for the node we care about.
@@ -1218,7 +1218,7 @@
   // If the block pointee type isn't canonical, this won't be a canonical
   // type either so fill in the canonical type field.
   QualType Canonical;
-  if (!T->isCanonical()) {
+  if (!T.isCanonical()) {
     Canonical = getBlockPointerType(getCanonicalType(T));
 
     // Get the new insert position for the node we care about.
@@ -1249,7 +1249,7 @@
   // If the referencee type isn't canonical, this won't be a canonical type
   // either, so fill in the canonical type field.
   QualType Canonical;
-  if (!T->isCanonical()) {
+  if (!T.isCanonical()) {
     Canonical = getLValueReferenceType(getCanonicalType(T));
 
     // Get the new insert position for the node we care about.
@@ -1281,7 +1281,7 @@
   // If the referencee type isn't canonical, this won't be a canonical type
   // either, so fill in the canonical type field.
   QualType Canonical;
-  if (!T->isCanonical()) {
+  if (!T.isCanonical()) {
     Canonical = getRValueReferenceType(getCanonicalType(T));
 
     // Get the new insert position for the node we care about.
@@ -1313,7 +1313,7 @@
   // If the pointee or class type isn't canonical, this won't be a canonical
   // type either, so fill in the canonical type field.
   QualType Canonical;
-  if (!T->isCanonical()) {
+  if (!T.isCanonical()) {
     Canonical = getMemberPointerType(getCanonicalType(T),getCanonicalType(Cls));
 
     // Get the new insert position for the node we care about.
@@ -1353,7 +1353,7 @@
   // If the element type isn't canonical, this won't be a canonical type either,
   // so fill in the canonical type field.
   QualType Canonical;
-  if (!EltTy->isCanonical()) {
+  if (!EltTy.isCanonical()) {
     Canonical = getConstantArrayType(getCanonicalType(EltTy), ArySize,
                                      ASM, EltTypeQuals);
     // Get the new insert position for the node we care about.
@@ -1448,7 +1448,7 @@
   // either, so fill in the canonical type field.
   QualType Canonical;
 
-  if (!EltTy->isCanonical()) {
+  if (!EltTy.isCanonical()) {
     Canonical = getIncompleteArrayType(getCanonicalType(EltTy),
                                        ASM, EltTypeQuals);
 
@@ -1484,7 +1484,7 @@
   // If the element type isn't canonical, this won't be a canonical type either,
   // so fill in the canonical type field.
   QualType Canonical;
-  if (!vecType->isCanonical()) {
+  if (!vecType.isCanonical()) {
     Canonical = getVectorType(getCanonicalType(vecType), NumElts);
 
     // Get the new insert position for the node we care about.
@@ -1516,7 +1516,7 @@
   // If the element type isn't canonical, this won't be a canonical type either,
   // so fill in the canonical type field.
   QualType Canonical;
-  if (!vecType->isCanonical()) {
+  if (!vecType.isCanonical()) {
     Canonical = getExtVectorType(getCanonicalType(vecType), NumElts);
 
     // Get the new insert position for the node we care about.
@@ -1580,7 +1580,7 @@
     return QualType(FT, 0);
 
   QualType Canonical;
-  if (!ResultTy->isCanonical()) {
+  if (!ResultTy.isCanonical()) {
     Canonical = getFunctionNoProtoType(getCanonicalType(ResultTy), NoReturn);
 
     // Get the new insert position for the node we care about.
@@ -1622,11 +1622,11 @@
     return QualType(FTP, 0);
 
   // Determine whether the type being created is already canonical or not.
-  bool isCanonical = ResultTy->isCanonical();
+  bool isCanonical = ResultTy.isCanonical();
   if (hasExceptionSpec)
     isCanonical = false;
   for (unsigned i = 0; i != NumArgs && isCanonical; ++i)
-    if (!ArgArray[i]->isCanonical())
+    if (!ArgArray[i].isCanonical())
       isCanonical = false;
 
   // If this type isn't canonical, get the canonical version of it.
@@ -1711,7 +1711,7 @@
 QualType
 ASTContext::getSubstTemplateTypeParmType(const TemplateTypeParmType *Parm,
                                          QualType Replacement) {
-  assert(Replacement->isCanonical()
+  assert(Replacement.isCanonical()
          && "replacement types must always be canonical");
 
   llvm::FoldingSetNodeID ID;
@@ -2499,7 +2499,7 @@
 /// routine will assert if passed a built-in type that isn't an integer or enum,
 /// or if it is not canonicalized.
 unsigned ASTContext::getIntegerRank(Type *T) {
-  assert(T->isCanonical() && "T should be canonicalized");
+  assert(T->isCanonicalUnqualified() && "T should be canonicalized");
   if (EnumType* ET = dyn_cast<EnumType>(T))
     T = ET->getDecl()->getIntegerType().getTypePtr();
 
@@ -3628,7 +3628,7 @@
 /// compatible.
 static bool areCompatVectorTypes(const VectorType *LHS,
                                  const VectorType *RHS) {
-  assert(LHS->isCanonical() && RHS->isCanonical());
+  assert(LHS->isCanonicalUnqualified() && RHS->isCanonicalUnqualified());
   return LHS->getElementType() == RHS->getElementType() &&
          LHS->getNumElements() == RHS->getNumElements();
 }