diff options
author | fadimounir <fadim@microsoft.com> | 2019-06-12 15:05:56 -0700 |
---|---|---|
committer | fadimounir <fadim@microsoft.com> | 2019-06-13 10:31:34 -0700 |
commit | 27c76ae6df4b117ee10668b0b0b5fef43c4e0d38 (patch) | |
tree | 255ddaaf56ecf658e1bf2bf7cdeb6ca4a13d2c06 /src/tools | |
parent | f1ca8ad423a244f8f429fe715cdd3c6228302e32 (diff) | |
download | coreclr-27c76ae6df4b117ee10668b0b0b5fef43c4e0d38.tar.gz coreclr-27c76ae6df4b117ee10668b0b0b5fef43c4e0d38.tar.bz2 coreclr-27c76ae6df4b117ee10668b0b0b5fef43c4e0d38.zip |
Add a switch to suppress crossgen warnings
Diffstat (limited to 'src/tools')
-rw-r--r-- | src/tools/crossgen/crossgen.cpp | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/src/tools/crossgen/crossgen.cpp b/src/tools/crossgen/crossgen.cpp index cf6f4c7c6a..39d91a1728 100644 --- a/src/tools/crossgen/crossgen.cpp +++ b/src/tools/crossgen/crossgen.cpp @@ -108,6 +108,7 @@ void PrintUsageHelper() W("\n") W(" /? or /help - Display this screen\n") W(" /nologo - Prevents displaying the logo\n") + W(" /nowarnings - Prevents displaying warning messages\n") W(" /silent - Do not display completion message\n") W(" /verbose - Display verbose information\n") W(" @response.rsp - Process command line arguments from specified\n") @@ -178,6 +179,7 @@ void PrintUsageHelper() class CrossgenLogger : public ICorSvcLogger { +public: STDMETHODIMP_(ULONG) AddRef() {return E_NOTIMPL;} STDMETHODIMP_(ULONG) Release() {return E_NOTIMPL;} STDMETHODIMP QueryInterface(REFIID riid,void ** ppv) @@ -205,10 +207,20 @@ class CrossgenLogger : public ICorSvcLogger { if (logLevel == LogLevel_Error) OutputErr(message); - else + else if(logLevel != LogLevel_Warning || m_bEnableWarningLogging) Output(message); return S_OK; } + + void SetWarningLogging(bool value) + { + m_bEnableWarningLogging = value; + } + + CrossgenLogger() : m_bEnableWarningLogging(true) { } + +private: + bool m_bEnableWarningLogging; }; CrossgenLogger g_CrossgenLogger; @@ -489,6 +501,10 @@ int _cdecl wmain(int argc, __in_ecount(argc) WCHAR **argv) { dwFlags |= NGENWORKER_FLAGS_VERBOSE; } + else if (MatchParameter(*argv, W("nowarnings"))) + { + dwFlags |= NGENWORKER_FLAGS_SUPPRESS_WARNINGS; + } else if (MatchParameter(*argv, W("Tuning"))) { dwFlags |= NGENWORKER_FLAGS_TUNING; @@ -891,6 +907,12 @@ int _cdecl wmain(int argc, __in_ecount(argc) WCHAR **argv) } + // Verbose mode will always print warnings + if ((dwFlags & NGENWORKER_FLAGS_VERBOSE) != 0) + dwFlags &= ~NGENWORKER_FLAGS_SUPPRESS_WARNINGS; + + g_CrossgenLogger.SetWarningLogging((dwFlags & NGENWORKER_FLAGS_SUPPRESS_WARNINGS) == 0); + // Initialize the logger SetSvcLogger(&g_CrossgenLogger); |