[cfe-commits] r83869 - in /cfe/trunk: include/clang/AST/DeclCXX.h lib/AST/DeclCXX.cpp

Fariborz Jahanian fjahanian at apple.com
Mon Oct 12 11:36:50 PDT 2009


Author: fjahanian
Date: Mon Oct 12 13:36:50 2009
New Revision: 83869

URL: http://llvm.org/viewvc/llvm-project?rev=83869&view=rev
Log:
Use CanQualType (instead of QualType) to store collection of visible
canonical conversion types.

Modified:
    cfe/trunk/include/clang/AST/DeclCXX.h
    cfe/trunk/lib/AST/DeclCXX.cpp

Modified: cfe/trunk/include/clang/AST/DeclCXX.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclCXX.h?rev=83869&r1=83868&r2=83869&view=diff

==============================================================================
--- cfe/trunk/include/clang/AST/DeclCXX.h (original)
+++ cfe/trunk/include/clang/AST/DeclCXX.h Mon Oct 12 13:36:50 2009
@@ -397,10 +397,10 @@
     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,

Modified: cfe/trunk/lib/AST/DeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclCXX.cpp?rev=83869&r1=83868&r2=83869&view=diff

==============================================================================
--- cfe/trunk/lib/AST/DeclCXX.cpp (original)
+++ cfe/trunk/lib/AST/DeclCXX.cpp Mon Oct 12 13:36:50 2009
@@ -287,14 +287,15 @@
 
 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 @@
 /// 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 @@
       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 @@
   if (getNumBases() == 0 && getNumVBases() == 0)
     return;
   
-  llvm::SmallPtrSet<QualType, 8> ConversionFunctions;
+  llvm::SmallPtrSet<CanQualType, 8> ConversionFunctions;
   if (!inTopClass)
     collectConversionFunctions(ConversionFunctions);
   
@@ -397,7 +399,7 @@
   // 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);





More information about the cfe-commits mailing list