Extend support for partial CPU state reads/writes

This patch implements `VariableManager::storeToCPUStateOffset` and
`VariableManager::loadFromCPUStateOffset`, which handle in a single
point all the accesses by offset to the CPU state.

* `getTypeAtOffset`: introduce a feature to easily debug how we compute
  which field is at a specified offset in the CPU state (`--debug
  type-at-offset`).
* Let `getTypeAtOffset` and its wrappers return the offset inside a
  field of the CPU state (useful when accessing the third byte of an
  integer).
* Use a dedicated class for the `CorrectCPUStateUsage` worklist
This commit is contained in:
Alessandro Di Federico
2016-04-14 08:31:52 +02:00
parent 74ed2abd53
commit cda7bbd94e
4 changed files with 429 additions and 121 deletions
+2 -1
View File
@@ -637,7 +637,8 @@ void CodeGenerator::translate(uint64_t VirtualAddress,
// Instantiate helpers
VariableManager Variables(*TheModule,
*HelpersModule);
*HelpersModule,
TargetArchitecture);
auto *PCReg = Variables.getByEnvOffset(ptc.pc, "pc").first;
JumpTargetManager JumpTargets(MainFunction,