aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-02-26 20:52:22 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-02-26 20:52:22 +0000
commit8958891f5fa1e593c4519a36b3df427ee019d70b (patch)
treef57fc5020048e30615e3ed3a817d5a8ffe148af3 /lib/CodeGen
parent3daea0a051d90f8ff660a6392f0112a0e78e6dba (diff)
Add Type::hasPointerRepresentation predicate.
- For types whose native representation is a pointer. - Use to replace ExprConstant.cpp:HasPointerEvalType, CodeGenFunction::isObjCPointerType. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65569 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/CGCall.cpp4
-rw-r--r--lib/CodeGen/CodeGenFunction.cpp10
-rw-r--r--lib/CodeGen/CodeGenFunction.h4
3 files changed, 3 insertions, 15 deletions
diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp
index e560bfd82f..7a98b0c1c6 100644
--- a/lib/CodeGen/CGCall.cpp
+++ b/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/lib/CodeGen/CodeGenFunction.cpp b/lib/CodeGen/CodeGenFunction.cpp
index 2f09734666..81fd3871d6 100644
--- a/lib/CodeGen/CodeGenFunction.cpp
+++ b/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/lib/CodeGen/CodeGenFunction.h b/lib/CodeGen/CodeGenFunction.h
index 8b5986c471..918646f955 100644
--- a/lib/CodeGen/CodeGenFunction.h
+++ b/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);