[Misc] Fix Some Warnings on Clang Build with Windows + Adding constexpr
This commit is contained in:
committed by
Radosław Gliński
parent
5f918ef28d
commit
7479ccc292
@@ -92,7 +92,7 @@ typedef struct _UNWIND_INFO {
|
||||
|
||||
// Size of unwind info per function.
|
||||
// TODO(benvanik): move this to emitter.
|
||||
static const uint32_t kUnwindInfoSize =
|
||||
static constexpr uint32_t kUnwindInfoSize =
|
||||
sizeof(UNWIND_INFO) + (sizeof(UNWIND_CODE) * (6 - 1));
|
||||
|
||||
class Win32X64CodeCache : public X64CodeCache {
|
||||
|
||||
@@ -1243,7 +1243,7 @@ void* X64Emitter::FindQwordConstantOffset(uint64_t qwordvalue) {
|
||||
}
|
||||
// First location to try and place constants.
|
||||
static constexpr uintptr_t kConstDataLocation = 0x20000000;
|
||||
static const uintptr_t kConstDataSize = sizeof(xmm_consts);
|
||||
static constexpr uintptr_t kConstDataSize = sizeof(xmm_consts);
|
||||
|
||||
// Increment the location by this amount for every allocation failure.
|
||||
static constexpr uintptr_t kConstDataIncrement = 0x00001000;
|
||||
|
||||
@@ -227,8 +227,8 @@ class X64Emitter : public Xbyak::CodeGenerator {
|
||||
// xmm0-2
|
||||
// Available: rbx, r10-r15
|
||||
// xmm4-xmm15 (save to get xmm3)
|
||||
static const int GPR_COUNT = 7;
|
||||
static const int XMM_COUNT = 12;
|
||||
static constexpr int GPR_COUNT = 7;
|
||||
static constexpr int XMM_COUNT = 12;
|
||||
static constexpr size_t kStashOffset = 32;
|
||||
static void SetupReg(const hir::Value* v, Xbyak::Reg8& r) {
|
||||
auto idx = gpr_reg_map_[v->reg.index];
|
||||
|
||||
@@ -123,7 +123,7 @@ struct OpBase {};
|
||||
|
||||
template <typename T, KeyType KEY_TYPE>
|
||||
struct Op : OpBase {
|
||||
static const KeyType key_type = KEY_TYPE;
|
||||
static constexpr KeyType key_type = KEY_TYPE;
|
||||
};
|
||||
|
||||
struct VoidOp : Op<VoidOp, KEY_TYPE_X> {
|
||||
|
||||
@@ -48,7 +48,7 @@ bool ControlFlowSimplificationPass::Run(HIRBuilder* builder) {
|
||||
block = builder->last_block();
|
||||
while (block) {
|
||||
auto prev_block = block->prev;
|
||||
const uint32_t expected = Edge::DOMINATES | Edge::UNCONDITIONAL;
|
||||
constexpr uint32_t expected = Edge::DOMINATES | Edge::UNCONDITIONAL;
|
||||
if (block->incoming_edge_head &&
|
||||
(block->incoming_edge_head->flags & expected) == expected) {
|
||||
// Dominated by the incoming block.
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace cpu {
|
||||
namespace hir {
|
||||
|
||||
#define DEFINE_OPCODE(num, name, sig, flags) \
|
||||
const OpcodeInfo num##_info = { \
|
||||
constexpr OpcodeInfo num##_info = { \
|
||||
num, \
|
||||
flags, \
|
||||
sig, \
|
||||
|
||||
@@ -44,7 +44,7 @@ using namespace xe::literals;
|
||||
|
||||
typedef std::vector<std::pair<std::string, std::string>> AnnotationList;
|
||||
|
||||
const uint32_t START_ADDRESS = 0x80000000;
|
||||
constexpr uint32_t START_ADDRESS = 0x80000000;
|
||||
|
||||
struct TestCase {
|
||||
TestCase(uint32_t address, std::string& name)
|
||||
|
||||
@@ -43,7 +43,7 @@ struct Context {
|
||||
|
||||
typedef std::vector<std::pair<std::string, std::string>> AnnotationList;
|
||||
|
||||
const uint32_t START_ADDRESS = 0x00000000;
|
||||
constexpr uint32_t START_ADDRESS = 0x00000000;
|
||||
|
||||
struct TestCase {
|
||||
TestCase(uint32_t address, std::string& name)
|
||||
|
||||
@@ -104,7 +104,7 @@ bool InitializeStackWalker() {
|
||||
options |= SYMOPT_LOAD_LINES;
|
||||
options |= SYMOPT_FAIL_CRITICAL_ERRORS;
|
||||
sym_set_options_(options);
|
||||
if (!sym_initialize_(GetCurrentProcess(), nullptr, TRUE)) {
|
||||
if (!sym_initialize_(GetCurrentProcess(), nullptr, true)) {
|
||||
XELOGE("Unable to initialize symbol services - already in use?");
|
||||
return false;
|
||||
}
|
||||
@@ -192,7 +192,7 @@ class Win32StackWalker : public StackWalker {
|
||||
}
|
||||
|
||||
// Setup the frame for walking.
|
||||
STACKFRAME64 stack_frame = {0};
|
||||
STACKFRAME64 stack_frame = {};
|
||||
stack_frame.AddrPC.Mode = AddrModeFlat;
|
||||
stack_frame.AddrPC.Offset = thread_context.Rip;
|
||||
stack_frame.AddrFrame.Mode = AddrModeFlat;
|
||||
|
||||
@@ -1505,13 +1505,13 @@ std::vector<uint32_t> XexModule::PreanalyzeCode() {
|
||||
uint32_t* range_end = (uint32_t*)memory()->TranslateVirtual(
|
||||
high_8_aligned); // align down to multiple of 8
|
||||
|
||||
const uint8_t mfspr_r12_lr[4] = {0x7D, 0x88, 0x02, 0xA6};
|
||||
constexpr uint8_t mfspr_r12_lr[4] = {0x7D, 0x88, 0x02, 0xA6};
|
||||
|
||||
// a blr instruction, with 4 zero bytes afterwards to pad the next address
|
||||
// to 8 byte alignment
|
||||
// if we see this prior to our address, we can assume we are a function
|
||||
// start
|
||||
const uint8_t blr[4] = {0x4E, 0x80, 0x0, 0x20};
|
||||
constexpr uint8_t blr[4] = {0x4E, 0x80, 0x0, 0x20};
|
||||
|
||||
uint32_t blr32 = *reinterpret_cast<const uint32_t*>(&blr[0]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user