[cfe-commits] r93233 - in /cfe/trunk/lib/Sema: Sema.h SemaDeclCXX.cpp SemaExprCXX.cpp SemaInit.cpp SemaOverload.cpp
John McCall
rjmccall at apple.com
Mon Jan 11 23:18:20 PST 2010
Author: rjmccall
Date: Tue Jan 12 01:18:19 2010
New Revision: 93233
URL: http://llvm.org/viewvc/llvm-project?rev=93233&view=rev
Log:
So I was sitting around, trying vainly to think of something to commit, and then
I said to myself, self, why don't you go add a couple of parameters to a method
and then fail to use them, and I thought that sounded like a pretty good idea,
so I did it.
Modified:
cfe/trunk/lib/Sema/Sema.h
cfe/trunk/lib/Sema/SemaDeclCXX.cpp
cfe/trunk/lib/Sema/SemaExprCXX.cpp
cfe/trunk/lib/Sema/SemaInit.cpp
cfe/trunk/lib/Sema/SemaOverload.cpp
Modified: cfe/trunk/lib/Sema/Sema.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/Sema.h?rev=93233&r1=93232&r2=93233&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/Sema.h (original)
+++ cfe/trunk/lib/Sema/Sema.h Tue Jan 12 01:18:19 2010
@@ -1040,6 +1040,7 @@
};
void PrintOverloadCandidates(OverloadCandidateSet& CandidateSet,
OverloadCandidateDisplayKind OCD,
+ Expr **Args, unsigned NumArgs,
const char *Opc = 0,
SourceLocation Loc = SourceLocation());
Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=93233&r1=93232&r2=93233&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Tue Jan 12 01:18:19 2010
@@ -4200,7 +4200,7 @@
else
Diag(Loc, diag::err_ovl_no_viable_function_in_init)
<< ClassType << Range;
- PrintOverloadCandidates(CandidateSet, OCD_AllCandidates);
+ PrintOverloadCandidates(CandidateSet, OCD_AllCandidates, Args, NumArgs);
return 0;
case OR_Ambiguous:
@@ -4208,7 +4208,7 @@
Diag(Loc, diag::err_ovl_ambiguous_init) << InitEntity << Range;
else
Diag(Loc, diag::err_ovl_ambiguous_init) << ClassType << Range;
- PrintOverloadCandidates(CandidateSet, OCD_ViableCandidates);
+ PrintOverloadCandidates(CandidateSet, OCD_ViableCandidates, Args, NumArgs);
return 0;
case OR_Deleted:
@@ -4223,7 +4223,7 @@
<< Best->Function->isDeleted()
<< RD->getDeclName() << Range;
}
- PrintOverloadCandidates(CandidateSet, OCD_AllCandidates);
+ PrintOverloadCandidates(CandidateSet, OCD_AllCandidates, Args, NumArgs);
return 0;
}
@@ -4547,7 +4547,7 @@
}
Diag(DeclLoc, diag::err_ref_init_ambiguous) << DeclType << Init->getType()
<< Init->getSourceRange();
- PrintOverloadCandidates(CandidateSet, OCD_ViableCandidates);
+ PrintOverloadCandidates(CandidateSet, OCD_ViableCandidates, &Init, 1);
return true;
case OR_No_Viable_Function:
Modified: cfe/trunk/lib/Sema/SemaExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprCXX.cpp?rev=93233&r1=93232&r2=93233&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExprCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExprCXX.cpp Tue Jan 12 01:18:19 2010
@@ -673,20 +673,20 @@
case OR_No_Viable_Function:
Diag(StartLoc, diag::err_ovl_no_viable_function_in_call)
<< Name << Range;
- PrintOverloadCandidates(Candidates, OCD_AllCandidates);
+ PrintOverloadCandidates(Candidates, OCD_AllCandidates, Args, NumArgs);
return true;
case OR_Ambiguous:
Diag(StartLoc, diag::err_ovl_ambiguous_call)
<< Name << Range;
- PrintOverloadCandidates(Candidates, OCD_ViableCandidates);
+ PrintOverloadCandidates(Candidates, OCD_ViableCandidates, Args, NumArgs);
return true;
case OR_Deleted:
Diag(StartLoc, diag::err_ovl_deleted_call)
<< Best->Function->isDeleted()
<< Name << Range;
- PrintOverloadCandidates(Candidates, OCD_AllCandidates);
+ PrintOverloadCandidates(Candidates, OCD_AllCandidates, Args, NumArgs);
return true;
}
assert(false && "Unreachable, bad result from BestViableFunction");
Modified: cfe/trunk/lib/Sema/SemaInit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaInit.cpp?rev=93233&r1=93232&r2=93233&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaInit.cpp (original)
+++ cfe/trunk/lib/Sema/SemaInit.cpp Tue Jan 12 01:18:19 2010
@@ -88,7 +88,7 @@
S.Diag(Init->getSourceRange().getBegin(),
diag::err_typecheck_convert_ambiguous)
<< DeclType << Init->getType() << Init->getSourceRange();
- S.PrintOverloadCandidates(CandidateSet, Sema::OCD_AllCandidates);
+ S.PrintOverloadCandidates(CandidateSet, Sema::OCD_AllCandidates, &Init, 1);
return true;
}
return false;
@@ -3015,14 +3015,16 @@
S.Diag(Loc, diag::err_temp_copy_no_viable)
<< (int)Entity.getKind() << CurInitExpr->getType()
<< CurInitExpr->getSourceRange();
- S.PrintOverloadCandidates(CandidateSet, Sema::OCD_AllCandidates);
+ S.PrintOverloadCandidates(CandidateSet, Sema::OCD_AllCandidates,
+ &CurInitExpr, 1);
return S.ExprError();
case OR_Ambiguous:
S.Diag(Loc, diag::err_temp_copy_ambiguous)
<< (int)Entity.getKind() << CurInitExpr->getType()
<< CurInitExpr->getSourceRange();
- S.PrintOverloadCandidates(CandidateSet, Sema::OCD_ViableCandidates);
+ S.PrintOverloadCandidates(CandidateSet, Sema::OCD_ViableCandidates,
+ &CurInitExpr, 1);
return S.ExprError();
case OR_Deleted:
@@ -3437,14 +3439,16 @@
<< DestType << Args[0]->getType()
<< Args[0]->getSourceRange();
- S.PrintOverloadCandidates(FailedCandidateSet, Sema::OCD_ViableCandidates);
+ S.PrintOverloadCandidates(FailedCandidateSet, Sema::OCD_ViableCandidates,
+ Args, NumArgs);
break;
case OR_No_Viable_Function:
S.Diag(Kind.getLocation(), diag::err_typecheck_nonviable_condition)
<< Args[0]->getType() << DestType.getNonReferenceType()
<< Args[0]->getSourceRange();
- S.PrintOverloadCandidates(FailedCandidateSet, Sema::OCD_AllCandidates);
+ S.PrintOverloadCandidates(FailedCandidateSet, Sema::OCD_AllCandidates,
+ Args, NumArgs);
break;
case OR_Deleted: {
@@ -3547,13 +3551,14 @@
S.Diag(Kind.getLocation(), diag::err_ovl_ambiguous_init)
<< DestType << ArgsRange;
S.PrintOverloadCandidates(FailedCandidateSet,
- Sema::OCD_ViableCandidates);
+ Sema::OCD_ViableCandidates, Args, NumArgs);
break;
case OR_No_Viable_Function:
S.Diag(Kind.getLocation(), diag::err_ovl_no_viable_function_in_init)
<< DestType << ArgsRange;
- S.PrintOverloadCandidates(FailedCandidateSet, Sema::OCD_AllCandidates);
+ S.PrintOverloadCandidates(FailedCandidateSet, Sema::OCD_AllCandidates,
+ Args, NumArgs);
break;
case OR_Deleted: {
Modified: cfe/trunk/lib/Sema/SemaOverload.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaOverload.cpp?rev=93233&r1=93232&r2=93233&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaOverload.cpp (original)
+++ cfe/trunk/lib/Sema/SemaOverload.cpp Tue Jan 12 01:18:19 2010
@@ -1631,7 +1631,7 @@
<< From->getType() << ToType << From->getSourceRange();
else
return false;
- PrintOverloadCandidates(CandidateSet, OCD_AllCandidates);
+ PrintOverloadCandidates(CandidateSet, OCD_AllCandidates, &From, 1);
return true;
}
@@ -4484,6 +4484,7 @@
void
Sema::PrintOverloadCandidates(OverloadCandidateSet& CandidateSet,
OverloadCandidateDisplayKind OCD,
+ Expr **Args, unsigned NumArgs,
const char *Opc,
SourceLocation OpLoc) {
// Sort the candidates by viability and position. Sorting directly would
@@ -5032,13 +5033,13 @@
Diag(Fn->getSourceRange().getBegin(),
diag::err_ovl_no_viable_function_in_call)
<< ULE->getName() << Fn->getSourceRange();
- PrintOverloadCandidates(CandidateSet, OCD_AllCandidates);
+ PrintOverloadCandidates(CandidateSet, OCD_AllCandidates, Args, NumArgs);
break;
case OR_Ambiguous:
Diag(Fn->getSourceRange().getBegin(), diag::err_ovl_ambiguous_call)
<< ULE->getName() << Fn->getSourceRange();
- PrintOverloadCandidates(CandidateSet, OCD_ViableCandidates);
+ PrintOverloadCandidates(CandidateSet, OCD_ViableCandidates, Args, NumArgs);
break;
case OR_Deleted:
@@ -5046,7 +5047,7 @@
<< Best->Function->isDeleted()
<< ULE->getName()
<< Fn->getSourceRange();
- PrintOverloadCandidates(CandidateSet, OCD_AllCandidates);
+ PrintOverloadCandidates(CandidateSet, OCD_AllCandidates, Args, NumArgs);
break;
}
@@ -5201,7 +5202,7 @@
Diag(OpLoc, diag::err_ovl_ambiguous_oper)
<< UnaryOperator::getOpcodeStr(Opc)
<< Input->getSourceRange();
- PrintOverloadCandidates(CandidateSet, OCD_ViableCandidates,
+ PrintOverloadCandidates(CandidateSet, OCD_ViableCandidates, Args, NumArgs,
UnaryOperator::getOpcodeStr(Opc), OpLoc);
return ExprError();
@@ -5210,7 +5211,7 @@
<< Best->Function->isDeleted()
<< UnaryOperator::getOpcodeStr(Opc)
<< Input->getSourceRange();
- PrintOverloadCandidates(CandidateSet, OCD_AllCandidates);
+ PrintOverloadCandidates(CandidateSet, OCD_AllCandidates, Args, NumArgs);
return ExprError();
}
@@ -5417,7 +5418,7 @@
assert(Result.isInvalid() &&
"C++ binary operator overloading is missing candidates!");
if (Result.isInvalid())
- PrintOverloadCandidates(CandidateSet, OCD_AllCandidates,
+ PrintOverloadCandidates(CandidateSet, OCD_AllCandidates, Args, 2,
BinaryOperator::getOpcodeStr(Opc), OpLoc);
return move(Result);
}
@@ -5426,7 +5427,7 @@
Diag(OpLoc, diag::err_ovl_ambiguous_oper)
<< BinaryOperator::getOpcodeStr(Opc)
<< Args[0]->getSourceRange() << Args[1]->getSourceRange();
- PrintOverloadCandidates(CandidateSet, OCD_ViableCandidates,
+ PrintOverloadCandidates(CandidateSet, OCD_ViableCandidates, Args, 2,
BinaryOperator::getOpcodeStr(Opc), OpLoc);
return ExprError();
@@ -5435,7 +5436,7 @@
<< Best->Function->isDeleted()
<< BinaryOperator::getOpcodeStr(Opc)
<< Args[0]->getSourceRange() << Args[1]->getSourceRange();
- PrintOverloadCandidates(CandidateSet, OCD_AllCandidates);
+ PrintOverloadCandidates(CandidateSet, OCD_AllCandidates, Args, 2);
return ExprError();
}
@@ -5545,7 +5546,7 @@
Diag(LLoc, diag::err_ovl_no_viable_subscript)
<< Args[0]->getType()
<< Args[0]->getSourceRange() << Args[1]->getSourceRange();
- PrintOverloadCandidates(CandidateSet, OCD_AllCandidates,
+ PrintOverloadCandidates(CandidateSet, OCD_AllCandidates, Args, 2,
"[]", LLoc);
return ExprError();
}
@@ -5553,7 +5554,7 @@
case OR_Ambiguous:
Diag(LLoc, diag::err_ovl_ambiguous_oper)
<< "[]" << Args[0]->getSourceRange() << Args[1]->getSourceRange();
- PrintOverloadCandidates(CandidateSet, OCD_ViableCandidates,
+ PrintOverloadCandidates(CandidateSet, OCD_ViableCandidates, Args, 2,
"[]", LLoc);
return ExprError();
@@ -5561,7 +5562,7 @@
Diag(LLoc, diag::err_ovl_deleted_oper)
<< Best->Function->isDeleted() << "[]"
<< Args[0]->getSourceRange() << Args[1]->getSourceRange();
- PrintOverloadCandidates(CandidateSet, OCD_AllCandidates,
+ PrintOverloadCandidates(CandidateSet, OCD_AllCandidates, Args, 2,
"[]", LLoc);
return ExprError();
}
@@ -5646,14 +5647,14 @@
Diag(UnresExpr->getMemberLoc(),
diag::err_ovl_no_viable_member_function_in_call)
<< DeclName << MemExprE->getSourceRange();
- PrintOverloadCandidates(CandidateSet, OCD_AllCandidates);
+ PrintOverloadCandidates(CandidateSet, OCD_AllCandidates, Args, NumArgs);
// FIXME: Leaking incoming expressions!
return ExprError();
case OR_Ambiguous:
Diag(UnresExpr->getMemberLoc(), diag::err_ovl_ambiguous_member_call)
<< DeclName << MemExprE->getSourceRange();
- PrintOverloadCandidates(CandidateSet, OCD_AllCandidates);
+ PrintOverloadCandidates(CandidateSet, OCD_AllCandidates, Args, NumArgs);
// FIXME: Leaking incoming expressions!
return ExprError();
@@ -5661,7 +5662,7 @@
Diag(UnresExpr->getMemberLoc(), diag::err_ovl_deleted_member_call)
<< Best->Function->isDeleted()
<< DeclName << MemExprE->getSourceRange();
- PrintOverloadCandidates(CandidateSet, OCD_AllCandidates);
+ PrintOverloadCandidates(CandidateSet, OCD_AllCandidates, Args, NumArgs);
// FIXME: Leaking incoming expressions!
return ExprError();
}
@@ -5809,14 +5810,14 @@
Diag(Object->getSourceRange().getBegin(),
diag::err_ovl_no_viable_object_call)
<< Object->getType() << Object->getSourceRange();
- PrintOverloadCandidates(CandidateSet, OCD_AllCandidates);
+ PrintOverloadCandidates(CandidateSet, OCD_AllCandidates, Args, NumArgs);
break;
case OR_Ambiguous:
Diag(Object->getSourceRange().getBegin(),
diag::err_ovl_ambiguous_object_call)
<< Object->getType() << Object->getSourceRange();
- PrintOverloadCandidates(CandidateSet, OCD_ViableCandidates);
+ PrintOverloadCandidates(CandidateSet, OCD_ViableCandidates, Args, NumArgs);
break;
case OR_Deleted:
@@ -5824,7 +5825,7 @@
diag::err_ovl_deleted_object_call)
<< Best->Function->isDeleted()
<< Object->getType() << Object->getSourceRange();
- PrintOverloadCandidates(CandidateSet, OCD_AllCandidates);
+ PrintOverloadCandidates(CandidateSet, OCD_AllCandidates, Args, NumArgs);
break;
}
@@ -6005,20 +6006,20 @@
else
Diag(OpLoc, diag::err_ovl_no_viable_oper)
<< "operator->" << Base->getSourceRange();
- PrintOverloadCandidates(CandidateSet, OCD_AllCandidates);
+ PrintOverloadCandidates(CandidateSet, OCD_AllCandidates, &Base, 1);
return ExprError();
case OR_Ambiguous:
Diag(OpLoc, diag::err_ovl_ambiguous_oper)
<< "->" << Base->getSourceRange();
- PrintOverloadCandidates(CandidateSet, OCD_ViableCandidates);
+ PrintOverloadCandidates(CandidateSet, OCD_ViableCandidates, &Base, 1);
return ExprError();
case OR_Deleted:
Diag(OpLoc, diag::err_ovl_deleted_oper)
<< Best->Function->isDeleted()
<< "->" << Base->getSourceRange();
- PrintOverloadCandidates(CandidateSet, OCD_AllCandidates);
+ PrintOverloadCandidates(CandidateSet, OCD_AllCandidates, &Base, 1);
return ExprError();
}
More information about the cfe-commits
mailing list