Generate warnings properly for multi-file compiles.

BUG=5367019

Slang (llvm-rs-cc) was clobbering warnings during multi-file compilation
because they are not part of the error count. When the diagnostics get reset,
we should be dumping whichever non-error (i.e. warning) diagnostics we have
accumulated. During investigation, I also found then that our dependency
generation path can cause duplicate warnings to be added to the diagnostic
client. Thus, to fix this bug, the change need dumps relevant diagnostics, but
then suppresses warnings if we are compiling the same file multiple times
(once for code generation and once for dependencies).

Change-Id: I4b94e962f93b96f31ff7e7d6cce45418fe39e1d1
8 files changed