Fix a bug that warnings generated with -M or -MM flags

This is a patch for bug: https://bugs.llvm.org/show_bug.cgi?id=6817

Warnings should not be emitted with -M and -MM flags, because this mode
is only used for generate MakeFiles.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@305561 91177308-0d34-0410-b5e6-96231b3b80d8
2 files changed