From 1064d5100f4d00af5f56b87331251f97d78f8b87 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 22 Oct 2015 14:56:39 -0700 Subject: Remove uses of QT_POINTER_SIZE, replacing with proper constructs Where the size of void* was really wanted, use sizeof(void*). There's only one use of QT_POINTER_SIZE in qtdeclarative now, in fdegen/ main.cpp selecting the ELF size constants. It's easier to keep it like that than to use C++ selecting constructs. The tool isn't built anyway. Change-Id: I1d0f78915b5942aab07cffff140fa0f99ce7d7d4 Reviewed-by: Erik Verbruggen --- src/qml/jit/qv4assembler_p.h | 2 +- src/qml/jit/qv4isel_masm.cpp | 2 +- tools/fdegen/main.cpp | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/qml/jit/qv4assembler_p.h b/src/qml/jit/qv4assembler_p.h index f0352f8344..80e71ef13c 100644 --- a/src/qml/jit/qv4assembler_p.h +++ b/src/qml/jit/qv4assembler_p.h @@ -869,7 +869,7 @@ public: template struct SizeOnStack { - enum { Size = Select= RegisterArgumentCount, QT_POINTER_SIZE, 0>::Chosen }; + enum { Size = Select= RegisterArgumentCount, sizeof(void*), 0>::Chosen }; }; template diff --git a/src/qml/jit/qv4isel_masm.cpp b/src/qml/jit/qv4isel_masm.cpp index 2b82b924b5..6de6524615 100644 --- a/src/qml/jit/qv4isel_masm.cpp +++ b/src/qml/jit/qv4isel_masm.cpp @@ -1120,7 +1120,7 @@ void InstructionSelection::convertTypeToDouble(IR::Expr *source, IR::Expr *targe Assembler::Pointer addr2 = _as->loadAddress(Assembler::ScratchRegister, source); IR::Temp *targetTemp = target->asTemp(); if (!targetTemp || targetTemp->kind == IR::Temp::StackSlot) { -#if QT_POINTER_SIZE == 8 +#if Q_PROCESSOR_WORDSIZE == 8 _as->load64(addr2, Assembler::ScratchRegister); _as->store64(Assembler::ScratchRegister, _as->loadAddress(Assembler::ReturnValueRegister, target)); #else diff --git a/tools/fdegen/main.cpp b/tools/fdegen/main.cpp index 1fb7a5b076..1906037989 100644 --- a/tools/fdegen/main.cpp +++ b/tools/fdegen/main.cpp @@ -140,7 +140,7 @@ static int createSectionCallback( } static unsigned char cie_init_instructions[] = { - DW_CFA_def_cfa, StackPointerRegister, /*offset in bytes */QT_POINTER_SIZE, + DW_CFA_def_cfa, StackPointerRegister, /*offset in bytes */sizeof(void*), DW_CFA_offset | InstructionPointerRegister, 1, }; @@ -158,8 +158,8 @@ int main() Dwarf_Unsigned cie = dwarf_add_frame_cie(dw, "", - /* code alignment factor */QT_POINTER_SIZE, - /* data alignment factor */-QT_POINTER_SIZE, + /* code alignment factor */sizeof(void*), + /* data alignment factor */-sizeof(void*), /* return address reg*/InstructionPointerRegister, cie_init_instructions, sizeof(cie_init_instructions), @@ -270,7 +270,7 @@ int main() printf("static const int fde_offset = %d;\n", fde_offset); printf("static const int initial_location_offset = %d;\n", fde_offset + 8); - printf("static const int address_range_offset = %d;\n", fde_offset + 8 + QT_POINTER_SIZE); + printf("static const int address_range_offset = %d;\n", fde_offset + 8 + sizeof(void*)); #ifdef DEBUG { -- cgit v1.2.3