forked from OSchip/llvm-project
simplify some code by using PointerLikeType.
llvm-svn: 49101
This commit is contained in:
parent
db5f1fa3d8
commit
182f660d8d
|
@ -1201,7 +1201,7 @@ void GRExprEngine::VisitReturnStmt(ReturnStmt* S, NodeTy* Pred, NodeSet& Dst) {
|
|||
|
||||
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.
|
||||
|
||||
|
|
|
@ -356,7 +356,7 @@ RVal GRSimpleVals::EvalCast(GRExprEngine& Eng, NonLVal X, QualType T) {
|
|||
|
||||
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());
|
||||
|
|
|
@ -225,10 +225,9 @@ RVal RVal::GetSymbolValue(SymbolManager& SymMgr, VarDecl* D) {
|
|||
|
||||
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));
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
|
|
@ -51,7 +51,7 @@ const llvm::Type *CodeGenFunction::ConvertType(QualType T) {
|
|||
}
|
||||
|
||||
bool CodeGenFunction::hasAggregateLLVMType(QualType T) {
|
||||
return !T->isRealType() && !T->isPointerType() && !T->isReferenceType() &&
|
||||
return !T->isRealType() && !T->isPointerLikeType() &&
|
||||
!T->isVoidType() && !T->isVectorType() && !T->isFunctionType();
|
||||
}
|
||||
|
||||
|
|
|
@ -927,7 +927,7 @@ void Sema::DefaultFunctionArrayConversion(Expr *&E) {
|
|||
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 @@ Expr *Sema::UsualUnaryConversions(Expr *&Expr) {
|
|||
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
|
||||
|
|
Loading…
Reference in New Issue