diff options
| author | Thomas Preud'homme <thomas.preudhomme@celest.fr> | 2010-09-05 22:39:34 +0200 |
|---|---|---|
| committer | Thomas Preud'homme <thomas.preudhomme@celest.fr> | 2010-09-10 20:15:03 +0200 |
| commit | 9b09fc376e8c212a767c875e71ca003e3b9a0d2e (patch) | |
| tree | b02d6544e1eeca1e9b878d120115bb1377c2291f /tccasm.c | |
| parent | a7fb00e887a2ef9372040a75c3d37b79971d9b21 (diff) | |
| download | tinycc-9b09fc376e8c212a767c875e71ca003e3b9a0d2e.tar.gz tinycc-9b09fc376e8c212a767c875e71ca003e3b9a0d2e.tar.bz2 | |
Add support of asm label for functions.
Add support for asm labels for functions, that is the ability to rename
a function at assembly level with __asm__ ("newname") appended in
function declaration.
Diffstat (limited to 'tccasm.c')
| -rw-r--r-- | tccasm.c | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -18,6 +18,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#ifdef CONFIG_TCC_ASM + #include "tcc.h" ST_FUNC int asm_get_local_label_name(TCCState *s1, unsigned int n) @@ -991,6 +993,8 @@ static void parse_asm_operands(ASMOperand *operands, int *nb_operands_ptr, } } +#endif + static void parse_asm_str(CString *astr) { skip('('); @@ -1006,6 +1010,20 @@ static void parse_asm_str(CString *astr) cstr_ccat(astr, '\0'); } +/* Parse an asm label and return the label + * Don't forget to free the CString in the caller! */ +static void asm_label_instr(CString *astr) +{ + next(); + parse_asm_str(astr); + skip(')'); +#ifdef ASM_DEBUG + printf("asm_alias: \"%s\"\n", (char *)astr->data); +#endif +} + +#ifdef CONFIG_TCC_ASM + /* parse the GCC asm() instruction */ ST_FUNC void asm_instr(void) { @@ -1136,3 +1154,5 @@ ST_FUNC void asm_global_instr(void) cstr_free(&astr); } + +#endif |
