diff options
author | Alon Zakai <alonzakai@gmail.com> | 2014-03-31 18:08:48 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2014-03-31 18:08:48 -0700 |
commit | e649b2938620c8f9767e2d89d9613b9ab9b6299b (patch) | |
tree | 59da81bbdbc2c96f6e22776172c4a373110f666f /lib | |
parent | 51b055a4088f6528aba09a2e91b88172ce6bef51 (diff) |
suppress args warnings when the number is forced anyhow
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Target/JSBackend/CallHandlers.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/Target/JSBackend/CallHandlers.h b/lib/Target/JSBackend/CallHandlers.h index 35ceb351af..6238251637 100644 --- a/lib/Target/JSBackend/CallHandlers.h +++ b/lib/Target/JSBackend/CallHandlers.h @@ -59,8 +59,10 @@ DEF_CALL_HANDLER(__default__, { } } - if (NumArgs == -1) NumArgs = getNumArgOperands(CI); - if (!FT->isVarArg()) { + bool ForcedNumArgs = NumArgs != -1; + if (!ForcedNumArgs) NumArgs = getNumArgOperands(CI); + + if (!FT->isVarArg() && !ForcedNumArgs) { int TypeNumArgs = FT->getNumParams(); if (TypeNumArgs != NumArgs) { if (EmscriptenAssertions) prettyWarning() << "unexpected number of arguments " << utostr(NumArgs) << " in call to '" << F->getName() << "', should be " << utostr(TypeNumArgs) << "\n"; @@ -1052,12 +1054,11 @@ std::string handleCall(const Instruction *CI) { // we don't need to use a function index. const std::string &Name = isa<Function>(CV) ? getJSName(CV) : getValueAsStr(CV); - unsigned NumArgs = getNumArgOperands(CI); CallHandlerMap::iterator CH = CallHandlers.find("___default__"); if (isa<Function>(CV)) { CallHandlerMap::iterator Custom = CallHandlers.find(Name); if (Custom != CallHandlers.end()) CH = Custom; } - return (this->*(CH->second))(CI, Name, NumArgs); + return (this->*(CH->second))(CI, Name, -1); } |