]> granicus.if.org Git - clang/commitdiff
Use CanQualType (instead of QualType) to store collection of visible
authorFariborz Jahanian <fjahanian@apple.com>
Mon, 12 Oct 2009 18:36:50 +0000 (18:36 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Mon, 12 Oct 2009 18:36:50 +0000 (18:36 +0000)
canonical conversion types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83869 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/DeclCXX.h
lib/AST/DeclCXX.cpp

index 85c678acd227d7e81213f1fc264ba030a3db9b39..7c651b2cc06a84a97f24ce5b0876a4bfe509abb9 100644 (file)
@@ -397,10 +397,10 @@ class CXXRecordDecl : public RecordDecl {
     TemplateOrInstantiation;
   
   void getNestedVisibleConversionFunctions(CXXRecordDecl *RD,
-          const llvm::SmallPtrSet<QualType, 8> &TopConversionsTypeSet,
-          const llvm::SmallPtrSet<QualType, 8> &HiddenConversionTypes);
+          const llvm::SmallPtrSet<CanQualType, 8> &TopConversionsTypeSet,
+          const llvm::SmallPtrSet<CanQualType, 8> &HiddenConversionTypes);
   void collectConversionFunctions(
-    llvm::SmallPtrSet<QualType, 8>& ConversionsTypeSet);
+    llvm::SmallPtrSet<CanQualType, 8>& ConversionsTypeSet);
   
 protected:
   CXXRecordDecl(Kind K, TagKind TK, DeclContext *DC,
index fc5f5934b0e51b1916a6646ac978297d38a05e08..64e800094e09ba6b4cbb330f1c4689a3f1f13a80 100644 (file)
@@ -287,14 +287,15 @@ void CXXRecordDecl::addedAssignmentOperator(ASTContext &Context,
 
 void
 CXXRecordDecl::collectConversionFunctions(
-                        llvm::SmallPtrSet<QualType, 8>& ConversionsTypeSet) {
+                        llvm::SmallPtrSet<CanQualType, 8>& ConversionsTypeSet) 
+{
   OverloadedFunctionDecl *TopConversions = getConversionFunctions();
   for (OverloadedFunctionDecl::function_iterator
        TFunc = TopConversions->function_begin(),
        TFuncEnd = TopConversions->function_end();
        TFunc != TFuncEnd; ++TFunc) {
     NamedDecl *TopConv = TFunc->get();
-    QualType TConvType;
+    CanQualType TConvType;
     if (FunctionTemplateDecl *TConversionTemplate =
         dyn_cast<FunctionTemplateDecl>(TopConv))
       TConvType = 
@@ -317,8 +318,9 @@ CXXRecordDecl::collectConversionFunctions(
 /// in current class.
 void
 CXXRecordDecl::getNestedVisibleConversionFunctions(CXXRecordDecl *RD,
-                const llvm::SmallPtrSet<QualType, 8> &TopConversionsTypeSet,                               
-                const llvm::SmallPtrSet<QualType, 8> &HiddenConversionTypes) {
+                const llvm::SmallPtrSet<CanQualType, 8> &TopConversionsTypeSet,                               
+                const llvm::SmallPtrSet<CanQualType, 8> &HiddenConversionTypes) 
+{
   bool inTopClass = (RD == this);
   QualType ClassType = getASTContext().getTypeDeclType(this);
   if (const RecordType *Record = ClassType->getAs<RecordType>()) {
@@ -332,7 +334,7 @@ CXXRecordDecl::getNestedVisibleConversionFunctions(CXXRecordDecl *RD,
       NamedDecl *Conv = Func->get();
       // Only those conversions not exact match of conversions in current
       // class are candidateconversion routines.
-      QualType ConvType;
+      CanQualType ConvType;
       if (FunctionTemplateDecl *ConversionTemplate = 
             dyn_cast<FunctionTemplateDecl>(Conv))
         ConvType = 
@@ -360,7 +362,7 @@ CXXRecordDecl::getNestedVisibleConversionFunctions(CXXRecordDecl *RD,
   if (getNumBases() == 0 && getNumVBases() == 0)
     return;
   
-  llvm::SmallPtrSet<QualType, 8> ConversionFunctions;
+  llvm::SmallPtrSet<CanQualType, 8> ConversionFunctions;
   if (!inTopClass)
     collectConversionFunctions(ConversionFunctions);
   
@@ -397,7 +399,7 @@ CXXRecordDecl::getVisibleConversionFunctions() {
   // If visible conversion list is already evaluated, return it.
   if (ComputedVisibleConversions)
     return &VisibleConversions;
-  llvm::SmallPtrSet<QualType, 8> TopConversionsTypeSet;
+  llvm::SmallPtrSet<CanQualType, 8> TopConversionsTypeSet;
   collectConversionFunctions(TopConversionsTypeSet);
   getNestedVisibleConversionFunctions(this, TopConversionsTypeSet,
                                       TopConversionsTypeSet);