44
44
#include " env/annotations/GPUAnnotation.hpp"
45
45
#include " optimizer/Dominators.hpp"
46
46
#include " optimizer/Structure.hpp"
47
+ #include " omrformatconsts.h"
47
48
48
49
#define OPT_DETAILS " O^O CODE GENERATION: "
49
50
@@ -576,7 +577,7 @@ static void getParmName(int32_t slot, char * s, bool addr = true)
576
577
{
577
578
int32_t len = 0 ;
578
579
579
- len = snprintf (s, MAX_NAME, " %%p%d %s" , slot, addr ? " .addr" : " " );
580
+ len = snprintf (s, MAX_NAME, " %%p%" OMR_PRId32 " %s" , slot, addr ? " .addr" : " " );
580
581
581
582
TR_ASSERT (len < MAX_NAME, " Auto's or parm's name is too long\n " );
582
583
}
@@ -588,9 +589,9 @@ static void getAutoOrParmName(TR::Symbol *sym, char * s, bool addr = true)
588
589
TR_ASSERT (sym->isAutoOrParm (), " expecting auto or parm" );
589
590
590
591
if (sym->isParm ())
591
- len = snprintf (s, MAX_NAME, " %%p%d %s" , sym->castToParmSymbol ()->getSlot (), addr ? " .addr" : " " );
592
+ len = snprintf (s, MAX_NAME, " %%p%" OMR_PRId32 " %s" , sym->castToParmSymbol ()->getSlot (), addr ? " .addr" : " " );
592
593
else
593
- len = snprintf (s, MAX_NAME, " %%a%d %s" , sym->castToAutoSymbol ()->getLiveLocalIndex (), addr ? " .addr" : " " );
594
+ len = snprintf (s, MAX_NAME, " %%a%" OMR_PRId32 " %s" , sym->castToAutoSymbol ()->getLiveLocalIndex (), addr ? " .addr" : " " );
594
595
595
596
TR_ASSERT (len < MAX_NAME, " Auto's or parm's name is too long\n " );
596
597
}
@@ -661,24 +662,24 @@ static void getNodeName(TR::Node* node, char * s, TR::Compilation *comp)
661
662
{
662
663
case TR::Int8:
663
664
if (isUnsigned)
664
- len = snprintf (s, MAX_NAME, " %u " , node->getUnsignedByte ());
665
+ len = snprintf (s, MAX_NAME, " %" OMR_PRIu8 , node->getUnsignedByte ());
665
666
else
666
- len = snprintf (s, MAX_NAME, " %d " , node->getByte ());
667
+ len = snprintf (s, MAX_NAME, " %" OMR_PRId8 , node->getByte ());
667
668
break ;
668
669
case TR::Int16:
669
- len = snprintf (s, MAX_NAME, " %d " , node->getConst <uint16_t >());
670
+ len = snprintf (s, MAX_NAME, " %" OMR_PRIu16 , node->getConst <uint16_t >());
670
671
break ;
671
672
case TR::Int32:
672
673
if (isUnsigned)
673
- len = snprintf (s, MAX_NAME, " %u " , node->getUnsignedInt ());
674
+ len = snprintf (s, MAX_NAME, " %" OMR_PRIu32 , node->getUnsignedInt ());
674
675
else
675
- len = snprintf (s, MAX_NAME, " %d " , node->getInt ());
676
+ len = snprintf (s, MAX_NAME, " %" OMR_PRId32 , node->getInt ());
676
677
break ;
677
678
case TR::Int64:
678
679
if (isUnsigned)
679
- len = snprintf (s, MAX_NAME, UINT64_PRINTF_FORMAT , node->getUnsignedLongInt ());
680
+ len = snprintf (s, MAX_NAME, " % " OMR_PRIu64 , node->getUnsignedLongInt ());
680
681
else
681
- len = snprintf (s, MAX_NAME, INT64_PRINTF_FORMAT , node->getLongInt ());
682
+ len = snprintf (s, MAX_NAME, " % " OMR_PRId64 , node->getLongInt ());
682
683
break ;
683
684
case TR::Float:
684
685
union
@@ -687,10 +688,10 @@ static void getNodeName(TR::Node* node, char * s, TR::Compilation *comp)
687
688
int64_t doubleBits;
688
689
};
689
690
doubleValue = node->getFloat ();
690
- len = snprintf (s, MAX_NAME, " 0x%0.16llx " , doubleBits);
691
+ len = snprintf (s, MAX_NAME, " 0x%016 " OMR_PRIx64 , doubleBits);
691
692
break ;
692
693
case TR::Double:
693
- len = snprintf (s, MAX_NAME, " 0x%0.16llx " , node->getDoubleBits ());
694
+ len = snprintf (s, MAX_NAME, " 0x%016 " OMR_PRIx64 , node->getDoubleBits ());
694
695
break ;
695
696
case TR::Address:
696
697
if (node->getAddress () == 0 )
@@ -704,7 +705,7 @@ static void getNodeName(TR::Node* node, char * s, TR::Compilation *comp)
704
705
}
705
706
else
706
707
{
707
- len = snprintf (s, MAX_NAME, " %%%d " , node->getLocalIndex ());
708
+ len = snprintf (s, MAX_NAME, " %%%" OMR_PRIu32 , node->getLocalIndex ());
708
709
}
709
710
710
711
TR_ASSERT (len < MAX_NAME, " Node's name is too long\n " );
@@ -1332,7 +1333,7 @@ J9::CodeGenerator::printNVVMIR(
1332
1333
}
1333
1334
else
1334
1335
{
1335
- int32_t len = snprintf (name0, MAX_NAME, " %d " , smsize);
1336
+ int32_t len = snprintf (name0, MAX_NAME, " %" OMR_PRId32 , smsize);
1336
1337
TR_ASSERT (len < MAX_NAME, " Node's name is too long\n " );
1337
1338
}
1338
1339
@@ -2861,4 +2862,3 @@ J9::CodeGenerator::objectHeaderInvariant()
2861
2862
{
2862
2863
return self ()->objectLengthOffset () + 4 /* length*/ ;
2863
2864
}
2864
-
0 commit comments