Trim trailing spaces everywhere.
This commit is contained in:
50
tccasm.c
50
tccasm.c
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* GAS like assembler for TCC
|
||||
*
|
||||
*
|
||||
* Copyright (c) 2001-2004 Fabrice Bellard
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
@ -125,7 +125,7 @@ static void asm_expr_unary(TCCState *s1, ExprValue *pe)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void asm_expr_prod(TCCState *s1, ExprValue *pe)
|
||||
{
|
||||
int op;
|
||||
@ -134,7 +134,7 @@ static void asm_expr_prod(TCCState *s1, ExprValue *pe)
|
||||
asm_expr_unary(s1, pe);
|
||||
for(;;) {
|
||||
op = tok;
|
||||
if (op != '*' && op != '/' && op != '%' &&
|
||||
if (op != '*' && op != '/' && op != '%' &&
|
||||
op != TOK_SHL && op != TOK_SAR)
|
||||
break;
|
||||
next();
|
||||
@ -145,14 +145,14 @@ static void asm_expr_prod(TCCState *s1, ExprValue *pe)
|
||||
case '*':
|
||||
pe->v *= e2.v;
|
||||
break;
|
||||
case '/':
|
||||
case '/':
|
||||
if (e2.v == 0) {
|
||||
div_error:
|
||||
tcc_error("division by zero");
|
||||
}
|
||||
pe->v /= e2.v;
|
||||
break;
|
||||
case '%':
|
||||
case '%':
|
||||
if (e2.v == 0)
|
||||
goto div_error;
|
||||
pe->v %= e2.v;
|
||||
@ -186,7 +186,7 @@ static void asm_expr_logic(TCCState *s1, ExprValue *pe)
|
||||
case '&':
|
||||
pe->v &= e2.v;
|
||||
break;
|
||||
case '|':
|
||||
case '|':
|
||||
pe->v |= e2.v;
|
||||
break;
|
||||
default:
|
||||
@ -224,7 +224,7 @@ static inline void asm_expr_sum(TCCState *s1, ExprValue *pe)
|
||||
} else if (pe->sym && !e2.sym) {
|
||||
/* OK */
|
||||
} else if (pe->sym && e2.sym) {
|
||||
if (pe->sym == e2.sym) {
|
||||
if (pe->sym == e2.sym) {
|
||||
/* OK */
|
||||
} else if (pe->sym->r == e2.sym->r && pe->sym->r != 0) {
|
||||
/* we also accept defined symbols in the same section */
|
||||
@ -267,7 +267,7 @@ static void asm_new_label1(TCCState *s1, int label, int is_local,
|
||||
if (sym->r) {
|
||||
/* the label is already defined */
|
||||
if (!is_local) {
|
||||
tcc_error("assembler label '%s' already defined",
|
||||
tcc_error("assembler label '%s' already defined",
|
||||
get_tok_str(label, NULL));
|
||||
} else {
|
||||
/* redefinition of local labels is possible */
|
||||
@ -493,7 +493,7 @@ static void asm_parse_directive(TCCState *s1)
|
||||
case TOK_ASM_weak:
|
||||
case TOK_ASM_hidden:
|
||||
tok1 = tok;
|
||||
do {
|
||||
do {
|
||||
Sym *sym;
|
||||
|
||||
next();
|
||||
@ -541,7 +541,7 @@ static void asm_parse_directive(TCCState *s1)
|
||||
case TOK_ASM_text:
|
||||
case TOK_ASM_data:
|
||||
case TOK_ASM_bss:
|
||||
{
|
||||
{
|
||||
char sname[64];
|
||||
tok1 = tok;
|
||||
n = 0;
|
||||
@ -591,7 +591,7 @@ static void asm_parse_directive(TCCState *s1)
|
||||
}
|
||||
break;
|
||||
case TOK_ASM_size:
|
||||
{
|
||||
{
|
||||
Sym *sym;
|
||||
|
||||
next();
|
||||
@ -612,7 +612,7 @@ static void asm_parse_directive(TCCState *s1)
|
||||
}
|
||||
break;
|
||||
case TOK_ASM_type:
|
||||
{
|
||||
{
|
||||
Sym *sym;
|
||||
const char *newtype;
|
||||
|
||||
@ -637,7 +637,7 @@ static void asm_parse_directive(TCCState *s1)
|
||||
sym->type.t = (sym->type.t & ~VT_BTYPE) | VT_FUNC;
|
||||
}
|
||||
else if (s1->warn_unsupported)
|
||||
tcc_warning("change type of '%s' from 0x%x to '%s' ignored",
|
||||
tcc_warning("change type of '%s' from 0x%x to '%s' ignored",
|
||||
get_tok_str(sym->v, NULL), sym->type.t, newtype);
|
||||
|
||||
next();
|
||||
@ -669,7 +669,7 @@ static void asm_parse_directive(TCCState *s1)
|
||||
}
|
||||
break;
|
||||
case TOK_ASM_previous:
|
||||
{
|
||||
{
|
||||
Section *sec;
|
||||
next();
|
||||
if (!last_text_section)
|
||||
@ -830,7 +830,7 @@ ST_FUNC int tcc_assemble(TCCState *s1, int do_preprocess)
|
||||
|
||||
cur_text_section->data_offset = ind;
|
||||
|
||||
free_defines(define_start);
|
||||
free_defines(define_start);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@ -863,7 +863,7 @@ static void tcc_assemble_inline(TCCState *s1, char *str, int len)
|
||||
/* find a constraint by its number or id (gcc 3 extended
|
||||
syntax). return -1 if not found. Return in *pp in char after the
|
||||
constraint */
|
||||
ST_FUNC int find_constraint(ASMOperand *operands, int nb_operands,
|
||||
ST_FUNC int find_constraint(ASMOperand *operands, int nb_operands,
|
||||
const char *name, const char **pp)
|
||||
{
|
||||
int index;
|
||||
@ -901,7 +901,7 @@ ST_FUNC int find_constraint(ASMOperand *operands, int nb_operands,
|
||||
return index;
|
||||
}
|
||||
|
||||
static void subst_asm_operands(ASMOperand *operands, int nb_operands,
|
||||
static void subst_asm_operands(ASMOperand *operands, int nb_operands,
|
||||
int nb_outputs,
|
||||
CString *out_str, CString *in_str)
|
||||
{
|
||||
@ -1052,12 +1052,12 @@ ST_FUNC void asm_instr(void)
|
||||
token after the assembler parsing */
|
||||
if (tok != ';')
|
||||
expect("';'");
|
||||
|
||||
|
||||
/* save all values in the memory */
|
||||
save_regs(0);
|
||||
|
||||
/* compute constraints */
|
||||
asm_compute_constraints(operands, nb_operands, nb_outputs,
|
||||
asm_compute_constraints(operands, nb_operands, nb_outputs,
|
||||
clobber_regs, &out_reg);
|
||||
|
||||
/* substitute the operands in the asm string. No substitution is
|
||||
@ -1076,8 +1076,8 @@ ST_FUNC void asm_instr(void)
|
||||
#endif
|
||||
|
||||
/* generate loads */
|
||||
asm_gen_code(operands, nb_operands, nb_outputs, 0,
|
||||
clobber_regs, out_reg);
|
||||
asm_gen_code(operands, nb_operands, nb_outputs, 0,
|
||||
clobber_regs, out_reg);
|
||||
|
||||
/* assemble the string with tcc internal assembler */
|
||||
tcc_assemble_inline(tcc_state, astr1.data, astr1.size - 1);
|
||||
@ -1086,9 +1086,9 @@ ST_FUNC void asm_instr(void)
|
||||
next();
|
||||
|
||||
/* store the output values if needed */
|
||||
asm_gen_code(operands, nb_operands, nb_outputs, 1,
|
||||
asm_gen_code(operands, nb_operands, nb_outputs, 1,
|
||||
clobber_regs, out_reg);
|
||||
|
||||
|
||||
/* free everything */
|
||||
for(i=0;i<nb_operands;i++) {
|
||||
ASMOperand *op;
|
||||
@ -1110,7 +1110,7 @@ ST_FUNC void asm_global_instr(void)
|
||||
token after the assembler parsing */
|
||||
if (tok != ';')
|
||||
expect("';'");
|
||||
|
||||
|
||||
#ifdef ASM_DEBUG
|
||||
printf("asm_global: \"%s\"\n", (char *)astr.data);
|
||||
#endif
|
||||
@ -1119,7 +1119,7 @@ ST_FUNC void asm_global_instr(void)
|
||||
|
||||
/* assemble the string with tcc internal assembler */
|
||||
tcc_assemble_inline(tcc_state, astr.data, astr.size - 1);
|
||||
|
||||
|
||||
cur_text_section->data_offset = ind;
|
||||
|
||||
/* restore the current C token */
|
||||
|
||||
Reference in New Issue
Block a user