[cfe-commits] r65671 - in /cfe/trunk: Driver/ASTConsumers.cpp include/clang/AST/Type.h include/clang/AST/TypeNodes.def lib/AST/ASTContext.cpp lib/AST/Type.cpp lib/AST/TypeSerialization.cpp lib/CodeGen/CGDebugInfo.cpp lib/CodeGen/CodeGenTypes.cpp lib/Sema/SemaExprCXX.cpp lib/Sema/SemaInherit.cpp lib/Sema/SemaInherit.h lib/Sema/SemaInit.cpp lib/Sema/SemaLookup.cpp lib/Sema/SemaNamedCast.cpp lib/Sema/SemaOverload.cpp lib/Sema/SemaTemplateInstantiate.cpp

Douglas Gregor dgregor at apple.com
Fri Feb 27 17:32:26 PST 2009


Author: dgregor
Date: Fri Feb 27 19:32:25 2009
New Revision: 65671

URL: http://llvm.org/viewvc/llvm-project?rev=65671&view=rev
Log:
Eliminate CXXRecordType

Modified:
    cfe/trunk/Driver/ASTConsumers.cpp
    cfe/trunk/include/clang/AST/Type.h
    cfe/trunk/include/clang/AST/TypeNodes.def
    cfe/trunk/lib/AST/ASTContext.cpp
    cfe/trunk/lib/AST/Type.cpp
    cfe/trunk/lib/AST/TypeSerialization.cpp
    cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
    cfe/trunk/lib/CodeGen/CodeGenTypes.cpp
    cfe/trunk/lib/Sema/SemaExprCXX.cpp
    cfe/trunk/lib/Sema/SemaInherit.cpp
    cfe/trunk/lib/Sema/SemaInherit.h
    cfe/trunk/lib/Sema/SemaInit.cpp
    cfe/trunk/lib/Sema/SemaLookup.cpp
    cfe/trunk/lib/Sema/SemaNamedCast.cpp
    cfe/trunk/lib/Sema/SemaOverload.cpp
    cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp

Modified: cfe/trunk/Driver/ASTConsumers.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/ASTConsumers.cpp?rev=65671&r1=65670&r2=65671&view=diff

==============================================================================
--- cfe/trunk/Driver/ASTConsumers.cpp (original)
+++ cfe/trunk/Driver/ASTConsumers.cpp Fri Feb 27 19:32:25 2009
@@ -944,12 +944,13 @@
   void HandleTranslationUnit(TranslationUnit& TU) {
     ASTContext& C = TU.getContext();
     for (ASTContext::type_iterator I=C.types_begin(),E=C.types_end(); I!=E; ++I)
-      if (CXXRecordType *T = dyn_cast<CXXRecordType>(*I)) {
-        CXXRecordDecl* D = T->getDecl();
-        // FIXME: This lookup needs to be generalized to handle namespaces and
-        // (when we support them) templates.
-        if (D->getNameAsString() == clsname) {
-          D->viewInheritance(C);      
+      if (RecordType *T = dyn_cast<RecordType>(*I)) {
+        if (CXXRecordDecl *D = dyn_cast<CXXRecordDecl>(T->getDecl())) {
+          // FIXME: This lookup needs to be generalized to handle namespaces and
+          // (when we support them) templates.
+          if (D->getNameAsString() == clsname) {
+            D->viewInheritance(C);      
+          }
         }
       }
   }

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

==============================================================================
--- cfe/trunk/include/clang/AST/Type.h (original)
+++ cfe/trunk/include/clang/AST/Type.h Fri Feb 27 19:32:25 2009
@@ -1308,7 +1308,6 @@
   }
   static bool classof(const TagType *) { return true; }
   static bool classof(const RecordType *) { return true; }
-  static bool classof(const CXXRecordType *) { return true; } 
   static bool classof(const EnumType *) { return true; }
  
 protected:  
@@ -1348,25 +1347,6 @@
   static bool classof(const RecordType *) { return true; }
 };
 
-/// CXXRecordType - This is a helper class that allows the use of
-/// isa/cast/dyncast to detect TagType objects of C++ structs/unions/classes.
-class CXXRecordType : public RecordType {
-  explicit CXXRecordType(CXXRecordDecl *D)
-    : RecordType(CXXRecord, reinterpret_cast<RecordDecl*>(D)) { }
-  friend class ASTContext;   // ASTContext creates these.
-public:
-
-  CXXRecordDecl *getDecl() const {
-    return reinterpret_cast<CXXRecordDecl*>(RecordType::getDecl());
-  }
-
-  static bool classof(const TagType *T);
-  static bool classof(const Type *T) {
-    return isa<TagType>(T) && classof(cast<TagType>(T));
-  }
-  static bool classof(const CXXRecordType *) { return true; }
-};
-
 /// EnumType - This is a helper class that allows the use of isa/cast/dyncast
 /// to detect TagType objects of enums.
 class EnumType : public TagType {

Modified: cfe/trunk/include/clang/AST/TypeNodes.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/TypeNodes.def?rev=65671&r1=65670&r2=65671&view=diff

==============================================================================
--- cfe/trunk/include/clang/AST/TypeNodes.def (original)
+++ cfe/trunk/include/clang/AST/TypeNodes.def Fri Feb 27 19:32:25 2009
@@ -68,7 +68,6 @@
 NON_CANONICAL_TYPE(TypeOf, Type)
 ABSTRACT_TYPE(Tag, Type)
 TYPE(Record, TagType)
-TYPE(CXXRecord, RecordType) // FIXME: kill this one
 TYPE(Enum, TagType)
 DEPENDENT_TYPE(TemplateTypeParm, Type)
 NON_CANONICAL_TYPE(ClassTemplateSpecialization, Type)

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

==============================================================================
--- cfe/trunk/lib/AST/ASTContext.cpp (original)
+++ cfe/trunk/lib/AST/ASTContext.cpp Fri Feb 27 19:32:25 2009
@@ -448,7 +448,6 @@
     break;
   }
   case Type::Record:
-  case Type::CXXRecord:
   case Type::Enum: {
     const TagType *TT = cast<TagType>(T);
 
@@ -1231,13 +1230,7 @@
   } else if (ObjCInterfaceDecl *ObjCInterface = dyn_cast<ObjCInterfaceDecl>(Decl))
     return getObjCInterfaceType(ObjCInterface);
 
-  if (CXXRecordDecl *CXXRecord = dyn_cast<CXXRecordDecl>(Decl)) {
-    if (PrevDecl)
-      Decl->TypeForDecl = PrevDecl->TypeForDecl;
-    else
-      Decl->TypeForDecl = new (*this,8) CXXRecordType(CXXRecord);
-  }
-  else if (RecordDecl *Record = dyn_cast<RecordDecl>(Decl)) {
+  if (RecordDecl *Record = dyn_cast<RecordDecl>(Decl)) {
     if (PrevDecl)
       Decl->TypeForDecl = PrevDecl->TypeForDecl;
     else
@@ -2841,7 +2834,6 @@
   case Type::FunctionNoProto:
     return mergeFunctionTypes(LHS, RHS);
   case Type::Record:
-  case Type::CXXRecord:
   case Type::Enum:
     // FIXME: Why are these compatible?
     if (isObjCIdStructType(LHS) && isObjCClassStructType(RHS)) return LHS;

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

==============================================================================
--- cfe/trunk/lib/AST/Type.cpp (original)
+++ cfe/trunk/lib/AST/Type.cpp Fri Feb 27 19:32:25 2009
@@ -119,7 +119,6 @@
   case FunctionNoProto:
   case Reference:
   case Record:
-  case CXXRecord:
     return true;
   default:
     return false;
@@ -709,10 +708,13 @@
 /// subsumes the notion of C aggregates (C99 6.2.5p21) because it also
 /// includes union types.
 bool Type::isAggregateType() const {
-  if (const CXXRecordType *CXXClassType = dyn_cast<CXXRecordType>(CanonicalType))
-    return CXXClassType->getDecl()->isAggregate();
-  if (isa<RecordType>(CanonicalType))
+  if (const RecordType *Record = dyn_cast<RecordType>(CanonicalType)) {
+    if (CXXRecordDecl *ClassDecl = dyn_cast<CXXRecordDecl>(Record->getDecl()))
+      return ClassDecl->isAggregate();
+
     return true;
+  }
+
   if (const ExtQualType *EXTQT = dyn_cast<ExtQualType>(CanonicalType))
     return EXTQT->getBaseType()->isAggregateType();
   return isa<ArrayType>(CanonicalType);
@@ -743,7 +745,6 @@
     // be completed.
     return isVoidType();
   case Record:
-  case CXXRecord:
   case Enum:
     // A tagged type (struct/union/enum/class) is incomplete if the decl is a
     // forward declaration, but not a full definition (C99 6.2.5p22).
@@ -784,11 +785,12 @@
     return true;
 
   case Record:
+    if (CXXRecordDecl *ClassDecl 
+          = dyn_cast<CXXRecordDecl>(cast<RecordType>(CanonicalType)->getDecl()))
+      return ClassDecl->isPOD();
+
     // C struct/union is POD.
     return true;
-
-  case CXXRecord:
-    return cast<CXXRecordType>(CanonicalType)->getDecl()->isPOD();
   }
 }
 
@@ -915,10 +917,6 @@
   return isa<RecordDecl>(TT->getDecl());
 }
 
-bool CXXRecordType::classof(const TagType *TT) {
-  return isa<CXXRecordDecl>(TT->getDecl());
-}
-
 bool EnumType::classof(const TagType *TT) {
   return isa<EnumDecl>(TT->getDecl());
 }

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

==============================================================================
--- cfe/trunk/lib/AST/TypeSerialization.cpp (original)
+++ cfe/trunk/lib/AST/TypeSerialization.cpp Fri Feb 27 19:32:25 2009
@@ -112,7 +112,6 @@
       break;
 
     case Type::Record:
-    case Type::CXXRecord:
     case Type::Enum:
       // FIXME: Implement this!
       assert(false && "Can't deserialize tag types!");

Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=65671&r1=65670&r2=65671&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Fri Feb 27 19:32:25 2009
@@ -508,7 +508,6 @@
   case Type::Pointer: Slot = CreateType(cast<PointerType>(Ty), Unit); break;
   case Type::Typedef: Slot = CreateType(cast<TypedefType>(Ty), Unit); break;
   case Type::Record:
-  case Type::CXXRecord:
   case Type::Enum:
     Slot = CreateType(cast<TagType>(Ty), Unit); 
     break;

Modified: cfe/trunk/lib/CodeGen/CodeGenTypes.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenTypes.cpp?rev=65671&r1=65670&r2=65671&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenTypes.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenTypes.cpp Fri Feb 27 19:32:25 2009
@@ -302,7 +302,6 @@
     return ConvertTypeRecursive(Context.getObjCIdType());
 
   case Type::Record:
-  case Type::CXXRecord:
   case Type::Enum: {
     const TagDecl *TD = cast<TagType>(Ty).getDecl();
     const llvm::Type *Res = ConvertTagDeclType(TD);

Modified: cfe/trunk/lib/Sema/SemaExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprCXX.cpp?rev=65671&r1=65670&r2=65671&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaExprCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExprCXX.cpp Fri Feb 27 19:32:25 2009
@@ -402,8 +402,8 @@
   DeclarationName NewName = Context.DeclarationNames.getCXXOperatorName(
                                         IsArray ? OO_Array_New : OO_New);
   if (AllocType->isRecordType() && !UseGlobal) {
-    CXXRecordDecl *Record = cast<CXXRecordType>(AllocType->getAsRecordType())
-                                ->getDecl();
+    CXXRecordDecl *Record 
+      = cast<CXXRecordDecl>(AllocType->getAsRecordType()->getDecl());
     // FIXME: We fail to find inherited overloads.
     if (FindAllocationOverload(StartLoc, Range, NewName, &AllocArgs[0],
                           AllocArgs.size(), Record, /*AllowMissing=*/true,

Modified: cfe/trunk/lib/Sema/SemaInherit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaInherit.cpp?rev=65671&r1=65670&r2=65671&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaInherit.cpp (original)
+++ cfe/trunk/lib/Sema/SemaInherit.cpp Fri Feb 27 19:32:25 2009
@@ -87,7 +87,7 @@
     return false;
 
   Paths.setOrigin(Derived);
-  return LookupInBases(cast<CXXRecordType>(Derived->getAsRecordType())->getDecl(),
+  return LookupInBases(cast<CXXRecordDecl>(Derived->getAsRecordType()->getDecl()),
                        MemberLookupCriteria(Base), Paths);
 }
 
@@ -123,7 +123,7 @@
       if (Paths.isDetectingVirtual() && Paths.DetectedVirtual == 0) {
         // If this is the first virtual we find, remember it. If it turns out
         // there is no base path here, we'll reset it later.
-        Paths.DetectedVirtual = cast<CXXRecordType>(BaseType->getAsRecordType());
+        Paths.DetectedVirtual = BaseType->getAsRecordType();
         SetVirtual = true;
       }
     } else

Modified: cfe/trunk/lib/Sema/SemaInherit.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaInherit.h?rev=65671&r1=65670&r2=65671&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaInherit.h (original)
+++ cfe/trunk/lib/Sema/SemaInherit.h Fri Feb 27 19:32:25 2009
@@ -27,7 +27,6 @@
 
 namespace clang {
   class CXXBaseSpecifier;
-  class CXXRecordType;
 
   /// BasePathElement - An element in a path from a derived class to a
   /// base class. Each step in the path references the link from a
@@ -128,7 +127,7 @@
     BasePath ScratchPath;
 
     /// DetectedVirtual - The base class that is virtual.
-    const CXXRecordType *DetectedVirtual;
+    const RecordType *DetectedVirtual;
 
     friend class Sema;
 
@@ -167,7 +166,7 @@
     bool isDetectingVirtual() const { return DetectVirtual; }
 
     /// getDetectedVirtual - The virtual base discovered on the path.
-    const CXXRecordType* getDetectedVirtual() const {
+    const RecordType* getDetectedVirtual() const {
       return DetectedVirtual;
     }
 

Modified: cfe/trunk/lib/Sema/SemaInit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaInit.cpp?rev=65671&r1=65670&r2=65671&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaInit.cpp (original)
+++ cfe/trunk/lib/Sema/SemaInit.cpp Fri Feb 27 19:32:25 2009
@@ -1612,12 +1612,12 @@
     return CheckValueInitialization(AT->getElementType(), Loc);
 
   if (const RecordType *RT = Type->getAsRecordType()) {
-    if (const CXXRecordType *CXXRec = dyn_cast<CXXRecordType>(RT)) {
+    if (CXXRecordDecl *ClassDecl = dyn_cast<CXXRecordDecl>(RT->getDecl())) {
       // -- if T is a class type (clause 9) with a user-declared
       //    constructor (12.1), then the default constructor for T is
       //    called (and the initialization is ill-formed if T has no
       //    accessible default constructor);
-      if (CXXRec->getDecl()->hasUserDeclaredConstructor())
+      if (ClassDecl->hasUserDeclaredConstructor())
         // FIXME: Eventually, we'll need to put the constructor decl
         // into the AST.
         return PerformInitializationByConstructor(Type, 0, 0, Loc,

Modified: cfe/trunk/lib/Sema/SemaLookup.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaLookup.cpp?rev=65671&r1=65670&r2=65671&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaLookup.cpp (original)
+++ cfe/trunk/lib/Sema/SemaLookup.cpp Fri Feb 27 19:32:25 2009
@@ -1232,13 +1232,14 @@
   //        member, if any; and its direct and indirect base
   //        classes. Its associated namespaces are the namespaces in
   //        which its associated classes are defined. 
-  if (const CXXRecordType *ClassType 
-        = dyn_cast_or_null<CXXRecordType>(T->getAsRecordType())) {
-    addAssociatedClassesAndNamespaces(ClassType->getDecl(), 
-                                      Context, AssociatedNamespaces, 
-                                      AssociatedClasses);
-    return;
-  }
+  if (const RecordType *ClassType = T->getAsRecordType())
+    if (CXXRecordDecl *ClassDecl 
+        = dyn_cast<CXXRecordDecl>(ClassType->getDecl())) {
+      addAssociatedClassesAndNamespaces(ClassDecl, Context, 
+                                        AssociatedNamespaces, 
+                                        AssociatedClasses);
+      return;
+    }
 
   //     -- If T is an enumeration type, its associated namespace is
   //        the namespace in which it is defined. If it is class

Modified: cfe/trunk/lib/Sema/SemaNamedCast.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaNamedCast.cpp?rev=65671&r1=65670&r2=65671&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaNamedCast.cpp (original)
+++ cfe/trunk/lib/Sema/SemaNamedCast.cpp Fri Feb 27 19:32:25 2009
@@ -706,7 +706,7 @@
     return TSC_Failed;
   }
 
-  if (const CXXRecordType *VBase = Paths.getDetectedVirtual()) {
+  if (const RecordType *VBase = Paths.getDetectedVirtual()) {
     Self.Diag(OpRange.getBegin(), diag::err_memptr_conv_via_virtual)
       << SrcClass << DestClass << QualType(VBase, 0) << OpRange;
     return TSC_Failed;

Modified: cfe/trunk/lib/Sema/SemaOverload.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaOverload.cpp?rev=65671&r1=65670&r2=65671&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaOverload.cpp (original)
+++ cfe/trunk/lib/Sema/SemaOverload.cpp Fri Feb 27 19:32:25 2009
@@ -1233,7 +1233,7 @@
     return true;
   }
 
-  if (const CXXRecordType *VBase = Paths.getDetectedVirtual()) {
+  if (const RecordType *VBase = Paths.getDetectedVirtual()) {
     Diag(From->getExprLoc(), diag::err_memptr_conv_via_virtual)
       << FromClass << ToClass << QualType(VBase, 0)
       << From->getSourceRange();
@@ -1317,46 +1317,48 @@
                                    bool AllowExplicit)
 {
   OverloadCandidateSet CandidateSet;
-  if (const CXXRecordType *ToRecordType 
-        = dyn_cast_or_null<CXXRecordType>(ToType->getAsRecordType())) {
-    // C++ [over.match.ctor]p1:
-    //   When objects of class type are direct-initialized (8.5), or
-    //   copy-initialized from an expression of the same or a
-    //   derived class type (8.5), overload resolution selects the
-    //   constructor. [...] For copy-initialization, the candidate
-    //   functions are all the converting constructors (12.3.1) of
-    //   that class. The argument list is the expression-list within
-    //   the parentheses of the initializer.
-    CXXRecordDecl *ToRecordDecl = ToRecordType->getDecl();
-    DeclarationName ConstructorName 
-      = Context.DeclarationNames.getCXXConstructorName(
-                        Context.getCanonicalType(ToType).getUnqualifiedType());
-    DeclContext::lookup_iterator Con, ConEnd;
-    for (llvm::tie(Con, ConEnd) = ToRecordDecl->lookup(ConstructorName);
-         Con != ConEnd; ++Con) {
-      CXXConstructorDecl *Constructor = cast<CXXConstructorDecl>(*Con);
-      if (Constructor->isConvertingConstructor())
-        AddOverloadCandidate(Constructor, &From, 1, CandidateSet,
-                             /*SuppressUserConversions=*/true);
+  if (const RecordType *ToRecordType = ToType->getAsRecordType()) {
+    if (CXXRecordDecl *ToRecordDecl 
+          = dyn_cast<CXXRecordDecl>(ToRecordType->getDecl())) {
+      // C++ [over.match.ctor]p1:
+      //   When objects of class type are direct-initialized (8.5), or
+      //   copy-initialized from an expression of the same or a
+      //   derived class type (8.5), overload resolution selects the
+      //   constructor. [...] For copy-initialization, the candidate
+      //   functions are all the converting constructors (12.3.1) of
+      //   that class. The argument list is the expression-list within
+      //   the parentheses of the initializer.
+      DeclarationName ConstructorName 
+        = Context.DeclarationNames.getCXXConstructorName(
+                          Context.getCanonicalType(ToType).getUnqualifiedType());
+      DeclContext::lookup_iterator Con, ConEnd;
+      for (llvm::tie(Con, ConEnd) = ToRecordDecl->lookup(ConstructorName);
+           Con != ConEnd; ++Con) {
+        CXXConstructorDecl *Constructor = cast<CXXConstructorDecl>(*Con);
+        if (Constructor->isConvertingConstructor())
+          AddOverloadCandidate(Constructor, &From, 1, CandidateSet,
+                               /*SuppressUserConversions=*/true);
+      }
     }
   }
 
   if (!AllowConversionFunctions) {
     // Don't allow any conversion functions to enter the overload set.
-  } else if (const CXXRecordType *FromRecordType
-               = dyn_cast_or_null<CXXRecordType>(
-                                        From->getType()->getAsRecordType())) {
-    // Add all of the conversion functions as candidates.
-    // FIXME: Look for conversions in base classes!
-    CXXRecordDecl *FromRecordDecl = FromRecordType->getDecl();
-    OverloadedFunctionDecl *Conversions 
-      = FromRecordDecl->getConversionFunctions();
-    for (OverloadedFunctionDecl::function_iterator Func 
-           = Conversions->function_begin();
-         Func != Conversions->function_end(); ++Func) {
-      CXXConversionDecl *Conv = cast<CXXConversionDecl>(*Func);
-      if (AllowExplicit || !Conv->isExplicit())
-        AddConversionCandidate(Conv, From, ToType, CandidateSet);
+  } else if (const RecordType *FromRecordType 
+               = From->getType()->getAsRecordType()) {
+    if (CXXRecordDecl *FromRecordDecl 
+          = dyn_cast<CXXRecordDecl>(FromRecordType->getDecl())) {
+      // Add all of the conversion functions as candidates.
+      // FIXME: Look for conversions in base classes!
+      OverloadedFunctionDecl *Conversions 
+        = FromRecordDecl->getConversionFunctions();
+      for (OverloadedFunctionDecl::function_iterator Func 
+             = Conversions->function_begin();
+           Func != Conversions->function_end(); ++Func) {
+        CXXConversionDecl *Conv = cast<CXXConversionDecl>(*Func);
+        if (AllowExplicit || !Conv->isExplicit())
+          AddConversionCandidate(Conv, From, ToType, CandidateSet);
+      }
     }
   }
 

Modified: cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp?rev=65671&r1=65670&r2=65671&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp (original)
+++ cfe/trunk/lib/Sema/SemaTemplateInstantiate.cpp Fri Feb 27 19:32:25 2009
@@ -255,14 +255,6 @@
 }
 
 QualType 
-TemplateTypeInstantiator::InstantiateCXXRecordType(const CXXRecordType *T,
-                                                   unsigned Quals) const {
-  // FIXME: Implement this
-  assert(false && "Cannot instantiate CXXRecordType yet");
-  return QualType();
-}
-
-QualType 
 TemplateTypeInstantiator::InstantiateEnumType(const EnumType *T,
                                               unsigned Quals) const {
   // FIXME: Implement this





More information about the cfe-commits mailing list