summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaCodeComplete.cpp
diff options
context:
space:
mode:
authorAlex Lorenz <arphaman@gmail.com>2017-03-13 15:43:42 +0000
committerAlex Lorenz <arphaman@gmail.com>2017-03-13 15:43:42 +0000
commit6bf4a58b511ce5a83d91836689eb47c05721cea8 (patch)
tree1f4631c99b721847235ef899a531cc29f26d915f /clang/lib/Sema/SemaCodeComplete.cpp
parent27f5ff66cc5a07a535046bc158a6844cb684422e (diff)
downloadbcm5719-llvm-6bf4a58b511ce5a83d91836689eb47c05721cea8.tar.gz
bcm5719-llvm-6bf4a58b511ce5a83d91836689eb47c05721cea8.zip
[CodeCompletion] Format block parameter placeholders in implicit property
setters using the block type information that's obtained from the property rdar://12604235 llvm-svn: 297628
Diffstat (limited to 'clang/lib/Sema/SemaCodeComplete.cpp')
-rw-r--r--clang/lib/Sema/SemaCodeComplete.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaCodeComplete.cpp b/clang/lib/Sema/SemaCodeComplete.cpp
index 9b71a3f0876..ea4a33d3f57 100644
--- a/clang/lib/Sema/SemaCodeComplete.cpp
+++ b/clang/lib/Sema/SemaCodeComplete.cpp
@@ -2288,6 +2288,15 @@ static std::string FormatFunctionParameter(const PrintingPolicy &Policy,
FunctionProtoTypeLoc BlockProto;
findTypeLocationForBlockDecl(Param->getTypeSourceInfo(), Block, BlockProto,
SuppressBlock);
+ // Try to retrieve the block type information from the property if this is a
+ // parameter in a setter.
+ if (!Block && ObjCMethodParam &&
+ cast<ObjCMethodDecl>(Param->getDeclContext())->isPropertyAccessor()) {
+ if (const auto *PD = cast<ObjCMethodDecl>(Param->getDeclContext())
+ ->findPropertyDecl(/*CheckOverrides=*/false))
+ findTypeLocationForBlockDecl(PD->getTypeSourceInfo(), Block, BlockProto,
+ SuppressBlock);
+ }
if (!Block) {
// We were unable to find a FunctionProtoTypeLoc with parameter names
OpenPOWER on IntegriCloud