Only allow exact matches for function overload resolution for builtins.
The intent is that the code in stdlib.ispc that is calling out to the built-ins should match argument types exactly (using explicit casts as needed), just for maximal clarity/safety.
This commit is contained in:
7
expr.h
7
expr.h
@@ -265,7 +265,7 @@ public:
|
||||
bool isLaunch;
|
||||
|
||||
private:
|
||||
void resolveFunctionOverloads();
|
||||
void resolveFunctionOverloads(bool exactMatchOnly);
|
||||
bool tryResolve(bool (*matchFunc)(Expr *, const Type *));
|
||||
};
|
||||
|
||||
@@ -567,7 +567,7 @@ private:
|
||||
*/
|
||||
class FunctionSymbolExpr : public Expr {
|
||||
public:
|
||||
FunctionSymbolExpr(std::vector<Symbol *> *candidateFunctions,
|
||||
FunctionSymbolExpr(const char *name, std::vector<Symbol *> *candidateFunctions,
|
||||
SourcePos pos);
|
||||
|
||||
llvm::Value *GetValue(FunctionEmitContext *ctx) const;
|
||||
@@ -581,6 +581,9 @@ public:
|
||||
private:
|
||||
friend class FunctionCallExpr;
|
||||
|
||||
/** Name of the function that is being called. */
|
||||
std::string name;
|
||||
|
||||
/** All of the functions with the name given in the function call;
|
||||
there may be more then one, in which case we need to resolve which
|
||||
overload is the best match. */
|
||||
|
||||
Reference in New Issue
Block a user