fix some printf format specifiers (#76)

use the definition in cinttypes for portability
This commit is contained in:
Arne Morten Kvarving 2022-08-27 09:33:01 +02:00 committed by GitHub
parent 5cba1a1185
commit 8459cd928c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 23 additions and 15 deletions

View file

@ -1,6 +1,8 @@
#include "util/Zir/Core/IR.h"
#include "util/Zir/Core/ZpIRDebug.h"
#include <cinttypes>
namespace ZpIR
{
@ -201,15 +203,15 @@ namespace ZpIR
void DebugPrinter::debugPrintBlock(ZpIRBasicBlock* block)
{
// print name
printf("IRBasicBlock %016llx\n", (uintptr_t)block);
printf("IRBasicBlock %" PRIxPTR "\n", (uintptr_t)block);
// print imports
printf("Imports:\n");
for(auto itr : block->m_imports)
printf(" reg: %s sym:0x%llx\n", getRegisterName(block, itr.reg).c_str(), itr.name);
printf(" reg: %s sym:0x%lux\n", getRegisterName(block, itr.reg).c_str(), itr.name);
// print exports
printf("Exports:\n");
for (auto itr : block->m_exports)
printf(" reg: %s sym:0x%llx\n", getRegisterName(block, itr.reg).c_str(), itr.name);
printf(" reg: %s sym:0x%lux\n", getRegisterName(block, itr.reg).c_str(), itr.name);
// print instructions
printf("Assembly:\n");
IR::__InsBase* instruction = block->m_instructionFirst;
@ -233,4 +235,4 @@ namespace ZpIR
}
}
}
}