aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaCodeComplete.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-10-02 23:49:58 +0000
committerDouglas Gregor <dgregor@apple.com>2010-10-02 23:49:58 +0000
commitc2760bc8e99510c4b3848fcd21323afd711ee269 (patch)
tree68b6c8014d28bdba80170d52cf04dd52b4b16a37 /lib/Sema/SemaCodeComplete.cpp
parent358559d8d7b458c5f64941842383a16e61f0828d (diff)
When providing a block literal as a code completion for a
function/method argument, include the parameter name and always include parentheses (even for zero-parameter blocks). Otherwise, the block literal placeholder '^' can look very weird. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115444 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaCodeComplete.cpp')
-rw-r--r--lib/Sema/SemaCodeComplete.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Sema/SemaCodeComplete.cpp b/lib/Sema/SemaCodeComplete.cpp
index 64a96dbff7..ae82ceb334 100644
--- a/lib/Sema/SemaCodeComplete.cpp
+++ b/lib/Sema/SemaCodeComplete.cpp
@@ -1910,6 +1910,8 @@ static std::string FormatFunctionParameter(ASTContext &Context,
if (Block->getNumArgs() == 0) {
if (Block->getTypePtr()->isVariadic())
Result += "(...)";
+ else
+ Result += "(void)";
} else {
Result += "(";
for (unsigned I = 0, N = Block->getNumArgs(); I != N; ++I) {
@@ -1923,6 +1925,9 @@ static std::string FormatFunctionParameter(ASTContext &Context,
Result += ")";
}
+ if (Param->getIdentifier())
+ Result += Param->getIdentifier()->getName();
+
return Result;
}