[cfe-commits] r40640 - in /cfe/trunk: AST/Type.cpp Sema/SemaExpr.cpp Sema/SemaType.cpp include/clang/AST/Type.h
Chris Lattner
sabre at nondot.org
Tue Jul 31 09:56:35 PDT 2007
Author: lattner
Date: Tue Jul 31 11:56:34 2007
New Revision: 40640
URL: http://llvm.org/viewvc/llvm-project?rev=40640&view=rev
Log:
rename isReferenceType to follow the new scheme.
Modified:
cfe/trunk/AST/Type.cpp
cfe/trunk/Sema/SemaExpr.cpp
cfe/trunk/Sema/SemaType.cpp
cfe/trunk/include/clang/AST/Type.h
Modified: cfe/trunk/AST/Type.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/AST/Type.cpp?rev=40640&r1=40639&r2=40640&view=diff
==============================================================================
--- cfe/trunk/AST/Type.cpp (original)
+++ cfe/trunk/AST/Type.cpp Tue Jul 31 11:56:34 2007
@@ -70,6 +70,7 @@
// 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 @@
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;
Modified: cfe/trunk/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Sema/SemaExpr.cpp?rev=40640&r1=40639&r2=40640&view=diff
==============================================================================
--- cfe/trunk/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/Sema/SemaExpr.cpp Tue Jul 31 11:56:34 2007
@@ -700,7 +700,7 @@
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 @@
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();
}
Modified: cfe/trunk/Sema/SemaType.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Sema/SemaType.cpp?rev=40640&r1=40639&r2=40640&view=diff
==============================================================================
--- cfe/trunk/Sema/SemaType.cpp (original)
+++ cfe/trunk/Sema/SemaType.cpp Tue Jul 31 11:56:34 2007
@@ -136,7 +136,7 @@
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 @@
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());
Modified: cfe/trunk/include/clang/AST/Type.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Type.h?rev=40640&r1=40639&r2=40640&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Type.h (original)
+++ cfe/trunk/include/clang/AST/Type.h Tue Jul 31 11:56:34 2007
@@ -240,9 +240,11 @@
/// 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;
More information about the cfe-commits
mailing list