summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ASTContext.cpp
diff options
context:
space:
mode:
authorKen Dyck <ken.dyck@onsemi.com>2010-01-11 19:19:56 +0000
committerKen Dyck <ken.dyck@onsemi.com>2010-01-11 19:19:56 +0000
commitde37a67f50ceb0f6ccb845a37e8408cd8ed4745f (patch)
treecd7f44517a757a8b04baf645a751155ec271e884 /clang/lib/AST/ASTContext.cpp
parentf991bbb0c120b77f6b068b697b811bd81519f932 (diff)
downloadbcm5719-llvm-de37a67f50ceb0f6ccb845a37e8408cd8ed4745f.tar.gz
bcm5719-llvm-de37a67f50ceb0f6ccb845a37e8408cd8ed4745f.zip
Change return type of getObjCEncodingTypeSize() to CharUnits as the units are in characters.
llvm-svn: 93171
Diffstat (limited to 'clang/lib/AST/ASTContext.cpp')
-rw-r--r--clang/lib/AST/ASTContext.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index bd5ca93e1c1..e729b1b58d5 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -3137,7 +3137,7 @@ static bool isTypeTypedefedAsBOOL(QualType T) {
/// getObjCEncodingTypeSize returns size of type for objective-c encoding
/// purpose.
-int ASTContext::getObjCEncodingTypeSize(QualType type) {
+CharUnits ASTContext::getObjCEncodingTypeSize(QualType type) {
CharUnits sz = getTypeSizeInChars(type);
// Make all integer and enum types at least as large as an int
@@ -3146,7 +3146,7 @@ int ASTContext::getObjCEncodingTypeSize(QualType type) {
// Treat arrays as pointers, since that's how they're passed in.
else if (type->isArrayType())
sz = getTypeSizeInChars(VoidPtrTy);
- return sz.getQuantity();
+ return sz;
}
static inline
@@ -3172,7 +3172,7 @@ void ASTContext::getObjCEncodingForBlock(const BlockExpr *Expr,
for (ObjCMethodDecl::param_iterator PI = Decl->param_begin(),
E = Decl->param_end(); PI != E; ++PI) {
QualType PType = (*PI)->getType();
- CharUnits sz = CharUnits::fromQuantity(getObjCEncodingTypeSize(PType));
+ CharUnits sz = getObjCEncodingTypeSize(PType);
assert (sz.isPositive() && "BlockExpr - Incomplete param type");
ParmOffset += sz;
}
@@ -3198,7 +3198,7 @@ void ASTContext::getObjCEncodingForBlock(const BlockExpr *Expr,
PType = PVDecl->getType();
getObjCEncodingForType(PType, S);
S += charUnitsToString(ParmOffset);
- ParmOffset += CharUnits::fromQuantity(getObjCEncodingTypeSize(PType));
+ ParmOffset += getObjCEncodingTypeSize(PType);
}
}
@@ -3222,7 +3222,7 @@ void ASTContext::getObjCEncodingForMethodDecl(const ObjCMethodDecl *Decl,
for (ObjCMethodDecl::param_iterator PI = Decl->param_begin(),
E = Decl->param_end(); PI != E; ++PI) {
QualType PType = (*PI)->getType();
- CharUnits sz = CharUnits::fromQuantity(getObjCEncodingTypeSize(PType));
+ CharUnits sz = getObjCEncodingTypeSize(PType);
assert (sz.isPositive() &&
"getObjCEncodingForMethodDecl - Incomplete param type");
ParmOffset += sz;
@@ -3250,7 +3250,7 @@ void ASTContext::getObjCEncodingForMethodDecl(const ObjCMethodDecl *Decl,
getObjCEncodingForTypeQualifier(PVDecl->getObjCDeclQualifier(), S);
getObjCEncodingForType(PType, S);
S += charUnitsToString(ParmOffset);
- ParmOffset += CharUnits::fromQuantity(getObjCEncodingTypeSize(PType));
+ ParmOffset += getObjCEncodingTypeSize(PType);
}
}
OpenPOWER on IntegriCloud