diff options
| author | Douglas Gregor <dgregor@apple.com> | 2008-11-26 06:01:48 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2008-11-26 06:01:48 +0000 |
| commit | a60a6914ccdcd83987e17445e5076556e88af10e (patch) | |
| tree | 0425289148f9255d40e9b50442bd4ea4125f4ccc /clang/lib/Sema/SemaOverload.cpp | |
| parent | 99dcbff1542f37a17952cd34d9c8ef022e28663a (diff) | |
| download | bcm5719-llvm-a60a6914ccdcd83987e17445e5076556e88af10e.tar.gz bcm5719-llvm-a60a6914ccdcd83987e17445e5076556e88af10e.zip | |
Tweak the new ResolveOverloadedCallFn to just return a FunctionDecl. It makes ActOnCallExpr simpler
llvm-svn: 60094
Diffstat (limited to 'clang/lib/Sema/SemaOverload.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaOverload.cpp | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp index 14e0f44c878..c6b028456fe 100644 --- a/clang/lib/Sema/SemaOverload.cpp +++ b/clang/lib/Sema/SemaOverload.cpp @@ -2967,24 +2967,20 @@ Sema::ResolveAddressOfOverloadedFunction(Expr *From, QualType ToType, /// (which eventually refers to the set of overloaded functions in /// Ovl) and the call arguments Args/NumArgs, attempt to resolve the /// function call down to a specific function. If overload resolution -/// succeeds, returns an expression that refers to a specific function -/// and deletes Fn. Otherwise, emits diagnostics, deletes all of the +/// succeeds, returns the function declaration produced by overload +/// resolution. Otherwise, emits diagnostics, deletes all of the /// arguments and Fn, and returns NULL. -Expr *Sema::ResolveOverloadedCallFn(Expr *Fn, OverloadedFunctionDecl *Ovl, - SourceLocation LParenLoc, - Expr **Args, unsigned NumArgs, - SourceLocation *CommaLocs, - SourceLocation RParenLoc) { +FunctionDecl *Sema::ResolveOverloadedCallFn(Expr *Fn, OverloadedFunctionDecl *Ovl, + SourceLocation LParenLoc, + Expr **Args, unsigned NumArgs, + SourceLocation *CommaLocs, + SourceLocation RParenLoc) { OverloadCandidateSet CandidateSet; AddOverloadCandidates(Ovl, Args, NumArgs, CandidateSet); OverloadCandidateSet::iterator Best; switch (BestViableFunction(CandidateSet, Best)) { - case OR_Success: { - Expr *NewFn = new DeclRefExpr(Best->Function, Best->Function->getType(), - Fn->getSourceRange().getBegin()); - Fn->Destroy(Context); - return NewFn; - } + case OR_Success: + return Best->Function; case OR_No_Viable_Function: Diag(Fn->getSourceRange().getBegin(), |

