simplify some code by using PointerLikeType.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49101 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/GRExprEngine.cpp b/lib/Analysis/GRExprEngine.cpp
index bf0d5ea..36bae45 100644
--- a/lib/Analysis/GRExprEngine.cpp
+++ b/lib/Analysis/GRExprEngine.cpp
@@ -1201,7 +1201,7 @@
QualType T = R->getType();
- if (T->isPointerType() || T->isReferenceType()) {
+ if (T->isPointerLikeType()) {
// Check if any of the return values return the address of a stack variable.
diff --git a/lib/Analysis/GRSimpleVals.cpp b/lib/Analysis/GRSimpleVals.cpp
index 0c62ae7..9a0d63e 100644
--- a/lib/Analysis/GRSimpleVals.cpp
+++ b/lib/Analysis/GRSimpleVals.cpp
@@ -356,7 +356,7 @@
RVal GRSimpleVals::EvalCast(GRExprEngine& Eng, LVal X, QualType T) {
- if (T->isPointerType() || T->isReferenceType() || T->isObjCQualifiedIdType())
+ if (T->isPointerLikeType() || T->isObjCQualifiedIdType())
return X;
assert (T->isIntegerType());
diff --git a/lib/Analysis/RValues.cpp b/lib/Analysis/RValues.cpp
index a4b4649..2e44e70 100644
--- a/lib/Analysis/RValues.cpp
+++ b/lib/Analysis/RValues.cpp
@@ -225,10 +225,9 @@
QualType T = D->getType();
- if (T->isPointerType() || T->isReferenceType())
+ if (T->isPointerLikeType())
return lval::SymbolVal(SymMgr.getSymbol(D));
- else
- return nonlval::SymbolVal(SymMgr.getSymbol(D));
+ return nonlval::SymbolVal(SymMgr.getSymbol(D));
}
//===----------------------------------------------------------------------===//
diff --git a/lib/CodeGen/CodeGenFunction.cpp b/lib/CodeGen/CodeGenFunction.cpp
index 5f47bb7..c804098 100644
--- a/lib/CodeGen/CodeGenFunction.cpp
+++ b/lib/CodeGen/CodeGenFunction.cpp
@@ -51,7 +51,7 @@
}
bool CodeGenFunction::hasAggregateLLVMType(QualType T) {
- return !T->isRealType() && !T->isPointerType() && !T->isReferenceType() &&
+ return !T->isRealType() && !T->isPointerLikeType() &&
!T->isVoidType() && !T->isVectorType() && !T->isFunctionType();
}
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index 9c36c17..9d75f4f 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -927,7 +927,7 @@
assert(!Ty.isNull() && "DefaultFunctionArrayConversion - missing type");
if (const ReferenceType *ref = Ty->getAsReferenceType()) {
- ImpCastExprToType(E, ref->getReferenceeType()); // C++ [expr]
+ ImpCastExprToType(E, ref->getPointeeType()); // C++ [expr]
Ty = E->getType();
}
if (Ty->isFunctionType())
@@ -946,7 +946,7 @@
assert(!Ty.isNull() && "UsualUnaryConversions - missing type");
if (const ReferenceType *Ref = Ty->getAsReferenceType()) {
- ImpCastExprToType(Expr, Ref->getReferenceeType()); // C++ [expr]
+ ImpCastExprToType(Expr, Ref->getPointeeType()); // C++ [expr]
Ty = Expr->getType();
}
if (Ty->isPromotableIntegerType()) // C99 6.3.1.1p2