summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaCodeComplete.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-09-20 21:25:19 +0000
committerDouglas Gregor <dgregor@apple.com>2010-09-20 21:25:19 +0000
commitdb5c09a8cde4cd654335d96f6ce992cae7ee846e (patch)
tree6660caa1667204cc16f582b3efb6ab5625403c20 /clang/lib/Sema/SemaCodeComplete.cpp
parent9dcf58a546d2ada73c3991a646d4662a56cdeaf3 (diff)
downloadbcm5719-llvm-db5c09a8cde4cd654335d96f6ce992cae7ee846e.tar.gz
bcm5719-llvm-db5c09a8cde4cd654335d96f6ce992cae7ee846e.zip
Get rid of the lame attempt to prioritize "void" functions at
statement context; it really isn't helpful in practice (remember printf!) and we'll be doing other adjustments for statements very soon. llvm-svn: 114358
Diffstat (limited to 'clang/lib/Sema/SemaCodeComplete.cpp')
-rw-r--r--clang/lib/Sema/SemaCodeComplete.cpp15
1 files changed, 3 insertions, 12 deletions
diff --git a/clang/lib/Sema/SemaCodeComplete.cpp b/clang/lib/Sema/SemaCodeComplete.cpp
index b02f2dd217f..86c79c7dd9c 100644
--- a/clang/lib/Sema/SemaCodeComplete.cpp
+++ b/clang/lib/Sema/SemaCodeComplete.cpp
@@ -625,12 +625,9 @@ void ResultBuilder::AdjustResultPriorityForPreferredType(Result &R) {
CanQualType TC = SemaRef.Context.getCanonicalType(T);
// Check for exactly-matching types (modulo qualifiers).
- if (SemaRef.Context.hasSameUnqualifiedType(PreferredType, TC)) {
- if (PreferredType->isVoidType())
- R.Priority += CCD_VoidMatch;
- else
- R.Priority /= CCF_ExactTypeMatch;
- } // Check for nearly-matching types, based on classification of each.
+ if (SemaRef.Context.hasSameUnqualifiedType(PreferredType, TC))
+ R.Priority /= CCF_ExactTypeMatch;
+ // Check for nearly-matching types, based on classification of each.
else if ((getSimplifiedTypeClass(PreferredType)
== getSimplifiedTypeClass(TC)) &&
!(PreferredType->isEnumeralType() && TC->isEnumeralType()))
@@ -2571,12 +2568,6 @@ void Sema::CodeCompleteOrdinaryName(Scope *S,
break;
case PCC_Statement:
- // For statements that are expressions, we prefer to call 'void' functions
- // rather than functions that return a result, since then the result would
- // be ignored.
- Results.setPreferredType(Context.VoidTy);
- // Fall through
-
case PCC_ParenthesizedExpression:
case PCC_Expression:
case PCC_ForInit:
OpenPOWER on IntegriCloud