Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dotnet/runtime.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Wrighton <davidwr@microsoft.com>2021-02-18 06:03:19 +0300
committerGitHub <noreply@github.com>2021-02-18 06:03:19 +0300
commit4f3545e2d1466512f53a2cd8b0db71667810c083 (patch)
tree3439d1575be09a88ccff595b83c930c9e15df0f6 /src/coreclr/vm/compile.cpp
parentaa138f7cb11502043a12668f48a6bc122be27485 (diff)
Adjust logic in cor.h, corhdr.h, corinfo.h, corjit.h and such so that they may be included without the PAL (#46055)
This was done via simple substitution of the standard sized integer types, and dealing with the fallout. It is tested by using the ICorJitInfo interface directly within the crossgen2 jitinterface thunk library. Effort was made to use a minimum number of casts, as casts in such a large change are likely to be wrong somewhere. - Exceptions are the use of casting to handle some calls to the existing internal metadata api and around use of char16_t. In addition, a small amount of logic from the PAL headers were pulled into the proper header to allow compilation in the presence of some SAL annotation, and other small details.
Diffstat (limited to 'src/coreclr/vm/compile.cpp')
-rw-r--r--src/coreclr/vm/compile.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/coreclr/vm/compile.cpp b/src/coreclr/vm/compile.cpp
index 616c0e58e01..8c5bef669e6 100644
--- a/src/coreclr/vm/compile.cpp
+++ b/src/coreclr/vm/compile.cpp
@@ -1314,7 +1314,7 @@ void EncodeTypeInDictionarySignature(
// SigParser expects ELEMENT_TYPE_MODULE_ZAPSIG to be before ELEMENT_TYPE_GENERICINST
//
SigPointer peek(ptr);
- ULONG instType = 0;
+ uint32_t instType = 0;
IfFailThrow(peek.GetData(&instType));
_ASSERTE(instType == ELEMENT_TYPE_INTERNAL);
@@ -1342,7 +1342,7 @@ void EncodeTypeInDictionarySignature(
EncodeTypeInDictionarySignature(pTypeHandleModule, ptr, pSigBuilder, encodeContext, pfnEncodeModule);
IfFailThrow(ptr.SkipExactlyOne());
- ULONG argCnt = 0; // Get number of parameters
+ uint32_t argCnt = 0; // Get number of parameters
IfFailThrow(ptr.GetData(&argCnt));
pSigBuilder->AppendData(argCnt);
@@ -1364,7 +1364,7 @@ void EncodeTypeInDictionarySignature(
case ELEMENT_TYPE_VAR:
case ELEMENT_TYPE_MVAR:
{
- ULONG varNum;
+ uint32_t varNum;
// Skip variable number
IfFailThrow(ptr.GetData(&varNum));
pSigBuilder->AppendData(varNum);
@@ -1388,30 +1388,30 @@ void EncodeTypeInDictionarySignature(
EncodeTypeInDictionarySignature(pInfoModule, ptr, pSigBuilder, encodeContext, pfnEncodeModule);
IfFailThrow(ptr.SkipExactlyOne());
- ULONG rank = 0; // Get rank
+ uint32_t rank = 0; // Get rank
IfFailThrow(ptr.GetData(&rank));
pSigBuilder->AppendData(rank);
if (rank)
{
- ULONG nsizes = 0;
+ uint32_t nsizes = 0;
IfFailThrow(ptr.GetData(&nsizes));
pSigBuilder->AppendData(nsizes);
while (nsizes--)
{
- ULONG data = 0;
+ uint32_t data = 0;
IfFailThrow(ptr.GetData(&data));
pSigBuilder->AppendData(data);
}
- ULONG nlbounds = 0;
+ uint32_t nlbounds = 0;
IfFailThrow(ptr.GetData(&nlbounds));
pSigBuilder->AppendData(nlbounds);
while (nlbounds--)
{
- ULONG data = 0;
+ uint32_t data = 0;
IfFailThrow(ptr.GetData(&data));
pSigBuilder->AppendData(data);
}
@@ -1438,13 +1438,13 @@ void CEECompileInfo::EncodeGenericSignature(
SigPointer ptr((PCCOR_SIGNATURE)signature);
- ULONG entryKind; // DictionaryEntryKind
+ uint32_t entryKind; // DictionaryEntryKind
IfFailThrow(ptr.GetData(&entryKind));
pSigBuilder->AppendData(entryKind);
if (!fMethod)
{
- ULONG dictionaryIndex = 0;
+ uint32_t dictionaryIndex = 0;
IfFailThrow(ptr.GetData(&dictionaryIndex));
pSigBuilder->AppendData(dictionaryIndex);
@@ -1474,7 +1474,7 @@ void CEECompileInfo::EncodeGenericSignature(
EncodeTypeInDictionarySignature(pInfoModule, ptr, pSigBuilder, encodeContext, pfnEncodeModule);
IfFailThrow(ptr.SkipExactlyOne());
- ULONG methodFlags;
+ uint32_t methodFlags;
IfFailThrow(ptr.GetData(&methodFlags));
pSigBuilder->AppendData(methodFlags);
@@ -1484,13 +1484,13 @@ void CEECompileInfo::EncodeGenericSignature(
IfFailThrow(ptr.SkipExactlyOne());
}
- ULONG tokenOrSlot;
+ uint32_t tokenOrSlot;
IfFailThrow(ptr.GetData(&tokenOrSlot));
pSigBuilder->AppendData(tokenOrSlot);
if (methodFlags & ENCODE_METHOD_SIG_MethodInstantiation)
{
- DWORD nGenericMethodArgs;
+ uint32_t nGenericMethodArgs;
IfFailThrow(ptr.GetData(&nGenericMethodArgs));
pSigBuilder->AppendData(nGenericMethodArgs);
@@ -1508,7 +1508,7 @@ void CEECompileInfo::EncodeGenericSignature(
EncodeTypeInDictionarySignature(pInfoModule, ptr, pSigBuilder, encodeContext, pfnEncodeModule);
IfFailThrow(ptr.SkipExactlyOne());
- DWORD fieldIndex;
+ uint32_t fieldIndex;
IfFailThrow(ptr.GetData(&fieldIndex));
pSigBuilder->AppendData(fieldIndex);
}
@@ -1518,7 +1518,7 @@ void CEECompileInfo::EncodeGenericSignature(
_ASSERTE(false);
}
- ULONG dictionarySlot;
+ uint32_t dictionarySlot;
IfFailThrow(ptr.GetData(&dictionarySlot));
pSigBuilder->AppendData(dictionarySlot);
}