summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-07-31 16:56:34 +0000
committerChris Lattner <sabre@nondot.org>2007-07-31 16:56:34 +0000
commitcd1d086b5afdb7f5d93cc3e6824abfc9ba9e20b7 (patch)
tree51226756ebd80a2c59864b816e19fd0792d99024
parentc996b176e8dcc9a578f2efc6817945da4ec27db0 (diff)
downloadbcm5719-llvm-cd1d086b5afdb7f5d93cc3e6824abfc9ba9e20b7.tar.gz
bcm5719-llvm-cd1d086b5afdb7f5d93cc3e6824abfc9ba9e20b7.zip
rename isReferenceType to follow the new scheme.
llvm-svn: 40640
-rw-r--r--clang/AST/Type.cpp3
-rw-r--r--clang/Sema/SemaExpr.cpp4
-rw-r--r--clang/Sema/SemaType.cpp4
-rw-r--r--clang/include/clang/AST/Type.h4
4 files changed, 9 insertions, 6 deletions
diff --git a/clang/AST/Type.cpp b/clang/AST/Type.cpp
index ae04c4effdc..1c61c681cee 100644
--- a/clang/AST/Type.cpp
+++ b/clang/AST/Type.cpp
@@ -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;
diff --git a/clang/Sema/SemaExpr.cpp b/clang/Sema/SemaExpr.cpp
index 89aef4ec594..0db9879e416 100644
--- a/clang/Sema/SemaExpr.cpp
+++ b/clang/Sema/SemaExpr.cpp
@@ -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();
}
diff --git a/clang/Sema/SemaType.cpp b/clang/Sema/SemaType.cpp
index d70002340be..7085d833fd3 100644
--- a/clang/Sema/SemaType.cpp
+++ b/clang/Sema/SemaType.cpp
@@ -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());
diff --git a/clang/include/clang/AST/Type.h b/clang/include/clang/AST/Type.h
index b35e19facc5..c1096555e54 100644
--- a/clang/include/clang/AST/Type.h
+++ b/clang/include/clang/AST/Type.h
@@ -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;
OpenPOWER on IntegriCloud