summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ASTContext.cpp
diff options
context:
space:
mode:
authorJoe Groff <arcata@gmail.com>2014-07-07 22:25:15 +0000
committerJoe Groff <arcata@gmail.com>2014-07-07 22:25:15 +0000
commit98ac7d2d35fe032497142aa1a5905f49e6414929 (patch)
tree04d58d4e7a6084c828d600b3c37268ea8779e257 /clang/lib/AST/ASTContext.cpp
parent70af1fdf9d9e25f153aebac5669ff0ea925f193e (diff)
downloadbcm5719-llvm-98ac7d2d35fe032497142aa1a5905f49e6414929.tar.gz
bcm5719-llvm-98ac7d2d35fe032497142aa1a5905f49e6414929.zip
ASTContext: Factor 'getObjCEncodingForPropertyType' as its own method.
It is useful to get the property encoding for an ObjC type without a full ObjCPropertyDecl. llvm-svn: 212496
Diffstat (limited to 'clang/lib/AST/ASTContext.cpp')
-rw-r--r--clang/lib/AST/ASTContext.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index 42508504671..6526a777546 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -5022,9 +5022,7 @@ void ASTContext::getObjCEncodingForPropertyDecl(const ObjCPropertyDecl *PD,
// Encode result type.
// GCC has some special rules regarding encoding of properties which
// closely resembles encoding of ivars.
- getObjCEncodingForTypeImpl(PD->getType(), S, true, true, nullptr,
- true /* outermost type */,
- true /* encoding for property */);
+ getObjCEncodingForPropertyType(PD->getType(), S);
if (PD->isReadOnly()) {
S += ",R";
@@ -5097,6 +5095,16 @@ void ASTContext::getObjCEncodingForType(QualType T, std::string& S,
true /* outermost type */);
}
+void ASTContext::getObjCEncodingForPropertyType(QualType T,
+ std::string& S) const {
+ // Encode result type.
+ // GCC has some special rules regarding encoding of properties which
+ // closely resembles encoding of ivars.
+ getObjCEncodingForTypeImpl(T, S, true, true, nullptr,
+ true /* outermost type */,
+ true /* encoding property */);
+}
+
static char getObjCEncodingForPrimitiveKind(const ASTContext *C,
BuiltinType::Kind kind) {
switch (kind) {
OpenPOWER on IntegriCloud