Skip to content

Commit 98a2a9d

Browse files
committed
Fix compilation errors
1 parent 0dfb332 commit 98a2a9d

File tree

7 files changed

+60
-60
lines changed

7 files changed

+60
-60
lines changed

src/coreclr/jit/compiler.cpp

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3070,36 +3070,15 @@ void Compiler::compInitOptions(JitFlags* jitFlags)
30703070
s_pJitFunctionFileInitialized = true;
30713071
}
30723072
#else // DEBUG
3073-
if (!jitFlags->IsSet(JitFlags::JIT_FLAG_PREJIT))
3073+
if (!JitConfig.JitDisasm().isEmpty())
30743074
{
3075-
if (!JitConfig.JitDisasm().isEmpty())
3075+
const char* methodName = info.compCompHnd->getMethodName(info.compMethodHnd, nullptr);
3076+
const char* className = info.compCompHnd->getClassName(info.compClassHnd);
3077+
if (JitConfig.JitDisasm().contains(methodName, className, &info.compMethodInfo->args))
30763078
{
3077-
const char* methodName = info.compCompHnd->getMethodName(info.compMethodHnd, nullptr);
3078-
const char* className = info.compCompHnd->getClassName(info.compClassHnd);
3079-
3080-
if (JitConfig.JitDisasm().contains(methodName, className, &info.compMethodInfo->args))
3081-
{
3082-
opts.disAsm = true;
3083-
}
3084-
}
3085-
}
3086-
else
3087-
{
3088-
if (!JitConfig.NgenDisasm().isEmpty())
3089-
{
3090-
const char* methodName = info.compCompHnd->getMethodName(info.compMethodHnd, nullptr);
3091-
const char* className = info.compCompHnd->getClassName(info.compClassHnd);
3092-
3093-
if (JitConfig.NgenDisasm().contains(methodName, className, &info.compMethodInfo->args))
3094-
{
3095-
opts.disAsm = true;
3096-
}
3079+
opts.disAsm = true;
30973080
}
30983081
}
3099-
3100-
bool diffable = JitConfig.DiffableDasm();
3101-
opts.disDiffable = diffable;
3102-
opts.dspDiffable = diffable;
31033082
#endif // !DEBUG
31043083

31053084
//-------------------------------------------------------------------------

src/coreclr/jit/compiler.h

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9296,7 +9296,6 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
92969296

92979297
static bool s_pJitFunctionFileInitialized;
92989298
static MethodSet* s_pJitMethodSet;
9299-
#endif // DEBUG
93009299

93019300
// silence warning of cast to greater size. It is easier to silence than construct code the compiler is happy with, and
93029301
// it is safe in this case
@@ -9315,6 +9314,23 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
93159314
return (o == ZERO) ? ZERO : (opts.dspDiffable ? T(0xD1FFAB1E) : o);
93169315
}
93179316
#pragma warning(pop)
9317+
#else
9318+
#pragma warning(push)
9319+
#pragma warning(disable : 4312)
9320+
template <typename T>
9321+
T dspPtr(T p)
9322+
{
9323+
return p;
9324+
}
9325+
9326+
template <typename T>
9327+
T dspOffset(T o)
9328+
{
9329+
return o;
9330+
}
9331+
#pragma warning(pop)
9332+
#endif
9333+
93189334
#ifdef DEBUG
93199335

93209336
static int dspTreeID(GenTree* tree)
@@ -9787,12 +9803,12 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
97879803
#endif
97889804

97899805
public:
9790-
LONG compMethodID;
97919806
#ifdef DEBUG
97929807
unsigned compGenTreeID;
97939808
unsigned compStatementID;
97949809
unsigned compBasicBlockID;
97959810
#endif
9811+
LONG compMethodID;
97969812

97979813
BasicBlock* compCurBB; // the current basic block in process
97989814
Statement* compCurStmt; // the current statement in process

src/coreclr/jit/emit.cpp

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1506,8 +1506,6 @@ void* emitter::emitAllocAnyInstr(size_t sz, emitAttr opsz)
15061506

15071507
emitInsCount++;
15081508

1509-
/* In debug mode we clear/set some additional fields */
1510-
15111509
instrDescDebugInfo* info = (instrDescDebugInfo*)emitGetMem(sizeof(*info));
15121510

15131511
info->idNum = emitInsCount;
@@ -2654,11 +2652,7 @@ const char* emitter::emitLabelString(insGroup* ig)
26542652
static char buf[4][TEMP_BUFFER_LEN];
26552653
const char* retbuf;
26562654

2657-
#ifdef DEBUG
26582655
sprintf_s(buf[curBuf], TEMP_BUFFER_LEN, "G_M%03u_IG%02u", emitComp->compMethodID, ig->igNum);
2659-
#else
2660-
sprintf_s(buf[curBuf], TEMP_BUFFER_LEN, "IG_%02u", ig->igNum);
2661-
#endif
26622656
retbuf = buf[curBuf];
26632657
curBuf = (curBuf + 1) % 4;
26642658
return retbuf;
@@ -4060,7 +4054,6 @@ void emitter::emitRecomputeIGoffsets()
40604054
//
40614055
void emitter::emitDispCommentForHandle(size_t handle, size_t cookie, GenTreeFlags flag)
40624056
{
4063-
#ifdef DEBUG
40644057
#ifdef TARGET_XARCH
40654058
const char* commentPrefix = " ;";
40664059
#else
@@ -4099,6 +4092,7 @@ void emitter::emitDispCommentForHandle(size_t handle, size_t cookie, GenTreeFlag
40994092
const char* str = nullptr;
41004093
if (flag == GTF_ICON_STR_HDL)
41014094
{
4095+
#ifdef DEBUG
41024096
const WCHAR* wstr = emitComp->eeGetCPString(handle);
41034097
// NOTE: eGetCPString always returns nullptr on Linux/ARM
41044098
if (wstr == nullptr)
@@ -4131,6 +4125,9 @@ void emitter::emitDispCommentForHandle(size_t handle, size_t cookie, GenTreeFlag
41314125
}
41324126
printf("%s \"%S\"", commentPrefix, buf);
41334127
}
4128+
#else
4129+
str = "string handle";
4130+
#endif
41344131
}
41354132
else if (flag == GTF_ICON_CLASS_HDL)
41364133
{
@@ -4169,7 +4166,6 @@ void emitter::emitDispCommentForHandle(size_t handle, size_t cookie, GenTreeFlag
41694166
{
41704167
printf("%s %s", commentPrefix, str);
41714168
}
4172-
#endif // DEBUG
41734169
}
41744170

41754171
//****************************************************************************
@@ -6671,6 +6667,10 @@ unsigned emitter::emitEndCodeGen(Compiler* comp,
66716667
if (emitComp->opts.disAsm)
66726668
{
66736669
printf("\n%s:", emitLabelString(ig));
6670+
if (!emitComp->opts.disDiffable)
6671+
{
6672+
printf(" ;; offset=%04XH", emitCurCodeOffs(cp));
6673+
}
66746674
printf("\n");
66756675
}
66766676
#endif // !DEBUG
@@ -6914,7 +6914,13 @@ unsigned emitter::emitEndCodeGen(Compiler* comp,
69146914
ig->igPerfScore);
69156915
}
69166916
*instrCount += ig->igInsCnt;
6917-
#endif // DEBUG
6917+
#else // DEBUG
6918+
if (emitComp->opts.disAsm)
6919+
{
6920+
// Separate IGs with a blank line
6921+
printf(" ");
6922+
}
6923+
#endif // !DEBUG
69186924

69196925
emitCurIG = nullptr;
69206926

src/coreclr/jit/emitxarch.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9125,11 +9125,11 @@ void emitter::emitDispIns(
91259125
}
91269126
else if ((val > 0) || (val < -0xFFFFFF))
91279127
{
9128-
printf("0x%IX", (INT64)val);
9128+
printf("0x%IX", (ssize_t)val);
91299129
}
91309130
else
91319131
{ // (val < 0)
9132-
printf("-0x%IX", (INT64)-val);
9132+
printf("-0x%IX", (ssize_t)-val);
91339133
}
91349134
emitDispCommentForHandle(srcVal, id->idDebugOnlyInfo()->idMemCookie, id->idDebugOnlyInfo()->idFlags);
91359135
}

src/coreclr/jit/jit.h

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -798,7 +798,6 @@ inline bool IsUninitialized(T data)
798798
{
799799
return data == UninitializedWord<T>(JitTls::GetCompiler());
800800
}
801-
#else // !defined(DEBUG)
802801

803802
#pragma warning(push)
804803
#pragma warning(disable : 4312)
@@ -820,6 +819,25 @@ T dspOffset(T o)
820819
}
821820
#pragma warning(pop)
822821

822+
#else // !defined(DEBUG)
823+
824+
//****************************************************************************
825+
//
826+
// Non-Debug template definitions for dspPtr, dspOffset
827+
// - This is a nop in non-Debug builds
828+
//
829+
template <typename T>
830+
T dspPtr(T p)
831+
{
832+
return p;
833+
}
834+
835+
template <typename T>
836+
T dspOffset(T o)
837+
{
838+
return o;
839+
}
840+
823841
#endif // !defined(DEBUG)
824842

825843
struct LikelyClassMethodRecord

src/coreclr/jit/jitconfigvalues.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ CONFIG_METHODSET(JitUnwindDump, W("JitUnwindDump")) // Dump the unwind codes for
218218
///
219219
/// NGEN
220220
///
221+
CONFIG_METHODSET(NgenDisasm, W("NgenDisasm")) // Same as JitDisasm, but for ngen
221222
CONFIG_METHODSET(NgenDump, W("NgenDump")) // Same as JitDump, but for ngen
222223
CONFIG_METHODSET(NgenEHDump, W("NgenEHDump")) // Dump the EH table for the method, as reported to the VM
223224
CONFIG_METHODSET(NgenGCDump, W("NgenGCDump"))

src/coreclr/jit/valuenum.cpp

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10421,26 +10421,6 @@ void Compiler::fgValueNumberAddExceptionSetForIndirection(GenTree* tree, GenTree
1042110421
vnStore->VNExcSetSingleton(vnStore->VNForFunc(TYP_REF, VNF_NullPtrExc, vnpBaseNorm.GetConservative())));
1042210422
}
1042310423

10424-
VNFuncApp func;
10425-
if (vnStore->GetVNFunc(vnpBaseNorm.GetConservative(), &func) &&
10426-
(func.m_func == VNF_GetsharedGcthreadstaticBaseNoctor))
10427-
{
10428-
switch (func.m_func)
10429-
{
10430-
case VNF_GetgenericsGcthreadstaticBase:
10431-
case VNF_GetgenericsNongcthreadstaticBase:
10432-
case VNF_GetsharedGcthreadstaticBase:
10433-
case VNF_GetsharedNongcthreadstaticBase:
10434-
case VNF_GetsharedGcthreadstaticBaseNoctor:
10435-
case VNF_GetsharedNongcthreadstaticBaseNoctor:
10436-
case VNF_GetsharedGcthreadstaticBaseDynamicclass:
10437-
case VNF_GetsharedNongcthreadstaticBaseDynamicclass:
10438-
tree->gtVNPair.SetConservative(tree->gtVNPair.GetLiberal());
10439-
break;
10440-
default:
10441-
break;
10442-
}
10443-
}
1044410424
// Add the NullPtrExc to "tree"'s value numbers.
1044510425
tree->gtVNPair = vnStore->VNPWithExc(tree->gtVNPair, excChkSet);
1044610426
}

0 commit comments

Comments
 (0)