]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
- Pass host-specific insn and register printing functions to
authorJulian Seward <jseward@acm.org>
Mon, 5 Jul 2004 20:50:45 +0000 (20:50 +0000)
committerJulian Seward <jseward@acm.org>
Mon, 5 Jul 2004 20:50:45 +0000 (20:50 +0000)
  the register allocator, so it can print debug info specific
  to the host.

- Properly propagate some no-return attributes.

git-svn-id: svn://svn.valgrind.org/vex/trunk@54

VEX/priv/host-generic/host_regs.h
VEX/priv/main/vex_globals.c
VEX/priv/main/vex_globals.h
VEX/priv/main/vex_main.c
VEX/pub/libvex.h
VEX/test_main.c

index 35fcda0fe9d6d63841e92bd3049d0a42ca47fd2b..c3c9735a65fba793eadca5e311aaaec7a45a51f2 100644 (file)
@@ -195,7 +195,11 @@ HInstrArray* doRegisterAllocation (
    /* Return an insn to spill/restore a real reg to a spill slot
       offset. */
    HInstr* (*genSpill) ( HReg, Int ),
-   HInstr* (*genReload) ( HReg, Int )
+   HInstr* (*genReload) ( HReg, Int ),
+
+   /* For debug printing only. */
+   void (*ppInstr) ( HInstr* ),
+   void (*ppReg) ( HReg )
 );
 
 
index ff4141c490e8a0cd535f926d0e6f226c815100bc..0eac1ebfbca648cc92cf5648adb305ec0b562a14 100644 (file)
@@ -18,6 +18,7 @@
 Bool vex_initdone = False;
 
 /* failure exit function */
+__attribute__ ((noreturn))
 void (*vex_failure_exit) ( void ) = NULL;
 
 /* logging output function */
index 2c40e3710b0e121a2269bb7a45d7ac8bf116db31..3f77d97a71b23ee01e256304a21258dd3ed36d6e 100644 (file)
@@ -19,6 +19,7 @@
 extern Bool vex_initdone;
 
 /* failure exit function */
+__attribute__ ((noreturn))
 extern void (*vex_failure_exit) ( void );
 
 /* logging output function */
index c9f4b4bd887ab9cc888085626da32b8922970e53..9d64e81ba0a2b2d5ca3197b154d0a21f32a10c6f 100644 (file)
@@ -22,6 +22,7 @@
 
 void LibVEX_Init (
    /* failure exit function */
+   __attribute__ ((noreturn))
    void (*failure_exit) ( void ),
    /* logging output function */
    void (*log_bytes) ( Char*, Int nbytes ),
@@ -83,6 +84,8 @@ TranslateResult LibVEX_Translate (
    void (*mapRegs) (HRegRemap*, HInstr*);
    HInstr* (*genSpill) ( HReg, Int );
    HInstr* (*genReload) ( HReg, Int );
+   void (*ppInstr) ( HInstr* );
+   void (*ppReg) ( HReg );
    HInstrArray* (*iselBB) ( IRBB* );
    IRBB* (*bbToIR) ( Char*, Addr64, Int*, Bool(*)(Addr64) );
 
@@ -104,6 +107,8 @@ TranslateResult LibVEX_Translate (
          mapRegs     = (void(*)(HRegRemap*,HInstr*)) mapRegs_X86Instr;
          genSpill    = (HInstr*(*)(HReg,Int)) genSpill_X86;
          genReload   = (HInstr*(*)(HReg,Int)) genReload_X86;
+         ppInstr     = (void(*)(HInstr*)) ppX86Instr;
+         ppReg       = (void(*)(HReg)) ppHRegX86;
          iselBB      = iselBB_X86;
          break;
       default:
@@ -140,7 +145,8 @@ TranslateResult LibVEX_Translate (
    rcode = doRegisterAllocation ( vcode, available_real_regs,
                                  n_available_real_regs,
                                  isMove, getRegUsage, mapRegs, 
-                                 genSpill, genReload );
+                                 genSpill, genReload,
+                                 ppInstr, ppReg );
 
    /* Assemble, etc. */
    LibVEX_Clear(True);
index 705f9224c0020666348ad698aaa51f2324283a13..c797f74ffbd125895a8c544b9e6e62d926d5110d 100644 (file)
@@ -23,6 +23,7 @@
 
 extern void LibVEX_Init (
    /* failure exit function */
+   __attribute__ ((noreturn))
    void (*failure_exit) ( void ),
    /* logging output function */
    void (*log_bytes) ( Char*, Int nbytes ),
index a68f126221b57d7b93690d08bd12bf9e195a4710..371594d633f1589c619a2ee2e2f7d97ca8a834e6 100644 (file)
@@ -18,6 +18,7 @@
 #include "libvex_basictypes.h"
 #include "libvex.h"
 
+__attribute__ ((noreturn))
 void failure_exit ( void )
 {
    fprintf(stdout, "VEX did failure_exit.  Bye.\n");