diff options
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/AST/ExprConstant.cpp | 10 | ||||
-rw-r--r-- | clang/lib/CodeGen/CGCall.cpp | 4 | ||||
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.cpp | 10 | ||||
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.h | 4 |
4 files changed, 5 insertions, 23 deletions
diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp index 6899b617036..5cfc6e6ab31 100644 --- a/clang/lib/AST/ExprConstant.cpp +++ b/clang/lib/AST/ExprConstant.cpp @@ -279,14 +279,8 @@ public: }; } // end anonymous namespace -static bool HasPointerEvalType(const Expr* E) { - return E->getType()->isPointerType() - || E->getType()->isBlockPointerType() - || E->getType()->isObjCQualifiedIdType(); -} - static bool EvaluatePointer(const Expr* E, APValue& Result, EvalInfo &Info) { - if (!HasPointerEvalType(E)) + if (!E->getType()->hasPointerRepresentation()) return false; Result = PointerExprEvaluator(Info).Visit(const_cast<Expr*>(E)); return Result.isLValue(); @@ -1570,7 +1564,7 @@ bool Expr::Evaluate(EvalResult &Result, ASTContext &Ctx) const { } else if (getType()->isIntegerType()) { if (!IntExprEvaluator(Info, Result.Val).Visit(const_cast<Expr*>(this))) return false; - } else if (HasPointerEvalType(this)) { + } else if (getType()->hasPointerRepresentation()) { if (!EvaluatePointer(this, Result.Val, Info)) return false; } else if (getType()->isRealFloatingType()) { diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp index e560bfd82f1..7a98b0c1c6b 100644 --- a/clang/lib/CodeGen/CGCall.cpp +++ b/clang/lib/CodeGen/CGCall.cpp @@ -525,9 +525,7 @@ void X86_64ABIInfo::classify(QualType Ty, } else if (const EnumType *ET = Ty->getAsEnumType()) { // Classify the underlying integer type. classify(ET->getDecl()->getIntegerType(), Context, OffsetBase, Lo, Hi); - } else if (Ty->isPointerType() || Ty->isReferenceType() || - Ty->isBlockPointerType() || Ty->isObjCQualifiedIdType() || - Ty->isObjCQualifiedInterfaceType()) { + } else if (Ty->hasPointerRepresentation()) { Current = Integer; } else if (const VectorType *VT = Ty->getAsVectorType()) { uint64_t Size = Context.getTypeSize(VT); diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index 2f097346665..81fd3871d61 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -73,17 +73,11 @@ const llvm::Type *CodeGenFunction::ConvertType(QualType T) { return CGM.getTypes().ConvertType(T); } -bool CodeGenFunction::isObjCPointerType(QualType T) { - // All Objective-C types are pointers. - return T->isObjCInterfaceType() || - T->isObjCQualifiedInterfaceType() || T->isObjCQualifiedIdType(); -} - bool CodeGenFunction::hasAggregateLLVMType(QualType T) { // FIXME: Use positive checks instead of negative ones to be more // robust in the face of extension. - return !isObjCPointerType(T) &&!T->isRealType() && !T->isPointerType() && - !T->isReferenceType() && !T->isVoidType() && !T->isVectorType() && !T->isFunctionType() && + return !T->hasPointerRepresentation() &&!T->isRealType() && + !T->isVoidType() && !T->isVectorType() && !T->isFunctionType() && !T->isBlockPointerType(); } diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h index 8b5986c4713..918646f9559 100644 --- a/clang/lib/CodeGen/CodeGenFunction.h +++ b/clang/lib/CodeGen/CodeGenFunction.h @@ -366,10 +366,6 @@ public: /// TypeOfSelfObject - Return type of object that this self represents. QualType TypeOfSelfObject(); - /// isObjCPointerType - Return true if the specificed AST type will map onto - /// some Objective-C pointer type. - static bool isObjCPointerType(QualType T); - /// hasAggregateLLVMType - Return true if the specified AST type will map into /// an aggregate LLVM type or is void. static bool hasAggregateLLVMType(QualType T); |