diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-09-20 21:25:19 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-09-20 21:25:19 +0000 |
commit | d475aad02da03c31c0e07f7ce0e26ef22bc039da (patch) | |
tree | fbc1e99fbbd4e24a116361ecbdffdd1e10d72548 /lib/Sema/SemaCodeComplete.cpp | |
parent | b05496dbd63f03bf474dae2c4d1e2142608780cc (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114358 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaCodeComplete.cpp')
-rw-r--r-- | lib/Sema/SemaCodeComplete.cpp | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/lib/Sema/SemaCodeComplete.cpp b/lib/Sema/SemaCodeComplete.cpp index b02f2dd217..86c79c7dd9 100644 --- a/lib/Sema/SemaCodeComplete.cpp +++ b/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: |