]> granicus.if.org Git - clang/commitdiff
rename isReferenceType to follow the new scheme.
authorChris Lattner <sabre@nondot.org>
Tue, 31 Jul 2007 16:56:34 +0000 (16:56 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 31 Jul 2007 16:56:34 +0000 (16:56 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40640 91177308-0d34-0410-b5e6-96231b3b80d8

AST/Type.cpp
Sema/SemaExpr.cpp
Sema/SemaType.cpp
include/clang/AST/Type.h

index ae04c4effdc6f7a448e3d70f47cd2e25691f7c20..1c61c681cee1687f24e028ae3c8a589654a342cb 100644 (file)
@@ -70,6 +70,7 @@ const FunctionType *Type::isFunctionType() const {
 
 // FIXME: move inline
 bool Type::isPointerType() const { return isa<PointerType>(CanonicalType); }
+bool Type::isReferenceType() const { return isa<ReferenceType>(CanonicalType); }
 
 const PointerType *Type::getAsPointerType() const {
   // If this is directly a pointer type, return it.
@@ -83,7 +84,7 @@ const PointerType *Type::getAsPointerType() const {
   return 0;
 }
 
-const ReferenceType *Type::isReferenceType() const {
+const ReferenceType *Type::getAsReferenceType() const {
   // If this is directly a reference type, return it.
   if (const ReferenceType *RTy = dyn_cast<ReferenceType>(this))
     return RTy;
index 89aef4ec5941c1e901f04b3ea857ed82dbe1d6d3..0db9879e4161858b1067fdf22e979cf86bcdd07e 100644 (file)
@@ -700,7 +700,7 @@ void Sema::DefaultFunctionArrayConversion(Expr *&e) {
   QualType t = e->getType();
   assert(!t.isNull() && "DefaultFunctionArrayConversion - missing type");
 
-  if (const ReferenceType *ref = t->isReferenceType()) {
+  if (const ReferenceType *ref = t->getAsReferenceType()) {
     promoteExprToType(e, ref->getReferenceeType()); // C++ [expr]
     t = e->getType();
   }
@@ -719,7 +719,7 @@ void Sema::UsualUnaryConversions(Expr *&expr) {
   QualType t = expr->getType();
   assert(!t.isNull() && "UsualUnaryConversions - missing type");
   
-  if (const ReferenceType *ref = t->isReferenceType()) {
+  if (const ReferenceType *ref = t->getAsReferenceType()) {
     promoteExprToType(expr, ref->getReferenceeType()); // C++ [expr]
     t = expr->getType();
   }
index d70002340be1500c2aae42b60f3c9387c149ce24..7085d833fd3aac7dcc2739e8a484623b685354e4 100644 (file)
@@ -136,7 +136,7 @@ QualType Sema::GetTypeForDeclarator(Declarator &D, Scope *S) {
       T = Context.getPointerType(T).getQualifiedType(DeclType.Ptr.TypeQuals);
       break;
     case DeclaratorChunk::Reference:
-      if (const ReferenceType *RT = T->isReferenceType()) {
+      if (const ReferenceType *RT = T->getAsReferenceType()) {
         // C++ 8.3.2p4: There shall be no references to references ...
         Diag(D.getIdentifierLoc(),
              diag::err_illegal_decl_reference_to_reference,
@@ -166,7 +166,7 @@ QualType Sema::GetTypeForDeclarator(Declarator &D, Scope *S) {
         Diag(D.getIdentifierLoc(), diag::err_illegal_decl_array_of_functions,
              D.getIdentifier()->getName());
         T = Context.getPointerType(T);
-      } else if (const ReferenceType *RT = T->isReferenceType()) {
+      } else if (const ReferenceType *RT = T->getAsReferenceType()) {
         // C++ 8.3.2p4: There shall be no ... arrays of references ...
         Diag(D.getIdentifierLoc(), diag::err_illegal_decl_array_of_references,
              D.getIdentifier()->getName());
index b35e19facc56f3279dd29890d7fa64e83f3bbfce..c1096555e54c18f765927a1528c4ba19f6f1d24c 100644 (file)
@@ -240,9 +240,11 @@ public:
   /// Derived types (C99 6.2.5p20).
   bool isDerivedType() const;
   const FunctionType *isFunctionType() const;   
+
   bool isPointerType() const;
+  bool isReferenceType() const;
   const PointerType *getAsPointerType() const;
-  const ReferenceType *isReferenceType() const;
+  const ReferenceType *getAsReferenceType() const;
   const ArrayType *isArrayType() const;
   const RecordType *isRecordType() const;
   const TagType *isStructureType() const;