// Returns ZapImage
virtual ZapImage * GetZapImage() = 0;
- // Reports an error during preloading. Return the error code to propagate,
- // or S_OK to ignore the error
- virtual void Error(mdToken token, HRESULT hr, LPCWSTR description) = 0;
+ // Report an error during preloading:
+ // 'token' is the metadata token that triggered the error
+ // hr is the HRESULT from the thrown Exception, or S_OK if we don't have an thrown exception
+ // resID is the resourceID with additional information from the thrown Exception, or 0
+ //
+ virtual void Error(mdToken token, HRESULT hr, UINT _resID, LPCWSTR description) = 0;
};
{
STANDARD_VM_CONTRACT;
+ HRESULT hr = pException->GetHR();
+ UINT resID = 0;
+
StackSString msg;
#ifdef CROSSGEN_COMPILE
pException->GetMessage(msg);
+
+ // Do we have an EEException with a resID?
+ if (EEMessageException::IsEEMessageException(pException))
+ {
+ EEMessageException * pEEMessageException = (EEMessageException *) pException;
+ resID = pEEMessageException->GetResID();
+ }
#else
{
GCX_COOP();
}
#endif
- m_pData->Error(token, pException->GetHR(), msg.GetUnicode());
+ m_pData->Error(token, hr, resID, msg.GetUnicode());
}
CEEInfo *g_pCEEInfo = NULL;
{
mdMethodDef token;
pImage->GetCompileInfo()->GetMethodDef(GetHandle(), &token);
- pImage->Error(token, S_OK, W("MapMethodEntryPoint failed"));
+ pImage->Error(token, S_OK, 0, W("MapMethodEntryPoint failed"));
}
else
#endif
fileNotFoundErrorsTable.Append(message);
}
-void ZapImage::Error(mdToken token, HRESULT hr, LPCWSTR message)
+void ZapImage::Error(mdToken token, HRESULT hr, UINT resID, LPCWSTR message)
{
// Missing dependencies are reported as fatal errors in code:CompilationDomain::BindAssemblySpec.
// Avoid printing redundant error message for them.
CorZapLogLevel level = CORZAP_LOGLEVEL_ERROR;
+ // Some warnings are demoted to informational level
+ if (resID == IDS_EE_SIMD_NGEN_DISALLOWED)
+ {
+ // Supress printing of "Target-dependent SIMD vector types may not be used with ngen."
+ level = CORZAP_LOGLEVEL_INFO;
+ }
+
if (m_zapper->m_pOpt->m_ignoreErrors)
{
#ifdef CROSSGEN_COMPILE
// Warnings should not go to stderr during crossgen
if (level == CORZAP_LOGLEVEL_ERROR)
+ {
level = CORZAP_LOGLEVEL_WARNING;
+ }
#endif
m_zapper->Print(level, W("Warning: "));
}
// Returns ZapImage
virtual ZapImage * GetZapImage();
- void Error(mdToken token, HRESULT error, LPCWSTR message);
+ void Error(mdToken token, HRESULT error, UINT resID, LPCWSTR message);
// Returns virtual section for EE datastructures
ZapVirtualSection * GetSection(CorCompileSection section)