summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Chen (CLR) <jochen@microsoft.com>2015-04-29 13:13:30 -0700
committerJohn Chen (CLR) <jochen@microsoft.com>2015-04-29 14:45:36 -0700
commit6058c71910eed8afd1ff57e4c51c9ad4ce623973 (patch)
tree3dc18b20c1a1a9de48ef8773158b61df7808b0c1
parent9579c444040a9fa9780b299cd536cb8ca1b8eaff (diff)
downloadcoreclr-6058c71910eed8afd1ff57e4c51c9ad4ce623973.tar.gz
coreclr-6058c71910eed8afd1ff57e4c51c9ad4ce623973.tar.bz2
coreclr-6058c71910eed8afd1ff57e4c51c9ad4ce623973.zip
Fix warnings introduced by crossgen
-rw-r--r--src/binder/assemblybinder.cpp2
-rw-r--r--src/pal/src/misc/msgbox.cpp3
-rw-r--r--src/vm/appdomain.cpp2
-rw-r--r--src/vm/ceemain.cpp4
-rw-r--r--src/vm/clrex.cpp98
-rw-r--r--src/vm/comdelegate.cpp50
-rw-r--r--src/vm/compile.cpp2
-rw-r--r--src/vm/dataimage.cpp2
-rw-r--r--src/zap/zapcode.cpp10
-rw-r--r--src/zap/zapimage.cpp6
-rw-r--r--src/zap/zapper.cpp6
11 files changed, 97 insertions, 88 deletions
diff --git a/src/binder/assemblybinder.cpp b/src/binder/assemblybinder.cpp
index 89a3c0fb3f..0ac084344a 100644
--- a/src/binder/assemblybinder.cpp
+++ b/src/binder/assemblybinder.cpp
@@ -443,6 +443,7 @@ namespace BINDER_SPACE
}
#endif // FEATURE_VERSIONING_LOG
+#ifndef CROSSGEN_COMPILE
HRESULT CreateImageAssembly(IMDInternalImport *pIMetaDataAssemblyImport,
PEKIND PeKind,
PEImage *pPEImage,
@@ -469,6 +470,7 @@ namespace BINDER_SPACE
Exit:
return hr;
}
+#endif // !CROSSGEN_COMPILE
};
/* static */
diff --git a/src/pal/src/misc/msgbox.cpp b/src/pal/src/misc/msgbox.cpp
index a06d53bc40..0d00115f14 100644
--- a/src/pal/src/misc/msgbox.cpp
+++ b/src/pal/src/misc/msgbox.cpp
@@ -224,7 +224,6 @@ MessageBoxA(
IN LPCSTR lpCaption,
IN UINT uType)
{
- INT len = 0;
INT rc = 0;
PERF_ENTRY(MessageBoxA);
@@ -411,7 +410,7 @@ MessageBoxA(
#endif // __APPLE__ else
PALCLeaveCriticalSection( &msgbox_critsec);
-error:
+
LOGEXIT("MessageBoxA returns %d\n", rc);
PERF_EXIT(MessageBoxA);
return rc;
diff --git a/src/vm/appdomain.cpp b/src/vm/appdomain.cpp
index 64bd4410bf..62b07478b0 100644
--- a/src/vm/appdomain.cpp
+++ b/src/vm/appdomain.cpp
@@ -6960,6 +6960,7 @@ struct LoadFileArgs
DomainFile *result;
};
+#ifndef CROSSGEN_COMPILE
static void LoadDomainFile_Wrapper(void *ptr)
{
WRAPPER_NO_CONTRACT;
@@ -6968,6 +6969,7 @@ static void LoadDomainFile_Wrapper(void *ptr)
LoadFileArgs *args = (LoadFileArgs *) ptr;
args->result = GetAppDomain()->LoadDomainFile(args->pLock, args->targetLevel);
}
+#endif // !CROSSGEN_COMPILE
DomainFile *AppDomain::LoadDomainFile(FileLoadLock *pLock, FileLoadLevel targetLevel)
{
diff --git a/src/vm/ceemain.cpp b/src/vm/ceemain.cpp
index ecac60aa0e..e6eff9bf14 100644
--- a/src/vm/ceemain.cpp
+++ b/src/vm/ceemain.cpp
@@ -262,9 +262,11 @@ static void PublishIPCManager(void);
static void TerminateIPCManager(void);
#endif // FEATURE_IPCMAN
+#ifndef CROSSGEN_COMPILE
static int GetThreadUICultureId(__out LocaleIDValue* pLocale); // TODO: This shouldn't use the LCID. We should rely on name instead
static HRESULT GetThreadUICultureNames(__inout StringArrayList* pCultureNames);
+#endif // !CROSSGEN_COMPILE
HRESULT EEStartup(COINITIEE fFlags);
#ifdef FEATURE_FUSION
@@ -286,6 +288,7 @@ BOOL STDMETHODCALLTYPE ExecuteDLL(HINSTANCE hInst,
BOOL STDMETHODCALLTYPE ExecuteEXE(HMODULE hMod);
BOOL STDMETHODCALLTYPE ExecuteEXE(__in LPWSTR pImageNameIn);
+#ifndef CROSSGEN_COMPILE
static void InitializeGarbageCollector();
#ifdef DEBUGGING_SUPPORTED
@@ -293,6 +296,7 @@ static void InitializeDebugger(void);
static void TerminateDebugger(void);
extern "C" HRESULT __cdecl CorDBGetInterface(DebugInterface** rcInterface);
#endif // DEBUGGING_SUPPORTED
+#endif // !CROSSGEN_COMPILE
#if !defined(FEATURE_CORECLR) && !defined(CROSSGEN_COMPILE)
diff --git a/src/vm/clrex.cpp b/src/vm/clrex.cpp
index 24ca7f05f1..cdf4eb8cc6 100644
--- a/src/vm/clrex.cpp
+++ b/src/vm/clrex.cpp
@@ -1363,55 +1363,6 @@ BOOL EEResourceException::GetThrowableMessage(SString &result)
}
// ---------------------------------------------------------------------------
-// EEComException methods
-// ---------------------------------------------------------------------------
-
-static HRESULT Undefer(EXCEPINFO *pExcepInfo)
-{
- CONTRACTL
- {
- GC_NOTRIGGER;
- NOTHROW;
- MODE_ANY;
- }
- CONTRACTL_END;
-
- if (pExcepInfo->pfnDeferredFillIn)
- {
- EXCEPINFO FilledInExcepInfo;
-
- HRESULT hr = pExcepInfo->pfnDeferredFillIn(&FilledInExcepInfo);
- if (SUCCEEDED(hr))
- {
- // Free the strings in the original EXCEPINFO.
- if (pExcepInfo->bstrDescription)
- {
- SysFreeString(pExcepInfo->bstrDescription);
- pExcepInfo->bstrDescription = NULL;
- }
- if (pExcepInfo->bstrSource)
- {
- SysFreeString(pExcepInfo->bstrSource);
- pExcepInfo->bstrSource = NULL;
- }
- if (pExcepInfo->bstrHelpFile)
- {
- SysFreeString(pExcepInfo->bstrHelpFile);
- pExcepInfo->bstrHelpFile = NULL;
- }
-
- // Fill in the new data
- *pExcepInfo = FilledInExcepInfo;
- }
- }
-
- if (pExcepInfo->scode != 0)
- return pExcepInfo->scode;
- else
- return (HRESULT)pExcepInfo->wCode;
-}
-
-// ---------------------------------------------------------------------------
// EEFieldException is an EE exception subclass composed of a field
// ---------------------------------------------------------------------------
@@ -2179,6 +2130,55 @@ void DECLSPEC_NORETURN EEFileLoadException::Throw(PEAssembly *parent,
}
#ifndef CROSSGEN_COMPILE
+// ---------------------------------------------------------------------------
+// EEComException methods
+// ---------------------------------------------------------------------------
+
+static HRESULT Undefer(EXCEPINFO *pExcepInfo)
+{
+ CONTRACTL
+ {
+ GC_NOTRIGGER;
+ NOTHROW;
+ MODE_ANY;
+ }
+ CONTRACTL_END;
+
+ if (pExcepInfo->pfnDeferredFillIn)
+ {
+ EXCEPINFO FilledInExcepInfo;
+
+ HRESULT hr = pExcepInfo->pfnDeferredFillIn(&FilledInExcepInfo);
+ if (SUCCEEDED(hr))
+ {
+ // Free the strings in the original EXCEPINFO.
+ if (pExcepInfo->bstrDescription)
+ {
+ SysFreeString(pExcepInfo->bstrDescription);
+ pExcepInfo->bstrDescription = NULL;
+ }
+ if (pExcepInfo->bstrSource)
+ {
+ SysFreeString(pExcepInfo->bstrSource);
+ pExcepInfo->bstrSource = NULL;
+ }
+ if (pExcepInfo->bstrHelpFile)
+ {
+ SysFreeString(pExcepInfo->bstrHelpFile);
+ pExcepInfo->bstrHelpFile = NULL;
+ }
+
+ // Fill in the new data
+ *pExcepInfo = FilledInExcepInfo;
+ }
+ }
+
+ if (pExcepInfo->scode != 0)
+ return pExcepInfo->scode;
+ else
+ return (HRESULT)pExcepInfo->wCode;
+}
+
EECOMException::EECOMException(EXCEPINFO *pExcepInfo)
: EEException(GetKindFromHR(Undefer(pExcepInfo)))
{
diff --git a/src/vm/comdelegate.cpp b/src/vm/comdelegate.cpp
index f461931f0e..193f6f4786 100644
--- a/src/vm/comdelegate.cpp
+++ b/src/vm/comdelegate.cpp
@@ -38,31 +38,6 @@
#ifndef DACCESS_COMPILE
-static PCODE GetVirtualCallStub(MethodDesc *method, TypeHandle scopeType)
-{
- CONTRACTL
- {
- THROWS;
- GC_TRIGGERS;
- MODE_ANY;
- INJECT_FAULT(COMPlusThrowOM()); // from MetaSig::SizeOfArgStack
- }
- CONTRACTL_END;
-
- //TODO: depending on what we decide for generics method we may want to move this check to better places
- if (method->IsGenericMethodDefinition() || method->HasMethodInstantiation())
- {
- COMPlusThrow(kNotSupportedException);
- }
-
- // need to grab a virtual dispatch stub
- // method can be on a canonical MethodTable, we need to allocate the stub on the loader allocator associated with the exact type instantiation.
- VirtualCallStubManager *pVirtualStubManager = scopeType.GetMethodTable()->GetLoaderAllocator()->GetVirtualCallStubManager();
- PCODE pTargetCall = pVirtualStubManager->GetCallStub(scopeType, method);
- _ASSERTE(pTargetCall);
- return pTargetCall;
-}
-
#if defined(_TARGET_AMD64_) && !defined(UNIX_AMD64_ABI)
// ShuffleOfs not needed
@@ -498,6 +473,31 @@ Stub* COMDelegate::SetupShuffleThunk(MethodTable * pDelMT, MethodDesc *pTargetMe
#ifndef CROSSGEN_COMPILE
+static PCODE GetVirtualCallStub(MethodDesc *method, TypeHandle scopeType)
+{
+ CONTRACTL
+ {
+ THROWS;
+ GC_TRIGGERS;
+ MODE_ANY;
+ INJECT_FAULT(COMPlusThrowOM()); // from MetaSig::SizeOfArgStack
+ }
+ CONTRACTL_END;
+
+ //TODO: depending on what we decide for generics method we may want to move this check to better places
+ if (method->IsGenericMethodDefinition() || method->HasMethodInstantiation())
+ {
+ COMPlusThrow(kNotSupportedException);
+ }
+
+ // need to grab a virtual dispatch stub
+ // method can be on a canonical MethodTable, we need to allocate the stub on the loader allocator associated with the exact type instantiation.
+ VirtualCallStubManager *pVirtualStubManager = scopeType.GetMethodTable()->GetLoaderAllocator()->GetVirtualCallStubManager();
+ PCODE pTargetCall = pVirtualStubManager->GetCallStub(scopeType, method);
+ _ASSERTE(pTargetCall);
+ return pTargetCall;
+}
+
FCIMPL5(FC_BOOL_RET, COMDelegate::BindToMethodName,
Object *refThisUNSAFE,
Object *targetUNSAFE,
diff --git a/src/vm/compile.cpp b/src/vm/compile.cpp
index 86e28c450b..7d7892b3c7 100644
--- a/src/vm/compile.cpp
+++ b/src/vm/compile.cpp
@@ -6137,6 +6137,7 @@ void CEEPreloader::TriageTypeFromSoftBoundModule(TypeHandle th, Module * pSoftBo
}
}
+#ifdef FEATURE_FULL_NGEN
static TypeHandle TryToLoadTypeSpecHelper(Module * pModule, PCCOR_SIGNATURE pSig, ULONG cSig)
{
STANDARD_VM_CONTRACT;
@@ -6158,7 +6159,6 @@ static TypeHandle TryToLoadTypeSpecHelper(Module * pModule, PCCOR_SIGNATURE pSig
return th;
}
-#ifdef FEATURE_FULL_NGEN
void CEEPreloader::TriageTypeSpecsFromSoftBoundModule(Module * pSoftBoundModule)
{
STANDARD_VM_CONTRACT;
diff --git a/src/vm/dataimage.cpp b/src/vm/dataimage.cpp
index 946ffaf91e..6fd9744b9b 100644
--- a/src/vm/dataimage.cpp
+++ b/src/vm/dataimage.cpp
@@ -707,7 +707,7 @@ FORCEINLINE static CorCompileSection GetSectionForNodeType(ZapNodeType type)
{
LIMITED_METHOD_CONTRACT;
- switch (type)
+ switch ((int)type)
{
// SECTION_MODULE
case NodeTypeForItemKind(DataImage::ITEM_MODULE):
diff --git a/src/zap/zapcode.cpp b/src/zap/zapcode.cpp
index b342ce0e2c..e7fd69b01c 100644
--- a/src/zap/zapcode.cpp
+++ b/src/zap/zapcode.cpp
@@ -95,9 +95,9 @@ ZapVirtualSection * ZapImage::GetCodeMethodDescSection(CodeType codeType)
return m_pHotCodeMethodDescsSection;
case Unprofiled:
return m_pCodeMethodDescsSection;
+ default:
+ UNREACHABLE();
}
-
- UNREACHABLE();
}
ZapVirtualSection* ZapImage::GetUnwindInfoLookupSection(CodeType codeType)
@@ -108,9 +108,9 @@ ZapVirtualSection* ZapImage::GetUnwindInfoLookupSection(CodeType codeType)
return m_pHotRuntimeFunctionLookupSection;
case Unprofiled:
return m_pRuntimeFunctionLookupSection;
+ default:
+ UNREACHABLE();
}
-
- UNREACHABLE();
}
void ZapImage::GetCodeCompilationRange(CodeType codeType, COUNT_T * start, COUNT_T * end)
@@ -1501,7 +1501,7 @@ ZapUnwindData * ZapUnwindData::NewUnwindData(ZapWriter * pWriter, PVOID pData, S
ZapUnwindData * pZapUnwindData = fIsFilterFunclet ?
(new (pMemory) ZapFilterFuncletUnwindData(cbSize)) : (new (pMemory) ZapUnwindData(cbSize));
- memcpy(pZapUnwindData + 1, pData, cbSize);
+ memcpy((void*)(pZapUnwindData + 1), pData, cbSize);
#if defined(_TARGET_AMD64_) || defined(_TARGET_ARM_)
// Make sure the personality routine thunk is created
diff --git a/src/zap/zapimage.cpp b/src/zap/zapimage.cpp
index 3d673bf2bc..a7723c74d0 100644
--- a/src/zap/zapimage.cpp
+++ b/src/zap/zapimage.cpp
@@ -5103,8 +5103,9 @@ bool ZapImage::canIntraModuleDirectCall(
#ifdef _DEBUG
const char* clsName, * methodName;
+ methodName = m_zapper->m_pEEJitInfo->getMethodName(targetFtn, &clsName);
LOG((LF_ZAP, LL_INFO10000, "getIntraModuleDirectCallAddr: Success %s::%s\n",
- clsName, (methodName = m_zapper->m_pEEJitInfo->getMethodName(targetFtn, &clsName), methodName)));
+ clsName, methodName));
#endif
return true;
@@ -5112,8 +5113,9 @@ bool ZapImage::canIntraModuleDirectCall(
CALL_VIA_ENTRY_POINT:
#ifdef _DEBUG
+ methodName = m_zapper->m_pEEJitInfo->getMethodName(targetFtn, &clsName);
LOG((LF_ZAP, LL_INFO10000, "getIntraModuleDirectCallAddr: Via EntryPoint %s::%s\n",
- clsName, (methodName = m_zapper->m_pEEJitInfo->getMethodName(targetFtn, &clsName), methodName)));
+ clsName, methodName));
#endif
return false;
diff --git a/src/zap/zapper.cpp b/src/zap/zapper.cpp
index 1985f83062..0f85157e38 100644
--- a/src/zap/zapper.cpp
+++ b/src/zap/zapper.cpp
@@ -439,11 +439,11 @@ ZapperOptions::ZapperOptions() :
m_fPartialNGen(false),
m_fPartialNGenSet(false),
m_fNGenLastRetry(false),
- m_legacyMode(false),
+ m_compilerFlags(CORJIT_FLG_RELOC | CORJIT_FLG_PREJIT),
+ m_legacyMode(false)
#ifdef FEATURE_CORECLR
- m_fNoMetaData(s_fNGenNoMetaData),
+ ,m_fNoMetaData(s_fNGenNoMetaData)
#endif
- m_compilerFlags(CORJIT_FLG_RELOC | CORJIT_FLG_PREJIT)
{
m_zapSet = CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_ZapSet);
if (m_zapSet != NULL && wcslen(m_zapSet) > 3)