diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-10-02 23:49:58 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-10-02 23:49:58 +0000 |
commit | af25cfaae01ecd3317608a8305200d26722fb771 (patch) | |
tree | 49f5b5a5490a71477cd78b9288055ae9a32f4c42 /clang/lib/Sema/SemaCodeComplete.cpp | |
parent | f717f3ae61394ed7d76e1c60b9d2d825196fb29b (diff) | |
download | bcm5719-llvm-af25cfaae01ecd3317608a8305200d26722fb771.tar.gz bcm5719-llvm-af25cfaae01ecd3317608a8305200d26722fb771.zip |
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.
llvm-svn: 115444
Diffstat (limited to 'clang/lib/Sema/SemaCodeComplete.cpp')
-rw-r--r-- | clang/lib/Sema/SemaCodeComplete.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaCodeComplete.cpp b/clang/lib/Sema/SemaCodeComplete.cpp index 64a96dbff7a..ae82ceb334a 100644 --- a/clang/lib/Sema/SemaCodeComplete.cpp +++ b/clang/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; } |