|
From: <sv...@va...> - 2017-03-13 10:30:40
|
Author: iraisr
Date: Mon Mar 13 10:30:32 2017
New Revision: 3314
Log:
Small refinement in VEX IR interface
Modified:
branches/VEX_JIT_HACKS/priv/ir_defs.c
branches/VEX_JIT_HACKS/pub/libvex_ir.h
Modified: branches/VEX_JIT_HACKS/priv/ir_defs.c
==============================================================================
--- branches/VEX_JIT_HACKS/priv/ir_defs.c (original)
+++ branches/VEX_JIT_HACKS/priv/ir_defs.c Mon Mar 13 10:30:32 2017
@@ -3675,16 +3675,8 @@
/*--- Helper functions for the IR -- IR Phi Nodes ---*/
/*---------------------------------------------------------------*/
-void addIRPhi(IRStmt* st, IRPhi* phi)
+void addIRPhiToIRPhiVec(IRPhiVec* phi_nodes, IRPhi* phi)
{
- vassert(st->tag == Ist_IfThenElse);
-
- IRPhiVec* phi_nodes = st->Ist.IfThenElse.phi_nodes;
- if (phi_nodes == NULL) {
- phi_nodes = emptyIRPhiVec();
- st->Ist.IfThenElse.phi_nodes = phi_nodes;
- }
-
if (phi_nodes->phis_used == phi_nodes->phis_size) {
IRPhi** phis2 = LibVEX_Alloc_inline(2 * phi_nodes->phis_size * sizeof(IRPhi*));
for (UInt i = 0; i < phi_nodes->phis_size; i++)
Modified: branches/VEX_JIT_HACKS/pub/libvex_ir.h
==============================================================================
--- branches/VEX_JIT_HACKS/pub/libvex_ir.h (original)
+++ branches/VEX_JIT_HACKS/pub/libvex_ir.h Mon Mar 13 10:30:32 2017
@@ -2760,12 +2760,14 @@
IRPhiVec;
extern void ppIRPhi(const IRPhi*);
-extern IRPhi* mkIRPhi(IRTemp, IRTemp, IRTemp);
+extern IRPhi* mkIRPhi(IRTemp dst, IRTemp srcThen, IRTemp srcElse);
extern IRPhi* deepCopyIRPhi(const IRPhi*);
extern void ppIRPhiVec(const IRPhiVec*);
extern IRPhiVec* emptyIRPhiVec(void);
extern IRPhiVec* deepCopyIRPhiVec(const IRPhiVec*);
+extern void addIRPhiToIRPhiVec(IRPhiVec* , IRPhi*);
+
/* ------------------ Type Environments ------------------ */
@@ -3151,9 +3153,6 @@
/* Pretty-print an IRStmt. */
extern void ppIRStmt ( const IRStmt* );
-/* Adds a phi node to IfThenElse statement. */
-extern void addIRPhi(IRStmt* , IRPhi*);
-
/* ------------------ Basic Blocks ------------------ */
/* Code blocks, which in proper compiler terminology are superblocks
|