Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up c-style formatting #3599

Merged
merged 6 commits into from
Feb 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion compiler/control/CompileMethod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
#include "ras/Debug.hpp"
#include "env/SystemSegmentProvider.hpp"
#include "env/DebugSegmentProvider.hpp"
#include "omrformatconsts.h"
#include "runtime/CodeCacheManager.hpp"

#if defined (_MSC_VER) && _MSC_VER < 1900
Expand All @@ -80,7 +81,7 @@ writePerfToolEntry(void *start, uint32_t size, const char *name)
static const int maxPerfFilenameSize = 15 + sizeof(jvmPid)* 3; // "/tmp/perf-%ld.map"
char perfFilename[maxPerfFilenameSize] = { 0 };

int numCharsWritten = snprintf(perfFilename, maxPerfFilenameSize, "/tmp/perf-%ld.map", jvmPid);
int numCharsWritten = snprintf(perfFilename, maxPerfFilenameSize, "/tmp/perf-%" OMR_PRId64 ".map", static_cast<int64_t>(jvmPid));
if (numCharsWritten > 0 && numCharsWritten < maxPerfFilenameSize)
{
perfFile = fopen(perfFilename, "a");
Expand Down
17 changes: 9 additions & 8 deletions compiler/runtime/OMRCodeCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include "infra/Assert.hpp"
#include "infra/CriticalSection.hpp"
#include "infra/Monitor.hpp"
#include "omrformatconsts.h"
#include "runtime/CodeCache.hpp"
#include "runtime/CodeCacheManager.hpp"
#include "runtime/CodeCacheMemorySegment.hpp"
Expand Down Expand Up @@ -1275,8 +1276,8 @@ void
OMR::CodeCache::dumpCodeCache()
{
printf("Code Cache @%p\n", this);
printf(" |-- warmCodeAlloc = 0x%08x\n", _warmCodeAlloc );
printf(" |-- coldCodeAlloc = 0x%08x\n", _coldCodeAlloc );
printf(" |-- warmCodeAlloc = 0x%08" OMR_PRIxPTR "\n", (uintptr_t)_warmCodeAlloc );
printf(" |-- coldCodeAlloc = 0x%08" OMR_PRIxPTR "\n", (uintptr_t)_coldCodeAlloc );
printf(" |-- tempTrampsMax = %d\n", _tempTrampolinesMax );
printf(" |-- flags = %d\n", _flags );
printf(" |-- next = 0x%p\n", _next );
Expand All @@ -1287,18 +1288,18 @@ void
OMR::CodeCache::printOccupancyStats()
{
fprintf(stderr, "Code Cache @%p flags=0x%x almostFull=%d\n", this, _flags, _almostFull);
fprintf(stderr, " cold-warm hole size = %8u bytes\n", self()->getFreeContiguousSpace());
fprintf(stderr, " cold-warm hole size = %8" OMR_PRIuSIZE " bytes\n", self()->getFreeContiguousSpace());
fprintf(stderr, " warmCodeAlloc=%p coldCodeAlloc=%p\n", (void*)_warmCodeAlloc, (void*)_coldCodeAlloc);
if (_freeBlockList)
{
fprintf(stderr, " sizeOfLargestFreeColdBlock = %8d bytes\n", _sizeOfLargestFreeColdBlock);
fprintf(stderr, " sizeOfLargestFreeWarmBlock = %8d bytes\n", _sizeOfLargestFreeWarmBlock);
fprintf(stderr, " sizeOfLargestFreeColdBlock = %8" OMR_PRIuSIZE " bytes\n", _sizeOfLargestFreeColdBlock);
fprintf(stderr, " sizeOfLargestFreeWarmBlock = %8" OMR_PRIuSIZE " bytes\n", _sizeOfLargestFreeWarmBlock);
fprintf(stderr, " reclaimed sizes:");
// scope for critical section
{
CacheCriticalSection resolveAndCreateTrampoline(self());
for (CodeCacheFreeCacheBlock *currLink = _freeBlockList; currLink; currLink = currLink->_next)
fprintf(stderr, " %u", currLink->_size);
fprintf(stderr, " %" OMR_PRIuSIZE, currLink->_size);
}
fprintf(stderr, "\n");
}
Expand Down Expand Up @@ -1411,12 +1412,12 @@ OMR::CodeCache::checkForErrors()
} // end for
if (_sizeOfLargestFreeWarmBlock != maxFreeWarmSize)
{
fprintf(stderr, "checkForErrors cache %p: Error: _sizeOfLargestFreeWarmBlock(%d) != maxFreeWarmSize(%d)\n", this, _sizeOfLargestFreeWarmBlock, maxFreeWarmSize);
fprintf(stderr, "checkForErrors cache %p: Error: _sizeOfLargestFreeWarmBlock(%" OMR_PRIuSIZE ") != maxFreeWarmSize(%" OMR_PRIuSIZE ")\n", this, _sizeOfLargestFreeWarmBlock, maxFreeWarmSize);
doCrash = true;
}
if (_sizeOfLargestFreeColdBlock != maxFreeColdSize)
{
fprintf(stderr, "checkForErrors cache %p: Error: _sizeOfLargestFreeColdBlock(%d) != maxFreeColdSize(%d)\n", this, _sizeOfLargestFreeColdBlock, maxFreeColdSize);
fprintf(stderr, "checkForErrors cache %p: Error: _sizeOfLargestFreeColdBlock(%" OMR_PRIuSIZE ") != maxFreeColdSize(%" OMR_PRIuSIZE ")\n", this, _sizeOfLargestFreeColdBlock, maxFreeColdSize);
doCrash = true;
}

Expand Down
41 changes: 21 additions & 20 deletions fvtest/compilertriltest/BitPermuteTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <gtest/gtest.h>
#include "JitTest.hpp"
#include "default_compiler.hpp"
#include "omrformatconsts.h"

uint8_t byteValues[] = {
0x00,
Expand Down Expand Up @@ -146,10 +147,10 @@ TEST_P(lBitPermuteTest, ConstAddressLengthTest)
" (lreturn "
" (lbitpermute "
" (lload parm=0) "
" (aconst %llu) "
" (iconst %llu) "
" (aconst %" OMR_PRIuPTR ") "
" (iconst %" OMR_PRIu32 ") "
" )))) ",
param.arrayAddress,
reinterpret_cast<uintptr_t>(param.arrayAddress),
param.arrayLength
);

Expand Down Expand Up @@ -178,10 +179,10 @@ TEST_P(lBitPermuteTest, ConstAddressTest)
" (lreturn "
" (lbitpermute "
" (lload parm=0) "
" (aconst %llu) "
" (aconst %" OMR_PRIuPTR ") "
" (iload parm=1) "
" )))) ",
param.arrayAddress
reinterpret_cast<uintptr_t>(param.arrayAddress)
);

auto trees = parseString(inputTrees);
Expand Down Expand Up @@ -245,10 +246,10 @@ TEST_P(iBitPermuteTest, ConstAddressLengthTest)
" (ireturn "
" (ibitpermute "
" (iload parm=0) "
" (aconst %llu) "
" (iconst %llu) "
" (aconst %" OMR_PRIuPTR ") "
" (iconst %" OMR_PRIu32 ") "
" )))) ",
maskedIndices,
reinterpret_cast<uintptr_t>(maskedIndices),
param.arrayLength
);

Expand Down Expand Up @@ -281,10 +282,10 @@ TEST_P(iBitPermuteTest, ConstAddressTest)
" (ireturn "
" (ibitpermute "
" (iload parm=0) "
" (aconst %llu) "
" (aconst %" OMR_PRIuPTR ") "
" (iload parm=1) "
" )))) ",
maskedIndices
reinterpret_cast<uintptr_t>(maskedIndices)
);

auto trees = parseString(inputTrees);
Expand Down Expand Up @@ -356,10 +357,10 @@ TEST_P(sBitPermuteTest, ConstAddressLengthTest)
" (su2i "
" (sbitpermute "
" (sload parm=0) "
" (aconst %llu) "
" (iconst %llu) "
" (aconst %" OMR_PRIuPTR ") "
" (iconst %" OMR_PRIu32 ") "
" ))))) ",
maskedIndices,
reinterpret_cast<uintptr_t>(maskedIndices),
param.arrayLength
);

Expand Down Expand Up @@ -396,10 +397,10 @@ TEST_P(sBitPermuteTest, ConstAddressTest)
" (su2i "
" (sbitpermute "
" (sload parm=0) "
" (aconst %llu) "
" (aconst %" OMR_PRIuPTR ") "
" (iload parm=1) "
" ))))) ",
maskedIndices
reinterpret_cast<uintptr_t>(maskedIndices)
);

auto trees = parseString(inputTrees);
Expand Down Expand Up @@ -475,10 +476,10 @@ TEST_P(bBitPermuteTest, ConstAddressLengthTest)
" (bu2i "
" (bbitpermute "
" (bload parm=0) "
" (aconst %llu) "
" (iconst %llu) "
" (aconst %" OMR_PRIuPTR ") "
" (iconst %" OMR_PRIu32 ") "
" ))))) ",
maskedIndices,
reinterpret_cast<uintptr_t>(maskedIndices),
param.arrayLength
);

Expand Down Expand Up @@ -515,10 +516,10 @@ TEST_P(bBitPermuteTest, ConstAddressTest)
" (bu2i "
" (bbitpermute "
" (bload parm=0) "
" (aconst %llu) "
" (aconst %" OMR_PRIuPTR ") "
" (iload parm=1) "
" ))))) ",
maskedIndices
(uintptr_t)maskedIndices
);

auto trees = parseString(inputTrees);
Expand Down
7 changes: 4 additions & 3 deletions fvtest/compilertriltest/LogicalTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

#include "OpCodeTest.hpp"
#include "default_compiler.hpp"
#include "omrformatconsts.h"

int32_t ineg(int32_t l) {
return -l;
Expand Down Expand Up @@ -166,8 +167,8 @@ TEST_P(Int64LogicalBinary, UsingConst) {
" (block"
" (lreturn"
" (%s"
" (lconst %li)"
" (lconst %li) ) ) ) )",
" (lconst %" OMR_PRId64 ")"
" (lconst %" OMR_PRId64 ") ) ) ) )",
param.opcode.c_str(), param.lhs, param.rhs);
auto trees = parseString(inputTrees);

Expand Down Expand Up @@ -228,7 +229,7 @@ TEST_P(Int64LogicalUnary, UsingConst) {
" (block"
" (lreturn"
" (%s"
" (lconst %ld) )"
" (lconst %" OMR_PRId64 ") )"
")))",
param.opcode.c_str(),
param.value);
Expand Down
11 changes: 6 additions & 5 deletions fvtest/compilertriltest/MaxMinTest.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2018, 2018 IBM Corp. and others
* Copyright (c) 2018, 2019 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
Expand All @@ -21,6 +21,7 @@

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copyright date needs to be updated.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK I might wait until CI passes, then push an amended commit that updates the copyrights, if that's OK?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, although the zos machines are down so it might be a while before that job passes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

#include "OpCodeTest.hpp"
#include "default_compiler.hpp"
#include "omrformatconsts.h"

int32_t imax(int32_t l, int32_t r) {
return std::max(l,r);
Expand Down Expand Up @@ -48,8 +49,8 @@ TEST_P(Int32MaxMin, UsingConst) {
" (block"
" (ireturn"
" (%s"
" (iconst %lld)"
" (iconst %lld))"
" (iconst %" OMR_PRId32 ")"
" (iconst %" OMR_PRId32 "))"
")))",
param.opcode.c_str(),
param.lhs,
Expand Down Expand Up @@ -109,8 +110,8 @@ TEST_P(Int64MaxMin, UsingConst) {
" (block"
" (lreturn"
" (%s"
" (lconst %lld)"
" (lconst %lld))"
" (lconst %" OMR_PRId64 ")"
" (lconst %" OMR_PRId64 "))"
")))",
param.opcode.c_str(),
param.lhs,
Expand Down
Loading