From 402bf98b0886a900708ddef0ff47f28abf525e70 Mon Sep 17 00:00:00 2001 From: Fadi Hanna Date: Thu, 16 May 2019 07:19:31 -0700 Subject: [PATCH] Suppress crossgen warnings on failures to load types/methods from IBC data. (dotnet/coreclr#24596) It's not unusual to see these types of warnings with incremental IBC. These warnings will move under the crossgen verbose mode. Commit migrated from https://github.com/dotnet/coreclr/commit/ff61bfc8aa9f0f71feddc8c03d824b13cc61215c --- src/coreclr/src/vm/ceeload.cpp | 8 ++++++-- src/coreclr/src/zap/zapimage.cpp | 4 ++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/coreclr/src/vm/ceeload.cpp b/src/coreclr/src/vm/ceeload.cpp index 1541ccf..e389df9 100644 --- a/src/coreclr/src/vm/ceeload.cpp +++ b/src/coreclr/src/vm/ceeload.cpp @@ -7179,7 +7179,9 @@ TypeHandle Module::LoadIBCTypeHelper(DataImage *image, CORBBTPROF_BLOB_PARAM_SIG } EX_CATCH { - image->GetPreloader()->Error(pBlobSigEntry->blob.token, GET_EXCEPTION()); + if (g_CorCompileVerboseLevel >= CORCOMPILE_VERBOSE) + image->GetPreloader()->Error(pBlobSigEntry->blob.token, GET_EXCEPTION()); + loadedType = TypeHandle(); } EX_END_CATCH(SwallowAllExceptions) @@ -7236,7 +7238,9 @@ MethodDesc* Module::LoadIBCMethodHelper(DataImage *image, CORBBTPROF_BLOB_PARAM_ } EX_CATCH { - image->GetPreloader()->Error(pBlobSigEntry->blob.token, GET_EXCEPTION()); + if (g_CorCompileVerboseLevel >= CORCOMPILE_VERBOSE) + image->GetPreloader()->Error(pBlobSigEntry->blob.token, GET_EXCEPTION()); + enclosingType = TypeHandle(); } EX_END_CATCH(SwallowAllExceptions) diff --git a/src/coreclr/src/zap/zapimage.cpp b/src/coreclr/src/zap/zapimage.cpp index a70b710..e64c0b6 100644 --- a/src/coreclr/src/zap/zapimage.cpp +++ b/src/coreclr/src/zap/zapimage.cpp @@ -3573,6 +3573,10 @@ void ZapImage::Error(mdToken token, HRESULT hr, UINT resID, LPCWSTR message) if ((resID == IDS_IBC_MISSING_EXTERNAL_TYPE) || (resID == IDS_IBC_MISSING_EXTERNAL_METHOD)) { + // Suppress printing IBC related warnings except in verbose mode. + if (m_zapper->m_pOpt->m_ignoreErrors && !m_zapper->m_pOpt->m_verbose) + return; + // Supress printing of "The generic type/method specified by the IBC data is not available to this assembly" level = CORZAP_LOGLEVEL_INFO; } -- 2.7.4