Skip to content

Commit

Permalink
Fix C4065
Browse files Browse the repository at this point in the history
```
warning C4065: switch statement contains 'default' but no 'case' labels
```
  • Loading branch information
fjeremic committed Jun 7, 2021
1 parent e2ebd2e commit 059bd52
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 39 deletions.
10 changes: 6 additions & 4 deletions compiler/il/Aliases.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,12 +198,12 @@ OMR::SymbolReference::getUseonlyAliasesBV(TR::SymbolReferenceTable * symRefTab)
}
case TR::Symbol::IsResolvedMethod:
{
#ifdef J9_PROJECT_SPECIFIC
TR::ResolvedMethodSymbol * resolvedMethodSymbol = _symbol->castToResolvedMethodSymbol();
if (!TR::comp()->getOption(TR_EnableHCR))
{
switch (resolvedMethodSymbol->getRecognizedMethod())
{
#ifdef J9_PROJECT_SPECIFIC
case TR::java_lang_Double_longBitsToDouble:
case TR::java_lang_Double_doubleToLongBits:
case TR::java_lang_Float_intBitsToFloat:
Expand Down Expand Up @@ -239,11 +239,12 @@ OMR::SymbolReference::getUseonlyAliasesBV(TR::SymbolReferenceTable * symRefTab)
case TR::java_lang_StrictMath_copySign_F:
case TR::java_lang_StrictMath_copySign_D:
return NULL;
#endif

default:
break;
}
}
#endif
return &symRefTab->aliasBuilder.defaultMethodUseAliases();
}

Expand Down Expand Up @@ -409,13 +410,13 @@ OMR::SymbolReference::getUseDefAliasesBV(bool isDirectCall, bool includeGCSafePo
}
case TR::Symbol::IsResolvedMethod:
{
#ifdef J9_PROJECT_SPECIFIC
TR::ResolvedMethodSymbol * resolvedMethodSymbol = _symbol->castToResolvedMethodSymbol();

if (!comp->getOption(TR_EnableHCR))
{
switch (resolvedMethodSymbol->getRecognizedMethod())
{
#ifdef J9_PROJECT_SPECIFIC
case TR::java_lang_System_arraycopy:
{
TR_BitVector * aliases = new (aliasRegion) TR_BitVector(bvInitialSize, aliasRegion, growability);
Expand Down Expand Up @@ -468,11 +469,12 @@ OMR::SymbolReference::getUseDefAliasesBV(bool isDirectCall, bool includeGCSafePo
return &symRefTab->aliasBuilder.gcSafePointSymRefNumbers();
else
return 0;
#endif //J9_PROJECT_SPECIFIC

default:
break;
}
}
#endif //J9_PROJECT_SPECIFIC

#ifdef J9_PROJECT_SPECIFIC
TR_ResolvedMethod * method = resolvedMethodSymbol->getResolvedMethod();
Expand Down
16 changes: 0 additions & 16 deletions compiler/il/OMRILOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,22 +151,6 @@ OMR::ILOpCode::compareOpCode(TR::DataType dt,
}
break;
}
case TR::Float:
{
switch(ct)
{
default: return TR::BadILOp;
}
break;
}
case TR::Double:
{
switch(ct)
{
default: return TR::BadILOp;
}
break;
}
case TR::Address:
{
switch(ct)
Expand Down
10 changes: 0 additions & 10 deletions compiler/il/OMRILOps.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -729,16 +729,6 @@ class ILOpCode
return TR::BadILOp;
}

static TR::ILOpCodes unsignedSubtractOpCode(TR::DataType type)
{
switch(type)
{
default: TR_ASSERT(0, "no unsigned sub opcode for this datatype");
}
TR_ASSERT_FATAL(0, "all unsigned subtract opcode has been deprecated. (eclipse/omr#2657)");
return TR::BadILOp;
}

static TR::ILOpCodes multiplyOpCode(TR::DataType type)
{
switch(type)
Expand Down
4 changes: 2 additions & 2 deletions compiler/optimizer/GeneralLoopUnroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4080,20 +4080,20 @@ TR_GeneralLoopUnroller::weighNaturalLoop(TR_RegionStructure *loop,
if (cg()->getSizeOfCombinedBuffer())
{
bool forceUnrollCount = false;
#ifdef J9_PROJECT_SPECIFIC
switch (methodId)
{
#ifdef J9_PROJECT_SPECIFIC
case TR::sun_nio_cs_ISO_8859_1_Encoder_encodeArrayLoop:
forceUnrollCount = true;
break;
case TR::sun_nio_cs_ext_IBM1388_Encoder_encodeArrayLoop:
forceUnrollCount = loop->getEntryBlock()->getFrequency() >= HIGH_FREQ_LOOP_CUTOFF;
break;
#endif
default:
// leave unrollCount unmodified
break;
}
#endif
if (forceUnrollCount)
unrollCount = 7;
}
Expand Down
6 changes: 4 additions & 2 deletions compiler/optimizer/ValuePropagationCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3296,19 +3296,21 @@ void OMR::ValuePropagation::transformRTMultiLeafArrayCopy(TR_RealTimeArrayCopy *
static
const char* transformedTargetName (TR::RecognizedMethod rm)
{
#ifdef J9_PROJECT_SPECIFIC
switch ( rm )
{
#ifdef J9_PROJECT_SPECIFIC
case TR::sun_nio_cs_UTF_16_Encoder_encodeUTF16Big:
return "icall com/ibm/jit/JITHelpers.transformedEncodeUTF16Big(JJI)I";

case TR::sun_nio_cs_UTF_16_Encoder_encodeUTF16Little:
return "icall com/ibm/jit/JITHelpers.transformedEncodeUTF16Little(JJI)I" ;
#endif

default:
return "arraytranslate";
}
#else
return "arraytranslate";
#endif
}

#ifdef J9_PROJECT_SPECIFIC
Expand Down
4 changes: 2 additions & 2 deletions compiler/ras/Debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1524,9 +1524,9 @@ TR_Debug::getName(TR::LabelSymbol *labelSymbol)
const char *
TR_Debug::getPerCodeCacheHelperName(TR_CCPreLoadedCode helper)
{
#if defined(TR_TARGET_POWER)
switch (helper)
{
#if defined(TR_TARGET_POWER)
case TR_AllocPrefetch: return "Alloc Prefetch";
case TR_ObjAlloc: return "Object Alloc Helper";
case TR_VariableLenArrayAlloc: return "Variable Length Array Alloc Helper";
Expand All @@ -1535,9 +1535,9 @@ TR_Debug::getPerCodeCacheHelperName(TR_CCPreLoadedCode helper)
case TR_writeBarrierAndCardMark: return "Write Barrier and Card Mark Helper";
case TR_cardMark: return "Card Mark Helper";
case TR_arrayStoreCHK: return "Array Store Check";
#endif // TR_TARGET_POWER
default: break;
}
#endif // TR_TARGET_POWER
return "Unknown Helper";
}

Expand Down
8 changes: 5 additions & 3 deletions compiler/x/codegen/OMRCodeGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -703,21 +703,23 @@ static bool willNotInlineCompareAndSwapNative(TR::Node *node,
*/
bool OMR::X86::CodeGenerator::willBeEvaluatedAsCallByCodeGen(TR::Node *node, TR::Compilation *comp)
{
#ifdef J9_PROJECT_SPECIFIC
TR::SymbolReference *callSymRef = node->getSymbolReference();
TR::MethodSymbol *methodSymbol = callSymRef->getSymbol()->castToMethodSymbol();
switch (methodSymbol->getRecognizedMethod())
{
#ifdef J9_PROJECT_SPECIFIC
case TR::sun_misc_Unsafe_compareAndSwapLong_jlObjectJJJ_Z:
return willNotInlineCompareAndSwapNative(node, 8, comp);
case TR::sun_misc_Unsafe_compareAndSwapInt_jlObjectJII_Z:
return willNotInlineCompareAndSwapNative(node, 4, comp);
case TR::sun_misc_Unsafe_compareAndSwapObject_jlObjectJjlObjectjlObject_Z:
return willNotInlineCompareAndSwapNative(node, (comp->target().is64Bit() && !comp->useCompressedPointers()) ? 8 : 4, comp);
#endif

default:
return true;
break;
}
#endif
return true;
}

int32_t OMR::X86::CodeGenerator::getMaximumNumbersOfAssignableFPRs()
Expand Down

0 comments on commit 059bd52

Please sign in to comment.