summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2016-11-29 21:57:00 +0000
committerJohn McCall <rjmccall@apple.com>2016-11-29 21:57:00 +0000
commit10abbcd4f86752f5ca886d8eff16641661814e52 (patch)
treea08e4e2f73ba191ff014755f2f4aa5b0cff502db /tools
parent9322d0d47b7444e844d107f6dcf3bb3ee07287fc (diff)
getObjCEncodingForMethodDecl cannot fail. Simplify. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288203 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r--tools/libclang/CXType.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/tools/libclang/CXType.cpp b/tools/libclang/CXType.cpp
index 106fa7ed09..a07bbe0857 100644
--- a/tools/libclang/CXType.cpp
+++ b/tools/libclang/CXType.cpp
@@ -902,12 +902,11 @@ CXString clang_getDeclObjCTypeEncoding(CXCursor C) {
std::string encoding;
if (const ObjCMethodDecl *OMD = dyn_cast<ObjCMethodDecl>(D)) {
- if (Ctx.getObjCEncodingForMethodDecl(OMD, encoding))
- return cxstring::createRef("?");
+ encoding = Ctx.getObjCEncodingForMethodDecl(OMD);
} else if (const ObjCPropertyDecl *OPD = dyn_cast<ObjCPropertyDecl>(D))
- Ctx.getObjCEncodingForPropertyDecl(OPD, nullptr, encoding);
+ encoding = Ctx.getObjCEncodingForPropertyDecl(OPD, nullptr);
else if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(D))
- Ctx.getObjCEncodingForFunctionDecl(FD, encoding);
+ encoding = Ctx.getObjCEncodingForFunctionDecl(FD);
else {
QualType Ty;
if (const TypeDecl *TD = dyn_cast<TypeDecl>(D))