mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-05 22:41:25 +12:00
Fixed some errors thrown by gcc/clang
This commit is contained in:
parent
18251b784f
commit
87accc624f
2 changed files with 20 additions and 20 deletions
|
@ -5094,15 +5094,15 @@ void RecompilationEngine::UpdateControlFlowGraph(ControlFlowGraph & cfg, const E
|
||||||
cfg.branches[this_entry.GetPrimaryAddress()].insert(next_entry->GetPrimaryAddress());
|
cfg.branches[this_entry.GetPrimaryAddress()].insert(next_entry->GetPrimaryAddress());
|
||||||
}
|
}
|
||||||
} else if (next_entry->type == ExecutionTraceEntry::Type::FunctionCall) {
|
} else if (next_entry->type == ExecutionTraceEntry::Type::FunctionCall) {
|
||||||
cfg.calls[this_entry.instruction.address].insert(next_entry->GetPrimaryAddress());
|
cfg.calls[this_entry.data.instruction.address].insert(next_entry->GetPrimaryAddress());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (this_entry.type == ExecutionTraceEntry::Type::CompiledBlock) {
|
} else if (this_entry.type == ExecutionTraceEntry::Type::CompiledBlock) {
|
||||||
if (next_entry) {
|
if (next_entry) {
|
||||||
if (next_entry->type == ExecutionTraceEntry::Type::Instruction || next_entry->type == ExecutionTraceEntry::Type::CompiledBlock) {
|
if (next_entry->type == ExecutionTraceEntry::Type::Instruction || next_entry->type == ExecutionTraceEntry::Type::CompiledBlock) {
|
||||||
cfg.branches[this_entry.compiled_block.exit_address].insert(next_entry->GetPrimaryAddress());
|
cfg.branches[this_entry.data.compiled_block.exit_address].insert(next_entry->GetPrimaryAddress());
|
||||||
} else if (next_entry->type == ExecutionTraceEntry::Type::FunctionCall) {
|
} else if (next_entry->type == ExecutionTraceEntry::Type::FunctionCall) {
|
||||||
cfg.calls[this_entry.compiled_block.exit_address].insert(next_entry->GetPrimaryAddress());
|
cfg.calls[this_entry.data.compiled_block.exit_address].insert(next_entry->GetPrimaryAddress());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5190,8 +5190,8 @@ void Tracer::Trace(TraceType trace_type, u32 arg1, u32 arg2) {
|
||||||
case TraceType::Instruction:
|
case TraceType::Instruction:
|
||||||
// arg1 is the address of the instruction
|
// arg1 is the address of the instruction
|
||||||
for (int i = (int)m_stack.back()->entries.size() - 1; i >= 0; i--) {
|
for (int i = (int)m_stack.back()->entries.size() - 1; i >= 0; i--) {
|
||||||
if ((m_stack.back()->entries[i].type == ExecutionTraceEntry::Type::Instruction && m_stack.back()->entries[i].instruction.address == arg1) ||
|
if ((m_stack.back()->entries[i].type == ExecutionTraceEntry::Type::Instruction && m_stack.back()->entries[i].data.instruction.address == arg1) ||
|
||||||
(m_stack.back()->entries[i].type == ExecutionTraceEntry::Type::CompiledBlock && m_stack.back()->entries[i].compiled_block.entry_address == arg1)) {
|
(m_stack.back()->entries[i].type == ExecutionTraceEntry::Type::CompiledBlock && m_stack.back()->entries[i].data.compiled_block.entry_address == arg1)) {
|
||||||
// Found a loop
|
// Found a loop
|
||||||
execution_trace = new ExecutionTrace(m_stack.back()->function_address);
|
execution_trace = new ExecutionTrace(m_stack.back()->function_address);
|
||||||
execution_trace->type = ExecutionTrace::Type::Loop;
|
execution_trace->type = ExecutionTrace::Type::Loop;
|
||||||
|
|
|
@ -38,7 +38,7 @@ namespace ppu_recompiler_llvm {
|
||||||
u32 entry_address;
|
u32 entry_address;
|
||||||
u32 exit_address;
|
u32 exit_address;
|
||||||
} compiled_block;
|
} compiled_block;
|
||||||
};
|
} data;
|
||||||
|
|
||||||
/// The type of the entry
|
/// The type of the entry
|
||||||
enum class Type {
|
enum class Type {
|
||||||
|
@ -51,14 +51,14 @@ namespace ppu_recompiler_llvm {
|
||||||
: type(type) {
|
: type(type) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case Type::Instruction:
|
case Type::Instruction:
|
||||||
instruction.address = arg1;
|
data.instruction.address = arg1;
|
||||||
break;
|
break;
|
||||||
case Type::FunctionCall:
|
case Type::FunctionCall:
|
||||||
function_call.address = arg1;
|
data.function_call.address = arg1;
|
||||||
break;
|
break;
|
||||||
case Type::CompiledBlock:
|
case Type::CompiledBlock:
|
||||||
compiled_block.entry_address = arg1;
|
data.compiled_block.entry_address = arg1;
|
||||||
compiled_block.exit_address = arg2;
|
data.compiled_block.exit_address = arg2;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
assert(0);
|
assert(0);
|
||||||
|
@ -69,11 +69,11 @@ namespace ppu_recompiler_llvm {
|
||||||
u32 GetPrimaryAddress() const {
|
u32 GetPrimaryAddress() const {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case Type::Instruction:
|
case Type::Instruction:
|
||||||
return instruction.address;
|
return data.instruction.address;
|
||||||
case Type::FunctionCall:
|
case Type::FunctionCall:
|
||||||
return function_call.address;
|
return data.function_call.address;
|
||||||
case Type::CompiledBlock:
|
case Type::CompiledBlock:
|
||||||
return compiled_block.entry_address;
|
return data.compiled_block.entry_address;
|
||||||
default:
|
default:
|
||||||
assert(0);
|
assert(0);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -83,11 +83,11 @@ namespace ppu_recompiler_llvm {
|
||||||
std::string ToString() const {
|
std::string ToString() const {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case Type::Instruction:
|
case Type::Instruction:
|
||||||
return fmt::Format("I:0x%08X", instruction.address);
|
return fmt::Format("I:0x%08X", data.instruction.address);
|
||||||
case Type::FunctionCall:
|
case Type::FunctionCall:
|
||||||
return fmt::Format("F:0x%08X", function_call.address);
|
return fmt::Format("F:0x%08X", data.function_call.address);
|
||||||
case Type::CompiledBlock:
|
case Type::CompiledBlock:
|
||||||
return fmt::Format("C:0x%08X-0x%08X", compiled_block.entry_address, compiled_block.exit_address);
|
return fmt::Format("C:0x%08X-0x%08X", data.compiled_block.entry_address, data.compiled_block.exit_address);
|
||||||
default:
|
default:
|
||||||
assert(0);
|
assert(0);
|
||||||
return "";
|
return "";
|
||||||
|
@ -98,15 +98,15 @@ namespace ppu_recompiler_llvm {
|
||||||
u64 hash = ((u64)type << 32);
|
u64 hash = ((u64)type << 32);
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case Type::Instruction:
|
case Type::Instruction:
|
||||||
hash |= instruction.address;
|
hash |= data.instruction.address;
|
||||||
break;
|
break;
|
||||||
case Type::FunctionCall:
|
case Type::FunctionCall:
|
||||||
hash |= function_call.address;
|
hash |= data.function_call.address;
|
||||||
break;
|
break;
|
||||||
case Type::CompiledBlock:
|
case Type::CompiledBlock:
|
||||||
hash = compiled_block.exit_address;
|
hash = data.compiled_block.exit_address;
|
||||||
hash <<= 32;
|
hash <<= 32;
|
||||||
hash |= compiled_block.entry_address;
|
hash |= data.compiled_block.entry_address;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
assert(0);
|
assert(0);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue