[cfe-commits] r100019 - in /cfe/trunk: include/clang/AST/ASTContext.h include/clang/AST/Type.h include/clang/AST/TypeLoc.h include/clang/AST/TypeNodes.def include/clang/Frontend/TypeXML.def lib/AST/ASTContext.cpp lib/AST/ASTImporter.cpp lib/AST/Type.cpp lib/AST/TypePrinter.cpp lib/CodeGen/Mangle.cpp lib/Frontend/PCHReader.cpp lib/Frontend/PCHWriter.cpp lib/Sema/SemaDecl.cpp lib/Sema/SemaTemplate.cpp lib/Sema/SemaTemplateDeduction.cpp lib/Sema/SemaType.cpp lib/Sema/TreeTransform.h

Douglas Gregor dgregor at apple.com
Wed Mar 31 10:34:00 PDT 2010


Author: dgregor
Date: Wed Mar 31 12:34:00 2010
New Revision: 100019

URL: http://llvm.org/viewvc/llvm-project?rev=100019&view=rev
Log:
Rename TypenameType to DependentNameType in anticipation of some
refactoring work in this area.

Modified:
    cfe/trunk/include/clang/AST/ASTContext.h
    cfe/trunk/include/clang/AST/Type.h
    cfe/trunk/include/clang/AST/TypeLoc.h
    cfe/trunk/include/clang/AST/TypeNodes.def
    cfe/trunk/include/clang/Frontend/TypeXML.def
    cfe/trunk/lib/AST/ASTContext.cpp
    cfe/trunk/lib/AST/ASTImporter.cpp
    cfe/trunk/lib/AST/Type.cpp
    cfe/trunk/lib/AST/TypePrinter.cpp
    cfe/trunk/lib/CodeGen/Mangle.cpp
    cfe/trunk/lib/Frontend/PCHReader.cpp
    cfe/trunk/lib/Frontend/PCHWriter.cpp
    cfe/trunk/lib/Sema/SemaDecl.cpp
    cfe/trunk/lib/Sema/SemaTemplate.cpp
    cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp
    cfe/trunk/lib/Sema/SemaType.cpp
    cfe/trunk/lib/Sema/TreeTransform.h

Modified: cfe/trunk/include/clang/AST/ASTContext.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ASTContext.h?rev=100019&r1=100018&r2=100019&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/ASTContext.h (original)
+++ cfe/trunk/include/clang/AST/ASTContext.h Wed Mar 31 12:34:00 2010
@@ -117,7 +117,7 @@
   llvm::FoldingSet<SubstTemplateTypeParmType> SubstTemplateTypeParmTypes;
   llvm::FoldingSet<TemplateSpecializationType> TemplateSpecializationTypes;
   llvm::FoldingSet<QualifiedNameType> QualifiedNameTypes;
-  llvm::FoldingSet<TypenameType> TypenameTypes;
+  llvm::FoldingSet<DependentNameType> DependentNameTypes;
   llvm::FoldingSet<ObjCInterfaceType> ObjCInterfaceTypes;
   llvm::FoldingSet<ObjCObjectPointerType> ObjCObjectPointerTypes;
   llvm::FoldingSet<ElaboratedType> ElaboratedTypes;
@@ -630,10 +630,10 @@
 
   QualType getQualifiedNameType(NestedNameSpecifier *NNS,
                                 QualType NamedType);
-  QualType getTypenameType(NestedNameSpecifier *NNS,
+  QualType getDependentNameType(NestedNameSpecifier *NNS,
                            const IdentifierInfo *Name,
                            QualType Canon = QualType());
-  QualType getTypenameType(NestedNameSpecifier *NNS,
+  QualType getDependentNameType(NestedNameSpecifier *NNS,
                            const TemplateSpecializationType *TemplateId,
                            QualType Canon = QualType());
   QualType getElaboratedType(QualType UnderlyingType,

Modified: cfe/trunk/include/clang/AST/Type.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Type.h?rev=100019&r1=100018&r2=100019&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Type.h (original)
+++ cfe/trunk/include/clang/AST/Type.h Wed Mar 31 12:34:00 2010
@@ -2604,16 +2604,16 @@
 /// \brief Represents a 'typename' specifier that names a type within
 /// a dependent type, e.g., "typename T::type".
 ///
-/// TypenameType has a very similar structure to QualifiedNameType,
+/// DependentNameType has a very similar structure to QualifiedNameType,
 /// which also involves a nested-name-specifier following by a type,
 /// and (FIXME!) both can even be prefixed by the 'typename'
 /// keyword. However, the two types serve very different roles:
 /// QualifiedNameType is a non-semantic type that serves only as sugar
 /// to show how a particular type was written in the source
-/// code. TypenameType, on the other hand, only occurs when the
+/// code. DependentNameType, on the other hand, only occurs when the
 /// nested-name-specifier is dependent, such that we cannot resolve
 /// the actual type until after instantiation.
-class TypenameType : public Type, public llvm::FoldingSetNode {
+class DependentNameType : public Type, public llvm::FoldingSetNode {
   /// \brief The nested name specifier containing the qualifier.
   NestedNameSpecifier *NNS;
 
@@ -2623,18 +2623,18 @@
   /// \brief The type that this typename specifier refers to.
   NameType Name;
 
-  TypenameType(NestedNameSpecifier *NNS, const IdentifierInfo *Name,
+  DependentNameType(NestedNameSpecifier *NNS, const IdentifierInfo *Name,
                QualType CanonType)
-    : Type(Typename, CanonType, true), NNS(NNS), Name(Name) {
+    : Type(DependentName, CanonType, true), NNS(NNS), Name(Name) {
     assert(NNS->isDependent() &&
-           "TypenameType requires a dependent nested-name-specifier");
+           "DependentNameType requires a dependent nested-name-specifier");
   }
 
-  TypenameType(NestedNameSpecifier *NNS, const TemplateSpecializationType *Ty,
+  DependentNameType(NestedNameSpecifier *NNS, const TemplateSpecializationType *Ty,
                QualType CanonType)
-    : Type(Typename, CanonType, true), NNS(NNS), Name(Ty) {
+    : Type(DependentName, CanonType, true), NNS(NNS), Name(Ty) {
     assert(NNS->isDependent() &&
-           "TypenameType requires a dependent nested-name-specifier");
+           "DependentNameType requires a dependent nested-name-specifier");
   }
 
   friend class ASTContext;  // ASTContext creates these
@@ -2673,9 +2673,9 @@
   }
 
   static bool classof(const Type *T) {
-    return T->getTypeClass() == Typename;
+    return T->getTypeClass() == DependentName;
   }
-  static bool classof(const TypenameType *T) { return true; }
+  static bool classof(const DependentNameType *T) { return true; }
 };
 
 /// ObjCInterfaceType - Interfaces are the core concept in Objective-C for
@@ -3260,6 +3260,6 @@
 CLANG_ISA_STATISTIC(TemplateSpecializationType, cxx_type_checks)
 CLANG_ISA_STATISTIC(QualifiedNameType, cxx_type_checks)
 CLANG_ISA_STATISTIC(InjectedClassNameType, cxx_type_checks)
-CLANG_ISA_STATISTIC(TypenameType, cxx_type_checks)
+CLANG_ISA_STATISTIC(DependentNameType, cxx_type_checks)
 
 #endif

Modified: cfe/trunk/include/clang/AST/TypeLoc.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/TypeLoc.h?rev=100019&r1=100018&r2=100019&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/TypeLoc.h (original)
+++ cfe/trunk/include/clang/AST/TypeLoc.h Wed Mar 31 12:34:00 2010
@@ -1242,9 +1242,9 @@
 };
 
 // FIXME: locations for the typename keyword and nested name specifier.
-class TypenameTypeLoc : public InheritingConcreteTypeLoc<TypeSpecTypeLoc,
-                                                         TypenameTypeLoc,
-                                                         TypenameType> {
+class DependentNameTypeLoc : public InheritingConcreteTypeLoc<TypeSpecTypeLoc,
+                                                         DependentNameTypeLoc,
+                                                         DependentNameType> {
 };
 
 }

Modified: cfe/trunk/include/clang/AST/TypeNodes.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/TypeNodes.def?rev=100019&r1=100018&r2=100019&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/TypeNodes.def (original)
+++ cfe/trunk/include/clang/AST/TypeNodes.def Wed Mar 31 12:34:00 2010
@@ -92,7 +92,7 @@
 NON_CANONICAL_UNLESS_DEPENDENT_TYPE(TemplateSpecialization, Type)
 NON_CANONICAL_TYPE(QualifiedName, Type)
 NON_CANONICAL_TYPE(InjectedClassName, Type)
-DEPENDENT_TYPE(Typename, Type)
+DEPENDENT_TYPE(DependentName, Type)
 TYPE(ObjCInterface, Type)
 TYPE(ObjCObjectPointer, Type)
 

Modified: cfe/trunk/include/clang/Frontend/TypeXML.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/TypeXML.def?rev=100019&r1=100018&r2=100019&view=diff
==============================================================================
--- cfe/trunk/include/clang/Frontend/TypeXML.def (original)
+++ cfe/trunk/include/clang/Frontend/TypeXML.def Wed Mar 31 12:34:00 2010
@@ -233,7 +233,7 @@
   TYPE_ATTRIBUTE_XML(getNamedType())
 END_NODE_XML
 
-NODE_XML(TypenameType, "TypenameType")
+NODE_XML(DependentNameType, "DependentNameType")
   ID_ATTRIBUTE_XML
 END_NODE_XML
 

Modified: cfe/trunk/lib/AST/ASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=100019&r1=100018&r2=100019&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ASTContext.cpp (original)
+++ cfe/trunk/lib/AST/ASTContext.cpp Wed Mar 31 12:34:00 2010
@@ -1962,7 +1962,7 @@
   return QualType(T, 0);
 }
 
-QualType ASTContext::getTypenameType(NestedNameSpecifier *NNS,
+QualType ASTContext::getDependentNameType(NestedNameSpecifier *NNS,
                                      const IdentifierInfo *Name,
                                      QualType Canon) {
   assert(NNS->isDependent() && "nested-name-specifier must be dependent");
@@ -1970,36 +1970,36 @@
   if (Canon.isNull()) {
     NestedNameSpecifier *CanonNNS = getCanonicalNestedNameSpecifier(NNS);
     if (CanonNNS != NNS)
-      Canon = getTypenameType(CanonNNS, Name);
+      Canon = getDependentNameType(CanonNNS, Name);
   }
 
   llvm::FoldingSetNodeID ID;
-  TypenameType::Profile(ID, NNS, Name);
+  DependentNameType::Profile(ID, NNS, Name);
 
   void *InsertPos = 0;
-  TypenameType *T
-    = TypenameTypes.FindNodeOrInsertPos(ID, InsertPos);
+  DependentNameType *T
+    = DependentNameTypes.FindNodeOrInsertPos(ID, InsertPos);
   if (T)
     return QualType(T, 0);
 
-  T = new (*this) TypenameType(NNS, Name, Canon);
+  T = new (*this) DependentNameType(NNS, Name, Canon);
   Types.push_back(T);
-  TypenameTypes.InsertNode(T, InsertPos);
+  DependentNameTypes.InsertNode(T, InsertPos);
   return QualType(T, 0);
 }
 
 QualType
-ASTContext::getTypenameType(NestedNameSpecifier *NNS,
+ASTContext::getDependentNameType(NestedNameSpecifier *NNS,
                             const TemplateSpecializationType *TemplateId,
                             QualType Canon) {
   assert(NNS->isDependent() && "nested-name-specifier must be dependent");
 
   llvm::FoldingSetNodeID ID;
-  TypenameType::Profile(ID, NNS, TemplateId);
+  DependentNameType::Profile(ID, NNS, TemplateId);
 
   void *InsertPos = 0;
-  TypenameType *T
-    = TypenameTypes.FindNodeOrInsertPos(ID, InsertPos);
+  DependentNameType *T
+    = DependentNameTypes.FindNodeOrInsertPos(ID, InsertPos);
   if (T)
     return QualType(T, 0);
 
@@ -2011,17 +2011,17 @@
         = CanonType->getAs<TemplateSpecializationType>();
       assert(CanonTemplateId &&
              "Canonical type must also be a template specialization type");
-      Canon = getTypenameType(CanonNNS, CanonTemplateId);
+      Canon = getDependentNameType(CanonNNS, CanonTemplateId);
     }
 
-    TypenameType *CheckT
-      = TypenameTypes.FindNodeOrInsertPos(ID, InsertPos);
+    DependentNameType *CheckT
+      = DependentNameTypes.FindNodeOrInsertPos(ID, InsertPos);
     assert(!CheckT && "Typename canonical type is broken"); (void)CheckT;
   }
 
-  T = new (*this) TypenameType(NNS, TemplateId, Canon);
+  T = new (*this) DependentNameType(NNS, TemplateId, Canon);
   Types.push_back(T);
-  TypenameTypes.InsertNode(T, InsertPos);
+  DependentNameTypes.InsertNode(T, InsertPos);
   return QualType(T, 0);
 }
 

Modified: cfe/trunk/lib/AST/ASTImporter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTImporter.cpp?rev=100019&r1=100018&r2=100019&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ASTImporter.cpp (original)
+++ cfe/trunk/lib/AST/ASTImporter.cpp Wed Mar 31 12:34:00 2010
@@ -73,7 +73,7 @@
     // FIXME: SubstTemplateTypeParmType
     // FIXME: TemplateSpecializationType
     QualType VisitQualifiedNameType(QualifiedNameType *T);
-    // FIXME: TypenameType
+    // FIXME: DependentNameType
     QualType VisitObjCInterfaceType(ObjCInterfaceType *T);
     QualType VisitObjCObjectPointerType(ObjCObjectPointerType *T);
                             
@@ -618,9 +618,9 @@
     break;
   }
 
-  case Type::Typename: {
-    const TypenameType *Typename1 = cast<TypenameType>(T1);
-    const TypenameType *Typename2 = cast<TypenameType>(T2);
+  case Type::DependentName: {
+    const DependentNameType *Typename1 = cast<DependentNameType>(T1);
+    const DependentNameType *Typename2 = cast<DependentNameType>(T2);
     if (!IsStructurallyEquivalent(Context, 
                                   Typename1->getQualifier(),
                                   Typename2->getQualifier()))

Modified: cfe/trunk/lib/AST/Type.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Type.cpp?rev=100019&r1=100018&r2=100019&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Type.cpp (original)
+++ cfe/trunk/lib/AST/Type.cpp Wed Mar 31 12:34:00 2010
@@ -757,7 +757,7 @@
   case SubstTemplateTypeParm:
   case TemplateSpecialization:
   case QualifiedName:
-  case Typename:
+  case DependentName:
   case ObjCInterface:
   case ObjCObjectPointer:
   case Elaborated:

Modified: cfe/trunk/lib/AST/TypePrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/TypePrinter.cpp?rev=100019&r1=100018&r2=100019&view=diff
==============================================================================
--- cfe/trunk/lib/AST/TypePrinter.cpp (original)
+++ cfe/trunk/lib/AST/TypePrinter.cpp Wed Mar 31 12:34:00 2010
@@ -567,7 +567,7 @@
     S = MyString + ' ' + S;  
 }
 
-void TypePrinter::PrintTypename(const TypenameType *T, std::string &S) { 
+void TypePrinter::PrintDependentName(const DependentNameType *T, std::string &S) { 
   std::string MyString;
   
   {

Modified: cfe/trunk/lib/CodeGen/Mangle.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/Mangle.cpp?rev=100019&r1=100018&r2=100019&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/Mangle.cpp (original)
+++ cfe/trunk/lib/CodeGen/Mangle.cpp Wed Mar 31 12:34:00 2010
@@ -1164,7 +1164,7 @@
   mangleName(TD, T->getArgs(), T->getNumArgs());
 }
 
-void CXXNameMangler::mangleType(const TypenameType *T) {
+void CXXNameMangler::mangleType(const DependentNameType *T) {
   // Typename types are always nested
   Out << 'N';
   mangleUnresolvedScope(T->getQualifier());
@@ -1456,7 +1456,7 @@
     // It isn't clear that we ever actually want to have such a
     // nested-name-specifier; why not just represent it as a typename type?
     if (!QTy && NNS->getAsIdentifier() && NNS->getPrefix()) {
-      QTy = getASTContext().getTypenameType(NNS->getPrefix(),
+      QTy = getASTContext().getDependentNameType(NNS->getPrefix(),
                                             NNS->getAsIdentifier())
               .getTypePtr();
     }

Modified: cfe/trunk/lib/Frontend/PCHReader.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/PCHReader.cpp?rev=100019&r1=100018&r2=100019&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/PCHReader.cpp (original)
+++ cfe/trunk/lib/Frontend/PCHReader.cpp Wed Mar 31 12:34:00 2010
@@ -2351,7 +2351,7 @@
 void TypeLocReader::VisitInjectedClassNameTypeLoc(InjectedClassNameTypeLoc TL) {
   TL.setNameLoc(SourceLocation::getFromRawEncoding(Record[Idx++]));
 }
-void TypeLocReader::VisitTypenameTypeLoc(TypenameTypeLoc TL) {
+void TypeLocReader::VisitDependentNameTypeLoc(DependentNameTypeLoc TL) {
   TL.setNameLoc(SourceLocation::getFromRawEncoding(Record[Idx++]));
 }
 void TypeLocReader::VisitObjCInterfaceTypeLoc(ObjCInterfaceTypeLoc TL) {

Modified: cfe/trunk/lib/Frontend/PCHWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/PCHWriter.cpp?rev=100019&r1=100018&r2=100019&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/PCHWriter.cpp (original)
+++ cfe/trunk/lib/Frontend/PCHWriter.cpp Wed Mar 31 12:34:00 2010
@@ -406,7 +406,7 @@
 void TypeLocWriter::VisitInjectedClassNameTypeLoc(InjectedClassNameTypeLoc TL) {
   Writer.AddSourceLocation(TL.getNameLoc(), Record);
 }
-void TypeLocWriter::VisitTypenameTypeLoc(TypenameTypeLoc TL) {
+void TypeLocWriter::VisitDependentNameTypeLoc(DependentNameTypeLoc TL) {
   Writer.AddSourceLocation(TL.getNameLoc(), Record);
 }
 void TypeLocWriter::VisitObjCInterfaceTypeLoc(ObjCInterfaceTypeLoc TL) {

Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=100019&r1=100018&r2=100019&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Wed Mar 31 12:34:00 2010
@@ -88,8 +88,8 @@
           return 0;
         
         // We know from the grammar that this name refers to a type, so build a
-        // TypenameType node to describe the type.
-        // FIXME: Record somewhere that this TypenameType node has no "typename"
+        // DependentNameType node to describe the type.
+        // FIXME: Record somewhere that this DependentNameType node has no "typename"
         // keyword associated with it.
         return CheckTypenameType((NestedNameSpecifier *)SS->getScopeRep(),
                                  II, SS->getRange()).getAsOpaquePtr();
@@ -198,7 +198,7 @@
   } else if (UnresolvedUsingTypenameDecl *UUDecl =
                dyn_cast<UnresolvedUsingTypenameDecl>(IIDecl)) {
     // FIXME: preserve source structure information.
-    T = Context.getTypenameType(UUDecl->getTargetNestedNameSpecifier(), &II);
+    T = Context.getDependentNameType(UUDecl->getTargetNestedNameSpecifier(), &II);
   } else {
     // If it's not plausibly a type, suppress diagnostics.
     Result.suppressDiagnostics();

Modified: cfe/trunk/lib/Sema/SemaTemplate.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplate.cpp?rev=100019&r1=100018&r2=100019&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaTemplate.cpp (original)
+++ cfe/trunk/lib/Sema/SemaTemplate.cpp Wed Mar 31 12:34:00 2010
@@ -4962,7 +4962,7 @@
     return Context.getQualifiedNameType(NNS, T).getAsOpaquePtr();
   }
 
-  return Context.getTypenameType(NNS, TemplateId).getAsOpaquePtr();
+  return Context.getDependentNameType(NNS, TemplateId).getAsOpaquePtr();
 }
 
 /// \brief Build the type that describes a C++ typename specifier,
@@ -4977,7 +4977,7 @@
     // If the nested-name-specifier does not refer to the current
     // instantiation, then build a typename type.
     if (!CurrentInstantiation)
-      return Context.getTypenameType(NNS, &II);
+      return Context.getDependentNameType(NNS, &II);
 
     // The nested-name-specifier refers to the current instantiation, so the
     // "typename" keyword itself is superfluous. In C++03, the program is
@@ -5013,7 +5013,7 @@
       
   case LookupResult::NotFoundInCurrentInstantiation:
     // Okay, it's a member of an unknown instantiation.
-    return Context.getTypenameType(NNS, &II);
+    return Context.getDependentNameType(NNS, &II);
 
   case LookupResult::Found:
     if (TypeDecl *Type = dyn_cast<TypeDecl>(Result.getFoundDecl())) {
@@ -5098,16 +5098,16 @@
     /// \brief Transforms a typename type by determining whether the type now
     /// refers to a member of the current instantiation, and then
     /// type-checking and building a QualifiedNameType (when possible).
-    QualType TransformTypenameType(TypeLocBuilder &TLB, TypenameTypeLoc TL, 
+    QualType TransformDependentNameType(TypeLocBuilder &TLB, DependentNameTypeLoc TL, 
                                    QualType ObjectType);
   };
 }
 
 QualType
-CurrentInstantiationRebuilder::TransformTypenameType(TypeLocBuilder &TLB,
-                                                     TypenameTypeLoc TL, 
+CurrentInstantiationRebuilder::TransformDependentNameType(TypeLocBuilder &TLB,
+                                                     DependentNameTypeLoc TL, 
                                                      QualType ObjectType) {
-  TypenameType *T = TL.getTypePtr();
+  DependentNameType *T = TL.getTypePtr();
 
   NestedNameSpecifier *NNS
     = TransformNestedNameSpecifier(T->getQualifier(),
@@ -5139,15 +5139,15 @@
         NewTemplateId == QualType(TemplateId, 0))
       Result = QualType(T, 0);
     else
-      Result = getDerived().RebuildTypenameType(NNS, NewTemplateId);
+      Result = getDerived().RebuildDependentNameType(NNS, NewTemplateId);
   } else
-    Result = getDerived().RebuildTypenameType(NNS, T->getIdentifier(),
+    Result = getDerived().RebuildDependentNameType(NNS, T->getIdentifier(),
                                               SourceRange(TL.getNameLoc()));
 
   if (Result.isNull())
     return QualType();
 
-  TypenameTypeLoc NewTL = TLB.push<TypenameTypeLoc>(Result);
+  DependentNameTypeLoc NewTL = TLB.push<DependentNameTypeLoc>(Result);
   NewTL.setNameLoc(TL.getNameLoc());
   return Result;
 }
@@ -5172,7 +5172,7 @@
 /// typename X<T>::pointer X<T>::data() { ... }
 /// \endcode
 ///
-/// Here, the type "typename X<T>::pointer" will be created as a TypenameType,
+/// Here, the type "typename X<T>::pointer" will be created as a DependentNameType,
 /// since we do not know that we can look into X<T> when we parsed the type.
 /// This function will rebuild the type, performing the lookup of "pointer"
 /// in X<T> and returning a QualifiedNameType whose canonical type is the same

Modified: cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp?rev=100019&r1=100018&r2=100019&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp (original)
+++ cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp Wed Mar 31 12:34:00 2010
@@ -773,7 +773,7 @@
 
     case Type::TypeOfExpr:
     case Type::TypeOf:
-    case Type::Typename:
+    case Type::DependentName:
       // No template argument deduction for these types
       return Sema::TDK_Success;
 
@@ -2555,10 +2555,10 @@
                                  OnlyDeduced, Depth, Used);
     break;
 
-  case Type::Typename:
+  case Type::DependentName:
     if (!OnlyDeduced)
       MarkUsedTemplateParameters(SemaRef,
-                                 cast<TypenameType>(T)->getQualifier(),
+                                 cast<DependentNameType>(T)->getQualifier(),
                                  OnlyDeduced, Depth, Used);
     break;
 

Modified: cfe/trunk/lib/Sema/SemaType.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaType.cpp?rev=100019&r1=100018&r2=100019&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaType.cpp (original)
+++ cfe/trunk/lib/Sema/SemaType.cpp Wed Mar 31 12:34:00 2010
@@ -1262,7 +1262,7 @@
         NestedNameSpecifier *NNSPrefix = NNS->getPrefix();
         switch (NNS->getKind()) {
         case NestedNameSpecifier::Identifier:
-          ClsType = Context.getTypenameType(NNSPrefix, NNS->getAsIdentifier());
+          ClsType = Context.getDependentNameType(NNSPrefix, NNS->getAsIdentifier());
           break;
 
         case NestedNameSpecifier::Namespace:

Modified: cfe/trunk/lib/Sema/TreeTransform.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/TreeTransform.h?rev=100019&r1=100018&r2=100019&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/TreeTransform.h (original)
+++ cfe/trunk/lib/Sema/TreeTransform.h Wed Mar 31 12:34:00 2010
@@ -537,15 +537,15 @@
 
   /// \brief Build a new typename type that refers to a template-id.
   ///
-  /// By default, builds a new TypenameType type from the nested-name-specifier
+  /// By default, builds a new DependentNameType type from the nested-name-specifier
   /// and the given type. Subclasses may override this routine to provide
   /// different behavior.
-  QualType RebuildTypenameType(NestedNameSpecifier *NNS, QualType T) {
+  QualType RebuildDependentNameType(NestedNameSpecifier *NNS, QualType T) {
     if (NNS->isDependent()) {
       CXXScopeSpec SS;
       SS.setScopeRep(NNS);
       if (!SemaRef.computeDeclContext(SS))
-        return SemaRef.Context.getTypenameType(NNS,
+        return SemaRef.Context.getDependentNameType(NNS,
                                           cast<TemplateSpecializationType>(T));
     }
 
@@ -557,7 +557,7 @@
   /// By default, performs semantic analysis when building the typename type
   /// (or qualified name type). Subclasses may override this routine to provide
   /// different behavior.
-  QualType RebuildTypenameType(NestedNameSpecifier *NNS,
+  QualType RebuildDependentNameType(NestedNameSpecifier *NNS,
                                const IdentifierInfo *Id,
                                SourceRange SR) {
     return SemaRef.CheckTypenameType(NNS, *Id, SR);
@@ -2996,10 +2996,10 @@
 }
 
 template<typename Derived>
-QualType TreeTransform<Derived>::TransformTypenameType(TypeLocBuilder &TLB,
-                                                       TypenameTypeLoc TL,
+QualType TreeTransform<Derived>::TransformDependentNameType(TypeLocBuilder &TLB,
+                                                       DependentNameTypeLoc TL,
                                                        QualType ObjectType) {
-  TypenameType *T = TL.getTypePtr();
+  DependentNameType *T = TL.getTypePtr();
 
   /* FIXME: preserve source information better than this */
   SourceRange SR(TL.getNameLoc());
@@ -3023,14 +3023,14 @@
         NewTemplateId == QualType(TemplateId, 0))
       return QualType(T, 0);
 
-    Result = getDerived().RebuildTypenameType(NNS, NewTemplateId);
+    Result = getDerived().RebuildDependentNameType(NNS, NewTemplateId);
   } else {
-    Result = getDerived().RebuildTypenameType(NNS, T->getIdentifier(), SR);
+    Result = getDerived().RebuildDependentNameType(NNS, T->getIdentifier(), SR);
   }
   if (Result.isNull())
     return QualType();
 
-  TypenameTypeLoc NewTL = TLB.push<TypenameTypeLoc>(Result);
+  DependentNameTypeLoc NewTL = TLB.push<DependentNameTypeLoc>(Result);
   NewTL.setNameLoc(TL.getNameLoc());
 
   return Result;





More information about the cfe-commits mailing list