diff options
author | Derek Schuff <dschuff@chromium.org> | 2012-09-19 09:43:58 -0700 |
---|---|---|
committer | Derek Schuff <dschuff@chromium.org> | 2012-09-19 09:43:58 -0700 |
commit | 5e79ec1d7ada2e14283e2b69b6f4375eb4dd1890 (patch) | |
tree | 5e68e4f01407991a33b4afc44e47c94181ed7135 /lib/Transforms | |
parent | 09ec8c048e4d64e2ac69531f736838f69bdc7fda (diff) |
Don't emit useless warning when dropping arguments from main
Arguments are always dropped from main because it is called with 3 arguments
but usually declared with 0 or 2.
However keep emitting the useless warning for other functions since this isn't
usually expected.
R=jvoung@chromium.org
BUG= http://code.google.com/p/nativeclient/issues/detail?id=709
Review URL: https://codereview.chromium.org/10950030
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/InstCombine/InstCombineCalls.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Transforms/InstCombine/InstCombineCalls.cpp b/lib/Transforms/InstCombine/InstCombineCalls.cpp index b12fc01357..e7f3b21b15 100644 --- a/lib/Transforms/InstCombine/InstCombineCalls.cpp +++ b/lib/Transforms/InstCombine/InstCombineCalls.cpp @@ -1148,8 +1148,10 @@ bool InstCombiner::transformConstExprCastCall(CallSite CS) { // If we are removing arguments to the function, emit an obnoxious warning. if (FT->getNumParams() < NumActualArgs) { if (!FT->isVarArg()) { - errs() << "WARNING: While resolving call to function '" - << Callee->getName() << "' arguments were dropped!\n"; + if (Callee->getName() != "main") { // @LOCALMOD + errs() << "WARNING: While resolving call to function '" + << Callee->getName() << "' arguments were dropped!\n"; + } } else { // Add all of the arguments in their promoted form to the arg list. for (unsigned i = FT->getNumParams(); i != NumActualArgs; ++i, ++AI) { |