From 07d4d67db4846a081c61afa56d8ccdfda486a47e Mon Sep 17 00:00:00 2001 From: Stan Cox Date: Fri, 3 May 1996 17:47:15 +0000 Subject: [PATCH] (ASM_OUTPUT_MI_THUNK): Define. From-SVN: r11918 --- gcc/config/i386/att.h | 12 ++++++++++++ gcc/config/i386/bsd.h | 12 ++++++++++++ gcc/config/i386/sun386.h | 11 +++++++++++ 3 files changed, 35 insertions(+) diff --git a/gcc/config/i386/att.h b/gcc/config/i386/att.h index b234ea16c56..3612cd2acfa 100644 --- a/gcc/config/i386/att.h +++ b/gcc/config/i386/att.h @@ -92,3 +92,15 @@ do \ #undef ASM_OUTPUT_LABELREF #define ASM_OUTPUT_LABELREF(FILE,NAME) \ fprintf (FILE, "%s", NAME) + +/* Output code to add DELTA to the first argument, and then jump to FUNCTION. + Used for C++ multiple inheritance. */ + +#define ASM_OUTPUT_MI_THUNK(FILE, THUNK_FNDECL, DELTA, FUNCTION) \ +do { \ + fprintf (FILE, "\taddl $%d,%s\n\tjmp ", DELTA, \ + i386_regparm > 0 ? "%eax" : "4(%esp)"); \ + assemble_name (FILE, IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (FUNCTION))); \ + fprintf (FILE, "\n"); \ +} while (0) + diff --git a/gcc/config/i386/bsd.h b/gcc/config/i386/bsd.h index 6bf7399dc31..4f8bdfe1459 100644 --- a/gcc/config/i386/bsd.h +++ b/gcc/config/i386/bsd.h @@ -123,6 +123,18 @@ Boston, MA 02111-1307, USA. */ #define ASM_OUTPUT_LABELREF(FILE,NAME) fprintf (FILE, "_%s", NAME) #endif /* not NO_UNDERSCORES */ +/* Output code to add DELTA to the first argument, and then jump to FUNCTION. + Used for C++ multiple inheritance. */ + +#define ASM_OUTPUT_MI_THUNK(FILE, THUNK_FNDECL, DELTA, FUNCTION) \ +do { \ + fprintf (FILE, "\taddl $%d,%s\n\tjmp ", DELTA, \ + i386_regparm > 0 ? "%eax" : "4(%esp)"); \ + assemble_name (FILE, IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (FUNCTION))); \ + fprintf (FILE, "\n"); \ +} while (0) + + /* Sequent has some changes in the format of DBX symbols. */ #define DBX_NO_XREFS 1 diff --git a/gcc/config/i386/sun386.h b/gcc/config/i386/sun386.h index 6e2680789bd..0046e740324 100644 --- a/gcc/config/i386/sun386.h +++ b/gcc/config/i386/sun386.h @@ -141,3 +141,14 @@ do \ #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \ fprintf (FILE, ".%s%d:\n", PREFIX, NUM) + +/* Output code to add DELTA to the first argument, and then jump to FUNCTION. + Used for C++ multiple inheritance. */ + +#define ASM_OUTPUT_MI_THUNK(FILE, THUNK_FNDECL, DELTA, FUNCTION) \ +do { \ + fprintf (FILE, "\taddl $%d,%s\n\tjmp ", DELTA, \ + i386_regparm > 0 ? "%eax" : "4(%esp)"); \ + assemble_name (FILE, IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (FUNCTION))); \ + fprintf (FILE, "\n"); \ +} while (0) -- 2.30.2