Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
Edward O'Callaghan (eocallaghan(a)alterapraxis.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/5221
-gerrit
commit e8fb1fcbce32e8bb4874c0f46b19e76674dbd221
Author: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
Date: Fri Feb 14 19:30:38 2014 +1100
SerialICE: Remove superfluous whitespace in the tree.
Change-Id: I14cf959ff4601ede921b8086e460fc36bb40bc4f
Signed-off-by: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
---
SerialICE/Makefile | 6 +-
SerialICE/README.GDB | 12 +-
SerialICE/README.SHELL | 5 +-
SerialICE/chipset.c | 2 +-
SerialICE/io.h | 2 +-
SerialICE/mainboard/amd_serengeti-cheetah.c | 2 +-
SerialICE/mainboard/asrock_939a785gmh.c | 2 +-
SerialICE/mainboard/asus_k8v-x.c | 2 +-
SerialICE/mainboard/asus_m2v-mx_se.c | 2 +-
SerialICE/mainboard/asus_m4a77td-pro.c | 6 +-
SerialICE/mainboard/asus_p2b.c | 2 +-
SerialICE/mainboard/dell_s1850.c | 10 +-
SerialICE/mainboard/hp_dl165_g6.c | 2 +-
SerialICE/mainboard/intel_d94x.c | 2 +-
SerialICE/mainboard/kontron_986lcd-m.c | 2 +-
SerialICE/mainboard/msi_ms6178.c | 2 +-
SerialICE/mainboard/rca_rm4100.c | 4 +-
SerialICE/mainboard/roda_rk886ex.c | 2 +-
SerialICE/mainboard/televideo_tc7010.c | 2 +-
SerialICE/mainboard/thomson_ip1000.c | 2 +-
SerialICE/mainboard/tyan_s2912.c | 2 +-
SerialICE/mainboard/wyse_s50.c | 4 +-
SerialICE/serial.c | 6 +-
SerialICE/serialice.c | 4 +-
SerialICE/serialice.h | 2 +-
SerialICE/serialice.ld | 2 +-
SerialICE/simba/replay.lua | 4 +-
SerialICE/start.S | 2 +-
SerialICE/types.h | 2 +-
SerialICE/util/kconfig/lex.zconf.c_shipped | 82 +-
SerialICE/util/kconfig/lxdialog/BIG.FAT.WARNING | 2 +-
SerialICE/util/kconfig/lxdialog/menubox.c | 2 +-
SerialICE/util/kconfig/regex.c | 556 ++++-----
SerialICE/util/kconfig/regex.h | 22 +-
SerialICE/util/kconfig/zconf.tab.c_shipped | 2 +-
SerialICE/util/romcc.c | 1396 +++++++++++------------
SerialICE/util/xmmstack.c | 14 +-
37 files changed, 1085 insertions(+), 1090 deletions(-)
diff --git a/SerialICE/Makefile b/SerialICE/Makefile
index f4a7580..e764992 100644
--- a/SerialICE/Makefile
+++ b/SerialICE/Makefile
@@ -1,5 +1,5 @@
##
-## SerialICE
+## SerialICE
##
## Copyright (C) 2009 coresystems GmbH
##
@@ -116,7 +116,7 @@ $(obj)/serialice.rom: $(obj)/serialice.elf
$(obj)/serialice.elf: $(obj)/serialice.o $(obj)/start.o $(src)/serialice.ld
$(Q)printf " LINK $(subst $(shell pwd)/,,$(@))\n"
- $(Q)$(CC) $(LDFLAGS) -o $@ $(obj)/serialice.o $(obj)/start.o
+ $(Q)$(CC) $(LDFLAGS) -o $@ $(obj)/serialice.o $(obj)/start.o
$(Q)$(NM) $@ | sort -u > $(obj)/serialice.map
$(obj)/serialice.S: $(SOURCES) $(obj)/romcc
@@ -143,7 +143,7 @@ $(obj)/serialice-gcc.rom: $(obj)/serialice-gcc.elf
$(obj)/serialice-gcc.elf: $(obj)/serialice-gcc.o $(obj)/start.o serialice.ld
$(Q)printf " LINK $(subst $(shell pwd)/,,$(@))\n"
- $(Q)$(CC) $(LDFLAGS) -o $@ $(obj)/serialice-gcc.o $(obj)/start.o
+ $(Q)$(CC) $(LDFLAGS) -o $@ $(obj)/serialice-gcc.o $(obj)/start.o
$(Q)$(NM) $@ | sort -u > $(obj)/serialice-gcc.map
$(obj)/serialice-pre.s: $(SOURCES) $(obj)/xmmstack
diff --git a/SerialICE/README.GDB b/SerialICE/README.GDB
index d842a05..3498a7a 100644
--- a/SerialICE/README.GDB
+++ b/SerialICE/README.GDB
@@ -52,9 +52,9 @@ To disassemble code at the current position, you can do this:
0xec23c: loop 0xec226
0xec23e: mov %bh,%al
0xec240: out %al,$0x61
-0xec242: ret
+0xec242: ret
0xec243: lcall $0xe5db,$0x1ac0
-(gdb)
+(gdb)
Now for the fun part:
@@ -78,7 +78,7 @@ ds 0x1838 6200
es 0x0 0
fs 0xe5db 58843
gs 0xe895 59541
-(gdb)
+(gdb)
Or, with a little bit of context:
(gdb) x/20i ($cs*16)+$eip - 0x10
@@ -88,7 +88,7 @@ Of course you can also change registers:
(gdb) set var $ecx=0x20
(gdb) print $ecx
$1 = 32
-(gdb)
+(gdb)
This is an excellent method to skip long loops.
@@ -101,12 +101,12 @@ Go back to the GDB shell at any time with CTRL-C
^C
Program received signal SIGINT, Interrupt.
0x000038d6 in ?? ()
-(gdb)
+(gdb)
(gdb) display /i ($cs * 16) + $pc
-That will output the current instruction each time you call nexti, stepi, etc.
+That will output the current instruction each time you call nexti, stepi, etc.
It's possible to trace execution with
diff --git a/SerialICE/README.SHELL b/SerialICE/README.SHELL
index 12fe7cd..909aa2b 100644
--- a/SerialICE/README.SHELL
+++ b/SerialICE/README.SHELL
@@ -13,7 +13,7 @@ meant to be used together with a SerialICE capable Qemu (See README.QEMU)
GETTING STARTED
---------------
-First, you have to compile the SerialICE shell for your mainboard.
+First, you have to compile the SerialICE shell for your mainboard.
Configure the SerialICE shell for your mainboard:
$ make menuconfig
@@ -30,7 +30,7 @@ LICENSE AND COPYRIGHT
---------------------
SerialICE mini shell is copyright (C) 2009 coresystems GmbH.
-It is released under the GNU General Public License version 2.
+It is released under the GNU General Public License version 2.
For questions contact <info(a)coresystems.de>
PORTING THE SHELL TO NEW MAINBOARDS
@@ -145,4 +145,3 @@ character command code.
SerialICE v1.5 (Nov 26 2009)
>
-
diff --git a/SerialICE/chipset.c b/SerialICE/chipset.c
index 8ab4515..c9f75ab 100644
--- a/SerialICE/chipset.c
+++ b/SerialICE/chipset.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 coresystems GmbH
*
diff --git a/SerialICE/io.h b/SerialICE/io.h
index a47feef..30accc2 100644
--- a/SerialICE/io.h
+++ b/SerialICE/io.h
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 coresystems GmbH
*
diff --git a/SerialICE/mainboard/amd_serengeti-cheetah.c b/SerialICE/mainboard/amd_serengeti-cheetah.c
index 78505ad..3179b62 100644
--- a/SerialICE/mainboard/amd_serengeti-cheetah.c
+++ b/SerialICE/mainboard/amd_serengeti-cheetah.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 Uwe Hermann <uwe(a)hermann-uwe.de>
* Copyright (C) 2010 Arne Georg Gleditsch <arne.gleditsch(a)numascale.com>
diff --git a/SerialICE/mainboard/asrock_939a785gmh.c b/SerialICE/mainboard/asrock_939a785gmh.c
index 6f8c9be..5c5b588 100644
--- a/SerialICE/mainboard/asrock_939a785gmh.c
+++ b/SerialICE/mainboard/asrock_939a785gmh.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2006 Uwe Hermann <uwe(a)hermann-uwe.de>
* Copyright (C) 2009 Rudolf Marek <r.marek(a)assembler.cz>
diff --git a/SerialICE/mainboard/asus_k8v-x.c b/SerialICE/mainboard/asus_k8v-x.c
index bc3dbe9..68ad177 100644
--- a/SerialICE/mainboard/asus_k8v-x.c
+++ b/SerialICE/mainboard/asus_k8v-x.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2006 Uwe Hermann <uwe(a)hermann-uwe.de>
* Copyright (C) 2009 Rudolf Marek <r.marek(a)assembler.cz>
diff --git a/SerialICE/mainboard/asus_m2v-mx_se.c b/SerialICE/mainboard/asus_m2v-mx_se.c
index cd694fd..06a8ec9 100644
--- a/SerialICE/mainboard/asus_m2v-mx_se.c
+++ b/SerialICE/mainboard/asus_m2v-mx_se.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2006 Uwe Hermann <uwe(a)hermann-uwe.de>
* Copyright (C) 2009 Rudolf Marek <r.marek(a)assembler.cz>
diff --git a/SerialICE/mainboard/asus_m4a77td-pro.c b/SerialICE/mainboard/asus_m4a77td-pro.c
index 6b91f80..3bc15a5 100644
--- a/SerialICE/mainboard/asus_m4a77td-pro.c
+++ b/SerialICE/mainboard/asus_m4a77td-pro.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2006 Uwe Hermann <uwe(a)hermann-uwe.de>
* Copyright (C) 2010 Rudolf Marek <r.marek(a)assembler.cz>
@@ -44,8 +44,8 @@ static void superio_init(void)
static void chipset_init(void)
{
/* stop the mainboard from rebooting */
- /* inspired by coreboot, src/southbridge/amd/sb700/sb700_early_init.c,
- * sb700_lpc_init(), where the comment says:
+ /* inspired by coreboot, src/southbridge/amd/sb700/sb700_early_init.c,
+ * sb700_lpc_init(), where the comment says:
* NOTE: Set BootTimerDisable, otherwise it would keep rebooting!!
* This bit has no meaning if debug strap is not enabled. So if the
* board keeps rebooting and the code fails to reach here, we could
diff --git a/SerialICE/mainboard/asus_p2b.c b/SerialICE/mainboard/asus_p2b.c
index c93045a..068229a 100644
--- a/SerialICE/mainboard/asus_p2b.c
+++ b/SerialICE/mainboard/asus_p2b.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 Mark Marshall <mark.marshall(a)csr.com>
*
diff --git a/SerialICE/mainboard/dell_s1850.c b/SerialICE/mainboard/dell_s1850.c
index b970650..861479f 100644
--- a/SerialICE/mainboard/dell_s1850.c
+++ b/SerialICE/mainboard/dell_s1850.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 coresystems GmbH
*
@@ -32,8 +32,8 @@ static void mainboard_set_ich5(void)
pci_write_config8(PCI_ADDR(0, 0x1f, 0, 0xe3), 0xc0);
pci_write_config8(PCI_ADDR(0, 0x1f, 0, 0xf0), 0x0);
/* disable certain devices -- see data sheet -- this is from
- * dell settings via lspci
- * Note that they leave SMBUS disabled -- 8f6f.
+ * dell settings via lspci
+ * Note that they leave SMBUS disabled -- 8f6f.
* we leave it enabled and visible in config space -- 8f66
*/
pci_write_config16(PCI_ADDR(0, 0x1f, 0, 0xf2), 0x8f66);
@@ -54,7 +54,7 @@ static void mainboard_set_ich5(void)
static inline void ibfzero(void)
{
- while(inb(ipmicsr) & IBF)
+ while(inb(ipmicsr) & IBF)
;
}
static inline void clearobf(void)
@@ -64,7 +64,7 @@ static inline void clearobf(void)
static inline void waitobf(void)
{
- while((inb(ipmicsr) & OBF) == 0)
+ while((inb(ipmicsr) & OBF) == 0)
;
}
diff --git a/SerialICE/mainboard/hp_dl165_g6.c b/SerialICE/mainboard/hp_dl165_g6.c
index 3301ad5..6aff1e9 100644
--- a/SerialICE/mainboard/hp_dl165_g6.c
+++ b/SerialICE/mainboard/hp_dl165_g6.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 Uwe Hermann <uwe(a)hermann-uwe.de>
* Copyright (C) 2010 Arne Georg Gleditsch <arne.gleditsch(a)numascale.com>
diff --git a/SerialICE/mainboard/intel_d94x.c b/SerialICE/mainboard/intel_d94x.c
index 02eb701..50bbe87 100644
--- a/SerialICE/mainboard/intel_d94x.c
+++ b/SerialICE/mainboard/intel_d94x.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 coresystems GmbH
*
diff --git a/SerialICE/mainboard/kontron_986lcd-m.c b/SerialICE/mainboard/kontron_986lcd-m.c
index 62d8c46..abde14f 100644
--- a/SerialICE/mainboard/kontron_986lcd-m.c
+++ b/SerialICE/mainboard/kontron_986lcd-m.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 coresystems GmbH
*
diff --git a/SerialICE/mainboard/msi_ms6178.c b/SerialICE/mainboard/msi_ms6178.c
index f0a505a..a4edb5a 100644
--- a/SerialICE/mainboard/msi_ms6178.c
+++ b/SerialICE/mainboard/msi_ms6178.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 Uwe Hermann <uwe(a)hermann-uwe.de>
*
diff --git a/SerialICE/mainboard/rca_rm4100.c b/SerialICE/mainboard/rca_rm4100.c
index 81ff089..bd4aa02 100644
--- a/SerialICE/mainboard/rca_rm4100.c
+++ b/SerialICE/mainboard/rca_rm4100.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 Joseph Smith <joe(a)settoplinux.org>
*
@@ -18,7 +18,7 @@
*/
/* This is a chipset init file for the RCA RM4100 mainboard */
-
+
const char boardname[33]="RCA RM4100 ";
/* Hardware specific functions */
diff --git a/SerialICE/mainboard/roda_rk886ex.c b/SerialICE/mainboard/roda_rk886ex.c
index 048f30d..b93b5c0 100644
--- a/SerialICE/mainboard/roda_rk886ex.c
+++ b/SerialICE/mainboard/roda_rk886ex.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 coresystems GmbH
*
diff --git a/SerialICE/mainboard/televideo_tc7010.c b/SerialICE/mainboard/televideo_tc7010.c
index 9c79e05..b22df9a 100644
--- a/SerialICE/mainboard/televideo_tc7010.c
+++ b/SerialICE/mainboard/televideo_tc7010.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2010 Peter Bannis
*
diff --git a/SerialICE/mainboard/thomson_ip1000.c b/SerialICE/mainboard/thomson_ip1000.c
index d558e42..ff20930 100644
--- a/SerialICE/mainboard/thomson_ip1000.c
+++ b/SerialICE/mainboard/thomson_ip1000.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 Joseph Smith <joe(a)settoplinux.org>
*
diff --git a/SerialICE/mainboard/tyan_s2912.c b/SerialICE/mainboard/tyan_s2912.c
index ad7184a..5afbc62 100644
--- a/SerialICE/mainboard/tyan_s2912.c
+++ b/SerialICE/mainboard/tyan_s2912.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 Uwe Hermann <uwe(a)hermann-uwe.de>
* Copyright (C) 2010 Arne Georg Gleditsch <arne.gleditsch(a)numascale.com>
diff --git a/SerialICE/mainboard/wyse_s50.c b/SerialICE/mainboard/wyse_s50.c
index d23d5a9..57a54c5 100644
--- a/SerialICE/mainboard/wyse_s50.c
+++ b/SerialICE/mainboard/wyse_s50.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2011 Nils Jacobs
*
@@ -117,4 +117,4 @@ cs5536_setup_extmsr();
cs5536_setup_iobase();
serial_init();
}
-
+
diff --git a/SerialICE/serial.c b/SerialICE/serial.c
index b5b0778..9188deb 100644
--- a/SerialICE/serial.c
+++ b/SerialICE/serial.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 coresystems GmbH
*
@@ -104,7 +104,7 @@ static void sio_put8(u8 data)
{
int i;
u8 c;
-
+
c = (data >> 4) & 0xf;
sio_put_nibble(c);
@@ -193,5 +193,3 @@ static u32 sio_get32(void)
return data;
}
-
-
diff --git a/SerialICE/serialice.c b/SerialICE/serialice.c
index 649ee11..56f6dac 100644
--- a/SerialICE/serialice.c
+++ b/SerialICE/serialice.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 coresystems GmbH
*
@@ -168,7 +168,7 @@ static void serialice_cpuinfo(void)
/* This code looks quite crappy but this way we don't
* have to worry about running out of registers if we
- * occupy eax, ebx, ecx, edx at the same time
+ * occupy eax, ebx, ecx, edx at the same time
*/
reg32 = cpuid_eax(eax, ecx);
sio_put32(reg32);
diff --git a/SerialICE/serialice.h b/SerialICE/serialice.h
index 40dae1c..ab8a26a 100644
--- a/SerialICE/serialice.h
+++ b/SerialICE/serialice.h
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 coresystems GmbH
*
diff --git a/SerialICE/serialice.ld b/SerialICE/serialice.ld
index 163a4c5..f43d9f2 100644
--- a/SerialICE/serialice.ld
+++ b/SerialICE/serialice.ld
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 coresystems GmbH
*
diff --git a/SerialICE/simba/replay.lua b/SerialICE/simba/replay.lua
index 4632c05..8ec3b0a 100644
--- a/SerialICE/simba/replay.lua
+++ b/SerialICE/simba/replay.lua
@@ -121,7 +121,7 @@ end
function parse_cpuid(line)
local id_op = "CPUID%: eax%: (%x+)%; ecx%: (%x+) => (%x+).(%x+).(%x+).(%x+)"
local id_op_old = "CPU%: CPUID eax%: (%x+)%; ecx%: (%x+) => (%x+).(%x+).(%x+).(%x+)"
- local found, idx0, idx1, eax, ebx, ecx, edx
+ local found, idx0, idx1, eax, ebx, ecx, edx
found, _, idx0, idx1, eax, ebx, ecx, edx = string.find(line, id_op)
if not found then
found, _, idx0, idx1, eax, ebx, ecx, edx = string.find(line, id_op_old)
@@ -196,7 +196,7 @@ function parse_file()
end
if not iplog then
- iplog, _, a, b, f, cs, eip, str =
+ iplog, _, a, b, f, cs, eip, str =
string.find(line, "(%x+)[%.:](%x+)%s+([^ ]*)%s+%[(%x+):(%x+)%]...(.*)")
if iplog and not f then
f = "R###"
diff --git a/SerialICE/start.S b/SerialICE/start.S
index 1e43f98..2ec0bb3 100644
--- a/SerialICE/start.S
+++ b/SerialICE/start.S
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 coresystems GmbH
*
diff --git a/SerialICE/types.h b/SerialICE/types.h
index a712b09..7ddeafa 100644
--- a/SerialICE/types.h
+++ b/SerialICE/types.h
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 coresystems GmbH
*
diff --git a/SerialICE/util/kconfig/lex.zconf.c_shipped b/SerialICE/util/kconfig/lex.zconf.c_shipped
index 1911092..a22db46 100644
--- a/SerialICE/util/kconfig/lex.zconf.c_shipped
+++ b/SerialICE/util/kconfig/lex.zconf.c_shipped
@@ -52,7 +52,7 @@
#if __STDC_VERSION__ >= 199901L
/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
- * if you want the limit (max/min) macros for int types.
+ * if you want the limit (max/min) macros for int types.
*/
#ifndef __STDC_LIMIT_MACROS
#define __STDC_LIMIT_MACROS 1
@@ -69,7 +69,7 @@ typedef uint32_t flex_uint32_t;
typedef signed char flex_int8_t;
typedef short int flex_int16_t;
typedef int flex_int32_t;
-typedef unsigned char flex_uint8_t;
+typedef unsigned char flex_uint8_t;
typedef unsigned short int flex_uint16_t;
typedef unsigned int flex_uint32_t;
#endif /* ! C99 */
@@ -179,7 +179,7 @@ extern FILE *zconfin, *zconfout;
#define EOB_ACT_LAST_MATCH 2
#define YY_LESS_LINENO(n)
-
+
/* Return all but the first "n" matched characters back to the input stream. */
#define yyless(n) \
do \
@@ -246,7 +246,7 @@ struct yy_buffer_state
int yy_bs_lineno; /**< The line count. */
int yy_bs_column; /**< The column count. */
-
+
/* Whether to try to fill the input buffer when we reach the
* end of it.
*/
@@ -866,7 +866,7 @@ extern int zconfwrap (void );
#endif
static void yyunput (int c,char *buf_ptr );
-
+
#ifndef yytext_ptr
static void yy_flex_strncpy (char *,yyconst char *,int );
#endif
@@ -971,7 +971,7 @@ YY_DECL
register yy_state_type yy_current_state;
register char *yy_cp, *yy_bp;
register int yy_act;
-
+
int str = 0;
int ts, i;
@@ -1574,7 +1574,7 @@ static int yy_get_next_buffer (void)
{
register yy_state_type yy_current_state;
register char *yy_cp;
-
+
yy_current_state = (yy_start);
for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
@@ -1593,7 +1593,7 @@ static int yy_get_next_buffer (void)
static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
{
register int yy_is_jam;
-
+
yy_current_state = yy_nxt[yy_current_state][1];
yy_is_jam = (yy_current_state <= 0);
@@ -1603,7 +1603,7 @@ static int yy_get_next_buffer (void)
static void yyunput (int c, register char * yy_bp )
{
register char *yy_cp;
-
+
yy_cp = (yy_c_buf_p);
/* undo effects of setting up zconftext */
@@ -1646,7 +1646,7 @@ static int yy_get_next_buffer (void)
{
int c;
-
+
*(yy_c_buf_p) = (yy_hold_char);
if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
@@ -1713,12 +1713,12 @@ static int yy_get_next_buffer (void)
/** Immediately switch to a different input stream.
* @param input_file A readable stream.
- *
+ *
* @note This function does not reset the start condition to @c INITIAL .
*/
void zconfrestart (FILE * input_file )
{
-
+
if ( ! YY_CURRENT_BUFFER ){
zconfensure_buffer_stack ();
YY_CURRENT_BUFFER_LVALUE =
@@ -1731,11 +1731,11 @@ static int yy_get_next_buffer (void)
/** Switch to a different input buffer.
* @param new_buffer The new input buffer.
- *
+ *
*/
void zconf_switch_to_buffer (YY_BUFFER_STATE new_buffer )
{
-
+
/* TODO. We should be able to replace this entire function body
* with
* zconfpop_buffer_state();
@@ -1775,13 +1775,13 @@ static void zconf_load_buffer_state (void)
/** Allocate and initialize an input buffer state.
* @param file A readable stream.
* @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
- *
+ *
* @return the allocated buffer state.
*/
YY_BUFFER_STATE zconf_create_buffer (FILE * file, int size )
{
YY_BUFFER_STATE b;
-
+
b = (YY_BUFFER_STATE) zconfalloc(sizeof( struct yy_buffer_state ) );
if ( ! b )
YY_FATAL_ERROR( "out of dynamic memory in zconf_create_buffer()" );
@@ -1804,11 +1804,11 @@ static void zconf_load_buffer_state (void)
/** Destroy the buffer.
* @param b a buffer created with zconf_create_buffer()
- *
+ *
*/
void zconf_delete_buffer (YY_BUFFER_STATE b )
{
-
+
if ( ! b )
return;
@@ -1829,7 +1829,7 @@ static void zconf_load_buffer_state (void)
{
int oerrno = errno;
-
+
zconf_flush_buffer(b );
b->yy_input_file = file;
@@ -1845,13 +1845,13 @@ static void zconf_load_buffer_state (void)
}
b->yy_is_interactive = 0;
-
+
errno = oerrno;
}
/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
* @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
- *
+ *
*/
void zconf_flush_buffer (YY_BUFFER_STATE b )
{
@@ -1880,7 +1880,7 @@ static void zconf_load_buffer_state (void)
* the current state. This function will allocate the stack
* if necessary.
* @param new_buffer The new state.
- *
+ *
*/
void zconfpush_buffer_state (YY_BUFFER_STATE new_buffer )
{
@@ -1910,7 +1910,7 @@ void zconfpush_buffer_state (YY_BUFFER_STATE new_buffer )
/** Removes and deletes the top of the stack, if present.
* The next element becomes the new top.
- *
+ *
*/
void zconfpop_buffer_state (void)
{
@@ -1934,7 +1934,7 @@ void zconfpop_buffer_state (void)
static void zconfensure_buffer_stack (void)
{
int num_to_alloc;
-
+
if (!(yy_buffer_stack)) {
/* First allocation is just for 2 elements, since we don't know if this
@@ -1973,13 +1973,13 @@ static void zconfensure_buffer_stack (void)
/** Setup the input buffer state to scan directly from a user-specified character buffer.
* @param base the character buffer
* @param size the size in bytes of the character buffer
- *
- * @return the newly allocated buffer state object.
+ *
+ * @return the newly allocated buffer state object.
*/
YY_BUFFER_STATE zconf_scan_buffer (char * base, yy_size_t size )
{
YY_BUFFER_STATE b;
-
+
if ( size < 2 ||
base[size-2] != YY_END_OF_BUFFER_CHAR ||
base[size-1] != YY_END_OF_BUFFER_CHAR )
@@ -2008,14 +2008,14 @@ YY_BUFFER_STATE zconf_scan_buffer (char * base, yy_size_t size )
/** Setup the input buffer state to scan a string. The next call to zconflex() will
* scan from a @e copy of @a str.
* @param str a NUL-terminated string to scan
- *
+ *
* @return the newly allocated buffer state object.
* @note If you want to scan bytes that may contain NUL values, then use
* zconf_scan_bytes() instead.
*/
YY_BUFFER_STATE zconf_scan_string (yyconst char * yystr )
{
-
+
return zconf_scan_bytes(yystr,strlen(yystr) );
}
@@ -2023,7 +2023,7 @@ YY_BUFFER_STATE zconf_scan_string (yyconst char * yystr )
* scan from a @e copy of @a bytes.
* @param bytes the byte buffer to scan
* @param len the number of bytes in the buffer pointed to by @a bytes.
- *
+ *
* @return the newly allocated buffer state object.
*/
YY_BUFFER_STATE zconf_scan_bytes (yyconst char * yybytes, int _yybytes_len )
@@ -2032,7 +2032,7 @@ YY_BUFFER_STATE zconf_scan_bytes (yyconst char * yybytes, int _yybytes_len )
char *buf;
yy_size_t n;
int i;
-
+
/* Get memory for full buffer, including space for trailing EOB's. */
n = _yybytes_len + 2;
buf = (char *) zconfalloc(n );
@@ -2086,16 +2086,16 @@ static void yy_fatal_error (yyconst char* msg )
/* Accessor methods (get/set functions) to struct members. */
/** Get the current line number.
- *
+ *
*/
int zconfget_lineno (void)
{
-
+
return zconflineno;
}
/** Get the input stream.
- *
+ *
*/
FILE *zconfget_in (void)
{
@@ -2103,7 +2103,7 @@ FILE *zconfget_in (void)
}
/** Get the output stream.
- *
+ *
*/
FILE *zconfget_out (void)
{
@@ -2111,7 +2111,7 @@ FILE *zconfget_out (void)
}
/** Get the length of the current token.
- *
+ *
*/
int zconfget_leng (void)
{
@@ -2119,7 +2119,7 @@ int zconfget_leng (void)
}
/** Get the current token.
- *
+ *
*/
char *zconfget_text (void)
@@ -2129,18 +2129,18 @@ char *zconfget_text (void)
/** Set the current line number.
* @param line_number
- *
+ *
*/
void zconfset_lineno (int line_number )
{
-
+
zconflineno = line_number;
}
/** Set the input stream. This does not discard the current
* input buffer.
* @param in_str A readable stream.
- *
+ *
* @see zconf_switch_to_buffer
*/
void zconfset_in (FILE * in_str )
@@ -2194,7 +2194,7 @@ static int yy_init_globals (void)
/* zconflex_destroy is for both reentrant and non-reentrant scanners. */
int zconflex_destroy (void)
{
-
+
/* Pop the buffer stack, destroying each element. */
while(YY_CURRENT_BUFFER){
zconf_delete_buffer(YY_CURRENT_BUFFER );
diff --git a/SerialICE/util/kconfig/lxdialog/BIG.FAT.WARNING b/SerialICE/util/kconfig/lxdialog/BIG.FAT.WARNING
index a8999d8..7cb5a7e 100644
--- a/SerialICE/util/kconfig/lxdialog/BIG.FAT.WARNING
+++ b/SerialICE/util/kconfig/lxdialog/BIG.FAT.WARNING
@@ -1,4 +1,4 @@
This is NOT the official version of dialog. This version has been
significantly modified from the original. It is for use by the Linux
-kernel configuration script. Please do not bother Savio Lam with
+kernel configuration script. Please do not bother Savio Lam with
questions about this program.
diff --git a/SerialICE/util/kconfig/lxdialog/menubox.c b/SerialICE/util/kconfig/lxdialog/menubox.c
index fa9d633..c689fc0 100644
--- a/SerialICE/util/kconfig/lxdialog/menubox.c
+++ b/SerialICE/util/kconfig/lxdialog/menubox.c
@@ -26,7 +26,7 @@
*
* *) A bugfix for the Page-Down problem
*
- * *) Formerly when I used Page Down and Page Up, the cursor would be set
+ * *) Formerly when I used Page Down and Page Up, the cursor would be set
* to the first position in the menu box. Now lxdialog is a bit
* smarter and works more like other menu systems (just have a look at
* it).
diff --git a/SerialICE/util/kconfig/regex.c b/SerialICE/util/kconfig/regex.c
index 8169880..e63c814 100644
--- a/SerialICE/util/kconfig/regex.c
+++ b/SerialICE/util/kconfig/regex.c
@@ -75,7 +75,7 @@ char *realloc ();
/* This must be nonzero for the wordchar and notwordchar pattern
commands in re_match_2. */
-#ifndef Sword
+#ifndef Sword
#define Sword 1
#endif
@@ -173,8 +173,8 @@ init_syntax_once ()
use `alloca' instead of `malloc'. This is because using malloc in
re_search* or re_match* could cause memory leaks when C-g is used in
Emacs; also, malloc is slower and causes storage fragmentation. On
- the other hand, malloc is more portable, and easier to debug.
-
+ the other hand, malloc is more portable, and easier to debug.
+
Because we sometimes use alloca, some routines have to be macros,
not functions -- `alloca'-allocated space disappears at the end of the
function it is called in. */
@@ -199,7 +199,7 @@ init_syntax_once ()
#ifndef _AIX /* Already did AIX, up at the top. */
char *alloca ();
#endif /* not _AIX */
-#endif /* not HAVE_ALLOCA_H */
+#endif /* not HAVE_ALLOCA_H */
#endif /* not __GNUC__ */
#endif /* not alloca */
@@ -302,9 +302,9 @@ typedef enum
/* Analogously, for end of buffer/string. */
endbuf,
-
+
/* Followed by two byte relative address to which to jump. */
- jump,
+ jump,
/* Same as jump, but marks the end of an alternative. */
jump_past_alt,
@@ -312,11 +312,11 @@ typedef enum
/* Followed by two-byte relative address of place to resume at
in case of failure. */
on_failure_jump,
-
+
/* Like on_failure_jump, but pushes a placeholder instead of the
current string position when executed. */
on_failure_keep_string_jump,
-
+
/* Throw away latest failure point and then jump to following
two-byte relative address. */
pop_failure_jump,
@@ -412,7 +412,7 @@ extract_number (dest, source)
int *dest;
unsigned char *source;
{
- int temp = SIGN_EXTEND_CHAR (*(source + 1));
+ int temp = SIGN_EXTEND_CHAR (*(source + 1));
*dest = *source & 0377;
*dest += temp << 8;
}
@@ -438,7 +438,7 @@ static void
extract_number_and_incr (destination, source)
int *destination;
unsigned char **source;
-{
+{
extract_number (destination, *source);
*source += 2;
}
@@ -487,8 +487,8 @@ print_fastmap (fastmap)
char *fastmap;
{
unsigned was_a_range = 0;
- unsigned i = 0;
-
+ unsigned i = 0;
+
while (i < (1 << BYTEWIDTH))
{
if (fastmap[i++])
@@ -507,7 +507,7 @@ print_fastmap (fastmap)
}
}
}
- putchar ('\n');
+ putchar ('\n');
}
@@ -528,7 +528,7 @@ print_partial_compiled_pattern (start, end)
printf ("(null)\n");
return;
}
-
+
/* Loop over pattern commands. */
while (p < pend)
{
@@ -574,14 +574,14 @@ print_partial_compiled_pattern (start, end)
printf ("/charset%s",
(re_opcode_t) *(p - 1) == charset_not ? "_not" : "");
-
+
assert (p + *p < pend);
for (c = 0; c < *p; c++)
{
unsigned bit;
unsigned char map_byte = p[1 + c];
-
+
putchar ('/');
for (bit = 0; bit < BYTEWIDTH; bit++)
@@ -618,7 +618,7 @@ print_partial_compiled_pattern (start, end)
case push_dummy_failure:
printf ("/push_dummy_failure");
break;
-
+
case maybe_pop_jump:
extract_number_and_incr (&mcnt, &p);
printf ("/maybe_pop_jump/0/%d", mcnt);
@@ -627,36 +627,36 @@ print_partial_compiled_pattern (start, end)
case pop_failure_jump:
extract_number_and_incr (&mcnt, &p);
printf ("/pop_failure_jump/0/%d", mcnt);
- break;
-
+ break;
+
case jump_past_alt:
extract_number_and_incr (&mcnt, &p);
printf ("/jump_past_alt/0/%d", mcnt);
- break;
-
+ break;
+
case jump:
extract_number_and_incr (&mcnt, &p);
printf ("/jump/0/%d", mcnt);
break;
- case succeed_n:
+ case succeed_n:
extract_number_and_incr (&mcnt, &p);
extract_number_and_incr (&mcnt2, &p);
printf ("/succeed_n/0/%d/0/%d", mcnt, mcnt2);
break;
-
- case jump_n:
+
+ case jump_n:
extract_number_and_incr (&mcnt, &p);
extract_number_and_incr (&mcnt2, &p);
printf ("/jump_n/0/%d/0/%d", mcnt, mcnt2);
break;
-
- case set_number_at:
+
+ case set_number_at:
extract_number_and_incr (&mcnt, &p);
extract_number_and_incr (&mcnt2, &p);
printf ("/set_number_at/0/%d/0/%d", mcnt, mcnt2);
break;
-
+
case wordbound:
printf ("/wordbound");
break;
@@ -668,10 +668,10 @@ print_partial_compiled_pattern (start, end)
case wordbeg:
printf ("/wordbeg");
break;
-
+
case wordend:
printf ("/wordend");
-
+
#ifdef emacs
case before_dot:
printf ("/before_dot");
@@ -690,7 +690,7 @@ print_partial_compiled_pattern (start, end)
mcnt = *p++;
printf ("/%d", mcnt);
break;
-
+
case notsyntaxspec:
printf ("/notsyntaxspec");
mcnt = *p++;
@@ -701,7 +701,7 @@ print_partial_compiled_pattern (start, end)
case wordchar:
printf ("/wordchar");
break;
-
+
case notwordchar:
printf ("/notwordchar");
break;
@@ -758,7 +758,7 @@ print_double_string (where, string1, size1, string2, size2)
int size2;
{
unsigned this_char;
-
+
if (where == NULL)
printf ("(null)");
else
@@ -768,7 +768,7 @@ print_double_string (where, string1, size1, string2, size2)
for (this_char = where - string1; this_char < size1; this_char++)
printchar (string1[this_char]);
- where = string2;
+ where = string2;
}
for (this_char = where - string2; this_char < size2; this_char++)
@@ -809,7 +809,7 @@ re_set_syntax (syntax)
reg_syntax_t syntax;
{
reg_syntax_t ret = re_syntax_options;
-
+
re_syntax_options = syntax;
return ret;
}
@@ -845,7 +845,7 @@ static boolean at_begline_loc_p (), at_endline_loc_p ();
static boolean group_in_compile_stack ();
static reg_errcode_t compile_range ();
-/* Fetch the next character in the uncompiled pattern---translating it
+/* Fetch the next character in the uncompiled pattern---translating it
if necessary. Also cast from a signed character in the constant
string passed to us by the user to an unsigned char that we can use
as an array index (in, e.g., `translate'). */
@@ -985,7 +985,7 @@ typedef struct
pattern_offset_t begalt_offset;
pattern_offset_t fixup_alt_jump;
pattern_offset_t inner_group_offset;
- pattern_offset_t laststart_offset;
+ pattern_offset_t laststart_offset;
regnum_t regnum;
} compile_stack_elt_t;
@@ -1028,7 +1028,7 @@ typedef struct
PATFETCH (c); \
} \
} \
- }
+ }
#define CHAR_CLASS_MAX_LENGTH 6 /* Namely, `xdigit'. */
@@ -1054,7 +1054,7 @@ typedef struct
`fastmap_accurate' is zero;
`re_nsub' is the number of subexpressions in PATTERN;
`not_bol' and `not_eol' are zero;
-
+
The `fastmap' and `newline_anchor' fields are neither
examined nor set. */
@@ -1069,20 +1069,20 @@ regex_compile (pattern, size, syntax, bufp)
`char *' (i.e., signed), we declare these variables as unsigned, so
they can be reliably used as array indices. */
register unsigned char c, c1;
-
+
/* A random tempory spot in PATTERN. */
const char *p1;
/* Points to the end of the buffer, where we should append. */
register unsigned char *b;
-
+
/* Keeps track of unclosed groups. */
compile_stack_type compile_stack;
/* Points to the current (ending) position in the pattern. */
const char *p = pattern;
const char *pend = pattern + size;
-
+
/* How to translate the characters in the pattern. */
char *translate = bufp->translate;
@@ -1103,7 +1103,7 @@ regex_compile (pattern, size, syntax, bufp)
/* Place in the uncompiled pattern (i.e., the {) to
which to go back if the interval is invalid. */
const char *beg_interval;
-
+
/* Address of the place where a forward jump should go to the end of
the containing expression. Each alternative of an `or' -- except the
last -- ends with a forward jump of this sort. */
@@ -1119,7 +1119,7 @@ regex_compile (pattern, size, syntax, bufp)
if (debug)
{
unsigned debug_count;
-
+
for (debug_count = 0; debug_count < size; debug_count++)
printchar (pattern[debug_count]);
putchar ('\n');
@@ -1143,9 +1143,9 @@ regex_compile (pattern, size, syntax, bufp)
printer (for debugging) will think there's no pattern. We reset it
at the end. */
bufp->used = 0;
-
+
/* Always count groups, whether or not bufp->no_sub is set. */
- bufp->re_nsub = 0;
+ bufp->re_nsub = 0;
#if !defined (emacs) && !defined (SYNTAX_TABLE)
/* Initialize the syntax table. */
@@ -1196,7 +1196,7 @@ regex_compile (pattern, size, syntax, bufp)
case '$':
{
if ( /* If at end of pattern, it's an operator. */
- p == pend
+ p == pend
/* If context independent, it's an operator. */
|| syntax & RE_CONTEXT_INDEP_ANCHORS
/* Otherwise, depends on what's next. */
@@ -1227,7 +1227,7 @@ regex_compile (pattern, size, syntax, bufp)
{
/* Are we optimizing this jump? */
boolean keep_string_p = false;
-
+
/* 1 means zero (many) matches is allowed. */
char zero_times_ok = 0, many_times_ok = 0;
@@ -1275,7 +1275,7 @@ regex_compile (pattern, size, syntax, bufp)
/* Star, etc. applied to an empty pattern is equivalent
to an empty pattern. */
- if (!laststart)
+ if (!laststart)
break;
/* Now we know whether or not zero matches is allowed
@@ -1284,7 +1284,7 @@ regex_compile (pattern, size, syntax, bufp)
{ /* More than one repetition is allowed, so put in at the
end a backward relative jump from `b' to before the next
jump we're going to put in below (which jumps from
- laststart to after this jump).
+ laststart to after this jump).
But if we are at the `*' in the exact sequence `.*\n',
insert an unconditional jump backwards to the .,
@@ -1361,7 +1361,7 @@ regex_compile (pattern, size, syntax, bufp)
/* We test `*p == '^' twice, instead of using an if
statement, so we only need one BUF_PUSH. */
- BUF_PUSH (*p == '^' ? charset_not : charset);
+ BUF_PUSH (*p == '^' ? charset_not : charset);
if (*p == '^')
p++;
@@ -1411,8 +1411,8 @@ regex_compile (pattern, size, syntax, bufp)
was a character: if this is a hyphen not at the
beginning or the end of a list, then it's the range
operator. */
- if (c == '-'
- && !(p - 2 >= pattern && p[-2] == '[')
+ if (c == '-'
+ && !(p - 2 >= pattern && p[-2] == '[')
&& !(p - 3 >= pattern && p[-3] == '[' && p[-2] == '^')
&& *p != ']')
{
@@ -1427,7 +1427,7 @@ regex_compile (pattern, size, syntax, bufp)
/* Move past the `-'. */
PATFETCH (c1);
-
+
ret = compile_range (&p, pend, translate, syntax, b);
if (ret != REG_NOERROR) return ret;
}
@@ -1456,7 +1456,7 @@ regex_compile (pattern, size, syntax, bufp)
str[c1] = '\0';
/* If isn't a word bracketed by `[:' and:`]':
- undo the ending character, the letters, and leave
+ undo the ending character, the letters, and leave
the leading `:' and `[' (but set bits for them). */
if (c == ':' && *p == ']')
{
@@ -1473,12 +1473,12 @@ regex_compile (pattern, size, syntax, bufp)
boolean is_space = STREQ (str, "space");
boolean is_upper = STREQ (str, "upper");
boolean is_xdigit = STREQ (str, "xdigit");
-
+
if (!IS_CHAR_CLASS (str)) return REG_ECTYPE;
/* Throw away the ] at the end of the character
class. */
- PATFETCH (c);
+ PATFETCH (c);
if (p == pend) return REG_EBRACK;
@@ -1503,7 +1503,7 @@ regex_compile (pattern, size, syntax, bufp)
else
{
c1++;
- while (c1--)
+ while (c1--)
PATUNFETCH;
SET_LIST_BIT ('[');
SET_LIST_BIT (':');
@@ -1519,8 +1519,8 @@ regex_compile (pattern, size, syntax, bufp)
/* Discard any (non)matching list bytes that are all 0 at the
end of the map. Decrease the map-length byte too. */
- while ((int) b[-1] > 0 && b[b[-1] - 1] == 0)
- b[-1]--;
+ while ((int) b[-1] > 0 && b[b[-1] - 1] == 0)
+ b[-1]--;
b += b[-1];
}
break;
@@ -1580,7 +1580,7 @@ regex_compile (pattern, size, syntax, bufp)
regnum++;
if (COMPILE_STACK_FULL)
- {
+ {
RETALLOC (compile_stack.stack, compile_stack.size << 1,
compile_stack_elt_t);
if (compile_stack.stack == NULL) return REG_ESPACE;
@@ -1593,7 +1593,7 @@ regex_compile (pattern, size, syntax, bufp)
whole pattern moves because of realloc, they will still
be valid. */
COMPILE_STACK_TOP.begalt_offset = begalt - bufp->buffer;
- COMPILE_STACK_TOP.fixup_alt_jump
+ COMPILE_STACK_TOP.fixup_alt_jump
= fixup_alt_jump ? fixup_alt_jump - bufp->buffer + 1 : 0;
COMPILE_STACK_TOP.laststart_offset = b - bufp->buffer;
COMPILE_STACK_TOP.regnum = regnum;
@@ -1607,7 +1607,7 @@ regex_compile (pattern, size, syntax, bufp)
COMPILE_STACK_TOP.inner_group_offset = b - bufp->buffer + 2;
BUF_PUSH_3 (start_memory, regnum, 0);
}
-
+
compile_stack.avail++;
fixup_alt_jump = 0;
@@ -1636,7 +1636,7 @@ regex_compile (pattern, size, syntax, bufp)
`pop_failure_jump' to pop. See comments at
`push_dummy_failure' in `re_match_2'. */
BUF_PUSH (push_dummy_failure);
-
+
/* We allocated space for this jump when we assigned
to `fixup_alt_jump', in the `handle_alt' case below. */
STORE_JUMP (jump_past_alt, fixup_alt_jump, b - 1);
@@ -1658,11 +1658,11 @@ regex_compile (pattern, size, syntax, bufp)
as in `(ab)c(de)' -- the second group is #2. */
regnum_t this_group_regnum;
- compile_stack.avail--;
+ compile_stack.avail--;
begalt = bufp->buffer + COMPILE_STACK_TOP.begalt_offset;
fixup_alt_jump
= COMPILE_STACK_TOP.fixup_alt_jump
- ? bufp->buffer + COMPILE_STACK_TOP.fixup_alt_jump - 1
+ ? bufp->buffer + COMPILE_STACK_TOP.fixup_alt_jump - 1
: 0;
laststart = bufp->buffer + COMPILE_STACK_TOP.laststart_offset;
this_group_regnum = COMPILE_STACK_TOP.regnum;
@@ -1677,7 +1677,7 @@ regex_compile (pattern, size, syntax, bufp)
{
unsigned char *inner_group_loc
= bufp->buffer + COMPILE_STACK_TOP.inner_group_offset;
-
+
*inner_group_loc = regnum - this_group_regnum;
BUF_PUSH_3 (stop_memory, this_group_regnum,
regnum - this_group_regnum);
@@ -1706,10 +1706,10 @@ regex_compile (pattern, size, syntax, bufp)
jump (put in below, which in turn will jump to the next
(if any) alternative's such jump, etc.). The last such
jump jumps to the correct final destination. A picture:
- _____ _____
- | | | |
- | v | v
- a | b | c
+ _____ _____
+ | | | |
+ | v | v
+ a | b | c
If we are at `b', then fixup_alt_jump right now points to a
three-byte space after `a'. We'll put in the jump, set
@@ -1731,10 +1731,10 @@ regex_compile (pattern, size, syntax, bufp)
break;
- case '{':
+ case '{':
/* If \{ is a literal. */
if (!(syntax & RE_INTERVALS)
- /* If we're at `\{' and it's not the open-interval
+ /* If we're at `\{' and it's not the open-interval
operator. */
|| ((syntax & RE_INTERVALS) && (syntax & RE_NO_BK_BRACES))
|| (p - 2 == pattern && p == pend))
@@ -1773,11 +1773,11 @@ regex_compile (pattern, size, syntax, bufp)
{
if (syntax & RE_NO_BK_BRACES)
goto unfetch_interval;
- else
+ else
return REG_BADBR;
}
- if (!(syntax & RE_NO_BK_BRACES))
+ if (!(syntax & RE_NO_BK_BRACES))
{
if (c != '\\') return REG_EBRACE;
@@ -1788,7 +1788,7 @@ regex_compile (pattern, size, syntax, bufp)
{
if (syntax & RE_NO_BK_BRACES)
goto unfetch_interval;
- else
+ else
return REG_BADBR;
}
@@ -1824,7 +1824,7 @@ regex_compile (pattern, size, syntax, bufp)
jump_n <succeed_n addr> <jump count>
(The upper bound and `jump_n' are omitted if
`upper_bound' is 1, though.) */
- else
+ else
{ /* If the upper bound is > 1, we need to insert
more at the end of the loop. */
unsigned nbytes = 10 + (upper_bound > 1) * 10;
@@ -1841,7 +1841,7 @@ regex_compile (pattern, size, syntax, bufp)
lower_bound);
b += 5;
- /* Code to initialize the lower bound. Insert
+ /* Code to initialize the lower bound. Insert
before the `succeed_n'. The `5' is the last two
bytes of this `set_number_at', plus 3 bytes of
the following `succeed_n'. */
@@ -1852,7 +1852,7 @@ regex_compile (pattern, size, syntax, bufp)
{ /* More than one repetition is allowed, so
append a backward jump to the `succeed_n'
that starts this interval.
-
+
When we've reached this during matching,
we'll have matched the interval once, so
jump back only `upper_bound - 1' times. */
@@ -1870,7 +1870,7 @@ regex_compile (pattern, size, syntax, bufp)
so everything is getting moved up by 5.
Conclusion: (b - 2) - (laststart + 3) + 5,
i.e., b - laststart.
-
+
We insert this at the beginning of the loop
so that if we fail during matching, we'll
reinitialize the bounds. */
@@ -1891,7 +1891,7 @@ regex_compile (pattern, size, syntax, bufp)
beg_interval = NULL;
/* normal_char and normal_backslash need `c'. */
- PATFETCH (c);
+ PATFETCH (c);
if (!(syntax & RE_NO_BK_BRACES))
{
@@ -1907,7 +1907,7 @@ regex_compile (pattern, size, syntax, bufp)
BUF_PUSH (at_dot);
break;
- case 's':
+ case 's':
laststart = b;
PATFETCH (c);
BUF_PUSH_2 (syntaxspec, syntax_spec_code[c]);
@@ -1998,11 +1998,11 @@ regex_compile (pattern, size, syntax, bufp)
/* Expects the character in `c'. */
normal_char:
/* If no exactn currently being built. */
- if (!pending_exact
+ if (!pending_exact
/* If last exactn not at current position. */
|| pending_exact + *pending_exact + 1 != b
-
+
/* We have only one byte following the exactn for the count. */
|| *pending_exact == (1 << BYTEWIDTH) - 1
@@ -2017,26 +2017,26 @@ regex_compile (pattern, size, syntax, bufp)
: (p[0] == '\\' && p[1] == '{'))))
{
/* Start building a new exactn. */
-
+
laststart = b;
BUF_PUSH_2 (exactn, 0);
pending_exact = b - 1;
}
-
+
BUF_PUSH (c);
(*pending_exact)++;
break;
} /* switch (c) */
} /* while p != pend */
-
+
/* Through the pattern now. */
-
+
if (fixup_alt_jump)
STORE_JUMP (jump_past_alt, fixup_alt_jump, b);
- if (!COMPILE_STACK_EMPTY)
+ if (!COMPILE_STACK_EMPTY)
return REG_EPAREN;
free (compile_stack.stack);
@@ -2092,14 +2092,14 @@ insert_op1 (op, loc, arg, end)
re_opcode_t op;
unsigned char *loc;
int arg;
- unsigned char *end;
+ unsigned char *end;
{
register unsigned char *pfrom = end;
register unsigned char *pto = end + 3;
while (pfrom != loc)
*--pto = *--pfrom;
-
+
store_op1 (op, loc, arg);
}
@@ -2111,14 +2111,14 @@ insert_op2 (op, loc, arg1, arg2, end)
re_opcode_t op;
unsigned char *loc;
int arg1, arg2;
- unsigned char *end;
+ unsigned char *end;
{
register unsigned char *pfrom = end;
register unsigned char *pto = end + 5;
while (pfrom != loc)
*--pto = *--pfrom;
-
+
store_op2 (op, loc, arg1, arg2);
}
@@ -2134,7 +2134,7 @@ at_begline_loc_p (pattern, p, syntax)
{
const char *prev = p - 2;
boolean prev_prev_backslash = prev > pattern && prev[-1] == '\\';
-
+
return
/* After a subexpression? */
(*prev == '(' && (syntax & RE_NO_BK_PARENS || prev_prev_backslash))
@@ -2154,7 +2154,7 @@ at_endline_loc_p (p, pend, syntax)
const char *next = p;
boolean next_backslash = *next == '\\';
const char *next_next = p + 1 < pend ? p + 1 : NULL;
-
+
return
/* Before a subexpression? */
(syntax & RE_NO_BK_PARENS ? *next == ')'
@@ -2165,7 +2165,7 @@ at_endline_loc_p (p, pend, syntax)
}
-/* Returns true if REGNUM is in one of COMPILE_STACK's elements and
+/* Returns true if REGNUM is in one of COMPILE_STACK's elements and
false if it's not. */
static boolean
@@ -2175,8 +2175,8 @@ group_in_compile_stack (compile_stack, regnum)
{
int this_element;
- for (this_element = compile_stack.avail - 1;
- this_element >= 0;
+ for (this_element = compile_stack.avail - 1;
+ this_element >= 0;
this_element--)
if (compile_stack.stack[this_element].regnum == regnum)
return true;
@@ -2190,9 +2190,9 @@ group_in_compile_stack (compile_stack, regnum)
starting character is in `P[-2]'. (`P[-1]' is the character `-'.)
Then we set the translation of all bits between the starting and
ending characters (inclusive) in the compiled pattern B.
-
+
Return an error code.
-
+
We use these short variable names so we can use the same macros as
`regex_compile' itself. */
@@ -2207,7 +2207,7 @@ compile_range (p_ptr, pend, translate, syntax, b)
const char *p = *p_ptr;
int range_start, range_end;
-
+
if (p == pend)
return REG_ERANGE;
@@ -2216,7 +2216,7 @@ compile_range (p_ptr, pend, translate, syntax, b)
is set, the range endpoints will be negative if we fetch using a
signed char *.
- We also want to fetch the endpoints without translating them; the
+ We also want to fetch the endpoints without translating them; the
appropriate translation is done in the bit-setting loop below. */
range_start = ((unsigned char *) p)[-2];
range_end = ((unsigned char *) p)[0];
@@ -2237,14 +2237,14 @@ compile_range (p_ptr, pend, translate, syntax, b)
{
SET_LIST_BIT (TRANSLATE (this_char));
}
-
+
return REG_NOERROR;
}
/* Failure stack declarations and macros; both re_compile_fastmap and
re_match_2 use a failure stack. These have to be macros because of
REGEX_ALLOCATE. */
-
+
/* Number of failure points for which to initially allocate space
when matching. If this number is exceeded, we allocate more
@@ -2292,8 +2292,8 @@ typedef struct
/* Double the size of FAIL_STACK, up to approximately `re_max_failures' items.
Return 1 if succeeds, and 0 if either ran out of memory
- allocating space for it or it was already too large.
-
+ allocating space for it or it was already too large.
+
REGEX_REALLOCATE requires `destination' be declared. */
#define DOUBLE_FAIL_STACK(fail_stack) \
@@ -2310,7 +2310,7 @@ typedef struct
1)))
-/* Push PATTERN_OP on FAIL_STACK.
+/* Push PATTERN_OP on FAIL_STACK.
Return 1 if was able to do so and 0 if ran out of memory allocating
space to do so. */
@@ -2341,12 +2341,12 @@ typedef struct
/* Push the information about the state we will need
- if we ever fail back to it.
-
+ if we ever fail back to it.
+
Requires variables fail_stack, regstart, regend, reg_info, and
num_regs be declared. DOUBLE_FAIL_STACK requires `destination' be
declared.
-
+
Does `return FAILURE_CODE' if runs out of memory. */
#define PUSH_FAILURE_POINT(pattern_place, string_place, failure_code) \
@@ -2454,7 +2454,7 @@ typedef struct
LOW_REG, HIGH_REG -- the highest and lowest active registers.
REGSTART, REGEND -- arrays of string positions.
REG_INFO -- array of information about each subexpression.
-
+
Also assumes the variables `fail_stack' and (if debugging), `bufp',
`pend', `string1', `size1', `string2', and `size2'. */
@@ -2522,7 +2522,7 @@ typedef struct
The caller must supply the address of a (1 << BYTEWIDTH)-byte data
area as BUFP->fastmap.
-
+
We set the `fastmap', `fastmap_accurate', and `can_be_null' fields in
the pattern buffer.
@@ -2539,7 +2539,7 @@ re_compile_fastmap (bufp)
#endif
/* We don't push any register information onto the failure stack. */
unsigned num_regs = 0;
-
+
register char *fastmap = bufp->fastmap;
unsigned char *pattern = bufp->buffer;
unsigned long size = bufp->used;
@@ -2556,27 +2556,27 @@ re_compile_fastmap (bufp)
boolean succeed_n_p = false;
assert (fastmap != NULL && p != NULL);
-
+
INIT_FAIL_STACK ();
bzero (fastmap, 1 << BYTEWIDTH); /* Assume nothing's valid. */
bufp->fastmap_accurate = 1; /* It will be when we're done. */
bufp->can_be_null = 0;
-
+
while (p != pend || !FAIL_STACK_EMPTY ())
{
if (p == pend)
{
bufp->can_be_null |= path_can_be_null;
-
+
/* Reset for next path. */
path_can_be_null = true;
-
+
p = fail_stack.stack[--fail_stack.avail];
}
/* We should never be about to go beyond the end of the pattern. */
assert (p < pend);
-
+
#ifdef SWITCH_ENUM_BUG
switch ((int) ((re_opcode_t) *p++))
#else
@@ -2700,10 +2700,10 @@ re_compile_fastmap (bufp)
case jump_past_alt:
case dummy_failure_jump:
EXTRACT_NUMBER_AND_INCR (j, p);
- p += j;
+ p += j;
if (j > 0)
continue;
-
+
/* Jump backward implies we just went through the body of a
loop and matched nothing. Opcode jumped to should be
`on_failure_jump' or `succeed_n'. Just treat it like an
@@ -2715,10 +2715,10 @@ re_compile_fastmap (bufp)
p++;
EXTRACT_NUMBER_AND_INCR (j, p);
- p += j;
-
+ p += j;
+
/* If what's on the stack is where we are now, pop it. */
- if (!FAIL_STACK_EMPTY ()
+ if (!FAIL_STACK_EMPTY ()
&& fail_stack.stack[fail_stack.avail - 1] == p)
fail_stack.avail--;
@@ -2756,7 +2756,7 @@ re_compile_fastmap (bufp)
case succeed_n:
/* Get to the number of times to succeed. */
- p += 2;
+ p += 2;
/* Increment p past the n for when k != 0. */
EXTRACT_NUMBER_AND_INCR (k, p);
@@ -2847,7 +2847,7 @@ re_search (bufp, string, size, startpos, range, regs)
int size, startpos, range;
struct re_registers *regs;
{
- return re_search_2 (bufp, NULL, 0, string, size, startpos, range,
+ return re_search_2 (bufp, NULL, 0, string, size, startpos, range,
regs, size);
}
@@ -2855,17 +2855,17 @@ re_search (bufp, string, size, startpos, range, regs)
/* Using the compiled pattern in BUFP->buffer, first tries to match the
virtual concatenation of STRING1 and STRING2, starting first at index
STARTPOS, then at STARTPOS + 1, and so on.
-
+
STRING1 and STRING2 have length SIZE1 and SIZE2, respectively.
-
+
RANGE is how far to scan while trying to match. RANGE = 0 means try
only at STARTPOS; in general, the last start tried is STARTPOS +
RANGE.
-
+
In REGS, return the indices of the virtual concatenation of STRING1
and STRING2 that matched the entire BUFP->buffer and its contained
subexpressions.
-
+
Do not consider matching one past the index STOP in the virtual
concatenation of STRING1 and STRING2.
@@ -2892,7 +2892,7 @@ re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop)
/* Check for out-of-range STARTPOS. */
if (startpos < 0 || startpos > total_size)
return -1;
-
+
/* Fix up RANGE if it might eventually take us outside
the virtual concatenation of STRING1 and STRING2. */
if (endpos < -1)
@@ -2914,10 +2914,10 @@ re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop)
if (fastmap && !bufp->fastmap_accurate)
if (re_compile_fastmap (bufp) == -2)
return -2;
-
+
/* Loop through the string, looking for a place to start matching. */
for (;;)
- {
+ {
/* If a fastmap is supplied, skip quickly over characters that
cannot be the start of a match. If the pattern can match the
null string, however, we don't need to skip characters; we want
@@ -2934,7 +2934,7 @@ re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop)
lim = range - (size1 - startpos);
d = (startpos >= size1 ? string2 - size1 : string1) + startpos;
-
+
/* Written out as an if-else to avoid testing `translate'
inside the loop. */
if (translate)
@@ -2951,7 +2951,7 @@ re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop)
else /* Searching backwards. */
{
register char c = (size1 == 0 || startpos >= size1
- ? string2[startpos - size1]
+ ? string2[startpos - size1]
: string1[startpos]);
if (!fastmap[(unsigned char) TRANSLATE (c)])
@@ -2968,21 +2968,21 @@ re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop)
startpos, regs, stop);
if (val >= 0)
return startpos;
-
+
if (val == -2)
return -2;
advance:
- if (!range)
+ if (!range)
break;
- else if (range > 0)
+ else if (range > 0)
{
- range--;
+ range--;
startpos++;
}
else
{
- range++;
+ range++;
startpos--;
}
}
@@ -3001,8 +3001,8 @@ static boolean alt_match_null_string_p (),
onto the failure stack. Other register information, such as the
starting and ending positions (which are addresses), and the list of
inner groups (which is a bits list) are maintained in separate
- variables.
-
+ variables.
+
We are making a (strictly speaking) nonportable assumption here: that
the compiler will pack our bit fields into something that fits into
the type of `word', i.e., is something that fits into one item on the
@@ -3076,7 +3076,7 @@ typedef union
/* Test if at very beginning or at very end of the virtual concatenation
of `string1' and `string2'. If only one string, it's `string2'. */
#define AT_STRINGS_BEG(d) ((d) == (size1 ? string1 : string2) || !size2)
-#define AT_STRINGS_END(d) ((d) == end2)
+#define AT_STRINGS_END(d) ((d) == end2)
/* Test if D points to a character which is word-constituent. We have
@@ -3139,7 +3139,7 @@ re_match (bufp, string, size, pos, regs)
int size, pos;
struct re_registers *regs;
{
- return re_match_2 (bufp, NULL, 0, string, size, pos, regs, size);
+ return re_match_2 (bufp, NULL, 0, string, size, pos, regs, size);
}
#endif /* not emacs */
@@ -3148,7 +3148,7 @@ re_match (bufp, string, size, pos, regs)
the (virtual) concatenation of STRING1 and STRING2 (of length SIZE1
and SIZE2, respectively). We start matching at POS, and stop
matching at STOP.
-
+
If REGS is non-null and the `no_sub' field of BUFP is nonzero, we
store offsets for the substring each group matched in REGS. See the
documentation for exactly how many groups we fill.
@@ -3179,7 +3179,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
/* Where we are in the data, and the end of the current string. */
const char *d, *dend;
-
+
/* Where we are in the pattern, and the end of the pattern. */
unsigned char *p = bufp->buffer;
register unsigned char *pend = p + bufp->used;
@@ -3206,7 +3206,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
return, for use in backreferences. The number here includes
an element for register zero. */
unsigned num_regs = bufp->re_nsub + 1;
-
+
/* The currently active registers. */
unsigned lowest_active_reg = NO_LOWEST_ACTIVE_REG;
unsigned highest_active_reg = NO_HIGHEST_ACTIVE_REG;
@@ -3233,15 +3233,15 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
matched any of the pattern so far this time through the reg_num-th
subexpression. These two fields get reset each time through any
loop their register is in. */
- register_info_type *reg_info;
+ register_info_type *reg_info;
/* The following record the register info as found in the above
- variables when we find a match better than any we've seen before.
+ variables when we find a match better than any we've seen before.
This happens as we backtrack through the failure points, which in
turn happens only if we have not yet matched the entire string. */
unsigned best_regs_set = false;
const char **best_regstart, **best_regend;
-
+
/* Logically, this is `best_regend[0]'. But we don't want to have to
allocate space for that if we're not allocating space for anything
else (see below). Also, we never need info about register 0 for
@@ -3258,13 +3258,13 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
#ifdef DEBUG
/* Counts the total number of registers pushed. */
- unsigned num_regs_pushed = 0;
+ unsigned num_regs_pushed = 0;
#endif
DEBUG_PRINT1 ("\n\nEntering re_match_2.\n");
-
+
INIT_FAIL_STACK ();
-
+
/* Do not bother to initialize all the register variables if there are
no groups in the pattern, as it takes a fair amount of time. If
there are groups, we include space for register 0 (the whole
@@ -3282,8 +3282,8 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
reg_dummy = REGEX_TALLOC (num_regs, const char *);
reg_info_dummy = REGEX_TALLOC (num_regs, register_info_type);
- if (!(regstart && regend && old_regstart && old_regend && reg_info
- && best_regstart && best_regend && reg_dummy && reg_info_dummy))
+ if (!(regstart && regend && old_regstart && old_regend && reg_info
+ && best_regstart && best_regend && reg_dummy && reg_info_dummy))
{
FREE_VARIABLES ();
return -2;
@@ -3306,21 +3306,21 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
FREE_VARIABLES ();
return -1;
}
-
+
/* Initialize subexpression text positions to -1 to mark ones that no
start_memory/stop_memory has been seen for. Also initialize the
register information struct. */
for (mcnt = 1; mcnt < num_regs; mcnt++)
{
- regstart[mcnt] = regend[mcnt]
+ regstart[mcnt] = regend[mcnt]
= old_regstart[mcnt] = old_regend[mcnt] = REG_UNSET_VALUE;
-
+
REG_MATCH_NULL_STRING_P (reg_info[mcnt]) = MATCH_NULL_UNSET_VALUE;
IS_ACTIVE (reg_info[mcnt]) = 0;
MATCHED_SOMETHING (reg_info[mcnt]) = 0;
EVER_MATCHED_SOMETHING (reg_info[mcnt]) = 0;
}
-
+
/* We move `string1' into `string2' if the latter's empty -- but not if
`string1' is null. */
if (size2 == 0 && string1 != NULL)
@@ -3345,7 +3345,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
end_match_2 = string2 + stop - size1;
}
- /* `p' scans through the pattern as `d' scans through the data.
+ /* `p' scans through the pattern as `d' scans through the data.
`dend' is the end of the input string that `d' points within. `d'
is advanced into the following input string whenever necessary, but
this happens before fetching; therefore, at the beginning of the
@@ -3367,7 +3367,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
DEBUG_PRINT1 ("The string to match is: `");
DEBUG_PRINT_DOUBLE_STRING (d, string1, size1, string2, size2);
DEBUG_PRINT1 ("'\n");
-
+
/* This loops over pattern commands. It exits by returning from the
function if the match is complete, or it drops through if the match
fails at this starting point in the input data. */
@@ -3378,16 +3378,16 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
if (p == pend)
{ /* End of pattern means we might have succeeded. */
DEBUG_PRINT1 ("end of pattern ... ");
-
+
/* If we haven't matched the entire string, and we want the
longest match, try backtracking. */
if (d != end_match_2)
{
DEBUG_PRINT1 ("backtracking.\n");
-
+
if (!FAIL_STACK_EMPTY ())
{ /* More failure points to try. */
- boolean same_str_p = (FIRST_STRING_P (match_end)
+ boolean same_str_p = (FIRST_STRING_P (match_end)
== MATCHING_IN_FIRST_STRING);
/* If exceeds best match so far, save it. */
@@ -3397,20 +3397,20 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
{
best_regs_set = true;
match_end = d;
-
+
DEBUG_PRINT1 ("\nSAVING match as best so far.\n");
-
+
for (mcnt = 1; mcnt < num_regs; mcnt++)
{
best_regstart[mcnt] = regstart[mcnt];
best_regend[mcnt] = regend[mcnt];
}
}
- goto fail;
+ goto fail;
}
/* If no failure points, don't restore garbage. */
- else if (best_regs_set)
+ else if (best_regs_set)
{
restore_best_regs:
/* Restore best match. It may happen that `dend ==
@@ -3419,7 +3419,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
strings `x-' and `y-z-', if the two strings are
not consecutive in memory. */
DEBUG_PRINT1 ("Restoring best registers.\n");
-
+
d = match_end;
dend = ((d >= string1 && d <= end1)
? end_match_1 : end_match_2);
@@ -3474,7 +3474,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
regs->end[0] = (MATCHING_IN_FIRST_STRING ? d - string1
: d - string2 + size1);
}
-
+
/* Go through the first `min (num_regs, regs->num_regs)'
registers, since that is all we initialized. */
for (mcnt = 1; mcnt < MIN (num_regs, regs->num_regs); mcnt++)
@@ -3487,7 +3487,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
regs->end[mcnt] = POINTER_TO_OFFSET (regend[mcnt]);
}
}
-
+
/* If the regs structure we return has more elements than
were in the pattern, set the extra elements to -1. If
we (re)allocated the registers, this is the case,
@@ -3503,8 +3503,8 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
nfailure_points_pushed - nfailure_points_popped);
DEBUG_PRINT2 ("%u registers pushed.\n", num_regs_pushed);
- mcnt = d - pos - (MATCHING_IN_FIRST_STRING
- ? string1
+ mcnt = d - pos - (MATCHING_IN_FIRST_STRING
+ ? string1
: string2 - size1);
DEBUG_PRINT2 ("Returning %d from re_match_2.\n", mcnt);
@@ -3594,7 +3594,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
p += 1 + *p;
if (!not) goto fail;
-
+
SET_REGS_MATCHED ();
d++;
break;
@@ -3611,9 +3611,9 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
/* Find out if this group can match the empty string. */
p1 = p; /* To send to group_match_null_string_p. */
-
+
if (REG_MATCH_NULL_STRING_P (reg_info[*p]) == MATCH_NULL_UNSET_VALUE)
- REG_MATCH_NULL_STRING_P (reg_info[*p])
+ REG_MATCH_NULL_STRING_P (reg_info[*p])
= group_match_null_string_p (&p1, pend, reg_info);
/* Save the position in the string where we were the last time
@@ -3624,7 +3624,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
old_regstart[*p] = REG_MATCH_NULL_STRING_P (reg_info[*p])
? REG_UNSET (regstart[*p]) ? d : regstart[*p]
: regstart[*p];
- DEBUG_PRINT2 (" old_regstart: %d\n",
+ DEBUG_PRINT2 (" old_regstart: %d\n",
POINTER_TO_OFFSET (old_regstart[*p]));
regstart[*p] = d;
@@ -3632,10 +3632,10 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
IS_ACTIVE (reg_info[*p]) = 1;
MATCHED_SOMETHING (reg_info[*p]) = 0;
-
+
/* This is the new highest active register. */
highest_active_reg = *p;
-
+
/* If nothing was active before, this is the new lowest active
register. */
if (lowest_active_reg == NO_LOWEST_ACTIVE_REG)
@@ -3651,7 +3651,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
number, and the number of inner groups. */
case stop_memory:
DEBUG_PRINT3 ("EXECUTING stop_memory %d (%d):\n", *p, p[1]);
-
+
/* We need to save the string position the last time we were at
this close-group operator in case the group is operated
upon by a repetition operator, e.g., with `((a*)*(b*)*)*'
@@ -3660,7 +3660,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
old_regend[*p] = REG_MATCH_NULL_STRING_P (reg_info[*p])
? REG_UNSET (regend[*p]) ? d : regend[*p]
: regend[*p];
- DEBUG_PRINT2 (" old_regend: %d\n",
+ DEBUG_PRINT2 (" old_regend: %d\n",
POINTER_TO_OFFSET (old_regend[*p]));
regend[*p] = d;
@@ -3668,7 +3668,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
/* This register isn't active anymore. */
IS_ACTIVE (reg_info[*p]) = 0;
-
+
/* If this was the only register active, nothing is active
anymore. */
if (lowest_active_reg == highest_active_reg)
@@ -3684,7 +3684,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
unsigned char r = *p - 1;
while (r > 0 && !IS_ACTIVE (reg_info[r]))
r--;
-
+
/* If we end up at register zero, that means that we saved
the registers as the result of an `on_failure_jump', not
a `start_memory', and we jumped to past the innermost
@@ -3700,7 +3700,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
else
highest_active_reg = r;
}
-
+
/* If just failed to match something this time around with a
group that's operated on by a repetition operator, try to
force exit from the ``loop'', and restore the register
@@ -3708,10 +3708,10 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
last match. */
if ((!MATCHED_SOMETHING (reg_info[*p])
|| (re_opcode_t) p[-3] == start_memory)
- && (p + 2) < pend)
+ && (p + 2) < pend)
{
boolean is_a_jump_n = false;
-
+
p1 = p + 2;
mcnt = 0;
switch ((re_opcode_t) *p1++)
@@ -3726,12 +3726,12 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
if (is_a_jump_n)
p1 += 2;
break;
-
+
default:
/* do nothing */ ;
}
p1 += mcnt;
-
+
/* If the next operation is a jump backwards in the pattern
to an on_failure_jump right before the start_memory
corresponding to this stop_memory, exit from the loop
@@ -3745,17 +3745,17 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
failed match, e.g., with `(a*)*b' against `ab' for
regstart[1], and, e.g., with `((a*)*(b*)*)*'
against `aba' for regend[3].
-
+
Also restore the registers for inner groups for,
e.g., `((a*)(b*))*' against `aba' (register 3 would
otherwise get trashed). */
-
+
if (EVER_MATCHED_SOMETHING (reg_info[*p]))
{
- unsigned r;
-
+ unsigned r;
+
EVER_MATCHED_SOMETHING (reg_info[*p]) = 0;
-
+
/* Restore this and inner groups' (if any) registers. */
for (r = *p; r < *p + *(p + 1); r++)
{
@@ -3764,7 +3764,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
/* xx why this test? */
if ((int) old_regend[r] >= (int) regstart[r])
regend[r] = old_regend[r];
- }
+ }
}
p1++;
EXTRACT_NUMBER_AND_INCR (mcnt, p1);
@@ -3773,7 +3773,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
goto fail;
}
}
-
+
/* Move past the register number and the inner group count. */
p += 2;
break;
@@ -3790,16 +3790,16 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
/* Can't back reference a group which we've never matched. */
if (REG_UNSET (regstart[regno]) || REG_UNSET (regend[regno]))
goto fail;
-
+
/* Where in input to try to start matching. */
d2 = regstart[regno];
-
+
/* Where to stop matching; if both the place to start and
the place to stop matching are in the same string, then
set to the place to stop, otherwise, for now have to use
the end of the first string. */
- dend2 = ((FIRST_STRING_P (regstart[regno])
+ dend2 = ((FIRST_STRING_P (regstart[regno])
== FIRST_STRING_P (regend[regno]))
? regend[regno] : end_match_1);
for (;;)
@@ -3823,16 +3823,16 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
/* How many characters left in this segment to match. */
mcnt = dend - d;
-
+
/* Want how many consecutive characters we can match in
one shot, so, if necessary, adjust the count. */
if (mcnt > dend2 - d2)
mcnt = dend2 - d2;
-
+
/* Compare that many; failure if mismatch, else move
past them. */
- if (translate
- ? bcmp_translate (d, d2, mcnt, translate)
+ if (translate
+ ? bcmp_translate (d, d2, mcnt, translate)
: bcmp (d, d2, mcnt))
goto fail;
d += mcnt, d2 += mcnt;
@@ -3846,7 +3846,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
`newline_anchor' is set, after newlines. */
case begline:
DEBUG_PRINT1 ("EXECUTING begline.\n");
-
+
if (AT_STRINGS_BEG (d))
{
if (!bufp->not_bol) break;
@@ -3867,7 +3867,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
{
if (!bufp->not_eol) break;
}
-
+
/* We have to ``prefetch'' the next character. */
else if ((d == end1 ? *string2 : *d) == '\n'
&& bufp->newline_anchor)
@@ -3901,7 +3901,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
then the . fails against the \n. But the next thing we want
to do is match the \n against the \n; if we restored the
string value, we would be back at the foo.
-
+
Because this is used only in specific cases, we don't need to
check all the things that `on_failure_jump' does, to make
sure the right things get saved on the stack. Hence we don't
@@ -3911,7 +3911,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
case; that seems worse than this. */
case on_failure_keep_string_jump:
DEBUG_PRINT1 ("EXECUTING on_failure_keep_string_jump");
-
+
EXTRACT_NUMBER_AND_INCR (mcnt, p);
DEBUG_PRINT3 (" %d (to 0x%x):\n", mcnt, p + mcnt);
@@ -3920,7 +3920,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
/* Uses of on_failure_jump:
-
+
Each alternative starts with an on_failure_jump that points
to the beginning of the next alternative. Each alternative
except the last ends with a jump that in effect jumps past
@@ -3986,7 +3986,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
would have to backtrack because of (as in, e.g., `a*a')
then we can change to pop_failure_jump, because we'll
never have to backtrack.
-
+
This is not true in the case of alternatives: in
`(a|ab)*' we do need to backtrack to the `ab' alternative
(e.g., if the string was `ab'). But instead of trying to
@@ -4018,7 +4018,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
p1 = p + mcnt;
/* p1[0] ... p1[2] are the `on_failure_jump' corresponding
- to the `maybe_finalize_jump' of this case. Examine what
+ to the `maybe_finalize_jump' of this case. Examine what
follows. */
if ((re_opcode_t) p1[3] == exactn && p1[5] != c)
{
@@ -4026,12 +4026,12 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
DEBUG_PRINT3 (" %c != %c => pop_failure_jump.\n",
c, p1[5]);
}
-
+
else if ((re_opcode_t) p1[3] == charset
|| (re_opcode_t) p1[3] == charset_not)
{
int not = (re_opcode_t) p1[3] == charset_not;
-
+
if (c < (unsigned char) (p1[4] * BYTEWIDTH)
&& p1[5 + c / BYTEWIDTH] & (1 << (c % BYTEWIDTH)))
not = !not;
@@ -4080,7 +4080,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
}
/* Note fall through. */
-
+
/* Unconditionally jump (without popping any failure points). */
case jump:
unconditional_jump:
@@ -4090,7 +4090,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
DEBUG_PRINT2 ("(to 0x%x).\n", p);
break;
-
+
/* We need this opcode so we can detect where alternatives end
in `group_match_null_string_p' et al. */
case jump_past_alt:
@@ -4125,7 +4125,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
/* Have to succeed matching what follows at least n times.
After that, handle like `on_failure_jump'. */
- case succeed_n:
+ case succeed_n:
EXTRACT_NUMBER (mcnt, p + 2);
DEBUG_PRINT2 ("EXECUTING succeed_n %d.\n", mcnt);
@@ -4146,8 +4146,8 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
goto on_failure;
}
break;
-
- case jump_n:
+
+ case jump_n:
EXTRACT_NUMBER (mcnt, p + 2);
DEBUG_PRINT2 ("EXECUTING jump_n %d.\n", mcnt);
@@ -4156,13 +4156,13 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
{
mcnt--;
STORE_NUMBER (p + 2, mcnt);
- goto unconditional_jump;
+ goto unconditional_jump;
}
/* If don't have to jump any more, skip over the rest of command. */
- else
- p += 4;
+ else
+ p += 4;
break;
-
+
case set_number_at:
{
DEBUG_PRINT1 ("EXECUTING set_number_at.\n");
@@ -4207,13 +4207,13 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
if (PTR_CHAR_POS ((unsigned char *) d) >= point)
goto fail;
break;
-
+
case at_dot:
DEBUG_PRINT1 ("EXECUTING at_dot.\n");
if (PTR_CHAR_POS ((unsigned char *) d) != point)
goto fail;
break;
-
+
case after_dot:
DEBUG_PRINT1 ("EXECUTING after_dot.\n");
if (PTR_CHAR_POS ((unsigned char *) d) <= point)
@@ -4266,7 +4266,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
SET_REGS_MATCHED ();
d++;
break;
-
+
case notwordchar:
DEBUG_PRINT1 ("EXECUTING non-Emacs notwordchar.\n");
PREFETCH ();
@@ -4276,7 +4276,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
d++;
break;
#endif /* not emacs */
-
+
default:
abort ();
}
@@ -4301,7 +4301,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
if (p < pend)
{
boolean is_a_jump_n = false;
-
+
/* If failed to a backwards jump that's part of a repetition
loop, need to pop this failure point and use the next one. */
switch ((re_opcode_t) *p)
@@ -4313,7 +4313,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
case jump:
p1 = p + 1;
EXTRACT_NUMBER_AND_INCR (mcnt, p1);
- p1 += mcnt;
+ p1 += mcnt;
if ((is_a_jump_n && (re_opcode_t) *p1 == succeed_n)
|| (!is_a_jump_n
@@ -4344,10 +4344,10 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
/* We are passed P pointing to a register number after a start_memory.
-
+
Return true if the pattern up to the corresponding stop_memory can
match the empty string, and false otherwise.
-
+
If we find the matching stop_memory, sets P to point to one past its number.
Otherwise, sets P to an undefined byte less than or equal to END.
@@ -4361,20 +4361,20 @@ group_match_null_string_p (p, end, reg_info)
int mcnt;
/* Point to after the args to the start_memory. */
unsigned char *p1 = *p + 2;
-
+
while (p1 < end)
{
/* Skip over opcodes that can match nothing, and return true or
false, as appropriate, when we get to one that can't, or to the
matching stop_memory. */
-
+
switch ((re_opcode_t) *p1)
{
/* Could be either a loop or a series of alternatives. */
case on_failure_jump:
p1++;
EXTRACT_NUMBER_AND_INCR (mcnt, p1);
-
+
/* If the next operation is not a jump backwards in the
pattern. */
@@ -4388,7 +4388,7 @@ group_match_null_string_p (p, end, reg_info)
/on_failure_jump/0/6/exactn/1/a/jump_past_alt/0/6
/on_failure_jump/0/6/exactn/1/b/jump_past_alt/0/3
- /exactn/1/c
+ /exactn/1/c
So, we have to first go through the first (n-1)
alternatives and then deal with the last one separately. */
@@ -4404,19 +4404,19 @@ group_match_null_string_p (p, end, reg_info)
is, including the ending `jump_past_alt' and
its number. */
- if (!alt_match_null_string_p (p1, p1 + mcnt - 3,
+ if (!alt_match_null_string_p (p1, p1 + mcnt - 3,
reg_info))
return false;
/* Move to right after this alternative, including the
jump_past_alt. */
- p1 += mcnt;
+ p1 += mcnt;
/* Break if it's the beginning of an n-th alternative
that doesn't begin with an on_failure_jump. */
if ((re_opcode_t) *p1 != on_failure_jump)
break;
-
+
/* Still have to check that it's not an n-th
alternative that starts with an on_failure_jump. */
p1++;
@@ -4441,14 +4441,14 @@ group_match_null_string_p (p, end, reg_info)
} /* if mcnt > 0 */
break;
-
+
case stop_memory:
assert (p1[1] == **p);
*p = p1 + 2;
return true;
-
- default:
+
+ default:
if (!common_op_match_null_string_p (&p1, end, reg_info))
return false;
}
@@ -4461,7 +4461,7 @@ group_match_null_string_p (p, end, reg_info)
/* Similar to group_match_null_string_p, but doesn't deal with alternatives:
It expects P to be the first byte of a single alternative and END one
byte past the last. The alternative can contain groups. */
-
+
static boolean
alt_match_null_string_p (p, end, reg_info)
unsigned char *p, *end;
@@ -4469,12 +4469,12 @@ alt_match_null_string_p (p, end, reg_info)
{
int mcnt;
unsigned char *p1 = p;
-
+
while (p1 < end)
{
- /* Skip over opcodes that can match nothing, and break when we get
+ /* Skip over opcodes that can match nothing, and break when we get
to one that can't. */
-
+
switch ((re_opcode_t) *p1)
{
/* It's a loop. */
@@ -4483,8 +4483,8 @@ alt_match_null_string_p (p, end, reg_info)
EXTRACT_NUMBER_AND_INCR (mcnt, p1);
p1 += mcnt;
break;
-
- default:
+
+ default:
if (!common_op_match_null_string_p (&p1, end, reg_info))
return false;
}
@@ -4495,8 +4495,8 @@ alt_match_null_string_p (p, end, reg_info)
/* Deals with the ops common to group_match_null_string_p and
- alt_match_null_string_p.
-
+ alt_match_null_string_p.
+
Sets P to one after the op and its arguments, if any. */
static boolean
@@ -4531,7 +4531,7 @@ common_op_match_null_string_p (p, end, reg_info)
reg_no = *p1;
assert (reg_no > 0 && reg_no <= MAX_REGNUM);
ret = group_match_null_string_p (&p1, end, reg_info);
-
+
/* Have to set this here in case we're checking a group which
contains a group and a back reference to it. */
@@ -4541,7 +4541,7 @@ common_op_match_null_string_p (p, end, reg_info)
if (!ret)
return false;
break;
-
+
/* If this is an optimized succeed_n for zero times, make the jump. */
case jump:
EXTRACT_NUMBER_AND_INCR (mcnt, p1);
@@ -4553,7 +4553,7 @@ common_op_match_null_string_p (p, end, reg_info)
case succeed_n:
/* Get to the number of times to succeed. */
- p1 += 2;
+ p1 += 2;
EXTRACT_NUMBER_AND_INCR (mcnt, p1);
if (mcnt == 0)
@@ -4566,7 +4566,7 @@ common_op_match_null_string_p (p, end, reg_info)
return false;
break;
- case duplicate:
+ case duplicate:
if (!REG_MATCH_NULL_STRING_P (reg_info[*p1]))
return false;
break;
@@ -4586,7 +4586,7 @@ common_op_match_null_string_p (p, end, reg_info)
/* Return zero if TRANSLATE[S1] and TRANSLATE[S2] are identical for LEN
bytes; nonzero otherwise. */
-
+
static int
bcmp_translate (s1, s2, len, translate)
unsigned char *s1, *s2;
@@ -4607,10 +4607,10 @@ bcmp_translate (s1, s2, len, translate)
/* re_compile_pattern is the GNU regular expression compiler: it
compiles PATTERN (of length SIZE) and puts the result in BUFP.
Returns 0 if the pattern was valid, otherwise an error string.
-
+
Assumes the `allocated' (and perhaps `buffer') and `translate' fields
are set in BUFP on entry.
-
+
We call regex_compile to do the actual compilation. */
const char *
@@ -4620,23 +4620,23 @@ re_compile_pattern (pattern, length, bufp)
struct re_pattern_buffer *bufp;
{
reg_errcode_t ret;
-
+
/* GNU code is written to assume at least RE_NREGS registers will be set
(and at least one extra will be -1). */
bufp->regs_allocated = REGS_UNALLOCATED;
-
+
/* And GNU code determines whether or not to get register information
by passing null for the REGS argument to re_match, etc., not by
setting no_sub. */
bufp->no_sub = 0;
-
+
/* Match anchors at newline. */
bufp->newline_anchor = 1;
-
+
ret = regex_compile (pattern, length, re_syntax_options, bufp);
return re_error_msg[(int) ret];
-}
+}
/* Entry points compatible with 4.2 BSD regex library. We don't define
them if this is an Emacs or POSIX compilation. */
@@ -4651,7 +4651,7 @@ re_comp (s)
const char *s;
{
reg_errcode_t ret;
-
+
if (!s)
{
if (!re_comp_buf.buffer)
@@ -4678,7 +4678,7 @@ re_comp (s)
re_comp_buf.newline_anchor = 1;
ret = regex_compile (s, strlen (s), re_syntax_options, &re_comp_buf);
-
+
/* Yes, we're discarding `const' here. */
return (char *) re_error_msg[(int) ret];
}
@@ -4735,7 +4735,7 @@ re_exec (s)
int
regcomp (preg, pattern, cflags)
regex_t *preg;
- const char *pattern;
+ const char *pattern;
int cflags;
{
reg_errcode_t ret;
@@ -4746,17 +4746,17 @@ regcomp (preg, pattern, cflags)
/* regex_compile will allocate the space for the compiled pattern. */
preg->buffer = 0;
preg->allocated = 0;
-
+
/* Don't bother to use a fastmap when searching. This simplifies the
REG_NEWLINE case: if we used a fastmap, we'd have to put all the
characters after newlines into the fastmap. This way, we just try
every character. */
preg->fastmap = 0;
-
+
if (cflags & REG_ICASE)
{
unsigned i;
-
+
preg->translate = (char *) malloc (CHAR_SET_SIZE);
if (preg->translate == NULL)
return (int) REG_ESPACE;
@@ -4781,38 +4781,38 @@ regcomp (preg, pattern, cflags)
preg->no_sub = !!(cflags & REG_NOSUB);
- /* POSIX says a null character in the pattern terminates it, so we
+ /* POSIX says a null character in the pattern terminates it, so we
can use strlen here in compiling the pattern. */
ret = regex_compile (pattern, strlen (pattern), syntax, preg);
-
+
/* POSIX doesn't distinguish between an unmatched open-group and an
unmatched close-group: both are REG_EPAREN. */
if (ret == REG_ERPAREN) ret = REG_EPAREN;
-
+
return (int) ret;
}
/* regexec searches for a given pattern, specified by PREG, in the
string STRING.
-
+
If NMATCH is zero or REG_NOSUB was set in the cflags argument to
`regcomp', we ignore PMATCH. Otherwise, we assume PMATCH has at
least NMATCH elements, and we set them to the offsets of the
corresponding matched substrings.
-
+
EFLAGS specifies `execution flags' which affect matching: if
REG_NOTBOL is set, then ^ does not match at the beginning of the
string; if REG_NOTEOL is set, then $ does not match at the end.
-
+
We return 0 if we find a match and REG_NOMATCH if not. */
int
regexec (preg, string, nmatch, pmatch, eflags)
const regex_t *preg;
- const char *string;
- size_t nmatch;
- regmatch_t pmatch[];
+ const char *string;
+ size_t nmatch;
+ regmatch_t pmatch[];
int eflags;
{
int ret;
@@ -4822,15 +4822,15 @@ regexec (preg, string, nmatch, pmatch, eflags)
boolean want_reg_info = !preg->no_sub && nmatch > 0;
private_preg = *preg;
-
+
private_preg.not_bol = !!(eflags & REG_NOTBOL);
private_preg.not_eol = !!(eflags & REG_NOTEOL);
-
+
/* The user has told us exactly how many registers to return
information about, via `nmatch'. We have to pass that on to the
matching routines. */
private_preg.regs_allocated = REGS_FIXED;
-
+
if (want_reg_info)
{
regs.num_regs = nmatch;
@@ -4844,7 +4844,7 @@ regexec (preg, string, nmatch, pmatch, eflags)
ret = re_search (&private_preg, string, len,
/* start: */ 0, /* range: */ len,
want_reg_info ? ®s : (struct re_registers *) 0);
-
+
/* Copy the register information to the POSIX structure. */
if (want_reg_info)
{
@@ -4884,7 +4884,7 @@ regerror (errcode, preg, errbuf, errbuf_size)
if (errcode < 0
|| errcode >= (sizeof (re_error_msg) / sizeof (re_error_msg[0])))
- /* Only error codes returned by the rest of the code should be passed
+ /* Only error codes returned by the rest of the code should be passed
to this routine. If we are given anything else, or if other regex
code generates an invalid error code, then the program has a bug.
Dump core so we can fix it. */
@@ -4898,7 +4898,7 @@ regerror (errcode, preg, errbuf, errbuf_size)
msg = "Success";
msg_size = strlen (msg) + 1; /* Includes the null. */
-
+
if (errbuf_size != 0)
{
if (msg_size > errbuf_size)
@@ -4923,7 +4923,7 @@ regfree (preg)
if (preg->buffer != NULL)
free (preg->buffer);
preg->buffer = NULL;
-
+
preg->allocated = 0;
preg->used = 0;
diff --git a/SerialICE/util/kconfig/regex.h b/SerialICE/util/kconfig/regex.h
index 408dd21..41ebf24 100644
--- a/SerialICE/util/kconfig/regex.h
+++ b/SerialICE/util/kconfig/regex.h
@@ -42,7 +42,7 @@ typedef unsigned reg_syntax_t;
#define RE_BACKSLASH_ESCAPE_IN_LISTS (1)
/* If this bit is not set, then + and ? are operators, and \+ and \? are
- literals.
+ literals.
If set, then \+ and \? are operators and + and ? are literals. */
#define RE_BK_PLUS_QM (RE_BACKSLASH_ESCAPE_IN_LISTS << 1)
@@ -58,7 +58,7 @@ typedef unsigned reg_syntax_t;
^ is an anchor if it is at the beginning of a regular
expression or after an open-group or an alternation operator;
$ is an anchor if it is at the end of a regular expression, or
- before a close-group or an alternation operator.
+ before a close-group or an alternation operator.
This bit could be (re)combined with RE_CONTEXT_INDEP_OPS, because
POSIX draft 11.2 says that * etc. in leading positions is undefined.
@@ -69,7 +69,7 @@ typedef unsigned reg_syntax_t;
/* If this bit is set, then special characters are always special
regardless of where they are in the pattern.
If this bit is not set, then special characters are special only in
- some contexts; otherwise they are ordinary. Specifically,
+ some contexts; otherwise they are ordinary. Specifically,
* + ? and intervals are only special when not after the beginning,
open-group, or alternation operator. */
#define RE_CONTEXT_INDEP_OPS (RE_CONTEXT_INDEP_ANCHORS << 1)
@@ -91,7 +91,7 @@ typedef unsigned reg_syntax_t;
#define RE_HAT_LISTS_NOT_NEWLINE (RE_DOT_NOT_NULL << 1)
/* If this bit is set, either \{...\} or {...} defines an
- interval, depending on RE_NO_BK_BRACES.
+ interval, depending on RE_NO_BK_BRACES.
If not set, \{, \}, {, and } are literals. */
#define RE_INTERVALS (RE_HAT_LISTS_NOT_NEWLINE << 1)
@@ -116,7 +116,7 @@ typedef unsigned reg_syntax_t;
If not set, then \<digit> is a back-reference. */
#define RE_NO_BK_REFS (RE_NO_BK_PARENS << 1)
-/* If this bit is set, then | is an alternation operator, and \| is literal.
+/* If this bit is set, then | is an alternation operator, and \| is literal.
If not set, then \| is an alternation operator, and | is literal. */
#define RE_NO_BK_VBAR (RE_NO_BK_REFS << 1)
@@ -138,7 +138,7 @@ extern reg_syntax_t re_syntax_options;
/* Define combinations of the above bits for the standard possibilities.
(The [[[ comments delimit what gets put into the Texinfo file, so
- don't delete them!) */
+ don't delete them!) */
/* [[[begin syntaxes]]] */
#define RE_SYNTAX_EMACS 0
@@ -205,7 +205,7 @@ extern reg_syntax_t re_syntax_options;
#ifdef RE_DUP_MAX
#undef RE_DUP_MAX
#endif
-#define RE_DUP_MAX ((1 << 15) - 1)
+#define RE_DUP_MAX ((1 << 15) - 1)
/* POSIX `cflags' bits (i.e., information for `regcomp'). */
@@ -217,7 +217,7 @@ extern reg_syntax_t re_syntax_options;
/* If this bit is set, then ignore case when matching.
If not set, then case is significant. */
#define REG_ICASE (REG_EXTENDED << 1)
-
+
/* If this bit is set, then anchors do not match at newline
characters in the string.
If not set, then anchors do match at newlines. */
@@ -256,7 +256,7 @@ typedef enum
REG_EESCAPE, /* Trailing backslash. */
REG_ESUBREG, /* Invalid back reference. */
REG_EBRACK, /* Unmatched left bracket. */
- REG_EPAREN, /* Parenthesis imbalance. */
+ REG_EPAREN, /* Parenthesis imbalance. */
REG_EBRACE, /* Unmatched \{. */
REG_BADBR, /* Invalid contents of \{\}. */
REG_ERANGE, /* Invalid range end. */
@@ -331,7 +331,7 @@ struct re_pattern_buffer
unsigned no_sub : 1;
/* If set, a beginning-of-line anchor doesn't match at the
- beginning of the string. */
+ beginning of the string. */
unsigned not_bol : 1;
/* Similarly for an end-of-line anchor. */
@@ -443,7 +443,7 @@ extern int re_match
/* Relates to `re_match' as `re_search_2' relates to `re_search'. */
-extern int re_match_2
+extern int re_match_2
_RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1,
int length1, const char *string2, int length2,
int start, struct re_registers *regs, int stop));
diff --git a/SerialICE/util/kconfig/zconf.tab.c_shipped b/SerialICE/util/kconfig/zconf.tab.c_shipped
index 0f14cdb..97b2772 100644
--- a/SerialICE/util/kconfig/zconf.tab.c_shipped
+++ b/SerialICE/util/kconfig/zconf.tab.c_shipped
@@ -1393,7 +1393,7 @@ yyparse ()
#endif
#endif
{
-
+
int yystate;
int yyn;
int yyresult;
diff --git a/SerialICE/util/romcc.c b/SerialICE/util/romcc.c
index 0d1f118..7078cd3 100644
--- a/SerialICE/util/romcc.c
+++ b/SerialICE/util/romcc.c
@@ -25,9 +25,9 @@
#define MAX_CWD_SIZE 4096
#define MAX_ALLOCATION_PASSES 100
-/* NOTE: Before you even start thinking to touch anything
+/* NOTE: Before you even start thinking to touch anything
* in this code, set DEBUG_ROMCC_WARNINGS to 1 to get an
- * insight on the original author's thoughts. We introduced
+ * insight on the original author's thoughts. We introduced
* this switch as romcc was about the only thing producing
* massive warnings in our code..
*/
@@ -61,7 +61,7 @@
#endif
/* Control flow graph of a loop without goto.
- *
+ *
* AAA
* +---/
* /
@@ -74,31 +74,31 @@
* |\ GGG HHH | continue;
* | \ \ | |
* | \ III | /
- * | \ | / /
- * | vvv /
- * +----BBB /
+ * | \ | / /
+ * | vvv /
+ * +----BBB /
* | /
* vv
* JJJ
*
- *
+ *
* AAA
* +-----+ | +----+
* | \ | / |
* | BBB +-+ |
* | / \ / | |
* | CCC JJJ / /
- * | / \ / /
- * | DDD EEE / /
+ * | / \ / /
+ * | DDD EEE / /
* | | +-/ /
- * | FFF /
- * | / \ /
- * | GGG HHH /
+ * | FFF /
+ * | / \ /
+ * | GGG HHH /
* | | +-/
* | III
- * +--+
+ * +--+
+ *
*
- *
* DFlocal(X) = { Y <- Succ(X) | idom(Y) != X }
* DFup(Z) = { Y <- DF(Z) | idom(Y) != X }
*
@@ -117,7 +117,7 @@
* DDD EEE DDD: [ ] ( BBB ) EEE: [ JJJ ] ()
* |
* FFF FFF: [ ] ( BBB )
- * / \
+ * / \
* GGG HHH GGG: [ ] ( BBB ) HHH: [ BBB ] ()
* |
* III III: [ BBB ] ()
@@ -125,7 +125,7 @@
*
* BBB and JJJ are definitely the dominance frontier.
* Where do I place phi functions and how do I make that decision.
- *
+ *
*/
static void die(char *fmt, ...)
{
@@ -223,7 +223,7 @@ static char *slurp_file(const char *dirname, const char *filename, off_t *r_size
off_t size, progress;
ssize_t result;
FILE* file;
-
+
if (!filename) {
*r_size = 0;
return 0;
@@ -398,14 +398,14 @@ struct token {
#define OP_SUB 9
#define OP_SL 10
#define OP_USR 11
-#define OP_SSR 12
-#define OP_AND 13
+#define OP_SSR 12
+#define OP_AND 13
#define OP_XOR 14
#define OP_OR 15
#define OP_POS 16 /* Dummy positive operator don't use it */
#define OP_NEG 17
#define OP_INVERT 18
-
+
#define OP_EQ 20
#define OP_NOTEQ 21
#define OP_SLESS 22
@@ -416,7 +416,7 @@ struct token {
#define OP_ULESSEQ 27
#define OP_SMOREEQ 28
#define OP_UMOREEQ 29
-
+
#define OP_LFALSE 30 /* Test if the expression is logically false */
#define OP_LTRUE 31 /* Test if the expression is logcially true */
@@ -475,7 +475,7 @@ struct token {
* assigned yet, or variables whose value we simply do not know.
*/
-#define OP_WRITE 60
+#define OP_WRITE 60
/* OP_WRITE moves one pseudo register to another.
* MISC(0) holds the destination pseudo register, which must be an OP_DECL.
* RHS(0) holds the psuedo to move.
@@ -544,10 +544,10 @@ struct token {
* The value represented by an OP_TUPLE is held in N registers.
* LHS(0..N-1) refer to those registers.
* ->use is a list of statements that use the value.
- *
+ *
* Although OP_TUPLE always has register sized pieces they are not
* used until structures are flattened/decomposed into their register
- * components.
+ * components.
* ???? registers ????
*/
@@ -561,10 +561,10 @@ struct token {
#define OP_FCALL 72
-/* OP_FCALL performs a procedure call.
+/* OP_FCALL performs a procedure call.
* MISC(0) holds a pointer to the OP_LIST of a function
* RHS(x) holds argument x of a function
- *
+ *
* Currently not seen outside of expressions.
*/
#define OP_PROG 73
@@ -614,16 +614,16 @@ struct token {
* ->use is the list of all branches that use this label.
*/
-#define OP_ADECL 87
+#define OP_ADECL 87
/* OP_ADECL is a triple that establishes an lvalue for assignments.
* A variable takes N registers to contain.
* LHS(0..N-1) refer to an OP_PIECE triple that represents
* the Xth register that the variable is stored in.
* ->use is a list of statements that use the variable.
- *
+ *
* Although OP_ADECL always has register sized pieces they are not
* used until structures are flattened/decomposed into their register
- * components.
+ * components.
*/
#define OP_SDECL 88
@@ -635,12 +635,12 @@ struct token {
#define OP_PHI 89
-/* OP_PHI is a triple used in SSA form code.
+/* OP_PHI is a triple used in SSA form code.
* It is used when multiple code paths merge and a variable needs
* a single assignment from any of those code paths.
* The operation is a cross between OP_DECL and OP_WRITE, which
* is what OP_PHI is generated from.
- *
+ *
* RHS(x) points to the value from code path x
* The number of RHS entries is the number of control paths into the block
* in which OP_PHI resides. The elements of the array point to point
@@ -653,12 +653,12 @@ struct token {
/* continuation helpers
*/
#define OP_CPS_BRANCH 90 /* an unconditional branch */
-/* OP_CPS_BRANCH calls a continuation
+/* OP_CPS_BRANCH calls a continuation
* RHS(x) holds argument x of the function
* TARG(0) holds OP_CPS_START target
*/
#define OP_CPS_CBRANCH 91 /* a conditional branch */
-/* OP_CPS_CBRANCH conditionally calls one of two continuations
+/* OP_CPS_CBRANCH conditionally calls one of two continuations
* RHS(0) holds the branch condition
* RHS(x + 1) holds argument x of the function
* TARG(0) holds the OP_CPS_START to jump to when true
@@ -672,7 +672,7 @@ struct token {
* ->next holds where the OP_CPS_RET will return to.
*/
#define OP_CPS_RET 93
-/* OP_CPS_RET conditionally calls one of two continuations
+/* OP_CPS_RET conditionally calls one of two continuations
* RHS(0) holds the variable with the return function address
* RHS(x + 1) holds argument x of the function
* The branch target may be any OP_CPS_START
@@ -813,7 +813,7 @@ static const struct op_info table_ops[] = {
[OP_CONVERT ] = OP( 0, 1, 0, 0, PURE | DEF | BLOCK, "convert"),
[OP_PIECE ] = OP( 0, 0, 1, 0, PURE | DEF | STRUCTURAL | PART, "piece"),
[OP_ASM ] = OP(-1, -1, 0, 0, PURE, "asm"),
-[OP_DEREF ] = OP( 0, 1, 0, 0, 0 | DEF | BLOCK, "deref"),
+[OP_DEREF ] = OP( 0, 1, 0, 0, 0 | DEF | BLOCK, "deref"),
[OP_DOT ] = OP( 0, 0, 1, 0, PURE | DEF | PART, "dot"),
[OP_INDEX ] = OP( 0, 0, 1, 0, PURE | DEF | PART, "index"),
@@ -884,7 +884,7 @@ static const struct op_info table_ops[] = {
#undef OP
#define OP_MAX (sizeof(table_ops)/sizeof(table_ops[0]))
-static const char *tops(int index)
+static const char *tops(int index)
{
static const char unknown[] = "unknown op";
if (index < 0) {
@@ -995,7 +995,7 @@ struct block {
struct block_set *ipdomfrontier;
struct block *ipdom;
int vertex;
-
+
};
struct symbol {
@@ -1170,11 +1170,11 @@ struct compile_state {
* make up the union.
* type->elements hold the length of the linked list
*/
-#define TYPE_POINTER 0x1200
+#define TYPE_POINTER 0x1200
/* For TYPE_POINTER:
* type->left holds the type pointed to.
*/
-#define TYPE_FUNCTION 0x1300
+#define TYPE_FUNCTION 0x1300
/* For TYPE_FUNCTION:
* type->left holds the return type.
* type->right holds the type of the arguments
@@ -1196,7 +1196,7 @@ struct compile_state {
* type->elements holds the number of elements.
*/
#define TYPE_TUPLE 0x1900
-/* TYPE_TUPLE is a basic building block when defining
+/* TYPE_TUPLE is a basic building block when defining
* positionally reference type conglomerations. (i.e. closures)
* In essence it is a wrapper for TYPE_PRODUCT, like TYPE_STRUCT
* except it has no field names.
@@ -1205,7 +1205,7 @@ struct compile_state {
* type->elements hold the number of elements in the closure.
*/
#define TYPE_JOIN 0x1a00
-/* TYPE_JOIN is a basic building block when defining
+/* TYPE_JOIN is a basic building block when defining
* positionally reference type conglomerations. (i.e. closures)
* In essence it is a wrapper for TYPE_OVERLAP, like TYPE_UNION
* except it has no field names.
@@ -1298,9 +1298,9 @@ static struct reg_info arch_reg_constraint(
struct compile_state *state, struct type *type, const char *constraint);
static struct reg_info arch_reg_clobber(
struct compile_state *state, const char *clobber);
-static struct reg_info arch_reg_lhs(struct compile_state *state,
+static struct reg_info arch_reg_lhs(struct compile_state *state,
struct triple *ins, int index);
-static struct reg_info arch_reg_rhs(struct compile_state *state,
+static struct reg_info arch_reg_rhs(struct compile_state *state,
struct triple *ins, int index);
static int arch_reg_size(int reg);
static struct triple *transform_to_arch_instruction(
@@ -1481,9 +1481,9 @@ static int set_arg(
}
return result;
}
-
-static void flag_usage(FILE *fp, const struct compiler_flag *ptr,
+
+static void flag_usage(FILE *fp, const struct compiler_flag *ptr,
const char *prefix, const char *invert_prefix)
{
for(;ptr->name; ptr++) {
@@ -1500,7 +1500,7 @@ static void arg_usage(FILE *fp, const struct compiler_arg *ptr,
for(;ptr->name; ptr++) {
const struct compiler_flag *flag;
for(flag = &ptr->flags[0]; flag->name; flag++) {
- fprintf(fp, "%s%s=%s\n",
+ fprintf(fp, "%s%s=%s\n",
prefix, ptr->name, flag->name);
}
}
@@ -1513,7 +1513,7 @@ static int append_string(size_t *max, const char ***vec, const char *str,
count = ++(*max);
*vec = xrealloc(*vec, sizeof(char *)*count, "name");
(*vec)[count -1] = 0;
- (*vec)[count -2] = str;
+ (*vec)[count -2] = str;
return 0;
}
@@ -1544,7 +1544,7 @@ static int append_define(struct compiler_state *compiler, const char *str)
rest = identifier(str, end);
if (rest != end) {
int len = end - str - 1;
- arg_error("Invalid name cannot define macro: `%*.*s'\n",
+ arg_error("Invalid name cannot define macro: `%*.*s'\n",
len, len, str);
}
result = append_string(&compiler->define_count,
@@ -1561,7 +1561,7 @@ static int append_undef(struct compiler_state *compiler, const char *str)
rest = identifier(str, end);
if (rest != end) {
int len = end - str - 1;
- arg_error("Invalid name cannot undefine macro: `%*.*s'\n",
+ arg_error("Invalid name cannot undefine macro: `%*.*s'\n",
len, len, str);
}
result = append_string(&compiler->undef_count,
@@ -1733,7 +1733,7 @@ static int get_col(struct file_state *file)
for(col = 0; ptr < end; ptr++) {
if (*ptr != '\t') {
col++;
- }
+ }
else {
col = (col & ~7) + 8;
}
@@ -1747,7 +1747,7 @@ static void loc(FILE *fp, struct compile_state *state, struct triple *triple)
if (triple && triple->occurance) {
struct occurance *spot;
for(spot = triple->occurance; spot; spot = spot->parent) {
- fprintf(fp, "%s:%d.%d: ",
+ fprintf(fp, "%s:%d.%d: ",
spot->filename, spot->line, spot->col);
}
return;
@@ -1756,11 +1756,11 @@ static void loc(FILE *fp, struct compile_state *state, struct triple *triple)
return;
}
col = get_col(state->file);
- fprintf(fp, "%s:%d.%d: ",
+ fprintf(fp, "%s:%d.%d: ",
state->file->report_name, state->file->report_line, col);
}
-static void __attribute__ ((noreturn)) internal_error(struct compile_state *state, struct triple *ptr,
+static void __attribute__ ((noreturn)) internal_error(struct compile_state *state, struct triple *ptr,
const char *fmt, ...)
{
FILE *fp = state->errout;
@@ -1780,7 +1780,7 @@ static void __attribute__ ((noreturn)) internal_error(struct compile_state *stat
}
-static void internal_warning(struct compile_state *state, struct triple *ptr,
+static void internal_warning(struct compile_state *state, struct triple *ptr,
const char *fmt, ...)
{
FILE *fp = state->errout;
@@ -1798,7 +1798,7 @@ static void internal_warning(struct compile_state *state, struct triple *ptr,
-static void __attribute__ ((noreturn)) error(struct compile_state *state, struct triple *ptr,
+static void __attribute__ ((noreturn)) error(struct compile_state *state, struct triple *ptr,
const char *fmt, ...)
{
FILE *fp = state->errout;
@@ -1819,14 +1819,14 @@ static void __attribute__ ((noreturn)) error(struct compile_state *state, struct
exit(1);
}
-static void warning(struct compile_state *state, struct triple *ptr,
+static void warning(struct compile_state *state, struct triple *ptr,
const char *fmt, ...)
{
FILE *fp = state->errout;
va_list args;
va_start(args, fmt);
loc(fp, state, ptr);
- fprintf(fp, "warning: ");
+ fprintf(fp, "warning: ");
if (ptr && (state->compiler->debug & DEBUG_ABORT_ON_ERROR)) {
fprintf(fp, "%p %-10s ", ptr, tops(ptr->op));
}
@@ -1894,7 +1894,7 @@ static void use_triple(struct triple *used, struct triple *user)
}
ptr = &(*ptr)->next;
}
- /* Append new to the head of the list,
+ /* Append new to the head of the list,
* copy_func and rename_block_variables
* depends on this.
*/
@@ -1969,7 +1969,7 @@ static struct occurance *new_occurance(struct compile_state *state)
(last->line == line) &&
(last->function == function) &&
((last->filename == filename) ||
- (strcmp(last->filename, filename) == 0)))
+ (strcmp(last->filename, filename) == 0)))
{
get_occurance(last);
return last;
@@ -2065,7 +2065,7 @@ static struct triple unknown_triple = {
static size_t registers_of(struct compile_state *state, struct type *type);
-static struct triple *alloc_triple(struct compile_state *state,
+static struct triple *alloc_triple(struct compile_state *state,
int op, struct type *type, int lhs_wanted, int rhs_wanted,
struct occurance *occurance)
{
@@ -2165,7 +2165,7 @@ static struct triple *copy_triple(struct compile_state *state, struct triple *sr
return copy;
}
-static struct triple *new_triple(struct compile_state *state,
+static struct triple *new_triple(struct compile_state *state,
int op, struct type *type, int lhs, int rhs)
{
struct triple *ret;
@@ -2175,7 +2175,7 @@ static struct triple *new_triple(struct compile_state *state,
return ret;
}
-static struct triple *build_triple(struct compile_state *state,
+static struct triple *build_triple(struct compile_state *state,
int op, struct type *type, struct triple *left, struct triple *right,
struct occurance *occurance)
{
@@ -2192,7 +2192,7 @@ static struct triple *build_triple(struct compile_state *state,
return ret;
}
-static struct triple *triple(struct compile_state *state,
+static struct triple *triple(struct compile_state *state,
int op, struct type *type, struct triple *left, struct triple *right)
{
struct triple *ret;
@@ -2208,7 +2208,7 @@ static struct triple *triple(struct compile_state *state,
return ret;
}
-static struct triple *branch(struct compile_state *state,
+static struct triple *branch(struct compile_state *state,
struct triple *targ, struct triple *test)
{
struct triple *ret;
@@ -2251,7 +2251,7 @@ static void insert_triple(struct compile_state *state,
static int triple_stores_block(struct compile_state *state, struct triple *ins)
{
- /* This function is used to determine if u.block
+ /* This function is used to determine if u.block
* is utilized to store the current block number.
*/
int stores_block;
@@ -2261,7 +2261,7 @@ static int triple_stores_block(struct compile_state *state, struct triple *ins)
}
static int triple_is_branch(struct compile_state *state, struct triple *ins);
-static struct block *block_of_triple(struct compile_state *state,
+static struct block *block_of_triple(struct compile_state *state,
struct triple *ins)
{
struct triple *first;
@@ -2270,8 +2270,8 @@ static struct block *block_of_triple(struct compile_state *state,
}
first = state->first;
while(ins != first && !triple_is_branch(state, ins->prev) &&
- !triple_stores_block(state, ins))
- {
+ !triple_stores_block(state, ins))
+ {
if (ins == ins->prev) {
internal_error(state, ins, "ins == ins->prev?");
}
@@ -2447,30 +2447,30 @@ static void display_triple(FILE *fp, struct triple *ins)
}
else if (ins->op == OP_INTCONST) {
fprintf(fp, "(%p) %c%c%c %-7s %-2d %-10s <0x%08lx> ",
- ins, pre, post, vol, reg, ins->template_id, tops(ins->op),
+ ins, pre, post, vol, reg, ins->template_id, tops(ins->op),
(unsigned long)(ins->u.cval));
}
else if (ins->op == OP_ADDRCONST) {
fprintf(fp, "(%p) %c%c%c %-7s %-2d %-10s %-10p <0x%08lx>",
- ins, pre, post, vol, reg, ins->template_id, tops(ins->op),
+ ins, pre, post, vol, reg, ins->template_id, tops(ins->op),
MISC(ins, 0), (unsigned long)(ins->u.cval));
}
else if (ins->op == OP_INDEX) {
fprintf(fp, "(%p) %c%c%c %-7s %-2d %-10s %-10p <0x%08lx>",
- ins, pre, post, vol, reg, ins->template_id, tops(ins->op),
+ ins, pre, post, vol, reg, ins->template_id, tops(ins->op),
RHS(ins, 0), (unsigned long)(ins->u.cval));
}
else if (ins->op == OP_PIECE) {
fprintf(fp, "(%p) %c%c%c %-7s %-2d %-10s %-10p <0x%08lx>",
- ins, pre, post, vol, reg, ins->template_id, tops(ins->op),
+ ins, pre, post, vol, reg, ins->template_id, tops(ins->op),
MISC(ins, 0), (unsigned long)(ins->u.cval));
}
else {
int i, count;
- fprintf(fp, "(%p) %c%c%c %-7s %-2d %-10s",
+ fprintf(fp, "(%p) %c%c%c %-7s %-2d %-10s",
ins, pre, post, vol, reg, ins->template_id, tops(ins->op));
if (table_ops[ins->op].flags & BITFIELD) {
- fprintf(fp, " <%2d-%2d:%2d>",
+ fprintf(fp, " <%2d-%2d:%2d>",
ins->u.bitfield.offset,
ins->u.bitfield.offset + ins->u.bitfield.size,
ins->u.bitfield.size);
@@ -2500,9 +2500,9 @@ static void display_triple(FILE *fp, struct triple *ins)
fprintf(fp, " @");
for(ptr = ins->occurance; ptr; ptr = ptr->parent) {
fprintf(fp, " %s,%s:%d.%d",
- ptr->function,
+ ptr->function,
ptr->filename,
- ptr->line,
+ ptr->line,
ptr->col);
}
if (ins->op == OP_ASM) {
@@ -2523,9 +2523,9 @@ static void display_triple_changes(
orig_count = TRIPLE_SIZE(orig);
if ((new->op != orig->op) ||
(new_count != orig_count) ||
- (memcmp(orig->param, new->param,
+ (memcmp(orig->param, new->param,
orig_count * sizeof(orig->param[0])) != 0) ||
- (memcmp(&orig->u, &new->u, sizeof(orig->u)) != 0))
+ (memcmp(&orig->u, &new->u, sizeof(orig->u)) != 0))
{
struct occurance *ptr;
int i, min_count, indent;
@@ -2533,7 +2533,7 @@ static void display_triple_changes(
if (orig->op == new->op) {
fprintf(fp, " %-11s", tops(orig->op));
} else {
- fprintf(fp, " [%-10s %-10s]",
+ fprintf(fp, " [%-10s %-10s]",
tops(new->op), tops(orig->op));
}
min_count = new_count;
@@ -2542,12 +2542,12 @@ static void display_triple_changes(
}
for(indent = i = 0; i < min_count; i++) {
if (orig->param[i] == new->param[i]) {
- fprintf(fp, " %-11p",
+ fprintf(fp, " %-11p",
orig->param[i]);
indent += 12;
} else {
fprintf(fp, " [%-10p %-10p]",
- new->param[i],
+ new->param[i],
orig->param[i]);
indent += 24;
}
@@ -2562,7 +2562,7 @@ static void display_triple_changes(
}
if ((new->op == OP_INTCONST)||
(new->op == OP_ADDRCONST)) {
- fprintf(fp, " <0x%08lx>",
+ fprintf(fp, " <0x%08lx>",
(unsigned long)(new->u.cval));
indent += 13;
}
@@ -2583,11 +2583,11 @@ static void display_triple_changes(
fprintf(fp, " @");
for(ptr = orig->occurance; ptr; ptr = ptr->parent) {
fprintf(fp, " %s,%s:%d.%d",
- ptr->function,
+ ptr->function,
ptr->filename,
- ptr->line,
+ ptr->line,
ptr->col);
-
+
}
fprintf(fp, "\n");
fflush(fp);
@@ -2597,7 +2597,7 @@ static void display_triple_changes(
static int triple_is_pure(struct compile_state *state, struct triple *ins, unsigned id)
{
/* Does the triple have no side effects.
- * I.e. Rexecuting the triple with the same arguments
+ * I.e. Rexecuting the triple with the same arguments
* gives the same value.
*/
unsigned pure;
@@ -2610,7 +2610,7 @@ static int triple_is_pure(struct compile_state *state, struct triple *ins, unsig
return (pure == PURE) && !(id & TRIPLE_FLAG_VOLATILE);
}
-static int triple_is_branch_type(struct compile_state *state,
+static int triple_is_branch_type(struct compile_state *state,
struct triple *ins, unsigned type)
{
/* Is this one of the passed branch types? */
@@ -2651,7 +2651,7 @@ static int triple_is_ret(struct compile_state *state, struct triple *ins)
/* Is this triple a return instruction? */
return triple_is_branch_type(state, ins, RETBRANCH);
}
-
+
#if DEBUG_ROMCC_WARNING
static int triple_is_simple_ubranch(struct compile_state *state, struct triple *ins)
{
@@ -2732,27 +2732,27 @@ static struct triple **triple_iter(struct compile_state *state,
}
}
return ret;
-
+
}
static struct triple **triple_lhs(struct compile_state *state,
struct triple *ins, struct triple **last)
{
- return triple_iter(state, ins->lhs, &LHS(ins,0),
+ return triple_iter(state, ins->lhs, &LHS(ins,0),
ins, last);
}
static struct triple **triple_rhs(struct compile_state *state,
struct triple *ins, struct triple **last)
{
- return triple_iter(state, ins->rhs, &RHS(ins,0),
+ return triple_iter(state, ins->rhs, &RHS(ins,0),
ins, last);
}
static struct triple **triple_misc(struct compile_state *state,
struct triple *ins, struct triple **last)
{
- return triple_iter(state, ins->misc, &MISC(ins,0),
+ return triple_iter(state, ins->misc, &MISC(ins,0),
ins, last);
}
@@ -2820,7 +2820,7 @@ static struct triple **triple_targ(struct compile_state *state,
static struct triple **triple_edge_targ(struct compile_state *state,
struct triple *ins, struct triple **last)
{
- return do_triple_targ(state, ins, last,
+ return do_triple_targ(state, ins, last,
state->functions_joined, !state->functions_joined);
}
@@ -2851,7 +2851,7 @@ static struct triple *after_lhs(struct compile_state *state, struct triple *ins)
}
/* Function piece accessor functions */
-static struct triple *do_farg(struct compile_state *state,
+static struct triple *do_farg(struct compile_state *state,
struct triple *func, unsigned index)
{
struct type *ftype;
@@ -2880,7 +2880,7 @@ static struct triple *fretaddr(struct compile_state *state, struct triple *func)
{
return do_farg(state, func, 1);
}
-static struct triple *farg(struct compile_state *state,
+static struct triple *farg(struct compile_state *state,
struct triple *func, unsigned index)
{
return do_farg(state, func, index + 2);
@@ -2929,7 +2929,7 @@ static void verify_use(struct compile_state *state,
}
}
-static int find_rhs_use(struct compile_state *state,
+static int find_rhs_use(struct compile_state *state,
struct triple *user, struct triple *used)
{
struct triple **param;
@@ -3162,7 +3162,7 @@ static void print_blocks(struct compile_state *state, const char *func, FILE *fp
#define TOK_FIRST_MACRO TOK_MDEFINE
#define TOK_LAST_MACRO TOK_MENDIF
-
+
#define TOK_MIF 112
#define TOK_MELSE 113
#define TOK_MIDENT 114
@@ -3282,7 +3282,7 @@ static const char *tokens[] = {
[TOK_MIF ] = "#if",
[TOK_MELSE ] = "#else",
[TOK_MIDENT ] = "#:ident:",
-[TOK_EOL ] = "EOL",
+[TOK_EOL ] = "EOL",
[TOK_EOF ] = "EOF",
};
@@ -3306,7 +3306,7 @@ static struct hash_entry *lookup(
unsigned int index;
index = hash(name, name_len);
entry = state->hash_table[index];
- while(entry &&
+ while(entry &&
((entry->name_len != name_len) ||
(memcmp(entry->name, name, name_len) != 0))) {
entry = entry->next;
@@ -3336,7 +3336,7 @@ static void ident_to_keyword(struct compile_state *state, struct token *tk)
entry = tk->ident;
if (entry && ((entry->tok == TOK_TYPE_NAME) ||
(entry->tok == TOK_ENUM_CONST) ||
- ((entry->tok >= TOK_FIRST_KEYWORD) &&
+ ((entry->tok >= TOK_FIRST_KEYWORD) &&
(entry->tok <= TOK_LAST_KEYWORD)))) {
tk->tok = entry->tok;
}
@@ -3397,7 +3397,7 @@ static void symbol(
romcc_symbol(state, ident, chain, def, type, state->scope_depth);
}
-static void var_symbol(struct compile_state *state,
+static void var_symbol(struct compile_state *state,
struct hash_entry *ident, struct triple *def)
{
if ((def->type->type & TYPE_MASK) == TYPE_PRODUCT) {
@@ -3406,7 +3406,7 @@ static void var_symbol(struct compile_state *state,
symbol(state, ident, &ident->sym_ident, def, def->type);
}
-static void label_symbol(struct compile_state *state,
+static void label_symbol(struct compile_state *state,
struct hash_entry *ident, struct triple *label, int depth)
{
romcc_symbol(state, ident, &ident->sym_label, label, &void_type, depth);
@@ -3435,7 +3435,7 @@ static void end_scope(struct compile_state *state)
int i;
int depth;
/* Walk through the hash table and remove all symbols
- * in the current scope.
+ * in the current scope.
*/
depth = state->scope_depth;
for(i = 0; i < HASH_TABLE_SIZE; i++) {
@@ -3518,7 +3518,7 @@ static void undef_macro(struct compile_state *state, struct hash_entry *ident)
struct macro_arg *arg, *anext;
macro = ident->sym_define;
ident->sym_define = 0;
-
+
/* Free the macro arguments... */
anext = macro->args;
while(anext) {
@@ -3535,8 +3535,8 @@ static void undef_macro(struct compile_state *state, struct hash_entry *ident)
}
}
-static void do_define_macro(struct compile_state *state,
- struct hash_entry *ident, const char *body,
+static void do_define_macro(struct compile_state *state,
+ struct hash_entry *ident, const char *body,
int argc, struct macro_arg *args)
{
struct macro *macro;
@@ -3550,7 +3550,7 @@ static void do_define_macro(struct compile_state *state,
int identical_bodies, identical_args;
struct macro_arg *oarg;
/* Explicitly allow identical redfinitions of the same macro */
- identical_bodies =
+ identical_bodies =
(macro->buf_len == body_len) &&
(memcmp(macro->buf, body, body_len) == 0);
identical_args = macro->argc == argc;
@@ -3580,7 +3580,7 @@ static void do_define_macro(struct compile_state *state,
ident->sym_define = macro;
}
-
+
static void define_macro(
struct compile_state *state,
struct hash_entry *ident,
@@ -3632,7 +3632,7 @@ static void register_builtin_macros(struct compile_state *state)
register_builtin_macro(state, "__STDC__", "0");
/* In particular I don't conform to C99 */
register_builtin_macro(state, "__STDC_VERSION__", "199901L");
-
+
}
static void process_cmdline_macros(struct compile_state *state)
@@ -3679,7 +3679,7 @@ static int digitp(int c)
{
int ret = 0;
switch(c) {
- case '0': case '1': case '2': case '3': case '4':
+ case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
ret = 1;
break;
@@ -3699,7 +3699,7 @@ static int hexdigitp(int c)
{
int ret = 0;
switch(c) {
- case '0': case '1': case '2': case '3': case '4':
+ case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
@@ -3708,7 +3708,7 @@ static int hexdigitp(int c)
}
return ret;
}
-static int hexdigval(int c)
+static int hexdigval(int c)
{
int val = -1;
if ((c >= '0') && (c <= '9')) {
@@ -3727,7 +3727,7 @@ static int octdigitp(int c)
{
int ret = 0;
switch(c) {
- case '0': case '1': case '2': case '3':
+ case '0': case '1': case '2': case '3':
case '4': case '5': case '6': case '7':
ret = 1;
break;
@@ -3800,7 +3800,7 @@ static int char_value(struct compile_state *state,
case '?': c = '?'; str++; break;
case '\'': c = '\''; str++; break;
case '"': c = '"'; str++; break;
- case 'x':
+ case 'x':
c = 0;
str++;
while((str < end) && hexdigitp(*str)) {
@@ -3809,7 +3809,7 @@ static int char_value(struct compile_state *state,
str++;
}
break;
- case '0': case '1': case '2': case '3':
+ case '0': case '1': case '2': case '3':
case '4': case '5': case '6': case '7':
c = 0;
while((str < end) && octdigitp(*str)) {
@@ -3836,7 +3836,7 @@ static const char *next_char(struct file_state *file, const char *pos, int index
int c = *pos;
/* Is this a trigraph? */
if (file->trigraphs &&
- (c == '?') && ((end - pos) >= 3) && (pos[1] == '?'))
+ (c == '?') && ((end - pos) >= 3) && (pos[1] == '?'))
{
switch(pos[2]) {
case '=': c = '#'; break;
@@ -3890,7 +3890,7 @@ static int get_char(struct file_state *file, const char *pos)
c = *pos;
/* If it is a trigraph get the trigraph value */
if (file->trigraphs &&
- (c == '?') && ((end - pos) >= 3) && (pos[1] == '?'))
+ (c == '?') && ((end - pos) >= 3) && (pos[1] == '?'))
{
switch(pos[2]) {
case '=': c = '#'; break;
@@ -3935,7 +3935,7 @@ static size_t char_strlen(struct file_state *file, const char *src, const char *
return len;
}
-static void char_strcpy(char *dest,
+static void char_strcpy(char *dest,
struct file_state *file, const char *src, const char *end)
{
while(src < end) {
@@ -3946,7 +3946,7 @@ static void char_strcpy(char *dest,
}
}
-static char *char_strdup(struct file_state *file,
+static char *char_strdup(struct file_state *file,
const char *start, const char *end, const char *id)
{
char *str;
@@ -4006,7 +4006,7 @@ static void save_string(struct file_state *file,
tk->str_len = strlen(str);
}
-static void raw_next_token(struct compile_state *state,
+static void raw_next_token(struct compile_state *state,
struct file_state *file, struct token *tk)
{
const char *token;
@@ -4043,7 +4043,7 @@ static void raw_next_token(struct compile_state *state,
tokp = next_char(file, tokp, 1);
while((c = get_char(file, tokp)) != -1) {
/* Advance to the next character only after we verify
- * the current character is not a newline.
+ * the current character is not a newline.
* EOL is special to the preprocessor so we don't
* want to loose any.
*/
@@ -4135,12 +4135,12 @@ static void raw_next_token(struct compile_state *state,
/* Save the character value */
save_string(file, tk, token, tokp, "literal character");
}
- /* integer and floating constants
+ /* integer and floating constants
* Integer Constants
* {digits}
* 0[Xx]{hexdigits}
* 0{octdigit}+
- *
+ *
* Floating constants
* {digits}.{digits}[Ee][+-]?{digits}
* {digits}.{digits}
@@ -4250,9 +4250,9 @@ static void raw_next_token(struct compile_state *state,
}
}
/* C99 alternate macro characters */
- else if ((c == '%') && (c1 == ':') && (c2 == '%') && (c3 == ':')) {
+ else if ((c == '%') && (c1 == ':') && (c2 == '%') && (c3 == ':')) {
eat += 3;
- tok = TOK_CONCATENATE;
+ tok = TOK_CONCATENATE;
}
else if ((c == '.') && (c1 == '.') && (c2 == '.')) { eat += 2; tok = TOK_DOTS; }
else if ((c == '<') && (c1 == '<') && (c2 == '=')) { eat += 2; tok = TOK_SLEQ; }
@@ -4335,7 +4335,7 @@ struct macro_arg_value {
size_t len;
};
static struct macro_arg_value *read_macro_args(
- struct compile_state *state, struct macro *macro,
+ struct compile_state *state, struct macro *macro,
struct file_state *file, struct token *tk)
{
struct macro_arg_value *argv;
@@ -4357,15 +4357,15 @@ static struct macro_arg_value *read_macro_args(
}
paren_depth = 0;
i = 0;
-
+
for(;;) {
const char *start;
size_t len;
start = file->pos;
raw_next_token(state, file, tk);
-
+
if (!paren_depth && (tk->tok == TOK_COMMA) &&
- (argv[i].ident != state->i___VA_ARGS__))
+ (argv[i].ident != state->i___VA_ARGS__))
{
i++;
if (i >= macro->argc) {
@@ -4374,11 +4374,11 @@ static struct macro_arg_value *read_macro_args(
}
continue;
}
-
+
if (tk->tok == TOK_LPAREN) {
paren_depth++;
}
-
+
if (tk->tok == TOK_RPAREN) {
if (paren_depth == 0) {
break;
@@ -4396,7 +4396,7 @@ static struct macro_arg_value *read_macro_args(
argv[i].len += len;
}
if (i != macro->argc -1) {
- error(state, 0, "missing %s arg %d\n",
+ error(state, 0, "missing %s arg %d\n",
macro->ident->name, i +2);
}
return argv;
@@ -4458,14 +4458,14 @@ static void append_macro_chars(struct compile_state *state,
buf->pos += flen;
}
-static int compile_macro(struct compile_state *state,
+static int compile_macro(struct compile_state *state,
struct file_state **filep, struct token *tk);
-static void macro_expand_args(struct compile_state *state,
+static void macro_expand_args(struct compile_state *state,
struct macro *macro, struct macro_arg_value *argv, struct token *tk)
{
int i;
-
+
for(i = 0; i < macro->argc; i++) {
struct file_state fmacro, *file;
struct macro_buf buf;
@@ -4492,7 +4492,7 @@ static void macro_expand_args(struct compile_state *state,
file = &fmacro;
for(;;) {
raw_next_token(state, file, tk);
-
+
/* If we have recursed into another macro body
* get out of it.
*/
@@ -4518,7 +4518,7 @@ static void macro_expand_args(struct compile_state *state,
append_macro_chars(state, macro->ident->name, &buf,
file, tk->pos, file->pos);
}
-
+
xfree(argv[i].value);
argv[i].value = buf.str;
argv[i].len = buf.pos;
@@ -4551,12 +4551,12 @@ static void expand_macro(struct compile_state *state,
fmacro.macro = 1;
fmacro.trigraphs = 0;
fmacro.join_lines = 0;
-
+
/* Allocate a buffer to hold the macro expansion */
buf->len = macro->buf_len + 3;
buf->str = xmalloc(buf->len, macro->ident->name);
buf->pos = 0;
-
+
fstart = fmacro.pos;
raw_next_token(state, &fmacro, tk);
while(tk->tok != TOK_EOF) {
@@ -4600,7 +4600,7 @@ static void expand_macro(struct compile_state *state,
if (*str == '\\') {
str = "\\";
len = 2;
- }
+ }
else if (*str == '"') {
str = "\\\"";
len = 2;
@@ -4642,7 +4642,7 @@ static void expand_macro(struct compile_state *state,
}
append_macro_text(state, macro->ident->name, buf, fstart, flen);
-
+
fstart = fmacro.pos;
raw_next_token(state, &fmacro, tk);
}
@@ -4674,19 +4674,19 @@ static void tag_macro_name(struct compile_state *state,
fmacro.macro = 1;
fmacro.trigraphs = 0;
fmacro.join_lines = 0;
-
+
/* Allocate a new macro expansion buffer */
buf->len = macro->buf_len + 3;
buf->str = xmalloc(buf->len, macro->ident->name);
buf->pos = 0;
-
+
fstart = fmacro.pos;
raw_next_token(state, &fmacro, tk);
while(tk->tok != TOK_EOF) {
flen = fmacro.pos - fstart;
if ((tk->tok == TOK_IDENT) &&
(tk->ident == macro->ident) &&
- (tk->val.notmacro == 0))
+ (tk->val.notmacro == 0))
{
append_macro_text(state, macro->ident->name, buf, fstart, flen);
fstart = "$";
@@ -4694,14 +4694,14 @@ static void tag_macro_name(struct compile_state *state,
}
append_macro_text(state, macro->ident->name, buf, fstart, flen);
-
+
fstart = fmacro.pos;
raw_next_token(state, &fmacro, tk);
}
xfree(fmacro.buf);
}
-static int compile_macro(struct compile_state *state,
+static int compile_macro(struct compile_state *state,
struct file_state **filep, struct token *tk)
{
struct file_state *file;
@@ -4808,7 +4808,7 @@ static int if_value(struct compile_state *state)
offset = state->if_depth % CHAR_BIT;
return !!(state->if_bytes[index] & (1 << (offset)));
}
-static void set_if_value(struct compile_state *state, int value)
+static void set_if_value(struct compile_state *state, int value)
{
int index, offset;
index = state->if_depth / CHAR_BIT;
@@ -4871,8 +4871,8 @@ static void raw_token(struct compile_state *state, struct token *tk)
rescan = 0;
file = state->file;
/* Exit out of an include directive or macro call */
- if ((tk->tok == TOK_EOF) &&
- (file != state->macro_file) && file->prev)
+ if ((tk->tok == TOK_EOF) &&
+ (file != state->macro_file) && file->prev)
{
state->file = file->prev;
/* file->basename is used keep it */
@@ -4939,8 +4939,8 @@ static void token(struct compile_state *state, struct token *tk)
pp_token(state, tk);
}
}
- /* Eat tokens disabled by the preprocessor
- * (Unless we are parsing a preprocessor directive
+ /* Eat tokens disabled by the preprocessor
+ * (Unless we are parsing a preprocessor directive
*/
else if (if_eat(state) && (state->token_base == 0)) {
pp_token(state, tk);
@@ -4974,7 +4974,7 @@ static struct token *do_eat_token(struct compile_state *state, int tok)
struct token *tk;
int i;
check_tok(state, get_token(state, 1), tok);
-
+
/* Free the old token value */
tk = get_token(state, 0);
if (tk->str_len) {
@@ -5152,7 +5152,7 @@ static void preprocess(struct compile_state *state, struct token *current_token)
*/
int old_token_base;
int tok;
-
+
state->macro_file = state->file;
old_token_base = state->token_base;
@@ -5236,7 +5236,7 @@ static void preprocess(struct compile_state *state, struct token *current_token)
pp_eat(state, TOK_MUNDEF);
if (if_eat(state)) /* quit early when #if'd out */
break;
-
+
ident = pp_eat(state, TOK_MIDENT)->ident;
undef_macro(state, ident);
@@ -5246,7 +5246,7 @@ static void preprocess(struct compile_state *state, struct token *current_token)
pp_eat(state, TOK_MPRAGMA);
if (if_eat(state)) /* quit early when #if'd out */
break;
- warning(state, 0, "Ignoring pragma");
+ warning(state, 0, "Ignoring pragma");
break;
case TOK_MELIF:
pp_eat(state, TOK_MELIF);
@@ -5257,7 +5257,7 @@ static void preprocess(struct compile_state *state, struct token *current_token)
if (if_value(state)) {
eat_tokens(state, TOK_MENDIF);
}
- /* If the previous #if was not taken see if the #elif enables the
+ /* If the previous #if was not taken see if the #elif enables the
* trailing code.
*/
else {
@@ -5349,11 +5349,11 @@ static void preprocess(struct compile_state *state, struct token *current_token)
else if (tok == TOK_DOTS) {
pp_eat(state, TOK_DOTS);
aident = state->i___VA_ARGS__;
- }
+ }
else {
aident = pp_eat(state, TOK_MIDENT)->ident;
}
-
+
narg = xcmalloc(sizeof(*arg), "macro arg");
narg->ident = aident;
@@ -5395,7 +5395,7 @@ static void preprocess(struct compile_state *state, struct token *current_token)
mend = get_token(state, 1)->pos;
}
}
-
+
/* Now that I have found the body defined the token */
do_define_macro(state, ident,
char_strdup(state->file, mstart, mend, "macro buf"),
@@ -5406,7 +5406,7 @@ static void preprocess(struct compile_state *state, struct token *current_token)
{
const char *start, *end;
int len;
-
+
pp_eat(state, TOK_MERROR);
/* Find the start of the line */
raw_peek(state);
@@ -5427,13 +5427,13 @@ static void preprocess(struct compile_state *state, struct token *current_token)
{
const char *start, *end;
int len;
-
+
pp_eat(state, TOK_MWARNING);
/* Find the start of the line */
raw_peek(state);
start = get_token(state, 1)->pos;
-
+
/* Find the end of the line */
while((tok = raw_peek(state)) != TOK_EOL) {
raw_eat(state, tok);
@@ -5520,7 +5520,7 @@ static void preprocess(struct compile_state *state, struct token *current_token)
if (tok == TOK_MIDENT) {
name2 = get_token(state, 1)->ident->name;
}
- error(state, 0, "Invalid preprocessor directive: %s %s",
+ error(state, 0, "Invalid preprocessor directive: %s %s",
name1, name2);
break;
}
@@ -5605,7 +5605,7 @@ static struct type *invalid_type(struct compile_state *state, struct type *type)
case TYPE_STRUCT:
case TYPE_TUPLE:
member = type->left;
- while(member && (invalid == 0) &&
+ while(member && (invalid == 0) &&
((member->type & TYPE_MASK) == TYPE_PRODUCT)) {
invalid = invalid_type(state, member->left);
member = member->right;
@@ -5631,7 +5631,7 @@ static struct type *invalid_type(struct compile_state *state, struct type *type)
break;
}
return invalid;
-
+
}
#define MASK_UCHAR(X) ((X) & ((ulong_t)0xff))
@@ -5666,7 +5666,7 @@ static struct type void_ptr_type = {
};
#if DEBUG_ROMCC_WARNING
-static struct type void_func_type = {
+static struct type void_func_type = {
.type = TYPE_FUNCTION,
.left = &void_type,
.right = &void_type,
@@ -5799,19 +5799,19 @@ static void name_of(FILE *fp, struct type *type)
name_of(fp, type->right);
break;
case TYPE_ENUM:
- fprintf(fp, "enum %s",
+ fprintf(fp, "enum %s",
(type->type_ident)? type->type_ident->name : "");
qual_of(fp, type);
break;
case TYPE_STRUCT:
- fprintf(fp, "struct %s { ",
+ fprintf(fp, "struct %s { ",
(type->type_ident)? type->type_ident->name : "");
name_of(fp, type->left);
fprintf(fp, " } ");
qual_of(fp, type);
break;
case TYPE_UNION:
- fprintf(fp, "union %s { ",
+ fprintf(fp, "union %s { ",
(type->type_ident)? type->type_ident->name : "");
name_of(fp, type->left);
fprintf(fp, " } ");
@@ -5828,7 +5828,7 @@ static void name_of(FILE *fp, struct type *type)
fprintf(fp, " [%ld]", (long)(type->elements));
break;
case TYPE_TUPLE:
- fprintf(fp, "tuple { ");
+ fprintf(fp, "tuple { ");
name_of(fp, type->left);
fprintf(fp, " } ");
qual_of(fp, type);
@@ -5975,7 +5975,7 @@ static size_t align_of_in_bytes(struct compile_state *state, struct type *type)
static size_t size_of(struct compile_state *state, struct type *type);
static size_t reg_size_of(struct compile_state *state, struct type *type);
-static size_t needed_padding(struct compile_state *state,
+static size_t needed_padding(struct compile_state *state,
struct type *type, size_t offset)
{
size_t padding, align;
@@ -5997,7 +5997,7 @@ static size_t needed_padding(struct compile_state *state,
return padding;
}
-static size_t reg_needed_padding(struct compile_state *state,
+static size_t reg_needed_padding(struct compile_state *state,
struct type *type, size_t offset)
{
size_t padding, align;
@@ -6006,7 +6006,7 @@ static size_t reg_needed_padding(struct compile_state *state,
* fit into the current register.
*/
if (((type->type & TYPE_MASK) == TYPE_BITFIELD) &&
- (((offset + type->elements)/REG_SIZEOF_REG) != (offset/REG_SIZEOF_REG)))
+ (((offset + type->elements)/REG_SIZEOF_REG) != (offset/REG_SIZEOF_REG)))
{
align = REG_SIZEOF_REG;
}
@@ -6203,7 +6203,7 @@ static size_t size_of_in_bytes(struct compile_state *state, struct type *type)
return bits_to_bytes(size_of(state, type));
}
-static size_t field_offset(struct compile_state *state,
+static size_t field_offset(struct compile_state *state,
struct type *type, struct hash_entry *field)
{
struct type *member;
@@ -6244,7 +6244,7 @@ static size_t field_offset(struct compile_state *state,
return size;
}
-static size_t field_reg_offset(struct compile_state *state,
+static size_t field_reg_offset(struct compile_state *state,
struct type *type, struct hash_entry *field)
{
struct type *member;
@@ -6285,7 +6285,7 @@ static size_t field_reg_offset(struct compile_state *state,
return size;
}
-static struct type *field_type(struct compile_state *state,
+static struct type *field_type(struct compile_state *state,
struct type *type, struct hash_entry *field)
{
struct type *member;
@@ -6314,14 +6314,14 @@ static struct type *field_type(struct compile_state *state,
else {
internal_error(state, 0, "field_type only works on structures and unions");
}
-
+
if (!member || (member->field_ident != field)) {
error(state, 0, "member %s not present", field->name);
}
return member;
}
-static size_t index_offset(struct compile_state *state,
+static size_t index_offset(struct compile_state *state,
struct type *type, ulong_t index)
{
struct type *member;
@@ -6367,14 +6367,14 @@ static size_t index_offset(struct compile_state *state,
}
}
else {
- internal_error(state, 0,
+ internal_error(state, 0,
"request for index %u in something not an array, tuple or join",
index);
}
return size;
}
-static size_t index_reg_offset(struct compile_state *state,
+static size_t index_reg_offset(struct compile_state *state,
struct type *type, ulong_t index)
{
struct type *member;
@@ -6401,7 +6401,7 @@ static size_t index_reg_offset(struct compile_state *state,
if (i != index) {
internal_error(state, 0, "Missing member index: %u", index);
}
-
+
}
else if ((type->type & TYPE_MASK) == TYPE_JOIN) {
ulong_t i;
@@ -6421,7 +6421,7 @@ static size_t index_reg_offset(struct compile_state *state,
}
}
else {
- internal_error(state, 0,
+ internal_error(state, 0,
"request for index %u in something not an array, tuple or join",
index);
}
@@ -6472,7 +6472,7 @@ static struct type *index_type(struct compile_state *state,
}
else {
member = 0;
- internal_error(state, 0,
+ internal_error(state, 0,
"request for index %u in something not an array, tuple or join",
index);
}
@@ -6697,7 +6697,7 @@ static struct type *reg_type(
name_of(state->errout, type);
fprintf(state->errout, "\n");
internal_error(state, 0, "reg_type not yet defined for type");
-
+
}
}
/* If I have a single register compound type not a bit-field
@@ -6725,7 +6725,7 @@ static struct type *reg_type(
}
static struct type *next_field(struct compile_state *state,
- struct type *type, struct type *prev_member)
+ struct type *type, struct type *prev_member)
{
struct type *member;
if ((type->type & TYPE_MASK) != TYPE_STRUCT) {
@@ -6746,13 +6746,13 @@ static struct type *next_field(struct compile_state *state,
prev_member = 0;
}
if (prev_member) {
- internal_error(state, 0, "prev_member %s not present",
+ internal_error(state, 0, "prev_member %s not present",
prev_member->field_ident->name);
}
return member;
}
-typedef void (*walk_type_fields_cb_t)(struct compile_state *state, struct type *type,
+typedef void (*walk_type_fields_cb_t)(struct compile_state *state, struct type *type,
size_t ret_offset, size_t mem_offset, void *arg);
static void walk_type_fields(struct compile_state *state,
@@ -6775,15 +6775,15 @@ static void walk_struct_fields(struct compile_state *state,
if ((mtype->type & TYPE_MASK) == TYPE_PRODUCT) {
mtype = mtype->left;
}
- walk_type_fields(state, mtype,
- reg_offset +
+ walk_type_fields(state, mtype,
+ reg_offset +
field_reg_offset(state, type, mtype->field_ident),
- mem_offset +
+ mem_offset +
field_offset(state, type, mtype->field_ident),
cb, arg);
tptr = tptr->right;
}
-
+
}
static void walk_type_fields(struct compile_state *state,
@@ -7070,7 +7070,7 @@ static struct type *compatible_ptrs(struct type *left, struct type *right)
result = new_type(qual_type, result, 0);
}
return result;
-
+
}
static struct triple *integral_promotion(
struct compile_state *state, struct triple *def)
@@ -7090,7 +7090,7 @@ static struct triple *integral_promotion(
def->type = new_type(int_type, 0, 0);
}
else {
- def = triple(state, OP_CONVERT,
+ def = triple(state, OP_CONVERT,
new_type(int_type, 0, 0), def, 0);
}
}
@@ -7149,7 +7149,7 @@ static int is_compound_type(struct type *type)
case TYPE_STRUCT:
case TYPE_TUPLE:
case TYPE_UNION:
- case TYPE_JOIN:
+ case TYPE_JOIN:
is_compound = 1;
break;
default:
@@ -7189,8 +7189,8 @@ static int is_lvalue(struct compile_state *state, struct triple *def)
if (!def) {
return 0;
}
- if ((def->op == OP_ADECL) ||
- (def->op == OP_SDECL) ||
+ if ((def->op == OP_ADECL) ||
+ (def->op == OP_SDECL) ||
(def->op == OP_DEREF) ||
(def->op == OP_BLOBCONST) ||
(def->op == OP_LIST)) {
@@ -7207,7 +7207,7 @@ static void clvalue(struct compile_state *state, struct triple *def)
if (!def) {
internal_error(state, def, "nothing where lvalue expected?");
}
- if (!is_lvalue(state, def)) {
+ if (!is_lvalue(state, def)) {
error(state, def, "lvalue expected");
}
}
@@ -7251,7 +7251,7 @@ static struct triple *int_const(
static struct triple *read_expr(struct compile_state *state, struct triple *def);
-static struct triple *do_mk_addr_expr(struct compile_state *state,
+static struct triple *do_mk_addr_expr(struct compile_state *state,
struct triple *expr, struct type *type, ulong_t offset)
{
struct triple *result;
@@ -7260,7 +7260,7 @@ static struct triple *do_mk_addr_expr(struct compile_state *state,
ptr_type = new_type(TYPE_POINTER | (type->type & QUAL_MASK), type, 0);
-
+
result = 0;
if (expr->op == OP_ADECL) {
error(state, expr, "address of auto variables not supported");
@@ -7436,7 +7436,7 @@ static struct triple *read_expr(struct compile_state *state, struct triple *def)
return def;
}
-int is_write_compatible(struct compile_state *state,
+int is_write_compatible(struct compile_state *state,
struct type *dest, struct type *rval)
{
int compatible = 0;
@@ -7588,7 +7588,7 @@ struct type *ptr_arithmetic_result(
/* Sanity checks to ensure I am working with the proper types */
ptr_arithmetic(state, left);
arithmetic(state, right);
- if (TYPE_ARITHMETIC(left->type->type) &&
+ if (TYPE_ARITHMETIC(left->type->type) &&
TYPE_ARITHMETIC(right->type->type)) {
type = arithmetic_result(state, left, right);
}
@@ -7604,7 +7604,7 @@ struct type *ptr_arithmetic_result(
/* boolean helper function */
-static struct triple *ltrue_expr(struct compile_state *state,
+static struct triple *ltrue_expr(struct compile_state *state,
struct triple *expr)
{
switch(expr->op) {
@@ -7620,7 +7620,7 @@ static struct triple *ltrue_expr(struct compile_state *state,
return expr;
}
-static struct triple *lfalse_expr(struct compile_state *state,
+static struct triple *lfalse_expr(struct compile_state *state,
struct triple *expr)
{
return triple(state, OP_LFALSE, &int_type, expr, 0);
@@ -7636,15 +7636,15 @@ static struct triple *mkland_expr(
/* Generate some intermediate triples */
end = label(state);
var = variable(state, &int_type);
-
+
/* Store the left hand side value */
lstore = write_expr(state, var, left);
/* Jump if the value is false */
- jmp = branch(state, end,
+ jmp = branch(state, end,
lfalse_expr(state, read_expr(state, var)));
mid = label(state);
-
+
/* Store the right hand side value */
rstore = write_expr(state, var, right);
@@ -7653,7 +7653,7 @@ static struct triple *mkland_expr(
/* Generate the prog for a logical and */
def = mkprog(state, var, lstore, jmp, mid, rstore, end, val, 0UL);
-
+
return def;
}
@@ -7666,17 +7666,17 @@ static struct triple *mklor_expr(
/* Generate some intermediate triples */
end = label(state);
var = variable(state, &int_type);
-
+
/* Store the left hand side value */
left = write_expr(state, var, left);
-
+
/* Jump if the value is true */
jmp = branch(state, end, read_expr(state, var));
mid = label(state);
-
+
/* Store the right hand side value */
right = write_expr(state, var, right);
-
+
/* An expression for the computed value*/
val = read_expr(state, var);
@@ -7687,7 +7687,7 @@ static struct triple *mklor_expr(
}
static struct triple *mkcond_expr(
- struct compile_state *state,
+ struct compile_state *state,
struct triple *test, struct triple *left, struct triple *right)
{
struct triple *def, *val, *var, *jmp1, *jmp2, *top, *mid, *end;
@@ -7742,7 +7742,7 @@ static struct triple *mkcond_expr(
/* Store the right hand side value */
right = write_expr(state, var, right);
-
+
/* An expression for the computed value */
val = read_expr(state, var);
@@ -7834,7 +7834,7 @@ static struct triple *flatten_generic(
insert_triple(state, first, ptr);
ptr->id |= TRIPLE_FLAG_FLATTENED;
ptr->id &= ~TRIPLE_FLAG_LOCAL;
-
+
/* Now flatten the lhs elements */
for(i = 0; i < lhs; i++) {
struct triple **ins = &LHS(ptr, i);
@@ -7865,7 +7865,7 @@ static struct triple *flatten_prog(
unuse_triple(first, body->prev);
use_triple(body, body->prev);
}
-
+
if (!(val->id & TRIPLE_FLAG_FLATTENED)) {
internal_error(state, val, "val not flattened?");
}
@@ -7977,7 +7977,7 @@ static struct triple *flatten(
base = MISC(ptr, 0);
offset = bits_to_bytes(field_offset(state, base->type, ptr->u.field));
left = RHS(base, 0);
- ptr = triple(state, OP_ADD, left->type,
+ ptr = triple(state, OP_ADD, left->type,
read_expr(state, left),
int_const(state, &ulong_type, offset));
free_triple(state, base);
@@ -8198,8 +8198,8 @@ static struct triple *mk_add_expr(
if (!equiv_types(right->type, ptr_math)) {
right = mk_cast_expr(state, ptr_math, right);
}
- right = triple(state, op, ptr_math, right,
- int_const(state, ptr_math,
+ right = triple(state, op, ptr_math, right,
+ int_const(state, ptr_math,
size_of_in_bytes(state, left->type->left)));
}
return triple(state, OP_ADD, result_type, left, right);
@@ -8225,8 +8225,8 @@ static struct triple *mk_sub_expr(
if (!equiv_types(right->type, ptr_math)) {
right = mk_cast_expr(state, ptr_math, right);
}
- right = triple(state, op, ptr_math, right,
- int_const(state, ptr_math,
+ right = triple(state, op, ptr_math, right,
+ int_const(state, ptr_math,
size_of_in_bytes(state, left->type->left)));
}
return triple(state, OP_SUB, result_type, left, right);
@@ -8272,7 +8272,7 @@ static struct triple *mk_post_dec_expr(
struct triple *val;
lvalue(state, def);
val = read_expr(state, def);
- return triple(state, OP_VAL, def->type,
+ return triple(state, OP_VAL, def->type,
write_expr(state, def,
mk_sub_expr(state, val, int_const(state, &int_type, 1)))
, val);
@@ -8304,12 +8304,12 @@ static int is_simple_const(struct triple *ins)
/* Is this a constant that u.cval has the value.
* Or equivalently is this a constant that read_const
* works on.
- * So far only OP_INTCONST qualifies.
+ * So far only OP_INTCONST qualifies.
*/
return (ins->op == OP_INTCONST);
}
-static int constants_equal(struct compile_state *state,
+static int constants_equal(struct compile_state *state,
struct triple *left, struct triple *right)
{
int equal;
@@ -8386,7 +8386,7 @@ static long_t bit_count(ulong_t value)
}
}
return count;
-
+
}
#endif
@@ -8449,12 +8449,12 @@ static ulong_t read_const(struct compile_state *state,
struct triple *ins, struct triple *rhs)
{
switch(rhs->type->type &TYPE_MASK) {
- case TYPE_CHAR:
+ case TYPE_CHAR:
case TYPE_SHORT:
case TYPE_INT:
case TYPE_LONG:
- case TYPE_UCHAR:
- case TYPE_USHORT:
+ case TYPE_UCHAR:
+ case TYPE_USHORT:
case TYPE_UINT:
case TYPE_ULONG:
case TYPE_POINTER:
@@ -8504,7 +8504,7 @@ int const_eq(struct compile_state *state, struct triple *ins,
rval = read_const(state, ins, right);
result = (lval == rval);
}
- else if ((left->op == OP_ADDRCONST) &&
+ else if ((left->op == OP_ADDRCONST) &&
(right->op == OP_ADDRCONST)) {
result = (MISC(left, 0) == MISC(right, 0)) &&
(left->u.cval == right->u.cval);
@@ -8514,7 +8514,7 @@ int const_eq(struct compile_state *state, struct triple *ins,
result = -1;
}
return result;
-
+
}
int const_ucmp(struct compile_state *state, struct triple *ins,
@@ -8539,7 +8539,7 @@ int const_ucmp(struct compile_state *state, struct triple *ins,
result = -1;
}
}
- else if ((left->op == OP_ADDRCONST) &&
+ else if ((left->op == OP_ADDRCONST) &&
(right->op == OP_ADDRCONST) &&
(MISC(left, 0) == MISC(right, 0))) {
result = 0;
@@ -8636,7 +8636,7 @@ static void check_lhs(struct compile_state *state, struct triple *ins)
for(;expr;expr = triple_lhs(state, ins, expr)) {
internal_error(state, ins, "unexpected lhs");
}
-
+
}
#endif
@@ -8694,7 +8694,7 @@ static void wipe_branch(struct compile_state *state, struct triple *ins)
}
#endif
-static void mkcopy(struct compile_state *state,
+static void mkcopy(struct compile_state *state,
struct triple *ins, struct triple *rhs)
{
struct block *block;
@@ -8716,7 +8716,7 @@ static void mkcopy(struct compile_state *state,
use_triple(RHS(ins, 0), ins);
}
-static void mkconst(struct compile_state *state,
+static void mkconst(struct compile_state *state,
struct triple *ins, ulong_t value)
{
if (!is_integral(ins) && !is_pointer(ins)) {
@@ -8746,7 +8746,7 @@ static void mkaddr_const(struct compile_state *state,
}
#if DEBUG_DECOMPOSE_PRINT_TUPLES
-static void print_tuple(struct compile_state *state,
+static void print_tuple(struct compile_state *state,
struct triple *ins, struct triple *tuple)
{
FILE *fp = state->dbgout;
@@ -8757,11 +8757,11 @@ static void print_tuple(struct compile_state *state,
name_of(fp, LHS(tuple, 0)->type);
}
fprintf(fp, "\n");
-
+
}
#endif
-static struct triple *decompose_with_tuple(struct compile_state *state,
+static struct triple *decompose_with_tuple(struct compile_state *state,
struct triple *ins, struct triple *tuple)
{
struct triple *next;
@@ -8783,7 +8783,7 @@ static struct triple *decompose_with_tuple(struct compile_state *state,
propogate_use(state, ins, tuple);
release_triple(state, ins);
-
+
return next;
}
@@ -8801,7 +8801,7 @@ static struct triple *decompose_unknownval(struct compile_state *state,
#endif
get_occurance(ins->occurance);
- tuple = alloc_triple(state, OP_TUPLE, ins->type, -1, -1,
+ tuple = alloc_triple(state, OP_TUPLE, ins->type, -1, -1,
ins->occurance);
for(i = 0; i < tuple->lhs; i++) {
@@ -8818,7 +8818,7 @@ static struct triple *decompose_unknownval(struct compile_state *state,
}
-static struct triple *decompose_read(struct compile_state *state,
+static struct triple *decompose_read(struct compile_state *state,
struct triple *ins)
{
struct triple *tuple, *lval;
@@ -8834,7 +8834,7 @@ static struct triple *decompose_read(struct compile_state *state,
ins->occurance);
if ((tuple->lhs != lval->lhs) &&
- (!triple_is_def(state, lval) || (tuple->lhs != 1)))
+ (!triple_is_def(state, lval) || (tuple->lhs != 1)))
{
internal_error(state, ins, "lhs size inconsistency?");
}
@@ -8854,7 +8854,7 @@ static struct triple *decompose_read(struct compile_state *state,
}
get_occurance(tuple->occurance);
- read = alloc_triple(state, OP_READ, piece->type, -1, -1,
+ read = alloc_triple(state, OP_READ, piece->type, -1, -1,
tuple->occurance);
RHS(read, 0) = piece;
@@ -8881,12 +8881,12 @@ static struct triple *decompose_read(struct compile_state *state,
return decompose_with_tuple(state, ins, tuple);
}
-static struct triple *decompose_write(struct compile_state *state,
+static struct triple *decompose_write(struct compile_state *state,
struct triple *ins)
{
struct triple *tuple, *lval, *val;
ulong_t i;
-
+
lval = MISC(ins, 0);
val = RHS(ins, 0);
get_occurance(ins->occurance);
@@ -8894,7 +8894,7 @@ static struct triple *decompose_write(struct compile_state *state,
ins->occurance);
if ((tuple->lhs != lval->lhs) &&
- (!triple_is_def(state, lval) || tuple->lhs != 1))
+ (!triple_is_def(state, lval) || tuple->lhs != 1))
{
internal_error(state, ins, "lhs size inconsistency?");
}
@@ -8914,7 +8914,7 @@ static struct triple *decompose_write(struct compile_state *state,
}
pval = LHS(val, i);
}
-
+
/* See if the piece is really a bitref */
bitref = 0;
if (piece->op == OP_BITREF) {
@@ -8942,7 +8942,7 @@ static struct triple *decompose_write(struct compile_state *state,
}
get_occurance(tuple->occurance);
- write = alloc_triple(state, OP_WRITE, piece->type, -1, -1,
+ write = alloc_triple(state, OP_WRITE, piece->type, -1, -1,
tuple->occurance);
MISC(write, 0) = piece;
RHS(write, 0) = pval;
@@ -8961,7 +8961,7 @@ static void decompose_load_cb(struct compile_state *state,
{
struct decompose_load_info *info = arg;
struct triple *load;
-
+
if (reg_offset > info->tuple->lhs) {
internal_error(state, info->tuple, "lhs to small?");
}
@@ -8971,7 +8971,7 @@ static void decompose_load_cb(struct compile_state *state,
LHS(info->tuple, reg_offset/REG_SIZEOF_REG) = load;
}
-static struct triple *decompose_load(struct compile_state *state,
+static struct triple *decompose_load(struct compile_state *state,
struct triple *ins)
{
struct triple *tuple;
@@ -9004,7 +9004,7 @@ static void decompose_store_cb(struct compile_state *state,
{
struct decompose_store_info *info = arg;
struct triple *store;
-
+
if (reg_offset > info->tuple->lhs) {
internal_error(state, info->tuple, "lhs to small?");
}
@@ -9015,7 +9015,7 @@ static void decompose_store_cb(struct compile_state *state,
LHS(info->tuple, reg_offset/REG_SIZEOF_REG) = store;
}
-static struct triple *decompose_store(struct compile_state *state,
+static struct triple *decompose_store(struct compile_state *state,
struct triple *ins)
{
struct triple *tuple;
@@ -9037,7 +9037,7 @@ static struct triple *decompose_store(struct compile_state *state,
return decompose_with_tuple(state, ins, tuple);
}
-static struct triple *decompose_dot(struct compile_state *state,
+static struct triple *decompose_dot(struct compile_state *state,
struct triple *ins)
{
struct triple *tuple, *lval;
@@ -9059,7 +9059,7 @@ static struct triple *decompose_dot(struct compile_state *state,
#endif
get_occurance(ins->occurance);
- tuple = alloc_triple(state, OP_TUPLE, type, -1, -1,
+ tuple = alloc_triple(state, OP_TUPLE, type, -1, -1,
ins->occurance);
if (((ins->type->type & TYPE_MASK) == TYPE_BITFIELD) &&
@@ -9094,7 +9094,7 @@ static struct triple *decompose_dot(struct compile_state *state,
piece->u.bitfield.offset = reg_offset % REG_SIZEOF_REG;
}
else if ((reg_offset % REG_SIZEOF_REG) != 0) {
- internal_error(state, ins,
+ internal_error(state, ins,
"request for a nonbitfield sub register?");
}
@@ -9104,7 +9104,7 @@ static struct triple *decompose_dot(struct compile_state *state,
return decompose_with_tuple(state, ins, tuple);
}
-static struct triple *decompose_index(struct compile_state *state,
+static struct triple *decompose_index(struct compile_state *state,
struct triple *ins)
{
struct triple *tuple, *lval;
@@ -9124,7 +9124,7 @@ static struct triple *decompose_index(struct compile_state *state,
#endif
get_occurance(ins->occurance);
- tuple = alloc_triple(state, OP_TUPLE, type, -1, -1,
+ tuple = alloc_triple(state, OP_TUPLE, type, -1, -1,
ins->occurance);
for(i = 0; i < tuple->lhs; i++, idx++) {
@@ -9194,7 +9194,7 @@ static void decompose_compound_types(struct compile_state *state)
case OP_INDEX:
next = decompose_index(state, ins);
break;
-
+
}
#if DEBUG_DECOMPOSE_HIRES
fprintf(fp, "decompose next: %p \n", next);
@@ -9218,7 +9218,7 @@ static void decompose_compound_types(struct compile_state *state)
else {
release_triple(state, ins);
}
- }
+ }
ins = next;
} while(ins != first);
ins = first;
@@ -9227,7 +9227,7 @@ static void decompose_compound_types(struct compile_state *state)
if (ins->op == OP_BITREF) {
if (ins->use) {
internal_error(state, ins, "bitref used");
- }
+ }
else {
release_triple(state, ins);
}
@@ -9957,7 +9957,7 @@ static void simplify_sextract(struct compile_state *state, struct triple *ins)
val &= mask;
val <<= (SIZEOF_LONG - ins->u.bitfield.size);
sval = val;
- sval >>= (SIZEOF_LONG - ins->u.bitfield.size);
+ sval >>= (SIZEOF_LONG - ins->u.bitfield.size);
mkconst(state, ins, sval);
}
}
@@ -10078,7 +10078,7 @@ static struct triple *branch_target(struct compile_state *state, struct triple *
* loop back onto themselves. If I see one don't advance the
* target.
*/
- while(triple_is_structural(state, targ) &&
+ while(triple_is_structural(state, targ) &&
(targ->next != targ) && (targ->next != state->first)) {
targ = targ->next;
}
@@ -10095,7 +10095,7 @@ static void simplify_branch(struct compile_state *state, struct triple *ins)
if (ins->use != 0) {
internal_error(state, ins, "branch use");
}
- /* The challenge here with simplify branch is that I need to
+ /* The challenge here with simplify branch is that I need to
* make modifications to the control flow graph as well
* as to the branch instruction itself. That is handled
* by rebuilding the basic blocks after simplify all is called.
@@ -10112,7 +10112,7 @@ static void simplify_branch(struct compile_state *state, struct triple *ins)
struct triple *targ;
simplified = 0;
targ = branch_target(state, ins);
- if ((targ != ins) && (targ->op == OP_BRANCH) &&
+ if ((targ != ins) && (targ->op == OP_BRANCH) &&
!phi_dependency(targ->u.block))
{
unuse_triple(TARG(ins, 0), ins);
@@ -10192,7 +10192,7 @@ static void simplify_label(struct compile_state *state, struct triple *ins)
unuse_triple(ins, use);
use_triple(ins->prev, use);
}
-
+
}
}
if (ins->use) {
@@ -10229,7 +10229,7 @@ static void simplify_phi(struct compile_state *state, struct triple *ins)
return;
}
}
-
+
/* See if all of rhs members of a phi are the same */
value = slot[0];
for(i = 1; i < zrhs; i++) {
@@ -10357,11 +10357,11 @@ static const struct simplify_table {
[OP_BSF ] = { simplify_bsf, COMPILER_SIMPLIFY_OP },
[OP_BSR ] = { simplify_bsr, COMPILER_SIMPLIFY_OP },
[OP_RDMSR ] = { simplify_noop, COMPILER_SIMPLIFY_OP },
-[OP_WRMSR ] = { simplify_noop, COMPILER_SIMPLIFY_OP },
+[OP_WRMSR ] = { simplify_noop, COMPILER_SIMPLIFY_OP },
[OP_HLT ] = { simplify_noop, COMPILER_SIMPLIFY_OP },
};
-static inline void debug_simplify(struct compile_state *state,
+static inline void debug_simplify(struct compile_state *state,
simplify_t do_simplify, struct triple *ins)
{
#if DEBUG_SIMPLIFY_HIRES
@@ -10396,14 +10396,14 @@ static void simplify(struct compile_state *state, struct triple *ins)
else {
do_simplify = table_simplify[op].func;
}
- if (do_simplify &&
+ if (do_simplify &&
!(state->compiler->flags & table_simplify[op].flag)) {
do_simplify = simplify_noop;
}
if (do_simplify && (ins->id & TRIPLE_FLAG_VOLATILE)) {
do_simplify = simplify_noop;
}
-
+
if (!do_simplify) {
internal_error(state, ins, "cannot simplify op: %d %s",
op, tops(op));
@@ -10532,7 +10532,7 @@ static void register_builtin_function(struct compile_state *state,
ident = lookup(state, name, name_len);
ftype->type_ident = ident;
symbol(state, ident, &ident->sym_ident, def, ftype);
-
+
state->file = file.prev;
state->function = 0;
state->main_function = 0;
@@ -10579,7 +10579,7 @@ static struct type *register_builtin_type(struct compile_state *state,
name_len = strlen(name);
ident = lookup(state, name, name_len);
-
+
if ((type->type & TYPE_MASK) == TYPE_PRODUCT) {
ulong_t elements = 0;
struct type *field;
@@ -10628,23 +10628,23 @@ static void register_builtins(struct compile_state *state)
register_builtin_function(state, "__builtin_uldiv", OP_UDIVT, uldiv_type,
&ulong_type, &ulong_type);
- register_builtin_function(state, "__builtin_inb", OP_INB, &uchar_type,
+ register_builtin_function(state, "__builtin_inb", OP_INB, &uchar_type,
&ushort_type);
register_builtin_function(state, "__builtin_inw", OP_INW, &ushort_type,
&ushort_type);
- register_builtin_function(state, "__builtin_inl", OP_INL, &uint_type,
+ register_builtin_function(state, "__builtin_inl", OP_INL, &uint_type,
&ushort_type);
- register_builtin_function(state, "__builtin_outb", OP_OUTB, &void_type,
+ register_builtin_function(state, "__builtin_outb", OP_OUTB, &void_type,
&uchar_type, &ushort_type);
- register_builtin_function(state, "__builtin_outw", OP_OUTW, &void_type,
+ register_builtin_function(state, "__builtin_outw", OP_OUTW, &void_type,
&ushort_type, &ushort_type);
- register_builtin_function(state, "__builtin_outl", OP_OUTL, &void_type,
+ register_builtin_function(state, "__builtin_outl", OP_OUTL, &void_type,
&uint_type, &ushort_type);
-
- register_builtin_function(state, "__builtin_bsf", OP_BSF, &int_type,
+
+ register_builtin_function(state, "__builtin_bsf", OP_BSF, &int_type,
&int_type);
- register_builtin_function(state, "__builtin_bsr", OP_BSR, &int_type,
+ register_builtin_function(state, "__builtin_bsr", OP_BSR, &int_type,
&int_type);
msr_type = register_builtin_type(state, "__builtin_msr_t",
@@ -10655,13 +10655,13 @@ static void register_builtins(struct compile_state *state)
&ulong_type);
register_builtin_function(state, "__builtin_wrmsr", OP_WRMSR, &void_type,
&ulong_type, &ulong_type, &ulong_type);
-
- register_builtin_function(state, "__builtin_hlt", OP_HLT, &void_type,
+
+ register_builtin_function(state, "__builtin_hlt", OP_HLT, &void_type,
&void_type);
}
static struct type *declarator(
- struct compile_state *state, struct type *type,
+ struct compile_state *state, struct type *type,
struct hash_entry **ident, int need_ident);
static void decl(struct compile_state *state, struct triple *first);
static struct type *specifier_qualifier_list(struct compile_state *state);
@@ -11189,8 +11189,8 @@ static struct triple *shift_expr(struct compile_state *state)
right = read_expr(state, add_expr(state));
integral(state, right);
right = integral_promotion(state, right);
-
- op = (tok == TOK_SL)? OP_SL :
+
+ op = (tok == TOK_SL)? OP_SL :
is_signed(left->type)? OP_SSR: OP_USR;
def = triple(state, op, left->type, left, right);
@@ -11364,7 +11364,7 @@ static struct triple *lor_expr(struct compile_state *state)
right = read_expr(state, land_expr(state));
bool(state, right);
- def = mklor_expr(state,
+ def = mklor_expr(state,
ltrue_expr(state, left),
ltrue_expr(state, right));
}
@@ -11438,7 +11438,7 @@ static struct triple *eval_const_expr(
do {
valid_ins(state, ptr);
if ((ptr->op == OP_PHI) || (ptr->op == OP_LIST)) {
- internal_error(state, ptr,
+ internal_error(state, ptr,
"unexpected %s in constant expression",
tops(ptr->op));
}
@@ -11453,8 +11453,8 @@ static struct triple *eval_const_expr(
else if (triple_is_cbranch(state, ptr)) {
struct triple *cond_val;
cond_val = get_cv(state, cv, RHS(ptr, 0));
- if (!cond_val || !is_const(cond_val) ||
- (cond_val->op != OP_INTCONST))
+ if (!cond_val || !is_const(cond_val) ||
+ (cond_val->op != OP_INTCONST))
{
internal_error(state, ptr, "bad branch condition");
}
@@ -11470,16 +11470,16 @@ static struct triple *eval_const_expr(
else if (ptr->op == OP_WRITE) {
struct triple *val;
val = get_cv(state, cv, RHS(ptr, 0));
-
- set_cv(state, cv, MISC(ptr, 0),
+
+ set_cv(state, cv, MISC(ptr, 0),
copy_triple(state, val));
- set_cv(state, cv, ptr,
+ set_cv(state, cv, ptr,
copy_triple(state, val));
ptr = ptr->next;
}
else if (ptr->op == OP_READ) {
- set_cv(state, cv, ptr,
- copy_triple(state,
+ set_cv(state, cv, ptr,
+ copy_triple(state,
get_cv(state, cv, RHS(ptr, 0))));
ptr = ptr->next;
}
@@ -11500,7 +11500,7 @@ static struct triple *eval_const_expr(
else {
error(state, ptr, "impure operation in constant expression");
}
-
+
} while(ptr != head);
/* Get the result value */
@@ -11546,7 +11546,7 @@ static struct triple *assignment_expr(struct compile_state *state)
* a larger set of statements than standard C. As long
* as the subset of the grammar that is standard C behaves
* correctly this should cause no problems.
- *
+ *
* For the extra token strings accepted by the grammar
* none of them should produce a valid lvalue, so they
* should not produce functioning programs.
@@ -11559,7 +11559,7 @@ static struct triple *assignment_expr(struct compile_state *state)
case TOK_EQ:
lvalue(state, left);
eat(state, TOK_EQ);
- def = write_expr(state, left,
+ def = write_expr(state, left,
read_expr(state, assignment_expr(state)));
break;
case TOK_TIMESEQ:
@@ -11579,7 +11579,7 @@ static struct triple *assignment_expr(struct compile_state *state)
case TOK_MODEQ: op = sign? OP_SMOD : OP_UMOD; break;
}
def = write_expr(state, left,
- triple(state, op, left->type,
+ triple(state, op, left->type,
read_expr(state, left), right));
break;
case TOK_PLUSEQ:
@@ -11615,7 +11615,7 @@ static struct triple *assignment_expr(struct compile_state *state)
case TOK_OREQ: op = OP_OR; break;
}
def = write_expr(state, left,
- triple(state, op, left->type,
+ triple(state, op, left->type,
read_expr(state, left), right));
break;
}
@@ -11692,7 +11692,7 @@ static void for_statement(struct compile_state *state, struct triple *first)
head = test = tail = jmp1 = jmp2 = 0;
if (peek(state) != TOK_SEMI) {
head = expr(state);
- }
+ }
eat(state, TOK_SEMI);
if (peek(state) != TOK_SEMI) {
test = expr(state);
@@ -11824,7 +11824,7 @@ static void return_statement(struct compile_state *state, struct triple *first)
eat(state, TOK_SEMI);
/* See if this last statement in a function */
- last = ((peek(state) == TOK_RBRACE) &&
+ last = ((peek(state) == TOK_RBRACE) &&
(state->scope_depth == GLOBAL_SCOPE_DEPTH +2));
/* Find the return variable */
@@ -12167,7 +12167,7 @@ static void asm_statement(struct compile_state *state, struct triple *first)
for(i = 0; i < out; i++) {
struct triple *constraint;
constraint = out_param[i].constraint;
- info->tmpl.lhs[i] = arch_reg_constraint(state,
+ info->tmpl.lhs[i] = arch_reg_constraint(state,
out_param[i].expr->type, constraint->u.blob);
free_triple(state, constraint);
}
@@ -12197,9 +12197,9 @@ static void asm_statement(struct compile_state *state, struct triple *first)
}
info->tmpl.lhs[val] = cinfo;
info->tmpl.rhs[i] = cinfo;
-
+
} else {
- info->tmpl.rhs[i] = arch_reg_constraint(state,
+ info->tmpl.rhs[i] = arch_reg_constraint(state,
in_param[i].expr->type, str);
}
free_triple(state, constraint);
@@ -12219,7 +12219,7 @@ static void asm_statement(struct compile_state *state, struct triple *first)
size_t size = arch_reg_size(info->tmpl.lhs[i].reg);
if (size >= SIZEOF_LONG) {
type = &ulong_type;
- }
+ }
else if (size >= SIZEOF_INT) {
type = &uint_type;
}
@@ -12296,7 +12296,7 @@ static void statement(struct compile_state *state, struct triple *first)
compound_statement(state, first);
}
else if (tok == TOK_IF) {
- if_statement(state, first);
+ if_statement(state, first);
}
else if (tok == TOK_FOR) {
for_statement(state, first);
@@ -12326,7 +12326,7 @@ static void statement(struct compile_state *state, struct triple *first)
asm_statement(state, first);
}
else if ((tok == TOK_IDENT) && (peek2(state) == TOK_COLON)) {
- labeled_statement(state, first);
+ labeled_statement(state, first);
}
else if (tok == TOK_CASE) {
case_statement(state, first);
@@ -12348,7 +12348,7 @@ static struct type *param_decl(struct compile_state *state)
struct type *type;
struct hash_entry *ident;
/* Cheat so the declarator will know we are not global */
- start_scope(state);
+ start_scope(state);
ident = 0;
type = decl_specifiers(state);
type = declarator(state, type, &ident, 0);
@@ -12388,7 +12388,7 @@ static struct type *type_name(struct compile_state *state)
}
static struct type *direct_declarator(
- struct compile_state *state, struct type *type,
+ struct compile_state *state, struct type *type,
struct hash_entry **pident, int need_ident)
{
struct hash_entry *ident;
@@ -12466,7 +12466,7 @@ static struct type *direct_declarator(
}
static struct type *declarator(
- struct compile_state *state, struct type *type,
+ struct compile_state *state, struct type *type,
struct hash_entry **pident, int need_ident)
{
while(peek(state) == TOK_STAR) {
@@ -12485,7 +12485,7 @@ static struct type *typedef_name(
ident = eat(state, TOK_TYPE_NAME)->ident;
type = ident->sym_ident->type;
specifiers |= type->type & QUAL_MASK;
- if ((specifiers & (STOR_MASK | QUAL_MASK)) !=
+ if ((specifiers & (STOR_MASK | QUAL_MASK)) !=
(type->type & (STOR_MASK | QUAL_MASK))) {
type = clone_type(specifiers, type);
}
@@ -12519,7 +12519,7 @@ static struct type *enum_specifier(
struct type *entry;
eident = eat(state, TOK_IDENT)->ident;
if (eident->sym_ident) {
- error(state, 0, "%s already declared",
+ error(state, 0, "%s already declared",
eident->name);
}
eident->tok = TOK_ENUM_CONST;
@@ -12652,13 +12652,13 @@ static struct type *struct_or_union_specifier(
symbol(state, ident, &ident->sym_tag, 0, struct_type);
}
}
- if (ident && ident->sym_tag &&
- ident->sym_tag->type &&
+ if (ident && ident->sym_tag &&
+ ident->sym_tag->type &&
((ident->sym_tag->type->type & TYPE_MASK) == type_main)) {
struct_type = clone_type(spec, ident->sym_tag->type);
}
else if (ident && !struct_type) {
- error(state, 0, "%s %s undeclared",
+ error(state, 0, "%s %s undeclared",
(type_main == TYPE_STRUCT)?"struct" : "union",
ident->name);
}
@@ -12943,7 +12943,7 @@ static struct type *type_specifier(
type = typedef_name(state, spec);
break;
default:
- error(state, 0, "bad type specifier %s",
+ error(state, 0, "bad type specifier %s",
tokens[tok]);
break;
}
@@ -13123,7 +13123,7 @@ static struct triple *initializer(
(equiv_types(type->left, result->type->left))) {
type->elements = result->type->elements;
}
- if (is_lvalue(state, result) &&
+ if (is_lvalue(state, result) &&
((result->type->type & TYPE_MASK) == TYPE_ARRAY) &&
(type->type & TYPE_MASK) != TYPE_ARRAY)
{
@@ -13189,7 +13189,7 @@ static struct triple *initializer(
}
dest = ((char *)buf) + bits_to_bytes(info.offset);
#if DEBUG_INITIALIZER
- fprintf(state->errout, "dest = buf + %d max_offset: %d value_size: %d op: %d\n",
+ fprintf(state->errout, "dest = buf + %d max_offset: %d value_size: %d op: %d\n",
dest - buf,
bits_to_bytes(max_offset),
bits_to_bytes(value_size),
@@ -13221,7 +13221,7 @@ static struct triple *initializer(
info.offset += value_size;
if ((type->type & TYPE_MASK) == TYPE_STRUCT) {
info.type = next_field(state, type, info.type);
- info.offset = field_offset(state, type,
+ info.offset = field_offset(state, type,
info.type->field_ident);
}
} while(comma && (peek(state) != TOK_RBRACE));
@@ -13316,7 +13316,7 @@ static struct triple *function_definition(
if (((param->type & TYPE_MASK) != TYPE_VOID) && !param->field_ident) {
error(state, 0, "No identifier for paramter %d\n", i);
}
-
+
/* Get a list of statements for this function. */
def = triple(state, OP_LIST, type, 0, 0);
@@ -13339,7 +13339,7 @@ static struct triple *function_definition(
ctype->elements = 1;
/* Add a variable for the return value */
- crtype = new_type(TYPE_TUPLE,
+ crtype = new_type(TYPE_TUPLE,
/* Remove all type qualifiers from the return type */
new_type(TYPE_PRODUCT, ctype, clone_type(0, type->left)), 0);
crtype->elements = 2;
@@ -13372,7 +13372,7 @@ static struct triple *function_definition(
}
/* Add the declaration static const char __func__ [] = "func-name" */
- fname_type = new_type(TYPE_ARRAY,
+ fname_type = new_type(TYPE_ARRAY,
clone_type(QUAL_CONST | STOR_STATIC, &char_type), 0);
fname_type->type |= QUAL_CONST | STOR_STATIC;
fname_type->elements = strlen(state->function) + 1;
@@ -13417,7 +13417,7 @@ static struct triple *function_definition(
return def;
}
-static struct triple *do_decl(struct compile_state *state,
+static struct triple *do_decl(struct compile_state *state,
struct type *type, struct hash_entry *ident)
{
struct triple *def;
@@ -13451,7 +13451,7 @@ static struct triple *do_decl(struct compile_state *state,
if ((type->type & TYPE_MASK) == TYPE_FUNCTION) {
error(state, 0, "Function prototypes not supported");
}
- if (ident &&
+ if (ident &&
((type->type & STOR_MASK) == STOR_STATIC) &&
((type->type & QUAL_CONST) == 0)) {
error(state, 0, "non const static variables not supported");
@@ -13494,8 +13494,8 @@ static void decl(struct compile_state *state, struct triple *first)
}
eat(state, TOK_EQ);
flatten(state, first,
- init_expr(state,
- ident->sym_ident->def,
+ init_expr(state,
+ ident->sym_ident->def,
initializer(state, type)));
}
arrays_complete(state, type);
@@ -13531,7 +13531,7 @@ static void decls(struct compile_state *state)
}
}
-/*
+/*
* Function inlining
*/
struct triple_reg_set {
@@ -13554,21 +13554,21 @@ static void walk_blocks(struct compile_state *state, struct basic_blocks *bb,
void *arg);
static void print_block(
struct compile_state *state, struct block *block, void *arg);
-static int do_triple_set(struct triple_reg_set **head,
+static int do_triple_set(struct triple_reg_set **head,
struct triple *member, struct triple *new_member);
static void do_triple_unset(struct triple_reg_set **head, struct triple *member);
static struct reg_block *compute_variable_lifetimes(
struct compile_state *state, struct basic_blocks *bb);
-static void free_variable_lifetimes(struct compile_state *state,
+static void free_variable_lifetimes(struct compile_state *state,
struct basic_blocks *bb, struct reg_block *blocks);
#if DEBUG_EXPLICIT_CLOSURES
-static void print_live_variables(struct compile_state *state,
+static void print_live_variables(struct compile_state *state,
struct basic_blocks *bb, struct reg_block *rb, FILE *fp);
#endif
static struct triple *call(struct compile_state *state,
- struct triple *retvar, struct triple *ret_addr,
+ struct triple *retvar, struct triple *ret_addr,
struct triple *targ, struct triple *ret)
{
struct triple *call;
@@ -13647,19 +13647,19 @@ static void mark_live(struct compile_state *state, struct triple *func, void *ar
static void mark_live_functions(struct compile_state *state)
{
- /* Ensure state->main_function is the last function in
+ /* Ensure state->main_function is the last function in
* the list of functions.
*/
if ((state->main_function->next != state->functions) ||
(state->functions->prev != state->main_function)) {
- internal_error(state, 0,
+ internal_error(state, 0,
"state->main_function is not at the end of the function list ");
}
state->main_function->u.cval = 1;
reverse_walk_functions(state, mark_live, 0);
}
-static int local_triple(struct compile_state *state,
+static int local_triple(struct compile_state *state,
struct triple *func, struct triple *ins)
{
int local = (ins->id & TRIPLE_FLAG_LOCAL);
@@ -13673,7 +13673,7 @@ static int local_triple(struct compile_state *state,
return local;
}
-struct triple *copy_func(struct compile_state *state, struct triple *ofunc,
+struct triple *copy_func(struct compile_state *state, struct triple *ofunc,
struct occurance *base_occurance)
{
struct triple *nfunc;
@@ -13716,7 +13716,7 @@ struct triple *copy_func(struct compile_state *state, struct triple *ofunc,
}
new->id |= TRIPLE_FLAG_FLATTENED;
new->id |= old->id & TRIPLE_FLAG_COPY;
-
+
/* During the copy remember new as user of old */
use_triple(old, new);
@@ -13755,7 +13755,7 @@ struct triple *copy_func(struct compile_state *state, struct triple *ofunc,
old = old->next;
new = new->next;
} while((old != ofirst) && (new != nfirst));
-
+
/* Make a third pass to cleanup the extra useses */
old = ofirst;
new = nfirst;
@@ -13804,7 +13804,7 @@ static void expand_inline_call(
}
result = 0;
if ((nfunc->type->left->type & TYPE_MASK) != TYPE_VOID) {
- result = read_expr(state,
+ result = read_expr(state,
deref_index(state, fresult(state, nfunc), 1));
}
if (state->compiler->debug & DEBUG_INLINE) {
@@ -13816,8 +13816,8 @@ static void expand_inline_call(
fprintf(fp, "__________ %s _________ done\n\n", __FUNCTION__);
}
- /*
- * Get rid of the extra triples
+ /*
+ * Get rid of the extra triples
*/
/* Remove the read of the return address */
ins = RHS(nfunc, 0)->prev->prev;
@@ -13833,7 +13833,7 @@ static void expand_inline_call(
release_triple(state, ins);
/* Remove the retaddres variable */
retvar = fretaddr(state, nfunc);
- if ((retvar->lhs != 1) ||
+ if ((retvar->lhs != 1) ||
(retvar->op != OP_ADECL) ||
(retvar->next->op != OP_PIECE) ||
(MISC(retvar->next, 0) != retvar)) {
@@ -13876,7 +13876,7 @@ static void expand_inline_call(
/*
*
* Type of the result variable.
- *
+ *
* result
* |
* +----------+------------+
@@ -13886,7 +13886,7 @@ static void expand_inline_call(
* +------------------+---------------+
* | |
* closure1 ... closuerN
- * | |
+ * | |
* +----+--+-+--------+-----+ +----+----+---+-----+
* | | | | | | | | |
* var1 var2 var3 ... varN result var1 var2 ... varN result
@@ -13904,7 +13904,7 @@ static void expand_inline_call(
* var1 var2 ... varN result var1 var2 ... varN result
*/
-static int add_closure_type(struct compile_state *state,
+static int add_closure_type(struct compile_state *state,
struct triple *func, struct type *closure_type)
{
struct type *type, *ctype, **next;
@@ -13937,19 +13937,19 @@ static int add_closure_type(struct compile_state *state,
fprintf(fp, "new_type: ");
name_of(fp, type);
fprintf(fp, "\n");
- fprintf(fp, "ctype: %p %d bits: %d ",
+ fprintf(fp, "ctype: %p %d bits: %d ",
ctype, ctype->elements, reg_size_of(state, ctype));
name_of(fp, ctype);
fprintf(fp, "\n");
#endif
-
+
/* Regenerate the variable with the new type definition */
new_var = pre_triple(state, var, OP_ADECL, type, 0, 0);
new_var->id |= TRIPLE_FLAG_FLATTENED;
for(i = 0; i < new_var->lhs; i++) {
LHS(new_var, i)->id |= TRIPLE_FLAG_FLATTENED;
}
-
+
/* Point everyone at the new variable */
propogate_use(state, var, new_var);
@@ -13958,7 +13958,7 @@ static int add_closure_type(struct compile_state *state,
release_triple(state, LHS(var, i));
}
release_triple(state, var);
-
+
/* Return the index of the added closure type */
return ctype->elements - 1;
}
@@ -14053,7 +14053,7 @@ static int lookup_closure_index(struct compile_state *state,
for(index0 = ins->next->next;
(index0->op == OP_INDEX) &&
(MISC(index0, 0) == result) &&
- (index0->u.cval == 0) ;
+ (index0->u.cval == 0) ;
index0 = write->next)
{
index1 = index0->next;
@@ -14097,12 +14097,12 @@ static void compute_closure_variables(struct compile_state *state,
int i, max_index;
#define MAX_INDICIES (sizeof(used_indicies)*CHAR_BIT)
#define ID_BITS(X) ((X) & (TRIPLE_FLAG_LOCAL -1))
- struct {
+ struct {
unsigned id;
int index;
} *info;
-
+
/* Find the basic blocks of this function */
bb.func = me;
bb.first = RHS(me, 0);
@@ -14151,7 +14151,7 @@ static void compute_closure_variables(struct compile_state *state,
ins = ins->next;
} while(ins != first);
- /*
+ /*
* Build the list of variables to enclose.
*
* A target it to put the same variable in the
@@ -14336,7 +14336,7 @@ static void expand_function_call(
if (!*closure_next) {
*closure_next = type;
} else {
- *closure_next = new_type(TYPE_PRODUCT, *closure_next,
+ *closure_next = new_type(TYPE_PRODUCT, *closure_next,
type);
closure_next = &(*closure_next)->right;
}
@@ -14396,22 +14396,22 @@ static void expand_function_call(
/* Initialize the return value */
if ((rtype->type & TYPE_MASK) != TYPE_VOID) {
- flatten(state, ret_loc,
- write_expr(state,
+ flatten(state, ret_loc,
+ write_expr(state,
deref_index(state, fresult(state, func), 1),
new_triple(state, OP_UNKNOWNVAL, rtype, 0, 0)));
}
ret_addr = flatten(state, ret_loc, ret_addr);
ret_set = flatten(state, ret_loc, write_expr(state, retvar, ret_addr));
- jmp = flatten(state, ret_loc,
+ jmp = flatten(state, ret_loc,
call(state, retvar, ret_addr, func_first, func_last));
/* Find the result */
if ((rtype->type & TYPE_MASK) != TYPE_VOID) {
struct triple * result;
- result = flatten(state, first,
- read_expr(state,
+ result = flatten(state, first,
+ read_expr(state,
deref_index(state, fresult(state, func), 1)));
propogate_use(state, fcall, result);
@@ -14430,7 +14430,7 @@ static void expand_function_call(
}
/* Generate an expression for the value */
new = flatten(state, first,
- read_expr(state,
+ read_expr(state,
closure_expr(state, func, closure_idx, i)));
@@ -14443,7 +14443,7 @@ static void expand_function_call(
/*
* If the original is a value update the dominated uses.
*/
-
+
/* Analyze the basic blocks so I can see who dominates whom */
bb.func = me;
bb.first = RHS(me, 0);
@@ -14451,7 +14451,7 @@ static void expand_function_call(
bb.func = 0;
}
analyze_basic_blocks(state, &bb);
-
+
#if DEBUG_EXPLICIT_CLOSURES
fprintf(state->errout, "Updating domindated uses: %p -> %p\n",
@@ -14459,7 +14459,7 @@ static void expand_function_call(
#endif
/* If fcall dominates the use update the expression */
for(use = set->member->use; use; use = next) {
- /* Replace use modifies the use chain and
+ /* Replace use modifies the use chain and
* removes use, so I must take a copy of the
* next entry early.
*/
@@ -14652,7 +14652,7 @@ static void insert_function(struct compile_state *state,
if (state->compiler->debug & DEBUG_INLINE) {
FILE *fp = state->errout;
- fprintf(fp, "%s func count: %d\n",
+ fprintf(fp, "%s func count: %d\n",
func->type->type_ident->name, func->u.cval);
}
if (func->u.cval == 0) {
@@ -14677,7 +14677,7 @@ struct triple *input_asm(struct compile_state *state)
struct asm_info *info;
struct triple *def;
int i, out;
-
+
info = xcmalloc(sizeof(*info), "asm_info");
info->str = "";
@@ -14687,7 +14687,7 @@ struct triple *input_asm(struct compile_state *state)
def = new_triple(state, OP_ASM, &void_type, out, 0);
def->u.ainfo = info;
def->id |= TRIPLE_FLAG_VOLATILE;
-
+
for(i = 0; i < out; i++) {
struct triple *piece;
piece = triple(state, OP_PIECE, &int_type, def, 0);
@@ -14703,7 +14703,7 @@ struct triple *output_asm(struct compile_state *state)
struct asm_info *info;
struct triple *def;
int in;
-
+
info = xcmalloc(sizeof(*info), "asm_info");
info->str = "";
@@ -14713,7 +14713,7 @@ struct triple *output_asm(struct compile_state *state)
def = new_triple(state, OP_ASM, &void_type, 0, in);
def->u.ainfo = info;
def->id |= TRIPLE_FLAG_VOLATILE;
-
+
return def;
}
@@ -14750,11 +14750,11 @@ static void join_functions(struct compile_state *state)
/* Verify the external arguments */
if (registers_of(state, args_type) > ARCH_INPUT_REGS) {
- error(state, state->main_function,
+ error(state, state->main_function,
"Too many external input arguments");
}
if (registers_of(state, result_type) > ARCH_OUTPUT_REGS) {
- error(state, state->main_function,
+ error(state, state->main_function,
"Too many external output arguments");
}
@@ -14784,8 +14784,8 @@ static void join_functions(struct compile_state *state)
param = param->left;
}
if (registers_of(state, param) != 1) {
- error(state, state->main_function,
- "Arg: %d %s requires multiple registers",
+ error(state, state->main_function,
+ "Arg: %d %s requires multiple registers",
idx + 1, param->field_ident->name);
}
expr = read_expr(state, LHS(in, idx));
@@ -14793,7 +14793,7 @@ static void join_functions(struct compile_state *state)
expr = flatten(state, call, expr);
use_triple(expr, call);
- idx++;
+ idx++;
}
@@ -14832,7 +14832,7 @@ static void join_functions(struct compile_state *state)
}
/* Allocate a dummy containing function */
- func = triple(state, OP_LIST,
+ func = triple(state, OP_LIST,
new_type(TYPE_FUNCTION, &void_type, &void_type), 0, 0);
func->type->type_ident = lookup(state, "", 0);
RHS(func, 0) = state->first;
@@ -14861,7 +14861,7 @@ static void join_functions(struct compile_state *state)
static int do_use_block(
- struct block *used, struct block_set **head, struct block *user,
+ struct block *used, struct block_set **head, struct block *user,
int front)
{
struct block_set **ptr, *new;
@@ -14916,13 +14916,13 @@ static void use_block(struct block *used, struct block *user)
/* Append new to the head of the list, print_block
* depends on this.
*/
- count = do_use_block(used, &used->use, user, 1);
+ count = do_use_block(used, &used->use, user, 1);
used->users += count;
}
static void unuse_block(struct block *used, struct block *unuser)
{
int count;
- count = do_unuse_block(used, &used->use, unuser);
+ count = do_unuse_block(used, &used->use, unuser);
used->users -= count;
}
@@ -14981,7 +14981,7 @@ static void unipdomf_block(struct block *block, struct block *unipdomf)
}
static int walk_triples(
- struct compile_state *state,
+ struct compile_state *state,
int (*cb)(struct compile_state *state, struct triple *ptr, void *arg),
void *arg)
{
@@ -15014,7 +15014,7 @@ static int do_print_triple(struct compile_state *state, struct triple *ins, void
}
display_triple(fp, ins);
- if (triple_is_branch(state, ins) && ins->use &&
+ if (triple_is_branch(state, ins) && ins->use &&
(ins->op != OP_RET) && (ins->op != OP_FCALL)) {
internal_error(state, ins, "branch used?");
}
@@ -15135,7 +15135,7 @@ static void free_basic_block(struct compile_state *state, struct block *block)
while((edge = block->edges)) {
child = edge->member;
remove_block_edge(block, child);
-
+
if (child && (child->vertex != -1)) {
free_basic_block(state, child);
}
@@ -15146,7 +15146,7 @@ static void free_basic_block(struct compile_state *state, struct block *block)
#endif
}
-static void free_basic_blocks(struct compile_state *state,
+static void free_basic_blocks(struct compile_state *state,
struct basic_blocks *bb)
{
struct triple *first, *ins;
@@ -15161,10 +15161,10 @@ static void free_basic_blocks(struct compile_state *state,
}
ins = ins->next;
} while(ins != first);
-
+
}
-static struct block *basic_block(struct compile_state *state,
+static struct block *basic_block(struct compile_state *state,
struct basic_blocks *bb, struct triple *first)
{
struct block *block;
@@ -15183,7 +15183,7 @@ static struct block *basic_block(struct compile_state *state,
block->vertex = bb->last_vertex;
ptr = first;
do {
- if ((ptr != first) && triple_is_label(state, ptr) && (ptr->use)) {
+ if ((ptr != first) && triple_is_label(state, ptr) && (ptr->use)) {
break;
}
block->last = ptr;
@@ -15198,7 +15198,7 @@ static struct block *basic_block(struct compile_state *state,
} while (ptr != bb->first);
if ((ptr == bb->first) ||
((ptr->next == bb->first) && (
- triple_is_end(state, ptr) ||
+ triple_is_end(state, ptr) ||
triple_is_ret(state, ptr))))
{
/* The block has no outflowing edges */
@@ -15263,7 +15263,7 @@ static struct block *basic_block(struct compile_state *state,
struct block_set *edge;
FILE *fp = state->errout;
fprintf(fp, "basic_block: %10p [%2d] ( %10p - %10p )",
- block, block->vertex,
+ block, block->vertex,
block->first, block->last);
for(edge = block->edges; edge; edge = edge->next) {
fprintf(fp, " %10p [%2d]",
@@ -15307,7 +15307,7 @@ static void print_block(
FILE *fp = arg;
fprintf(fp, "\nblock: %p (%d) ",
- block,
+ block,
block->vertex);
for(edge = block->edges; edge; edge = edge->next) {
@@ -15331,7 +15331,7 @@ static void print_block(
}
fprintf(fp, "users %d: ", block->users);
for(user = block->use; user; user = user->next) {
- fprintf(fp, "%p (%d) ",
+ fprintf(fp, "%p (%d) ",
user->member,
user->member->vertex);
}
@@ -15357,7 +15357,7 @@ static void print_blocks(struct compile_state *state, const char *func, FILE *fp
}
}
-static void prune_nonblock_triples(struct compile_state *state,
+static void prune_nonblock_triples(struct compile_state *state,
struct basic_blocks *bb)
{
struct block *block;
@@ -15389,7 +15389,7 @@ static void prune_nonblock_triples(struct compile_state *state,
} while(ins != first);
}
-static void setup_basic_blocks(struct compile_state *state,
+static void setup_basic_blocks(struct compile_state *state,
struct basic_blocks *bb)
{
if (!triple_stores_block(state, bb->first)) {
@@ -15404,8 +15404,8 @@ static void setup_basic_blocks(struct compile_state *state,
bb->first_block = basic_block(state, bb, bb->first);
/* Be certain the last instruction of a function, or the
- * entire program is in a basic block. When it is not find
- * the start of the block, insert a label if necessary and build
+ * entire program is in a basic block. When it is not find
+ * the start of the block, insert a label if necessary and build
* basic block. Then add a fake edge from the start block
* to the final block.
*/
@@ -15421,7 +15421,7 @@ static void setup_basic_blocks(struct compile_state *state,
add_block_edge(bb->first_block, tail, 0);
use_block(tail, bb->first_block);
}
-
+
/* Find the last basic block.
*/
bb->last_block = block_of_triple(state, bb->first->prev);
@@ -15522,7 +15522,7 @@ static int initialize_spdblock(
return vertex;
}
-static int setup_spdblocks(struct compile_state *state,
+static int setup_spdblocks(struct compile_state *state,
struct basic_blocks *bb, struct sdom_block *sd)
{
struct block *block;
@@ -15532,7 +15532,7 @@ static int setup_spdblocks(struct compile_state *state,
/* Walk through the graph and find unconnected blocks. Add a
* fake edge from the unconnected blocks to the end of the
- * graph.
+ * graph.
*/
block = bb->first_block->last->next->u.block;
for(; block && block != bb->first_block; block = block->last->next->u.block) {
@@ -15576,16 +15576,16 @@ static void compress_ancestors(struct sdom_block *v)
}
}
-static void compute_sdom(struct compile_state *state,
+static void compute_sdom(struct compile_state *state,
struct basic_blocks *bb, struct sdom_block *sd)
{
int i;
- /* // step 2
+ /* // step 2
* for each v <= pred(w) {
* u = EVAL(v);
- * if (semi[u] < semi[w] {
- * semi[w] = semi[u];
- * }
+ * if (semi[u] < semi[w] {
+ * semi[w] = semi[u];
+ * }
* }
* add w to bucket(vertex(semi[w]));
* LINK(parent(w), w);
@@ -15620,22 +15620,22 @@ static void compute_sdom(struct compile_state *state,
next = v->sdom_next;
unsdom_block(v);
u = (!v->ancestor) ? v : (compress_ancestors(v), v->label);
- v->block->idom = (u->sdom->vertex < v->sdom->vertex)?
+ v->block->idom = (u->sdom->vertex < v->sdom->vertex)?
u->block : parent->block;
}
}
}
-static void compute_spdom(struct compile_state *state,
+static void compute_spdom(struct compile_state *state,
struct basic_blocks *bb, struct sdom_block *sd)
{
int i;
- /* // step 2
+ /* // step 2
* for each v <= pred(w) {
* u = EVAL(v);
- * if (semi[u] < semi[w] {
- * semi[w] = semi[u];
- * }
+ * if (semi[u] < semi[w] {
+ * semi[w] = semi[u];
+ * }
* }
* add w to bucket(vertex(semi[w]));
* LINK(parent(w), w);
@@ -15669,13 +15669,13 @@ static void compute_spdom(struct compile_state *state,
next = v->sdom_next;
unsdom_block(v);
u = (!v->ancestor) ? v : (compress_ancestors(v), v->label);
- v->block->ipdom = (u->sdom->vertex < v->sdom->vertex)?
+ v->block->ipdom = (u->sdom->vertex < v->sdom->vertex)?
u->block : parent->block;
}
}
}
-static void compute_idom(struct compile_state *state,
+static void compute_idom(struct compile_state *state,
struct basic_blocks *bb, struct sdom_block *sd)
{
int i;
@@ -15690,7 +15690,7 @@ static void compute_idom(struct compile_state *state,
sd[1].block->idom = 0;
}
-static void compute_ipdom(struct compile_state *state,
+static void compute_ipdom(struct compile_state *state,
struct basic_blocks *bb, struct sdom_block *sd)
{
int i;
@@ -15707,13 +15707,13 @@ static void compute_ipdom(struct compile_state *state,
/* Theorem 1:
* Every vertex of a flowgraph G = (V, E, r) except r has
- * a unique immediate dominator.
+ * a unique immediate dominator.
* The edges {(idom(w), w) |w <= V - {r}} form a directed tree
- * rooted at r, called the dominator tree of G, such that
+ * rooted at r, called the dominator tree of G, such that
* v dominates w if and only if v is a proper ancestor of w in
* the dominator tree.
*/
- /* Lemma 1:
+ /* Lemma 1:
* If v and w are vertices of G such that v <= w,
* than any path from v to w must contain a common ancestor
* of v and w in T.
@@ -15726,7 +15726,7 @@ static void compute_ipdom(struct compile_state *state,
* sdom(u) >= sdom(w). Then idom(w) = sdom(w).
*/
/* Theorem 3:
- * Let w != r and let u be a vertex for which sdom(u) is
+ * Let w != r and let u be a vertex for which sdom(u) is
* minimum amoung vertices u satisfying sdom(w) -> u -> w.
* Then sdom(u) <= sdom(w) and idom(u) = idom(w).
*/
@@ -15744,11 +15744,11 @@ static void find_immediate_dominators(struct compile_state *state,
/* Theorem 4:
* For any vertex w != r.
* sdom(w) = min(
- * {v|(v,w) <= E and v < w } U
+ * {v|(v,w) <= E and v < w } U
* {sdom(u) | u > w and there is an edge (v, w) such that u -> v})
*/
/* Corollary 1:
- * Let w != r and let u be a vertex for which sdom(u) is
+ * Let w != r and let u be a vertex for which sdom(u) is
* minimum amoung vertices u satisfying sdom(w) -> u -> w.
* Then:
* { sdom(w) if sdom(w) = sdom(u),
@@ -15756,7 +15756,7 @@ static void find_immediate_dominators(struct compile_state *state,
* { idom(u) otherwise
*/
/* The algorithm consists of the following 4 steps.
- * Step 1. Carry out a depth-first search of the problem graph.
+ * Step 1. Carry out a depth-first search of the problem graph.
* Number the vertices from 1 to N as they are reached during
* the search. Initialize the variables used in succeeding steps.
* Step 2. Compute the semidominators of all vertices by applying
@@ -15896,7 +15896,7 @@ static void print_dominated2(
for(i = 0; i < depth; i++) {
fprintf(fp, " ");
}
- fprintf(fp, "%3d: %p (%p - %p) @",
+ fprintf(fp, "%3d: %p (%p - %p) @",
block->vertex, block, block->first, block->last);
ins = block->first;
while(ins != block->last && (ins->occurance->line == 0)) {
@@ -15947,7 +15947,7 @@ static int print_frontiers(
fprintf(fp, " %d", user->member->vertex);
}
fprintf(fp, "\n");
-
+
for(edge = block->edges; edge; edge = edge->next) {
vertex = print_frontiers(state, fp, edge->member, vertex);
}
@@ -15958,7 +15958,7 @@ static void print_dominance_frontiers(struct compile_state *state,
{
fprintf(fp, "\ndominance frontiers\n");
print_frontiers(state, fp, bb->first_block, 0);
-
+
}
static void analyze_idominators(struct compile_state *state, struct basic_blocks *bb)
@@ -16024,7 +16024,7 @@ static void print_ipdominance_frontiers(struct compile_state *state,
{
fprintf(fp, "\nipdominance frontiers\n");
print_pfrontiers(state, fp, bb->last_block, 0);
-
+
}
static void analyze_ipdominators(struct compile_state *state,
@@ -16060,7 +16060,7 @@ static int tdominates(struct compile_state *state,
bsub = block_of_triple(state, sub);
if (bdom != bsub) {
result = bdominates(state, bdom, bsub);
- }
+ }
else {
struct triple *ins;
if (!bdom || !bsub) {
@@ -16106,7 +16106,7 @@ static void insert_phi_operations(struct compile_state *state)
if (!triple_is_auto_var(state, var) || !var->use) {
continue;
}
-
+
iter += 1;
work_list = 0;
work_list_tail = &work_list;
@@ -16119,7 +16119,7 @@ static void insert_phi_operations(struct compile_state *state)
continue;
}
if (user->member->op != OP_WRITE) {
- internal_error(state, user->member,
+ internal_error(state, user->member,
"bad variable access");
}
block = user->member->u.block;
@@ -16152,7 +16152,7 @@ static void insert_phi_operations(struct compile_state *state)
/* Insert a phi function for this variable */
get_occurance(var->occurance);
phi = alloc_triple(
- state, OP_PHI, var->type, -1, in_edges,
+ state, OP_PHI, var->type, -1, in_edges,
var->occurance);
phi->u.block = front;
MISC(phi, 0) = var;
@@ -16555,7 +16555,7 @@ static void prune_unused_phis(struct compile_state *state)
struct triple *first, *phi;
struct phi_triple *live;
int phis, i;
-
+
/* Find the first instruction */
first = state->first;
@@ -16566,7 +16566,7 @@ static void prune_unused_phis(struct compile_state *state)
phis += 1;
}
}
-
+
/* Mark them all dead */
live = xcmalloc(sizeof(*live) * (phis + 1), "phi_triple");
phis = 0;
@@ -16580,7 +16580,7 @@ static void prune_unused_phis(struct compile_state *state)
phi->id = phis;
phis += 1;
}
-
+
/* Mark phis alive that are used by non phis */
for(i = 0; i < phis; i++) {
struct triple_set *set;
@@ -16613,7 +16613,7 @@ static void prune_unused_phis(struct compile_state *state)
slot[j] = unknown;
use_triple(unknown, phi);
transform_to_arch_instruction(state, unknown);
-#if 0
+#if 0
warning(state, phi, "variable not set at index %d on all paths to use", j);
#endif
}
@@ -16747,7 +16747,7 @@ static void transform_from_ssa_form(struct compile_state *state)
}
var = post_triple(state, phi, OP_ADECL, phi->type, 0, 0);
var = var->next; /* point at the var */
-
+
/* Replaces use of phi with var */
propogate_use(state, phi, var);
@@ -16800,7 +16800,7 @@ static void transform_from_ssa_form(struct compile_state *state)
if (!eblock->first) {
internal_error(state, 0, "empty block?");
}
-
+
/* Make certain the write is placed in the edge block... */
/* Walk through the edge block backwards to find an
* appropriate location for the OP_WRITE.
@@ -16847,7 +16847,7 @@ static void transform_from_ssa_form(struct compile_state *state)
/* Release the phi function */
release_triple(state, phi);
}
-
+
/* Walk all of the operations to find the adecls */
for(var = first->next; var != first ; var = var->next) {
struct triple_set *use, *use_next;
@@ -16864,7 +16864,7 @@ static void transform_from_ssa_form(struct compile_state *state)
int zrhs, i, used;
use_next = use->next;
user = use->member;
-
+
/* Generate a read of var */
read = pre_triple(state, user, OP_READ, var->type, var, 0);
use_triple(var, read);
@@ -16883,7 +16883,7 @@ static void transform_from_ssa_form(struct compile_state *state)
if (used) {
unuse_triple(var, user);
use_triple(read, user);
- }
+ }
/* If we didn't use it release the extra triple */
else {
release_triple(state, read);
@@ -16895,7 +16895,7 @@ static void transform_from_ssa_form(struct compile_state *state)
#define HI() if (state->compiler->debug & DEBUG_REBUILD_SSA_FORM) { \
FILE *fp = state->dbgout; \
fprintf(fp, "@ %s:%d\n", __FILE__, __LINE__); romcc_print_blocks(state, fp); \
- }
+ }
static void rebuild_ssa_form(struct compile_state *state)
{
@@ -16910,7 +16910,7 @@ HI();
HI();
rename_variables(state);
HI();
-
+
prune_block_variables(state, state->bb.first_block);
HI();
prune_unused_phis(state);
@@ -16918,7 +16918,7 @@ HI();
}
#undef HI
-/*
+/*
* Register conflict resolution
* =========================================================
*/
@@ -16948,7 +16948,7 @@ static struct reg_info find_def_color(
if (tinfo.reg >= MAX_REGISTERS) {
tinfo.reg = REG_UNSET;
}
- if ((tinfo.reg != REG_UNSET) &&
+ if ((tinfo.reg != REG_UNSET) &&
(info.reg != REG_UNSET) &&
(tinfo.reg != info.reg)) {
internal_error(state, def, "register conflict");
@@ -17201,7 +17201,7 @@ static struct triple *typed_pre_copy(
use_triple(in, ins);
transform_to_arch_instruction(state, in);
return in;
-
+
}
static struct triple *pre_copy(
struct compile_state *state, struct triple *ins, int index)
@@ -17258,7 +17258,7 @@ static void insert_copies_to_phi(struct compile_state *state)
move->u.block = eblock;
move->id |= TRIPLE_FLAG_PRE_SPLIT;
use_triple(val, move);
-
+
slot[edge] = move;
unuse_triple(val, phi);
use_triple(move, phi);
@@ -17315,7 +17315,7 @@ struct triple_reg_set;
struct reg_block;
-static int do_triple_set(struct triple_reg_set **head,
+static int do_triple_set(struct triple_reg_set **head,
struct triple *member, struct triple *new_member)
{
struct triple_reg_set **ptr, *new;
@@ -17433,7 +17433,7 @@ static struct triple *part_to_piece(struct compile_state *state, struct triple *
return ins;
}
-static int this_def(struct compile_state *state,
+static int this_def(struct compile_state *state,
struct triple *ins, struct triple *other)
{
if (ins == other) {
@@ -17611,7 +17611,7 @@ static struct reg_block *compute_variable_lifetimes(
return blocks;
}
-static void free_variable_lifetimes(struct compile_state *state,
+static void free_variable_lifetimes(struct compile_state *state,
struct basic_blocks *bb, struct reg_block *blocks)
{
int i;
@@ -17634,16 +17634,16 @@ static void free_variable_lifetimes(struct compile_state *state,
}
typedef void (*wvl_cb_t)(
- struct compile_state *state,
- struct reg_block *blocks, struct triple_reg_set *live,
+ struct compile_state *state,
+ struct reg_block *blocks, struct triple_reg_set *live,
struct reg_block *rb, struct triple *ins, void *arg);
static void walk_variable_lifetimes(struct compile_state *state,
- struct basic_blocks *bb, struct reg_block *blocks,
+ struct basic_blocks *bb, struct reg_block *blocks,
wvl_cb_t cb, void *arg)
{
int i;
-
+
for(i = 1; i <= state->bb.last_vertex; i++) {
struct triple_reg_set *live;
struct triple_reg_set *entry, *next;
@@ -17678,7 +17678,7 @@ static void walk_variable_lifetimes(struct compile_state *state,
* going on.
*/
cb(state, blocks, live, rb, ptr, arg);
-
+
/* Remove the current definition from live */
do_triple_unset(&live, ptr);
@@ -17731,7 +17731,7 @@ static void print_live_variables_block(
block, block->vertex);
for(edge = block->edges; edge; edge = edge->next) {
fprintf(fp, " %p<-%p",
- edge->member,
+ edge->member,
edge->member && edge->member->use?edge->member->use->member : 0);
}
fprintf(fp, "\n");
@@ -17785,7 +17785,7 @@ static void print_live_variables_block(
fprintf(fp, "\n");
}
-static void print_live_variables(struct compile_state *state,
+static void print_live_variables(struct compile_state *state,
struct basic_blocks *bb, struct reg_block *rb, FILE *fp)
{
struct print_live_variable_info info;
@@ -17821,7 +17821,7 @@ struct dead_triple {
#define TRIPLE_FLAG_FREE 1
};
-static void print_dead_triples(struct compile_state *state,
+static void print_dead_triples(struct compile_state *state,
struct dead_triple *dtriple)
{
struct triple *first, *ins;
@@ -17839,7 +17839,7 @@ static void print_dead_triples(struct compile_state *state,
if ((ins->op == OP_LABEL) && (ins->use)) {
fprintf(fp, "\n%p:\n", ins);
}
- fprintf(fp, "%c",
+ fprintf(fp, "%c",
(dt->flags & TRIPLE_FLAG_ALIVE)?' ': '-');
display_triple(fp, ins);
if (triple_is_branch(state, ins)) {
@@ -17906,7 +17906,7 @@ static void eliminate_inefectual_code(struct compile_state *state)
/* Now put then in an array and mark all of the triples dead */
dtriple = xcmalloc(sizeof(*dtriple) * (triples + 1), "dtriples");
-
+
ins = first;
i = 1;
block = 0;
@@ -17977,7 +17977,7 @@ static void eliminate_inefectual_code(struct compile_state *state)
}
print_dead_triples(state, dtriple);
for(dt = &dtriple[1]; dt <= &dtriple[triples]; dt++) {
- if ((dt->triple->op == OP_NOOP) &&
+ if ((dt->triple->op == OP_NOOP) &&
(dt->flags & TRIPLE_FLAG_ALIVE)) {
internal_error(state, dt->triple, "noop effective?");
}
@@ -18036,13 +18036,13 @@ static void insert_mandatory_copies(struct compile_state *state)
if (i < 0) {
continue;
}
-
+
/* Find the users color requirements */
rinfo = arch_reg_rhs(state, entry->member, i);
if (rinfo.reg >= MAX_REGISTERS) {
rinfo.reg = REG_UNSET;
}
-
+
/* See if I need a pre_copy */
if (rinfo.reg != REG_UNSET) {
if ((reg != REG_UNSET) && (reg != rinfo.reg)) {
@@ -18059,14 +18059,14 @@ static void insert_mandatory_copies(struct compile_state *state)
* They do not take up any registers until a
* copy places them in one.
*/
- if ((info.reg == REG_UNNEEDED) &&
+ if ((info.reg == REG_UNNEEDED) &&
(rinfo.reg != REG_UNNEEDED)) {
do_pre_copy = 1;
}
}
do_post_copy =
!do_pre_copy &&
- (((info.reg != REG_UNSET) &&
+ (((info.reg != REG_UNSET) &&
(reg != REG_UNSET) &&
(info.reg != reg)) ||
((info.regcm & regcm) == 0));
@@ -18082,7 +18082,7 @@ static void insert_mandatory_copies(struct compile_state *state)
if (i < 0) {
continue;
}
-
+
/* Find the users color requirements */
rinfo = arch_reg_rhs(state, entry->member, i);
if (rinfo.reg >= MAX_REGISTERS) {
@@ -18131,7 +18131,7 @@ static void insert_mandatory_copies(struct compile_state *state)
}
}
regcm &= rinfo.regcm;
-
+
}
if (do_post_copy) {
struct reg_info pre, post;
@@ -18225,7 +18225,7 @@ static void print_interference_block(
block, block->vertex);
for(edge = block->edges; edge; edge = edge->next) {
fprintf(fp, " %p<-%p",
- edge->member,
+ edge->member,
edge->member && edge->member->use?edge->member->use->member : 0);
}
fprintf(fp, "\n");
@@ -18271,7 +18271,7 @@ static void print_interference_block(
op = ptr->op;
done = (ptr == block->last);
lr = rstate->lrd[ptr->id].lr;
-
+
id = ptr->id;
ptr->id = rstate->lrd[id].orig_id;
SET_REG(ptr->id, lr->color);
@@ -18436,7 +18436,7 @@ static struct lre_hash **lre_probe(struct reg_state *rstate,
right = tmp;
}
index = hash_live_edge(left, right);
-
+
ptr = &rstate->hash[index];
while(*ptr) {
if (((*ptr)->left == left) && ((*ptr)->right == right)) {
@@ -18455,7 +18455,7 @@ static int interfere(struct reg_state *rstate,
return ptr && *ptr;
}
-static void add_live_edge(struct reg_state *rstate,
+static void add_live_edge(struct reg_state *rstate,
struct live_range *left, struct live_range *right)
{
/* FIXME the memory allocation overhead is noticeable here... */
@@ -18494,7 +18494,7 @@ static void add_live_edge(struct reg_state *rstate,
edge->node = right;
left->edges = edge;
left->degree += 1;
-
+
edge = xmalloc(sizeof(*edge), "live_range_edge");
edge->next = right->edges;
edge->node = left;
@@ -18546,7 +18546,7 @@ static void remove_live_edges(struct reg_state *rstate, struct live_range *range
}
}
-static void transfer_live_edges(struct reg_state *rstate,
+static void transfer_live_edges(struct reg_state *rstate,
struct live_range *dest, struct live_range *src)
{
struct live_range_edge *edge, *next;
@@ -18561,7 +18561,7 @@ static void transfer_live_edges(struct reg_state *rstate,
/* Interference graph...
- *
+ *
* new(n) --- Return a graph with n nodes but no edges.
* add(g,x,y) --- Return a graph including g with an between x and y
* interfere(g, x, y) --- Return true if there exists an edge between the nodes
@@ -18574,11 +18574,11 @@ static void transfer_live_edges(struct reg_state *rstate,
* The adjacency vectors support an efficient implementation of neighbors.
*/
-/*
+/*
* +---------------------------------------------------+
* | +--------------+ |
* v v | |
- * renumber -> build graph -> colalesce -> spill_costs -> simplify -> select
+ * renumber -> build graph -> colalesce -> spill_costs -> simplify -> select
*
* -- In simplify implment optimistic coloring... (No backtracking)
* -- Implement Rematerialization it is the only form of spilling we can perform
@@ -18594,7 +18594,7 @@ static void transfer_live_edges(struct reg_state *rstate,
#if DEBUG_ROMCC_WARNING
static void different_colored(
- struct compile_state *state, struct reg_state *rstate,
+ struct compile_state *state, struct reg_state *rstate,
struct triple *parent, struct triple *ins)
{
struct live_range *lr;
@@ -18630,13 +18630,13 @@ static struct live_range *coalesce_ranges(
}
if ((lr1->color == REG_UNNEEDED) ||
(lr2->color == REG_UNNEEDED)) {
- internal_error(state, 0,
+ internal_error(state, 0,
"cannot coalesce live ranges without a possible color");
}
if ((lr1->color != lr2->color) &&
(lr1->color != REG_UNSET) &&
(lr2->color != REG_UNSET)) {
- internal_error(state, lr1->defs->def,
+ internal_error(state, lr1->defs->def,
"cannot coalesce live ranges of different colors");
}
color = lr1->color;
@@ -18667,7 +18667,7 @@ static struct live_range *coalesce_ranges(
/* If there is a clear dominate live range put it in lr1,
* For purposes of this test phi functions are
* considered dominated by the definitions that feed into
- * them.
+ * them.
*/
if ((lr1->defs->prev->def->op == OP_PHI) ||
((lr2->defs->prev->def->op != OP_PHI) &&
@@ -18698,12 +18698,12 @@ static struct live_range *coalesce_ranges(
lr2->defs->def,
lr2->color);
#endif
-
+
/* Append lr2 onto lr1 */
#if DEBUG_ROMCC_WARNINGS
#warning "FIXME should this be a merge instead of a splice?"
#endif
- /* This FIXME item applies to the correctness of live_range_end
+ /* This FIXME item applies to the correctness of live_range_end
* and to the necessity of making multiple passes of coalesce_live_ranges.
* A failure to find some coalesce opportunities in coaleace_live_ranges
* does not impact the correct of the compiler just the efficiency with
@@ -18713,7 +18713,7 @@ static struct live_range *coalesce_ranges(
mid1 = lr1->defs->prev;
mid2 = lr2->defs;
end = lr2->defs->prev;
-
+
head->prev = end;
end->next = head;
@@ -18818,7 +18818,7 @@ static void initialize_live_ranges(
rstate->lr[i].classes = info.regcm;
rstate->lr[i].degree = 0;
rstate->lrd[j].lr = &rstate->lr[i];
- }
+ }
/* Otherwise give the triple the dummy live range. */
else {
rstate->lrd[j].lr = &rstate->lr[0];
@@ -18845,7 +18845,7 @@ static void initialize_live_ranges(
if (ins->id > rstate->defs) {
internal_error(state, ins, "bad id");
}
-
+
/* Walk through the template of ins and coalesce live ranges */
zlhs = ins->lhs;
if ((zlhs == 0) && triple_is_def(state, ins)) {
@@ -18891,7 +18891,7 @@ static void initialize_live_ranges(
}
if (rinfo.reg == linfo.reg) {
- coalesce_ranges(state, rstate,
+ coalesce_ranges(state, rstate,
lhs->lr, rhs->lr);
}
}
@@ -18901,8 +18901,8 @@ static void initialize_live_ranges(
}
static void graph_ins(
- struct compile_state *state,
- struct reg_block *blocks, struct triple_reg_set *live,
+ struct compile_state *state,
+ struct reg_block *blocks, struct triple_reg_set *live,
struct reg_block *rb, struct triple *ins, void *arg)
{
struct reg_state *rstate = arg;
@@ -18917,7 +18917,7 @@ static void graph_ins(
return;
}
def = rstate->lrd[ins->id].lr;
-
+
/* Create an edge between ins and everything that is
* alive, unless the live_range cannot share
* a physical register with ins.
@@ -18965,8 +18965,8 @@ static struct live_range *get_verify_live_range(
}
static void verify_graph_ins(
- struct compile_state *state,
- struct reg_block *blocks, struct triple_reg_set *live,
+ struct compile_state *state,
+ struct reg_block *blocks, struct triple_reg_set *live,
struct reg_block *rb, struct triple *ins, void *arg)
{
struct reg_state *rstate = arg;
@@ -18987,17 +18987,17 @@ static void verify_graph_ins(
}
lr2 = get_verify_live_range(state, rstate, entry2->member);
if (lr1 == lr2) {
- internal_error(state, entry2->member,
+ internal_error(state, entry2->member,
"live range with 2 values simultaneously alive");
}
if (!arch_regcm_intersect(lr1->classes, lr2->classes)) {
continue;
}
if (!interfere(rstate, lr1, lr2)) {
- internal_error(state, entry2->member,
+ internal_error(state, entry2->member,
"edges don't interfere?");
}
-
+
lr1_found = 0;
lr2_degree = 0;
for(edge2 = lr2->edges; edge2; edge2 = edge2->next) {
@@ -19021,8 +19021,8 @@ static void verify_graph_ins(
#endif
static void print_interference_ins(
- struct compile_state *state,
- struct reg_block *blocks, struct triple_reg_set *live,
+ struct compile_state *state,
+ struct reg_block *blocks, struct triple_reg_set *live,
struct reg_block *rb, struct triple *ins, void *arg)
{
struct reg_state *rstate = arg;
@@ -19092,7 +19092,7 @@ static int coalesce_live_ranges(
* Forcing a value to stay in a single register
* for an extended period of time does have
* limitations when applied to non homogenous
- * register pool.
+ * register pool.
*
* The two cases I have identified are:
* 1) Two forced register assignments may
@@ -19110,7 +19110,7 @@ static int coalesce_live_ranges(
* functions. This creates a 2 headed live
* range that cannot be sanely split.
*
- * - phi functions (coalesced in initialize_live_ranges)
+ * - phi functions (coalesced in initialize_live_ranges)
* are handled as pre split live ranges so we will
* never attempt to split them.
*/
@@ -19160,7 +19160,7 @@ static int coalesce_live_ranges(
if ((lr1->classes & lr2->classes) == 0) {
continue;
}
-
+
if (interfere(rstate, lr1, lr2)) {
continue;
}
@@ -19235,7 +19235,7 @@ static int correct_coalesce_conflicts(
{
int conflicts;
conflicts = 0;
- walk_variable_lifetimes(state, &state->bb, blocks,
+ walk_variable_lifetimes(state, &state->bb, blocks,
fix_coalesce_conflicts, &conflicts);
return conflicts;
}
@@ -19251,7 +19251,7 @@ static void replace_set_use(struct compile_state *state,
}
}
-static void replace_block_use(struct compile_state *state,
+static void replace_block_use(struct compile_state *state,
struct reg_block *blocks, struct triple *orig, struct triple *new)
{
int i;
@@ -19343,7 +19343,7 @@ static struct triple *resolve_tangle(
}
info = find_lhs_color(state, tangle, 0);
SET_INFO(tangle->id, info);
-
+
return copy;
}
@@ -19369,7 +19369,7 @@ static void fix_tangles(struct compile_state *state,
}
reg_inc_used(state, used, info.reg);
}
-
+
/* Now find the least dominated definition of a register in
* conflict I have seen so far.
*/
@@ -19382,7 +19382,7 @@ static void fix_tangles(struct compile_state *state,
/* Changing copies that feed into phi functions
* is incorrect.
*/
- if (set->member->use &&
+ if (set->member->use &&
(set->member->use->member->op == OP_PHI)) {
continue;
}
@@ -19412,7 +19412,7 @@ static int correct_tangles(
int tangles;
tangles = 0;
color_instructions(state);
- walk_variable_lifetimes(state, &state->bb, blocks,
+ walk_variable_lifetimes(state, &state->bb, blocks,
fix_tangles, &tangles);
return tangles;
}
@@ -19443,7 +19443,7 @@ struct triple *find_constrained_def(
if (regcm == info.regcm) {
continue;
}
-
+
/* If there is just one use.
* That use cannot accept a larger register class.
* There are no intervening definitions except
@@ -19454,7 +19454,7 @@ struct triple *find_constrained_def(
#if DEBUG_ROMCC_WARNINGS
#warning "FIXME ignore cases that cannot be fixed (a definition followed by a use)"
#endif
-
+
/* Of the constrained live ranges deal with the
* least dominated one first.
@@ -19463,7 +19463,7 @@ struct triple *find_constrained_def(
fprintf(state->errout, "canidate: %p %-8s regcm: %x %x\n",
lrd->def, tops(lrd->def->op), regcm, info.regcm);
}
- if (!constrained ||
+ if (!constrained ||
tdominates(state, lrd->def, constrained))
{
constrained = lrd->def;
@@ -19473,13 +19473,13 @@ struct triple *find_constrained_def(
}
static int split_constrained_ranges(
- struct compile_state *state, struct reg_state *rstate,
+ struct compile_state *state, struct reg_state *rstate,
struct live_range *range)
{
/* Walk through the edges in conflict and our current live
* range, and find definitions that are more severly constrained
* than they type of data they contain require.
- *
+ *
* Then pick one of those ranges and relax the constraints.
*/
struct live_range_edge *edge;
@@ -19507,14 +19507,14 @@ static int split_constrained_ranges(
}
return !!constrained;
}
-
+
static int split_ranges(
struct compile_state *state, struct reg_state *rstate,
char *used, struct live_range *range)
{
int split;
if (state->compiler->debug & DEBUG_RANGE_CONFLICTS) {
- fprintf(state->errout, "split_ranges %d %s %p\n",
+ fprintf(state->errout, "split_ranges %d %s %p\n",
rstate->passes, tops(range->defs->def->op), range->defs->def);
}
if ((range->color == REG_UNNEEDED) ||
@@ -19524,7 +19524,7 @@ static int split_ranges(
split = split_constrained_ranges(state, rstate, range);
/* Ideally I would split the live range that will not be used
- * for the longest period of time in hopes that this will
+ * for the longest period of time in hopes that this will
* (a) allow me to spill a register or
* (b) allow me to place a value in another register.
*
@@ -19538,7 +19538,7 @@ static int split_ranges(
#if DEBUG_ROMCC_WARNINGS
#warning "WISHLIST implement live range splitting..."
#endif
-
+
if (!split && (state->compiler->debug & DEBUG_RANGE_CONFLICTS2)) {
FILE *fp = state->errout;
print_interference_blocks(state, rstate, fp, 0);
@@ -19590,7 +19590,7 @@ static void cgdebug_loc(struct compile_state *state, struct triple *ins)
}
}
-static int select_free_color(struct compile_state *state,
+static int select_free_color(struct compile_state *state,
struct reg_state *rstate, struct live_range *range)
{
struct triple_set *entry;
@@ -19620,7 +19620,7 @@ static int select_free_color(struct compile_state *state,
for(edge = range->edges; edge; edge = edge->next) {
i++;
}
- cgdebug_printf(state, "\n%s edges: %d",
+ cgdebug_printf(state, "\n%s edges: %d",
tops(range->defs->def->op), i);
cgdebug_loc(state, range->defs->def);
cgdebug_printf(state, "\n");
@@ -19630,7 +19630,7 @@ static int select_free_color(struct compile_state *state,
arch_reg_str(i));
}
}
- }
+ }
/* If a color is already assigned see if it will work */
if (range->color != REG_UNSET) {
@@ -19758,7 +19758,7 @@ static int select_free_color(struct compile_state *state,
* pick the first color that is free.
*/
if (range->color == REG_UNSET) {
- range->color =
+ range->color =
arch_select_free_register(state, used, range->classes);
}
if (range->color == REG_UNSET) {
@@ -19784,7 +19784,7 @@ static int select_free_color(struct compile_state *state,
tops(lrd->def->op), lrd->def);
lrd = lrd->next;
} while(lrd != range->defs);
-
+
warning(state, range->defs->def, "classes: %x",
range->classes);
for(i = 0; i < MAX_REGISTERS; i++) {
@@ -19897,7 +19897,7 @@ static void verify_colors(struct compile_state *state, struct reg_state *rstate)
do {
if (triple_is_def(state, ins)) {
if ((ins->id < 0) || (ins->id > rstate->defs)) {
- internal_error(state, ins,
+ internal_error(state, ins,
"triple without a live range def");
}
lr = rstate->lrd[ins->id].lr;
@@ -19932,7 +19932,7 @@ static void color_triples(struct compile_state *state, struct reg_state *rstate)
ins = first;
do {
if ((ins->id < 0) || (ins->id > rstate->defs)) {
- internal_error(state, ins,
+ internal_error(state, ins,
"triple without a live range");
}
lrd = &rstate->lrd[ins->id];
@@ -19953,7 +19953,7 @@ static struct live_range *merge_sort_lr(
mid = first + size/2;
first = merge_sort_lr(first, mid -1);
mid = merge_sort_lr(mid, last);
-
+
join = 0;
join_tail = &join;
/* merge the two lists */
@@ -19982,7 +19982,7 @@ static struct live_range *merge_sort_lr(
/* Splice the remaining list */
pick = (first)? first : mid;
*join_tail = pick;
- if (pick) {
+ if (pick) {
pick->group_prev = join_tail;
}
}
@@ -19995,7 +19995,7 @@ static struct live_range *merge_sort_lr(
return join;
}
-static void ids_from_rstate(struct compile_state *state,
+static void ids_from_rstate(struct compile_state *state,
struct reg_state *rstate)
{
struct triple *ins, *first;
@@ -20091,14 +20091,14 @@ static void allocate_registers(struct compile_state *state)
tangles = correct_tangles(state, rstate.blocks);
} while(tangles);
-
+
print_blocks(state, "resolve_tangles", state->dbgout);
verify_consistency(state);
-
+
/* Allocate and initialize the live ranges */
initialize_live_ranges(state, &rstate);
- /* Note currently doing coalescing in a loop appears to
+ /* Note currently doing coalescing in a loop appears to
* buys me nothing. The code is left this way in case
* there is some value in it. Or if a future bugfix
* yields some benefit.
@@ -20113,18 +20113,18 @@ static void allocate_registers(struct compile_state *state)
/* Compute the interference graph */
walk_variable_lifetimes(
- state, &state->bb, rstate.blocks,
+ state, &state->bb, rstate.blocks,
graph_ins, &rstate);
-
+
/* Display the interference graph if desired */
if (state->compiler->debug & DEBUG_INTERFERENCE) {
print_interference_blocks(state, &rstate, state->dbgout, 1);
fprintf(state->dbgout, "\nlive variables by instruction\n");
walk_variable_lifetimes(
- state, &state->bb, rstate.blocks,
+ state, &state->bb, rstate.blocks,
print_interference_ins, &rstate);
}
-
+
coalesced = coalesce_live_ranges(state, &rstate);
if (state->compiler->debug & DEBUG_COALESCING) {
@@ -20138,13 +20138,13 @@ static void allocate_registers(struct compile_state *state)
# endif
/* Verify the interference graph */
walk_variable_lifetimes(
- state, &state->bb, rstate.blocks,
+ state, &state->bb, rstate.blocks,
verify_graph_ins, &rstate);
# if 0
fprintf(state->errout, "verify_graph_ins done\n");
#endif
#endif
-
+
/* Build the groups low and high. But with the nodes
* first sorted by degree order.
*/
@@ -20164,13 +20164,13 @@ static void allocate_registers(struct compile_state *state)
struct live_range *range;
next = &(*point)->group_next;
range = *point;
-
+
/* If it has a low degree or it already has a color
* place the node in low.
*/
if ((range->degree < regc_max_size(state, range->classes)) ||
(range->color != REG_UNSET)) {
- cgdebug_printf(state, "Lo: %5d degree %5d%s\n",
+ cgdebug_printf(state, "Lo: %5d degree %5d%s\n",
range - rstate.lr, range->degree,
(range->color != REG_UNSET) ? " (colored)": "");
*range->group_prev = range->group_next;
@@ -20187,7 +20187,7 @@ static void allocate_registers(struct compile_state *state)
next = point;
}
else {
- cgdebug_printf(state, "hi: %5d degree %5d%s\n",
+ cgdebug_printf(state, "hi: %5d degree %5d%s\n",
range - rstate.lr, range->degree,
(range->color != REG_UNSET) ? " (colored)": "");
}
@@ -20280,7 +20280,7 @@ static int is_lattice_lo(struct compile_state *state, struct lattice_node *lnode
return (lnode->val != lnode->def) && !is_scc_const(state, lnode->val);
}
-static void scc_add_fedge(struct compile_state *state, struct scc_state *scc,
+static void scc_add_fedge(struct compile_state *state, struct scc_state *scc,
struct flow_edge *fedge)
{
if (state->compiler->debug & DEBUG_SCC_TRANSFORM2) {
@@ -20410,12 +20410,12 @@ static void initialize_scc_state(
ins_count, ssa_edge_count, state->bb.last_vertex);
}
scc->ins_count = ins_count;
- scc->lattice =
+ scc->lattice =
xcmalloc(sizeof(*scc->lattice)*(ins_count + 1), "lattice");
- scc->ssa_edges =
+ scc->ssa_edges =
xcmalloc(sizeof(*scc->ssa_edges)*(ssa_edge_count + 1), "ssa_edges");
- scc->flow_blocks =
- xcmalloc(sizeof(*scc->flow_blocks)*(state->bb.last_vertex + 1),
+ scc->flow_blocks =
+ xcmalloc(sizeof(*scc->flow_blocks)*(state->bb.last_vertex + 1),
"flow_blocks");
/* Initialize pass one collect up the nodes */
@@ -20554,7 +20554,7 @@ static void initialize_scc_state(
fedge->out_next = 0;
fedge->executable = 0;
fedge->dst->in = fedge;
-
+
/* Initialize the work lists */
scc->flow_work_list = 0;
scc->ssa_work_list = 0;
@@ -20566,7 +20566,7 @@ static void initialize_scc_state(
}
}
-
+
static void free_scc_state(
struct compile_state *state, struct scc_state *scc)
{
@@ -20582,7 +20582,7 @@ static void free_scc_state(
xfree(scc->flow_blocks);
xfree(scc->ssa_edges);
xfree(scc->lattice);
-
+
}
static struct lattice_node *triple_to_lattice(
@@ -20611,7 +20611,7 @@ static struct triple *preserve_lval(
return old;
}
-static int lval_changed(struct compile_state *state,
+static int lval_changed(struct compile_state *state,
struct triple *old, struct lattice_node *lnode)
{
int changed;
@@ -20646,7 +20646,7 @@ static void scc_debug_lnode(
struct triple *val, **expr;
val = lnode->val? lnode->val : lnode->def;
fprintf(fp, "%p %s %3d %10s (",
- lnode->def,
+ lnode->def,
((lnode->def->op == OP_PHI)? "phi: ": "expr:"),
lnode->def->id,
tops(lnode->def->op));
@@ -20674,7 +20674,7 @@ static int compute_lnode_val(struct compile_state *state, struct scc_state *scc,
struct triple *old, *scratch;
struct triple **dexpr, **vexpr;
int count, i;
-
+
/* Store the original value */
old = preserve_lval(state, lnode);
@@ -20731,9 +20731,9 @@ static int compute_lnode_val(struct compile_state *state, struct scc_state *scc,
lnode->val = 0; /* Lattice low by definition */
}
/* Find the case when I am lattice high */
- if (lnode->val &&
+ if (lnode->val &&
(lnode->val->op == lnode->def->op) &&
- (memcmp(lnode->val->param, lnode->def->param,
+ (memcmp(lnode->val->param, lnode->def->param,
count * sizeof(lnode->val->param[0])) == 0) &&
(memcmp(&lnode->val->u, &lnode->def->u, sizeof(lnode->def->u)) == 0)) {
lnode->val = lnode->def;
@@ -20756,7 +20756,7 @@ static int compute_lnode_val(struct compile_state *state, struct scc_state *scc,
}
}
/* Find the cases that are always lattice lo */
- if (lnode->val &&
+ if (lnode->val &&
triple_is_def(state, lnode->val) &&
!triple_is_pure(state, lnode->val, lnode->old_id)) {
lnode->val = 0;
@@ -20764,7 +20764,7 @@ static int compute_lnode_val(struct compile_state *state, struct scc_state *scc,
/* See if the lattice value has changed */
changed = lval_changed(state, old, lnode);
/* See if this value should not change */
- if ((lnode->val != lnode->def) &&
+ if ((lnode->val != lnode->def) &&
(( !triple_is_def(state, lnode->def) &&
!triple_is_cbranch(state, lnode->def)) ||
(lnode->def->op == OP_PIECE))) {
@@ -20781,7 +20781,7 @@ static int compute_lnode_val(struct compile_state *state, struct scc_state *scc,
if (lnode->val != scratch) {
xfree(scratch);
}
-
+
return changed;
}
@@ -20808,7 +20808,7 @@ static void scc_visit_cbranch(struct compile_state *state, struct scc_state *scc
fprintf(fp, "%s: %d (",
tops(lnode->def->op),
lnode->def->id);
-
+
for(fedge = lnode->fblock->out; fedge; fedge = fedge->out_next) {
fprintf(fp, " %d", fedge->dst->block->vertex);
}
@@ -20856,7 +20856,7 @@ static void scc_visit_cbranch(struct compile_state *state, struct scc_state *scc
}
-static void scc_add_sedge_dst(struct compile_state *state,
+static void scc_add_sedge_dst(struct compile_state *state,
struct scc_state *scc, struct ssa_edge *sedge)
{
if (triple_is_cbranch(state, sedge->dst->def)) {
@@ -20867,7 +20867,7 @@ static void scc_add_sedge_dst(struct compile_state *state,
}
}
-static void scc_visit_phi(struct compile_state *state, struct scc_state *scc,
+static void scc_visit_phi(struct compile_state *state, struct scc_state *scc,
struct lattice_node *lnode)
{
struct lattice_node *tmp;
@@ -20887,7 +20887,7 @@ static void scc_visit_phi(struct compile_state *state, struct scc_state *scc,
index = 0;
for(fedge = lnode->fblock->in; fedge; index++, fedge = fedge->in_next) {
if (state->compiler->debug & DEBUG_SCC_TRANSFORM) {
- fprintf(state->errout, "Examining edge: %d vertex: %d executable: %d\n",
+ fprintf(state->errout, "Examining edge: %d vertex: %d executable: %d\n",
index,
fedge->dst->block->vertex,
fedge->executable
@@ -20975,14 +20975,14 @@ static void scc_writeback_values(
struct flow_edge *fedge;
int executable;
executable = 0;
- for(fedge = lnode->fblock->in;
+ for(fedge = lnode->fblock->in;
!executable && fedge; fedge = fedge->in_next) {
executable |= fedge->executable;
}
if (executable) {
internal_warning(state, lnode->def,
"lattice node %d %s->%s still high?",
- ins->id,
+ ins->id,
tops(lnode->def->op),
tops(lnode->val->op));
}
@@ -20998,7 +20998,7 @@ static void scc_writeback_values(
mkconst(state, ins, lnode->val->u.cval);
break;
case OP_ADDRCONST:
- mkaddr_const(state, ins,
+ mkaddr_const(state, ins,
MISC(lnode->val, 0), lnode->val->u.cval);
break;
default:
@@ -21057,9 +21057,9 @@ static void scc_transform(struct compile_state *state)
reps++;
}
}
-
+
if (state->compiler->debug & DEBUG_SCC_TRANSFORM) {
- fprintf(state->errout, "vertex: %d reps: %d\n",
+ fprintf(state->errout, "vertex: %d reps: %d\n",
block->vertex, reps);
}
@@ -21112,11 +21112,11 @@ static void scc_transform(struct compile_state *state)
}
}
}
-
+
scc_writeback_values(state, &scc);
free_scc_state(state, &scc);
rebuild_ssa_form(state);
-
+
print_blocks(state, __func__, state->dbgout);
}
@@ -21129,7 +21129,7 @@ static void transform_to_arch_instructions(struct compile_state *state)
do {
ins = transform_to_arch_instruction(state, ins);
} while(ins != first);
-
+
print_blocks(state, __func__, state->dbgout);
}
@@ -21200,7 +21200,7 @@ static void verify_uses(struct compile_state *state)
}
ins = ins->next;
} while(ins != first);
-
+
}
static void verify_blocks_present(struct compile_state *state)
{
@@ -21214,14 +21214,14 @@ static void verify_blocks_present(struct compile_state *state)
valid_ins(state, ins);
if (triple_stores_block(state, ins)) {
if (!ins->u.block) {
- internal_error(state, ins,
+ internal_error(state, ins,
"%p not in a block?", ins);
}
}
ins = ins->next;
} while(ins != first);
-
-
+
+
}
static int edge_present(struct compile_state *state, struct block *block, struct triple *edge)
@@ -21306,12 +21306,12 @@ static void verify_blocks(struct compile_state *state)
}
}
if (block->users != users) {
- internal_error(state, block->first,
+ internal_error(state, block->first,
"computed users %d != stored users %d",
users, block->users);
}
if (!triple_stores_block(state, block->last->next)) {
- internal_error(state, block->last->next,
+ internal_error(state, block->last->next,
"cannot find next block");
}
block = block->last->next->u.block;
@@ -21333,7 +21333,7 @@ static void verify_domination(struct compile_state *state)
if (!state->bb.first_block) {
return;
}
-
+
first = state->first;
ins = first;
do {
@@ -21360,7 +21360,7 @@ static void verify_domination(struct compile_state *state)
bset = bset->next;
}
if (!bset) {
- internal_error(state, set->member,
+ internal_error(state, set->member,
"no edge for phi rhs %d", i);
}
use_point = bset->member->last;
@@ -21369,11 +21369,11 @@ static void verify_domination(struct compile_state *state)
if (use_point &&
!tdominates(state, ins, use_point)) {
if (is_const(ins)) {
- internal_warning(state, ins,
+ internal_warning(state, ins,
"non dominated rhs use point %p?", use_point);
}
else {
- internal_error(state, ins,
+ internal_error(state, ins,
"non dominated rhs use point %p?", use_point);
}
}
@@ -21438,7 +21438,7 @@ static void verify_piece(struct compile_state *state)
static void verify_ins_colors(struct compile_state *state)
{
struct triple *first, *ins;
-
+
first = state->first;
ins = first;
do {
@@ -21555,7 +21555,7 @@ static void verify_consistency(struct compile_state *state)
fprintf(state->dbgout, "consistency verified\n");
}
}
-#else
+#else
static void verify_consistency(struct compile_state *state) {}
#endif /* DEBUG_CONSISTENCY */
@@ -21668,7 +21668,7 @@ static void print_op_asm(struct compile_state *state,
param);
}
piece = (param < lhs)? LHS(ins, param) : RHS(ins, param - lhs);
- fprintf(fp, "%s",
+ fprintf(fp, "%s",
arch_reg_str(ID_REG(piece->id)));
ptr = next -1;
}
@@ -21928,14 +21928,14 @@ static int arch_regcm_intersect(unsigned regcm1, unsigned regcm2)
{
/* See if two register classes may have overlapping registers */
unsigned gpr_mask = REGCM_GPR8 | REGCM_GPR8_LO | REGCM_GPR16_8 | REGCM_GPR16 |
- REGCM_GPR32_8 | REGCM_GPR32 |
+ REGCM_GPR32_8 | REGCM_GPR32 |
REGCM_DIVIDEND32 | REGCM_DIVIDEND64;
/* Special case for the immediates */
if ((regcm1 & (REGCM_IMM32 | REGCM_IMM16 | REGCM_IMM8)) &&
((regcm1 & ~(REGCM_IMM32 | REGCM_IMM16 | REGCM_IMM8)) == 0) &&
(regcm2 & (REGCM_IMM32 | REGCM_IMM16 | REGCM_IMM8)) &&
- ((regcm2 & ~(REGCM_IMM32 | REGCM_IMM16 | REGCM_IMM8)) == 0)) {
+ ((regcm2 & ~(REGCM_IMM32 | REGCM_IMM16 | REGCM_IMM8)) == 0)) {
return 0;
}
return (regcm1 & regcm2) ||
@@ -21968,7 +21968,7 @@ static void arch_reg_equivs(
*equiv++ = REG_DXAX;
*equiv++ = REG_EDXEAX;
break;
- case REG_BL:
+ case REG_BL:
#if X86_4_8BIT_GPRS
*equiv++ = REG_BH;
#endif
@@ -22028,19 +22028,19 @@ static void arch_reg_equivs(
*equiv++ = REG_BH;
*equiv++ = REG_EBX;
break;
- case REG_CX:
+ case REG_CX:
*equiv++ = REG_CL;
*equiv++ = REG_CH;
*equiv++ = REG_ECX;
break;
- case REG_DX:
+ case REG_DX:
*equiv++ = REG_DL;
*equiv++ = REG_DH;
*equiv++ = REG_EDX;
*equiv++ = REG_DXAX;
*equiv++ = REG_EDXEAX;
break;
- case REG_SI:
+ case REG_SI:
*equiv++ = REG_ESI;
break;
case REG_DI:
@@ -22076,19 +22076,19 @@ static void arch_reg_equivs(
*equiv++ = REG_DXAX;
*equiv++ = REG_EDXEAX;
break;
- case REG_ESI:
+ case REG_ESI:
*equiv++ = REG_SI;
break;
- case REG_EDI:
+ case REG_EDI:
*equiv++ = REG_DI;
break;
- case REG_EBP:
+ case REG_EBP:
*equiv++ = REG_BP;
break;
- case REG_ESP:
+ case REG_ESP:
*equiv++ = REG_SP;
break;
- case REG_DXAX:
+ case REG_DXAX:
*equiv++ = REG_AL;
*equiv++ = REG_AH;
*equiv++ = REG_DL;
@@ -22099,7 +22099,7 @@ static void arch_reg_equivs(
*equiv++ = REG_EDX;
*equiv++ = REG_EDXEAX;
break;
- case REG_EDXEAX:
+ case REG_EDXEAX:
*equiv++ = REG_AL;
*equiv++ = REG_AH;
*equiv++ = REG_DL;
@@ -22111,15 +22111,15 @@ static void arch_reg_equivs(
*equiv++ = REG_DXAX;
break;
}
- *equiv++ = REG_UNSET;
+ *equiv++ = REG_UNSET;
}
static unsigned arch_avail_mask(struct compile_state *state)
{
unsigned avail_mask;
/* REGCM_GPR8 is not available */
- avail_mask = REGCM_GPR8_LO | REGCM_GPR16_8 | REGCM_GPR16 |
- REGCM_GPR32 | REGCM_GPR32_8 |
+ avail_mask = REGCM_GPR8_LO | REGCM_GPR16_8 | REGCM_GPR16 |
+ REGCM_GPR32 | REGCM_GPR32_8 |
REGCM_DIVIDEND32 | REGCM_DIVIDEND64 |
REGCM_IMM32 | REGCM_IMM16 | REGCM_IMM8 | REGCM_FLAGS;
if (state->arch->features & X86_MMX_REGS) {
@@ -22162,7 +22162,7 @@ static unsigned arch_regcm_reg_normalize(struct compile_state *state, unsigned r
/* Remove the immediate register classes */
regcm &= ~(REGCM_IMM32 | REGCM_IMM16 | REGCM_IMM8);
return regcm;
-
+
}
static unsigned arch_reg_regcm(struct compile_state *state, int reg)
@@ -22306,7 +22306,7 @@ static struct reg_info arch_reg_clobber(
return result;
}
-static int do_select_reg(struct compile_state *state,
+static int do_select_reg(struct compile_state *state,
char *used, int reg, unsigned classes)
{
unsigned mask;
@@ -22331,7 +22331,7 @@ static int arch_select_free_register(
* increase the odds the register allocator will work when
* it guesses first give out registers from register classes
* least likely to run out of registers.
- *
+ *
*/
int i, reg;
reg = REG_UNSET;
@@ -22366,7 +22366,7 @@ static int arch_select_free_register(
}
-static unsigned arch_type_to_regcm(struct compile_state *state, struct type *type)
+static unsigned arch_type_to_regcm(struct compile_state *state, struct type *type)
{
#if DEBUG_ROMCC_WARNINGS
@@ -22376,13 +22376,13 @@ static unsigned arch_type_to_regcm(struct compile_state *state, struct type *typ
mask = 0;
switch(type->type & TYPE_MASK) {
case TYPE_ARRAY:
- case TYPE_VOID:
- mask = 0;
+ case TYPE_VOID:
+ mask = 0;
break;
case TYPE_CHAR:
case TYPE_UCHAR:
mask = REGCM_GPR8 | REGCM_GPR8_LO |
- REGCM_GPR16 | REGCM_GPR16_8 |
+ REGCM_GPR16 | REGCM_GPR16_8 |
REGCM_GPR32 | REGCM_GPR32_8 |
REGCM_DIVIDEND32 | REGCM_DIVIDEND64 |
REGCM_MMX | REGCM_XMM |
@@ -22433,7 +22433,7 @@ static int is_imm32(struct triple *imm)
{
return ((imm->op == OP_INTCONST) && (imm->u.cval <= 0xffffffffUL)) ||
(imm->op == OP_ADDRCONST);
-
+
}
static int is_imm16(struct triple *imm)
{
@@ -22549,13 +22549,13 @@ static int get_imm8(struct triple *ins, struct triple **expr)
#endif
#define COPY8_REGCM (REGCM_DIVIDEND64 | REGCM_DIVIDEND32 | REGCM_GPR32 | REGCM_GPR16 | REGCM_GPR8_LO | REGCM_MMX | REGCM_XMM)
-#define COPY16_REGCM (REGCM_DIVIDEND64 | REGCM_DIVIDEND32 | REGCM_GPR32 | REGCM_GPR16 | REGCM_MMX | REGCM_XMM)
+#define COPY16_REGCM (REGCM_DIVIDEND64 | REGCM_DIVIDEND32 | REGCM_GPR32 | REGCM_GPR16 | REGCM_MMX | REGCM_XMM)
#define COPY32_REGCM (REGCM_DIVIDEND64 | REGCM_DIVIDEND32 | REGCM_GPR32 | REGCM_MMX | REGCM_XMM)
static struct ins_template templates[] = {
[TEMPLATE_NOP] = {
- .lhs = {
+ .lhs = {
[ 0] = { REG_UNNEEDED, REGCM_IMMALL },
[ 1] = { REG_UNNEEDED, REGCM_IMMALL },
[ 2] = { REG_UNNEEDED, REGCM_IMMALL },
@@ -22622,10 +22622,10 @@ static struct ins_template templates[] = {
[63] = { REG_UNNEEDED, REGCM_IMMALL },
},
},
- [TEMPLATE_INTCONST8] = {
+ [TEMPLATE_INTCONST8] = {
.lhs = { [0] = { REG_UNNEEDED, REGCM_IMM8 } },
},
- [TEMPLATE_INTCONST32] = {
+ [TEMPLATE_INTCONST32] = {
.lhs = { [0] = { REG_UNNEEDED, REGCM_IMM32 } },
},
[TEMPLATE_UNKNOWNVAL] = {
@@ -22655,32 +22655,32 @@ static struct ins_template templates[] = {
.lhs = { [0] = { REG_UNSET, COPY32_REGCM } },
.rhs = { [0] = { REG_UNNEEDED, REGCM_IMM32 | REGCM_IMM16 | REGCM_IMM8 } },
},
- [TEMPLATE_PHI8] = {
+ [TEMPLATE_PHI8] = {
.lhs = { [0] = { REG_VIRT0, COPY8_REGCM } },
.rhs = { [0] = { REG_VIRT0, COPY8_REGCM } },
},
- [TEMPLATE_PHI16] = {
+ [TEMPLATE_PHI16] = {
.lhs = { [0] = { REG_VIRT0, COPY16_REGCM } },
- .rhs = { [0] = { REG_VIRT0, COPY16_REGCM } },
+ .rhs = { [0] = { REG_VIRT0, COPY16_REGCM } },
},
- [TEMPLATE_PHI32] = {
+ [TEMPLATE_PHI32] = {
.lhs = { [0] = { REG_VIRT0, COPY32_REGCM } },
- .rhs = { [0] = { REG_VIRT0, COPY32_REGCM } },
+ .rhs = { [0] = { REG_VIRT0, COPY32_REGCM } },
},
[TEMPLATE_STORE8] = {
- .rhs = {
+ .rhs = {
[0] = { REG_UNSET, REGCM_GPR32 },
[1] = { REG_UNSET, REGCM_GPR8_LO },
},
},
[TEMPLATE_STORE16] = {
- .rhs = {
+ .rhs = {
[0] = { REG_UNSET, REGCM_GPR32 },
[1] = { REG_UNSET, REGCM_GPR16 },
},
},
[TEMPLATE_STORE32] = {
- .rhs = {
+ .rhs = {
[0] = { REG_UNSET, REGCM_GPR32 },
[1] = { REG_UNSET, REGCM_GPR32 },
},
@@ -22699,84 +22699,84 @@ static struct ins_template templates[] = {
},
[TEMPLATE_BINARY8_REG] = {
.lhs = { [0] = { REG_VIRT0, REGCM_GPR8_LO } },
- .rhs = {
+ .rhs = {
[0] = { REG_VIRT0, REGCM_GPR8_LO },
[1] = { REG_UNSET, REGCM_GPR8_LO },
},
},
[TEMPLATE_BINARY16_REG] = {
.lhs = { [0] = { REG_VIRT0, REGCM_GPR16 } },
- .rhs = {
+ .rhs = {
[0] = { REG_VIRT0, REGCM_GPR16 },
[1] = { REG_UNSET, REGCM_GPR16 },
},
},
[TEMPLATE_BINARY32_REG] = {
.lhs = { [0] = { REG_VIRT0, REGCM_GPR32 } },
- .rhs = {
+ .rhs = {
[0] = { REG_VIRT0, REGCM_GPR32 },
[1] = { REG_UNSET, REGCM_GPR32 },
},
},
[TEMPLATE_BINARY8_IMM] = {
.lhs = { [0] = { REG_VIRT0, REGCM_GPR8_LO } },
- .rhs = {
+ .rhs = {
[0] = { REG_VIRT0, REGCM_GPR8_LO },
[1] = { REG_UNNEEDED, REGCM_IMM8 },
},
},
[TEMPLATE_BINARY16_IMM] = {
.lhs = { [0] = { REG_VIRT0, REGCM_GPR16 } },
- .rhs = {
+ .rhs = {
[0] = { REG_VIRT0, REGCM_GPR16 },
[1] = { REG_UNNEEDED, REGCM_IMM16 },
},
},
[TEMPLATE_BINARY32_IMM] = {
.lhs = { [0] = { REG_VIRT0, REGCM_GPR32 } },
- .rhs = {
+ .rhs = {
[0] = { REG_VIRT0, REGCM_GPR32 },
[1] = { REG_UNNEEDED, REGCM_IMM32 },
},
},
[TEMPLATE_SL8_CL] = {
.lhs = { [0] = { REG_VIRT0, REGCM_GPR8_LO } },
- .rhs = {
+ .rhs = {
[0] = { REG_VIRT0, REGCM_GPR8_LO },
[1] = { REG_CL, REGCM_GPR8_LO },
},
},
[TEMPLATE_SL16_CL] = {
.lhs = { [0] = { REG_VIRT0, REGCM_GPR16 } },
- .rhs = {
+ .rhs = {
[0] = { REG_VIRT0, REGCM_GPR16 },
[1] = { REG_CL, REGCM_GPR8_LO },
},
},
[TEMPLATE_SL32_CL] = {
.lhs = { [0] = { REG_VIRT0, REGCM_GPR32 } },
- .rhs = {
+ .rhs = {
[0] = { REG_VIRT0, REGCM_GPR32 },
[1] = { REG_CL, REGCM_GPR8_LO },
},
},
[TEMPLATE_SL8_IMM] = {
.lhs = { [0] = { REG_VIRT0, REGCM_GPR8_LO } },
- .rhs = {
+ .rhs = {
[0] = { REG_VIRT0, REGCM_GPR8_LO },
[1] = { REG_UNNEEDED, REGCM_IMM8 },
},
},
[TEMPLATE_SL16_IMM] = {
.lhs = { [0] = { REG_VIRT0, REGCM_GPR16 } },
- .rhs = {
+ .rhs = {
[0] = { REG_VIRT0, REGCM_GPR16 },
[1] = { REG_UNNEEDED, REGCM_IMM8 },
},
},
[TEMPLATE_SL32_IMM] = {
.lhs = { [0] = { REG_VIRT0, REGCM_GPR32 } },
- .rhs = {
+ .rhs = {
[0] = { REG_VIRT0, REGCM_GPR32 },
[1] = { REG_UNNEEDED, REGCM_IMM8 },
},
@@ -22858,19 +22858,19 @@ static struct ins_template templates[] = {
.rhs = { [0] = { REG_UNSET, REGCM_GPR32 } },
},
[TEMPLATE_INB_DX] = {
- .lhs = { [0] = { REG_AL, REGCM_GPR8_LO } },
+ .lhs = { [0] = { REG_AL, REGCM_GPR8_LO } },
.rhs = { [0] = { REG_DX, REGCM_GPR16 } },
},
[TEMPLATE_INB_IMM] = {
- .lhs = { [0] = { REG_AL, REGCM_GPR8_LO } },
+ .lhs = { [0] = { REG_AL, REGCM_GPR8_LO } },
.rhs = { [0] = { REG_UNNEEDED, REGCM_IMM8 } },
},
- [TEMPLATE_INW_DX] = {
- .lhs = { [0] = { REG_AX, REGCM_GPR16 } },
+ [TEMPLATE_INW_DX] = {
+ .lhs = { [0] = { REG_AX, REGCM_GPR16 } },
.rhs = { [0] = { REG_DX, REGCM_GPR16 } },
},
- [TEMPLATE_INW_IMM] = {
- .lhs = { [0] = { REG_AX, REGCM_GPR16 } },
+ [TEMPLATE_INW_IMM] = {
+ .lhs = { [0] = { REG_AX, REGCM_GPR16 } },
.rhs = { [0] = { REG_UNNEEDED, REGCM_IMM8 } },
},
[TEMPLATE_INL_DX] = {
@@ -22881,19 +22881,19 @@ static struct ins_template templates[] = {
.lhs = { [0] = { REG_EAX, REGCM_GPR32 } },
.rhs = { [0] = { REG_UNNEEDED, REGCM_IMM8 } },
},
- [TEMPLATE_OUTB_DX] = {
+ [TEMPLATE_OUTB_DX] = {
.rhs = {
[0] = { REG_AL, REGCM_GPR8_LO },
[1] = { REG_DX, REGCM_GPR16 },
},
},
- [TEMPLATE_OUTB_IMM] = {
+ [TEMPLATE_OUTB_IMM] = {
.rhs = {
- [0] = { REG_AL, REGCM_GPR8_LO },
+ [0] = { REG_AL, REGCM_GPR8_LO },
[1] = { REG_UNNEEDED, REGCM_IMM8 },
},
},
- [TEMPLATE_OUTW_DX] = {
+ [TEMPLATE_OUTW_DX] = {
.rhs = {
[0] = { REG_AX, REGCM_GPR16 },
[1] = { REG_DX, REGCM_GPR16 },
@@ -22901,19 +22901,19 @@ static struct ins_template templates[] = {
},
[TEMPLATE_OUTW_IMM] = {
.rhs = {
- [0] = { REG_AX, REGCM_GPR16 },
+ [0] = { REG_AX, REGCM_GPR16 },
[1] = { REG_UNNEEDED, REGCM_IMM8 },
},
},
- [TEMPLATE_OUTL_DX] = {
+ [TEMPLATE_OUTL_DX] = {
.rhs = {
[0] = { REG_EAX, REGCM_GPR32 },
[1] = { REG_DX, REGCM_GPR16 },
},
},
- [TEMPLATE_OUTL_IMM] = {
+ [TEMPLATE_OUTL_IMM] = {
.rhs = {
- [0] = { REG_EAX, REGCM_GPR32 },
+ [0] = { REG_EAX, REGCM_GPR32 },
[1] = { REG_UNNEEDED, REGCM_IMM8 },
},
},
@@ -22922,7 +22922,7 @@ static struct ins_template templates[] = {
.rhs = { [0] = { REG_UNSET, REGCM_GPR32 } },
},
[TEMPLATE_RDMSR] = {
- .lhs = {
+ .lhs = {
[0] = { REG_EAX, REGCM_GPR32 },
[1] = { REG_EDX, REGCM_GPR32 },
},
@@ -22937,27 +22937,27 @@ static struct ins_template templates[] = {
},
[TEMPLATE_UMUL8] = {
.lhs = { [0] = { REG_AX, REGCM_GPR16 } },
- .rhs = {
+ .rhs = {
[0] = { REG_AL, REGCM_GPR8_LO },
[1] = { REG_UNSET, REGCM_GPR8_LO },
},
},
[TEMPLATE_UMUL16] = {
.lhs = { [0] = { REG_DXAX, REGCM_DIVIDEND32 } },
- .rhs = {
+ .rhs = {
[0] = { REG_AX, REGCM_GPR16 },
[1] = { REG_UNSET, REGCM_GPR16 },
},
},
[TEMPLATE_UMUL32] = {
.lhs = { [0] = { REG_EDXEAX, REGCM_DIVIDEND64 } },
- .rhs = {
+ .rhs = {
[0] = { REG_EAX, REGCM_GPR32 },
[1] = { REG_UNSET, REGCM_GPR32 },
},
},
[TEMPLATE_DIV8] = {
- .lhs = {
+ .lhs = {
[0] = { REG_AL, REGCM_GPR8_LO },
[1] = { REG_AH, REGCM_GPR8 },
},
@@ -22967,7 +22967,7 @@ static struct ins_template templates[] = {
},
},
[TEMPLATE_DIV16] = {
- .lhs = {
+ .lhs = {
[0] = { REG_AX, REGCM_GPR16 },
[1] = { REG_DX, REGCM_GPR16 },
},
@@ -22977,7 +22977,7 @@ static struct ins_template templates[] = {
},
},
[TEMPLATE_DIV32] = {
- .lhs = {
+ .lhs = {
[0] = { REG_EAX, REGCM_GPR32 },
[1] = { REG_EDX, REGCM_GPR32 },
},
@@ -22998,7 +22998,7 @@ static void fixup_branch(struct compile_state *state,
}
test = pre_triple(state, branch,
cmp_op, cmp_type, left, right);
- test->template_id = TEMPLATE_TEST32;
+ test->template_id = TEMPLATE_TEST32;
if (cmp_op == OP_CMP) {
test->template_id = TEMPLATE_CMP32_REG;
if (get_imm32(test, &RHS(test, 1))) {
@@ -23032,13 +23032,13 @@ static void fixup_branches(struct compile_state *state,
right = RHS(cmp, 1);
}
branch = entry->member;
- fixup_branch(state, branch, jmp_op,
+ fixup_branch(state, branch, jmp_op,
cmp->op, cmp->type, left, right);
}
}
}
-static void bool_cmp(struct compile_state *state,
+static void bool_cmp(struct compile_state *state,
struct triple *ins, int cmp_op, int jmp_op, int set_op)
{
struct triple_set *entry, *next;
@@ -23105,7 +23105,7 @@ struct reg_info arch_reg_lhs(struct compile_state *state, struct triple *ins, in
break;
default:
if (ins->template_id > LAST_TEMPLATE) {
- internal_error(state, ins, "bad template number %d",
+ internal_error(state, ins, "bad template number %d",
ins->template_id);
}
template = &templates[ins->template_id];
@@ -23140,7 +23140,7 @@ struct reg_info arch_reg_rhs(struct compile_state *state, struct triple *ins, in
/* Fall through */
default:
if (ins->template_id > LAST_TEMPLATE) {
- internal_error(state, ins, "bad template number %d",
+ internal_error(state, ins, "bad template number %d",
ins->template_id);
}
template = &templates[ins->template_id];
@@ -23158,7 +23158,7 @@ static struct triple *mod_div(struct compile_state *state,
struct triple *ins, int div_op, int index)
{
struct triple *div, *piece0, *piece1;
-
+
/* Generate the appropriate division instruction */
div = post_triple(state, ins, div_op, ins->type, 0, 0);
RHS(div, 0) = RHS(ins, 0);
@@ -23468,8 +23468,8 @@ static struct triple *transform_to_arch_instruction(
case OP_NEG:
ins->template_id = TEMPLATE_UNARY32;
break;
- case OP_EQ:
- bool_cmp(state, ins, OP_CMP, OP_JMP_EQ, OP_SET_EQ);
+ case OP_EQ:
+ bool_cmp(state, ins, OP_CMP, OP_JMP_EQ, OP_SET_EQ);
break;
case OP_NOTEQ:
bool_cmp(state, ins, OP_CMP, OP_JMP_NOTEQ, OP_SET_NOTEQ);
@@ -23509,7 +23509,7 @@ static struct triple *transform_to_arch_instruction(
ins->template_id = TEMPLATE_NOP;
break;
case OP_CBRANCH:
- fixup_branch(state, ins, OP_JMP_NOTEQ, OP_TEST,
+ fixup_branch(state, ins, OP_JMP_NOTEQ, OP_TEST,
RHS(ins, 0)->type, RHS(ins, 0), 0);
break;
case OP_CALL:
@@ -23615,20 +23615,20 @@ static void generate_local_labels(struct compile_state *state)
first = state->first;
label = first;
do {
- if ((label->op == OP_LABEL) ||
+ if ((label->op == OP_LABEL) ||
(label->op == OP_SDECL)) {
if (label->use) {
label->u.cval = next_label(state);
} else {
label->u.cval = 0;
}
-
+
}
label = label->next;
} while(label != first);
}
-static int check_reg(struct compile_state *state,
+static int check_reg(struct compile_state *state,
struct triple *triple, int classes)
{
unsigned mask;
@@ -23659,7 +23659,7 @@ static const char *arch_regs[] = {
"%edx:%eax",
"%dx:%ax",
"%mm0", "%mm1", "%mm2", "%mm3", "%mm4", "%mm5", "%mm6", "%mm7",
- "%xmm0", "%xmm1", "%xmm2", "%xmm3",
+ "%xmm0", "%xmm1", "%xmm2", "%xmm3",
"%xmm4", "%xmm5", "%xmm6", "%xmm7",
};
static const char *arch_reg_str(int reg)
@@ -23718,7 +23718,7 @@ static int reg_size(struct compile_state *state, struct triple *ins)
}
return arch_reg_size(reg);
}
-
+
const char *type_suffix(struct compile_state *state, struct type *type)
@@ -23741,7 +23741,7 @@ static void print_const_val(
{
switch(ins->op) {
case OP_INTCONST:
- fprintf(fp, " $%ld ",
+ fprintf(fp, " $%ld ",
(long)(ins->u.cval));
break;
case OP_ADDRCONST:
@@ -23754,7 +23754,7 @@ static void print_const_val(
internal_error(state, ins, "unlabeled constant");
}
fprintf(fp, " $L%s%lu+%lu ",
- state->compiler->label_prefix,
+ state->compiler->label_prefix,
(unsigned long)(MISC(ins, 0)->u.cval),
(unsigned long)(ins->u.cval));
break;
@@ -23772,12 +23772,12 @@ static void print_const(struct compile_state *state,
switch(ins->type->type & TYPE_MASK) {
case TYPE_CHAR:
case TYPE_UCHAR:
- fprintf(fp, ".byte 0x%02lx\n",
+ fprintf(fp, ".byte 0x%02lx\n",
(unsigned long)(ins->u.cval));
break;
case TYPE_SHORT:
case TYPE_USHORT:
- fprintf(fp, ".short 0x%04lx\n",
+ fprintf(fp, ".short 0x%04lx\n",
(unsigned long)(ins->u.cval));
break;
case TYPE_INT:
@@ -23785,7 +23785,7 @@ static void print_const(struct compile_state *state,
case TYPE_LONG:
case TYPE_ULONG:
case TYPE_POINTER:
- fprintf(fp, ".int %lu\n",
+ fprintf(fp, ".int %lu\n",
(unsigned long)(ins->u.cval));
break;
default:
@@ -23795,7 +23795,7 @@ static void print_const(struct compile_state *state,
internal_error(state, ins, "Unknown constant type. Val: %lu",
(unsigned long)(ins->u.cval));
}
-
+
break;
case OP_ADDRCONST:
if ((MISC(ins, 0)->op != OP_SDECL) &&
@@ -23867,7 +23867,7 @@ static long get_mask_pool_ref(
}
static void print_binary_op(struct compile_state *state,
- const char *op, struct triple *ins, FILE *fp)
+ const char *op, struct triple *ins, FILE *fp)
{
unsigned mask;
mask = REGCM_GPR32 | REGCM_GPR16 | REGCM_GPR8_LO;
@@ -23894,7 +23894,7 @@ static void print_binary_op(struct compile_state *state,
reg(state, RHS(ins, 0), mask));
}
}
-static void print_unary_op(struct compile_state *state,
+static void print_unary_op(struct compile_state *state,
const char *op, struct triple *ins, FILE *fp)
{
unsigned mask;
@@ -23958,7 +23958,7 @@ static void print_op_in(struct compile_state *state, struct triple *ins, FILE *f
internal_error(state, ins, "src != %%dx");
}
fprintf(fp, "\t%s %s, %s\n",
- op,
+ op,
reg(state, RHS(ins, 0), REGCM_GPR16),
reg(state, ins, mask));
}
@@ -23984,7 +23984,7 @@ static void print_op_out(struct compile_state *state, struct triple *ins, FILE *
internal_error(state, ins, "src != %%eax");
}
if (is_const(RHS(ins, 1))) {
- fprintf(fp, "\t%s %s,",
+ fprintf(fp, "\t%s %s,",
op, reg(state, RHS(ins, 0), mask));
print_const_val(state, RHS(ins, 1), fp);
fprintf(fp, "\n");
@@ -23996,7 +23996,7 @@ static void print_op_out(struct compile_state *state, struct triple *ins, FILE *
internal_error(state, ins, "dst != %%dx");
}
fprintf(fp, "\t%s %s, %s\n",
- op,
+ op,
reg(state, RHS(ins, 0), mask),
reg(state, RHS(ins, 1), REGCM_GPR16));
}
@@ -24046,7 +24046,7 @@ static void print_op_move(struct compile_state *state,
src_regcm = arch_reg_regcm(state, src_reg);
dst_regcm = arch_reg_regcm(state, dst_reg);
/* If the class is the same just move the register */
- if (src_regcm & dst_regcm &
+ if (src_regcm & dst_regcm &
(REGCM_GPR8_LO | REGCM_GPR16 | REGCM_GPR32)) {
if ((src_reg != dst_reg) || !omit_copy) {
fprintf(fp, "\tmov %s, %s\n",
@@ -24060,7 +24060,7 @@ static void print_op_move(struct compile_state *state,
src_reg = (src_reg - REGC_GPR32_FIRST) + REGC_GPR16_FIRST;
if ((src_reg != dst_reg) || !omit_copy) {
fprintf(fp, "\tmovw %s, %s\n",
- arch_reg_str(src_reg),
+ arch_reg_str(src_reg),
arch_reg_str(dst_reg));
}
}
@@ -24097,7 +24097,7 @@ static void print_op_move(struct compile_state *state,
}
}
/* Move 8/16bit to 16/32bit */
- else if ((src_regcm & (REGCM_GPR8_LO | REGCM_GPR16)) &&
+ else if ((src_regcm & (REGCM_GPR8_LO | REGCM_GPR16)) &&
(dst_regcm & (REGCM_GPR16 | REGCM_GPR32))) {
const char *op;
op = is_signed(src->type)? "movsx": "movzx";
@@ -24169,7 +24169,7 @@ static void print_op_move(struct compile_state *state,
const char *extend;
extend = is_signed(src->type)? "cltd":"movl $0, %edx";
fprintf(fp, "\tmov %s, %%eax\n\t%s\n",
- arch_reg_str(src_reg),
+ arch_reg_str(src_reg),
extend);
}
/* Move from 64bit gpr to gpr */
@@ -24177,7 +24177,7 @@ static void print_op_move(struct compile_state *state,
(dst_regcm & (REGCM_GPR32 | REGCM_GPR16 | REGCM_GPR8_LO))) {
if (dst_regcm & REGCM_GPR32) {
src_reg = REG_EAX;
- }
+ }
else if (dst_regcm & REGCM_GPR16) {
src_reg = REG_AX;
}
@@ -24382,19 +24382,19 @@ static void print_op_move(struct compile_state *state,
}
if (dst_regcm & (REGCM_GPR32 | REGCM_GPR16 | REGCM_GPR8_LO)) {
- fprintf(fp, "\tshl $%d, %s\n",
- shift_bits,
+ fprintf(fp, "\tshl $%d, %s\n",
+ shift_bits,
reg(state, dst, REGCM_GPR32 | REGCM_GPR16 | REGCM_GPR8_LO));
- fprintf(fp, "\tsar $%d, %s\n",
- shift_bits,
+ fprintf(fp, "\tsar $%d, %s\n",
+ shift_bits,
reg(state, dst, REGCM_GPR32 | REGCM_GPR16 | REGCM_GPR8_LO));
}
else if (dst_regcm & (REGCM_MMX | REGCM_XMM)) {
fprintf(fp, "\tpslld $%d, %s\n",
- shift_bits,
+ shift_bits,
reg(state, dst, REGCM_MMX | REGCM_XMM));
fprintf(fp, "\tpsrad $%d, %s\n",
- shift_bits,
+ shift_bits,
reg(state, dst, REGCM_MMX | REGCM_XMM));
}
else {
@@ -24425,7 +24425,7 @@ static void print_op_load(struct compile_state *state,
case TYPE_INT: case TYPE_UINT:
case TYPE_LONG: case TYPE_ULONG:
case TYPE_POINTER:
- op = "movl";
+ op = "movl";
break;
default:
internal_error(state, ins, "unknown type in load");
@@ -24433,7 +24433,7 @@ static void print_op_load(struct compile_state *state,
break;
}
fprintf(fp, "\t%s (%s), %s\n",
- op,
+ op,
reg(state, src, REGCM_GPR32),
reg(state, dst, REGCM_GPR32));
}
@@ -24468,8 +24468,8 @@ static void print_op_store(struct compile_state *state,
reg(state, src, REGCM_GPR8_LO | REGCM_GPR16 | REGCM_GPR32),
reg(state, dst, REGCM_GPR32));
}
-
-
+
+
}
static void print_op_smul(struct compile_state *state,
@@ -24570,7 +24570,7 @@ static void print_op_branch(struct compile_state *state,
internal_error(state, branch, "Invalid branch op");
break;
}
-
+
}
#if 1
if (branch->op == OP_CALL) {
@@ -24578,7 +24578,7 @@ static void print_op_branch(struct compile_state *state,
}
#endif
fprintf(fp, "\t%s L%s%lu\n",
- bop,
+ bop,
state->compiler->label_prefix,
(unsigned long)(TARG(branch, 0)->u.cval));
}
@@ -24624,19 +24624,19 @@ static void print_op_set(struct compile_state *state,
sop, reg(state, set, REGCM_GPR8_LO));
}
-static void print_op_bit_scan(struct compile_state *state,
- struct triple *ins, FILE *fp)
+static void print_op_bit_scan(struct compile_state *state,
+ struct triple *ins, FILE *fp)
{
const char *op;
switch(ins->op) {
case OP_BSF: op = "bsf"; break;
case OP_BSR: op = "bsr"; break;
- default:
+ default:
internal_error(state, ins, "unknown bit scan");
op = 0;
break;
}
- fprintf(fp,
+ fprintf(fp,
"\t%s %s, %s\n"
"\tjnz 1f\n"
"\tmovl $-1, %s\n"
@@ -24653,18 +24653,18 @@ static void print_sdecl(struct compile_state *state,
{
fprintf(fp, ".section \"" DATA_SECTION "\"\n");
fprintf(fp, ".balign %ld\n", (long int)align_of_in_bytes(state, ins->type));
- fprintf(fp, "L%s%lu:\n",
+ fprintf(fp, "L%s%lu:\n",
state->compiler->label_prefix, (unsigned long)(ins->u.cval));
print_const(state, MISC(ins, 0), fp);
fprintf(fp, ".section \"" TEXT_SECTION "\"\n");
-
+
}
static void print_instruction(struct compile_state *state,
struct triple *ins, FILE *fp)
{
/* Assumption: after I have exted the register allocator
- * everything is in a valid register.
+ * everything is in a valid register.
*/
switch(ins->op) {
case OP_ASM:
@@ -24696,7 +24696,7 @@ static void print_instruction(struct compile_state *state,
case OP_SDECL:
print_sdecl(state, ins, fp);
break;
- case OP_COPY:
+ case OP_COPY:
case OP_CONVERT:
print_op_move(state, ins, fp);
break;
@@ -24731,10 +24731,10 @@ static void print_instruction(struct compile_state *state,
print_op_set(state, ins, fp);
break;
case OP_INB: case OP_INW: case OP_INL:
- print_op_in(state, ins, fp);
+ print_op_in(state, ins, fp);
break;
case OP_OUTB: case OP_OUTW: case OP_OUTL:
- print_op_out(state, ins, fp);
+ print_op_out(state, ins, fp);
break;
case OP_BSF:
case OP_BSR:
@@ -24763,7 +24763,7 @@ static void print_instruction(struct compile_state *state,
if (!ins->use) {
return;
}
- fprintf(fp, "L%s%lu:\n",
+ fprintf(fp, "L%s%lu:\n",
state->compiler->label_prefix, (unsigned long)(ins->u.cval));
break;
case OP_ADECL:
@@ -24810,7 +24810,7 @@ static void print_instructions(struct compile_state *state)
first = state->first;
ins = first;
do {
- if (print_location &&
+ if (print_location &&
last_occurance != ins->occurance) {
if (!ins->occurance->parent) {
fprintf(fp, "\t/* %s,%s:%d.%d */\n",
@@ -24857,7 +24857,7 @@ static void generate_code(struct compile_state *state)
{
generate_local_labels(state);
print_instructions(state);
-
+
}
static void print_preprocessed_tokens(struct compile_state *state)
@@ -24878,7 +24878,7 @@ static void print_preprocessed_tokens(struct compile_state *state)
break;
}
tk = eat(state, tok);
- token_str =
+ token_str =
tk->ident ? tk->ident->name :
tk->str_len ? tk->val.str :
tokens[tk->tok];
@@ -24887,8 +24887,8 @@ static void print_preprocessed_tokens(struct compile_state *state)
while(file->macro && file->prev) {
file = file->prev;
}
- if (!file->macro &&
- ((file->line != line) || (file->basename != filename)))
+ if (!file->macro &&
+ ((file->line != line) || (file->basename != filename)))
{
int i, col;
if ((file->basename == filename) &&
@@ -24909,9 +24909,9 @@ static void print_preprocessed_tokens(struct compile_state *state)
fprintf(fp, " ");
}
}
-
+
fprintf(fp, "%s ", token_str);
-
+
if (state->compiler->debug & DEBUG_TOKENS) {
loc(state->dbgout, state, 0);
fprintf(state->dbgout, "%s <- `%s'\n",
@@ -25009,8 +25009,8 @@ static void compile(const char *filename, const char *includefile,
/* Exit the global definition scope */
end_scope(&state);
- /* Now that basic compilation has happened
- * optimize the intermediate code
+ /* Now that basic compilation has happened
+ * optimize the intermediate code
*/
optimize(&state);
@@ -25067,8 +25067,8 @@ int main(int argc, char **argv)
struct compiler_state compiler;
struct arch_state arch;
int all_opts;
-
-
+
+
/* I don't want any surprises */
setlocale(LC_ALL, "C");
diff --git a/SerialICE/util/xmmstack.c b/SerialICE/util/xmmstack.c
index 7dcc041..8a14a95 100644
--- a/SerialICE/util/xmmstack.c
+++ b/SerialICE/util/xmmstack.c
@@ -109,7 +109,7 @@ int main(int argc,char **argv)
int param;
int inapp;
- if (argc<2)
+ if (argc<2)
{
printf("Usage: \n\txmmstack [-xmm] [-mmx] file.s\nThis program is for use with:\n"
"\tgcc -fomit-frame-pointer -fno-stack-protector *.c\n"
@@ -552,7 +552,7 @@ getxmml:\n\
);
while(!feof(f))
- {
+ {
*buf=0;
fgets(buf,sizeof(buf)-1,f);
chomp(buf);len=strlen(buf);
@@ -616,7 +616,7 @@ getxmml:\n\
case 2:fprintf(w,"jmp getxmmw\n");break;
case 4:fprintf(w,"jmp getxmml\n");break;
}
- if (!strcmp(find[2],"%eax")||!strcmp(find[2],"%ax")||!strcmp(find[2],"%al"))
+ if (!strcmp(find[2],"%eax")||!strcmp(find[2],"%ax")||!strcmp(find[2],"%al"))
{
fprintf(w,"movl %%edx,%%esp #NOSTACK\n");
fprintf(w,"movl %%dr0,%%edx #NOSTACK\n");
@@ -669,7 +669,7 @@ getxmml:\n\
case 2:fprintf(w,"%s %%ax,%s\n",find[1],find[3]);break;
case 4:fprintf(w,"%s %%eax,%s\n",find[1],find[3]);break;
}
- if (strcmp(find[3],"%eax")&&strcmp(find[3],"%ax")&&strcmp(find[3],"%al"))
+ if (strcmp(find[3],"%eax")&&strcmp(find[3],"%ax")&&strcmp(find[3],"%al"))
//Nota, només pot ser un registre, (tot ha de ser const, ni malloc's ni res)
fprintf(w,"movl %%dr0,%%eax #NOSTACK\n");
continue;
@@ -737,7 +737,7 @@ getxmml:\n\
fprintf(w,"movl $.+10,%%esp\n");
fprintf(w,"jmp docall\n");
fprintf(w,"movl %%dr0,%%eax #NOSTACK\n");
- fprintf(w,".byte 0xe9\n.long %s-4-. #NOSTACK\n",find[1]);//jmp, not works with .global??? gcc???
+ fprintf(w,".byte 0xe9\n.long %s-4-. #NOSTACK\n",find[1]);//jmp, not works with .global??? gcc???
continue;
}
if (regexp("^(rep\\s*;\\s*|)ret$",buf,len,find))
@@ -753,7 +753,7 @@ getxmml:\n\
fprintf(w,"movl %%eax,%%esp\n");
fprintf(w,"movl %%dr0,%%eax #NOSTACK\n");
fprintf(w,"jmp *%%esp #NOSTACK\n");
-
+
continue;
}
fprintf(w,"%s\n",buf);
@@ -763,5 +763,3 @@ getxmml:\n\
return 0;
}
-
-
Edward O'Callaghan (eocallaghan(a)alterapraxis.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/5215
-gerrit
commit 8c1530197dc24fa95b8eed6d0ae6d47528168d10
Author: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
Date: Fri Feb 14 01:53:18 2014 +1100
SerialICE/Makefile: Create gitconfig target.
Provide for gitconfig Makefile target and some example pre-commit lint
check hooks.
Change-Id: I49ce2791f740089f5867fe2221cbbbd1e1c6a8a7
Signed-off-by: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
---
Makefile | 34 +++++++
util/gitconfig/commit-msg | 173 +++++++++++++++++++++++++++++++++++
util/gitconfig/pre-commit | 2 +
util/lint/lint-000-license-headers | 35 +++++++
util/lint/lint-stable-003-whitespace | 44 +++++++++
5 files changed, 288 insertions(+)
diff --git a/Makefile b/Makefile
index 46d4657..95d2bb1 100644
--- a/Makefile
+++ b/Makefile
@@ -60,3 +60,37 @@ buildall:
mv build build-$$board; \
done
+#######################################################################
+# Development utilities
+lint lint-stable:
+ FAILED=0; LINTLOG=`mktemp .tmpconfig.lintXXXXX`; \
+ for script in util/lint/$@-*; do \
+ echo; echo `basename $$script`; \
+ grep "^# DESCR:" $$script | sed "s,.*DESCR: *,," ; \
+ echo ========; \
+ $$script > $$LINTLOG; \
+ if [ `cat $$LINTLOG | wc -l` -eq 0 ]; then \
+ printf "success\n\n"; \
+ else \
+ echo test failed: ; \
+ cat $$LINTLOG; \
+ rm -f $$LINTLOG; \
+ FAILED=$$(( $$FAILED + 1 )); \
+ fi; \
+ echo ========; \
+ done; \
+ test $$FAILED -eq 0 || { echo "ERROR: $$FAILED test(s) failed." && exit 1; }; \
+ rm -f $$LINTLOG
+
+gitconfig:
+ mkdir -p .git/hooks
+ for hook in commit-msg pre-commit ; do \
+ if [ util/gitconfig/$$hook -nt .git/hooks/$$hook -o \
+ ! -x .git/hooks/$$hook ]; then \
+ cp util/gitconfig/$$hook .git/hooks/$$hook; \
+ chmod +x .git/hooks/$$hook; \
+ fi; \
+ done
+ git config remote.origin.push HEAD:refs/for/master
+ (git config --global user.name >/dev/null && git config --global user.email >/dev/null) || (printf 'Please configure your name and email in git:\n\n git config --global user.name "Your Name Comes Here"\n git config --global user.email your.email(a)example.com\n'; exit 1)
+
diff --git a/util/gitconfig/commit-msg b/util/gitconfig/commit-msg
new file mode 100755
index 0000000..82f0581
--- /dev/null
+++ b/util/gitconfig/commit-msg
@@ -0,0 +1,173 @@
+#!/bin/sh
+#
+# Part of Gerrit Code Review (http://code.google.com/p/gerrit/ )
+#
+# Copyright (C) 2009 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+CHANGE_ID_AFTER="Bug|Issue"
+MSG="$1"
+
+# Check for, and add if missing, a unique Change-Id
+#
+add_ChangeId() {
+ clean_message=`sed -e '
+ /^diff --git a\/.*/{
+ s///
+ q
+ }
+ /^Signed-off-by:/d
+ /^#/d
+ ' "$MSG" | git stripspace`
+ if test -z "$clean_message"
+ then
+ return
+ fi
+
+ # Does Change-Id: already exist? if so, exit (no change).
+ if grep -i '^Change-Id: I[0-9a-f]\{40\}$' "$MSG" >/dev/null
+ then
+ return
+ fi
+
+ id=`_gen_ChangeId`
+ T="$MSG.tmp.$$"
+ AWK=awk
+ if [ -x /usr/xpg4/bin/awk ]; then
+ # Solaris AWK is just too broken
+ AWK=/usr/xpg4/bin/awk
+ fi
+
+ # How this works:
+ # - parse the commit message as (textLine+ blankLine*)*
+ # - assume textLine+ to be a footer until proven otherwise
+ # - exception: the first block is not footer (as it is the title)
+ # - read textLine+ into a variable
+ # - then count blankLines
+ # - once the next textLine appears, print textLine+ blankLine* as these
+ # aren't footer
+ # - in END, the last textLine+ block is available for footer parsing
+ $AWK '
+ BEGIN {
+ # while we start with the assumption that textLine+
+ # is a footer, the first block is not.
+ isFooter = 0
+ footerComment = 0
+ blankLines = 0
+ }
+
+ # Skip lines starting with "#" without any spaces before it.
+ /^#/ { next }
+
+ # Skip the line starting with the diff command and everything after it,
+ # up to the end of the file, assuming it is only patch data.
+ # If more than one line before the diff was empty, strip all but one.
+ /^diff --git a/ {
+ blankLines = 0
+ while (getline) { }
+ next
+ }
+
+ # Count blank lines outside footer comments
+ /^$/ && (footerComment == 0) {
+ blankLines++
+ next
+ }
+
+ # Catch footer comment
+ /^\[[a-zA-Z0-9-]+:/ && (isFooter == 1) {
+ footerComment = 1
+ }
+
+ /]$/ && (footerComment == 1) {
+ footerComment = 2
+ }
+
+ # We have a non-blank line after blank lines. Handle this.
+ (blankLines > 0) {
+ print lines
+ for (i = 0; i < blankLines; i++) {
+ print ""
+ }
+
+ lines = ""
+ blankLines = 0
+ isFooter = 1
+ footerComment = 0
+ }
+
+ # Detect that the current block is not the footer
+ (footerComment == 0) && (!/^\[?[a-zA-Z0-9-]+:/ || /^[a-zA-Z0-9-]+:\/\//) {
+ isFooter = 0
+ }
+
+ {
+ # We need this information about the current last comment line
+ if (footerComment == 2) {
+ footerComment = 0
+ }
+ if (lines != "") {
+ lines = lines "\n";
+ }
+ lines = lines $0
+ }
+
+ # Footer handling:
+ # If the last block is considered a footer, splice in the Change-Id at the
+ # right place.
+ # Look for the right place to inject Change-Id by considering
+ # CHANGE_ID_AFTER. Keys listed in it (case insensitive) come first,
+ # then Change-Id, then everything else (eg. Signed-off-by:).
+ #
+ # Otherwise just print the last block, a new line and the Change-Id as a
+ # block of its own.
+ END {
+ unprinted = 1
+ if (isFooter == 0) {
+ print lines "\n"
+ lines = ""
+ }
+ changeIdAfter = "^(" tolower("'"$CHANGE_ID_AFTER"'") "):"
+ numlines = split(lines, footer, "\n")
+ for (line = 1; line <= numlines; line++) {
+ if (unprinted && match(tolower(footer[line]), changeIdAfter) != 1) {
+ unprinted = 0
+ print "Change-Id: I'"$id"'"
+ }
+ print footer[line]
+ }
+ if (unprinted) {
+ print "Change-Id: I'"$id"'"
+ }
+ }' "$MSG" > $T && mv $T "$MSG" || rm -f $T
+}
+_gen_ChangeIdInput() {
+ echo "tree `git write-tree`"
+ if parent=`git rev-parse "HEAD^0" 2>/dev/null`
+ then
+ echo "parent $parent"
+ fi
+ echo "author `git var GIT_AUTHOR_IDENT`"
+ echo "committer `git var GIT_COMMITTER_IDENT`"
+ echo
+ printf '%s' "$clean_message"
+}
+_gen_ChangeId() {
+ _gen_ChangeIdInput |
+ git hash-object -t commit --stdin
+}
+
+
+add_ChangeId
diff --git a/util/gitconfig/pre-commit b/util/gitconfig/pre-commit
new file mode 100755
index 0000000..8ab3e56
--- /dev/null
+++ b/util/gitconfig/pre-commit
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec make lint-stable
diff --git a/util/lint/lint-000-license-headers b/util/lint/lint-000-license-headers
new file mode 100755
index 0000000..9165aa6
--- /dev/null
+++ b/util/lint/lint-000-license-headers
@@ -0,0 +1,35 @@
+#!/bin/sh
+# This file is part of the coreboot project.
+#
+# Copyright (C) 2010 coresystems GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
+#
+# DESCR: Check that all files in src/ and util/ have valid license headers
+
+LC_ALL=C export LC_ALL
+find SerialICE util -name .git -type d -prune -o \
+ -name README -prune -o \
+ -name LICENSE -prune -o \
+ -name TODO -prune -o \
+ -name COPYING -prune -o \
+ -name microcode-\*.h -prune -o \
+ -name \*.[18] -prune -o \
+ -name romcc -type d -prune -o \
+ -name crossgcc -type d -prune -o \
+ -name vendorcode -type d -prune -o \
+ -type f -exec \
+ grep -L "51 Franklin St, Fifth Floor, Boston" {} + | \
+ sed -e "s,^.*$,File & has no valid GPL header.,"
diff --git a/util/lint/lint-stable-003-whitespace b/util/lint/lint-stable-003-whitespace
new file mode 100755
index 0000000..c2f5b3c
--- /dev/null
+++ b/util/lint/lint-stable-003-whitespace
@@ -0,0 +1,44 @@
+#!/bin/sh
+# This file is part of the coreboot project.
+#
+# Copyright (C) 2011 Patrick Georgi <patrick(a)georgi-clan.de>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
+# DESCR: Check for superfluous whitespace in the tree
+
+LC_ALL=C export LC_ALL
+find SerialICE util -name .git -type d -prune -o \
+ -type f -perm /111 -prune -o \
+ -name README -prune -o \
+ -name LICENSE -prune -o \
+ -name TODO -prune -o \
+ -name COPYING -prune -o \
+ -name \*.patch -prune -o \
+ -name \*.diff -prune -o \
+ -name \*.txt -prune -o \
+ -name \*.exe -prune -o \
+ -name \*.o -prune -o \
+ -name microcode-\*.h -prune -o \
+ -name \*.?_shipped -prune -o \
+ -name \*.[18] -prune -o \
+ -name \*~ -prune -o \
+ -name kconfig -type d -prune -o \
+ -name romcc -type d -prune -o \
+ -name crossgcc -type d -prune -o \
+ -name vendorcode -type d -prune -o \
+ -type f -exec \
+ grep -l "[[:space:]][[:space:]]*$" {} + | \
+ sed -e "s,^.*$,File & has lines ending with whitespace.,"
+
Edward O'Callaghan (eocallaghan(a)alterapraxis.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/5214
-gerrit
commit 10238c6f0c7fca5903211c9ed10dff094753f9c1
Author: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
Date: Fri Feb 14 01:03:34 2014 +1100
SerialICE/mainboard: Add initial Jetway NF81-T56N-LF support.
Add support for Jetway NF81-T56N-LF mainboard and its Super I/O.
Change-Id: Idef372f1f2654a93dbd1023101fd0bb15fef32f8
Signed-off-by: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
---
SerialICE/Kconfig | 8 +++++-
SerialICE/mainboard/jetway_nf81_t56n_lf.c | 27 ++++++++++++++++++++
SerialICE/superio/fintek-f71869ad.c | 41 +++++++++++++++++++++++++++++++
3 files changed, 75 insertions(+), 1 deletion(-)
diff --git a/SerialICE/Kconfig b/SerialICE/Kconfig
index 00933b2..328950e 100644
--- a/SerialICE/Kconfig
+++ b/SerialICE/Kconfig
@@ -130,6 +130,10 @@ config BOARD_ASROCK_775I65G
config BOARD_COMMELL_LV_672
bool "Commell LV-672"
+config BOARD_JETWAY_NF81_T56N_LF
+ bool "Jetway NF81-T56N-LF"
+ select BUILD_XMMSTACK
+
endchoice
config BOARD_INIT
@@ -163,15 +167,17 @@ config BOARD_INIT
default "intel_d845gbv2.c" if BOARD_INTEL_D845GBV2
default "asrock_775i65g.c" if BOARD_ASROCK_775I65G
default "commell_lv_672.c" if BOARD_COMMELL_LV_672
+ default "jetway_nf81_t56n_lf.c" if BOARD_JETWAY_NF81_T56N_LF
config SOUTHBRIDGE_INIT
string
default "southbridge/intel-ich7.c" if BOARD_KONTRON_986LCD_M
- default "southbridge/amd-sbxxx.c" if BOARD_ASUS_F2A85_M
+ default "southbridge/amd-sbxxx.c" if BOARD_ASUS_F2A85_M || BOARD_JETWAY_NF81_T56N_LF
config SUPERIO_INIT
string
default "superio/winbond-w83627thg.c" if BOARD_KONTRON_986LCD_M
+ default "superio/fintek-f71869ad.c" if BOARD_JETWAY_NF81_T56N_LF
choice
prompt "ROM size"
diff --git a/SerialICE/mainboard/jetway_nf81_t56n_lf.c b/SerialICE/mainboard/jetway_nf81_t56n_lf.c
new file mode 100644
index 0000000..7b704a0
--- /dev/null
+++ b/SerialICE/mainboard/jetway_nf81_t56n_lf.c
@@ -0,0 +1,27 @@
+/*
+ * SerialICE
+ *
+ * Copyright (C) 2014 Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+const char boardname[33]="Jetway NF81-T56N-LF ";
+
+static void chipset_init(void)
+{
+ southbridge_init();
+ sbxxx_enable_48mhzout();
+ superio_init();
+}
diff --git a/SerialICE/superio/fintek-f71869ad.c b/SerialICE/superio/fintek-f71869ad.c
new file mode 100644
index 0000000..c04389b
--- /dev/null
+++ b/SerialICE/superio/fintek-f71869ad.c
@@ -0,0 +1,41 @@
+/*
+ * SerialICE
+ *
+ * Copyright (C) 2014 Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#define SUPERIO_CONFIG_PORT 0x2e
+#define UART_IO_PORT 0x3F8
+#define UART_IRQ_ADDR 4
+
+static void superio_init(void)
+{
+ u8 byte;
+ pnp_enter_ext_func_mode_ite(SUPERIO_CONFIG_PORT);
+
+ /* Disable the watchdog. */
+ pnp_set_logical_device(SUPERIO_CONFIG_PORT, 7);
+ pnp_write_register(SUPERIO_CONFIG_PORT, 0x72, 0x00);
+
+ /* Enable the serial port. */
+ pnp_set_logical_device(SUPERIO_CONFIG_PORT, 1); /* COM1 */
+ pnp_set_enable(SUPERIO_CONFIG_PORT, 0);
+ pnp_set_iobase0(SUPERIO_CONFIG_PORT, UART_IO_PORT);
+ pnp_set_irq0(SUPERIO_CONFIG_PORT, UART_IRQ_ADDR);
+ pnp_set_enable(SUPERIO_CONFIG_PORT, 1);
+
+ pnp_exit_ext_func_mode_ite(SUPERIO_CONFIG_PORT);
+}
Edward O'Callaghan (eocallaghan(a)alterapraxis.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/5221
-gerrit
commit 0ef9b86c83b54bad345254b3bb0ff3047e1da12f
Author: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
Date: Fri Feb 14 19:30:38 2014 +1100
SerialICE: Remove superfluous whitespace in the tree.
Change-Id: I14cf959ff4601ede921b8086e460fc36bb40bc4f
Signed-off-by: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
---
SerialICE/Makefile | 6 +-
SerialICE/README.GDB | 12 +-
SerialICE/README.SHELL | 5 +-
SerialICE/chipset.c | 2 +-
SerialICE/io.h | 2 +-
SerialICE/mainboard/amd_serengeti-cheetah.c | 2 +-
SerialICE/mainboard/asrock_939a785gmh.c | 2 +-
SerialICE/mainboard/asus_k8v-x.c | 2 +-
SerialICE/mainboard/asus_m2v-mx_se.c | 2 +-
SerialICE/mainboard/asus_m4a77td-pro.c | 6 +-
SerialICE/mainboard/asus_p2b.c | 2 +-
SerialICE/mainboard/dell_s1850.c | 10 +-
SerialICE/mainboard/hp_dl165_g6.c | 2 +-
SerialICE/mainboard/intel_d94x.c | 2 +-
SerialICE/mainboard/kontron_986lcd-m.c | 2 +-
SerialICE/mainboard/msi_ms6178.c | 2 +-
SerialICE/mainboard/rca_rm4100.c | 4 +-
SerialICE/mainboard/roda_rk886ex.c | 2 +-
SerialICE/mainboard/televideo_tc7010.c | 2 +-
SerialICE/mainboard/thomson_ip1000.c | 2 +-
SerialICE/mainboard/tyan_s2912.c | 2 +-
SerialICE/mainboard/wyse_s50.c | 4 +-
SerialICE/serial.c | 6 +-
SerialICE/serialice.c | 4 +-
SerialICE/serialice.h | 2 +-
SerialICE/serialice.ld | 2 +-
SerialICE/simba/replay.lua | 4 +-
SerialICE/start.S | 2 +-
SerialICE/types.h | 2 +-
SerialICE/util/kconfig/lex.zconf.c_shipped | 82 +-
SerialICE/util/kconfig/lxdialog/BIG.FAT.WARNING | 2 +-
SerialICE/util/kconfig/lxdialog/menubox.c | 2 +-
SerialICE/util/kconfig/regex.c | 556 ++++-----
SerialICE/util/kconfig/regex.h | 22 +-
SerialICE/util/kconfig/zconf.tab.c_shipped | 2 +-
SerialICE/util/romcc.c | 1396 +++++++++++------------
SerialICE/util/xmmstack.c | 14 +-
37 files changed, 1085 insertions(+), 1090 deletions(-)
diff --git a/SerialICE/Makefile b/SerialICE/Makefile
index f4a7580..e764992 100644
--- a/SerialICE/Makefile
+++ b/SerialICE/Makefile
@@ -1,5 +1,5 @@
##
-## SerialICE
+## SerialICE
##
## Copyright (C) 2009 coresystems GmbH
##
@@ -116,7 +116,7 @@ $(obj)/serialice.rom: $(obj)/serialice.elf
$(obj)/serialice.elf: $(obj)/serialice.o $(obj)/start.o $(src)/serialice.ld
$(Q)printf " LINK $(subst $(shell pwd)/,,$(@))\n"
- $(Q)$(CC) $(LDFLAGS) -o $@ $(obj)/serialice.o $(obj)/start.o
+ $(Q)$(CC) $(LDFLAGS) -o $@ $(obj)/serialice.o $(obj)/start.o
$(Q)$(NM) $@ | sort -u > $(obj)/serialice.map
$(obj)/serialice.S: $(SOURCES) $(obj)/romcc
@@ -143,7 +143,7 @@ $(obj)/serialice-gcc.rom: $(obj)/serialice-gcc.elf
$(obj)/serialice-gcc.elf: $(obj)/serialice-gcc.o $(obj)/start.o serialice.ld
$(Q)printf " LINK $(subst $(shell pwd)/,,$(@))\n"
- $(Q)$(CC) $(LDFLAGS) -o $@ $(obj)/serialice-gcc.o $(obj)/start.o
+ $(Q)$(CC) $(LDFLAGS) -o $@ $(obj)/serialice-gcc.o $(obj)/start.o
$(Q)$(NM) $@ | sort -u > $(obj)/serialice-gcc.map
$(obj)/serialice-pre.s: $(SOURCES) $(obj)/xmmstack
diff --git a/SerialICE/README.GDB b/SerialICE/README.GDB
index d842a05..3498a7a 100644
--- a/SerialICE/README.GDB
+++ b/SerialICE/README.GDB
@@ -52,9 +52,9 @@ To disassemble code at the current position, you can do this:
0xec23c: loop 0xec226
0xec23e: mov %bh,%al
0xec240: out %al,$0x61
-0xec242: ret
+0xec242: ret
0xec243: lcall $0xe5db,$0x1ac0
-(gdb)
+(gdb)
Now for the fun part:
@@ -78,7 +78,7 @@ ds 0x1838 6200
es 0x0 0
fs 0xe5db 58843
gs 0xe895 59541
-(gdb)
+(gdb)
Or, with a little bit of context:
(gdb) x/20i ($cs*16)+$eip - 0x10
@@ -88,7 +88,7 @@ Of course you can also change registers:
(gdb) set var $ecx=0x20
(gdb) print $ecx
$1 = 32
-(gdb)
+(gdb)
This is an excellent method to skip long loops.
@@ -101,12 +101,12 @@ Go back to the GDB shell at any time with CTRL-C
^C
Program received signal SIGINT, Interrupt.
0x000038d6 in ?? ()
-(gdb)
+(gdb)
(gdb) display /i ($cs * 16) + $pc
-That will output the current instruction each time you call nexti, stepi, etc.
+That will output the current instruction each time you call nexti, stepi, etc.
It's possible to trace execution with
diff --git a/SerialICE/README.SHELL b/SerialICE/README.SHELL
index 12fe7cd..909aa2b 100644
--- a/SerialICE/README.SHELL
+++ b/SerialICE/README.SHELL
@@ -13,7 +13,7 @@ meant to be used together with a SerialICE capable Qemu (See README.QEMU)
GETTING STARTED
---------------
-First, you have to compile the SerialICE shell for your mainboard.
+First, you have to compile the SerialICE shell for your mainboard.
Configure the SerialICE shell for your mainboard:
$ make menuconfig
@@ -30,7 +30,7 @@ LICENSE AND COPYRIGHT
---------------------
SerialICE mini shell is copyright (C) 2009 coresystems GmbH.
-It is released under the GNU General Public License version 2.
+It is released under the GNU General Public License version 2.
For questions contact <info(a)coresystems.de>
PORTING THE SHELL TO NEW MAINBOARDS
@@ -145,4 +145,3 @@ character command code.
SerialICE v1.5 (Nov 26 2009)
>
-
diff --git a/SerialICE/chipset.c b/SerialICE/chipset.c
index 8ab4515..c9f75ab 100644
--- a/SerialICE/chipset.c
+++ b/SerialICE/chipset.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 coresystems GmbH
*
diff --git a/SerialICE/io.h b/SerialICE/io.h
index a47feef..30accc2 100644
--- a/SerialICE/io.h
+++ b/SerialICE/io.h
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 coresystems GmbH
*
diff --git a/SerialICE/mainboard/amd_serengeti-cheetah.c b/SerialICE/mainboard/amd_serengeti-cheetah.c
index 78505ad..3179b62 100644
--- a/SerialICE/mainboard/amd_serengeti-cheetah.c
+++ b/SerialICE/mainboard/amd_serengeti-cheetah.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 Uwe Hermann <uwe(a)hermann-uwe.de>
* Copyright (C) 2010 Arne Georg Gleditsch <arne.gleditsch(a)numascale.com>
diff --git a/SerialICE/mainboard/asrock_939a785gmh.c b/SerialICE/mainboard/asrock_939a785gmh.c
index 6f8c9be..5c5b588 100644
--- a/SerialICE/mainboard/asrock_939a785gmh.c
+++ b/SerialICE/mainboard/asrock_939a785gmh.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2006 Uwe Hermann <uwe(a)hermann-uwe.de>
* Copyright (C) 2009 Rudolf Marek <r.marek(a)assembler.cz>
diff --git a/SerialICE/mainboard/asus_k8v-x.c b/SerialICE/mainboard/asus_k8v-x.c
index bc3dbe9..68ad177 100644
--- a/SerialICE/mainboard/asus_k8v-x.c
+++ b/SerialICE/mainboard/asus_k8v-x.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2006 Uwe Hermann <uwe(a)hermann-uwe.de>
* Copyright (C) 2009 Rudolf Marek <r.marek(a)assembler.cz>
diff --git a/SerialICE/mainboard/asus_m2v-mx_se.c b/SerialICE/mainboard/asus_m2v-mx_se.c
index cd694fd..06a8ec9 100644
--- a/SerialICE/mainboard/asus_m2v-mx_se.c
+++ b/SerialICE/mainboard/asus_m2v-mx_se.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2006 Uwe Hermann <uwe(a)hermann-uwe.de>
* Copyright (C) 2009 Rudolf Marek <r.marek(a)assembler.cz>
diff --git a/SerialICE/mainboard/asus_m4a77td-pro.c b/SerialICE/mainboard/asus_m4a77td-pro.c
index 6b91f80..3bc15a5 100644
--- a/SerialICE/mainboard/asus_m4a77td-pro.c
+++ b/SerialICE/mainboard/asus_m4a77td-pro.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2006 Uwe Hermann <uwe(a)hermann-uwe.de>
* Copyright (C) 2010 Rudolf Marek <r.marek(a)assembler.cz>
@@ -44,8 +44,8 @@ static void superio_init(void)
static void chipset_init(void)
{
/* stop the mainboard from rebooting */
- /* inspired by coreboot, src/southbridge/amd/sb700/sb700_early_init.c,
- * sb700_lpc_init(), where the comment says:
+ /* inspired by coreboot, src/southbridge/amd/sb700/sb700_early_init.c,
+ * sb700_lpc_init(), where the comment says:
* NOTE: Set BootTimerDisable, otherwise it would keep rebooting!!
* This bit has no meaning if debug strap is not enabled. So if the
* board keeps rebooting and the code fails to reach here, we could
diff --git a/SerialICE/mainboard/asus_p2b.c b/SerialICE/mainboard/asus_p2b.c
index c93045a..068229a 100644
--- a/SerialICE/mainboard/asus_p2b.c
+++ b/SerialICE/mainboard/asus_p2b.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 Mark Marshall <mark.marshall(a)csr.com>
*
diff --git a/SerialICE/mainboard/dell_s1850.c b/SerialICE/mainboard/dell_s1850.c
index b970650..861479f 100644
--- a/SerialICE/mainboard/dell_s1850.c
+++ b/SerialICE/mainboard/dell_s1850.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 coresystems GmbH
*
@@ -32,8 +32,8 @@ static void mainboard_set_ich5(void)
pci_write_config8(PCI_ADDR(0, 0x1f, 0, 0xe3), 0xc0);
pci_write_config8(PCI_ADDR(0, 0x1f, 0, 0xf0), 0x0);
/* disable certain devices -- see data sheet -- this is from
- * dell settings via lspci
- * Note that they leave SMBUS disabled -- 8f6f.
+ * dell settings via lspci
+ * Note that they leave SMBUS disabled -- 8f6f.
* we leave it enabled and visible in config space -- 8f66
*/
pci_write_config16(PCI_ADDR(0, 0x1f, 0, 0xf2), 0x8f66);
@@ -54,7 +54,7 @@ static void mainboard_set_ich5(void)
static inline void ibfzero(void)
{
- while(inb(ipmicsr) & IBF)
+ while(inb(ipmicsr) & IBF)
;
}
static inline void clearobf(void)
@@ -64,7 +64,7 @@ static inline void clearobf(void)
static inline void waitobf(void)
{
- while((inb(ipmicsr) & OBF) == 0)
+ while((inb(ipmicsr) & OBF) == 0)
;
}
diff --git a/SerialICE/mainboard/hp_dl165_g6.c b/SerialICE/mainboard/hp_dl165_g6.c
index 3301ad5..6aff1e9 100644
--- a/SerialICE/mainboard/hp_dl165_g6.c
+++ b/SerialICE/mainboard/hp_dl165_g6.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 Uwe Hermann <uwe(a)hermann-uwe.de>
* Copyright (C) 2010 Arne Georg Gleditsch <arne.gleditsch(a)numascale.com>
diff --git a/SerialICE/mainboard/intel_d94x.c b/SerialICE/mainboard/intel_d94x.c
index 02eb701..50bbe87 100644
--- a/SerialICE/mainboard/intel_d94x.c
+++ b/SerialICE/mainboard/intel_d94x.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 coresystems GmbH
*
diff --git a/SerialICE/mainboard/kontron_986lcd-m.c b/SerialICE/mainboard/kontron_986lcd-m.c
index 62d8c46..abde14f 100644
--- a/SerialICE/mainboard/kontron_986lcd-m.c
+++ b/SerialICE/mainboard/kontron_986lcd-m.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 coresystems GmbH
*
diff --git a/SerialICE/mainboard/msi_ms6178.c b/SerialICE/mainboard/msi_ms6178.c
index f0a505a..a4edb5a 100644
--- a/SerialICE/mainboard/msi_ms6178.c
+++ b/SerialICE/mainboard/msi_ms6178.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 Uwe Hermann <uwe(a)hermann-uwe.de>
*
diff --git a/SerialICE/mainboard/rca_rm4100.c b/SerialICE/mainboard/rca_rm4100.c
index 81ff089..bd4aa02 100644
--- a/SerialICE/mainboard/rca_rm4100.c
+++ b/SerialICE/mainboard/rca_rm4100.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 Joseph Smith <joe(a)settoplinux.org>
*
@@ -18,7 +18,7 @@
*/
/* This is a chipset init file for the RCA RM4100 mainboard */
-
+
const char boardname[33]="RCA RM4100 ";
/* Hardware specific functions */
diff --git a/SerialICE/mainboard/roda_rk886ex.c b/SerialICE/mainboard/roda_rk886ex.c
index 048f30d..b93b5c0 100644
--- a/SerialICE/mainboard/roda_rk886ex.c
+++ b/SerialICE/mainboard/roda_rk886ex.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 coresystems GmbH
*
diff --git a/SerialICE/mainboard/televideo_tc7010.c b/SerialICE/mainboard/televideo_tc7010.c
index 9c79e05..b22df9a 100644
--- a/SerialICE/mainboard/televideo_tc7010.c
+++ b/SerialICE/mainboard/televideo_tc7010.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2010 Peter Bannis
*
diff --git a/SerialICE/mainboard/thomson_ip1000.c b/SerialICE/mainboard/thomson_ip1000.c
index d558e42..ff20930 100644
--- a/SerialICE/mainboard/thomson_ip1000.c
+++ b/SerialICE/mainboard/thomson_ip1000.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 Joseph Smith <joe(a)settoplinux.org>
*
diff --git a/SerialICE/mainboard/tyan_s2912.c b/SerialICE/mainboard/tyan_s2912.c
index ad7184a..5afbc62 100644
--- a/SerialICE/mainboard/tyan_s2912.c
+++ b/SerialICE/mainboard/tyan_s2912.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 Uwe Hermann <uwe(a)hermann-uwe.de>
* Copyright (C) 2010 Arne Georg Gleditsch <arne.gleditsch(a)numascale.com>
diff --git a/SerialICE/mainboard/wyse_s50.c b/SerialICE/mainboard/wyse_s50.c
index d23d5a9..57a54c5 100644
--- a/SerialICE/mainboard/wyse_s50.c
+++ b/SerialICE/mainboard/wyse_s50.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2011 Nils Jacobs
*
@@ -117,4 +117,4 @@ cs5536_setup_extmsr();
cs5536_setup_iobase();
serial_init();
}
-
+
diff --git a/SerialICE/serial.c b/SerialICE/serial.c
index b5b0778..9188deb 100644
--- a/SerialICE/serial.c
+++ b/SerialICE/serial.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 coresystems GmbH
*
@@ -104,7 +104,7 @@ static void sio_put8(u8 data)
{
int i;
u8 c;
-
+
c = (data >> 4) & 0xf;
sio_put_nibble(c);
@@ -193,5 +193,3 @@ static u32 sio_get32(void)
return data;
}
-
-
diff --git a/SerialICE/serialice.c b/SerialICE/serialice.c
index 649ee11..56f6dac 100644
--- a/SerialICE/serialice.c
+++ b/SerialICE/serialice.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 coresystems GmbH
*
@@ -168,7 +168,7 @@ static void serialice_cpuinfo(void)
/* This code looks quite crappy but this way we don't
* have to worry about running out of registers if we
- * occupy eax, ebx, ecx, edx at the same time
+ * occupy eax, ebx, ecx, edx at the same time
*/
reg32 = cpuid_eax(eax, ecx);
sio_put32(reg32);
diff --git a/SerialICE/serialice.h b/SerialICE/serialice.h
index 40dae1c..ab8a26a 100644
--- a/SerialICE/serialice.h
+++ b/SerialICE/serialice.h
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 coresystems GmbH
*
diff --git a/SerialICE/serialice.ld b/SerialICE/serialice.ld
index 163a4c5..f43d9f2 100644
--- a/SerialICE/serialice.ld
+++ b/SerialICE/serialice.ld
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 coresystems GmbH
*
diff --git a/SerialICE/simba/replay.lua b/SerialICE/simba/replay.lua
index 4632c05..8ec3b0a 100644
--- a/SerialICE/simba/replay.lua
+++ b/SerialICE/simba/replay.lua
@@ -121,7 +121,7 @@ end
function parse_cpuid(line)
local id_op = "CPUID%: eax%: (%x+)%; ecx%: (%x+) => (%x+).(%x+).(%x+).(%x+)"
local id_op_old = "CPU%: CPUID eax%: (%x+)%; ecx%: (%x+) => (%x+).(%x+).(%x+).(%x+)"
- local found, idx0, idx1, eax, ebx, ecx, edx
+ local found, idx0, idx1, eax, ebx, ecx, edx
found, _, idx0, idx1, eax, ebx, ecx, edx = string.find(line, id_op)
if not found then
found, _, idx0, idx1, eax, ebx, ecx, edx = string.find(line, id_op_old)
@@ -196,7 +196,7 @@ function parse_file()
end
if not iplog then
- iplog, _, a, b, f, cs, eip, str =
+ iplog, _, a, b, f, cs, eip, str =
string.find(line, "(%x+)[%.:](%x+)%s+([^ ]*)%s+%[(%x+):(%x+)%]...(.*)")
if iplog and not f then
f = "R###"
diff --git a/SerialICE/start.S b/SerialICE/start.S
index 1e43f98..2ec0bb3 100644
--- a/SerialICE/start.S
+++ b/SerialICE/start.S
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 coresystems GmbH
*
diff --git a/SerialICE/types.h b/SerialICE/types.h
index a712b09..7ddeafa 100644
--- a/SerialICE/types.h
+++ b/SerialICE/types.h
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 coresystems GmbH
*
diff --git a/SerialICE/util/kconfig/lex.zconf.c_shipped b/SerialICE/util/kconfig/lex.zconf.c_shipped
index 1911092..a22db46 100644
--- a/SerialICE/util/kconfig/lex.zconf.c_shipped
+++ b/SerialICE/util/kconfig/lex.zconf.c_shipped
@@ -52,7 +52,7 @@
#if __STDC_VERSION__ >= 199901L
/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
- * if you want the limit (max/min) macros for int types.
+ * if you want the limit (max/min) macros for int types.
*/
#ifndef __STDC_LIMIT_MACROS
#define __STDC_LIMIT_MACROS 1
@@ -69,7 +69,7 @@ typedef uint32_t flex_uint32_t;
typedef signed char flex_int8_t;
typedef short int flex_int16_t;
typedef int flex_int32_t;
-typedef unsigned char flex_uint8_t;
+typedef unsigned char flex_uint8_t;
typedef unsigned short int flex_uint16_t;
typedef unsigned int flex_uint32_t;
#endif /* ! C99 */
@@ -179,7 +179,7 @@ extern FILE *zconfin, *zconfout;
#define EOB_ACT_LAST_MATCH 2
#define YY_LESS_LINENO(n)
-
+
/* Return all but the first "n" matched characters back to the input stream. */
#define yyless(n) \
do \
@@ -246,7 +246,7 @@ struct yy_buffer_state
int yy_bs_lineno; /**< The line count. */
int yy_bs_column; /**< The column count. */
-
+
/* Whether to try to fill the input buffer when we reach the
* end of it.
*/
@@ -866,7 +866,7 @@ extern int zconfwrap (void );
#endif
static void yyunput (int c,char *buf_ptr );
-
+
#ifndef yytext_ptr
static void yy_flex_strncpy (char *,yyconst char *,int );
#endif
@@ -971,7 +971,7 @@ YY_DECL
register yy_state_type yy_current_state;
register char *yy_cp, *yy_bp;
register int yy_act;
-
+
int str = 0;
int ts, i;
@@ -1574,7 +1574,7 @@ static int yy_get_next_buffer (void)
{
register yy_state_type yy_current_state;
register char *yy_cp;
-
+
yy_current_state = (yy_start);
for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
@@ -1593,7 +1593,7 @@ static int yy_get_next_buffer (void)
static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
{
register int yy_is_jam;
-
+
yy_current_state = yy_nxt[yy_current_state][1];
yy_is_jam = (yy_current_state <= 0);
@@ -1603,7 +1603,7 @@ static int yy_get_next_buffer (void)
static void yyunput (int c, register char * yy_bp )
{
register char *yy_cp;
-
+
yy_cp = (yy_c_buf_p);
/* undo effects of setting up zconftext */
@@ -1646,7 +1646,7 @@ static int yy_get_next_buffer (void)
{
int c;
-
+
*(yy_c_buf_p) = (yy_hold_char);
if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
@@ -1713,12 +1713,12 @@ static int yy_get_next_buffer (void)
/** Immediately switch to a different input stream.
* @param input_file A readable stream.
- *
+ *
* @note This function does not reset the start condition to @c INITIAL .
*/
void zconfrestart (FILE * input_file )
{
-
+
if ( ! YY_CURRENT_BUFFER ){
zconfensure_buffer_stack ();
YY_CURRENT_BUFFER_LVALUE =
@@ -1731,11 +1731,11 @@ static int yy_get_next_buffer (void)
/** Switch to a different input buffer.
* @param new_buffer The new input buffer.
- *
+ *
*/
void zconf_switch_to_buffer (YY_BUFFER_STATE new_buffer )
{
-
+
/* TODO. We should be able to replace this entire function body
* with
* zconfpop_buffer_state();
@@ -1775,13 +1775,13 @@ static void zconf_load_buffer_state (void)
/** Allocate and initialize an input buffer state.
* @param file A readable stream.
* @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
- *
+ *
* @return the allocated buffer state.
*/
YY_BUFFER_STATE zconf_create_buffer (FILE * file, int size )
{
YY_BUFFER_STATE b;
-
+
b = (YY_BUFFER_STATE) zconfalloc(sizeof( struct yy_buffer_state ) );
if ( ! b )
YY_FATAL_ERROR( "out of dynamic memory in zconf_create_buffer()" );
@@ -1804,11 +1804,11 @@ static void zconf_load_buffer_state (void)
/** Destroy the buffer.
* @param b a buffer created with zconf_create_buffer()
- *
+ *
*/
void zconf_delete_buffer (YY_BUFFER_STATE b )
{
-
+
if ( ! b )
return;
@@ -1829,7 +1829,7 @@ static void zconf_load_buffer_state (void)
{
int oerrno = errno;
-
+
zconf_flush_buffer(b );
b->yy_input_file = file;
@@ -1845,13 +1845,13 @@ static void zconf_load_buffer_state (void)
}
b->yy_is_interactive = 0;
-
+
errno = oerrno;
}
/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
* @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
- *
+ *
*/
void zconf_flush_buffer (YY_BUFFER_STATE b )
{
@@ -1880,7 +1880,7 @@ static void zconf_load_buffer_state (void)
* the current state. This function will allocate the stack
* if necessary.
* @param new_buffer The new state.
- *
+ *
*/
void zconfpush_buffer_state (YY_BUFFER_STATE new_buffer )
{
@@ -1910,7 +1910,7 @@ void zconfpush_buffer_state (YY_BUFFER_STATE new_buffer )
/** Removes and deletes the top of the stack, if present.
* The next element becomes the new top.
- *
+ *
*/
void zconfpop_buffer_state (void)
{
@@ -1934,7 +1934,7 @@ void zconfpop_buffer_state (void)
static void zconfensure_buffer_stack (void)
{
int num_to_alloc;
-
+
if (!(yy_buffer_stack)) {
/* First allocation is just for 2 elements, since we don't know if this
@@ -1973,13 +1973,13 @@ static void zconfensure_buffer_stack (void)
/** Setup the input buffer state to scan directly from a user-specified character buffer.
* @param base the character buffer
* @param size the size in bytes of the character buffer
- *
- * @return the newly allocated buffer state object.
+ *
+ * @return the newly allocated buffer state object.
*/
YY_BUFFER_STATE zconf_scan_buffer (char * base, yy_size_t size )
{
YY_BUFFER_STATE b;
-
+
if ( size < 2 ||
base[size-2] != YY_END_OF_BUFFER_CHAR ||
base[size-1] != YY_END_OF_BUFFER_CHAR )
@@ -2008,14 +2008,14 @@ YY_BUFFER_STATE zconf_scan_buffer (char * base, yy_size_t size )
/** Setup the input buffer state to scan a string. The next call to zconflex() will
* scan from a @e copy of @a str.
* @param str a NUL-terminated string to scan
- *
+ *
* @return the newly allocated buffer state object.
* @note If you want to scan bytes that may contain NUL values, then use
* zconf_scan_bytes() instead.
*/
YY_BUFFER_STATE zconf_scan_string (yyconst char * yystr )
{
-
+
return zconf_scan_bytes(yystr,strlen(yystr) );
}
@@ -2023,7 +2023,7 @@ YY_BUFFER_STATE zconf_scan_string (yyconst char * yystr )
* scan from a @e copy of @a bytes.
* @param bytes the byte buffer to scan
* @param len the number of bytes in the buffer pointed to by @a bytes.
- *
+ *
* @return the newly allocated buffer state object.
*/
YY_BUFFER_STATE zconf_scan_bytes (yyconst char * yybytes, int _yybytes_len )
@@ -2032,7 +2032,7 @@ YY_BUFFER_STATE zconf_scan_bytes (yyconst char * yybytes, int _yybytes_len )
char *buf;
yy_size_t n;
int i;
-
+
/* Get memory for full buffer, including space for trailing EOB's. */
n = _yybytes_len + 2;
buf = (char *) zconfalloc(n );
@@ -2086,16 +2086,16 @@ static void yy_fatal_error (yyconst char* msg )
/* Accessor methods (get/set functions) to struct members. */
/** Get the current line number.
- *
+ *
*/
int zconfget_lineno (void)
{
-
+
return zconflineno;
}
/** Get the input stream.
- *
+ *
*/
FILE *zconfget_in (void)
{
@@ -2103,7 +2103,7 @@ FILE *zconfget_in (void)
}
/** Get the output stream.
- *
+ *
*/
FILE *zconfget_out (void)
{
@@ -2111,7 +2111,7 @@ FILE *zconfget_out (void)
}
/** Get the length of the current token.
- *
+ *
*/
int zconfget_leng (void)
{
@@ -2119,7 +2119,7 @@ int zconfget_leng (void)
}
/** Get the current token.
- *
+ *
*/
char *zconfget_text (void)
@@ -2129,18 +2129,18 @@ char *zconfget_text (void)
/** Set the current line number.
* @param line_number
- *
+ *
*/
void zconfset_lineno (int line_number )
{
-
+
zconflineno = line_number;
}
/** Set the input stream. This does not discard the current
* input buffer.
* @param in_str A readable stream.
- *
+ *
* @see zconf_switch_to_buffer
*/
void zconfset_in (FILE * in_str )
@@ -2194,7 +2194,7 @@ static int yy_init_globals (void)
/* zconflex_destroy is for both reentrant and non-reentrant scanners. */
int zconflex_destroy (void)
{
-
+
/* Pop the buffer stack, destroying each element. */
while(YY_CURRENT_BUFFER){
zconf_delete_buffer(YY_CURRENT_BUFFER );
diff --git a/SerialICE/util/kconfig/lxdialog/BIG.FAT.WARNING b/SerialICE/util/kconfig/lxdialog/BIG.FAT.WARNING
index a8999d8..7cb5a7e 100644
--- a/SerialICE/util/kconfig/lxdialog/BIG.FAT.WARNING
+++ b/SerialICE/util/kconfig/lxdialog/BIG.FAT.WARNING
@@ -1,4 +1,4 @@
This is NOT the official version of dialog. This version has been
significantly modified from the original. It is for use by the Linux
-kernel configuration script. Please do not bother Savio Lam with
+kernel configuration script. Please do not bother Savio Lam with
questions about this program.
diff --git a/SerialICE/util/kconfig/lxdialog/menubox.c b/SerialICE/util/kconfig/lxdialog/menubox.c
index fa9d633..c689fc0 100644
--- a/SerialICE/util/kconfig/lxdialog/menubox.c
+++ b/SerialICE/util/kconfig/lxdialog/menubox.c
@@ -26,7 +26,7 @@
*
* *) A bugfix for the Page-Down problem
*
- * *) Formerly when I used Page Down and Page Up, the cursor would be set
+ * *) Formerly when I used Page Down and Page Up, the cursor would be set
* to the first position in the menu box. Now lxdialog is a bit
* smarter and works more like other menu systems (just have a look at
* it).
diff --git a/SerialICE/util/kconfig/regex.c b/SerialICE/util/kconfig/regex.c
index 8169880..e63c814 100644
--- a/SerialICE/util/kconfig/regex.c
+++ b/SerialICE/util/kconfig/regex.c
@@ -75,7 +75,7 @@ char *realloc ();
/* This must be nonzero for the wordchar and notwordchar pattern
commands in re_match_2. */
-#ifndef Sword
+#ifndef Sword
#define Sword 1
#endif
@@ -173,8 +173,8 @@ init_syntax_once ()
use `alloca' instead of `malloc'. This is because using malloc in
re_search* or re_match* could cause memory leaks when C-g is used in
Emacs; also, malloc is slower and causes storage fragmentation. On
- the other hand, malloc is more portable, and easier to debug.
-
+ the other hand, malloc is more portable, and easier to debug.
+
Because we sometimes use alloca, some routines have to be macros,
not functions -- `alloca'-allocated space disappears at the end of the
function it is called in. */
@@ -199,7 +199,7 @@ init_syntax_once ()
#ifndef _AIX /* Already did AIX, up at the top. */
char *alloca ();
#endif /* not _AIX */
-#endif /* not HAVE_ALLOCA_H */
+#endif /* not HAVE_ALLOCA_H */
#endif /* not __GNUC__ */
#endif /* not alloca */
@@ -302,9 +302,9 @@ typedef enum
/* Analogously, for end of buffer/string. */
endbuf,
-
+
/* Followed by two byte relative address to which to jump. */
- jump,
+ jump,
/* Same as jump, but marks the end of an alternative. */
jump_past_alt,
@@ -312,11 +312,11 @@ typedef enum
/* Followed by two-byte relative address of place to resume at
in case of failure. */
on_failure_jump,
-
+
/* Like on_failure_jump, but pushes a placeholder instead of the
current string position when executed. */
on_failure_keep_string_jump,
-
+
/* Throw away latest failure point and then jump to following
two-byte relative address. */
pop_failure_jump,
@@ -412,7 +412,7 @@ extract_number (dest, source)
int *dest;
unsigned char *source;
{
- int temp = SIGN_EXTEND_CHAR (*(source + 1));
+ int temp = SIGN_EXTEND_CHAR (*(source + 1));
*dest = *source & 0377;
*dest += temp << 8;
}
@@ -438,7 +438,7 @@ static void
extract_number_and_incr (destination, source)
int *destination;
unsigned char **source;
-{
+{
extract_number (destination, *source);
*source += 2;
}
@@ -487,8 +487,8 @@ print_fastmap (fastmap)
char *fastmap;
{
unsigned was_a_range = 0;
- unsigned i = 0;
-
+ unsigned i = 0;
+
while (i < (1 << BYTEWIDTH))
{
if (fastmap[i++])
@@ -507,7 +507,7 @@ print_fastmap (fastmap)
}
}
}
- putchar ('\n');
+ putchar ('\n');
}
@@ -528,7 +528,7 @@ print_partial_compiled_pattern (start, end)
printf ("(null)\n");
return;
}
-
+
/* Loop over pattern commands. */
while (p < pend)
{
@@ -574,14 +574,14 @@ print_partial_compiled_pattern (start, end)
printf ("/charset%s",
(re_opcode_t) *(p - 1) == charset_not ? "_not" : "");
-
+
assert (p + *p < pend);
for (c = 0; c < *p; c++)
{
unsigned bit;
unsigned char map_byte = p[1 + c];
-
+
putchar ('/');
for (bit = 0; bit < BYTEWIDTH; bit++)
@@ -618,7 +618,7 @@ print_partial_compiled_pattern (start, end)
case push_dummy_failure:
printf ("/push_dummy_failure");
break;
-
+
case maybe_pop_jump:
extract_number_and_incr (&mcnt, &p);
printf ("/maybe_pop_jump/0/%d", mcnt);
@@ -627,36 +627,36 @@ print_partial_compiled_pattern (start, end)
case pop_failure_jump:
extract_number_and_incr (&mcnt, &p);
printf ("/pop_failure_jump/0/%d", mcnt);
- break;
-
+ break;
+
case jump_past_alt:
extract_number_and_incr (&mcnt, &p);
printf ("/jump_past_alt/0/%d", mcnt);
- break;
-
+ break;
+
case jump:
extract_number_and_incr (&mcnt, &p);
printf ("/jump/0/%d", mcnt);
break;
- case succeed_n:
+ case succeed_n:
extract_number_and_incr (&mcnt, &p);
extract_number_and_incr (&mcnt2, &p);
printf ("/succeed_n/0/%d/0/%d", mcnt, mcnt2);
break;
-
- case jump_n:
+
+ case jump_n:
extract_number_and_incr (&mcnt, &p);
extract_number_and_incr (&mcnt2, &p);
printf ("/jump_n/0/%d/0/%d", mcnt, mcnt2);
break;
-
- case set_number_at:
+
+ case set_number_at:
extract_number_and_incr (&mcnt, &p);
extract_number_and_incr (&mcnt2, &p);
printf ("/set_number_at/0/%d/0/%d", mcnt, mcnt2);
break;
-
+
case wordbound:
printf ("/wordbound");
break;
@@ -668,10 +668,10 @@ print_partial_compiled_pattern (start, end)
case wordbeg:
printf ("/wordbeg");
break;
-
+
case wordend:
printf ("/wordend");
-
+
#ifdef emacs
case before_dot:
printf ("/before_dot");
@@ -690,7 +690,7 @@ print_partial_compiled_pattern (start, end)
mcnt = *p++;
printf ("/%d", mcnt);
break;
-
+
case notsyntaxspec:
printf ("/notsyntaxspec");
mcnt = *p++;
@@ -701,7 +701,7 @@ print_partial_compiled_pattern (start, end)
case wordchar:
printf ("/wordchar");
break;
-
+
case notwordchar:
printf ("/notwordchar");
break;
@@ -758,7 +758,7 @@ print_double_string (where, string1, size1, string2, size2)
int size2;
{
unsigned this_char;
-
+
if (where == NULL)
printf ("(null)");
else
@@ -768,7 +768,7 @@ print_double_string (where, string1, size1, string2, size2)
for (this_char = where - string1; this_char < size1; this_char++)
printchar (string1[this_char]);
- where = string2;
+ where = string2;
}
for (this_char = where - string2; this_char < size2; this_char++)
@@ -809,7 +809,7 @@ re_set_syntax (syntax)
reg_syntax_t syntax;
{
reg_syntax_t ret = re_syntax_options;
-
+
re_syntax_options = syntax;
return ret;
}
@@ -845,7 +845,7 @@ static boolean at_begline_loc_p (), at_endline_loc_p ();
static boolean group_in_compile_stack ();
static reg_errcode_t compile_range ();
-/* Fetch the next character in the uncompiled pattern---translating it
+/* Fetch the next character in the uncompiled pattern---translating it
if necessary. Also cast from a signed character in the constant
string passed to us by the user to an unsigned char that we can use
as an array index (in, e.g., `translate'). */
@@ -985,7 +985,7 @@ typedef struct
pattern_offset_t begalt_offset;
pattern_offset_t fixup_alt_jump;
pattern_offset_t inner_group_offset;
- pattern_offset_t laststart_offset;
+ pattern_offset_t laststart_offset;
regnum_t regnum;
} compile_stack_elt_t;
@@ -1028,7 +1028,7 @@ typedef struct
PATFETCH (c); \
} \
} \
- }
+ }
#define CHAR_CLASS_MAX_LENGTH 6 /* Namely, `xdigit'. */
@@ -1054,7 +1054,7 @@ typedef struct
`fastmap_accurate' is zero;
`re_nsub' is the number of subexpressions in PATTERN;
`not_bol' and `not_eol' are zero;
-
+
The `fastmap' and `newline_anchor' fields are neither
examined nor set. */
@@ -1069,20 +1069,20 @@ regex_compile (pattern, size, syntax, bufp)
`char *' (i.e., signed), we declare these variables as unsigned, so
they can be reliably used as array indices. */
register unsigned char c, c1;
-
+
/* A random tempory spot in PATTERN. */
const char *p1;
/* Points to the end of the buffer, where we should append. */
register unsigned char *b;
-
+
/* Keeps track of unclosed groups. */
compile_stack_type compile_stack;
/* Points to the current (ending) position in the pattern. */
const char *p = pattern;
const char *pend = pattern + size;
-
+
/* How to translate the characters in the pattern. */
char *translate = bufp->translate;
@@ -1103,7 +1103,7 @@ regex_compile (pattern, size, syntax, bufp)
/* Place in the uncompiled pattern (i.e., the {) to
which to go back if the interval is invalid. */
const char *beg_interval;
-
+
/* Address of the place where a forward jump should go to the end of
the containing expression. Each alternative of an `or' -- except the
last -- ends with a forward jump of this sort. */
@@ -1119,7 +1119,7 @@ regex_compile (pattern, size, syntax, bufp)
if (debug)
{
unsigned debug_count;
-
+
for (debug_count = 0; debug_count < size; debug_count++)
printchar (pattern[debug_count]);
putchar ('\n');
@@ -1143,9 +1143,9 @@ regex_compile (pattern, size, syntax, bufp)
printer (for debugging) will think there's no pattern. We reset it
at the end. */
bufp->used = 0;
-
+
/* Always count groups, whether or not bufp->no_sub is set. */
- bufp->re_nsub = 0;
+ bufp->re_nsub = 0;
#if !defined (emacs) && !defined (SYNTAX_TABLE)
/* Initialize the syntax table. */
@@ -1196,7 +1196,7 @@ regex_compile (pattern, size, syntax, bufp)
case '$':
{
if ( /* If at end of pattern, it's an operator. */
- p == pend
+ p == pend
/* If context independent, it's an operator. */
|| syntax & RE_CONTEXT_INDEP_ANCHORS
/* Otherwise, depends on what's next. */
@@ -1227,7 +1227,7 @@ regex_compile (pattern, size, syntax, bufp)
{
/* Are we optimizing this jump? */
boolean keep_string_p = false;
-
+
/* 1 means zero (many) matches is allowed. */
char zero_times_ok = 0, many_times_ok = 0;
@@ -1275,7 +1275,7 @@ regex_compile (pattern, size, syntax, bufp)
/* Star, etc. applied to an empty pattern is equivalent
to an empty pattern. */
- if (!laststart)
+ if (!laststart)
break;
/* Now we know whether or not zero matches is allowed
@@ -1284,7 +1284,7 @@ regex_compile (pattern, size, syntax, bufp)
{ /* More than one repetition is allowed, so put in at the
end a backward relative jump from `b' to before the next
jump we're going to put in below (which jumps from
- laststart to after this jump).
+ laststart to after this jump).
But if we are at the `*' in the exact sequence `.*\n',
insert an unconditional jump backwards to the .,
@@ -1361,7 +1361,7 @@ regex_compile (pattern, size, syntax, bufp)
/* We test `*p == '^' twice, instead of using an if
statement, so we only need one BUF_PUSH. */
- BUF_PUSH (*p == '^' ? charset_not : charset);
+ BUF_PUSH (*p == '^' ? charset_not : charset);
if (*p == '^')
p++;
@@ -1411,8 +1411,8 @@ regex_compile (pattern, size, syntax, bufp)
was a character: if this is a hyphen not at the
beginning or the end of a list, then it's the range
operator. */
- if (c == '-'
- && !(p - 2 >= pattern && p[-2] == '[')
+ if (c == '-'
+ && !(p - 2 >= pattern && p[-2] == '[')
&& !(p - 3 >= pattern && p[-3] == '[' && p[-2] == '^')
&& *p != ']')
{
@@ -1427,7 +1427,7 @@ regex_compile (pattern, size, syntax, bufp)
/* Move past the `-'. */
PATFETCH (c1);
-
+
ret = compile_range (&p, pend, translate, syntax, b);
if (ret != REG_NOERROR) return ret;
}
@@ -1456,7 +1456,7 @@ regex_compile (pattern, size, syntax, bufp)
str[c1] = '\0';
/* If isn't a word bracketed by `[:' and:`]':
- undo the ending character, the letters, and leave
+ undo the ending character, the letters, and leave
the leading `:' and `[' (but set bits for them). */
if (c == ':' && *p == ']')
{
@@ -1473,12 +1473,12 @@ regex_compile (pattern, size, syntax, bufp)
boolean is_space = STREQ (str, "space");
boolean is_upper = STREQ (str, "upper");
boolean is_xdigit = STREQ (str, "xdigit");
-
+
if (!IS_CHAR_CLASS (str)) return REG_ECTYPE;
/* Throw away the ] at the end of the character
class. */
- PATFETCH (c);
+ PATFETCH (c);
if (p == pend) return REG_EBRACK;
@@ -1503,7 +1503,7 @@ regex_compile (pattern, size, syntax, bufp)
else
{
c1++;
- while (c1--)
+ while (c1--)
PATUNFETCH;
SET_LIST_BIT ('[');
SET_LIST_BIT (':');
@@ -1519,8 +1519,8 @@ regex_compile (pattern, size, syntax, bufp)
/* Discard any (non)matching list bytes that are all 0 at the
end of the map. Decrease the map-length byte too. */
- while ((int) b[-1] > 0 && b[b[-1] - 1] == 0)
- b[-1]--;
+ while ((int) b[-1] > 0 && b[b[-1] - 1] == 0)
+ b[-1]--;
b += b[-1];
}
break;
@@ -1580,7 +1580,7 @@ regex_compile (pattern, size, syntax, bufp)
regnum++;
if (COMPILE_STACK_FULL)
- {
+ {
RETALLOC (compile_stack.stack, compile_stack.size << 1,
compile_stack_elt_t);
if (compile_stack.stack == NULL) return REG_ESPACE;
@@ -1593,7 +1593,7 @@ regex_compile (pattern, size, syntax, bufp)
whole pattern moves because of realloc, they will still
be valid. */
COMPILE_STACK_TOP.begalt_offset = begalt - bufp->buffer;
- COMPILE_STACK_TOP.fixup_alt_jump
+ COMPILE_STACK_TOP.fixup_alt_jump
= fixup_alt_jump ? fixup_alt_jump - bufp->buffer + 1 : 0;
COMPILE_STACK_TOP.laststart_offset = b - bufp->buffer;
COMPILE_STACK_TOP.regnum = regnum;
@@ -1607,7 +1607,7 @@ regex_compile (pattern, size, syntax, bufp)
COMPILE_STACK_TOP.inner_group_offset = b - bufp->buffer + 2;
BUF_PUSH_3 (start_memory, regnum, 0);
}
-
+
compile_stack.avail++;
fixup_alt_jump = 0;
@@ -1636,7 +1636,7 @@ regex_compile (pattern, size, syntax, bufp)
`pop_failure_jump' to pop. See comments at
`push_dummy_failure' in `re_match_2'. */
BUF_PUSH (push_dummy_failure);
-
+
/* We allocated space for this jump when we assigned
to `fixup_alt_jump', in the `handle_alt' case below. */
STORE_JUMP (jump_past_alt, fixup_alt_jump, b - 1);
@@ -1658,11 +1658,11 @@ regex_compile (pattern, size, syntax, bufp)
as in `(ab)c(de)' -- the second group is #2. */
regnum_t this_group_regnum;
- compile_stack.avail--;
+ compile_stack.avail--;
begalt = bufp->buffer + COMPILE_STACK_TOP.begalt_offset;
fixup_alt_jump
= COMPILE_STACK_TOP.fixup_alt_jump
- ? bufp->buffer + COMPILE_STACK_TOP.fixup_alt_jump - 1
+ ? bufp->buffer + COMPILE_STACK_TOP.fixup_alt_jump - 1
: 0;
laststart = bufp->buffer + COMPILE_STACK_TOP.laststart_offset;
this_group_regnum = COMPILE_STACK_TOP.regnum;
@@ -1677,7 +1677,7 @@ regex_compile (pattern, size, syntax, bufp)
{
unsigned char *inner_group_loc
= bufp->buffer + COMPILE_STACK_TOP.inner_group_offset;
-
+
*inner_group_loc = regnum - this_group_regnum;
BUF_PUSH_3 (stop_memory, this_group_regnum,
regnum - this_group_regnum);
@@ -1706,10 +1706,10 @@ regex_compile (pattern, size, syntax, bufp)
jump (put in below, which in turn will jump to the next
(if any) alternative's such jump, etc.). The last such
jump jumps to the correct final destination. A picture:
- _____ _____
- | | | |
- | v | v
- a | b | c
+ _____ _____
+ | | | |
+ | v | v
+ a | b | c
If we are at `b', then fixup_alt_jump right now points to a
three-byte space after `a'. We'll put in the jump, set
@@ -1731,10 +1731,10 @@ regex_compile (pattern, size, syntax, bufp)
break;
- case '{':
+ case '{':
/* If \{ is a literal. */
if (!(syntax & RE_INTERVALS)
- /* If we're at `\{' and it's not the open-interval
+ /* If we're at `\{' and it's not the open-interval
operator. */
|| ((syntax & RE_INTERVALS) && (syntax & RE_NO_BK_BRACES))
|| (p - 2 == pattern && p == pend))
@@ -1773,11 +1773,11 @@ regex_compile (pattern, size, syntax, bufp)
{
if (syntax & RE_NO_BK_BRACES)
goto unfetch_interval;
- else
+ else
return REG_BADBR;
}
- if (!(syntax & RE_NO_BK_BRACES))
+ if (!(syntax & RE_NO_BK_BRACES))
{
if (c != '\\') return REG_EBRACE;
@@ -1788,7 +1788,7 @@ regex_compile (pattern, size, syntax, bufp)
{
if (syntax & RE_NO_BK_BRACES)
goto unfetch_interval;
- else
+ else
return REG_BADBR;
}
@@ -1824,7 +1824,7 @@ regex_compile (pattern, size, syntax, bufp)
jump_n <succeed_n addr> <jump count>
(The upper bound and `jump_n' are omitted if
`upper_bound' is 1, though.) */
- else
+ else
{ /* If the upper bound is > 1, we need to insert
more at the end of the loop. */
unsigned nbytes = 10 + (upper_bound > 1) * 10;
@@ -1841,7 +1841,7 @@ regex_compile (pattern, size, syntax, bufp)
lower_bound);
b += 5;
- /* Code to initialize the lower bound. Insert
+ /* Code to initialize the lower bound. Insert
before the `succeed_n'. The `5' is the last two
bytes of this `set_number_at', plus 3 bytes of
the following `succeed_n'. */
@@ -1852,7 +1852,7 @@ regex_compile (pattern, size, syntax, bufp)
{ /* More than one repetition is allowed, so
append a backward jump to the `succeed_n'
that starts this interval.
-
+
When we've reached this during matching,
we'll have matched the interval once, so
jump back only `upper_bound - 1' times. */
@@ -1870,7 +1870,7 @@ regex_compile (pattern, size, syntax, bufp)
so everything is getting moved up by 5.
Conclusion: (b - 2) - (laststart + 3) + 5,
i.e., b - laststart.
-
+
We insert this at the beginning of the loop
so that if we fail during matching, we'll
reinitialize the bounds. */
@@ -1891,7 +1891,7 @@ regex_compile (pattern, size, syntax, bufp)
beg_interval = NULL;
/* normal_char and normal_backslash need `c'. */
- PATFETCH (c);
+ PATFETCH (c);
if (!(syntax & RE_NO_BK_BRACES))
{
@@ -1907,7 +1907,7 @@ regex_compile (pattern, size, syntax, bufp)
BUF_PUSH (at_dot);
break;
- case 's':
+ case 's':
laststart = b;
PATFETCH (c);
BUF_PUSH_2 (syntaxspec, syntax_spec_code[c]);
@@ -1998,11 +1998,11 @@ regex_compile (pattern, size, syntax, bufp)
/* Expects the character in `c'. */
normal_char:
/* If no exactn currently being built. */
- if (!pending_exact
+ if (!pending_exact
/* If last exactn not at current position. */
|| pending_exact + *pending_exact + 1 != b
-
+
/* We have only one byte following the exactn for the count. */
|| *pending_exact == (1 << BYTEWIDTH) - 1
@@ -2017,26 +2017,26 @@ regex_compile (pattern, size, syntax, bufp)
: (p[0] == '\\' && p[1] == '{'))))
{
/* Start building a new exactn. */
-
+
laststart = b;
BUF_PUSH_2 (exactn, 0);
pending_exact = b - 1;
}
-
+
BUF_PUSH (c);
(*pending_exact)++;
break;
} /* switch (c) */
} /* while p != pend */
-
+
/* Through the pattern now. */
-
+
if (fixup_alt_jump)
STORE_JUMP (jump_past_alt, fixup_alt_jump, b);
- if (!COMPILE_STACK_EMPTY)
+ if (!COMPILE_STACK_EMPTY)
return REG_EPAREN;
free (compile_stack.stack);
@@ -2092,14 +2092,14 @@ insert_op1 (op, loc, arg, end)
re_opcode_t op;
unsigned char *loc;
int arg;
- unsigned char *end;
+ unsigned char *end;
{
register unsigned char *pfrom = end;
register unsigned char *pto = end + 3;
while (pfrom != loc)
*--pto = *--pfrom;
-
+
store_op1 (op, loc, arg);
}
@@ -2111,14 +2111,14 @@ insert_op2 (op, loc, arg1, arg2, end)
re_opcode_t op;
unsigned char *loc;
int arg1, arg2;
- unsigned char *end;
+ unsigned char *end;
{
register unsigned char *pfrom = end;
register unsigned char *pto = end + 5;
while (pfrom != loc)
*--pto = *--pfrom;
-
+
store_op2 (op, loc, arg1, arg2);
}
@@ -2134,7 +2134,7 @@ at_begline_loc_p (pattern, p, syntax)
{
const char *prev = p - 2;
boolean prev_prev_backslash = prev > pattern && prev[-1] == '\\';
-
+
return
/* After a subexpression? */
(*prev == '(' && (syntax & RE_NO_BK_PARENS || prev_prev_backslash))
@@ -2154,7 +2154,7 @@ at_endline_loc_p (p, pend, syntax)
const char *next = p;
boolean next_backslash = *next == '\\';
const char *next_next = p + 1 < pend ? p + 1 : NULL;
-
+
return
/* Before a subexpression? */
(syntax & RE_NO_BK_PARENS ? *next == ')'
@@ -2165,7 +2165,7 @@ at_endline_loc_p (p, pend, syntax)
}
-/* Returns true if REGNUM is in one of COMPILE_STACK's elements and
+/* Returns true if REGNUM is in one of COMPILE_STACK's elements and
false if it's not. */
static boolean
@@ -2175,8 +2175,8 @@ group_in_compile_stack (compile_stack, regnum)
{
int this_element;
- for (this_element = compile_stack.avail - 1;
- this_element >= 0;
+ for (this_element = compile_stack.avail - 1;
+ this_element >= 0;
this_element--)
if (compile_stack.stack[this_element].regnum == regnum)
return true;
@@ -2190,9 +2190,9 @@ group_in_compile_stack (compile_stack, regnum)
starting character is in `P[-2]'. (`P[-1]' is the character `-'.)
Then we set the translation of all bits between the starting and
ending characters (inclusive) in the compiled pattern B.
-
+
Return an error code.
-
+
We use these short variable names so we can use the same macros as
`regex_compile' itself. */
@@ -2207,7 +2207,7 @@ compile_range (p_ptr, pend, translate, syntax, b)
const char *p = *p_ptr;
int range_start, range_end;
-
+
if (p == pend)
return REG_ERANGE;
@@ -2216,7 +2216,7 @@ compile_range (p_ptr, pend, translate, syntax, b)
is set, the range endpoints will be negative if we fetch using a
signed char *.
- We also want to fetch the endpoints without translating them; the
+ We also want to fetch the endpoints without translating them; the
appropriate translation is done in the bit-setting loop below. */
range_start = ((unsigned char *) p)[-2];
range_end = ((unsigned char *) p)[0];
@@ -2237,14 +2237,14 @@ compile_range (p_ptr, pend, translate, syntax, b)
{
SET_LIST_BIT (TRANSLATE (this_char));
}
-
+
return REG_NOERROR;
}
/* Failure stack declarations and macros; both re_compile_fastmap and
re_match_2 use a failure stack. These have to be macros because of
REGEX_ALLOCATE. */
-
+
/* Number of failure points for which to initially allocate space
when matching. If this number is exceeded, we allocate more
@@ -2292,8 +2292,8 @@ typedef struct
/* Double the size of FAIL_STACK, up to approximately `re_max_failures' items.
Return 1 if succeeds, and 0 if either ran out of memory
- allocating space for it or it was already too large.
-
+ allocating space for it or it was already too large.
+
REGEX_REALLOCATE requires `destination' be declared. */
#define DOUBLE_FAIL_STACK(fail_stack) \
@@ -2310,7 +2310,7 @@ typedef struct
1)))
-/* Push PATTERN_OP on FAIL_STACK.
+/* Push PATTERN_OP on FAIL_STACK.
Return 1 if was able to do so and 0 if ran out of memory allocating
space to do so. */
@@ -2341,12 +2341,12 @@ typedef struct
/* Push the information about the state we will need
- if we ever fail back to it.
-
+ if we ever fail back to it.
+
Requires variables fail_stack, regstart, regend, reg_info, and
num_regs be declared. DOUBLE_FAIL_STACK requires `destination' be
declared.
-
+
Does `return FAILURE_CODE' if runs out of memory. */
#define PUSH_FAILURE_POINT(pattern_place, string_place, failure_code) \
@@ -2454,7 +2454,7 @@ typedef struct
LOW_REG, HIGH_REG -- the highest and lowest active registers.
REGSTART, REGEND -- arrays of string positions.
REG_INFO -- array of information about each subexpression.
-
+
Also assumes the variables `fail_stack' and (if debugging), `bufp',
`pend', `string1', `size1', `string2', and `size2'. */
@@ -2522,7 +2522,7 @@ typedef struct
The caller must supply the address of a (1 << BYTEWIDTH)-byte data
area as BUFP->fastmap.
-
+
We set the `fastmap', `fastmap_accurate', and `can_be_null' fields in
the pattern buffer.
@@ -2539,7 +2539,7 @@ re_compile_fastmap (bufp)
#endif
/* We don't push any register information onto the failure stack. */
unsigned num_regs = 0;
-
+
register char *fastmap = bufp->fastmap;
unsigned char *pattern = bufp->buffer;
unsigned long size = bufp->used;
@@ -2556,27 +2556,27 @@ re_compile_fastmap (bufp)
boolean succeed_n_p = false;
assert (fastmap != NULL && p != NULL);
-
+
INIT_FAIL_STACK ();
bzero (fastmap, 1 << BYTEWIDTH); /* Assume nothing's valid. */
bufp->fastmap_accurate = 1; /* It will be when we're done. */
bufp->can_be_null = 0;
-
+
while (p != pend || !FAIL_STACK_EMPTY ())
{
if (p == pend)
{
bufp->can_be_null |= path_can_be_null;
-
+
/* Reset for next path. */
path_can_be_null = true;
-
+
p = fail_stack.stack[--fail_stack.avail];
}
/* We should never be about to go beyond the end of the pattern. */
assert (p < pend);
-
+
#ifdef SWITCH_ENUM_BUG
switch ((int) ((re_opcode_t) *p++))
#else
@@ -2700,10 +2700,10 @@ re_compile_fastmap (bufp)
case jump_past_alt:
case dummy_failure_jump:
EXTRACT_NUMBER_AND_INCR (j, p);
- p += j;
+ p += j;
if (j > 0)
continue;
-
+
/* Jump backward implies we just went through the body of a
loop and matched nothing. Opcode jumped to should be
`on_failure_jump' or `succeed_n'. Just treat it like an
@@ -2715,10 +2715,10 @@ re_compile_fastmap (bufp)
p++;
EXTRACT_NUMBER_AND_INCR (j, p);
- p += j;
-
+ p += j;
+
/* If what's on the stack is where we are now, pop it. */
- if (!FAIL_STACK_EMPTY ()
+ if (!FAIL_STACK_EMPTY ()
&& fail_stack.stack[fail_stack.avail - 1] == p)
fail_stack.avail--;
@@ -2756,7 +2756,7 @@ re_compile_fastmap (bufp)
case succeed_n:
/* Get to the number of times to succeed. */
- p += 2;
+ p += 2;
/* Increment p past the n for when k != 0. */
EXTRACT_NUMBER_AND_INCR (k, p);
@@ -2847,7 +2847,7 @@ re_search (bufp, string, size, startpos, range, regs)
int size, startpos, range;
struct re_registers *regs;
{
- return re_search_2 (bufp, NULL, 0, string, size, startpos, range,
+ return re_search_2 (bufp, NULL, 0, string, size, startpos, range,
regs, size);
}
@@ -2855,17 +2855,17 @@ re_search (bufp, string, size, startpos, range, regs)
/* Using the compiled pattern in BUFP->buffer, first tries to match the
virtual concatenation of STRING1 and STRING2, starting first at index
STARTPOS, then at STARTPOS + 1, and so on.
-
+
STRING1 and STRING2 have length SIZE1 and SIZE2, respectively.
-
+
RANGE is how far to scan while trying to match. RANGE = 0 means try
only at STARTPOS; in general, the last start tried is STARTPOS +
RANGE.
-
+
In REGS, return the indices of the virtual concatenation of STRING1
and STRING2 that matched the entire BUFP->buffer and its contained
subexpressions.
-
+
Do not consider matching one past the index STOP in the virtual
concatenation of STRING1 and STRING2.
@@ -2892,7 +2892,7 @@ re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop)
/* Check for out-of-range STARTPOS. */
if (startpos < 0 || startpos > total_size)
return -1;
-
+
/* Fix up RANGE if it might eventually take us outside
the virtual concatenation of STRING1 and STRING2. */
if (endpos < -1)
@@ -2914,10 +2914,10 @@ re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop)
if (fastmap && !bufp->fastmap_accurate)
if (re_compile_fastmap (bufp) == -2)
return -2;
-
+
/* Loop through the string, looking for a place to start matching. */
for (;;)
- {
+ {
/* If a fastmap is supplied, skip quickly over characters that
cannot be the start of a match. If the pattern can match the
null string, however, we don't need to skip characters; we want
@@ -2934,7 +2934,7 @@ re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop)
lim = range - (size1 - startpos);
d = (startpos >= size1 ? string2 - size1 : string1) + startpos;
-
+
/* Written out as an if-else to avoid testing `translate'
inside the loop. */
if (translate)
@@ -2951,7 +2951,7 @@ re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop)
else /* Searching backwards. */
{
register char c = (size1 == 0 || startpos >= size1
- ? string2[startpos - size1]
+ ? string2[startpos - size1]
: string1[startpos]);
if (!fastmap[(unsigned char) TRANSLATE (c)])
@@ -2968,21 +2968,21 @@ re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop)
startpos, regs, stop);
if (val >= 0)
return startpos;
-
+
if (val == -2)
return -2;
advance:
- if (!range)
+ if (!range)
break;
- else if (range > 0)
+ else if (range > 0)
{
- range--;
+ range--;
startpos++;
}
else
{
- range++;
+ range++;
startpos--;
}
}
@@ -3001,8 +3001,8 @@ static boolean alt_match_null_string_p (),
onto the failure stack. Other register information, such as the
starting and ending positions (which are addresses), and the list of
inner groups (which is a bits list) are maintained in separate
- variables.
-
+ variables.
+
We are making a (strictly speaking) nonportable assumption here: that
the compiler will pack our bit fields into something that fits into
the type of `word', i.e., is something that fits into one item on the
@@ -3076,7 +3076,7 @@ typedef union
/* Test if at very beginning or at very end of the virtual concatenation
of `string1' and `string2'. If only one string, it's `string2'. */
#define AT_STRINGS_BEG(d) ((d) == (size1 ? string1 : string2) || !size2)
-#define AT_STRINGS_END(d) ((d) == end2)
+#define AT_STRINGS_END(d) ((d) == end2)
/* Test if D points to a character which is word-constituent. We have
@@ -3139,7 +3139,7 @@ re_match (bufp, string, size, pos, regs)
int size, pos;
struct re_registers *regs;
{
- return re_match_2 (bufp, NULL, 0, string, size, pos, regs, size);
+ return re_match_2 (bufp, NULL, 0, string, size, pos, regs, size);
}
#endif /* not emacs */
@@ -3148,7 +3148,7 @@ re_match (bufp, string, size, pos, regs)
the (virtual) concatenation of STRING1 and STRING2 (of length SIZE1
and SIZE2, respectively). We start matching at POS, and stop
matching at STOP.
-
+
If REGS is non-null and the `no_sub' field of BUFP is nonzero, we
store offsets for the substring each group matched in REGS. See the
documentation for exactly how many groups we fill.
@@ -3179,7 +3179,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
/* Where we are in the data, and the end of the current string. */
const char *d, *dend;
-
+
/* Where we are in the pattern, and the end of the pattern. */
unsigned char *p = bufp->buffer;
register unsigned char *pend = p + bufp->used;
@@ -3206,7 +3206,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
return, for use in backreferences. The number here includes
an element for register zero. */
unsigned num_regs = bufp->re_nsub + 1;
-
+
/* The currently active registers. */
unsigned lowest_active_reg = NO_LOWEST_ACTIVE_REG;
unsigned highest_active_reg = NO_HIGHEST_ACTIVE_REG;
@@ -3233,15 +3233,15 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
matched any of the pattern so far this time through the reg_num-th
subexpression. These two fields get reset each time through any
loop their register is in. */
- register_info_type *reg_info;
+ register_info_type *reg_info;
/* The following record the register info as found in the above
- variables when we find a match better than any we've seen before.
+ variables when we find a match better than any we've seen before.
This happens as we backtrack through the failure points, which in
turn happens only if we have not yet matched the entire string. */
unsigned best_regs_set = false;
const char **best_regstart, **best_regend;
-
+
/* Logically, this is `best_regend[0]'. But we don't want to have to
allocate space for that if we're not allocating space for anything
else (see below). Also, we never need info about register 0 for
@@ -3258,13 +3258,13 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
#ifdef DEBUG
/* Counts the total number of registers pushed. */
- unsigned num_regs_pushed = 0;
+ unsigned num_regs_pushed = 0;
#endif
DEBUG_PRINT1 ("\n\nEntering re_match_2.\n");
-
+
INIT_FAIL_STACK ();
-
+
/* Do not bother to initialize all the register variables if there are
no groups in the pattern, as it takes a fair amount of time. If
there are groups, we include space for register 0 (the whole
@@ -3282,8 +3282,8 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
reg_dummy = REGEX_TALLOC (num_regs, const char *);
reg_info_dummy = REGEX_TALLOC (num_regs, register_info_type);
- if (!(regstart && regend && old_regstart && old_regend && reg_info
- && best_regstart && best_regend && reg_dummy && reg_info_dummy))
+ if (!(regstart && regend && old_regstart && old_regend && reg_info
+ && best_regstart && best_regend && reg_dummy && reg_info_dummy))
{
FREE_VARIABLES ();
return -2;
@@ -3306,21 +3306,21 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
FREE_VARIABLES ();
return -1;
}
-
+
/* Initialize subexpression text positions to -1 to mark ones that no
start_memory/stop_memory has been seen for. Also initialize the
register information struct. */
for (mcnt = 1; mcnt < num_regs; mcnt++)
{
- regstart[mcnt] = regend[mcnt]
+ regstart[mcnt] = regend[mcnt]
= old_regstart[mcnt] = old_regend[mcnt] = REG_UNSET_VALUE;
-
+
REG_MATCH_NULL_STRING_P (reg_info[mcnt]) = MATCH_NULL_UNSET_VALUE;
IS_ACTIVE (reg_info[mcnt]) = 0;
MATCHED_SOMETHING (reg_info[mcnt]) = 0;
EVER_MATCHED_SOMETHING (reg_info[mcnt]) = 0;
}
-
+
/* We move `string1' into `string2' if the latter's empty -- but not if
`string1' is null. */
if (size2 == 0 && string1 != NULL)
@@ -3345,7 +3345,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
end_match_2 = string2 + stop - size1;
}
- /* `p' scans through the pattern as `d' scans through the data.
+ /* `p' scans through the pattern as `d' scans through the data.
`dend' is the end of the input string that `d' points within. `d'
is advanced into the following input string whenever necessary, but
this happens before fetching; therefore, at the beginning of the
@@ -3367,7 +3367,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
DEBUG_PRINT1 ("The string to match is: `");
DEBUG_PRINT_DOUBLE_STRING (d, string1, size1, string2, size2);
DEBUG_PRINT1 ("'\n");
-
+
/* This loops over pattern commands. It exits by returning from the
function if the match is complete, or it drops through if the match
fails at this starting point in the input data. */
@@ -3378,16 +3378,16 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
if (p == pend)
{ /* End of pattern means we might have succeeded. */
DEBUG_PRINT1 ("end of pattern ... ");
-
+
/* If we haven't matched the entire string, and we want the
longest match, try backtracking. */
if (d != end_match_2)
{
DEBUG_PRINT1 ("backtracking.\n");
-
+
if (!FAIL_STACK_EMPTY ())
{ /* More failure points to try. */
- boolean same_str_p = (FIRST_STRING_P (match_end)
+ boolean same_str_p = (FIRST_STRING_P (match_end)
== MATCHING_IN_FIRST_STRING);
/* If exceeds best match so far, save it. */
@@ -3397,20 +3397,20 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
{
best_regs_set = true;
match_end = d;
-
+
DEBUG_PRINT1 ("\nSAVING match as best so far.\n");
-
+
for (mcnt = 1; mcnt < num_regs; mcnt++)
{
best_regstart[mcnt] = regstart[mcnt];
best_regend[mcnt] = regend[mcnt];
}
}
- goto fail;
+ goto fail;
}
/* If no failure points, don't restore garbage. */
- else if (best_regs_set)
+ else if (best_regs_set)
{
restore_best_regs:
/* Restore best match. It may happen that `dend ==
@@ -3419,7 +3419,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
strings `x-' and `y-z-', if the two strings are
not consecutive in memory. */
DEBUG_PRINT1 ("Restoring best registers.\n");
-
+
d = match_end;
dend = ((d >= string1 && d <= end1)
? end_match_1 : end_match_2);
@@ -3474,7 +3474,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
regs->end[0] = (MATCHING_IN_FIRST_STRING ? d - string1
: d - string2 + size1);
}
-
+
/* Go through the first `min (num_regs, regs->num_regs)'
registers, since that is all we initialized. */
for (mcnt = 1; mcnt < MIN (num_regs, regs->num_regs); mcnt++)
@@ -3487,7 +3487,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
regs->end[mcnt] = POINTER_TO_OFFSET (regend[mcnt]);
}
}
-
+
/* If the regs structure we return has more elements than
were in the pattern, set the extra elements to -1. If
we (re)allocated the registers, this is the case,
@@ -3503,8 +3503,8 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
nfailure_points_pushed - nfailure_points_popped);
DEBUG_PRINT2 ("%u registers pushed.\n", num_regs_pushed);
- mcnt = d - pos - (MATCHING_IN_FIRST_STRING
- ? string1
+ mcnt = d - pos - (MATCHING_IN_FIRST_STRING
+ ? string1
: string2 - size1);
DEBUG_PRINT2 ("Returning %d from re_match_2.\n", mcnt);
@@ -3594,7 +3594,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
p += 1 + *p;
if (!not) goto fail;
-
+
SET_REGS_MATCHED ();
d++;
break;
@@ -3611,9 +3611,9 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
/* Find out if this group can match the empty string. */
p1 = p; /* To send to group_match_null_string_p. */
-
+
if (REG_MATCH_NULL_STRING_P (reg_info[*p]) == MATCH_NULL_UNSET_VALUE)
- REG_MATCH_NULL_STRING_P (reg_info[*p])
+ REG_MATCH_NULL_STRING_P (reg_info[*p])
= group_match_null_string_p (&p1, pend, reg_info);
/* Save the position in the string where we were the last time
@@ -3624,7 +3624,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
old_regstart[*p] = REG_MATCH_NULL_STRING_P (reg_info[*p])
? REG_UNSET (regstart[*p]) ? d : regstart[*p]
: regstart[*p];
- DEBUG_PRINT2 (" old_regstart: %d\n",
+ DEBUG_PRINT2 (" old_regstart: %d\n",
POINTER_TO_OFFSET (old_regstart[*p]));
regstart[*p] = d;
@@ -3632,10 +3632,10 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
IS_ACTIVE (reg_info[*p]) = 1;
MATCHED_SOMETHING (reg_info[*p]) = 0;
-
+
/* This is the new highest active register. */
highest_active_reg = *p;
-
+
/* If nothing was active before, this is the new lowest active
register. */
if (lowest_active_reg == NO_LOWEST_ACTIVE_REG)
@@ -3651,7 +3651,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
number, and the number of inner groups. */
case stop_memory:
DEBUG_PRINT3 ("EXECUTING stop_memory %d (%d):\n", *p, p[1]);
-
+
/* We need to save the string position the last time we were at
this close-group operator in case the group is operated
upon by a repetition operator, e.g., with `((a*)*(b*)*)*'
@@ -3660,7 +3660,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
old_regend[*p] = REG_MATCH_NULL_STRING_P (reg_info[*p])
? REG_UNSET (regend[*p]) ? d : regend[*p]
: regend[*p];
- DEBUG_PRINT2 (" old_regend: %d\n",
+ DEBUG_PRINT2 (" old_regend: %d\n",
POINTER_TO_OFFSET (old_regend[*p]));
regend[*p] = d;
@@ -3668,7 +3668,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
/* This register isn't active anymore. */
IS_ACTIVE (reg_info[*p]) = 0;
-
+
/* If this was the only register active, nothing is active
anymore. */
if (lowest_active_reg == highest_active_reg)
@@ -3684,7 +3684,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
unsigned char r = *p - 1;
while (r > 0 && !IS_ACTIVE (reg_info[r]))
r--;
-
+
/* If we end up at register zero, that means that we saved
the registers as the result of an `on_failure_jump', not
a `start_memory', and we jumped to past the innermost
@@ -3700,7 +3700,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
else
highest_active_reg = r;
}
-
+
/* If just failed to match something this time around with a
group that's operated on by a repetition operator, try to
force exit from the ``loop'', and restore the register
@@ -3708,10 +3708,10 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
last match. */
if ((!MATCHED_SOMETHING (reg_info[*p])
|| (re_opcode_t) p[-3] == start_memory)
- && (p + 2) < pend)
+ && (p + 2) < pend)
{
boolean is_a_jump_n = false;
-
+
p1 = p + 2;
mcnt = 0;
switch ((re_opcode_t) *p1++)
@@ -3726,12 +3726,12 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
if (is_a_jump_n)
p1 += 2;
break;
-
+
default:
/* do nothing */ ;
}
p1 += mcnt;
-
+
/* If the next operation is a jump backwards in the pattern
to an on_failure_jump right before the start_memory
corresponding to this stop_memory, exit from the loop
@@ -3745,17 +3745,17 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
failed match, e.g., with `(a*)*b' against `ab' for
regstart[1], and, e.g., with `((a*)*(b*)*)*'
against `aba' for regend[3].
-
+
Also restore the registers for inner groups for,
e.g., `((a*)(b*))*' against `aba' (register 3 would
otherwise get trashed). */
-
+
if (EVER_MATCHED_SOMETHING (reg_info[*p]))
{
- unsigned r;
-
+ unsigned r;
+
EVER_MATCHED_SOMETHING (reg_info[*p]) = 0;
-
+
/* Restore this and inner groups' (if any) registers. */
for (r = *p; r < *p + *(p + 1); r++)
{
@@ -3764,7 +3764,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
/* xx why this test? */
if ((int) old_regend[r] >= (int) regstart[r])
regend[r] = old_regend[r];
- }
+ }
}
p1++;
EXTRACT_NUMBER_AND_INCR (mcnt, p1);
@@ -3773,7 +3773,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
goto fail;
}
}
-
+
/* Move past the register number and the inner group count. */
p += 2;
break;
@@ -3790,16 +3790,16 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
/* Can't back reference a group which we've never matched. */
if (REG_UNSET (regstart[regno]) || REG_UNSET (regend[regno]))
goto fail;
-
+
/* Where in input to try to start matching. */
d2 = regstart[regno];
-
+
/* Where to stop matching; if both the place to start and
the place to stop matching are in the same string, then
set to the place to stop, otherwise, for now have to use
the end of the first string. */
- dend2 = ((FIRST_STRING_P (regstart[regno])
+ dend2 = ((FIRST_STRING_P (regstart[regno])
== FIRST_STRING_P (regend[regno]))
? regend[regno] : end_match_1);
for (;;)
@@ -3823,16 +3823,16 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
/* How many characters left in this segment to match. */
mcnt = dend - d;
-
+
/* Want how many consecutive characters we can match in
one shot, so, if necessary, adjust the count. */
if (mcnt > dend2 - d2)
mcnt = dend2 - d2;
-
+
/* Compare that many; failure if mismatch, else move
past them. */
- if (translate
- ? bcmp_translate (d, d2, mcnt, translate)
+ if (translate
+ ? bcmp_translate (d, d2, mcnt, translate)
: bcmp (d, d2, mcnt))
goto fail;
d += mcnt, d2 += mcnt;
@@ -3846,7 +3846,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
`newline_anchor' is set, after newlines. */
case begline:
DEBUG_PRINT1 ("EXECUTING begline.\n");
-
+
if (AT_STRINGS_BEG (d))
{
if (!bufp->not_bol) break;
@@ -3867,7 +3867,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
{
if (!bufp->not_eol) break;
}
-
+
/* We have to ``prefetch'' the next character. */
else if ((d == end1 ? *string2 : *d) == '\n'
&& bufp->newline_anchor)
@@ -3901,7 +3901,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
then the . fails against the \n. But the next thing we want
to do is match the \n against the \n; if we restored the
string value, we would be back at the foo.
-
+
Because this is used only in specific cases, we don't need to
check all the things that `on_failure_jump' does, to make
sure the right things get saved on the stack. Hence we don't
@@ -3911,7 +3911,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
case; that seems worse than this. */
case on_failure_keep_string_jump:
DEBUG_PRINT1 ("EXECUTING on_failure_keep_string_jump");
-
+
EXTRACT_NUMBER_AND_INCR (mcnt, p);
DEBUG_PRINT3 (" %d (to 0x%x):\n", mcnt, p + mcnt);
@@ -3920,7 +3920,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
/* Uses of on_failure_jump:
-
+
Each alternative starts with an on_failure_jump that points
to the beginning of the next alternative. Each alternative
except the last ends with a jump that in effect jumps past
@@ -3986,7 +3986,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
would have to backtrack because of (as in, e.g., `a*a')
then we can change to pop_failure_jump, because we'll
never have to backtrack.
-
+
This is not true in the case of alternatives: in
`(a|ab)*' we do need to backtrack to the `ab' alternative
(e.g., if the string was `ab'). But instead of trying to
@@ -4018,7 +4018,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
p1 = p + mcnt;
/* p1[0] ... p1[2] are the `on_failure_jump' corresponding
- to the `maybe_finalize_jump' of this case. Examine what
+ to the `maybe_finalize_jump' of this case. Examine what
follows. */
if ((re_opcode_t) p1[3] == exactn && p1[5] != c)
{
@@ -4026,12 +4026,12 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
DEBUG_PRINT3 (" %c != %c => pop_failure_jump.\n",
c, p1[5]);
}
-
+
else if ((re_opcode_t) p1[3] == charset
|| (re_opcode_t) p1[3] == charset_not)
{
int not = (re_opcode_t) p1[3] == charset_not;
-
+
if (c < (unsigned char) (p1[4] * BYTEWIDTH)
&& p1[5 + c / BYTEWIDTH] & (1 << (c % BYTEWIDTH)))
not = !not;
@@ -4080,7 +4080,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
}
/* Note fall through. */
-
+
/* Unconditionally jump (without popping any failure points). */
case jump:
unconditional_jump:
@@ -4090,7 +4090,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
DEBUG_PRINT2 ("(to 0x%x).\n", p);
break;
-
+
/* We need this opcode so we can detect where alternatives end
in `group_match_null_string_p' et al. */
case jump_past_alt:
@@ -4125,7 +4125,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
/* Have to succeed matching what follows at least n times.
After that, handle like `on_failure_jump'. */
- case succeed_n:
+ case succeed_n:
EXTRACT_NUMBER (mcnt, p + 2);
DEBUG_PRINT2 ("EXECUTING succeed_n %d.\n", mcnt);
@@ -4146,8 +4146,8 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
goto on_failure;
}
break;
-
- case jump_n:
+
+ case jump_n:
EXTRACT_NUMBER (mcnt, p + 2);
DEBUG_PRINT2 ("EXECUTING jump_n %d.\n", mcnt);
@@ -4156,13 +4156,13 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
{
mcnt--;
STORE_NUMBER (p + 2, mcnt);
- goto unconditional_jump;
+ goto unconditional_jump;
}
/* If don't have to jump any more, skip over the rest of command. */
- else
- p += 4;
+ else
+ p += 4;
break;
-
+
case set_number_at:
{
DEBUG_PRINT1 ("EXECUTING set_number_at.\n");
@@ -4207,13 +4207,13 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
if (PTR_CHAR_POS ((unsigned char *) d) >= point)
goto fail;
break;
-
+
case at_dot:
DEBUG_PRINT1 ("EXECUTING at_dot.\n");
if (PTR_CHAR_POS ((unsigned char *) d) != point)
goto fail;
break;
-
+
case after_dot:
DEBUG_PRINT1 ("EXECUTING after_dot.\n");
if (PTR_CHAR_POS ((unsigned char *) d) <= point)
@@ -4266,7 +4266,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
SET_REGS_MATCHED ();
d++;
break;
-
+
case notwordchar:
DEBUG_PRINT1 ("EXECUTING non-Emacs notwordchar.\n");
PREFETCH ();
@@ -4276,7 +4276,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
d++;
break;
#endif /* not emacs */
-
+
default:
abort ();
}
@@ -4301,7 +4301,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
if (p < pend)
{
boolean is_a_jump_n = false;
-
+
/* If failed to a backwards jump that's part of a repetition
loop, need to pop this failure point and use the next one. */
switch ((re_opcode_t) *p)
@@ -4313,7 +4313,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
case jump:
p1 = p + 1;
EXTRACT_NUMBER_AND_INCR (mcnt, p1);
- p1 += mcnt;
+ p1 += mcnt;
if ((is_a_jump_n && (re_opcode_t) *p1 == succeed_n)
|| (!is_a_jump_n
@@ -4344,10 +4344,10 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
/* We are passed P pointing to a register number after a start_memory.
-
+
Return true if the pattern up to the corresponding stop_memory can
match the empty string, and false otherwise.
-
+
If we find the matching stop_memory, sets P to point to one past its number.
Otherwise, sets P to an undefined byte less than or equal to END.
@@ -4361,20 +4361,20 @@ group_match_null_string_p (p, end, reg_info)
int mcnt;
/* Point to after the args to the start_memory. */
unsigned char *p1 = *p + 2;
-
+
while (p1 < end)
{
/* Skip over opcodes that can match nothing, and return true or
false, as appropriate, when we get to one that can't, or to the
matching stop_memory. */
-
+
switch ((re_opcode_t) *p1)
{
/* Could be either a loop or a series of alternatives. */
case on_failure_jump:
p1++;
EXTRACT_NUMBER_AND_INCR (mcnt, p1);
-
+
/* If the next operation is not a jump backwards in the
pattern. */
@@ -4388,7 +4388,7 @@ group_match_null_string_p (p, end, reg_info)
/on_failure_jump/0/6/exactn/1/a/jump_past_alt/0/6
/on_failure_jump/0/6/exactn/1/b/jump_past_alt/0/3
- /exactn/1/c
+ /exactn/1/c
So, we have to first go through the first (n-1)
alternatives and then deal with the last one separately. */
@@ -4404,19 +4404,19 @@ group_match_null_string_p (p, end, reg_info)
is, including the ending `jump_past_alt' and
its number. */
- if (!alt_match_null_string_p (p1, p1 + mcnt - 3,
+ if (!alt_match_null_string_p (p1, p1 + mcnt - 3,
reg_info))
return false;
/* Move to right after this alternative, including the
jump_past_alt. */
- p1 += mcnt;
+ p1 += mcnt;
/* Break if it's the beginning of an n-th alternative
that doesn't begin with an on_failure_jump. */
if ((re_opcode_t) *p1 != on_failure_jump)
break;
-
+
/* Still have to check that it's not an n-th
alternative that starts with an on_failure_jump. */
p1++;
@@ -4441,14 +4441,14 @@ group_match_null_string_p (p, end, reg_info)
} /* if mcnt > 0 */
break;
-
+
case stop_memory:
assert (p1[1] == **p);
*p = p1 + 2;
return true;
-
- default:
+
+ default:
if (!common_op_match_null_string_p (&p1, end, reg_info))
return false;
}
@@ -4461,7 +4461,7 @@ group_match_null_string_p (p, end, reg_info)
/* Similar to group_match_null_string_p, but doesn't deal with alternatives:
It expects P to be the first byte of a single alternative and END one
byte past the last. The alternative can contain groups. */
-
+
static boolean
alt_match_null_string_p (p, end, reg_info)
unsigned char *p, *end;
@@ -4469,12 +4469,12 @@ alt_match_null_string_p (p, end, reg_info)
{
int mcnt;
unsigned char *p1 = p;
-
+
while (p1 < end)
{
- /* Skip over opcodes that can match nothing, and break when we get
+ /* Skip over opcodes that can match nothing, and break when we get
to one that can't. */
-
+
switch ((re_opcode_t) *p1)
{
/* It's a loop. */
@@ -4483,8 +4483,8 @@ alt_match_null_string_p (p, end, reg_info)
EXTRACT_NUMBER_AND_INCR (mcnt, p1);
p1 += mcnt;
break;
-
- default:
+
+ default:
if (!common_op_match_null_string_p (&p1, end, reg_info))
return false;
}
@@ -4495,8 +4495,8 @@ alt_match_null_string_p (p, end, reg_info)
/* Deals with the ops common to group_match_null_string_p and
- alt_match_null_string_p.
-
+ alt_match_null_string_p.
+
Sets P to one after the op and its arguments, if any. */
static boolean
@@ -4531,7 +4531,7 @@ common_op_match_null_string_p (p, end, reg_info)
reg_no = *p1;
assert (reg_no > 0 && reg_no <= MAX_REGNUM);
ret = group_match_null_string_p (&p1, end, reg_info);
-
+
/* Have to set this here in case we're checking a group which
contains a group and a back reference to it. */
@@ -4541,7 +4541,7 @@ common_op_match_null_string_p (p, end, reg_info)
if (!ret)
return false;
break;
-
+
/* If this is an optimized succeed_n for zero times, make the jump. */
case jump:
EXTRACT_NUMBER_AND_INCR (mcnt, p1);
@@ -4553,7 +4553,7 @@ common_op_match_null_string_p (p, end, reg_info)
case succeed_n:
/* Get to the number of times to succeed. */
- p1 += 2;
+ p1 += 2;
EXTRACT_NUMBER_AND_INCR (mcnt, p1);
if (mcnt == 0)
@@ -4566,7 +4566,7 @@ common_op_match_null_string_p (p, end, reg_info)
return false;
break;
- case duplicate:
+ case duplicate:
if (!REG_MATCH_NULL_STRING_P (reg_info[*p1]))
return false;
break;
@@ -4586,7 +4586,7 @@ common_op_match_null_string_p (p, end, reg_info)
/* Return zero if TRANSLATE[S1] and TRANSLATE[S2] are identical for LEN
bytes; nonzero otherwise. */
-
+
static int
bcmp_translate (s1, s2, len, translate)
unsigned char *s1, *s2;
@@ -4607,10 +4607,10 @@ bcmp_translate (s1, s2, len, translate)
/* re_compile_pattern is the GNU regular expression compiler: it
compiles PATTERN (of length SIZE) and puts the result in BUFP.
Returns 0 if the pattern was valid, otherwise an error string.
-
+
Assumes the `allocated' (and perhaps `buffer') and `translate' fields
are set in BUFP on entry.
-
+
We call regex_compile to do the actual compilation. */
const char *
@@ -4620,23 +4620,23 @@ re_compile_pattern (pattern, length, bufp)
struct re_pattern_buffer *bufp;
{
reg_errcode_t ret;
-
+
/* GNU code is written to assume at least RE_NREGS registers will be set
(and at least one extra will be -1). */
bufp->regs_allocated = REGS_UNALLOCATED;
-
+
/* And GNU code determines whether or not to get register information
by passing null for the REGS argument to re_match, etc., not by
setting no_sub. */
bufp->no_sub = 0;
-
+
/* Match anchors at newline. */
bufp->newline_anchor = 1;
-
+
ret = regex_compile (pattern, length, re_syntax_options, bufp);
return re_error_msg[(int) ret];
-}
+}
/* Entry points compatible with 4.2 BSD regex library. We don't define
them if this is an Emacs or POSIX compilation. */
@@ -4651,7 +4651,7 @@ re_comp (s)
const char *s;
{
reg_errcode_t ret;
-
+
if (!s)
{
if (!re_comp_buf.buffer)
@@ -4678,7 +4678,7 @@ re_comp (s)
re_comp_buf.newline_anchor = 1;
ret = regex_compile (s, strlen (s), re_syntax_options, &re_comp_buf);
-
+
/* Yes, we're discarding `const' here. */
return (char *) re_error_msg[(int) ret];
}
@@ -4735,7 +4735,7 @@ re_exec (s)
int
regcomp (preg, pattern, cflags)
regex_t *preg;
- const char *pattern;
+ const char *pattern;
int cflags;
{
reg_errcode_t ret;
@@ -4746,17 +4746,17 @@ regcomp (preg, pattern, cflags)
/* regex_compile will allocate the space for the compiled pattern. */
preg->buffer = 0;
preg->allocated = 0;
-
+
/* Don't bother to use a fastmap when searching. This simplifies the
REG_NEWLINE case: if we used a fastmap, we'd have to put all the
characters after newlines into the fastmap. This way, we just try
every character. */
preg->fastmap = 0;
-
+
if (cflags & REG_ICASE)
{
unsigned i;
-
+
preg->translate = (char *) malloc (CHAR_SET_SIZE);
if (preg->translate == NULL)
return (int) REG_ESPACE;
@@ -4781,38 +4781,38 @@ regcomp (preg, pattern, cflags)
preg->no_sub = !!(cflags & REG_NOSUB);
- /* POSIX says a null character in the pattern terminates it, so we
+ /* POSIX says a null character in the pattern terminates it, so we
can use strlen here in compiling the pattern. */
ret = regex_compile (pattern, strlen (pattern), syntax, preg);
-
+
/* POSIX doesn't distinguish between an unmatched open-group and an
unmatched close-group: both are REG_EPAREN. */
if (ret == REG_ERPAREN) ret = REG_EPAREN;
-
+
return (int) ret;
}
/* regexec searches for a given pattern, specified by PREG, in the
string STRING.
-
+
If NMATCH is zero or REG_NOSUB was set in the cflags argument to
`regcomp', we ignore PMATCH. Otherwise, we assume PMATCH has at
least NMATCH elements, and we set them to the offsets of the
corresponding matched substrings.
-
+
EFLAGS specifies `execution flags' which affect matching: if
REG_NOTBOL is set, then ^ does not match at the beginning of the
string; if REG_NOTEOL is set, then $ does not match at the end.
-
+
We return 0 if we find a match and REG_NOMATCH if not. */
int
regexec (preg, string, nmatch, pmatch, eflags)
const regex_t *preg;
- const char *string;
- size_t nmatch;
- regmatch_t pmatch[];
+ const char *string;
+ size_t nmatch;
+ regmatch_t pmatch[];
int eflags;
{
int ret;
@@ -4822,15 +4822,15 @@ regexec (preg, string, nmatch, pmatch, eflags)
boolean want_reg_info = !preg->no_sub && nmatch > 0;
private_preg = *preg;
-
+
private_preg.not_bol = !!(eflags & REG_NOTBOL);
private_preg.not_eol = !!(eflags & REG_NOTEOL);
-
+
/* The user has told us exactly how many registers to return
information about, via `nmatch'. We have to pass that on to the
matching routines. */
private_preg.regs_allocated = REGS_FIXED;
-
+
if (want_reg_info)
{
regs.num_regs = nmatch;
@@ -4844,7 +4844,7 @@ regexec (preg, string, nmatch, pmatch, eflags)
ret = re_search (&private_preg, string, len,
/* start: */ 0, /* range: */ len,
want_reg_info ? ®s : (struct re_registers *) 0);
-
+
/* Copy the register information to the POSIX structure. */
if (want_reg_info)
{
@@ -4884,7 +4884,7 @@ regerror (errcode, preg, errbuf, errbuf_size)
if (errcode < 0
|| errcode >= (sizeof (re_error_msg) / sizeof (re_error_msg[0])))
- /* Only error codes returned by the rest of the code should be passed
+ /* Only error codes returned by the rest of the code should be passed
to this routine. If we are given anything else, or if other regex
code generates an invalid error code, then the program has a bug.
Dump core so we can fix it. */
@@ -4898,7 +4898,7 @@ regerror (errcode, preg, errbuf, errbuf_size)
msg = "Success";
msg_size = strlen (msg) + 1; /* Includes the null. */
-
+
if (errbuf_size != 0)
{
if (msg_size > errbuf_size)
@@ -4923,7 +4923,7 @@ regfree (preg)
if (preg->buffer != NULL)
free (preg->buffer);
preg->buffer = NULL;
-
+
preg->allocated = 0;
preg->used = 0;
diff --git a/SerialICE/util/kconfig/regex.h b/SerialICE/util/kconfig/regex.h
index 408dd21..41ebf24 100644
--- a/SerialICE/util/kconfig/regex.h
+++ b/SerialICE/util/kconfig/regex.h
@@ -42,7 +42,7 @@ typedef unsigned reg_syntax_t;
#define RE_BACKSLASH_ESCAPE_IN_LISTS (1)
/* If this bit is not set, then + and ? are operators, and \+ and \? are
- literals.
+ literals.
If set, then \+ and \? are operators and + and ? are literals. */
#define RE_BK_PLUS_QM (RE_BACKSLASH_ESCAPE_IN_LISTS << 1)
@@ -58,7 +58,7 @@ typedef unsigned reg_syntax_t;
^ is an anchor if it is at the beginning of a regular
expression or after an open-group or an alternation operator;
$ is an anchor if it is at the end of a regular expression, or
- before a close-group or an alternation operator.
+ before a close-group or an alternation operator.
This bit could be (re)combined with RE_CONTEXT_INDEP_OPS, because
POSIX draft 11.2 says that * etc. in leading positions is undefined.
@@ -69,7 +69,7 @@ typedef unsigned reg_syntax_t;
/* If this bit is set, then special characters are always special
regardless of where they are in the pattern.
If this bit is not set, then special characters are special only in
- some contexts; otherwise they are ordinary. Specifically,
+ some contexts; otherwise they are ordinary. Specifically,
* + ? and intervals are only special when not after the beginning,
open-group, or alternation operator. */
#define RE_CONTEXT_INDEP_OPS (RE_CONTEXT_INDEP_ANCHORS << 1)
@@ -91,7 +91,7 @@ typedef unsigned reg_syntax_t;
#define RE_HAT_LISTS_NOT_NEWLINE (RE_DOT_NOT_NULL << 1)
/* If this bit is set, either \{...\} or {...} defines an
- interval, depending on RE_NO_BK_BRACES.
+ interval, depending on RE_NO_BK_BRACES.
If not set, \{, \}, {, and } are literals. */
#define RE_INTERVALS (RE_HAT_LISTS_NOT_NEWLINE << 1)
@@ -116,7 +116,7 @@ typedef unsigned reg_syntax_t;
If not set, then \<digit> is a back-reference. */
#define RE_NO_BK_REFS (RE_NO_BK_PARENS << 1)
-/* If this bit is set, then | is an alternation operator, and \| is literal.
+/* If this bit is set, then | is an alternation operator, and \| is literal.
If not set, then \| is an alternation operator, and | is literal. */
#define RE_NO_BK_VBAR (RE_NO_BK_REFS << 1)
@@ -138,7 +138,7 @@ extern reg_syntax_t re_syntax_options;
/* Define combinations of the above bits for the standard possibilities.
(The [[[ comments delimit what gets put into the Texinfo file, so
- don't delete them!) */
+ don't delete them!) */
/* [[[begin syntaxes]]] */
#define RE_SYNTAX_EMACS 0
@@ -205,7 +205,7 @@ extern reg_syntax_t re_syntax_options;
#ifdef RE_DUP_MAX
#undef RE_DUP_MAX
#endif
-#define RE_DUP_MAX ((1 << 15) - 1)
+#define RE_DUP_MAX ((1 << 15) - 1)
/* POSIX `cflags' bits (i.e., information for `regcomp'). */
@@ -217,7 +217,7 @@ extern reg_syntax_t re_syntax_options;
/* If this bit is set, then ignore case when matching.
If not set, then case is significant. */
#define REG_ICASE (REG_EXTENDED << 1)
-
+
/* If this bit is set, then anchors do not match at newline
characters in the string.
If not set, then anchors do match at newlines. */
@@ -256,7 +256,7 @@ typedef enum
REG_EESCAPE, /* Trailing backslash. */
REG_ESUBREG, /* Invalid back reference. */
REG_EBRACK, /* Unmatched left bracket. */
- REG_EPAREN, /* Parenthesis imbalance. */
+ REG_EPAREN, /* Parenthesis imbalance. */
REG_EBRACE, /* Unmatched \{. */
REG_BADBR, /* Invalid contents of \{\}. */
REG_ERANGE, /* Invalid range end. */
@@ -331,7 +331,7 @@ struct re_pattern_buffer
unsigned no_sub : 1;
/* If set, a beginning-of-line anchor doesn't match at the
- beginning of the string. */
+ beginning of the string. */
unsigned not_bol : 1;
/* Similarly for an end-of-line anchor. */
@@ -443,7 +443,7 @@ extern int re_match
/* Relates to `re_match' as `re_search_2' relates to `re_search'. */
-extern int re_match_2
+extern int re_match_2
_RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1,
int length1, const char *string2, int length2,
int start, struct re_registers *regs, int stop));
diff --git a/SerialICE/util/kconfig/zconf.tab.c_shipped b/SerialICE/util/kconfig/zconf.tab.c_shipped
index 0f14cdb..97b2772 100644
--- a/SerialICE/util/kconfig/zconf.tab.c_shipped
+++ b/SerialICE/util/kconfig/zconf.tab.c_shipped
@@ -1393,7 +1393,7 @@ yyparse ()
#endif
#endif
{
-
+
int yystate;
int yyn;
int yyresult;
diff --git a/SerialICE/util/romcc.c b/SerialICE/util/romcc.c
index 0d1f118..7078cd3 100644
--- a/SerialICE/util/romcc.c
+++ b/SerialICE/util/romcc.c
@@ -25,9 +25,9 @@
#define MAX_CWD_SIZE 4096
#define MAX_ALLOCATION_PASSES 100
-/* NOTE: Before you even start thinking to touch anything
+/* NOTE: Before you even start thinking to touch anything
* in this code, set DEBUG_ROMCC_WARNINGS to 1 to get an
- * insight on the original author's thoughts. We introduced
+ * insight on the original author's thoughts. We introduced
* this switch as romcc was about the only thing producing
* massive warnings in our code..
*/
@@ -61,7 +61,7 @@
#endif
/* Control flow graph of a loop without goto.
- *
+ *
* AAA
* +---/
* /
@@ -74,31 +74,31 @@
* |\ GGG HHH | continue;
* | \ \ | |
* | \ III | /
- * | \ | / /
- * | vvv /
- * +----BBB /
+ * | \ | / /
+ * | vvv /
+ * +----BBB /
* | /
* vv
* JJJ
*
- *
+ *
* AAA
* +-----+ | +----+
* | \ | / |
* | BBB +-+ |
* | / \ / | |
* | CCC JJJ / /
- * | / \ / /
- * | DDD EEE / /
+ * | / \ / /
+ * | DDD EEE / /
* | | +-/ /
- * | FFF /
- * | / \ /
- * | GGG HHH /
+ * | FFF /
+ * | / \ /
+ * | GGG HHH /
* | | +-/
* | III
- * +--+
+ * +--+
+ *
*
- *
* DFlocal(X) = { Y <- Succ(X) | idom(Y) != X }
* DFup(Z) = { Y <- DF(Z) | idom(Y) != X }
*
@@ -117,7 +117,7 @@
* DDD EEE DDD: [ ] ( BBB ) EEE: [ JJJ ] ()
* |
* FFF FFF: [ ] ( BBB )
- * / \
+ * / \
* GGG HHH GGG: [ ] ( BBB ) HHH: [ BBB ] ()
* |
* III III: [ BBB ] ()
@@ -125,7 +125,7 @@
*
* BBB and JJJ are definitely the dominance frontier.
* Where do I place phi functions and how do I make that decision.
- *
+ *
*/
static void die(char *fmt, ...)
{
@@ -223,7 +223,7 @@ static char *slurp_file(const char *dirname, const char *filename, off_t *r_size
off_t size, progress;
ssize_t result;
FILE* file;
-
+
if (!filename) {
*r_size = 0;
return 0;
@@ -398,14 +398,14 @@ struct token {
#define OP_SUB 9
#define OP_SL 10
#define OP_USR 11
-#define OP_SSR 12
-#define OP_AND 13
+#define OP_SSR 12
+#define OP_AND 13
#define OP_XOR 14
#define OP_OR 15
#define OP_POS 16 /* Dummy positive operator don't use it */
#define OP_NEG 17
#define OP_INVERT 18
-
+
#define OP_EQ 20
#define OP_NOTEQ 21
#define OP_SLESS 22
@@ -416,7 +416,7 @@ struct token {
#define OP_ULESSEQ 27
#define OP_SMOREEQ 28
#define OP_UMOREEQ 29
-
+
#define OP_LFALSE 30 /* Test if the expression is logically false */
#define OP_LTRUE 31 /* Test if the expression is logcially true */
@@ -475,7 +475,7 @@ struct token {
* assigned yet, or variables whose value we simply do not know.
*/
-#define OP_WRITE 60
+#define OP_WRITE 60
/* OP_WRITE moves one pseudo register to another.
* MISC(0) holds the destination pseudo register, which must be an OP_DECL.
* RHS(0) holds the psuedo to move.
@@ -544,10 +544,10 @@ struct token {
* The value represented by an OP_TUPLE is held in N registers.
* LHS(0..N-1) refer to those registers.
* ->use is a list of statements that use the value.
- *
+ *
* Although OP_TUPLE always has register sized pieces they are not
* used until structures are flattened/decomposed into their register
- * components.
+ * components.
* ???? registers ????
*/
@@ -561,10 +561,10 @@ struct token {
#define OP_FCALL 72
-/* OP_FCALL performs a procedure call.
+/* OP_FCALL performs a procedure call.
* MISC(0) holds a pointer to the OP_LIST of a function
* RHS(x) holds argument x of a function
- *
+ *
* Currently not seen outside of expressions.
*/
#define OP_PROG 73
@@ -614,16 +614,16 @@ struct token {
* ->use is the list of all branches that use this label.
*/
-#define OP_ADECL 87
+#define OP_ADECL 87
/* OP_ADECL is a triple that establishes an lvalue for assignments.
* A variable takes N registers to contain.
* LHS(0..N-1) refer to an OP_PIECE triple that represents
* the Xth register that the variable is stored in.
* ->use is a list of statements that use the variable.
- *
+ *
* Although OP_ADECL always has register sized pieces they are not
* used until structures are flattened/decomposed into their register
- * components.
+ * components.
*/
#define OP_SDECL 88
@@ -635,12 +635,12 @@ struct token {
#define OP_PHI 89
-/* OP_PHI is a triple used in SSA form code.
+/* OP_PHI is a triple used in SSA form code.
* It is used when multiple code paths merge and a variable needs
* a single assignment from any of those code paths.
* The operation is a cross between OP_DECL and OP_WRITE, which
* is what OP_PHI is generated from.
- *
+ *
* RHS(x) points to the value from code path x
* The number of RHS entries is the number of control paths into the block
* in which OP_PHI resides. The elements of the array point to point
@@ -653,12 +653,12 @@ struct token {
/* continuation helpers
*/
#define OP_CPS_BRANCH 90 /* an unconditional branch */
-/* OP_CPS_BRANCH calls a continuation
+/* OP_CPS_BRANCH calls a continuation
* RHS(x) holds argument x of the function
* TARG(0) holds OP_CPS_START target
*/
#define OP_CPS_CBRANCH 91 /* a conditional branch */
-/* OP_CPS_CBRANCH conditionally calls one of two continuations
+/* OP_CPS_CBRANCH conditionally calls one of two continuations
* RHS(0) holds the branch condition
* RHS(x + 1) holds argument x of the function
* TARG(0) holds the OP_CPS_START to jump to when true
@@ -672,7 +672,7 @@ struct token {
* ->next holds where the OP_CPS_RET will return to.
*/
#define OP_CPS_RET 93
-/* OP_CPS_RET conditionally calls one of two continuations
+/* OP_CPS_RET conditionally calls one of two continuations
* RHS(0) holds the variable with the return function address
* RHS(x + 1) holds argument x of the function
* The branch target may be any OP_CPS_START
@@ -813,7 +813,7 @@ static const struct op_info table_ops[] = {
[OP_CONVERT ] = OP( 0, 1, 0, 0, PURE | DEF | BLOCK, "convert"),
[OP_PIECE ] = OP( 0, 0, 1, 0, PURE | DEF | STRUCTURAL | PART, "piece"),
[OP_ASM ] = OP(-1, -1, 0, 0, PURE, "asm"),
-[OP_DEREF ] = OP( 0, 1, 0, 0, 0 | DEF | BLOCK, "deref"),
+[OP_DEREF ] = OP( 0, 1, 0, 0, 0 | DEF | BLOCK, "deref"),
[OP_DOT ] = OP( 0, 0, 1, 0, PURE | DEF | PART, "dot"),
[OP_INDEX ] = OP( 0, 0, 1, 0, PURE | DEF | PART, "index"),
@@ -884,7 +884,7 @@ static const struct op_info table_ops[] = {
#undef OP
#define OP_MAX (sizeof(table_ops)/sizeof(table_ops[0]))
-static const char *tops(int index)
+static const char *tops(int index)
{
static const char unknown[] = "unknown op";
if (index < 0) {
@@ -995,7 +995,7 @@ struct block {
struct block_set *ipdomfrontier;
struct block *ipdom;
int vertex;
-
+
};
struct symbol {
@@ -1170,11 +1170,11 @@ struct compile_state {
* make up the union.
* type->elements hold the length of the linked list
*/
-#define TYPE_POINTER 0x1200
+#define TYPE_POINTER 0x1200
/* For TYPE_POINTER:
* type->left holds the type pointed to.
*/
-#define TYPE_FUNCTION 0x1300
+#define TYPE_FUNCTION 0x1300
/* For TYPE_FUNCTION:
* type->left holds the return type.
* type->right holds the type of the arguments
@@ -1196,7 +1196,7 @@ struct compile_state {
* type->elements holds the number of elements.
*/
#define TYPE_TUPLE 0x1900
-/* TYPE_TUPLE is a basic building block when defining
+/* TYPE_TUPLE is a basic building block when defining
* positionally reference type conglomerations. (i.e. closures)
* In essence it is a wrapper for TYPE_PRODUCT, like TYPE_STRUCT
* except it has no field names.
@@ -1205,7 +1205,7 @@ struct compile_state {
* type->elements hold the number of elements in the closure.
*/
#define TYPE_JOIN 0x1a00
-/* TYPE_JOIN is a basic building block when defining
+/* TYPE_JOIN is a basic building block when defining
* positionally reference type conglomerations. (i.e. closures)
* In essence it is a wrapper for TYPE_OVERLAP, like TYPE_UNION
* except it has no field names.
@@ -1298,9 +1298,9 @@ static struct reg_info arch_reg_constraint(
struct compile_state *state, struct type *type, const char *constraint);
static struct reg_info arch_reg_clobber(
struct compile_state *state, const char *clobber);
-static struct reg_info arch_reg_lhs(struct compile_state *state,
+static struct reg_info arch_reg_lhs(struct compile_state *state,
struct triple *ins, int index);
-static struct reg_info arch_reg_rhs(struct compile_state *state,
+static struct reg_info arch_reg_rhs(struct compile_state *state,
struct triple *ins, int index);
static int arch_reg_size(int reg);
static struct triple *transform_to_arch_instruction(
@@ -1481,9 +1481,9 @@ static int set_arg(
}
return result;
}
-
-static void flag_usage(FILE *fp, const struct compiler_flag *ptr,
+
+static void flag_usage(FILE *fp, const struct compiler_flag *ptr,
const char *prefix, const char *invert_prefix)
{
for(;ptr->name; ptr++) {
@@ -1500,7 +1500,7 @@ static void arg_usage(FILE *fp, const struct compiler_arg *ptr,
for(;ptr->name; ptr++) {
const struct compiler_flag *flag;
for(flag = &ptr->flags[0]; flag->name; flag++) {
- fprintf(fp, "%s%s=%s\n",
+ fprintf(fp, "%s%s=%s\n",
prefix, ptr->name, flag->name);
}
}
@@ -1513,7 +1513,7 @@ static int append_string(size_t *max, const char ***vec, const char *str,
count = ++(*max);
*vec = xrealloc(*vec, sizeof(char *)*count, "name");
(*vec)[count -1] = 0;
- (*vec)[count -2] = str;
+ (*vec)[count -2] = str;
return 0;
}
@@ -1544,7 +1544,7 @@ static int append_define(struct compiler_state *compiler, const char *str)
rest = identifier(str, end);
if (rest != end) {
int len = end - str - 1;
- arg_error("Invalid name cannot define macro: `%*.*s'\n",
+ arg_error("Invalid name cannot define macro: `%*.*s'\n",
len, len, str);
}
result = append_string(&compiler->define_count,
@@ -1561,7 +1561,7 @@ static int append_undef(struct compiler_state *compiler, const char *str)
rest = identifier(str, end);
if (rest != end) {
int len = end - str - 1;
- arg_error("Invalid name cannot undefine macro: `%*.*s'\n",
+ arg_error("Invalid name cannot undefine macro: `%*.*s'\n",
len, len, str);
}
result = append_string(&compiler->undef_count,
@@ -1733,7 +1733,7 @@ static int get_col(struct file_state *file)
for(col = 0; ptr < end; ptr++) {
if (*ptr != '\t') {
col++;
- }
+ }
else {
col = (col & ~7) + 8;
}
@@ -1747,7 +1747,7 @@ static void loc(FILE *fp, struct compile_state *state, struct triple *triple)
if (triple && triple->occurance) {
struct occurance *spot;
for(spot = triple->occurance; spot; spot = spot->parent) {
- fprintf(fp, "%s:%d.%d: ",
+ fprintf(fp, "%s:%d.%d: ",
spot->filename, spot->line, spot->col);
}
return;
@@ -1756,11 +1756,11 @@ static void loc(FILE *fp, struct compile_state *state, struct triple *triple)
return;
}
col = get_col(state->file);
- fprintf(fp, "%s:%d.%d: ",
+ fprintf(fp, "%s:%d.%d: ",
state->file->report_name, state->file->report_line, col);
}
-static void __attribute__ ((noreturn)) internal_error(struct compile_state *state, struct triple *ptr,
+static void __attribute__ ((noreturn)) internal_error(struct compile_state *state, struct triple *ptr,
const char *fmt, ...)
{
FILE *fp = state->errout;
@@ -1780,7 +1780,7 @@ static void __attribute__ ((noreturn)) internal_error(struct compile_state *stat
}
-static void internal_warning(struct compile_state *state, struct triple *ptr,
+static void internal_warning(struct compile_state *state, struct triple *ptr,
const char *fmt, ...)
{
FILE *fp = state->errout;
@@ -1798,7 +1798,7 @@ static void internal_warning(struct compile_state *state, struct triple *ptr,
-static void __attribute__ ((noreturn)) error(struct compile_state *state, struct triple *ptr,
+static void __attribute__ ((noreturn)) error(struct compile_state *state, struct triple *ptr,
const char *fmt, ...)
{
FILE *fp = state->errout;
@@ -1819,14 +1819,14 @@ static void __attribute__ ((noreturn)) error(struct compile_state *state, struct
exit(1);
}
-static void warning(struct compile_state *state, struct triple *ptr,
+static void warning(struct compile_state *state, struct triple *ptr,
const char *fmt, ...)
{
FILE *fp = state->errout;
va_list args;
va_start(args, fmt);
loc(fp, state, ptr);
- fprintf(fp, "warning: ");
+ fprintf(fp, "warning: ");
if (ptr && (state->compiler->debug & DEBUG_ABORT_ON_ERROR)) {
fprintf(fp, "%p %-10s ", ptr, tops(ptr->op));
}
@@ -1894,7 +1894,7 @@ static void use_triple(struct triple *used, struct triple *user)
}
ptr = &(*ptr)->next;
}
- /* Append new to the head of the list,
+ /* Append new to the head of the list,
* copy_func and rename_block_variables
* depends on this.
*/
@@ -1969,7 +1969,7 @@ static struct occurance *new_occurance(struct compile_state *state)
(last->line == line) &&
(last->function == function) &&
((last->filename == filename) ||
- (strcmp(last->filename, filename) == 0)))
+ (strcmp(last->filename, filename) == 0)))
{
get_occurance(last);
return last;
@@ -2065,7 +2065,7 @@ static struct triple unknown_triple = {
static size_t registers_of(struct compile_state *state, struct type *type);
-static struct triple *alloc_triple(struct compile_state *state,
+static struct triple *alloc_triple(struct compile_state *state,
int op, struct type *type, int lhs_wanted, int rhs_wanted,
struct occurance *occurance)
{
@@ -2165,7 +2165,7 @@ static struct triple *copy_triple(struct compile_state *state, struct triple *sr
return copy;
}
-static struct triple *new_triple(struct compile_state *state,
+static struct triple *new_triple(struct compile_state *state,
int op, struct type *type, int lhs, int rhs)
{
struct triple *ret;
@@ -2175,7 +2175,7 @@ static struct triple *new_triple(struct compile_state *state,
return ret;
}
-static struct triple *build_triple(struct compile_state *state,
+static struct triple *build_triple(struct compile_state *state,
int op, struct type *type, struct triple *left, struct triple *right,
struct occurance *occurance)
{
@@ -2192,7 +2192,7 @@ static struct triple *build_triple(struct compile_state *state,
return ret;
}
-static struct triple *triple(struct compile_state *state,
+static struct triple *triple(struct compile_state *state,
int op, struct type *type, struct triple *left, struct triple *right)
{
struct triple *ret;
@@ -2208,7 +2208,7 @@ static struct triple *triple(struct compile_state *state,
return ret;
}
-static struct triple *branch(struct compile_state *state,
+static struct triple *branch(struct compile_state *state,
struct triple *targ, struct triple *test)
{
struct triple *ret;
@@ -2251,7 +2251,7 @@ static void insert_triple(struct compile_state *state,
static int triple_stores_block(struct compile_state *state, struct triple *ins)
{
- /* This function is used to determine if u.block
+ /* This function is used to determine if u.block
* is utilized to store the current block number.
*/
int stores_block;
@@ -2261,7 +2261,7 @@ static int triple_stores_block(struct compile_state *state, struct triple *ins)
}
static int triple_is_branch(struct compile_state *state, struct triple *ins);
-static struct block *block_of_triple(struct compile_state *state,
+static struct block *block_of_triple(struct compile_state *state,
struct triple *ins)
{
struct triple *first;
@@ -2270,8 +2270,8 @@ static struct block *block_of_triple(struct compile_state *state,
}
first = state->first;
while(ins != first && !triple_is_branch(state, ins->prev) &&
- !triple_stores_block(state, ins))
- {
+ !triple_stores_block(state, ins))
+ {
if (ins == ins->prev) {
internal_error(state, ins, "ins == ins->prev?");
}
@@ -2447,30 +2447,30 @@ static void display_triple(FILE *fp, struct triple *ins)
}
else if (ins->op == OP_INTCONST) {
fprintf(fp, "(%p) %c%c%c %-7s %-2d %-10s <0x%08lx> ",
- ins, pre, post, vol, reg, ins->template_id, tops(ins->op),
+ ins, pre, post, vol, reg, ins->template_id, tops(ins->op),
(unsigned long)(ins->u.cval));
}
else if (ins->op == OP_ADDRCONST) {
fprintf(fp, "(%p) %c%c%c %-7s %-2d %-10s %-10p <0x%08lx>",
- ins, pre, post, vol, reg, ins->template_id, tops(ins->op),
+ ins, pre, post, vol, reg, ins->template_id, tops(ins->op),
MISC(ins, 0), (unsigned long)(ins->u.cval));
}
else if (ins->op == OP_INDEX) {
fprintf(fp, "(%p) %c%c%c %-7s %-2d %-10s %-10p <0x%08lx>",
- ins, pre, post, vol, reg, ins->template_id, tops(ins->op),
+ ins, pre, post, vol, reg, ins->template_id, tops(ins->op),
RHS(ins, 0), (unsigned long)(ins->u.cval));
}
else if (ins->op == OP_PIECE) {
fprintf(fp, "(%p) %c%c%c %-7s %-2d %-10s %-10p <0x%08lx>",
- ins, pre, post, vol, reg, ins->template_id, tops(ins->op),
+ ins, pre, post, vol, reg, ins->template_id, tops(ins->op),
MISC(ins, 0), (unsigned long)(ins->u.cval));
}
else {
int i, count;
- fprintf(fp, "(%p) %c%c%c %-7s %-2d %-10s",
+ fprintf(fp, "(%p) %c%c%c %-7s %-2d %-10s",
ins, pre, post, vol, reg, ins->template_id, tops(ins->op));
if (table_ops[ins->op].flags & BITFIELD) {
- fprintf(fp, " <%2d-%2d:%2d>",
+ fprintf(fp, " <%2d-%2d:%2d>",
ins->u.bitfield.offset,
ins->u.bitfield.offset + ins->u.bitfield.size,
ins->u.bitfield.size);
@@ -2500,9 +2500,9 @@ static void display_triple(FILE *fp, struct triple *ins)
fprintf(fp, " @");
for(ptr = ins->occurance; ptr; ptr = ptr->parent) {
fprintf(fp, " %s,%s:%d.%d",
- ptr->function,
+ ptr->function,
ptr->filename,
- ptr->line,
+ ptr->line,
ptr->col);
}
if (ins->op == OP_ASM) {
@@ -2523,9 +2523,9 @@ static void display_triple_changes(
orig_count = TRIPLE_SIZE(orig);
if ((new->op != orig->op) ||
(new_count != orig_count) ||
- (memcmp(orig->param, new->param,
+ (memcmp(orig->param, new->param,
orig_count * sizeof(orig->param[0])) != 0) ||
- (memcmp(&orig->u, &new->u, sizeof(orig->u)) != 0))
+ (memcmp(&orig->u, &new->u, sizeof(orig->u)) != 0))
{
struct occurance *ptr;
int i, min_count, indent;
@@ -2533,7 +2533,7 @@ static void display_triple_changes(
if (orig->op == new->op) {
fprintf(fp, " %-11s", tops(orig->op));
} else {
- fprintf(fp, " [%-10s %-10s]",
+ fprintf(fp, " [%-10s %-10s]",
tops(new->op), tops(orig->op));
}
min_count = new_count;
@@ -2542,12 +2542,12 @@ static void display_triple_changes(
}
for(indent = i = 0; i < min_count; i++) {
if (orig->param[i] == new->param[i]) {
- fprintf(fp, " %-11p",
+ fprintf(fp, " %-11p",
orig->param[i]);
indent += 12;
} else {
fprintf(fp, " [%-10p %-10p]",
- new->param[i],
+ new->param[i],
orig->param[i]);
indent += 24;
}
@@ -2562,7 +2562,7 @@ static void display_triple_changes(
}
if ((new->op == OP_INTCONST)||
(new->op == OP_ADDRCONST)) {
- fprintf(fp, " <0x%08lx>",
+ fprintf(fp, " <0x%08lx>",
(unsigned long)(new->u.cval));
indent += 13;
}
@@ -2583,11 +2583,11 @@ static void display_triple_changes(
fprintf(fp, " @");
for(ptr = orig->occurance; ptr; ptr = ptr->parent) {
fprintf(fp, " %s,%s:%d.%d",
- ptr->function,
+ ptr->function,
ptr->filename,
- ptr->line,
+ ptr->line,
ptr->col);
-
+
}
fprintf(fp, "\n");
fflush(fp);
@@ -2597,7 +2597,7 @@ static void display_triple_changes(
static int triple_is_pure(struct compile_state *state, struct triple *ins, unsigned id)
{
/* Does the triple have no side effects.
- * I.e. Rexecuting the triple with the same arguments
+ * I.e. Rexecuting the triple with the same arguments
* gives the same value.
*/
unsigned pure;
@@ -2610,7 +2610,7 @@ static int triple_is_pure(struct compile_state *state, struct triple *ins, unsig
return (pure == PURE) && !(id & TRIPLE_FLAG_VOLATILE);
}
-static int triple_is_branch_type(struct compile_state *state,
+static int triple_is_branch_type(struct compile_state *state,
struct triple *ins, unsigned type)
{
/* Is this one of the passed branch types? */
@@ -2651,7 +2651,7 @@ static int triple_is_ret(struct compile_state *state, struct triple *ins)
/* Is this triple a return instruction? */
return triple_is_branch_type(state, ins, RETBRANCH);
}
-
+
#if DEBUG_ROMCC_WARNING
static int triple_is_simple_ubranch(struct compile_state *state, struct triple *ins)
{
@@ -2732,27 +2732,27 @@ static struct triple **triple_iter(struct compile_state *state,
}
}
return ret;
-
+
}
static struct triple **triple_lhs(struct compile_state *state,
struct triple *ins, struct triple **last)
{
- return triple_iter(state, ins->lhs, &LHS(ins,0),
+ return triple_iter(state, ins->lhs, &LHS(ins,0),
ins, last);
}
static struct triple **triple_rhs(struct compile_state *state,
struct triple *ins, struct triple **last)
{
- return triple_iter(state, ins->rhs, &RHS(ins,0),
+ return triple_iter(state, ins->rhs, &RHS(ins,0),
ins, last);
}
static struct triple **triple_misc(struct compile_state *state,
struct triple *ins, struct triple **last)
{
- return triple_iter(state, ins->misc, &MISC(ins,0),
+ return triple_iter(state, ins->misc, &MISC(ins,0),
ins, last);
}
@@ -2820,7 +2820,7 @@ static struct triple **triple_targ(struct compile_state *state,
static struct triple **triple_edge_targ(struct compile_state *state,
struct triple *ins, struct triple **last)
{
- return do_triple_targ(state, ins, last,
+ return do_triple_targ(state, ins, last,
state->functions_joined, !state->functions_joined);
}
@@ -2851,7 +2851,7 @@ static struct triple *after_lhs(struct compile_state *state, struct triple *ins)
}
/* Function piece accessor functions */
-static struct triple *do_farg(struct compile_state *state,
+static struct triple *do_farg(struct compile_state *state,
struct triple *func, unsigned index)
{
struct type *ftype;
@@ -2880,7 +2880,7 @@ static struct triple *fretaddr(struct compile_state *state, struct triple *func)
{
return do_farg(state, func, 1);
}
-static struct triple *farg(struct compile_state *state,
+static struct triple *farg(struct compile_state *state,
struct triple *func, unsigned index)
{
return do_farg(state, func, index + 2);
@@ -2929,7 +2929,7 @@ static void verify_use(struct compile_state *state,
}
}
-static int find_rhs_use(struct compile_state *state,
+static int find_rhs_use(struct compile_state *state,
struct triple *user, struct triple *used)
{
struct triple **param;
@@ -3162,7 +3162,7 @@ static void print_blocks(struct compile_state *state, const char *func, FILE *fp
#define TOK_FIRST_MACRO TOK_MDEFINE
#define TOK_LAST_MACRO TOK_MENDIF
-
+
#define TOK_MIF 112
#define TOK_MELSE 113
#define TOK_MIDENT 114
@@ -3282,7 +3282,7 @@ static const char *tokens[] = {
[TOK_MIF ] = "#if",
[TOK_MELSE ] = "#else",
[TOK_MIDENT ] = "#:ident:",
-[TOK_EOL ] = "EOL",
+[TOK_EOL ] = "EOL",
[TOK_EOF ] = "EOF",
};
@@ -3306,7 +3306,7 @@ static struct hash_entry *lookup(
unsigned int index;
index = hash(name, name_len);
entry = state->hash_table[index];
- while(entry &&
+ while(entry &&
((entry->name_len != name_len) ||
(memcmp(entry->name, name, name_len) != 0))) {
entry = entry->next;
@@ -3336,7 +3336,7 @@ static void ident_to_keyword(struct compile_state *state, struct token *tk)
entry = tk->ident;
if (entry && ((entry->tok == TOK_TYPE_NAME) ||
(entry->tok == TOK_ENUM_CONST) ||
- ((entry->tok >= TOK_FIRST_KEYWORD) &&
+ ((entry->tok >= TOK_FIRST_KEYWORD) &&
(entry->tok <= TOK_LAST_KEYWORD)))) {
tk->tok = entry->tok;
}
@@ -3397,7 +3397,7 @@ static void symbol(
romcc_symbol(state, ident, chain, def, type, state->scope_depth);
}
-static void var_symbol(struct compile_state *state,
+static void var_symbol(struct compile_state *state,
struct hash_entry *ident, struct triple *def)
{
if ((def->type->type & TYPE_MASK) == TYPE_PRODUCT) {
@@ -3406,7 +3406,7 @@ static void var_symbol(struct compile_state *state,
symbol(state, ident, &ident->sym_ident, def, def->type);
}
-static void label_symbol(struct compile_state *state,
+static void label_symbol(struct compile_state *state,
struct hash_entry *ident, struct triple *label, int depth)
{
romcc_symbol(state, ident, &ident->sym_label, label, &void_type, depth);
@@ -3435,7 +3435,7 @@ static void end_scope(struct compile_state *state)
int i;
int depth;
/* Walk through the hash table and remove all symbols
- * in the current scope.
+ * in the current scope.
*/
depth = state->scope_depth;
for(i = 0; i < HASH_TABLE_SIZE; i++) {
@@ -3518,7 +3518,7 @@ static void undef_macro(struct compile_state *state, struct hash_entry *ident)
struct macro_arg *arg, *anext;
macro = ident->sym_define;
ident->sym_define = 0;
-
+
/* Free the macro arguments... */
anext = macro->args;
while(anext) {
@@ -3535,8 +3535,8 @@ static void undef_macro(struct compile_state *state, struct hash_entry *ident)
}
}
-static void do_define_macro(struct compile_state *state,
- struct hash_entry *ident, const char *body,
+static void do_define_macro(struct compile_state *state,
+ struct hash_entry *ident, const char *body,
int argc, struct macro_arg *args)
{
struct macro *macro;
@@ -3550,7 +3550,7 @@ static void do_define_macro(struct compile_state *state,
int identical_bodies, identical_args;
struct macro_arg *oarg;
/* Explicitly allow identical redfinitions of the same macro */
- identical_bodies =
+ identical_bodies =
(macro->buf_len == body_len) &&
(memcmp(macro->buf, body, body_len) == 0);
identical_args = macro->argc == argc;
@@ -3580,7 +3580,7 @@ static void do_define_macro(struct compile_state *state,
ident->sym_define = macro;
}
-
+
static void define_macro(
struct compile_state *state,
struct hash_entry *ident,
@@ -3632,7 +3632,7 @@ static void register_builtin_macros(struct compile_state *state)
register_builtin_macro(state, "__STDC__", "0");
/* In particular I don't conform to C99 */
register_builtin_macro(state, "__STDC_VERSION__", "199901L");
-
+
}
static void process_cmdline_macros(struct compile_state *state)
@@ -3679,7 +3679,7 @@ static int digitp(int c)
{
int ret = 0;
switch(c) {
- case '0': case '1': case '2': case '3': case '4':
+ case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
ret = 1;
break;
@@ -3699,7 +3699,7 @@ static int hexdigitp(int c)
{
int ret = 0;
switch(c) {
- case '0': case '1': case '2': case '3': case '4':
+ case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
@@ -3708,7 +3708,7 @@ static int hexdigitp(int c)
}
return ret;
}
-static int hexdigval(int c)
+static int hexdigval(int c)
{
int val = -1;
if ((c >= '0') && (c <= '9')) {
@@ -3727,7 +3727,7 @@ static int octdigitp(int c)
{
int ret = 0;
switch(c) {
- case '0': case '1': case '2': case '3':
+ case '0': case '1': case '2': case '3':
case '4': case '5': case '6': case '7':
ret = 1;
break;
@@ -3800,7 +3800,7 @@ static int char_value(struct compile_state *state,
case '?': c = '?'; str++; break;
case '\'': c = '\''; str++; break;
case '"': c = '"'; str++; break;
- case 'x':
+ case 'x':
c = 0;
str++;
while((str < end) && hexdigitp(*str)) {
@@ -3809,7 +3809,7 @@ static int char_value(struct compile_state *state,
str++;
}
break;
- case '0': case '1': case '2': case '3':
+ case '0': case '1': case '2': case '3':
case '4': case '5': case '6': case '7':
c = 0;
while((str < end) && octdigitp(*str)) {
@@ -3836,7 +3836,7 @@ static const char *next_char(struct file_state *file, const char *pos, int index
int c = *pos;
/* Is this a trigraph? */
if (file->trigraphs &&
- (c == '?') && ((end - pos) >= 3) && (pos[1] == '?'))
+ (c == '?') && ((end - pos) >= 3) && (pos[1] == '?'))
{
switch(pos[2]) {
case '=': c = '#'; break;
@@ -3890,7 +3890,7 @@ static int get_char(struct file_state *file, const char *pos)
c = *pos;
/* If it is a trigraph get the trigraph value */
if (file->trigraphs &&
- (c == '?') && ((end - pos) >= 3) && (pos[1] == '?'))
+ (c == '?') && ((end - pos) >= 3) && (pos[1] == '?'))
{
switch(pos[2]) {
case '=': c = '#'; break;
@@ -3935,7 +3935,7 @@ static size_t char_strlen(struct file_state *file, const char *src, const char *
return len;
}
-static void char_strcpy(char *dest,
+static void char_strcpy(char *dest,
struct file_state *file, const char *src, const char *end)
{
while(src < end) {
@@ -3946,7 +3946,7 @@ static void char_strcpy(char *dest,
}
}
-static char *char_strdup(struct file_state *file,
+static char *char_strdup(struct file_state *file,
const char *start, const char *end, const char *id)
{
char *str;
@@ -4006,7 +4006,7 @@ static void save_string(struct file_state *file,
tk->str_len = strlen(str);
}
-static void raw_next_token(struct compile_state *state,
+static void raw_next_token(struct compile_state *state,
struct file_state *file, struct token *tk)
{
const char *token;
@@ -4043,7 +4043,7 @@ static void raw_next_token(struct compile_state *state,
tokp = next_char(file, tokp, 1);
while((c = get_char(file, tokp)) != -1) {
/* Advance to the next character only after we verify
- * the current character is not a newline.
+ * the current character is not a newline.
* EOL is special to the preprocessor so we don't
* want to loose any.
*/
@@ -4135,12 +4135,12 @@ static void raw_next_token(struct compile_state *state,
/* Save the character value */
save_string(file, tk, token, tokp, "literal character");
}
- /* integer and floating constants
+ /* integer and floating constants
* Integer Constants
* {digits}
* 0[Xx]{hexdigits}
* 0{octdigit}+
- *
+ *
* Floating constants
* {digits}.{digits}[Ee][+-]?{digits}
* {digits}.{digits}
@@ -4250,9 +4250,9 @@ static void raw_next_token(struct compile_state *state,
}
}
/* C99 alternate macro characters */
- else if ((c == '%') && (c1 == ':') && (c2 == '%') && (c3 == ':')) {
+ else if ((c == '%') && (c1 == ':') && (c2 == '%') && (c3 == ':')) {
eat += 3;
- tok = TOK_CONCATENATE;
+ tok = TOK_CONCATENATE;
}
else if ((c == '.') && (c1 == '.') && (c2 == '.')) { eat += 2; tok = TOK_DOTS; }
else if ((c == '<') && (c1 == '<') && (c2 == '=')) { eat += 2; tok = TOK_SLEQ; }
@@ -4335,7 +4335,7 @@ struct macro_arg_value {
size_t len;
};
static struct macro_arg_value *read_macro_args(
- struct compile_state *state, struct macro *macro,
+ struct compile_state *state, struct macro *macro,
struct file_state *file, struct token *tk)
{
struct macro_arg_value *argv;
@@ -4357,15 +4357,15 @@ static struct macro_arg_value *read_macro_args(
}
paren_depth = 0;
i = 0;
-
+
for(;;) {
const char *start;
size_t len;
start = file->pos;
raw_next_token(state, file, tk);
-
+
if (!paren_depth && (tk->tok == TOK_COMMA) &&
- (argv[i].ident != state->i___VA_ARGS__))
+ (argv[i].ident != state->i___VA_ARGS__))
{
i++;
if (i >= macro->argc) {
@@ -4374,11 +4374,11 @@ static struct macro_arg_value *read_macro_args(
}
continue;
}
-
+
if (tk->tok == TOK_LPAREN) {
paren_depth++;
}
-
+
if (tk->tok == TOK_RPAREN) {
if (paren_depth == 0) {
break;
@@ -4396,7 +4396,7 @@ static struct macro_arg_value *read_macro_args(
argv[i].len += len;
}
if (i != macro->argc -1) {
- error(state, 0, "missing %s arg %d\n",
+ error(state, 0, "missing %s arg %d\n",
macro->ident->name, i +2);
}
return argv;
@@ -4458,14 +4458,14 @@ static void append_macro_chars(struct compile_state *state,
buf->pos += flen;
}
-static int compile_macro(struct compile_state *state,
+static int compile_macro(struct compile_state *state,
struct file_state **filep, struct token *tk);
-static void macro_expand_args(struct compile_state *state,
+static void macro_expand_args(struct compile_state *state,
struct macro *macro, struct macro_arg_value *argv, struct token *tk)
{
int i;
-
+
for(i = 0; i < macro->argc; i++) {
struct file_state fmacro, *file;
struct macro_buf buf;
@@ -4492,7 +4492,7 @@ static void macro_expand_args(struct compile_state *state,
file = &fmacro;
for(;;) {
raw_next_token(state, file, tk);
-
+
/* If we have recursed into another macro body
* get out of it.
*/
@@ -4518,7 +4518,7 @@ static void macro_expand_args(struct compile_state *state,
append_macro_chars(state, macro->ident->name, &buf,
file, tk->pos, file->pos);
}
-
+
xfree(argv[i].value);
argv[i].value = buf.str;
argv[i].len = buf.pos;
@@ -4551,12 +4551,12 @@ static void expand_macro(struct compile_state *state,
fmacro.macro = 1;
fmacro.trigraphs = 0;
fmacro.join_lines = 0;
-
+
/* Allocate a buffer to hold the macro expansion */
buf->len = macro->buf_len + 3;
buf->str = xmalloc(buf->len, macro->ident->name);
buf->pos = 0;
-
+
fstart = fmacro.pos;
raw_next_token(state, &fmacro, tk);
while(tk->tok != TOK_EOF) {
@@ -4600,7 +4600,7 @@ static void expand_macro(struct compile_state *state,
if (*str == '\\') {
str = "\\";
len = 2;
- }
+ }
else if (*str == '"') {
str = "\\\"";
len = 2;
@@ -4642,7 +4642,7 @@ static void expand_macro(struct compile_state *state,
}
append_macro_text(state, macro->ident->name, buf, fstart, flen);
-
+
fstart = fmacro.pos;
raw_next_token(state, &fmacro, tk);
}
@@ -4674,19 +4674,19 @@ static void tag_macro_name(struct compile_state *state,
fmacro.macro = 1;
fmacro.trigraphs = 0;
fmacro.join_lines = 0;
-
+
/* Allocate a new macro expansion buffer */
buf->len = macro->buf_len + 3;
buf->str = xmalloc(buf->len, macro->ident->name);
buf->pos = 0;
-
+
fstart = fmacro.pos;
raw_next_token(state, &fmacro, tk);
while(tk->tok != TOK_EOF) {
flen = fmacro.pos - fstart;
if ((tk->tok == TOK_IDENT) &&
(tk->ident == macro->ident) &&
- (tk->val.notmacro == 0))
+ (tk->val.notmacro == 0))
{
append_macro_text(state, macro->ident->name, buf, fstart, flen);
fstart = "$";
@@ -4694,14 +4694,14 @@ static void tag_macro_name(struct compile_state *state,
}
append_macro_text(state, macro->ident->name, buf, fstart, flen);
-
+
fstart = fmacro.pos;
raw_next_token(state, &fmacro, tk);
}
xfree(fmacro.buf);
}
-static int compile_macro(struct compile_state *state,
+static int compile_macro(struct compile_state *state,
struct file_state **filep, struct token *tk)
{
struct file_state *file;
@@ -4808,7 +4808,7 @@ static int if_value(struct compile_state *state)
offset = state->if_depth % CHAR_BIT;
return !!(state->if_bytes[index] & (1 << (offset)));
}
-static void set_if_value(struct compile_state *state, int value)
+static void set_if_value(struct compile_state *state, int value)
{
int index, offset;
index = state->if_depth / CHAR_BIT;
@@ -4871,8 +4871,8 @@ static void raw_token(struct compile_state *state, struct token *tk)
rescan = 0;
file = state->file;
/* Exit out of an include directive or macro call */
- if ((tk->tok == TOK_EOF) &&
- (file != state->macro_file) && file->prev)
+ if ((tk->tok == TOK_EOF) &&
+ (file != state->macro_file) && file->prev)
{
state->file = file->prev;
/* file->basename is used keep it */
@@ -4939,8 +4939,8 @@ static void token(struct compile_state *state, struct token *tk)
pp_token(state, tk);
}
}
- /* Eat tokens disabled by the preprocessor
- * (Unless we are parsing a preprocessor directive
+ /* Eat tokens disabled by the preprocessor
+ * (Unless we are parsing a preprocessor directive
*/
else if (if_eat(state) && (state->token_base == 0)) {
pp_token(state, tk);
@@ -4974,7 +4974,7 @@ static struct token *do_eat_token(struct compile_state *state, int tok)
struct token *tk;
int i;
check_tok(state, get_token(state, 1), tok);
-
+
/* Free the old token value */
tk = get_token(state, 0);
if (tk->str_len) {
@@ -5152,7 +5152,7 @@ static void preprocess(struct compile_state *state, struct token *current_token)
*/
int old_token_base;
int tok;
-
+
state->macro_file = state->file;
old_token_base = state->token_base;
@@ -5236,7 +5236,7 @@ static void preprocess(struct compile_state *state, struct token *current_token)
pp_eat(state, TOK_MUNDEF);
if (if_eat(state)) /* quit early when #if'd out */
break;
-
+
ident = pp_eat(state, TOK_MIDENT)->ident;
undef_macro(state, ident);
@@ -5246,7 +5246,7 @@ static void preprocess(struct compile_state *state, struct token *current_token)
pp_eat(state, TOK_MPRAGMA);
if (if_eat(state)) /* quit early when #if'd out */
break;
- warning(state, 0, "Ignoring pragma");
+ warning(state, 0, "Ignoring pragma");
break;
case TOK_MELIF:
pp_eat(state, TOK_MELIF);
@@ -5257,7 +5257,7 @@ static void preprocess(struct compile_state *state, struct token *current_token)
if (if_value(state)) {
eat_tokens(state, TOK_MENDIF);
}
- /* If the previous #if was not taken see if the #elif enables the
+ /* If the previous #if was not taken see if the #elif enables the
* trailing code.
*/
else {
@@ -5349,11 +5349,11 @@ static void preprocess(struct compile_state *state, struct token *current_token)
else if (tok == TOK_DOTS) {
pp_eat(state, TOK_DOTS);
aident = state->i___VA_ARGS__;
- }
+ }
else {
aident = pp_eat(state, TOK_MIDENT)->ident;
}
-
+
narg = xcmalloc(sizeof(*arg), "macro arg");
narg->ident = aident;
@@ -5395,7 +5395,7 @@ static void preprocess(struct compile_state *state, struct token *current_token)
mend = get_token(state, 1)->pos;
}
}
-
+
/* Now that I have found the body defined the token */
do_define_macro(state, ident,
char_strdup(state->file, mstart, mend, "macro buf"),
@@ -5406,7 +5406,7 @@ static void preprocess(struct compile_state *state, struct token *current_token)
{
const char *start, *end;
int len;
-
+
pp_eat(state, TOK_MERROR);
/* Find the start of the line */
raw_peek(state);
@@ -5427,13 +5427,13 @@ static void preprocess(struct compile_state *state, struct token *current_token)
{
const char *start, *end;
int len;
-
+
pp_eat(state, TOK_MWARNING);
/* Find the start of the line */
raw_peek(state);
start = get_token(state, 1)->pos;
-
+
/* Find the end of the line */
while((tok = raw_peek(state)) != TOK_EOL) {
raw_eat(state, tok);
@@ -5520,7 +5520,7 @@ static void preprocess(struct compile_state *state, struct token *current_token)
if (tok == TOK_MIDENT) {
name2 = get_token(state, 1)->ident->name;
}
- error(state, 0, "Invalid preprocessor directive: %s %s",
+ error(state, 0, "Invalid preprocessor directive: %s %s",
name1, name2);
break;
}
@@ -5605,7 +5605,7 @@ static struct type *invalid_type(struct compile_state *state, struct type *type)
case TYPE_STRUCT:
case TYPE_TUPLE:
member = type->left;
- while(member && (invalid == 0) &&
+ while(member && (invalid == 0) &&
((member->type & TYPE_MASK) == TYPE_PRODUCT)) {
invalid = invalid_type(state, member->left);
member = member->right;
@@ -5631,7 +5631,7 @@ static struct type *invalid_type(struct compile_state *state, struct type *type)
break;
}
return invalid;
-
+
}
#define MASK_UCHAR(X) ((X) & ((ulong_t)0xff))
@@ -5666,7 +5666,7 @@ static struct type void_ptr_type = {
};
#if DEBUG_ROMCC_WARNING
-static struct type void_func_type = {
+static struct type void_func_type = {
.type = TYPE_FUNCTION,
.left = &void_type,
.right = &void_type,
@@ -5799,19 +5799,19 @@ static void name_of(FILE *fp, struct type *type)
name_of(fp, type->right);
break;
case TYPE_ENUM:
- fprintf(fp, "enum %s",
+ fprintf(fp, "enum %s",
(type->type_ident)? type->type_ident->name : "");
qual_of(fp, type);
break;
case TYPE_STRUCT:
- fprintf(fp, "struct %s { ",
+ fprintf(fp, "struct %s { ",
(type->type_ident)? type->type_ident->name : "");
name_of(fp, type->left);
fprintf(fp, " } ");
qual_of(fp, type);
break;
case TYPE_UNION:
- fprintf(fp, "union %s { ",
+ fprintf(fp, "union %s { ",
(type->type_ident)? type->type_ident->name : "");
name_of(fp, type->left);
fprintf(fp, " } ");
@@ -5828,7 +5828,7 @@ static void name_of(FILE *fp, struct type *type)
fprintf(fp, " [%ld]", (long)(type->elements));
break;
case TYPE_TUPLE:
- fprintf(fp, "tuple { ");
+ fprintf(fp, "tuple { ");
name_of(fp, type->left);
fprintf(fp, " } ");
qual_of(fp, type);
@@ -5975,7 +5975,7 @@ static size_t align_of_in_bytes(struct compile_state *state, struct type *type)
static size_t size_of(struct compile_state *state, struct type *type);
static size_t reg_size_of(struct compile_state *state, struct type *type);
-static size_t needed_padding(struct compile_state *state,
+static size_t needed_padding(struct compile_state *state,
struct type *type, size_t offset)
{
size_t padding, align;
@@ -5997,7 +5997,7 @@ static size_t needed_padding(struct compile_state *state,
return padding;
}
-static size_t reg_needed_padding(struct compile_state *state,
+static size_t reg_needed_padding(struct compile_state *state,
struct type *type, size_t offset)
{
size_t padding, align;
@@ -6006,7 +6006,7 @@ static size_t reg_needed_padding(struct compile_state *state,
* fit into the current register.
*/
if (((type->type & TYPE_MASK) == TYPE_BITFIELD) &&
- (((offset + type->elements)/REG_SIZEOF_REG) != (offset/REG_SIZEOF_REG)))
+ (((offset + type->elements)/REG_SIZEOF_REG) != (offset/REG_SIZEOF_REG)))
{
align = REG_SIZEOF_REG;
}
@@ -6203,7 +6203,7 @@ static size_t size_of_in_bytes(struct compile_state *state, struct type *type)
return bits_to_bytes(size_of(state, type));
}
-static size_t field_offset(struct compile_state *state,
+static size_t field_offset(struct compile_state *state,
struct type *type, struct hash_entry *field)
{
struct type *member;
@@ -6244,7 +6244,7 @@ static size_t field_offset(struct compile_state *state,
return size;
}
-static size_t field_reg_offset(struct compile_state *state,
+static size_t field_reg_offset(struct compile_state *state,
struct type *type, struct hash_entry *field)
{
struct type *member;
@@ -6285,7 +6285,7 @@ static size_t field_reg_offset(struct compile_state *state,
return size;
}
-static struct type *field_type(struct compile_state *state,
+static struct type *field_type(struct compile_state *state,
struct type *type, struct hash_entry *field)
{
struct type *member;
@@ -6314,14 +6314,14 @@ static struct type *field_type(struct compile_state *state,
else {
internal_error(state, 0, "field_type only works on structures and unions");
}
-
+
if (!member || (member->field_ident != field)) {
error(state, 0, "member %s not present", field->name);
}
return member;
}
-static size_t index_offset(struct compile_state *state,
+static size_t index_offset(struct compile_state *state,
struct type *type, ulong_t index)
{
struct type *member;
@@ -6367,14 +6367,14 @@ static size_t index_offset(struct compile_state *state,
}
}
else {
- internal_error(state, 0,
+ internal_error(state, 0,
"request for index %u in something not an array, tuple or join",
index);
}
return size;
}
-static size_t index_reg_offset(struct compile_state *state,
+static size_t index_reg_offset(struct compile_state *state,
struct type *type, ulong_t index)
{
struct type *member;
@@ -6401,7 +6401,7 @@ static size_t index_reg_offset(struct compile_state *state,
if (i != index) {
internal_error(state, 0, "Missing member index: %u", index);
}
-
+
}
else if ((type->type & TYPE_MASK) == TYPE_JOIN) {
ulong_t i;
@@ -6421,7 +6421,7 @@ static size_t index_reg_offset(struct compile_state *state,
}
}
else {
- internal_error(state, 0,
+ internal_error(state, 0,
"request for index %u in something not an array, tuple or join",
index);
}
@@ -6472,7 +6472,7 @@ static struct type *index_type(struct compile_state *state,
}
else {
member = 0;
- internal_error(state, 0,
+ internal_error(state, 0,
"request for index %u in something not an array, tuple or join",
index);
}
@@ -6697,7 +6697,7 @@ static struct type *reg_type(
name_of(state->errout, type);
fprintf(state->errout, "\n");
internal_error(state, 0, "reg_type not yet defined for type");
-
+
}
}
/* If I have a single register compound type not a bit-field
@@ -6725,7 +6725,7 @@ static struct type *reg_type(
}
static struct type *next_field(struct compile_state *state,
- struct type *type, struct type *prev_member)
+ struct type *type, struct type *prev_member)
{
struct type *member;
if ((type->type & TYPE_MASK) != TYPE_STRUCT) {
@@ -6746,13 +6746,13 @@ static struct type *next_field(struct compile_state *state,
prev_member = 0;
}
if (prev_member) {
- internal_error(state, 0, "prev_member %s not present",
+ internal_error(state, 0, "prev_member %s not present",
prev_member->field_ident->name);
}
return member;
}
-typedef void (*walk_type_fields_cb_t)(struct compile_state *state, struct type *type,
+typedef void (*walk_type_fields_cb_t)(struct compile_state *state, struct type *type,
size_t ret_offset, size_t mem_offset, void *arg);
static void walk_type_fields(struct compile_state *state,
@@ -6775,15 +6775,15 @@ static void walk_struct_fields(struct compile_state *state,
if ((mtype->type & TYPE_MASK) == TYPE_PRODUCT) {
mtype = mtype->left;
}
- walk_type_fields(state, mtype,
- reg_offset +
+ walk_type_fields(state, mtype,
+ reg_offset +
field_reg_offset(state, type, mtype->field_ident),
- mem_offset +
+ mem_offset +
field_offset(state, type, mtype->field_ident),
cb, arg);
tptr = tptr->right;
}
-
+
}
static void walk_type_fields(struct compile_state *state,
@@ -7070,7 +7070,7 @@ static struct type *compatible_ptrs(struct type *left, struct type *right)
result = new_type(qual_type, result, 0);
}
return result;
-
+
}
static struct triple *integral_promotion(
struct compile_state *state, struct triple *def)
@@ -7090,7 +7090,7 @@ static struct triple *integral_promotion(
def->type = new_type(int_type, 0, 0);
}
else {
- def = triple(state, OP_CONVERT,
+ def = triple(state, OP_CONVERT,
new_type(int_type, 0, 0), def, 0);
}
}
@@ -7149,7 +7149,7 @@ static int is_compound_type(struct type *type)
case TYPE_STRUCT:
case TYPE_TUPLE:
case TYPE_UNION:
- case TYPE_JOIN:
+ case TYPE_JOIN:
is_compound = 1;
break;
default:
@@ -7189,8 +7189,8 @@ static int is_lvalue(struct compile_state *state, struct triple *def)
if (!def) {
return 0;
}
- if ((def->op == OP_ADECL) ||
- (def->op == OP_SDECL) ||
+ if ((def->op == OP_ADECL) ||
+ (def->op == OP_SDECL) ||
(def->op == OP_DEREF) ||
(def->op == OP_BLOBCONST) ||
(def->op == OP_LIST)) {
@@ -7207,7 +7207,7 @@ static void clvalue(struct compile_state *state, struct triple *def)
if (!def) {
internal_error(state, def, "nothing where lvalue expected?");
}
- if (!is_lvalue(state, def)) {
+ if (!is_lvalue(state, def)) {
error(state, def, "lvalue expected");
}
}
@@ -7251,7 +7251,7 @@ static struct triple *int_const(
static struct triple *read_expr(struct compile_state *state, struct triple *def);
-static struct triple *do_mk_addr_expr(struct compile_state *state,
+static struct triple *do_mk_addr_expr(struct compile_state *state,
struct triple *expr, struct type *type, ulong_t offset)
{
struct triple *result;
@@ -7260,7 +7260,7 @@ static struct triple *do_mk_addr_expr(struct compile_state *state,
ptr_type = new_type(TYPE_POINTER | (type->type & QUAL_MASK), type, 0);
-
+
result = 0;
if (expr->op == OP_ADECL) {
error(state, expr, "address of auto variables not supported");
@@ -7436,7 +7436,7 @@ static struct triple *read_expr(struct compile_state *state, struct triple *def)
return def;
}
-int is_write_compatible(struct compile_state *state,
+int is_write_compatible(struct compile_state *state,
struct type *dest, struct type *rval)
{
int compatible = 0;
@@ -7588,7 +7588,7 @@ struct type *ptr_arithmetic_result(
/* Sanity checks to ensure I am working with the proper types */
ptr_arithmetic(state, left);
arithmetic(state, right);
- if (TYPE_ARITHMETIC(left->type->type) &&
+ if (TYPE_ARITHMETIC(left->type->type) &&
TYPE_ARITHMETIC(right->type->type)) {
type = arithmetic_result(state, left, right);
}
@@ -7604,7 +7604,7 @@ struct type *ptr_arithmetic_result(
/* boolean helper function */
-static struct triple *ltrue_expr(struct compile_state *state,
+static struct triple *ltrue_expr(struct compile_state *state,
struct triple *expr)
{
switch(expr->op) {
@@ -7620,7 +7620,7 @@ static struct triple *ltrue_expr(struct compile_state *state,
return expr;
}
-static struct triple *lfalse_expr(struct compile_state *state,
+static struct triple *lfalse_expr(struct compile_state *state,
struct triple *expr)
{
return triple(state, OP_LFALSE, &int_type, expr, 0);
@@ -7636,15 +7636,15 @@ static struct triple *mkland_expr(
/* Generate some intermediate triples */
end = label(state);
var = variable(state, &int_type);
-
+
/* Store the left hand side value */
lstore = write_expr(state, var, left);
/* Jump if the value is false */
- jmp = branch(state, end,
+ jmp = branch(state, end,
lfalse_expr(state, read_expr(state, var)));
mid = label(state);
-
+
/* Store the right hand side value */
rstore = write_expr(state, var, right);
@@ -7653,7 +7653,7 @@ static struct triple *mkland_expr(
/* Generate the prog for a logical and */
def = mkprog(state, var, lstore, jmp, mid, rstore, end, val, 0UL);
-
+
return def;
}
@@ -7666,17 +7666,17 @@ static struct triple *mklor_expr(
/* Generate some intermediate triples */
end = label(state);
var = variable(state, &int_type);
-
+
/* Store the left hand side value */
left = write_expr(state, var, left);
-
+
/* Jump if the value is true */
jmp = branch(state, end, read_expr(state, var));
mid = label(state);
-
+
/* Store the right hand side value */
right = write_expr(state, var, right);
-
+
/* An expression for the computed value*/
val = read_expr(state, var);
@@ -7687,7 +7687,7 @@ static struct triple *mklor_expr(
}
static struct triple *mkcond_expr(
- struct compile_state *state,
+ struct compile_state *state,
struct triple *test, struct triple *left, struct triple *right)
{
struct triple *def, *val, *var, *jmp1, *jmp2, *top, *mid, *end;
@@ -7742,7 +7742,7 @@ static struct triple *mkcond_expr(
/* Store the right hand side value */
right = write_expr(state, var, right);
-
+
/* An expression for the computed value */
val = read_expr(state, var);
@@ -7834,7 +7834,7 @@ static struct triple *flatten_generic(
insert_triple(state, first, ptr);
ptr->id |= TRIPLE_FLAG_FLATTENED;
ptr->id &= ~TRIPLE_FLAG_LOCAL;
-
+
/* Now flatten the lhs elements */
for(i = 0; i < lhs; i++) {
struct triple **ins = &LHS(ptr, i);
@@ -7865,7 +7865,7 @@ static struct triple *flatten_prog(
unuse_triple(first, body->prev);
use_triple(body, body->prev);
}
-
+
if (!(val->id & TRIPLE_FLAG_FLATTENED)) {
internal_error(state, val, "val not flattened?");
}
@@ -7977,7 +7977,7 @@ static struct triple *flatten(
base = MISC(ptr, 0);
offset = bits_to_bytes(field_offset(state, base->type, ptr->u.field));
left = RHS(base, 0);
- ptr = triple(state, OP_ADD, left->type,
+ ptr = triple(state, OP_ADD, left->type,
read_expr(state, left),
int_const(state, &ulong_type, offset));
free_triple(state, base);
@@ -8198,8 +8198,8 @@ static struct triple *mk_add_expr(
if (!equiv_types(right->type, ptr_math)) {
right = mk_cast_expr(state, ptr_math, right);
}
- right = triple(state, op, ptr_math, right,
- int_const(state, ptr_math,
+ right = triple(state, op, ptr_math, right,
+ int_const(state, ptr_math,
size_of_in_bytes(state, left->type->left)));
}
return triple(state, OP_ADD, result_type, left, right);
@@ -8225,8 +8225,8 @@ static struct triple *mk_sub_expr(
if (!equiv_types(right->type, ptr_math)) {
right = mk_cast_expr(state, ptr_math, right);
}
- right = triple(state, op, ptr_math, right,
- int_const(state, ptr_math,
+ right = triple(state, op, ptr_math, right,
+ int_const(state, ptr_math,
size_of_in_bytes(state, left->type->left)));
}
return triple(state, OP_SUB, result_type, left, right);
@@ -8272,7 +8272,7 @@ static struct triple *mk_post_dec_expr(
struct triple *val;
lvalue(state, def);
val = read_expr(state, def);
- return triple(state, OP_VAL, def->type,
+ return triple(state, OP_VAL, def->type,
write_expr(state, def,
mk_sub_expr(state, val, int_const(state, &int_type, 1)))
, val);
@@ -8304,12 +8304,12 @@ static int is_simple_const(struct triple *ins)
/* Is this a constant that u.cval has the value.
* Or equivalently is this a constant that read_const
* works on.
- * So far only OP_INTCONST qualifies.
+ * So far only OP_INTCONST qualifies.
*/
return (ins->op == OP_INTCONST);
}
-static int constants_equal(struct compile_state *state,
+static int constants_equal(struct compile_state *state,
struct triple *left, struct triple *right)
{
int equal;
@@ -8386,7 +8386,7 @@ static long_t bit_count(ulong_t value)
}
}
return count;
-
+
}
#endif
@@ -8449,12 +8449,12 @@ static ulong_t read_const(struct compile_state *state,
struct triple *ins, struct triple *rhs)
{
switch(rhs->type->type &TYPE_MASK) {
- case TYPE_CHAR:
+ case TYPE_CHAR:
case TYPE_SHORT:
case TYPE_INT:
case TYPE_LONG:
- case TYPE_UCHAR:
- case TYPE_USHORT:
+ case TYPE_UCHAR:
+ case TYPE_USHORT:
case TYPE_UINT:
case TYPE_ULONG:
case TYPE_POINTER:
@@ -8504,7 +8504,7 @@ int const_eq(struct compile_state *state, struct triple *ins,
rval = read_const(state, ins, right);
result = (lval == rval);
}
- else if ((left->op == OP_ADDRCONST) &&
+ else if ((left->op == OP_ADDRCONST) &&
(right->op == OP_ADDRCONST)) {
result = (MISC(left, 0) == MISC(right, 0)) &&
(left->u.cval == right->u.cval);
@@ -8514,7 +8514,7 @@ int const_eq(struct compile_state *state, struct triple *ins,
result = -1;
}
return result;
-
+
}
int const_ucmp(struct compile_state *state, struct triple *ins,
@@ -8539,7 +8539,7 @@ int const_ucmp(struct compile_state *state, struct triple *ins,
result = -1;
}
}
- else if ((left->op == OP_ADDRCONST) &&
+ else if ((left->op == OP_ADDRCONST) &&
(right->op == OP_ADDRCONST) &&
(MISC(left, 0) == MISC(right, 0))) {
result = 0;
@@ -8636,7 +8636,7 @@ static void check_lhs(struct compile_state *state, struct triple *ins)
for(;expr;expr = triple_lhs(state, ins, expr)) {
internal_error(state, ins, "unexpected lhs");
}
-
+
}
#endif
@@ -8694,7 +8694,7 @@ static void wipe_branch(struct compile_state *state, struct triple *ins)
}
#endif
-static void mkcopy(struct compile_state *state,
+static void mkcopy(struct compile_state *state,
struct triple *ins, struct triple *rhs)
{
struct block *block;
@@ -8716,7 +8716,7 @@ static void mkcopy(struct compile_state *state,
use_triple(RHS(ins, 0), ins);
}
-static void mkconst(struct compile_state *state,
+static void mkconst(struct compile_state *state,
struct triple *ins, ulong_t value)
{
if (!is_integral(ins) && !is_pointer(ins)) {
@@ -8746,7 +8746,7 @@ static void mkaddr_const(struct compile_state *state,
}
#if DEBUG_DECOMPOSE_PRINT_TUPLES
-static void print_tuple(struct compile_state *state,
+static void print_tuple(struct compile_state *state,
struct triple *ins, struct triple *tuple)
{
FILE *fp = state->dbgout;
@@ -8757,11 +8757,11 @@ static void print_tuple(struct compile_state *state,
name_of(fp, LHS(tuple, 0)->type);
}
fprintf(fp, "\n");
-
+
}
#endif
-static struct triple *decompose_with_tuple(struct compile_state *state,
+static struct triple *decompose_with_tuple(struct compile_state *state,
struct triple *ins, struct triple *tuple)
{
struct triple *next;
@@ -8783,7 +8783,7 @@ static struct triple *decompose_with_tuple(struct compile_state *state,
propogate_use(state, ins, tuple);
release_triple(state, ins);
-
+
return next;
}
@@ -8801,7 +8801,7 @@ static struct triple *decompose_unknownval(struct compile_state *state,
#endif
get_occurance(ins->occurance);
- tuple = alloc_triple(state, OP_TUPLE, ins->type, -1, -1,
+ tuple = alloc_triple(state, OP_TUPLE, ins->type, -1, -1,
ins->occurance);
for(i = 0; i < tuple->lhs; i++) {
@@ -8818,7 +8818,7 @@ static struct triple *decompose_unknownval(struct compile_state *state,
}
-static struct triple *decompose_read(struct compile_state *state,
+static struct triple *decompose_read(struct compile_state *state,
struct triple *ins)
{
struct triple *tuple, *lval;
@@ -8834,7 +8834,7 @@ static struct triple *decompose_read(struct compile_state *state,
ins->occurance);
if ((tuple->lhs != lval->lhs) &&
- (!triple_is_def(state, lval) || (tuple->lhs != 1)))
+ (!triple_is_def(state, lval) || (tuple->lhs != 1)))
{
internal_error(state, ins, "lhs size inconsistency?");
}
@@ -8854,7 +8854,7 @@ static struct triple *decompose_read(struct compile_state *state,
}
get_occurance(tuple->occurance);
- read = alloc_triple(state, OP_READ, piece->type, -1, -1,
+ read = alloc_triple(state, OP_READ, piece->type, -1, -1,
tuple->occurance);
RHS(read, 0) = piece;
@@ -8881,12 +8881,12 @@ static struct triple *decompose_read(struct compile_state *state,
return decompose_with_tuple(state, ins, tuple);
}
-static struct triple *decompose_write(struct compile_state *state,
+static struct triple *decompose_write(struct compile_state *state,
struct triple *ins)
{
struct triple *tuple, *lval, *val;
ulong_t i;
-
+
lval = MISC(ins, 0);
val = RHS(ins, 0);
get_occurance(ins->occurance);
@@ -8894,7 +8894,7 @@ static struct triple *decompose_write(struct compile_state *state,
ins->occurance);
if ((tuple->lhs != lval->lhs) &&
- (!triple_is_def(state, lval) || tuple->lhs != 1))
+ (!triple_is_def(state, lval) || tuple->lhs != 1))
{
internal_error(state, ins, "lhs size inconsistency?");
}
@@ -8914,7 +8914,7 @@ static struct triple *decompose_write(struct compile_state *state,
}
pval = LHS(val, i);
}
-
+
/* See if the piece is really a bitref */
bitref = 0;
if (piece->op == OP_BITREF) {
@@ -8942,7 +8942,7 @@ static struct triple *decompose_write(struct compile_state *state,
}
get_occurance(tuple->occurance);
- write = alloc_triple(state, OP_WRITE, piece->type, -1, -1,
+ write = alloc_triple(state, OP_WRITE, piece->type, -1, -1,
tuple->occurance);
MISC(write, 0) = piece;
RHS(write, 0) = pval;
@@ -8961,7 +8961,7 @@ static void decompose_load_cb(struct compile_state *state,
{
struct decompose_load_info *info = arg;
struct triple *load;
-
+
if (reg_offset > info->tuple->lhs) {
internal_error(state, info->tuple, "lhs to small?");
}
@@ -8971,7 +8971,7 @@ static void decompose_load_cb(struct compile_state *state,
LHS(info->tuple, reg_offset/REG_SIZEOF_REG) = load;
}
-static struct triple *decompose_load(struct compile_state *state,
+static struct triple *decompose_load(struct compile_state *state,
struct triple *ins)
{
struct triple *tuple;
@@ -9004,7 +9004,7 @@ static void decompose_store_cb(struct compile_state *state,
{
struct decompose_store_info *info = arg;
struct triple *store;
-
+
if (reg_offset > info->tuple->lhs) {
internal_error(state, info->tuple, "lhs to small?");
}
@@ -9015,7 +9015,7 @@ static void decompose_store_cb(struct compile_state *state,
LHS(info->tuple, reg_offset/REG_SIZEOF_REG) = store;
}
-static struct triple *decompose_store(struct compile_state *state,
+static struct triple *decompose_store(struct compile_state *state,
struct triple *ins)
{
struct triple *tuple;
@@ -9037,7 +9037,7 @@ static struct triple *decompose_store(struct compile_state *state,
return decompose_with_tuple(state, ins, tuple);
}
-static struct triple *decompose_dot(struct compile_state *state,
+static struct triple *decompose_dot(struct compile_state *state,
struct triple *ins)
{
struct triple *tuple, *lval;
@@ -9059,7 +9059,7 @@ static struct triple *decompose_dot(struct compile_state *state,
#endif
get_occurance(ins->occurance);
- tuple = alloc_triple(state, OP_TUPLE, type, -1, -1,
+ tuple = alloc_triple(state, OP_TUPLE, type, -1, -1,
ins->occurance);
if (((ins->type->type & TYPE_MASK) == TYPE_BITFIELD) &&
@@ -9094,7 +9094,7 @@ static struct triple *decompose_dot(struct compile_state *state,
piece->u.bitfield.offset = reg_offset % REG_SIZEOF_REG;
}
else if ((reg_offset % REG_SIZEOF_REG) != 0) {
- internal_error(state, ins,
+ internal_error(state, ins,
"request for a nonbitfield sub register?");
}
@@ -9104,7 +9104,7 @@ static struct triple *decompose_dot(struct compile_state *state,
return decompose_with_tuple(state, ins, tuple);
}
-static struct triple *decompose_index(struct compile_state *state,
+static struct triple *decompose_index(struct compile_state *state,
struct triple *ins)
{
struct triple *tuple, *lval;
@@ -9124,7 +9124,7 @@ static struct triple *decompose_index(struct compile_state *state,
#endif
get_occurance(ins->occurance);
- tuple = alloc_triple(state, OP_TUPLE, type, -1, -1,
+ tuple = alloc_triple(state, OP_TUPLE, type, -1, -1,
ins->occurance);
for(i = 0; i < tuple->lhs; i++, idx++) {
@@ -9194,7 +9194,7 @@ static void decompose_compound_types(struct compile_state *state)
case OP_INDEX:
next = decompose_index(state, ins);
break;
-
+
}
#if DEBUG_DECOMPOSE_HIRES
fprintf(fp, "decompose next: %p \n", next);
@@ -9218,7 +9218,7 @@ static void decompose_compound_types(struct compile_state *state)
else {
release_triple(state, ins);
}
- }
+ }
ins = next;
} while(ins != first);
ins = first;
@@ -9227,7 +9227,7 @@ static void decompose_compound_types(struct compile_state *state)
if (ins->op == OP_BITREF) {
if (ins->use) {
internal_error(state, ins, "bitref used");
- }
+ }
else {
release_triple(state, ins);
}
@@ -9957,7 +9957,7 @@ static void simplify_sextract(struct compile_state *state, struct triple *ins)
val &= mask;
val <<= (SIZEOF_LONG - ins->u.bitfield.size);
sval = val;
- sval >>= (SIZEOF_LONG - ins->u.bitfield.size);
+ sval >>= (SIZEOF_LONG - ins->u.bitfield.size);
mkconst(state, ins, sval);
}
}
@@ -10078,7 +10078,7 @@ static struct triple *branch_target(struct compile_state *state, struct triple *
* loop back onto themselves. If I see one don't advance the
* target.
*/
- while(triple_is_structural(state, targ) &&
+ while(triple_is_structural(state, targ) &&
(targ->next != targ) && (targ->next != state->first)) {
targ = targ->next;
}
@@ -10095,7 +10095,7 @@ static void simplify_branch(struct compile_state *state, struct triple *ins)
if (ins->use != 0) {
internal_error(state, ins, "branch use");
}
- /* The challenge here with simplify branch is that I need to
+ /* The challenge here with simplify branch is that I need to
* make modifications to the control flow graph as well
* as to the branch instruction itself. That is handled
* by rebuilding the basic blocks after simplify all is called.
@@ -10112,7 +10112,7 @@ static void simplify_branch(struct compile_state *state, struct triple *ins)
struct triple *targ;
simplified = 0;
targ = branch_target(state, ins);
- if ((targ != ins) && (targ->op == OP_BRANCH) &&
+ if ((targ != ins) && (targ->op == OP_BRANCH) &&
!phi_dependency(targ->u.block))
{
unuse_triple(TARG(ins, 0), ins);
@@ -10192,7 +10192,7 @@ static void simplify_label(struct compile_state *state, struct triple *ins)
unuse_triple(ins, use);
use_triple(ins->prev, use);
}
-
+
}
}
if (ins->use) {
@@ -10229,7 +10229,7 @@ static void simplify_phi(struct compile_state *state, struct triple *ins)
return;
}
}
-
+
/* See if all of rhs members of a phi are the same */
value = slot[0];
for(i = 1; i < zrhs; i++) {
@@ -10357,11 +10357,11 @@ static const struct simplify_table {
[OP_BSF ] = { simplify_bsf, COMPILER_SIMPLIFY_OP },
[OP_BSR ] = { simplify_bsr, COMPILER_SIMPLIFY_OP },
[OP_RDMSR ] = { simplify_noop, COMPILER_SIMPLIFY_OP },
-[OP_WRMSR ] = { simplify_noop, COMPILER_SIMPLIFY_OP },
+[OP_WRMSR ] = { simplify_noop, COMPILER_SIMPLIFY_OP },
[OP_HLT ] = { simplify_noop, COMPILER_SIMPLIFY_OP },
};
-static inline void debug_simplify(struct compile_state *state,
+static inline void debug_simplify(struct compile_state *state,
simplify_t do_simplify, struct triple *ins)
{
#if DEBUG_SIMPLIFY_HIRES
@@ -10396,14 +10396,14 @@ static void simplify(struct compile_state *state, struct triple *ins)
else {
do_simplify = table_simplify[op].func;
}
- if (do_simplify &&
+ if (do_simplify &&
!(state->compiler->flags & table_simplify[op].flag)) {
do_simplify = simplify_noop;
}
if (do_simplify && (ins->id & TRIPLE_FLAG_VOLATILE)) {
do_simplify = simplify_noop;
}
-
+
if (!do_simplify) {
internal_error(state, ins, "cannot simplify op: %d %s",
op, tops(op));
@@ -10532,7 +10532,7 @@ static void register_builtin_function(struct compile_state *state,
ident = lookup(state, name, name_len);
ftype->type_ident = ident;
symbol(state, ident, &ident->sym_ident, def, ftype);
-
+
state->file = file.prev;
state->function = 0;
state->main_function = 0;
@@ -10579,7 +10579,7 @@ static struct type *register_builtin_type(struct compile_state *state,
name_len = strlen(name);
ident = lookup(state, name, name_len);
-
+
if ((type->type & TYPE_MASK) == TYPE_PRODUCT) {
ulong_t elements = 0;
struct type *field;
@@ -10628,23 +10628,23 @@ static void register_builtins(struct compile_state *state)
register_builtin_function(state, "__builtin_uldiv", OP_UDIVT, uldiv_type,
&ulong_type, &ulong_type);
- register_builtin_function(state, "__builtin_inb", OP_INB, &uchar_type,
+ register_builtin_function(state, "__builtin_inb", OP_INB, &uchar_type,
&ushort_type);
register_builtin_function(state, "__builtin_inw", OP_INW, &ushort_type,
&ushort_type);
- register_builtin_function(state, "__builtin_inl", OP_INL, &uint_type,
+ register_builtin_function(state, "__builtin_inl", OP_INL, &uint_type,
&ushort_type);
- register_builtin_function(state, "__builtin_outb", OP_OUTB, &void_type,
+ register_builtin_function(state, "__builtin_outb", OP_OUTB, &void_type,
&uchar_type, &ushort_type);
- register_builtin_function(state, "__builtin_outw", OP_OUTW, &void_type,
+ register_builtin_function(state, "__builtin_outw", OP_OUTW, &void_type,
&ushort_type, &ushort_type);
- register_builtin_function(state, "__builtin_outl", OP_OUTL, &void_type,
+ register_builtin_function(state, "__builtin_outl", OP_OUTL, &void_type,
&uint_type, &ushort_type);
-
- register_builtin_function(state, "__builtin_bsf", OP_BSF, &int_type,
+
+ register_builtin_function(state, "__builtin_bsf", OP_BSF, &int_type,
&int_type);
- register_builtin_function(state, "__builtin_bsr", OP_BSR, &int_type,
+ register_builtin_function(state, "__builtin_bsr", OP_BSR, &int_type,
&int_type);
msr_type = register_builtin_type(state, "__builtin_msr_t",
@@ -10655,13 +10655,13 @@ static void register_builtins(struct compile_state *state)
&ulong_type);
register_builtin_function(state, "__builtin_wrmsr", OP_WRMSR, &void_type,
&ulong_type, &ulong_type, &ulong_type);
-
- register_builtin_function(state, "__builtin_hlt", OP_HLT, &void_type,
+
+ register_builtin_function(state, "__builtin_hlt", OP_HLT, &void_type,
&void_type);
}
static struct type *declarator(
- struct compile_state *state, struct type *type,
+ struct compile_state *state, struct type *type,
struct hash_entry **ident, int need_ident);
static void decl(struct compile_state *state, struct triple *first);
static struct type *specifier_qualifier_list(struct compile_state *state);
@@ -11189,8 +11189,8 @@ static struct triple *shift_expr(struct compile_state *state)
right = read_expr(state, add_expr(state));
integral(state, right);
right = integral_promotion(state, right);
-
- op = (tok == TOK_SL)? OP_SL :
+
+ op = (tok == TOK_SL)? OP_SL :
is_signed(left->type)? OP_SSR: OP_USR;
def = triple(state, op, left->type, left, right);
@@ -11364,7 +11364,7 @@ static struct triple *lor_expr(struct compile_state *state)
right = read_expr(state, land_expr(state));
bool(state, right);
- def = mklor_expr(state,
+ def = mklor_expr(state,
ltrue_expr(state, left),
ltrue_expr(state, right));
}
@@ -11438,7 +11438,7 @@ static struct triple *eval_const_expr(
do {
valid_ins(state, ptr);
if ((ptr->op == OP_PHI) || (ptr->op == OP_LIST)) {
- internal_error(state, ptr,
+ internal_error(state, ptr,
"unexpected %s in constant expression",
tops(ptr->op));
}
@@ -11453,8 +11453,8 @@ static struct triple *eval_const_expr(
else if (triple_is_cbranch(state, ptr)) {
struct triple *cond_val;
cond_val = get_cv(state, cv, RHS(ptr, 0));
- if (!cond_val || !is_const(cond_val) ||
- (cond_val->op != OP_INTCONST))
+ if (!cond_val || !is_const(cond_val) ||
+ (cond_val->op != OP_INTCONST))
{
internal_error(state, ptr, "bad branch condition");
}
@@ -11470,16 +11470,16 @@ static struct triple *eval_const_expr(
else if (ptr->op == OP_WRITE) {
struct triple *val;
val = get_cv(state, cv, RHS(ptr, 0));
-
- set_cv(state, cv, MISC(ptr, 0),
+
+ set_cv(state, cv, MISC(ptr, 0),
copy_triple(state, val));
- set_cv(state, cv, ptr,
+ set_cv(state, cv, ptr,
copy_triple(state, val));
ptr = ptr->next;
}
else if (ptr->op == OP_READ) {
- set_cv(state, cv, ptr,
- copy_triple(state,
+ set_cv(state, cv, ptr,
+ copy_triple(state,
get_cv(state, cv, RHS(ptr, 0))));
ptr = ptr->next;
}
@@ -11500,7 +11500,7 @@ static struct triple *eval_const_expr(
else {
error(state, ptr, "impure operation in constant expression");
}
-
+
} while(ptr != head);
/* Get the result value */
@@ -11546,7 +11546,7 @@ static struct triple *assignment_expr(struct compile_state *state)
* a larger set of statements than standard C. As long
* as the subset of the grammar that is standard C behaves
* correctly this should cause no problems.
- *
+ *
* For the extra token strings accepted by the grammar
* none of them should produce a valid lvalue, so they
* should not produce functioning programs.
@@ -11559,7 +11559,7 @@ static struct triple *assignment_expr(struct compile_state *state)
case TOK_EQ:
lvalue(state, left);
eat(state, TOK_EQ);
- def = write_expr(state, left,
+ def = write_expr(state, left,
read_expr(state, assignment_expr(state)));
break;
case TOK_TIMESEQ:
@@ -11579,7 +11579,7 @@ static struct triple *assignment_expr(struct compile_state *state)
case TOK_MODEQ: op = sign? OP_SMOD : OP_UMOD; break;
}
def = write_expr(state, left,
- triple(state, op, left->type,
+ triple(state, op, left->type,
read_expr(state, left), right));
break;
case TOK_PLUSEQ:
@@ -11615,7 +11615,7 @@ static struct triple *assignment_expr(struct compile_state *state)
case TOK_OREQ: op = OP_OR; break;
}
def = write_expr(state, left,
- triple(state, op, left->type,
+ triple(state, op, left->type,
read_expr(state, left), right));
break;
}
@@ -11692,7 +11692,7 @@ static void for_statement(struct compile_state *state, struct triple *first)
head = test = tail = jmp1 = jmp2 = 0;
if (peek(state) != TOK_SEMI) {
head = expr(state);
- }
+ }
eat(state, TOK_SEMI);
if (peek(state) != TOK_SEMI) {
test = expr(state);
@@ -11824,7 +11824,7 @@ static void return_statement(struct compile_state *state, struct triple *first)
eat(state, TOK_SEMI);
/* See if this last statement in a function */
- last = ((peek(state) == TOK_RBRACE) &&
+ last = ((peek(state) == TOK_RBRACE) &&
(state->scope_depth == GLOBAL_SCOPE_DEPTH +2));
/* Find the return variable */
@@ -12167,7 +12167,7 @@ static void asm_statement(struct compile_state *state, struct triple *first)
for(i = 0; i < out; i++) {
struct triple *constraint;
constraint = out_param[i].constraint;
- info->tmpl.lhs[i] = arch_reg_constraint(state,
+ info->tmpl.lhs[i] = arch_reg_constraint(state,
out_param[i].expr->type, constraint->u.blob);
free_triple(state, constraint);
}
@@ -12197,9 +12197,9 @@ static void asm_statement(struct compile_state *state, struct triple *first)
}
info->tmpl.lhs[val] = cinfo;
info->tmpl.rhs[i] = cinfo;
-
+
} else {
- info->tmpl.rhs[i] = arch_reg_constraint(state,
+ info->tmpl.rhs[i] = arch_reg_constraint(state,
in_param[i].expr->type, str);
}
free_triple(state, constraint);
@@ -12219,7 +12219,7 @@ static void asm_statement(struct compile_state *state, struct triple *first)
size_t size = arch_reg_size(info->tmpl.lhs[i].reg);
if (size >= SIZEOF_LONG) {
type = &ulong_type;
- }
+ }
else if (size >= SIZEOF_INT) {
type = &uint_type;
}
@@ -12296,7 +12296,7 @@ static void statement(struct compile_state *state, struct triple *first)
compound_statement(state, first);
}
else if (tok == TOK_IF) {
- if_statement(state, first);
+ if_statement(state, first);
}
else if (tok == TOK_FOR) {
for_statement(state, first);
@@ -12326,7 +12326,7 @@ static void statement(struct compile_state *state, struct triple *first)
asm_statement(state, first);
}
else if ((tok == TOK_IDENT) && (peek2(state) == TOK_COLON)) {
- labeled_statement(state, first);
+ labeled_statement(state, first);
}
else if (tok == TOK_CASE) {
case_statement(state, first);
@@ -12348,7 +12348,7 @@ static struct type *param_decl(struct compile_state *state)
struct type *type;
struct hash_entry *ident;
/* Cheat so the declarator will know we are not global */
- start_scope(state);
+ start_scope(state);
ident = 0;
type = decl_specifiers(state);
type = declarator(state, type, &ident, 0);
@@ -12388,7 +12388,7 @@ static struct type *type_name(struct compile_state *state)
}
static struct type *direct_declarator(
- struct compile_state *state, struct type *type,
+ struct compile_state *state, struct type *type,
struct hash_entry **pident, int need_ident)
{
struct hash_entry *ident;
@@ -12466,7 +12466,7 @@ static struct type *direct_declarator(
}
static struct type *declarator(
- struct compile_state *state, struct type *type,
+ struct compile_state *state, struct type *type,
struct hash_entry **pident, int need_ident)
{
while(peek(state) == TOK_STAR) {
@@ -12485,7 +12485,7 @@ static struct type *typedef_name(
ident = eat(state, TOK_TYPE_NAME)->ident;
type = ident->sym_ident->type;
specifiers |= type->type & QUAL_MASK;
- if ((specifiers & (STOR_MASK | QUAL_MASK)) !=
+ if ((specifiers & (STOR_MASK | QUAL_MASK)) !=
(type->type & (STOR_MASK | QUAL_MASK))) {
type = clone_type(specifiers, type);
}
@@ -12519,7 +12519,7 @@ static struct type *enum_specifier(
struct type *entry;
eident = eat(state, TOK_IDENT)->ident;
if (eident->sym_ident) {
- error(state, 0, "%s already declared",
+ error(state, 0, "%s already declared",
eident->name);
}
eident->tok = TOK_ENUM_CONST;
@@ -12652,13 +12652,13 @@ static struct type *struct_or_union_specifier(
symbol(state, ident, &ident->sym_tag, 0, struct_type);
}
}
- if (ident && ident->sym_tag &&
- ident->sym_tag->type &&
+ if (ident && ident->sym_tag &&
+ ident->sym_tag->type &&
((ident->sym_tag->type->type & TYPE_MASK) == type_main)) {
struct_type = clone_type(spec, ident->sym_tag->type);
}
else if (ident && !struct_type) {
- error(state, 0, "%s %s undeclared",
+ error(state, 0, "%s %s undeclared",
(type_main == TYPE_STRUCT)?"struct" : "union",
ident->name);
}
@@ -12943,7 +12943,7 @@ static struct type *type_specifier(
type = typedef_name(state, spec);
break;
default:
- error(state, 0, "bad type specifier %s",
+ error(state, 0, "bad type specifier %s",
tokens[tok]);
break;
}
@@ -13123,7 +13123,7 @@ static struct triple *initializer(
(equiv_types(type->left, result->type->left))) {
type->elements = result->type->elements;
}
- if (is_lvalue(state, result) &&
+ if (is_lvalue(state, result) &&
((result->type->type & TYPE_MASK) == TYPE_ARRAY) &&
(type->type & TYPE_MASK) != TYPE_ARRAY)
{
@@ -13189,7 +13189,7 @@ static struct triple *initializer(
}
dest = ((char *)buf) + bits_to_bytes(info.offset);
#if DEBUG_INITIALIZER
- fprintf(state->errout, "dest = buf + %d max_offset: %d value_size: %d op: %d\n",
+ fprintf(state->errout, "dest = buf + %d max_offset: %d value_size: %d op: %d\n",
dest - buf,
bits_to_bytes(max_offset),
bits_to_bytes(value_size),
@@ -13221,7 +13221,7 @@ static struct triple *initializer(
info.offset += value_size;
if ((type->type & TYPE_MASK) == TYPE_STRUCT) {
info.type = next_field(state, type, info.type);
- info.offset = field_offset(state, type,
+ info.offset = field_offset(state, type,
info.type->field_ident);
}
} while(comma && (peek(state) != TOK_RBRACE));
@@ -13316,7 +13316,7 @@ static struct triple *function_definition(
if (((param->type & TYPE_MASK) != TYPE_VOID) && !param->field_ident) {
error(state, 0, "No identifier for paramter %d\n", i);
}
-
+
/* Get a list of statements for this function. */
def = triple(state, OP_LIST, type, 0, 0);
@@ -13339,7 +13339,7 @@ static struct triple *function_definition(
ctype->elements = 1;
/* Add a variable for the return value */
- crtype = new_type(TYPE_TUPLE,
+ crtype = new_type(TYPE_TUPLE,
/* Remove all type qualifiers from the return type */
new_type(TYPE_PRODUCT, ctype, clone_type(0, type->left)), 0);
crtype->elements = 2;
@@ -13372,7 +13372,7 @@ static struct triple *function_definition(
}
/* Add the declaration static const char __func__ [] = "func-name" */
- fname_type = new_type(TYPE_ARRAY,
+ fname_type = new_type(TYPE_ARRAY,
clone_type(QUAL_CONST | STOR_STATIC, &char_type), 0);
fname_type->type |= QUAL_CONST | STOR_STATIC;
fname_type->elements = strlen(state->function) + 1;
@@ -13417,7 +13417,7 @@ static struct triple *function_definition(
return def;
}
-static struct triple *do_decl(struct compile_state *state,
+static struct triple *do_decl(struct compile_state *state,
struct type *type, struct hash_entry *ident)
{
struct triple *def;
@@ -13451,7 +13451,7 @@ static struct triple *do_decl(struct compile_state *state,
if ((type->type & TYPE_MASK) == TYPE_FUNCTION) {
error(state, 0, "Function prototypes not supported");
}
- if (ident &&
+ if (ident &&
((type->type & STOR_MASK) == STOR_STATIC) &&
((type->type & QUAL_CONST) == 0)) {
error(state, 0, "non const static variables not supported");
@@ -13494,8 +13494,8 @@ static void decl(struct compile_state *state, struct triple *first)
}
eat(state, TOK_EQ);
flatten(state, first,
- init_expr(state,
- ident->sym_ident->def,
+ init_expr(state,
+ ident->sym_ident->def,
initializer(state, type)));
}
arrays_complete(state, type);
@@ -13531,7 +13531,7 @@ static void decls(struct compile_state *state)
}
}
-/*
+/*
* Function inlining
*/
struct triple_reg_set {
@@ -13554,21 +13554,21 @@ static void walk_blocks(struct compile_state *state, struct basic_blocks *bb,
void *arg);
static void print_block(
struct compile_state *state, struct block *block, void *arg);
-static int do_triple_set(struct triple_reg_set **head,
+static int do_triple_set(struct triple_reg_set **head,
struct triple *member, struct triple *new_member);
static void do_triple_unset(struct triple_reg_set **head, struct triple *member);
static struct reg_block *compute_variable_lifetimes(
struct compile_state *state, struct basic_blocks *bb);
-static void free_variable_lifetimes(struct compile_state *state,
+static void free_variable_lifetimes(struct compile_state *state,
struct basic_blocks *bb, struct reg_block *blocks);
#if DEBUG_EXPLICIT_CLOSURES
-static void print_live_variables(struct compile_state *state,
+static void print_live_variables(struct compile_state *state,
struct basic_blocks *bb, struct reg_block *rb, FILE *fp);
#endif
static struct triple *call(struct compile_state *state,
- struct triple *retvar, struct triple *ret_addr,
+ struct triple *retvar, struct triple *ret_addr,
struct triple *targ, struct triple *ret)
{
struct triple *call;
@@ -13647,19 +13647,19 @@ static void mark_live(struct compile_state *state, struct triple *func, void *ar
static void mark_live_functions(struct compile_state *state)
{
- /* Ensure state->main_function is the last function in
+ /* Ensure state->main_function is the last function in
* the list of functions.
*/
if ((state->main_function->next != state->functions) ||
(state->functions->prev != state->main_function)) {
- internal_error(state, 0,
+ internal_error(state, 0,
"state->main_function is not at the end of the function list ");
}
state->main_function->u.cval = 1;
reverse_walk_functions(state, mark_live, 0);
}
-static int local_triple(struct compile_state *state,
+static int local_triple(struct compile_state *state,
struct triple *func, struct triple *ins)
{
int local = (ins->id & TRIPLE_FLAG_LOCAL);
@@ -13673,7 +13673,7 @@ static int local_triple(struct compile_state *state,
return local;
}
-struct triple *copy_func(struct compile_state *state, struct triple *ofunc,
+struct triple *copy_func(struct compile_state *state, struct triple *ofunc,
struct occurance *base_occurance)
{
struct triple *nfunc;
@@ -13716,7 +13716,7 @@ struct triple *copy_func(struct compile_state *state, struct triple *ofunc,
}
new->id |= TRIPLE_FLAG_FLATTENED;
new->id |= old->id & TRIPLE_FLAG_COPY;
-
+
/* During the copy remember new as user of old */
use_triple(old, new);
@@ -13755,7 +13755,7 @@ struct triple *copy_func(struct compile_state *state, struct triple *ofunc,
old = old->next;
new = new->next;
} while((old != ofirst) && (new != nfirst));
-
+
/* Make a third pass to cleanup the extra useses */
old = ofirst;
new = nfirst;
@@ -13804,7 +13804,7 @@ static void expand_inline_call(
}
result = 0;
if ((nfunc->type->left->type & TYPE_MASK) != TYPE_VOID) {
- result = read_expr(state,
+ result = read_expr(state,
deref_index(state, fresult(state, nfunc), 1));
}
if (state->compiler->debug & DEBUG_INLINE) {
@@ -13816,8 +13816,8 @@ static void expand_inline_call(
fprintf(fp, "__________ %s _________ done\n\n", __FUNCTION__);
}
- /*
- * Get rid of the extra triples
+ /*
+ * Get rid of the extra triples
*/
/* Remove the read of the return address */
ins = RHS(nfunc, 0)->prev->prev;
@@ -13833,7 +13833,7 @@ static void expand_inline_call(
release_triple(state, ins);
/* Remove the retaddres variable */
retvar = fretaddr(state, nfunc);
- if ((retvar->lhs != 1) ||
+ if ((retvar->lhs != 1) ||
(retvar->op != OP_ADECL) ||
(retvar->next->op != OP_PIECE) ||
(MISC(retvar->next, 0) != retvar)) {
@@ -13876,7 +13876,7 @@ static void expand_inline_call(
/*
*
* Type of the result variable.
- *
+ *
* result
* |
* +----------+------------+
@@ -13886,7 +13886,7 @@ static void expand_inline_call(
* +------------------+---------------+
* | |
* closure1 ... closuerN
- * | |
+ * | |
* +----+--+-+--------+-----+ +----+----+---+-----+
* | | | | | | | | |
* var1 var2 var3 ... varN result var1 var2 ... varN result
@@ -13904,7 +13904,7 @@ static void expand_inline_call(
* var1 var2 ... varN result var1 var2 ... varN result
*/
-static int add_closure_type(struct compile_state *state,
+static int add_closure_type(struct compile_state *state,
struct triple *func, struct type *closure_type)
{
struct type *type, *ctype, **next;
@@ -13937,19 +13937,19 @@ static int add_closure_type(struct compile_state *state,
fprintf(fp, "new_type: ");
name_of(fp, type);
fprintf(fp, "\n");
- fprintf(fp, "ctype: %p %d bits: %d ",
+ fprintf(fp, "ctype: %p %d bits: %d ",
ctype, ctype->elements, reg_size_of(state, ctype));
name_of(fp, ctype);
fprintf(fp, "\n");
#endif
-
+
/* Regenerate the variable with the new type definition */
new_var = pre_triple(state, var, OP_ADECL, type, 0, 0);
new_var->id |= TRIPLE_FLAG_FLATTENED;
for(i = 0; i < new_var->lhs; i++) {
LHS(new_var, i)->id |= TRIPLE_FLAG_FLATTENED;
}
-
+
/* Point everyone at the new variable */
propogate_use(state, var, new_var);
@@ -13958,7 +13958,7 @@ static int add_closure_type(struct compile_state *state,
release_triple(state, LHS(var, i));
}
release_triple(state, var);
-
+
/* Return the index of the added closure type */
return ctype->elements - 1;
}
@@ -14053,7 +14053,7 @@ static int lookup_closure_index(struct compile_state *state,
for(index0 = ins->next->next;
(index0->op == OP_INDEX) &&
(MISC(index0, 0) == result) &&
- (index0->u.cval == 0) ;
+ (index0->u.cval == 0) ;
index0 = write->next)
{
index1 = index0->next;
@@ -14097,12 +14097,12 @@ static void compute_closure_variables(struct compile_state *state,
int i, max_index;
#define MAX_INDICIES (sizeof(used_indicies)*CHAR_BIT)
#define ID_BITS(X) ((X) & (TRIPLE_FLAG_LOCAL -1))
- struct {
+ struct {
unsigned id;
int index;
} *info;
-
+
/* Find the basic blocks of this function */
bb.func = me;
bb.first = RHS(me, 0);
@@ -14151,7 +14151,7 @@ static void compute_closure_variables(struct compile_state *state,
ins = ins->next;
} while(ins != first);
- /*
+ /*
* Build the list of variables to enclose.
*
* A target it to put the same variable in the
@@ -14336,7 +14336,7 @@ static void expand_function_call(
if (!*closure_next) {
*closure_next = type;
} else {
- *closure_next = new_type(TYPE_PRODUCT, *closure_next,
+ *closure_next = new_type(TYPE_PRODUCT, *closure_next,
type);
closure_next = &(*closure_next)->right;
}
@@ -14396,22 +14396,22 @@ static void expand_function_call(
/* Initialize the return value */
if ((rtype->type & TYPE_MASK) != TYPE_VOID) {
- flatten(state, ret_loc,
- write_expr(state,
+ flatten(state, ret_loc,
+ write_expr(state,
deref_index(state, fresult(state, func), 1),
new_triple(state, OP_UNKNOWNVAL, rtype, 0, 0)));
}
ret_addr = flatten(state, ret_loc, ret_addr);
ret_set = flatten(state, ret_loc, write_expr(state, retvar, ret_addr));
- jmp = flatten(state, ret_loc,
+ jmp = flatten(state, ret_loc,
call(state, retvar, ret_addr, func_first, func_last));
/* Find the result */
if ((rtype->type & TYPE_MASK) != TYPE_VOID) {
struct triple * result;
- result = flatten(state, first,
- read_expr(state,
+ result = flatten(state, first,
+ read_expr(state,
deref_index(state, fresult(state, func), 1)));
propogate_use(state, fcall, result);
@@ -14430,7 +14430,7 @@ static void expand_function_call(
}
/* Generate an expression for the value */
new = flatten(state, first,
- read_expr(state,
+ read_expr(state,
closure_expr(state, func, closure_idx, i)));
@@ -14443,7 +14443,7 @@ static void expand_function_call(
/*
* If the original is a value update the dominated uses.
*/
-
+
/* Analyze the basic blocks so I can see who dominates whom */
bb.func = me;
bb.first = RHS(me, 0);
@@ -14451,7 +14451,7 @@ static void expand_function_call(
bb.func = 0;
}
analyze_basic_blocks(state, &bb);
-
+
#if DEBUG_EXPLICIT_CLOSURES
fprintf(state->errout, "Updating domindated uses: %p -> %p\n",
@@ -14459,7 +14459,7 @@ static void expand_function_call(
#endif
/* If fcall dominates the use update the expression */
for(use = set->member->use; use; use = next) {
- /* Replace use modifies the use chain and
+ /* Replace use modifies the use chain and
* removes use, so I must take a copy of the
* next entry early.
*/
@@ -14652,7 +14652,7 @@ static void insert_function(struct compile_state *state,
if (state->compiler->debug & DEBUG_INLINE) {
FILE *fp = state->errout;
- fprintf(fp, "%s func count: %d\n",
+ fprintf(fp, "%s func count: %d\n",
func->type->type_ident->name, func->u.cval);
}
if (func->u.cval == 0) {
@@ -14677,7 +14677,7 @@ struct triple *input_asm(struct compile_state *state)
struct asm_info *info;
struct triple *def;
int i, out;
-
+
info = xcmalloc(sizeof(*info), "asm_info");
info->str = "";
@@ -14687,7 +14687,7 @@ struct triple *input_asm(struct compile_state *state)
def = new_triple(state, OP_ASM, &void_type, out, 0);
def->u.ainfo = info;
def->id |= TRIPLE_FLAG_VOLATILE;
-
+
for(i = 0; i < out; i++) {
struct triple *piece;
piece = triple(state, OP_PIECE, &int_type, def, 0);
@@ -14703,7 +14703,7 @@ struct triple *output_asm(struct compile_state *state)
struct asm_info *info;
struct triple *def;
int in;
-
+
info = xcmalloc(sizeof(*info), "asm_info");
info->str = "";
@@ -14713,7 +14713,7 @@ struct triple *output_asm(struct compile_state *state)
def = new_triple(state, OP_ASM, &void_type, 0, in);
def->u.ainfo = info;
def->id |= TRIPLE_FLAG_VOLATILE;
-
+
return def;
}
@@ -14750,11 +14750,11 @@ static void join_functions(struct compile_state *state)
/* Verify the external arguments */
if (registers_of(state, args_type) > ARCH_INPUT_REGS) {
- error(state, state->main_function,
+ error(state, state->main_function,
"Too many external input arguments");
}
if (registers_of(state, result_type) > ARCH_OUTPUT_REGS) {
- error(state, state->main_function,
+ error(state, state->main_function,
"Too many external output arguments");
}
@@ -14784,8 +14784,8 @@ static void join_functions(struct compile_state *state)
param = param->left;
}
if (registers_of(state, param) != 1) {
- error(state, state->main_function,
- "Arg: %d %s requires multiple registers",
+ error(state, state->main_function,
+ "Arg: %d %s requires multiple registers",
idx + 1, param->field_ident->name);
}
expr = read_expr(state, LHS(in, idx));
@@ -14793,7 +14793,7 @@ static void join_functions(struct compile_state *state)
expr = flatten(state, call, expr);
use_triple(expr, call);
- idx++;
+ idx++;
}
@@ -14832,7 +14832,7 @@ static void join_functions(struct compile_state *state)
}
/* Allocate a dummy containing function */
- func = triple(state, OP_LIST,
+ func = triple(state, OP_LIST,
new_type(TYPE_FUNCTION, &void_type, &void_type), 0, 0);
func->type->type_ident = lookup(state, "", 0);
RHS(func, 0) = state->first;
@@ -14861,7 +14861,7 @@ static void join_functions(struct compile_state *state)
static int do_use_block(
- struct block *used, struct block_set **head, struct block *user,
+ struct block *used, struct block_set **head, struct block *user,
int front)
{
struct block_set **ptr, *new;
@@ -14916,13 +14916,13 @@ static void use_block(struct block *used, struct block *user)
/* Append new to the head of the list, print_block
* depends on this.
*/
- count = do_use_block(used, &used->use, user, 1);
+ count = do_use_block(used, &used->use, user, 1);
used->users += count;
}
static void unuse_block(struct block *used, struct block *unuser)
{
int count;
- count = do_unuse_block(used, &used->use, unuser);
+ count = do_unuse_block(used, &used->use, unuser);
used->users -= count;
}
@@ -14981,7 +14981,7 @@ static void unipdomf_block(struct block *block, struct block *unipdomf)
}
static int walk_triples(
- struct compile_state *state,
+ struct compile_state *state,
int (*cb)(struct compile_state *state, struct triple *ptr, void *arg),
void *arg)
{
@@ -15014,7 +15014,7 @@ static int do_print_triple(struct compile_state *state, struct triple *ins, void
}
display_triple(fp, ins);
- if (triple_is_branch(state, ins) && ins->use &&
+ if (triple_is_branch(state, ins) && ins->use &&
(ins->op != OP_RET) && (ins->op != OP_FCALL)) {
internal_error(state, ins, "branch used?");
}
@@ -15135,7 +15135,7 @@ static void free_basic_block(struct compile_state *state, struct block *block)
while((edge = block->edges)) {
child = edge->member;
remove_block_edge(block, child);
-
+
if (child && (child->vertex != -1)) {
free_basic_block(state, child);
}
@@ -15146,7 +15146,7 @@ static void free_basic_block(struct compile_state *state, struct block *block)
#endif
}
-static void free_basic_blocks(struct compile_state *state,
+static void free_basic_blocks(struct compile_state *state,
struct basic_blocks *bb)
{
struct triple *first, *ins;
@@ -15161,10 +15161,10 @@ static void free_basic_blocks(struct compile_state *state,
}
ins = ins->next;
} while(ins != first);
-
+
}
-static struct block *basic_block(struct compile_state *state,
+static struct block *basic_block(struct compile_state *state,
struct basic_blocks *bb, struct triple *first)
{
struct block *block;
@@ -15183,7 +15183,7 @@ static struct block *basic_block(struct compile_state *state,
block->vertex = bb->last_vertex;
ptr = first;
do {
- if ((ptr != first) && triple_is_label(state, ptr) && (ptr->use)) {
+ if ((ptr != first) && triple_is_label(state, ptr) && (ptr->use)) {
break;
}
block->last = ptr;
@@ -15198,7 +15198,7 @@ static struct block *basic_block(struct compile_state *state,
} while (ptr != bb->first);
if ((ptr == bb->first) ||
((ptr->next == bb->first) && (
- triple_is_end(state, ptr) ||
+ triple_is_end(state, ptr) ||
triple_is_ret(state, ptr))))
{
/* The block has no outflowing edges */
@@ -15263,7 +15263,7 @@ static struct block *basic_block(struct compile_state *state,
struct block_set *edge;
FILE *fp = state->errout;
fprintf(fp, "basic_block: %10p [%2d] ( %10p - %10p )",
- block, block->vertex,
+ block, block->vertex,
block->first, block->last);
for(edge = block->edges; edge; edge = edge->next) {
fprintf(fp, " %10p [%2d]",
@@ -15307,7 +15307,7 @@ static void print_block(
FILE *fp = arg;
fprintf(fp, "\nblock: %p (%d) ",
- block,
+ block,
block->vertex);
for(edge = block->edges; edge; edge = edge->next) {
@@ -15331,7 +15331,7 @@ static void print_block(
}
fprintf(fp, "users %d: ", block->users);
for(user = block->use; user; user = user->next) {
- fprintf(fp, "%p (%d) ",
+ fprintf(fp, "%p (%d) ",
user->member,
user->member->vertex);
}
@@ -15357,7 +15357,7 @@ static void print_blocks(struct compile_state *state, const char *func, FILE *fp
}
}
-static void prune_nonblock_triples(struct compile_state *state,
+static void prune_nonblock_triples(struct compile_state *state,
struct basic_blocks *bb)
{
struct block *block;
@@ -15389,7 +15389,7 @@ static void prune_nonblock_triples(struct compile_state *state,
} while(ins != first);
}
-static void setup_basic_blocks(struct compile_state *state,
+static void setup_basic_blocks(struct compile_state *state,
struct basic_blocks *bb)
{
if (!triple_stores_block(state, bb->first)) {
@@ -15404,8 +15404,8 @@ static void setup_basic_blocks(struct compile_state *state,
bb->first_block = basic_block(state, bb, bb->first);
/* Be certain the last instruction of a function, or the
- * entire program is in a basic block. When it is not find
- * the start of the block, insert a label if necessary and build
+ * entire program is in a basic block. When it is not find
+ * the start of the block, insert a label if necessary and build
* basic block. Then add a fake edge from the start block
* to the final block.
*/
@@ -15421,7 +15421,7 @@ static void setup_basic_blocks(struct compile_state *state,
add_block_edge(bb->first_block, tail, 0);
use_block(tail, bb->first_block);
}
-
+
/* Find the last basic block.
*/
bb->last_block = block_of_triple(state, bb->first->prev);
@@ -15522,7 +15522,7 @@ static int initialize_spdblock(
return vertex;
}
-static int setup_spdblocks(struct compile_state *state,
+static int setup_spdblocks(struct compile_state *state,
struct basic_blocks *bb, struct sdom_block *sd)
{
struct block *block;
@@ -15532,7 +15532,7 @@ static int setup_spdblocks(struct compile_state *state,
/* Walk through the graph and find unconnected blocks. Add a
* fake edge from the unconnected blocks to the end of the
- * graph.
+ * graph.
*/
block = bb->first_block->last->next->u.block;
for(; block && block != bb->first_block; block = block->last->next->u.block) {
@@ -15576,16 +15576,16 @@ static void compress_ancestors(struct sdom_block *v)
}
}
-static void compute_sdom(struct compile_state *state,
+static void compute_sdom(struct compile_state *state,
struct basic_blocks *bb, struct sdom_block *sd)
{
int i;
- /* // step 2
+ /* // step 2
* for each v <= pred(w) {
* u = EVAL(v);
- * if (semi[u] < semi[w] {
- * semi[w] = semi[u];
- * }
+ * if (semi[u] < semi[w] {
+ * semi[w] = semi[u];
+ * }
* }
* add w to bucket(vertex(semi[w]));
* LINK(parent(w), w);
@@ -15620,22 +15620,22 @@ static void compute_sdom(struct compile_state *state,
next = v->sdom_next;
unsdom_block(v);
u = (!v->ancestor) ? v : (compress_ancestors(v), v->label);
- v->block->idom = (u->sdom->vertex < v->sdom->vertex)?
+ v->block->idom = (u->sdom->vertex < v->sdom->vertex)?
u->block : parent->block;
}
}
}
-static void compute_spdom(struct compile_state *state,
+static void compute_spdom(struct compile_state *state,
struct basic_blocks *bb, struct sdom_block *sd)
{
int i;
- /* // step 2
+ /* // step 2
* for each v <= pred(w) {
* u = EVAL(v);
- * if (semi[u] < semi[w] {
- * semi[w] = semi[u];
- * }
+ * if (semi[u] < semi[w] {
+ * semi[w] = semi[u];
+ * }
* }
* add w to bucket(vertex(semi[w]));
* LINK(parent(w), w);
@@ -15669,13 +15669,13 @@ static void compute_spdom(struct compile_state *state,
next = v->sdom_next;
unsdom_block(v);
u = (!v->ancestor) ? v : (compress_ancestors(v), v->label);
- v->block->ipdom = (u->sdom->vertex < v->sdom->vertex)?
+ v->block->ipdom = (u->sdom->vertex < v->sdom->vertex)?
u->block : parent->block;
}
}
}
-static void compute_idom(struct compile_state *state,
+static void compute_idom(struct compile_state *state,
struct basic_blocks *bb, struct sdom_block *sd)
{
int i;
@@ -15690,7 +15690,7 @@ static void compute_idom(struct compile_state *state,
sd[1].block->idom = 0;
}
-static void compute_ipdom(struct compile_state *state,
+static void compute_ipdom(struct compile_state *state,
struct basic_blocks *bb, struct sdom_block *sd)
{
int i;
@@ -15707,13 +15707,13 @@ static void compute_ipdom(struct compile_state *state,
/* Theorem 1:
* Every vertex of a flowgraph G = (V, E, r) except r has
- * a unique immediate dominator.
+ * a unique immediate dominator.
* The edges {(idom(w), w) |w <= V - {r}} form a directed tree
- * rooted at r, called the dominator tree of G, such that
+ * rooted at r, called the dominator tree of G, such that
* v dominates w if and only if v is a proper ancestor of w in
* the dominator tree.
*/
- /* Lemma 1:
+ /* Lemma 1:
* If v and w are vertices of G such that v <= w,
* than any path from v to w must contain a common ancestor
* of v and w in T.
@@ -15726,7 +15726,7 @@ static void compute_ipdom(struct compile_state *state,
* sdom(u) >= sdom(w). Then idom(w) = sdom(w).
*/
/* Theorem 3:
- * Let w != r and let u be a vertex for which sdom(u) is
+ * Let w != r and let u be a vertex for which sdom(u) is
* minimum amoung vertices u satisfying sdom(w) -> u -> w.
* Then sdom(u) <= sdom(w) and idom(u) = idom(w).
*/
@@ -15744,11 +15744,11 @@ static void find_immediate_dominators(struct compile_state *state,
/* Theorem 4:
* For any vertex w != r.
* sdom(w) = min(
- * {v|(v,w) <= E and v < w } U
+ * {v|(v,w) <= E and v < w } U
* {sdom(u) | u > w and there is an edge (v, w) such that u -> v})
*/
/* Corollary 1:
- * Let w != r and let u be a vertex for which sdom(u) is
+ * Let w != r and let u be a vertex for which sdom(u) is
* minimum amoung vertices u satisfying sdom(w) -> u -> w.
* Then:
* { sdom(w) if sdom(w) = sdom(u),
@@ -15756,7 +15756,7 @@ static void find_immediate_dominators(struct compile_state *state,
* { idom(u) otherwise
*/
/* The algorithm consists of the following 4 steps.
- * Step 1. Carry out a depth-first search of the problem graph.
+ * Step 1. Carry out a depth-first search of the problem graph.
* Number the vertices from 1 to N as they are reached during
* the search. Initialize the variables used in succeeding steps.
* Step 2. Compute the semidominators of all vertices by applying
@@ -15896,7 +15896,7 @@ static void print_dominated2(
for(i = 0; i < depth; i++) {
fprintf(fp, " ");
}
- fprintf(fp, "%3d: %p (%p - %p) @",
+ fprintf(fp, "%3d: %p (%p - %p) @",
block->vertex, block, block->first, block->last);
ins = block->first;
while(ins != block->last && (ins->occurance->line == 0)) {
@@ -15947,7 +15947,7 @@ static int print_frontiers(
fprintf(fp, " %d", user->member->vertex);
}
fprintf(fp, "\n");
-
+
for(edge = block->edges; edge; edge = edge->next) {
vertex = print_frontiers(state, fp, edge->member, vertex);
}
@@ -15958,7 +15958,7 @@ static void print_dominance_frontiers(struct compile_state *state,
{
fprintf(fp, "\ndominance frontiers\n");
print_frontiers(state, fp, bb->first_block, 0);
-
+
}
static void analyze_idominators(struct compile_state *state, struct basic_blocks *bb)
@@ -16024,7 +16024,7 @@ static void print_ipdominance_frontiers(struct compile_state *state,
{
fprintf(fp, "\nipdominance frontiers\n");
print_pfrontiers(state, fp, bb->last_block, 0);
-
+
}
static void analyze_ipdominators(struct compile_state *state,
@@ -16060,7 +16060,7 @@ static int tdominates(struct compile_state *state,
bsub = block_of_triple(state, sub);
if (bdom != bsub) {
result = bdominates(state, bdom, bsub);
- }
+ }
else {
struct triple *ins;
if (!bdom || !bsub) {
@@ -16106,7 +16106,7 @@ static void insert_phi_operations(struct compile_state *state)
if (!triple_is_auto_var(state, var) || !var->use) {
continue;
}
-
+
iter += 1;
work_list = 0;
work_list_tail = &work_list;
@@ -16119,7 +16119,7 @@ static void insert_phi_operations(struct compile_state *state)
continue;
}
if (user->member->op != OP_WRITE) {
- internal_error(state, user->member,
+ internal_error(state, user->member,
"bad variable access");
}
block = user->member->u.block;
@@ -16152,7 +16152,7 @@ static void insert_phi_operations(struct compile_state *state)
/* Insert a phi function for this variable */
get_occurance(var->occurance);
phi = alloc_triple(
- state, OP_PHI, var->type, -1, in_edges,
+ state, OP_PHI, var->type, -1, in_edges,
var->occurance);
phi->u.block = front;
MISC(phi, 0) = var;
@@ -16555,7 +16555,7 @@ static void prune_unused_phis(struct compile_state *state)
struct triple *first, *phi;
struct phi_triple *live;
int phis, i;
-
+
/* Find the first instruction */
first = state->first;
@@ -16566,7 +16566,7 @@ static void prune_unused_phis(struct compile_state *state)
phis += 1;
}
}
-
+
/* Mark them all dead */
live = xcmalloc(sizeof(*live) * (phis + 1), "phi_triple");
phis = 0;
@@ -16580,7 +16580,7 @@ static void prune_unused_phis(struct compile_state *state)
phi->id = phis;
phis += 1;
}
-
+
/* Mark phis alive that are used by non phis */
for(i = 0; i < phis; i++) {
struct triple_set *set;
@@ -16613,7 +16613,7 @@ static void prune_unused_phis(struct compile_state *state)
slot[j] = unknown;
use_triple(unknown, phi);
transform_to_arch_instruction(state, unknown);
-#if 0
+#if 0
warning(state, phi, "variable not set at index %d on all paths to use", j);
#endif
}
@@ -16747,7 +16747,7 @@ static void transform_from_ssa_form(struct compile_state *state)
}
var = post_triple(state, phi, OP_ADECL, phi->type, 0, 0);
var = var->next; /* point at the var */
-
+
/* Replaces use of phi with var */
propogate_use(state, phi, var);
@@ -16800,7 +16800,7 @@ static void transform_from_ssa_form(struct compile_state *state)
if (!eblock->first) {
internal_error(state, 0, "empty block?");
}
-
+
/* Make certain the write is placed in the edge block... */
/* Walk through the edge block backwards to find an
* appropriate location for the OP_WRITE.
@@ -16847,7 +16847,7 @@ static void transform_from_ssa_form(struct compile_state *state)
/* Release the phi function */
release_triple(state, phi);
}
-
+
/* Walk all of the operations to find the adecls */
for(var = first->next; var != first ; var = var->next) {
struct triple_set *use, *use_next;
@@ -16864,7 +16864,7 @@ static void transform_from_ssa_form(struct compile_state *state)
int zrhs, i, used;
use_next = use->next;
user = use->member;
-
+
/* Generate a read of var */
read = pre_triple(state, user, OP_READ, var->type, var, 0);
use_triple(var, read);
@@ -16883,7 +16883,7 @@ static void transform_from_ssa_form(struct compile_state *state)
if (used) {
unuse_triple(var, user);
use_triple(read, user);
- }
+ }
/* If we didn't use it release the extra triple */
else {
release_triple(state, read);
@@ -16895,7 +16895,7 @@ static void transform_from_ssa_form(struct compile_state *state)
#define HI() if (state->compiler->debug & DEBUG_REBUILD_SSA_FORM) { \
FILE *fp = state->dbgout; \
fprintf(fp, "@ %s:%d\n", __FILE__, __LINE__); romcc_print_blocks(state, fp); \
- }
+ }
static void rebuild_ssa_form(struct compile_state *state)
{
@@ -16910,7 +16910,7 @@ HI();
HI();
rename_variables(state);
HI();
-
+
prune_block_variables(state, state->bb.first_block);
HI();
prune_unused_phis(state);
@@ -16918,7 +16918,7 @@ HI();
}
#undef HI
-/*
+/*
* Register conflict resolution
* =========================================================
*/
@@ -16948,7 +16948,7 @@ static struct reg_info find_def_color(
if (tinfo.reg >= MAX_REGISTERS) {
tinfo.reg = REG_UNSET;
}
- if ((tinfo.reg != REG_UNSET) &&
+ if ((tinfo.reg != REG_UNSET) &&
(info.reg != REG_UNSET) &&
(tinfo.reg != info.reg)) {
internal_error(state, def, "register conflict");
@@ -17201,7 +17201,7 @@ static struct triple *typed_pre_copy(
use_triple(in, ins);
transform_to_arch_instruction(state, in);
return in;
-
+
}
static struct triple *pre_copy(
struct compile_state *state, struct triple *ins, int index)
@@ -17258,7 +17258,7 @@ static void insert_copies_to_phi(struct compile_state *state)
move->u.block = eblock;
move->id |= TRIPLE_FLAG_PRE_SPLIT;
use_triple(val, move);
-
+
slot[edge] = move;
unuse_triple(val, phi);
use_triple(move, phi);
@@ -17315,7 +17315,7 @@ struct triple_reg_set;
struct reg_block;
-static int do_triple_set(struct triple_reg_set **head,
+static int do_triple_set(struct triple_reg_set **head,
struct triple *member, struct triple *new_member)
{
struct triple_reg_set **ptr, *new;
@@ -17433,7 +17433,7 @@ static struct triple *part_to_piece(struct compile_state *state, struct triple *
return ins;
}
-static int this_def(struct compile_state *state,
+static int this_def(struct compile_state *state,
struct triple *ins, struct triple *other)
{
if (ins == other) {
@@ -17611,7 +17611,7 @@ static struct reg_block *compute_variable_lifetimes(
return blocks;
}
-static void free_variable_lifetimes(struct compile_state *state,
+static void free_variable_lifetimes(struct compile_state *state,
struct basic_blocks *bb, struct reg_block *blocks)
{
int i;
@@ -17634,16 +17634,16 @@ static void free_variable_lifetimes(struct compile_state *state,
}
typedef void (*wvl_cb_t)(
- struct compile_state *state,
- struct reg_block *blocks, struct triple_reg_set *live,
+ struct compile_state *state,
+ struct reg_block *blocks, struct triple_reg_set *live,
struct reg_block *rb, struct triple *ins, void *arg);
static void walk_variable_lifetimes(struct compile_state *state,
- struct basic_blocks *bb, struct reg_block *blocks,
+ struct basic_blocks *bb, struct reg_block *blocks,
wvl_cb_t cb, void *arg)
{
int i;
-
+
for(i = 1; i <= state->bb.last_vertex; i++) {
struct triple_reg_set *live;
struct triple_reg_set *entry, *next;
@@ -17678,7 +17678,7 @@ static void walk_variable_lifetimes(struct compile_state *state,
* going on.
*/
cb(state, blocks, live, rb, ptr, arg);
-
+
/* Remove the current definition from live */
do_triple_unset(&live, ptr);
@@ -17731,7 +17731,7 @@ static void print_live_variables_block(
block, block->vertex);
for(edge = block->edges; edge; edge = edge->next) {
fprintf(fp, " %p<-%p",
- edge->member,
+ edge->member,
edge->member && edge->member->use?edge->member->use->member : 0);
}
fprintf(fp, "\n");
@@ -17785,7 +17785,7 @@ static void print_live_variables_block(
fprintf(fp, "\n");
}
-static void print_live_variables(struct compile_state *state,
+static void print_live_variables(struct compile_state *state,
struct basic_blocks *bb, struct reg_block *rb, FILE *fp)
{
struct print_live_variable_info info;
@@ -17821,7 +17821,7 @@ struct dead_triple {
#define TRIPLE_FLAG_FREE 1
};
-static void print_dead_triples(struct compile_state *state,
+static void print_dead_triples(struct compile_state *state,
struct dead_triple *dtriple)
{
struct triple *first, *ins;
@@ -17839,7 +17839,7 @@ static void print_dead_triples(struct compile_state *state,
if ((ins->op == OP_LABEL) && (ins->use)) {
fprintf(fp, "\n%p:\n", ins);
}
- fprintf(fp, "%c",
+ fprintf(fp, "%c",
(dt->flags & TRIPLE_FLAG_ALIVE)?' ': '-');
display_triple(fp, ins);
if (triple_is_branch(state, ins)) {
@@ -17906,7 +17906,7 @@ static void eliminate_inefectual_code(struct compile_state *state)
/* Now put then in an array and mark all of the triples dead */
dtriple = xcmalloc(sizeof(*dtriple) * (triples + 1), "dtriples");
-
+
ins = first;
i = 1;
block = 0;
@@ -17977,7 +17977,7 @@ static void eliminate_inefectual_code(struct compile_state *state)
}
print_dead_triples(state, dtriple);
for(dt = &dtriple[1]; dt <= &dtriple[triples]; dt++) {
- if ((dt->triple->op == OP_NOOP) &&
+ if ((dt->triple->op == OP_NOOP) &&
(dt->flags & TRIPLE_FLAG_ALIVE)) {
internal_error(state, dt->triple, "noop effective?");
}
@@ -18036,13 +18036,13 @@ static void insert_mandatory_copies(struct compile_state *state)
if (i < 0) {
continue;
}
-
+
/* Find the users color requirements */
rinfo = arch_reg_rhs(state, entry->member, i);
if (rinfo.reg >= MAX_REGISTERS) {
rinfo.reg = REG_UNSET;
}
-
+
/* See if I need a pre_copy */
if (rinfo.reg != REG_UNSET) {
if ((reg != REG_UNSET) && (reg != rinfo.reg)) {
@@ -18059,14 +18059,14 @@ static void insert_mandatory_copies(struct compile_state *state)
* They do not take up any registers until a
* copy places them in one.
*/
- if ((info.reg == REG_UNNEEDED) &&
+ if ((info.reg == REG_UNNEEDED) &&
(rinfo.reg != REG_UNNEEDED)) {
do_pre_copy = 1;
}
}
do_post_copy =
!do_pre_copy &&
- (((info.reg != REG_UNSET) &&
+ (((info.reg != REG_UNSET) &&
(reg != REG_UNSET) &&
(info.reg != reg)) ||
((info.regcm & regcm) == 0));
@@ -18082,7 +18082,7 @@ static void insert_mandatory_copies(struct compile_state *state)
if (i < 0) {
continue;
}
-
+
/* Find the users color requirements */
rinfo = arch_reg_rhs(state, entry->member, i);
if (rinfo.reg >= MAX_REGISTERS) {
@@ -18131,7 +18131,7 @@ static void insert_mandatory_copies(struct compile_state *state)
}
}
regcm &= rinfo.regcm;
-
+
}
if (do_post_copy) {
struct reg_info pre, post;
@@ -18225,7 +18225,7 @@ static void print_interference_block(
block, block->vertex);
for(edge = block->edges; edge; edge = edge->next) {
fprintf(fp, " %p<-%p",
- edge->member,
+ edge->member,
edge->member && edge->member->use?edge->member->use->member : 0);
}
fprintf(fp, "\n");
@@ -18271,7 +18271,7 @@ static void print_interference_block(
op = ptr->op;
done = (ptr == block->last);
lr = rstate->lrd[ptr->id].lr;
-
+
id = ptr->id;
ptr->id = rstate->lrd[id].orig_id;
SET_REG(ptr->id, lr->color);
@@ -18436,7 +18436,7 @@ static struct lre_hash **lre_probe(struct reg_state *rstate,
right = tmp;
}
index = hash_live_edge(left, right);
-
+
ptr = &rstate->hash[index];
while(*ptr) {
if (((*ptr)->left == left) && ((*ptr)->right == right)) {
@@ -18455,7 +18455,7 @@ static int interfere(struct reg_state *rstate,
return ptr && *ptr;
}
-static void add_live_edge(struct reg_state *rstate,
+static void add_live_edge(struct reg_state *rstate,
struct live_range *left, struct live_range *right)
{
/* FIXME the memory allocation overhead is noticeable here... */
@@ -18494,7 +18494,7 @@ static void add_live_edge(struct reg_state *rstate,
edge->node = right;
left->edges = edge;
left->degree += 1;
-
+
edge = xmalloc(sizeof(*edge), "live_range_edge");
edge->next = right->edges;
edge->node = left;
@@ -18546,7 +18546,7 @@ static void remove_live_edges(struct reg_state *rstate, struct live_range *range
}
}
-static void transfer_live_edges(struct reg_state *rstate,
+static void transfer_live_edges(struct reg_state *rstate,
struct live_range *dest, struct live_range *src)
{
struct live_range_edge *edge, *next;
@@ -18561,7 +18561,7 @@ static void transfer_live_edges(struct reg_state *rstate,
/* Interference graph...
- *
+ *
* new(n) --- Return a graph with n nodes but no edges.
* add(g,x,y) --- Return a graph including g with an between x and y
* interfere(g, x, y) --- Return true if there exists an edge between the nodes
@@ -18574,11 +18574,11 @@ static void transfer_live_edges(struct reg_state *rstate,
* The adjacency vectors support an efficient implementation of neighbors.
*/
-/*
+/*
* +---------------------------------------------------+
* | +--------------+ |
* v v | |
- * renumber -> build graph -> colalesce -> spill_costs -> simplify -> select
+ * renumber -> build graph -> colalesce -> spill_costs -> simplify -> select
*
* -- In simplify implment optimistic coloring... (No backtracking)
* -- Implement Rematerialization it is the only form of spilling we can perform
@@ -18594,7 +18594,7 @@ static void transfer_live_edges(struct reg_state *rstate,
#if DEBUG_ROMCC_WARNING
static void different_colored(
- struct compile_state *state, struct reg_state *rstate,
+ struct compile_state *state, struct reg_state *rstate,
struct triple *parent, struct triple *ins)
{
struct live_range *lr;
@@ -18630,13 +18630,13 @@ static struct live_range *coalesce_ranges(
}
if ((lr1->color == REG_UNNEEDED) ||
(lr2->color == REG_UNNEEDED)) {
- internal_error(state, 0,
+ internal_error(state, 0,
"cannot coalesce live ranges without a possible color");
}
if ((lr1->color != lr2->color) &&
(lr1->color != REG_UNSET) &&
(lr2->color != REG_UNSET)) {
- internal_error(state, lr1->defs->def,
+ internal_error(state, lr1->defs->def,
"cannot coalesce live ranges of different colors");
}
color = lr1->color;
@@ -18667,7 +18667,7 @@ static struct live_range *coalesce_ranges(
/* If there is a clear dominate live range put it in lr1,
* For purposes of this test phi functions are
* considered dominated by the definitions that feed into
- * them.
+ * them.
*/
if ((lr1->defs->prev->def->op == OP_PHI) ||
((lr2->defs->prev->def->op != OP_PHI) &&
@@ -18698,12 +18698,12 @@ static struct live_range *coalesce_ranges(
lr2->defs->def,
lr2->color);
#endif
-
+
/* Append lr2 onto lr1 */
#if DEBUG_ROMCC_WARNINGS
#warning "FIXME should this be a merge instead of a splice?"
#endif
- /* This FIXME item applies to the correctness of live_range_end
+ /* This FIXME item applies to the correctness of live_range_end
* and to the necessity of making multiple passes of coalesce_live_ranges.
* A failure to find some coalesce opportunities in coaleace_live_ranges
* does not impact the correct of the compiler just the efficiency with
@@ -18713,7 +18713,7 @@ static struct live_range *coalesce_ranges(
mid1 = lr1->defs->prev;
mid2 = lr2->defs;
end = lr2->defs->prev;
-
+
head->prev = end;
end->next = head;
@@ -18818,7 +18818,7 @@ static void initialize_live_ranges(
rstate->lr[i].classes = info.regcm;
rstate->lr[i].degree = 0;
rstate->lrd[j].lr = &rstate->lr[i];
- }
+ }
/* Otherwise give the triple the dummy live range. */
else {
rstate->lrd[j].lr = &rstate->lr[0];
@@ -18845,7 +18845,7 @@ static void initialize_live_ranges(
if (ins->id > rstate->defs) {
internal_error(state, ins, "bad id");
}
-
+
/* Walk through the template of ins and coalesce live ranges */
zlhs = ins->lhs;
if ((zlhs == 0) && triple_is_def(state, ins)) {
@@ -18891,7 +18891,7 @@ static void initialize_live_ranges(
}
if (rinfo.reg == linfo.reg) {
- coalesce_ranges(state, rstate,
+ coalesce_ranges(state, rstate,
lhs->lr, rhs->lr);
}
}
@@ -18901,8 +18901,8 @@ static void initialize_live_ranges(
}
static void graph_ins(
- struct compile_state *state,
- struct reg_block *blocks, struct triple_reg_set *live,
+ struct compile_state *state,
+ struct reg_block *blocks, struct triple_reg_set *live,
struct reg_block *rb, struct triple *ins, void *arg)
{
struct reg_state *rstate = arg;
@@ -18917,7 +18917,7 @@ static void graph_ins(
return;
}
def = rstate->lrd[ins->id].lr;
-
+
/* Create an edge between ins and everything that is
* alive, unless the live_range cannot share
* a physical register with ins.
@@ -18965,8 +18965,8 @@ static struct live_range *get_verify_live_range(
}
static void verify_graph_ins(
- struct compile_state *state,
- struct reg_block *blocks, struct triple_reg_set *live,
+ struct compile_state *state,
+ struct reg_block *blocks, struct triple_reg_set *live,
struct reg_block *rb, struct triple *ins, void *arg)
{
struct reg_state *rstate = arg;
@@ -18987,17 +18987,17 @@ static void verify_graph_ins(
}
lr2 = get_verify_live_range(state, rstate, entry2->member);
if (lr1 == lr2) {
- internal_error(state, entry2->member,
+ internal_error(state, entry2->member,
"live range with 2 values simultaneously alive");
}
if (!arch_regcm_intersect(lr1->classes, lr2->classes)) {
continue;
}
if (!interfere(rstate, lr1, lr2)) {
- internal_error(state, entry2->member,
+ internal_error(state, entry2->member,
"edges don't interfere?");
}
-
+
lr1_found = 0;
lr2_degree = 0;
for(edge2 = lr2->edges; edge2; edge2 = edge2->next) {
@@ -19021,8 +19021,8 @@ static void verify_graph_ins(
#endif
static void print_interference_ins(
- struct compile_state *state,
- struct reg_block *blocks, struct triple_reg_set *live,
+ struct compile_state *state,
+ struct reg_block *blocks, struct triple_reg_set *live,
struct reg_block *rb, struct triple *ins, void *arg)
{
struct reg_state *rstate = arg;
@@ -19092,7 +19092,7 @@ static int coalesce_live_ranges(
* Forcing a value to stay in a single register
* for an extended period of time does have
* limitations when applied to non homogenous
- * register pool.
+ * register pool.
*
* The two cases I have identified are:
* 1) Two forced register assignments may
@@ -19110,7 +19110,7 @@ static int coalesce_live_ranges(
* functions. This creates a 2 headed live
* range that cannot be sanely split.
*
- * - phi functions (coalesced in initialize_live_ranges)
+ * - phi functions (coalesced in initialize_live_ranges)
* are handled as pre split live ranges so we will
* never attempt to split them.
*/
@@ -19160,7 +19160,7 @@ static int coalesce_live_ranges(
if ((lr1->classes & lr2->classes) == 0) {
continue;
}
-
+
if (interfere(rstate, lr1, lr2)) {
continue;
}
@@ -19235,7 +19235,7 @@ static int correct_coalesce_conflicts(
{
int conflicts;
conflicts = 0;
- walk_variable_lifetimes(state, &state->bb, blocks,
+ walk_variable_lifetimes(state, &state->bb, blocks,
fix_coalesce_conflicts, &conflicts);
return conflicts;
}
@@ -19251,7 +19251,7 @@ static void replace_set_use(struct compile_state *state,
}
}
-static void replace_block_use(struct compile_state *state,
+static void replace_block_use(struct compile_state *state,
struct reg_block *blocks, struct triple *orig, struct triple *new)
{
int i;
@@ -19343,7 +19343,7 @@ static struct triple *resolve_tangle(
}
info = find_lhs_color(state, tangle, 0);
SET_INFO(tangle->id, info);
-
+
return copy;
}
@@ -19369,7 +19369,7 @@ static void fix_tangles(struct compile_state *state,
}
reg_inc_used(state, used, info.reg);
}
-
+
/* Now find the least dominated definition of a register in
* conflict I have seen so far.
*/
@@ -19382,7 +19382,7 @@ static void fix_tangles(struct compile_state *state,
/* Changing copies that feed into phi functions
* is incorrect.
*/
- if (set->member->use &&
+ if (set->member->use &&
(set->member->use->member->op == OP_PHI)) {
continue;
}
@@ -19412,7 +19412,7 @@ static int correct_tangles(
int tangles;
tangles = 0;
color_instructions(state);
- walk_variable_lifetimes(state, &state->bb, blocks,
+ walk_variable_lifetimes(state, &state->bb, blocks,
fix_tangles, &tangles);
return tangles;
}
@@ -19443,7 +19443,7 @@ struct triple *find_constrained_def(
if (regcm == info.regcm) {
continue;
}
-
+
/* If there is just one use.
* That use cannot accept a larger register class.
* There are no intervening definitions except
@@ -19454,7 +19454,7 @@ struct triple *find_constrained_def(
#if DEBUG_ROMCC_WARNINGS
#warning "FIXME ignore cases that cannot be fixed (a definition followed by a use)"
#endif
-
+
/* Of the constrained live ranges deal with the
* least dominated one first.
@@ -19463,7 +19463,7 @@ struct triple *find_constrained_def(
fprintf(state->errout, "canidate: %p %-8s regcm: %x %x\n",
lrd->def, tops(lrd->def->op), regcm, info.regcm);
}
- if (!constrained ||
+ if (!constrained ||
tdominates(state, lrd->def, constrained))
{
constrained = lrd->def;
@@ -19473,13 +19473,13 @@ struct triple *find_constrained_def(
}
static int split_constrained_ranges(
- struct compile_state *state, struct reg_state *rstate,
+ struct compile_state *state, struct reg_state *rstate,
struct live_range *range)
{
/* Walk through the edges in conflict and our current live
* range, and find definitions that are more severly constrained
* than they type of data they contain require.
- *
+ *
* Then pick one of those ranges and relax the constraints.
*/
struct live_range_edge *edge;
@@ -19507,14 +19507,14 @@ static int split_constrained_ranges(
}
return !!constrained;
}
-
+
static int split_ranges(
struct compile_state *state, struct reg_state *rstate,
char *used, struct live_range *range)
{
int split;
if (state->compiler->debug & DEBUG_RANGE_CONFLICTS) {
- fprintf(state->errout, "split_ranges %d %s %p\n",
+ fprintf(state->errout, "split_ranges %d %s %p\n",
rstate->passes, tops(range->defs->def->op), range->defs->def);
}
if ((range->color == REG_UNNEEDED) ||
@@ -19524,7 +19524,7 @@ static int split_ranges(
split = split_constrained_ranges(state, rstate, range);
/* Ideally I would split the live range that will not be used
- * for the longest period of time in hopes that this will
+ * for the longest period of time in hopes that this will
* (a) allow me to spill a register or
* (b) allow me to place a value in another register.
*
@@ -19538,7 +19538,7 @@ static int split_ranges(
#if DEBUG_ROMCC_WARNINGS
#warning "WISHLIST implement live range splitting..."
#endif
-
+
if (!split && (state->compiler->debug & DEBUG_RANGE_CONFLICTS2)) {
FILE *fp = state->errout;
print_interference_blocks(state, rstate, fp, 0);
@@ -19590,7 +19590,7 @@ static void cgdebug_loc(struct compile_state *state, struct triple *ins)
}
}
-static int select_free_color(struct compile_state *state,
+static int select_free_color(struct compile_state *state,
struct reg_state *rstate, struct live_range *range)
{
struct triple_set *entry;
@@ -19620,7 +19620,7 @@ static int select_free_color(struct compile_state *state,
for(edge = range->edges; edge; edge = edge->next) {
i++;
}
- cgdebug_printf(state, "\n%s edges: %d",
+ cgdebug_printf(state, "\n%s edges: %d",
tops(range->defs->def->op), i);
cgdebug_loc(state, range->defs->def);
cgdebug_printf(state, "\n");
@@ -19630,7 +19630,7 @@ static int select_free_color(struct compile_state *state,
arch_reg_str(i));
}
}
- }
+ }
/* If a color is already assigned see if it will work */
if (range->color != REG_UNSET) {
@@ -19758,7 +19758,7 @@ static int select_free_color(struct compile_state *state,
* pick the first color that is free.
*/
if (range->color == REG_UNSET) {
- range->color =
+ range->color =
arch_select_free_register(state, used, range->classes);
}
if (range->color == REG_UNSET) {
@@ -19784,7 +19784,7 @@ static int select_free_color(struct compile_state *state,
tops(lrd->def->op), lrd->def);
lrd = lrd->next;
} while(lrd != range->defs);
-
+
warning(state, range->defs->def, "classes: %x",
range->classes);
for(i = 0; i < MAX_REGISTERS; i++) {
@@ -19897,7 +19897,7 @@ static void verify_colors(struct compile_state *state, struct reg_state *rstate)
do {
if (triple_is_def(state, ins)) {
if ((ins->id < 0) || (ins->id > rstate->defs)) {
- internal_error(state, ins,
+ internal_error(state, ins,
"triple without a live range def");
}
lr = rstate->lrd[ins->id].lr;
@@ -19932,7 +19932,7 @@ static void color_triples(struct compile_state *state, struct reg_state *rstate)
ins = first;
do {
if ((ins->id < 0) || (ins->id > rstate->defs)) {
- internal_error(state, ins,
+ internal_error(state, ins,
"triple without a live range");
}
lrd = &rstate->lrd[ins->id];
@@ -19953,7 +19953,7 @@ static struct live_range *merge_sort_lr(
mid = first + size/2;
first = merge_sort_lr(first, mid -1);
mid = merge_sort_lr(mid, last);
-
+
join = 0;
join_tail = &join;
/* merge the two lists */
@@ -19982,7 +19982,7 @@ static struct live_range *merge_sort_lr(
/* Splice the remaining list */
pick = (first)? first : mid;
*join_tail = pick;
- if (pick) {
+ if (pick) {
pick->group_prev = join_tail;
}
}
@@ -19995,7 +19995,7 @@ static struct live_range *merge_sort_lr(
return join;
}
-static void ids_from_rstate(struct compile_state *state,
+static void ids_from_rstate(struct compile_state *state,
struct reg_state *rstate)
{
struct triple *ins, *first;
@@ -20091,14 +20091,14 @@ static void allocate_registers(struct compile_state *state)
tangles = correct_tangles(state, rstate.blocks);
} while(tangles);
-
+
print_blocks(state, "resolve_tangles", state->dbgout);
verify_consistency(state);
-
+
/* Allocate and initialize the live ranges */
initialize_live_ranges(state, &rstate);
- /* Note currently doing coalescing in a loop appears to
+ /* Note currently doing coalescing in a loop appears to
* buys me nothing. The code is left this way in case
* there is some value in it. Or if a future bugfix
* yields some benefit.
@@ -20113,18 +20113,18 @@ static void allocate_registers(struct compile_state *state)
/* Compute the interference graph */
walk_variable_lifetimes(
- state, &state->bb, rstate.blocks,
+ state, &state->bb, rstate.blocks,
graph_ins, &rstate);
-
+
/* Display the interference graph if desired */
if (state->compiler->debug & DEBUG_INTERFERENCE) {
print_interference_blocks(state, &rstate, state->dbgout, 1);
fprintf(state->dbgout, "\nlive variables by instruction\n");
walk_variable_lifetimes(
- state, &state->bb, rstate.blocks,
+ state, &state->bb, rstate.blocks,
print_interference_ins, &rstate);
}
-
+
coalesced = coalesce_live_ranges(state, &rstate);
if (state->compiler->debug & DEBUG_COALESCING) {
@@ -20138,13 +20138,13 @@ static void allocate_registers(struct compile_state *state)
# endif
/* Verify the interference graph */
walk_variable_lifetimes(
- state, &state->bb, rstate.blocks,
+ state, &state->bb, rstate.blocks,
verify_graph_ins, &rstate);
# if 0
fprintf(state->errout, "verify_graph_ins done\n");
#endif
#endif
-
+
/* Build the groups low and high. But with the nodes
* first sorted by degree order.
*/
@@ -20164,13 +20164,13 @@ static void allocate_registers(struct compile_state *state)
struct live_range *range;
next = &(*point)->group_next;
range = *point;
-
+
/* If it has a low degree or it already has a color
* place the node in low.
*/
if ((range->degree < regc_max_size(state, range->classes)) ||
(range->color != REG_UNSET)) {
- cgdebug_printf(state, "Lo: %5d degree %5d%s\n",
+ cgdebug_printf(state, "Lo: %5d degree %5d%s\n",
range - rstate.lr, range->degree,
(range->color != REG_UNSET) ? " (colored)": "");
*range->group_prev = range->group_next;
@@ -20187,7 +20187,7 @@ static void allocate_registers(struct compile_state *state)
next = point;
}
else {
- cgdebug_printf(state, "hi: %5d degree %5d%s\n",
+ cgdebug_printf(state, "hi: %5d degree %5d%s\n",
range - rstate.lr, range->degree,
(range->color != REG_UNSET) ? " (colored)": "");
}
@@ -20280,7 +20280,7 @@ static int is_lattice_lo(struct compile_state *state, struct lattice_node *lnode
return (lnode->val != lnode->def) && !is_scc_const(state, lnode->val);
}
-static void scc_add_fedge(struct compile_state *state, struct scc_state *scc,
+static void scc_add_fedge(struct compile_state *state, struct scc_state *scc,
struct flow_edge *fedge)
{
if (state->compiler->debug & DEBUG_SCC_TRANSFORM2) {
@@ -20410,12 +20410,12 @@ static void initialize_scc_state(
ins_count, ssa_edge_count, state->bb.last_vertex);
}
scc->ins_count = ins_count;
- scc->lattice =
+ scc->lattice =
xcmalloc(sizeof(*scc->lattice)*(ins_count + 1), "lattice");
- scc->ssa_edges =
+ scc->ssa_edges =
xcmalloc(sizeof(*scc->ssa_edges)*(ssa_edge_count + 1), "ssa_edges");
- scc->flow_blocks =
- xcmalloc(sizeof(*scc->flow_blocks)*(state->bb.last_vertex + 1),
+ scc->flow_blocks =
+ xcmalloc(sizeof(*scc->flow_blocks)*(state->bb.last_vertex + 1),
"flow_blocks");
/* Initialize pass one collect up the nodes */
@@ -20554,7 +20554,7 @@ static void initialize_scc_state(
fedge->out_next = 0;
fedge->executable = 0;
fedge->dst->in = fedge;
-
+
/* Initialize the work lists */
scc->flow_work_list = 0;
scc->ssa_work_list = 0;
@@ -20566,7 +20566,7 @@ static void initialize_scc_state(
}
}
-
+
static void free_scc_state(
struct compile_state *state, struct scc_state *scc)
{
@@ -20582,7 +20582,7 @@ static void free_scc_state(
xfree(scc->flow_blocks);
xfree(scc->ssa_edges);
xfree(scc->lattice);
-
+
}
static struct lattice_node *triple_to_lattice(
@@ -20611,7 +20611,7 @@ static struct triple *preserve_lval(
return old;
}
-static int lval_changed(struct compile_state *state,
+static int lval_changed(struct compile_state *state,
struct triple *old, struct lattice_node *lnode)
{
int changed;
@@ -20646,7 +20646,7 @@ static void scc_debug_lnode(
struct triple *val, **expr;
val = lnode->val? lnode->val : lnode->def;
fprintf(fp, "%p %s %3d %10s (",
- lnode->def,
+ lnode->def,
((lnode->def->op == OP_PHI)? "phi: ": "expr:"),
lnode->def->id,
tops(lnode->def->op));
@@ -20674,7 +20674,7 @@ static int compute_lnode_val(struct compile_state *state, struct scc_state *scc,
struct triple *old, *scratch;
struct triple **dexpr, **vexpr;
int count, i;
-
+
/* Store the original value */
old = preserve_lval(state, lnode);
@@ -20731,9 +20731,9 @@ static int compute_lnode_val(struct compile_state *state, struct scc_state *scc,
lnode->val = 0; /* Lattice low by definition */
}
/* Find the case when I am lattice high */
- if (lnode->val &&
+ if (lnode->val &&
(lnode->val->op == lnode->def->op) &&
- (memcmp(lnode->val->param, lnode->def->param,
+ (memcmp(lnode->val->param, lnode->def->param,
count * sizeof(lnode->val->param[0])) == 0) &&
(memcmp(&lnode->val->u, &lnode->def->u, sizeof(lnode->def->u)) == 0)) {
lnode->val = lnode->def;
@@ -20756,7 +20756,7 @@ static int compute_lnode_val(struct compile_state *state, struct scc_state *scc,
}
}
/* Find the cases that are always lattice lo */
- if (lnode->val &&
+ if (lnode->val &&
triple_is_def(state, lnode->val) &&
!triple_is_pure(state, lnode->val, lnode->old_id)) {
lnode->val = 0;
@@ -20764,7 +20764,7 @@ static int compute_lnode_val(struct compile_state *state, struct scc_state *scc,
/* See if the lattice value has changed */
changed = lval_changed(state, old, lnode);
/* See if this value should not change */
- if ((lnode->val != lnode->def) &&
+ if ((lnode->val != lnode->def) &&
(( !triple_is_def(state, lnode->def) &&
!triple_is_cbranch(state, lnode->def)) ||
(lnode->def->op == OP_PIECE))) {
@@ -20781,7 +20781,7 @@ static int compute_lnode_val(struct compile_state *state, struct scc_state *scc,
if (lnode->val != scratch) {
xfree(scratch);
}
-
+
return changed;
}
@@ -20808,7 +20808,7 @@ static void scc_visit_cbranch(struct compile_state *state, struct scc_state *scc
fprintf(fp, "%s: %d (",
tops(lnode->def->op),
lnode->def->id);
-
+
for(fedge = lnode->fblock->out; fedge; fedge = fedge->out_next) {
fprintf(fp, " %d", fedge->dst->block->vertex);
}
@@ -20856,7 +20856,7 @@ static void scc_visit_cbranch(struct compile_state *state, struct scc_state *scc
}
-static void scc_add_sedge_dst(struct compile_state *state,
+static void scc_add_sedge_dst(struct compile_state *state,
struct scc_state *scc, struct ssa_edge *sedge)
{
if (triple_is_cbranch(state, sedge->dst->def)) {
@@ -20867,7 +20867,7 @@ static void scc_add_sedge_dst(struct compile_state *state,
}
}
-static void scc_visit_phi(struct compile_state *state, struct scc_state *scc,
+static void scc_visit_phi(struct compile_state *state, struct scc_state *scc,
struct lattice_node *lnode)
{
struct lattice_node *tmp;
@@ -20887,7 +20887,7 @@ static void scc_visit_phi(struct compile_state *state, struct scc_state *scc,
index = 0;
for(fedge = lnode->fblock->in; fedge; index++, fedge = fedge->in_next) {
if (state->compiler->debug & DEBUG_SCC_TRANSFORM) {
- fprintf(state->errout, "Examining edge: %d vertex: %d executable: %d\n",
+ fprintf(state->errout, "Examining edge: %d vertex: %d executable: %d\n",
index,
fedge->dst->block->vertex,
fedge->executable
@@ -20975,14 +20975,14 @@ static void scc_writeback_values(
struct flow_edge *fedge;
int executable;
executable = 0;
- for(fedge = lnode->fblock->in;
+ for(fedge = lnode->fblock->in;
!executable && fedge; fedge = fedge->in_next) {
executable |= fedge->executable;
}
if (executable) {
internal_warning(state, lnode->def,
"lattice node %d %s->%s still high?",
- ins->id,
+ ins->id,
tops(lnode->def->op),
tops(lnode->val->op));
}
@@ -20998,7 +20998,7 @@ static void scc_writeback_values(
mkconst(state, ins, lnode->val->u.cval);
break;
case OP_ADDRCONST:
- mkaddr_const(state, ins,
+ mkaddr_const(state, ins,
MISC(lnode->val, 0), lnode->val->u.cval);
break;
default:
@@ -21057,9 +21057,9 @@ static void scc_transform(struct compile_state *state)
reps++;
}
}
-
+
if (state->compiler->debug & DEBUG_SCC_TRANSFORM) {
- fprintf(state->errout, "vertex: %d reps: %d\n",
+ fprintf(state->errout, "vertex: %d reps: %d\n",
block->vertex, reps);
}
@@ -21112,11 +21112,11 @@ static void scc_transform(struct compile_state *state)
}
}
}
-
+
scc_writeback_values(state, &scc);
free_scc_state(state, &scc);
rebuild_ssa_form(state);
-
+
print_blocks(state, __func__, state->dbgout);
}
@@ -21129,7 +21129,7 @@ static void transform_to_arch_instructions(struct compile_state *state)
do {
ins = transform_to_arch_instruction(state, ins);
} while(ins != first);
-
+
print_blocks(state, __func__, state->dbgout);
}
@@ -21200,7 +21200,7 @@ static void verify_uses(struct compile_state *state)
}
ins = ins->next;
} while(ins != first);
-
+
}
static void verify_blocks_present(struct compile_state *state)
{
@@ -21214,14 +21214,14 @@ static void verify_blocks_present(struct compile_state *state)
valid_ins(state, ins);
if (triple_stores_block(state, ins)) {
if (!ins->u.block) {
- internal_error(state, ins,
+ internal_error(state, ins,
"%p not in a block?", ins);
}
}
ins = ins->next;
} while(ins != first);
-
-
+
+
}
static int edge_present(struct compile_state *state, struct block *block, struct triple *edge)
@@ -21306,12 +21306,12 @@ static void verify_blocks(struct compile_state *state)
}
}
if (block->users != users) {
- internal_error(state, block->first,
+ internal_error(state, block->first,
"computed users %d != stored users %d",
users, block->users);
}
if (!triple_stores_block(state, block->last->next)) {
- internal_error(state, block->last->next,
+ internal_error(state, block->last->next,
"cannot find next block");
}
block = block->last->next->u.block;
@@ -21333,7 +21333,7 @@ static void verify_domination(struct compile_state *state)
if (!state->bb.first_block) {
return;
}
-
+
first = state->first;
ins = first;
do {
@@ -21360,7 +21360,7 @@ static void verify_domination(struct compile_state *state)
bset = bset->next;
}
if (!bset) {
- internal_error(state, set->member,
+ internal_error(state, set->member,
"no edge for phi rhs %d", i);
}
use_point = bset->member->last;
@@ -21369,11 +21369,11 @@ static void verify_domination(struct compile_state *state)
if (use_point &&
!tdominates(state, ins, use_point)) {
if (is_const(ins)) {
- internal_warning(state, ins,
+ internal_warning(state, ins,
"non dominated rhs use point %p?", use_point);
}
else {
- internal_error(state, ins,
+ internal_error(state, ins,
"non dominated rhs use point %p?", use_point);
}
}
@@ -21438,7 +21438,7 @@ static void verify_piece(struct compile_state *state)
static void verify_ins_colors(struct compile_state *state)
{
struct triple *first, *ins;
-
+
first = state->first;
ins = first;
do {
@@ -21555,7 +21555,7 @@ static void verify_consistency(struct compile_state *state)
fprintf(state->dbgout, "consistency verified\n");
}
}
-#else
+#else
static void verify_consistency(struct compile_state *state) {}
#endif /* DEBUG_CONSISTENCY */
@@ -21668,7 +21668,7 @@ static void print_op_asm(struct compile_state *state,
param);
}
piece = (param < lhs)? LHS(ins, param) : RHS(ins, param - lhs);
- fprintf(fp, "%s",
+ fprintf(fp, "%s",
arch_reg_str(ID_REG(piece->id)));
ptr = next -1;
}
@@ -21928,14 +21928,14 @@ static int arch_regcm_intersect(unsigned regcm1, unsigned regcm2)
{
/* See if two register classes may have overlapping registers */
unsigned gpr_mask = REGCM_GPR8 | REGCM_GPR8_LO | REGCM_GPR16_8 | REGCM_GPR16 |
- REGCM_GPR32_8 | REGCM_GPR32 |
+ REGCM_GPR32_8 | REGCM_GPR32 |
REGCM_DIVIDEND32 | REGCM_DIVIDEND64;
/* Special case for the immediates */
if ((regcm1 & (REGCM_IMM32 | REGCM_IMM16 | REGCM_IMM8)) &&
((regcm1 & ~(REGCM_IMM32 | REGCM_IMM16 | REGCM_IMM8)) == 0) &&
(regcm2 & (REGCM_IMM32 | REGCM_IMM16 | REGCM_IMM8)) &&
- ((regcm2 & ~(REGCM_IMM32 | REGCM_IMM16 | REGCM_IMM8)) == 0)) {
+ ((regcm2 & ~(REGCM_IMM32 | REGCM_IMM16 | REGCM_IMM8)) == 0)) {
return 0;
}
return (regcm1 & regcm2) ||
@@ -21968,7 +21968,7 @@ static void arch_reg_equivs(
*equiv++ = REG_DXAX;
*equiv++ = REG_EDXEAX;
break;
- case REG_BL:
+ case REG_BL:
#if X86_4_8BIT_GPRS
*equiv++ = REG_BH;
#endif
@@ -22028,19 +22028,19 @@ static void arch_reg_equivs(
*equiv++ = REG_BH;
*equiv++ = REG_EBX;
break;
- case REG_CX:
+ case REG_CX:
*equiv++ = REG_CL;
*equiv++ = REG_CH;
*equiv++ = REG_ECX;
break;
- case REG_DX:
+ case REG_DX:
*equiv++ = REG_DL;
*equiv++ = REG_DH;
*equiv++ = REG_EDX;
*equiv++ = REG_DXAX;
*equiv++ = REG_EDXEAX;
break;
- case REG_SI:
+ case REG_SI:
*equiv++ = REG_ESI;
break;
case REG_DI:
@@ -22076,19 +22076,19 @@ static void arch_reg_equivs(
*equiv++ = REG_DXAX;
*equiv++ = REG_EDXEAX;
break;
- case REG_ESI:
+ case REG_ESI:
*equiv++ = REG_SI;
break;
- case REG_EDI:
+ case REG_EDI:
*equiv++ = REG_DI;
break;
- case REG_EBP:
+ case REG_EBP:
*equiv++ = REG_BP;
break;
- case REG_ESP:
+ case REG_ESP:
*equiv++ = REG_SP;
break;
- case REG_DXAX:
+ case REG_DXAX:
*equiv++ = REG_AL;
*equiv++ = REG_AH;
*equiv++ = REG_DL;
@@ -22099,7 +22099,7 @@ static void arch_reg_equivs(
*equiv++ = REG_EDX;
*equiv++ = REG_EDXEAX;
break;
- case REG_EDXEAX:
+ case REG_EDXEAX:
*equiv++ = REG_AL;
*equiv++ = REG_AH;
*equiv++ = REG_DL;
@@ -22111,15 +22111,15 @@ static void arch_reg_equivs(
*equiv++ = REG_DXAX;
break;
}
- *equiv++ = REG_UNSET;
+ *equiv++ = REG_UNSET;
}
static unsigned arch_avail_mask(struct compile_state *state)
{
unsigned avail_mask;
/* REGCM_GPR8 is not available */
- avail_mask = REGCM_GPR8_LO | REGCM_GPR16_8 | REGCM_GPR16 |
- REGCM_GPR32 | REGCM_GPR32_8 |
+ avail_mask = REGCM_GPR8_LO | REGCM_GPR16_8 | REGCM_GPR16 |
+ REGCM_GPR32 | REGCM_GPR32_8 |
REGCM_DIVIDEND32 | REGCM_DIVIDEND64 |
REGCM_IMM32 | REGCM_IMM16 | REGCM_IMM8 | REGCM_FLAGS;
if (state->arch->features & X86_MMX_REGS) {
@@ -22162,7 +22162,7 @@ static unsigned arch_regcm_reg_normalize(struct compile_state *state, unsigned r
/* Remove the immediate register classes */
regcm &= ~(REGCM_IMM32 | REGCM_IMM16 | REGCM_IMM8);
return regcm;
-
+
}
static unsigned arch_reg_regcm(struct compile_state *state, int reg)
@@ -22306,7 +22306,7 @@ static struct reg_info arch_reg_clobber(
return result;
}
-static int do_select_reg(struct compile_state *state,
+static int do_select_reg(struct compile_state *state,
char *used, int reg, unsigned classes)
{
unsigned mask;
@@ -22331,7 +22331,7 @@ static int arch_select_free_register(
* increase the odds the register allocator will work when
* it guesses first give out registers from register classes
* least likely to run out of registers.
- *
+ *
*/
int i, reg;
reg = REG_UNSET;
@@ -22366,7 +22366,7 @@ static int arch_select_free_register(
}
-static unsigned arch_type_to_regcm(struct compile_state *state, struct type *type)
+static unsigned arch_type_to_regcm(struct compile_state *state, struct type *type)
{
#if DEBUG_ROMCC_WARNINGS
@@ -22376,13 +22376,13 @@ static unsigned arch_type_to_regcm(struct compile_state *state, struct type *typ
mask = 0;
switch(type->type & TYPE_MASK) {
case TYPE_ARRAY:
- case TYPE_VOID:
- mask = 0;
+ case TYPE_VOID:
+ mask = 0;
break;
case TYPE_CHAR:
case TYPE_UCHAR:
mask = REGCM_GPR8 | REGCM_GPR8_LO |
- REGCM_GPR16 | REGCM_GPR16_8 |
+ REGCM_GPR16 | REGCM_GPR16_8 |
REGCM_GPR32 | REGCM_GPR32_8 |
REGCM_DIVIDEND32 | REGCM_DIVIDEND64 |
REGCM_MMX | REGCM_XMM |
@@ -22433,7 +22433,7 @@ static int is_imm32(struct triple *imm)
{
return ((imm->op == OP_INTCONST) && (imm->u.cval <= 0xffffffffUL)) ||
(imm->op == OP_ADDRCONST);
-
+
}
static int is_imm16(struct triple *imm)
{
@@ -22549,13 +22549,13 @@ static int get_imm8(struct triple *ins, struct triple **expr)
#endif
#define COPY8_REGCM (REGCM_DIVIDEND64 | REGCM_DIVIDEND32 | REGCM_GPR32 | REGCM_GPR16 | REGCM_GPR8_LO | REGCM_MMX | REGCM_XMM)
-#define COPY16_REGCM (REGCM_DIVIDEND64 | REGCM_DIVIDEND32 | REGCM_GPR32 | REGCM_GPR16 | REGCM_MMX | REGCM_XMM)
+#define COPY16_REGCM (REGCM_DIVIDEND64 | REGCM_DIVIDEND32 | REGCM_GPR32 | REGCM_GPR16 | REGCM_MMX | REGCM_XMM)
#define COPY32_REGCM (REGCM_DIVIDEND64 | REGCM_DIVIDEND32 | REGCM_GPR32 | REGCM_MMX | REGCM_XMM)
static struct ins_template templates[] = {
[TEMPLATE_NOP] = {
- .lhs = {
+ .lhs = {
[ 0] = { REG_UNNEEDED, REGCM_IMMALL },
[ 1] = { REG_UNNEEDED, REGCM_IMMALL },
[ 2] = { REG_UNNEEDED, REGCM_IMMALL },
@@ -22622,10 +22622,10 @@ static struct ins_template templates[] = {
[63] = { REG_UNNEEDED, REGCM_IMMALL },
},
},
- [TEMPLATE_INTCONST8] = {
+ [TEMPLATE_INTCONST8] = {
.lhs = { [0] = { REG_UNNEEDED, REGCM_IMM8 } },
},
- [TEMPLATE_INTCONST32] = {
+ [TEMPLATE_INTCONST32] = {
.lhs = { [0] = { REG_UNNEEDED, REGCM_IMM32 } },
},
[TEMPLATE_UNKNOWNVAL] = {
@@ -22655,32 +22655,32 @@ static struct ins_template templates[] = {
.lhs = { [0] = { REG_UNSET, COPY32_REGCM } },
.rhs = { [0] = { REG_UNNEEDED, REGCM_IMM32 | REGCM_IMM16 | REGCM_IMM8 } },
},
- [TEMPLATE_PHI8] = {
+ [TEMPLATE_PHI8] = {
.lhs = { [0] = { REG_VIRT0, COPY8_REGCM } },
.rhs = { [0] = { REG_VIRT0, COPY8_REGCM } },
},
- [TEMPLATE_PHI16] = {
+ [TEMPLATE_PHI16] = {
.lhs = { [0] = { REG_VIRT0, COPY16_REGCM } },
- .rhs = { [0] = { REG_VIRT0, COPY16_REGCM } },
+ .rhs = { [0] = { REG_VIRT0, COPY16_REGCM } },
},
- [TEMPLATE_PHI32] = {
+ [TEMPLATE_PHI32] = {
.lhs = { [0] = { REG_VIRT0, COPY32_REGCM } },
- .rhs = { [0] = { REG_VIRT0, COPY32_REGCM } },
+ .rhs = { [0] = { REG_VIRT0, COPY32_REGCM } },
},
[TEMPLATE_STORE8] = {
- .rhs = {
+ .rhs = {
[0] = { REG_UNSET, REGCM_GPR32 },
[1] = { REG_UNSET, REGCM_GPR8_LO },
},
},
[TEMPLATE_STORE16] = {
- .rhs = {
+ .rhs = {
[0] = { REG_UNSET, REGCM_GPR32 },
[1] = { REG_UNSET, REGCM_GPR16 },
},
},
[TEMPLATE_STORE32] = {
- .rhs = {
+ .rhs = {
[0] = { REG_UNSET, REGCM_GPR32 },
[1] = { REG_UNSET, REGCM_GPR32 },
},
@@ -22699,84 +22699,84 @@ static struct ins_template templates[] = {
},
[TEMPLATE_BINARY8_REG] = {
.lhs = { [0] = { REG_VIRT0, REGCM_GPR8_LO } },
- .rhs = {
+ .rhs = {
[0] = { REG_VIRT0, REGCM_GPR8_LO },
[1] = { REG_UNSET, REGCM_GPR8_LO },
},
},
[TEMPLATE_BINARY16_REG] = {
.lhs = { [0] = { REG_VIRT0, REGCM_GPR16 } },
- .rhs = {
+ .rhs = {
[0] = { REG_VIRT0, REGCM_GPR16 },
[1] = { REG_UNSET, REGCM_GPR16 },
},
},
[TEMPLATE_BINARY32_REG] = {
.lhs = { [0] = { REG_VIRT0, REGCM_GPR32 } },
- .rhs = {
+ .rhs = {
[0] = { REG_VIRT0, REGCM_GPR32 },
[1] = { REG_UNSET, REGCM_GPR32 },
},
},
[TEMPLATE_BINARY8_IMM] = {
.lhs = { [0] = { REG_VIRT0, REGCM_GPR8_LO } },
- .rhs = {
+ .rhs = {
[0] = { REG_VIRT0, REGCM_GPR8_LO },
[1] = { REG_UNNEEDED, REGCM_IMM8 },
},
},
[TEMPLATE_BINARY16_IMM] = {
.lhs = { [0] = { REG_VIRT0, REGCM_GPR16 } },
- .rhs = {
+ .rhs = {
[0] = { REG_VIRT0, REGCM_GPR16 },
[1] = { REG_UNNEEDED, REGCM_IMM16 },
},
},
[TEMPLATE_BINARY32_IMM] = {
.lhs = { [0] = { REG_VIRT0, REGCM_GPR32 } },
- .rhs = {
+ .rhs = {
[0] = { REG_VIRT0, REGCM_GPR32 },
[1] = { REG_UNNEEDED, REGCM_IMM32 },
},
},
[TEMPLATE_SL8_CL] = {
.lhs = { [0] = { REG_VIRT0, REGCM_GPR8_LO } },
- .rhs = {
+ .rhs = {
[0] = { REG_VIRT0, REGCM_GPR8_LO },
[1] = { REG_CL, REGCM_GPR8_LO },
},
},
[TEMPLATE_SL16_CL] = {
.lhs = { [0] = { REG_VIRT0, REGCM_GPR16 } },
- .rhs = {
+ .rhs = {
[0] = { REG_VIRT0, REGCM_GPR16 },
[1] = { REG_CL, REGCM_GPR8_LO },
},
},
[TEMPLATE_SL32_CL] = {
.lhs = { [0] = { REG_VIRT0, REGCM_GPR32 } },
- .rhs = {
+ .rhs = {
[0] = { REG_VIRT0, REGCM_GPR32 },
[1] = { REG_CL, REGCM_GPR8_LO },
},
},
[TEMPLATE_SL8_IMM] = {
.lhs = { [0] = { REG_VIRT0, REGCM_GPR8_LO } },
- .rhs = {
+ .rhs = {
[0] = { REG_VIRT0, REGCM_GPR8_LO },
[1] = { REG_UNNEEDED, REGCM_IMM8 },
},
},
[TEMPLATE_SL16_IMM] = {
.lhs = { [0] = { REG_VIRT0, REGCM_GPR16 } },
- .rhs = {
+ .rhs = {
[0] = { REG_VIRT0, REGCM_GPR16 },
[1] = { REG_UNNEEDED, REGCM_IMM8 },
},
},
[TEMPLATE_SL32_IMM] = {
.lhs = { [0] = { REG_VIRT0, REGCM_GPR32 } },
- .rhs = {
+ .rhs = {
[0] = { REG_VIRT0, REGCM_GPR32 },
[1] = { REG_UNNEEDED, REGCM_IMM8 },
},
@@ -22858,19 +22858,19 @@ static struct ins_template templates[] = {
.rhs = { [0] = { REG_UNSET, REGCM_GPR32 } },
},
[TEMPLATE_INB_DX] = {
- .lhs = { [0] = { REG_AL, REGCM_GPR8_LO } },
+ .lhs = { [0] = { REG_AL, REGCM_GPR8_LO } },
.rhs = { [0] = { REG_DX, REGCM_GPR16 } },
},
[TEMPLATE_INB_IMM] = {
- .lhs = { [0] = { REG_AL, REGCM_GPR8_LO } },
+ .lhs = { [0] = { REG_AL, REGCM_GPR8_LO } },
.rhs = { [0] = { REG_UNNEEDED, REGCM_IMM8 } },
},
- [TEMPLATE_INW_DX] = {
- .lhs = { [0] = { REG_AX, REGCM_GPR16 } },
+ [TEMPLATE_INW_DX] = {
+ .lhs = { [0] = { REG_AX, REGCM_GPR16 } },
.rhs = { [0] = { REG_DX, REGCM_GPR16 } },
},
- [TEMPLATE_INW_IMM] = {
- .lhs = { [0] = { REG_AX, REGCM_GPR16 } },
+ [TEMPLATE_INW_IMM] = {
+ .lhs = { [0] = { REG_AX, REGCM_GPR16 } },
.rhs = { [0] = { REG_UNNEEDED, REGCM_IMM8 } },
},
[TEMPLATE_INL_DX] = {
@@ -22881,19 +22881,19 @@ static struct ins_template templates[] = {
.lhs = { [0] = { REG_EAX, REGCM_GPR32 } },
.rhs = { [0] = { REG_UNNEEDED, REGCM_IMM8 } },
},
- [TEMPLATE_OUTB_DX] = {
+ [TEMPLATE_OUTB_DX] = {
.rhs = {
[0] = { REG_AL, REGCM_GPR8_LO },
[1] = { REG_DX, REGCM_GPR16 },
},
},
- [TEMPLATE_OUTB_IMM] = {
+ [TEMPLATE_OUTB_IMM] = {
.rhs = {
- [0] = { REG_AL, REGCM_GPR8_LO },
+ [0] = { REG_AL, REGCM_GPR8_LO },
[1] = { REG_UNNEEDED, REGCM_IMM8 },
},
},
- [TEMPLATE_OUTW_DX] = {
+ [TEMPLATE_OUTW_DX] = {
.rhs = {
[0] = { REG_AX, REGCM_GPR16 },
[1] = { REG_DX, REGCM_GPR16 },
@@ -22901,19 +22901,19 @@ static struct ins_template templates[] = {
},
[TEMPLATE_OUTW_IMM] = {
.rhs = {
- [0] = { REG_AX, REGCM_GPR16 },
+ [0] = { REG_AX, REGCM_GPR16 },
[1] = { REG_UNNEEDED, REGCM_IMM8 },
},
},
- [TEMPLATE_OUTL_DX] = {
+ [TEMPLATE_OUTL_DX] = {
.rhs = {
[0] = { REG_EAX, REGCM_GPR32 },
[1] = { REG_DX, REGCM_GPR16 },
},
},
- [TEMPLATE_OUTL_IMM] = {
+ [TEMPLATE_OUTL_IMM] = {
.rhs = {
- [0] = { REG_EAX, REGCM_GPR32 },
+ [0] = { REG_EAX, REGCM_GPR32 },
[1] = { REG_UNNEEDED, REGCM_IMM8 },
},
},
@@ -22922,7 +22922,7 @@ static struct ins_template templates[] = {
.rhs = { [0] = { REG_UNSET, REGCM_GPR32 } },
},
[TEMPLATE_RDMSR] = {
- .lhs = {
+ .lhs = {
[0] = { REG_EAX, REGCM_GPR32 },
[1] = { REG_EDX, REGCM_GPR32 },
},
@@ -22937,27 +22937,27 @@ static struct ins_template templates[] = {
},
[TEMPLATE_UMUL8] = {
.lhs = { [0] = { REG_AX, REGCM_GPR16 } },
- .rhs = {
+ .rhs = {
[0] = { REG_AL, REGCM_GPR8_LO },
[1] = { REG_UNSET, REGCM_GPR8_LO },
},
},
[TEMPLATE_UMUL16] = {
.lhs = { [0] = { REG_DXAX, REGCM_DIVIDEND32 } },
- .rhs = {
+ .rhs = {
[0] = { REG_AX, REGCM_GPR16 },
[1] = { REG_UNSET, REGCM_GPR16 },
},
},
[TEMPLATE_UMUL32] = {
.lhs = { [0] = { REG_EDXEAX, REGCM_DIVIDEND64 } },
- .rhs = {
+ .rhs = {
[0] = { REG_EAX, REGCM_GPR32 },
[1] = { REG_UNSET, REGCM_GPR32 },
},
},
[TEMPLATE_DIV8] = {
- .lhs = {
+ .lhs = {
[0] = { REG_AL, REGCM_GPR8_LO },
[1] = { REG_AH, REGCM_GPR8 },
},
@@ -22967,7 +22967,7 @@ static struct ins_template templates[] = {
},
},
[TEMPLATE_DIV16] = {
- .lhs = {
+ .lhs = {
[0] = { REG_AX, REGCM_GPR16 },
[1] = { REG_DX, REGCM_GPR16 },
},
@@ -22977,7 +22977,7 @@ static struct ins_template templates[] = {
},
},
[TEMPLATE_DIV32] = {
- .lhs = {
+ .lhs = {
[0] = { REG_EAX, REGCM_GPR32 },
[1] = { REG_EDX, REGCM_GPR32 },
},
@@ -22998,7 +22998,7 @@ static void fixup_branch(struct compile_state *state,
}
test = pre_triple(state, branch,
cmp_op, cmp_type, left, right);
- test->template_id = TEMPLATE_TEST32;
+ test->template_id = TEMPLATE_TEST32;
if (cmp_op == OP_CMP) {
test->template_id = TEMPLATE_CMP32_REG;
if (get_imm32(test, &RHS(test, 1))) {
@@ -23032,13 +23032,13 @@ static void fixup_branches(struct compile_state *state,
right = RHS(cmp, 1);
}
branch = entry->member;
- fixup_branch(state, branch, jmp_op,
+ fixup_branch(state, branch, jmp_op,
cmp->op, cmp->type, left, right);
}
}
}
-static void bool_cmp(struct compile_state *state,
+static void bool_cmp(struct compile_state *state,
struct triple *ins, int cmp_op, int jmp_op, int set_op)
{
struct triple_set *entry, *next;
@@ -23105,7 +23105,7 @@ struct reg_info arch_reg_lhs(struct compile_state *state, struct triple *ins, in
break;
default:
if (ins->template_id > LAST_TEMPLATE) {
- internal_error(state, ins, "bad template number %d",
+ internal_error(state, ins, "bad template number %d",
ins->template_id);
}
template = &templates[ins->template_id];
@@ -23140,7 +23140,7 @@ struct reg_info arch_reg_rhs(struct compile_state *state, struct triple *ins, in
/* Fall through */
default:
if (ins->template_id > LAST_TEMPLATE) {
- internal_error(state, ins, "bad template number %d",
+ internal_error(state, ins, "bad template number %d",
ins->template_id);
}
template = &templates[ins->template_id];
@@ -23158,7 +23158,7 @@ static struct triple *mod_div(struct compile_state *state,
struct triple *ins, int div_op, int index)
{
struct triple *div, *piece0, *piece1;
-
+
/* Generate the appropriate division instruction */
div = post_triple(state, ins, div_op, ins->type, 0, 0);
RHS(div, 0) = RHS(ins, 0);
@@ -23468,8 +23468,8 @@ static struct triple *transform_to_arch_instruction(
case OP_NEG:
ins->template_id = TEMPLATE_UNARY32;
break;
- case OP_EQ:
- bool_cmp(state, ins, OP_CMP, OP_JMP_EQ, OP_SET_EQ);
+ case OP_EQ:
+ bool_cmp(state, ins, OP_CMP, OP_JMP_EQ, OP_SET_EQ);
break;
case OP_NOTEQ:
bool_cmp(state, ins, OP_CMP, OP_JMP_NOTEQ, OP_SET_NOTEQ);
@@ -23509,7 +23509,7 @@ static struct triple *transform_to_arch_instruction(
ins->template_id = TEMPLATE_NOP;
break;
case OP_CBRANCH:
- fixup_branch(state, ins, OP_JMP_NOTEQ, OP_TEST,
+ fixup_branch(state, ins, OP_JMP_NOTEQ, OP_TEST,
RHS(ins, 0)->type, RHS(ins, 0), 0);
break;
case OP_CALL:
@@ -23615,20 +23615,20 @@ static void generate_local_labels(struct compile_state *state)
first = state->first;
label = first;
do {
- if ((label->op == OP_LABEL) ||
+ if ((label->op == OP_LABEL) ||
(label->op == OP_SDECL)) {
if (label->use) {
label->u.cval = next_label(state);
} else {
label->u.cval = 0;
}
-
+
}
label = label->next;
} while(label != first);
}
-static int check_reg(struct compile_state *state,
+static int check_reg(struct compile_state *state,
struct triple *triple, int classes)
{
unsigned mask;
@@ -23659,7 +23659,7 @@ static const char *arch_regs[] = {
"%edx:%eax",
"%dx:%ax",
"%mm0", "%mm1", "%mm2", "%mm3", "%mm4", "%mm5", "%mm6", "%mm7",
- "%xmm0", "%xmm1", "%xmm2", "%xmm3",
+ "%xmm0", "%xmm1", "%xmm2", "%xmm3",
"%xmm4", "%xmm5", "%xmm6", "%xmm7",
};
static const char *arch_reg_str(int reg)
@@ -23718,7 +23718,7 @@ static int reg_size(struct compile_state *state, struct triple *ins)
}
return arch_reg_size(reg);
}
-
+
const char *type_suffix(struct compile_state *state, struct type *type)
@@ -23741,7 +23741,7 @@ static void print_const_val(
{
switch(ins->op) {
case OP_INTCONST:
- fprintf(fp, " $%ld ",
+ fprintf(fp, " $%ld ",
(long)(ins->u.cval));
break;
case OP_ADDRCONST:
@@ -23754,7 +23754,7 @@ static void print_const_val(
internal_error(state, ins, "unlabeled constant");
}
fprintf(fp, " $L%s%lu+%lu ",
- state->compiler->label_prefix,
+ state->compiler->label_prefix,
(unsigned long)(MISC(ins, 0)->u.cval),
(unsigned long)(ins->u.cval));
break;
@@ -23772,12 +23772,12 @@ static void print_const(struct compile_state *state,
switch(ins->type->type & TYPE_MASK) {
case TYPE_CHAR:
case TYPE_UCHAR:
- fprintf(fp, ".byte 0x%02lx\n",
+ fprintf(fp, ".byte 0x%02lx\n",
(unsigned long)(ins->u.cval));
break;
case TYPE_SHORT:
case TYPE_USHORT:
- fprintf(fp, ".short 0x%04lx\n",
+ fprintf(fp, ".short 0x%04lx\n",
(unsigned long)(ins->u.cval));
break;
case TYPE_INT:
@@ -23785,7 +23785,7 @@ static void print_const(struct compile_state *state,
case TYPE_LONG:
case TYPE_ULONG:
case TYPE_POINTER:
- fprintf(fp, ".int %lu\n",
+ fprintf(fp, ".int %lu\n",
(unsigned long)(ins->u.cval));
break;
default:
@@ -23795,7 +23795,7 @@ static void print_const(struct compile_state *state,
internal_error(state, ins, "Unknown constant type. Val: %lu",
(unsigned long)(ins->u.cval));
}
-
+
break;
case OP_ADDRCONST:
if ((MISC(ins, 0)->op != OP_SDECL) &&
@@ -23867,7 +23867,7 @@ static long get_mask_pool_ref(
}
static void print_binary_op(struct compile_state *state,
- const char *op, struct triple *ins, FILE *fp)
+ const char *op, struct triple *ins, FILE *fp)
{
unsigned mask;
mask = REGCM_GPR32 | REGCM_GPR16 | REGCM_GPR8_LO;
@@ -23894,7 +23894,7 @@ static void print_binary_op(struct compile_state *state,
reg(state, RHS(ins, 0), mask));
}
}
-static void print_unary_op(struct compile_state *state,
+static void print_unary_op(struct compile_state *state,
const char *op, struct triple *ins, FILE *fp)
{
unsigned mask;
@@ -23958,7 +23958,7 @@ static void print_op_in(struct compile_state *state, struct triple *ins, FILE *f
internal_error(state, ins, "src != %%dx");
}
fprintf(fp, "\t%s %s, %s\n",
- op,
+ op,
reg(state, RHS(ins, 0), REGCM_GPR16),
reg(state, ins, mask));
}
@@ -23984,7 +23984,7 @@ static void print_op_out(struct compile_state *state, struct triple *ins, FILE *
internal_error(state, ins, "src != %%eax");
}
if (is_const(RHS(ins, 1))) {
- fprintf(fp, "\t%s %s,",
+ fprintf(fp, "\t%s %s,",
op, reg(state, RHS(ins, 0), mask));
print_const_val(state, RHS(ins, 1), fp);
fprintf(fp, "\n");
@@ -23996,7 +23996,7 @@ static void print_op_out(struct compile_state *state, struct triple *ins, FILE *
internal_error(state, ins, "dst != %%dx");
}
fprintf(fp, "\t%s %s, %s\n",
- op,
+ op,
reg(state, RHS(ins, 0), mask),
reg(state, RHS(ins, 1), REGCM_GPR16));
}
@@ -24046,7 +24046,7 @@ static void print_op_move(struct compile_state *state,
src_regcm = arch_reg_regcm(state, src_reg);
dst_regcm = arch_reg_regcm(state, dst_reg);
/* If the class is the same just move the register */
- if (src_regcm & dst_regcm &
+ if (src_regcm & dst_regcm &
(REGCM_GPR8_LO | REGCM_GPR16 | REGCM_GPR32)) {
if ((src_reg != dst_reg) || !omit_copy) {
fprintf(fp, "\tmov %s, %s\n",
@@ -24060,7 +24060,7 @@ static void print_op_move(struct compile_state *state,
src_reg = (src_reg - REGC_GPR32_FIRST) + REGC_GPR16_FIRST;
if ((src_reg != dst_reg) || !omit_copy) {
fprintf(fp, "\tmovw %s, %s\n",
- arch_reg_str(src_reg),
+ arch_reg_str(src_reg),
arch_reg_str(dst_reg));
}
}
@@ -24097,7 +24097,7 @@ static void print_op_move(struct compile_state *state,
}
}
/* Move 8/16bit to 16/32bit */
- else if ((src_regcm & (REGCM_GPR8_LO | REGCM_GPR16)) &&
+ else if ((src_regcm & (REGCM_GPR8_LO | REGCM_GPR16)) &&
(dst_regcm & (REGCM_GPR16 | REGCM_GPR32))) {
const char *op;
op = is_signed(src->type)? "movsx": "movzx";
@@ -24169,7 +24169,7 @@ static void print_op_move(struct compile_state *state,
const char *extend;
extend = is_signed(src->type)? "cltd":"movl $0, %edx";
fprintf(fp, "\tmov %s, %%eax\n\t%s\n",
- arch_reg_str(src_reg),
+ arch_reg_str(src_reg),
extend);
}
/* Move from 64bit gpr to gpr */
@@ -24177,7 +24177,7 @@ static void print_op_move(struct compile_state *state,
(dst_regcm & (REGCM_GPR32 | REGCM_GPR16 | REGCM_GPR8_LO))) {
if (dst_regcm & REGCM_GPR32) {
src_reg = REG_EAX;
- }
+ }
else if (dst_regcm & REGCM_GPR16) {
src_reg = REG_AX;
}
@@ -24382,19 +24382,19 @@ static void print_op_move(struct compile_state *state,
}
if (dst_regcm & (REGCM_GPR32 | REGCM_GPR16 | REGCM_GPR8_LO)) {
- fprintf(fp, "\tshl $%d, %s\n",
- shift_bits,
+ fprintf(fp, "\tshl $%d, %s\n",
+ shift_bits,
reg(state, dst, REGCM_GPR32 | REGCM_GPR16 | REGCM_GPR8_LO));
- fprintf(fp, "\tsar $%d, %s\n",
- shift_bits,
+ fprintf(fp, "\tsar $%d, %s\n",
+ shift_bits,
reg(state, dst, REGCM_GPR32 | REGCM_GPR16 | REGCM_GPR8_LO));
}
else if (dst_regcm & (REGCM_MMX | REGCM_XMM)) {
fprintf(fp, "\tpslld $%d, %s\n",
- shift_bits,
+ shift_bits,
reg(state, dst, REGCM_MMX | REGCM_XMM));
fprintf(fp, "\tpsrad $%d, %s\n",
- shift_bits,
+ shift_bits,
reg(state, dst, REGCM_MMX | REGCM_XMM));
}
else {
@@ -24425,7 +24425,7 @@ static void print_op_load(struct compile_state *state,
case TYPE_INT: case TYPE_UINT:
case TYPE_LONG: case TYPE_ULONG:
case TYPE_POINTER:
- op = "movl";
+ op = "movl";
break;
default:
internal_error(state, ins, "unknown type in load");
@@ -24433,7 +24433,7 @@ static void print_op_load(struct compile_state *state,
break;
}
fprintf(fp, "\t%s (%s), %s\n",
- op,
+ op,
reg(state, src, REGCM_GPR32),
reg(state, dst, REGCM_GPR32));
}
@@ -24468,8 +24468,8 @@ static void print_op_store(struct compile_state *state,
reg(state, src, REGCM_GPR8_LO | REGCM_GPR16 | REGCM_GPR32),
reg(state, dst, REGCM_GPR32));
}
-
-
+
+
}
static void print_op_smul(struct compile_state *state,
@@ -24570,7 +24570,7 @@ static void print_op_branch(struct compile_state *state,
internal_error(state, branch, "Invalid branch op");
break;
}
-
+
}
#if 1
if (branch->op == OP_CALL) {
@@ -24578,7 +24578,7 @@ static void print_op_branch(struct compile_state *state,
}
#endif
fprintf(fp, "\t%s L%s%lu\n",
- bop,
+ bop,
state->compiler->label_prefix,
(unsigned long)(TARG(branch, 0)->u.cval));
}
@@ -24624,19 +24624,19 @@ static void print_op_set(struct compile_state *state,
sop, reg(state, set, REGCM_GPR8_LO));
}
-static void print_op_bit_scan(struct compile_state *state,
- struct triple *ins, FILE *fp)
+static void print_op_bit_scan(struct compile_state *state,
+ struct triple *ins, FILE *fp)
{
const char *op;
switch(ins->op) {
case OP_BSF: op = "bsf"; break;
case OP_BSR: op = "bsr"; break;
- default:
+ default:
internal_error(state, ins, "unknown bit scan");
op = 0;
break;
}
- fprintf(fp,
+ fprintf(fp,
"\t%s %s, %s\n"
"\tjnz 1f\n"
"\tmovl $-1, %s\n"
@@ -24653,18 +24653,18 @@ static void print_sdecl(struct compile_state *state,
{
fprintf(fp, ".section \"" DATA_SECTION "\"\n");
fprintf(fp, ".balign %ld\n", (long int)align_of_in_bytes(state, ins->type));
- fprintf(fp, "L%s%lu:\n",
+ fprintf(fp, "L%s%lu:\n",
state->compiler->label_prefix, (unsigned long)(ins->u.cval));
print_const(state, MISC(ins, 0), fp);
fprintf(fp, ".section \"" TEXT_SECTION "\"\n");
-
+
}
static void print_instruction(struct compile_state *state,
struct triple *ins, FILE *fp)
{
/* Assumption: after I have exted the register allocator
- * everything is in a valid register.
+ * everything is in a valid register.
*/
switch(ins->op) {
case OP_ASM:
@@ -24696,7 +24696,7 @@ static void print_instruction(struct compile_state *state,
case OP_SDECL:
print_sdecl(state, ins, fp);
break;
- case OP_COPY:
+ case OP_COPY:
case OP_CONVERT:
print_op_move(state, ins, fp);
break;
@@ -24731,10 +24731,10 @@ static void print_instruction(struct compile_state *state,
print_op_set(state, ins, fp);
break;
case OP_INB: case OP_INW: case OP_INL:
- print_op_in(state, ins, fp);
+ print_op_in(state, ins, fp);
break;
case OP_OUTB: case OP_OUTW: case OP_OUTL:
- print_op_out(state, ins, fp);
+ print_op_out(state, ins, fp);
break;
case OP_BSF:
case OP_BSR:
@@ -24763,7 +24763,7 @@ static void print_instruction(struct compile_state *state,
if (!ins->use) {
return;
}
- fprintf(fp, "L%s%lu:\n",
+ fprintf(fp, "L%s%lu:\n",
state->compiler->label_prefix, (unsigned long)(ins->u.cval));
break;
case OP_ADECL:
@@ -24810,7 +24810,7 @@ static void print_instructions(struct compile_state *state)
first = state->first;
ins = first;
do {
- if (print_location &&
+ if (print_location &&
last_occurance != ins->occurance) {
if (!ins->occurance->parent) {
fprintf(fp, "\t/* %s,%s:%d.%d */\n",
@@ -24857,7 +24857,7 @@ static void generate_code(struct compile_state *state)
{
generate_local_labels(state);
print_instructions(state);
-
+
}
static void print_preprocessed_tokens(struct compile_state *state)
@@ -24878,7 +24878,7 @@ static void print_preprocessed_tokens(struct compile_state *state)
break;
}
tk = eat(state, tok);
- token_str =
+ token_str =
tk->ident ? tk->ident->name :
tk->str_len ? tk->val.str :
tokens[tk->tok];
@@ -24887,8 +24887,8 @@ static void print_preprocessed_tokens(struct compile_state *state)
while(file->macro && file->prev) {
file = file->prev;
}
- if (!file->macro &&
- ((file->line != line) || (file->basename != filename)))
+ if (!file->macro &&
+ ((file->line != line) || (file->basename != filename)))
{
int i, col;
if ((file->basename == filename) &&
@@ -24909,9 +24909,9 @@ static void print_preprocessed_tokens(struct compile_state *state)
fprintf(fp, " ");
}
}
-
+
fprintf(fp, "%s ", token_str);
-
+
if (state->compiler->debug & DEBUG_TOKENS) {
loc(state->dbgout, state, 0);
fprintf(state->dbgout, "%s <- `%s'\n",
@@ -25009,8 +25009,8 @@ static void compile(const char *filename, const char *includefile,
/* Exit the global definition scope */
end_scope(&state);
- /* Now that basic compilation has happened
- * optimize the intermediate code
+ /* Now that basic compilation has happened
+ * optimize the intermediate code
*/
optimize(&state);
@@ -25067,8 +25067,8 @@ int main(int argc, char **argv)
struct compiler_state compiler;
struct arch_state arch;
int all_opts;
-
-
+
+
/* I don't want any surprises */
setlocale(LC_ALL, "C");
diff --git a/SerialICE/util/xmmstack.c b/SerialICE/util/xmmstack.c
index 7dcc041..8a14a95 100644
--- a/SerialICE/util/xmmstack.c
+++ b/SerialICE/util/xmmstack.c
@@ -109,7 +109,7 @@ int main(int argc,char **argv)
int param;
int inapp;
- if (argc<2)
+ if (argc<2)
{
printf("Usage: \n\txmmstack [-xmm] [-mmx] file.s\nThis program is for use with:\n"
"\tgcc -fomit-frame-pointer -fno-stack-protector *.c\n"
@@ -552,7 +552,7 @@ getxmml:\n\
);
while(!feof(f))
- {
+ {
*buf=0;
fgets(buf,sizeof(buf)-1,f);
chomp(buf);len=strlen(buf);
@@ -616,7 +616,7 @@ getxmml:\n\
case 2:fprintf(w,"jmp getxmmw\n");break;
case 4:fprintf(w,"jmp getxmml\n");break;
}
- if (!strcmp(find[2],"%eax")||!strcmp(find[2],"%ax")||!strcmp(find[2],"%al"))
+ if (!strcmp(find[2],"%eax")||!strcmp(find[2],"%ax")||!strcmp(find[2],"%al"))
{
fprintf(w,"movl %%edx,%%esp #NOSTACK\n");
fprintf(w,"movl %%dr0,%%edx #NOSTACK\n");
@@ -669,7 +669,7 @@ getxmml:\n\
case 2:fprintf(w,"%s %%ax,%s\n",find[1],find[3]);break;
case 4:fprintf(w,"%s %%eax,%s\n",find[1],find[3]);break;
}
- if (strcmp(find[3],"%eax")&&strcmp(find[3],"%ax")&&strcmp(find[3],"%al"))
+ if (strcmp(find[3],"%eax")&&strcmp(find[3],"%ax")&&strcmp(find[3],"%al"))
//Nota, només pot ser un registre, (tot ha de ser const, ni malloc's ni res)
fprintf(w,"movl %%dr0,%%eax #NOSTACK\n");
continue;
@@ -737,7 +737,7 @@ getxmml:\n\
fprintf(w,"movl $.+10,%%esp\n");
fprintf(w,"jmp docall\n");
fprintf(w,"movl %%dr0,%%eax #NOSTACK\n");
- fprintf(w,".byte 0xe9\n.long %s-4-. #NOSTACK\n",find[1]);//jmp, not works with .global??? gcc???
+ fprintf(w,".byte 0xe9\n.long %s-4-. #NOSTACK\n",find[1]);//jmp, not works with .global??? gcc???
continue;
}
if (regexp("^(rep\\s*;\\s*|)ret$",buf,len,find))
@@ -753,7 +753,7 @@ getxmml:\n\
fprintf(w,"movl %%eax,%%esp\n");
fprintf(w,"movl %%dr0,%%eax #NOSTACK\n");
fprintf(w,"jmp *%%esp #NOSTACK\n");
-
+
continue;
}
fprintf(w,"%s\n",buf);
@@ -763,5 +763,3 @@ getxmml:\n\
return 0;
}
-
-
Edward O'Callaghan (eocallaghan(a)alterapraxis.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/5215
-gerrit
commit e16e232f57beaf0bec7427fbf8cc12d67bd6a028
Author: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
Date: Fri Feb 14 01:53:18 2014 +1100
SerialICE/Makefile: Create gitconfig target.
Provide for gitconfig Makefile target and some example pre-commit lint
check hooks.
Change-Id: I49ce2791f740089f5867fe2221cbbbd1e1c6a8a7
Signed-off-by: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
---
Makefile | 34 +++++++
util/gitconfig/commit-msg | 173 +++++++++++++++++++++++++++++++++++
util/gitconfig/pre-commit | 2 +
util/lint/lint-000-license-headers | 35 +++++++
util/lint/lint-stable-003-whitespace | 44 +++++++++
5 files changed, 288 insertions(+)
diff --git a/Makefile b/Makefile
index 46d4657..95d2bb1 100644
--- a/Makefile
+++ b/Makefile
@@ -60,3 +60,37 @@ buildall:
mv build build-$$board; \
done
+#######################################################################
+# Development utilities
+lint lint-stable:
+ FAILED=0; LINTLOG=`mktemp .tmpconfig.lintXXXXX`; \
+ for script in util/lint/$@-*; do \
+ echo; echo `basename $$script`; \
+ grep "^# DESCR:" $$script | sed "s,.*DESCR: *,," ; \
+ echo ========; \
+ $$script > $$LINTLOG; \
+ if [ `cat $$LINTLOG | wc -l` -eq 0 ]; then \
+ printf "success\n\n"; \
+ else \
+ echo test failed: ; \
+ cat $$LINTLOG; \
+ rm -f $$LINTLOG; \
+ FAILED=$$(( $$FAILED + 1 )); \
+ fi; \
+ echo ========; \
+ done; \
+ test $$FAILED -eq 0 || { echo "ERROR: $$FAILED test(s) failed." && exit 1; }; \
+ rm -f $$LINTLOG
+
+gitconfig:
+ mkdir -p .git/hooks
+ for hook in commit-msg pre-commit ; do \
+ if [ util/gitconfig/$$hook -nt .git/hooks/$$hook -o \
+ ! -x .git/hooks/$$hook ]; then \
+ cp util/gitconfig/$$hook .git/hooks/$$hook; \
+ chmod +x .git/hooks/$$hook; \
+ fi; \
+ done
+ git config remote.origin.push HEAD:refs/for/master
+ (git config --global user.name >/dev/null && git config --global user.email >/dev/null) || (printf 'Please configure your name and email in git:\n\n git config --global user.name "Your Name Comes Here"\n git config --global user.email your.email(a)example.com\n'; exit 1)
+
diff --git a/util/gitconfig/commit-msg b/util/gitconfig/commit-msg
new file mode 100755
index 0000000..82f0581
--- /dev/null
+++ b/util/gitconfig/commit-msg
@@ -0,0 +1,173 @@
+#!/bin/sh
+#
+# Part of Gerrit Code Review (http://code.google.com/p/gerrit/ )
+#
+# Copyright (C) 2009 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+CHANGE_ID_AFTER="Bug|Issue"
+MSG="$1"
+
+# Check for, and add if missing, a unique Change-Id
+#
+add_ChangeId() {
+ clean_message=`sed -e '
+ /^diff --git a\/.*/{
+ s///
+ q
+ }
+ /^Signed-off-by:/d
+ /^#/d
+ ' "$MSG" | git stripspace`
+ if test -z "$clean_message"
+ then
+ return
+ fi
+
+ # Does Change-Id: already exist? if so, exit (no change).
+ if grep -i '^Change-Id: I[0-9a-f]\{40\}$' "$MSG" >/dev/null
+ then
+ return
+ fi
+
+ id=`_gen_ChangeId`
+ T="$MSG.tmp.$$"
+ AWK=awk
+ if [ -x /usr/xpg4/bin/awk ]; then
+ # Solaris AWK is just too broken
+ AWK=/usr/xpg4/bin/awk
+ fi
+
+ # How this works:
+ # - parse the commit message as (textLine+ blankLine*)*
+ # - assume textLine+ to be a footer until proven otherwise
+ # - exception: the first block is not footer (as it is the title)
+ # - read textLine+ into a variable
+ # - then count blankLines
+ # - once the next textLine appears, print textLine+ blankLine* as these
+ # aren't footer
+ # - in END, the last textLine+ block is available for footer parsing
+ $AWK '
+ BEGIN {
+ # while we start with the assumption that textLine+
+ # is a footer, the first block is not.
+ isFooter = 0
+ footerComment = 0
+ blankLines = 0
+ }
+
+ # Skip lines starting with "#" without any spaces before it.
+ /^#/ { next }
+
+ # Skip the line starting with the diff command and everything after it,
+ # up to the end of the file, assuming it is only patch data.
+ # If more than one line before the diff was empty, strip all but one.
+ /^diff --git a/ {
+ blankLines = 0
+ while (getline) { }
+ next
+ }
+
+ # Count blank lines outside footer comments
+ /^$/ && (footerComment == 0) {
+ blankLines++
+ next
+ }
+
+ # Catch footer comment
+ /^\[[a-zA-Z0-9-]+:/ && (isFooter == 1) {
+ footerComment = 1
+ }
+
+ /]$/ && (footerComment == 1) {
+ footerComment = 2
+ }
+
+ # We have a non-blank line after blank lines. Handle this.
+ (blankLines > 0) {
+ print lines
+ for (i = 0; i < blankLines; i++) {
+ print ""
+ }
+
+ lines = ""
+ blankLines = 0
+ isFooter = 1
+ footerComment = 0
+ }
+
+ # Detect that the current block is not the footer
+ (footerComment == 0) && (!/^\[?[a-zA-Z0-9-]+:/ || /^[a-zA-Z0-9-]+:\/\//) {
+ isFooter = 0
+ }
+
+ {
+ # We need this information about the current last comment line
+ if (footerComment == 2) {
+ footerComment = 0
+ }
+ if (lines != "") {
+ lines = lines "\n";
+ }
+ lines = lines $0
+ }
+
+ # Footer handling:
+ # If the last block is considered a footer, splice in the Change-Id at the
+ # right place.
+ # Look for the right place to inject Change-Id by considering
+ # CHANGE_ID_AFTER. Keys listed in it (case insensitive) come first,
+ # then Change-Id, then everything else (eg. Signed-off-by:).
+ #
+ # Otherwise just print the last block, a new line and the Change-Id as a
+ # block of its own.
+ END {
+ unprinted = 1
+ if (isFooter == 0) {
+ print lines "\n"
+ lines = ""
+ }
+ changeIdAfter = "^(" tolower("'"$CHANGE_ID_AFTER"'") "):"
+ numlines = split(lines, footer, "\n")
+ for (line = 1; line <= numlines; line++) {
+ if (unprinted && match(tolower(footer[line]), changeIdAfter) != 1) {
+ unprinted = 0
+ print "Change-Id: I'"$id"'"
+ }
+ print footer[line]
+ }
+ if (unprinted) {
+ print "Change-Id: I'"$id"'"
+ }
+ }' "$MSG" > $T && mv $T "$MSG" || rm -f $T
+}
+_gen_ChangeIdInput() {
+ echo "tree `git write-tree`"
+ if parent=`git rev-parse "HEAD^0" 2>/dev/null`
+ then
+ echo "parent $parent"
+ fi
+ echo "author `git var GIT_AUTHOR_IDENT`"
+ echo "committer `git var GIT_COMMITTER_IDENT`"
+ echo
+ printf '%s' "$clean_message"
+}
+_gen_ChangeId() {
+ _gen_ChangeIdInput |
+ git hash-object -t commit --stdin
+}
+
+
+add_ChangeId
diff --git a/util/gitconfig/pre-commit b/util/gitconfig/pre-commit
new file mode 100755
index 0000000..8ab3e56
--- /dev/null
+++ b/util/gitconfig/pre-commit
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec make lint-stable
diff --git a/util/lint/lint-000-license-headers b/util/lint/lint-000-license-headers
new file mode 100755
index 0000000..9165aa6
--- /dev/null
+++ b/util/lint/lint-000-license-headers
@@ -0,0 +1,35 @@
+#!/bin/sh
+# This file is part of the coreboot project.
+#
+# Copyright (C) 2010 coresystems GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
+#
+# DESCR: Check that all files in src/ and util/ have valid license headers
+
+LC_ALL=C export LC_ALL
+find SerialICE util -name .git -type d -prune -o \
+ -name README -prune -o \
+ -name LICENSE -prune -o \
+ -name TODO -prune -o \
+ -name COPYING -prune -o \
+ -name microcode-\*.h -prune -o \
+ -name \*.[18] -prune -o \
+ -name romcc -type d -prune -o \
+ -name crossgcc -type d -prune -o \
+ -name vendorcode -type d -prune -o \
+ -type f -exec \
+ grep -L "51 Franklin St, Fifth Floor, Boston" {} + | \
+ sed -e "s,^.*$,File & has no valid GPL header.,"
diff --git a/util/lint/lint-stable-003-whitespace b/util/lint/lint-stable-003-whitespace
new file mode 100755
index 0000000..c2f5b3c
--- /dev/null
+++ b/util/lint/lint-stable-003-whitespace
@@ -0,0 +1,44 @@
+#!/bin/sh
+# This file is part of the coreboot project.
+#
+# Copyright (C) 2011 Patrick Georgi <patrick(a)georgi-clan.de>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
+# DESCR: Check for superfluous whitespace in the tree
+
+LC_ALL=C export LC_ALL
+find SerialICE util -name .git -type d -prune -o \
+ -type f -perm /111 -prune -o \
+ -name README -prune -o \
+ -name LICENSE -prune -o \
+ -name TODO -prune -o \
+ -name COPYING -prune -o \
+ -name \*.patch -prune -o \
+ -name \*.diff -prune -o \
+ -name \*.txt -prune -o \
+ -name \*.exe -prune -o \
+ -name \*.o -prune -o \
+ -name microcode-\*.h -prune -o \
+ -name \*.?_shipped -prune -o \
+ -name \*.[18] -prune -o \
+ -name \*~ -prune -o \
+ -name kconfig -type d -prune -o \
+ -name romcc -type d -prune -o \
+ -name crossgcc -type d -prune -o \
+ -name vendorcode -type d -prune -o \
+ -type f -exec \
+ grep -l "[[:space:]][[:space:]]*$" {} + | \
+ sed -e "s,^.*$,File & has lines ending with whitespace.,"
+
Edward O'Callaghan (eocallaghan(a)alterapraxis.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/5214
-gerrit
commit c6dcd9f233090c8b86d5a7c541478e519084617c
Author: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
Date: Fri Feb 14 01:03:34 2014 +1100
SerialICE/mainboard: Add initial Jetway NF81-T56N-LF support.
Add support for Jetway NF81-T56N-LF mainboard and its Super I/O.
Change-Id: Idef372f1f2654a93dbd1023101fd0bb15fef32f8
Signed-off-by: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
---
SerialICE/Kconfig | 9 ++++++-
SerialICE/mainboard/jetway_nf81_t56n_lf.c | 27 ++++++++++++++++++++
SerialICE/superio/fintek-f71869ad.c | 41 +++++++++++++++++++++++++++++++
3 files changed, 76 insertions(+), 1 deletion(-)
diff --git a/SerialICE/Kconfig b/SerialICE/Kconfig
index 00933b2..02a1154 100644
--- a/SerialICE/Kconfig
+++ b/SerialICE/Kconfig
@@ -130,6 +130,11 @@ config BOARD_ASROCK_775I65G
config BOARD_COMMELL_LV_672
bool "Commell LV-672"
+config BOARD_JETWAY_NF81_T56N_LF
+ bool "Jetway NF81-T56N-LF"
+ select BUILD_XMMSTACK
+ select CONFIG_ROM_2048K
+
endchoice
config BOARD_INIT
@@ -163,15 +168,17 @@ config BOARD_INIT
default "intel_d845gbv2.c" if BOARD_INTEL_D845GBV2
default "asrock_775i65g.c" if BOARD_ASROCK_775I65G
default "commell_lv_672.c" if BOARD_COMMELL_LV_672
+ default "jetway_nf81_t56n_lf.c" if BOARD_JETWAY_NF81_T56N_LF
config SOUTHBRIDGE_INIT
string
default "southbridge/intel-ich7.c" if BOARD_KONTRON_986LCD_M
- default "southbridge/amd-sbxxx.c" if BOARD_ASUS_F2A85_M
+ default "southbridge/amd-sbxxx.c" if BOARD_ASUS_F2A85_M || BOARD_JETWAY_NF81_T56N_LF
config SUPERIO_INIT
string
default "superio/winbond-w83627thg.c" if BOARD_KONTRON_986LCD_M
+ default "superio/fintek-f71869ad.c" if BOARD_JETWAY_NF81_T56N_LF
choice
prompt "ROM size"
diff --git a/SerialICE/mainboard/jetway_nf81_t56n_lf.c b/SerialICE/mainboard/jetway_nf81_t56n_lf.c
new file mode 100644
index 0000000..7b704a0
--- /dev/null
+++ b/SerialICE/mainboard/jetway_nf81_t56n_lf.c
@@ -0,0 +1,27 @@
+/*
+ * SerialICE
+ *
+ * Copyright (C) 2014 Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+const char boardname[33]="Jetway NF81-T56N-LF ";
+
+static void chipset_init(void)
+{
+ southbridge_init();
+ sbxxx_enable_48mhzout();
+ superio_init();
+}
diff --git a/SerialICE/superio/fintek-f71869ad.c b/SerialICE/superio/fintek-f71869ad.c
new file mode 100644
index 0000000..77d5023
--- /dev/null
+++ b/SerialICE/superio/fintek-f71869ad.c
@@ -0,0 +1,41 @@
+/*
+ * SerialICE
+ *
+ * Copyright (C) 2014 Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#define SUPERIO_CONFIG_PORT 0x2e
+#define SUPERIO_IO_PORT 0x3F8
+#define SUPERIO_IRQ_ADDR 4
+
+static void superio_init(void)
+{
+ u8 byte;
+ pnp_enter_ext_func_mode_ite(SUPERIO_CONFIG_PORT);
+
+ /* Disable the watchdog. */
+ pnp_set_logical_device(SUPERIO_CONFIG_PORT, 7);
+ pnp_write_register(SUPERIO_CONFIG_PORT, 0x72, 0x00);
+
+ /* Enable the serial port. */
+ pnp_set_logical_device(SUPERIO_CONFIG_PORT, 1); /* COM1 */
+ pnp_set_enable(SUPERIO_CONFIG_PORT, 0);
+ pnp_set_iobase0(SUPERIO_CONFIG_PORT, SUPERIO_IO_PORT);
+ pnp_set_irq0(SUPERIO_CONFIG_PORT, SUPERIO_IRQ_ADDR);
+ pnp_set_enable(SUPERIO_CONFIG_PORT, 1);
+
+ pnp_exit_ext_func_mode_ite(SUPERIO_CONFIG_PORT);
+}
Edward O'Callaghan (eocallaghan(a)alterapraxis.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/5221
-gerrit
commit 1fb90692b4c78258739b274f4a1c3ff484ae00bb
Author: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
Date: Fri Feb 14 19:30:38 2014 +1100
SerialICE: Remove superfluous whitespace in the tree.
Change-Id: I14cf959ff4601ede921b8086e460fc36bb40bc4f
Signed-off-by: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
---
SerialICE/Makefile | 6 +-
SerialICE/README.GDB | 12 +-
SerialICE/README.SHELL | 5 +-
SerialICE/chipset.c | 2 +-
SerialICE/io.h | 2 +-
SerialICE/mainboard/amd_serengeti-cheetah.c | 2 +-
SerialICE/mainboard/asrock_939a785gmh.c | 2 +-
SerialICE/mainboard/asus_k8v-x.c | 2 +-
SerialICE/mainboard/asus_m2v-mx_se.c | 2 +-
SerialICE/mainboard/asus_m4a77td-pro.c | 6 +-
SerialICE/mainboard/asus_p2b.c | 2 +-
SerialICE/mainboard/dell_s1850.c | 10 +-
SerialICE/mainboard/hp_dl165_g6.c | 2 +-
SerialICE/mainboard/intel_d94x.c | 2 +-
SerialICE/mainboard/kontron_986lcd-m.c | 2 +-
SerialICE/mainboard/msi_ms6178.c | 2 +-
SerialICE/mainboard/rca_rm4100.c | 4 +-
SerialICE/mainboard/roda_rk886ex.c | 2 +-
SerialICE/mainboard/televideo_tc7010.c | 2 +-
SerialICE/mainboard/thomson_ip1000.c | 2 +-
SerialICE/mainboard/tyan_s2912.c | 2 +-
SerialICE/mainboard/wyse_s50.c | 4 +-
SerialICE/serial.c | 6 +-
SerialICE/serialice.c | 4 +-
SerialICE/serialice.h | 2 +-
SerialICE/serialice.ld | 2 +-
SerialICE/simba/replay.lua | 4 +-
SerialICE/start.S | 2 +-
SerialICE/types.h | 2 +-
SerialICE/util/kconfig/lex.zconf.c_shipped | 82 +-
SerialICE/util/kconfig/lxdialog/BIG.FAT.WARNING | 2 +-
SerialICE/util/kconfig/lxdialog/menubox.c | 2 +-
SerialICE/util/kconfig/regex.c | 556 ++++-----
SerialICE/util/kconfig/regex.h | 22 +-
SerialICE/util/kconfig/zconf.tab.c_shipped | 2 +-
SerialICE/util/romcc.c | 1396 +++++++++++------------
SerialICE/util/xmmstack.c | 14 +-
37 files changed, 1085 insertions(+), 1090 deletions(-)
diff --git a/SerialICE/Makefile b/SerialICE/Makefile
index f4a7580..e764992 100644
--- a/SerialICE/Makefile
+++ b/SerialICE/Makefile
@@ -1,5 +1,5 @@
##
-## SerialICE
+## SerialICE
##
## Copyright (C) 2009 coresystems GmbH
##
@@ -116,7 +116,7 @@ $(obj)/serialice.rom: $(obj)/serialice.elf
$(obj)/serialice.elf: $(obj)/serialice.o $(obj)/start.o $(src)/serialice.ld
$(Q)printf " LINK $(subst $(shell pwd)/,,$(@))\n"
- $(Q)$(CC) $(LDFLAGS) -o $@ $(obj)/serialice.o $(obj)/start.o
+ $(Q)$(CC) $(LDFLAGS) -o $@ $(obj)/serialice.o $(obj)/start.o
$(Q)$(NM) $@ | sort -u > $(obj)/serialice.map
$(obj)/serialice.S: $(SOURCES) $(obj)/romcc
@@ -143,7 +143,7 @@ $(obj)/serialice-gcc.rom: $(obj)/serialice-gcc.elf
$(obj)/serialice-gcc.elf: $(obj)/serialice-gcc.o $(obj)/start.o serialice.ld
$(Q)printf " LINK $(subst $(shell pwd)/,,$(@))\n"
- $(Q)$(CC) $(LDFLAGS) -o $@ $(obj)/serialice-gcc.o $(obj)/start.o
+ $(Q)$(CC) $(LDFLAGS) -o $@ $(obj)/serialice-gcc.o $(obj)/start.o
$(Q)$(NM) $@ | sort -u > $(obj)/serialice-gcc.map
$(obj)/serialice-pre.s: $(SOURCES) $(obj)/xmmstack
diff --git a/SerialICE/README.GDB b/SerialICE/README.GDB
index d842a05..3498a7a 100644
--- a/SerialICE/README.GDB
+++ b/SerialICE/README.GDB
@@ -52,9 +52,9 @@ To disassemble code at the current position, you can do this:
0xec23c: loop 0xec226
0xec23e: mov %bh,%al
0xec240: out %al,$0x61
-0xec242: ret
+0xec242: ret
0xec243: lcall $0xe5db,$0x1ac0
-(gdb)
+(gdb)
Now for the fun part:
@@ -78,7 +78,7 @@ ds 0x1838 6200
es 0x0 0
fs 0xe5db 58843
gs 0xe895 59541
-(gdb)
+(gdb)
Or, with a little bit of context:
(gdb) x/20i ($cs*16)+$eip - 0x10
@@ -88,7 +88,7 @@ Of course you can also change registers:
(gdb) set var $ecx=0x20
(gdb) print $ecx
$1 = 32
-(gdb)
+(gdb)
This is an excellent method to skip long loops.
@@ -101,12 +101,12 @@ Go back to the GDB shell at any time with CTRL-C
^C
Program received signal SIGINT, Interrupt.
0x000038d6 in ?? ()
-(gdb)
+(gdb)
(gdb) display /i ($cs * 16) + $pc
-That will output the current instruction each time you call nexti, stepi, etc.
+That will output the current instruction each time you call nexti, stepi, etc.
It's possible to trace execution with
diff --git a/SerialICE/README.SHELL b/SerialICE/README.SHELL
index 12fe7cd..909aa2b 100644
--- a/SerialICE/README.SHELL
+++ b/SerialICE/README.SHELL
@@ -13,7 +13,7 @@ meant to be used together with a SerialICE capable Qemu (See README.QEMU)
GETTING STARTED
---------------
-First, you have to compile the SerialICE shell for your mainboard.
+First, you have to compile the SerialICE shell for your mainboard.
Configure the SerialICE shell for your mainboard:
$ make menuconfig
@@ -30,7 +30,7 @@ LICENSE AND COPYRIGHT
---------------------
SerialICE mini shell is copyright (C) 2009 coresystems GmbH.
-It is released under the GNU General Public License version 2.
+It is released under the GNU General Public License version 2.
For questions contact <info(a)coresystems.de>
PORTING THE SHELL TO NEW MAINBOARDS
@@ -145,4 +145,3 @@ character command code.
SerialICE v1.5 (Nov 26 2009)
>
-
diff --git a/SerialICE/chipset.c b/SerialICE/chipset.c
index 8ab4515..c9f75ab 100644
--- a/SerialICE/chipset.c
+++ b/SerialICE/chipset.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 coresystems GmbH
*
diff --git a/SerialICE/io.h b/SerialICE/io.h
index a47feef..30accc2 100644
--- a/SerialICE/io.h
+++ b/SerialICE/io.h
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 coresystems GmbH
*
diff --git a/SerialICE/mainboard/amd_serengeti-cheetah.c b/SerialICE/mainboard/amd_serengeti-cheetah.c
index 78505ad..3179b62 100644
--- a/SerialICE/mainboard/amd_serengeti-cheetah.c
+++ b/SerialICE/mainboard/amd_serengeti-cheetah.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 Uwe Hermann <uwe(a)hermann-uwe.de>
* Copyright (C) 2010 Arne Georg Gleditsch <arne.gleditsch(a)numascale.com>
diff --git a/SerialICE/mainboard/asrock_939a785gmh.c b/SerialICE/mainboard/asrock_939a785gmh.c
index 6f8c9be..5c5b588 100644
--- a/SerialICE/mainboard/asrock_939a785gmh.c
+++ b/SerialICE/mainboard/asrock_939a785gmh.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2006 Uwe Hermann <uwe(a)hermann-uwe.de>
* Copyright (C) 2009 Rudolf Marek <r.marek(a)assembler.cz>
diff --git a/SerialICE/mainboard/asus_k8v-x.c b/SerialICE/mainboard/asus_k8v-x.c
index bc3dbe9..68ad177 100644
--- a/SerialICE/mainboard/asus_k8v-x.c
+++ b/SerialICE/mainboard/asus_k8v-x.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2006 Uwe Hermann <uwe(a)hermann-uwe.de>
* Copyright (C) 2009 Rudolf Marek <r.marek(a)assembler.cz>
diff --git a/SerialICE/mainboard/asus_m2v-mx_se.c b/SerialICE/mainboard/asus_m2v-mx_se.c
index cd694fd..06a8ec9 100644
--- a/SerialICE/mainboard/asus_m2v-mx_se.c
+++ b/SerialICE/mainboard/asus_m2v-mx_se.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2006 Uwe Hermann <uwe(a)hermann-uwe.de>
* Copyright (C) 2009 Rudolf Marek <r.marek(a)assembler.cz>
diff --git a/SerialICE/mainboard/asus_m4a77td-pro.c b/SerialICE/mainboard/asus_m4a77td-pro.c
index 6b91f80..3bc15a5 100644
--- a/SerialICE/mainboard/asus_m4a77td-pro.c
+++ b/SerialICE/mainboard/asus_m4a77td-pro.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2006 Uwe Hermann <uwe(a)hermann-uwe.de>
* Copyright (C) 2010 Rudolf Marek <r.marek(a)assembler.cz>
@@ -44,8 +44,8 @@ static void superio_init(void)
static void chipset_init(void)
{
/* stop the mainboard from rebooting */
- /* inspired by coreboot, src/southbridge/amd/sb700/sb700_early_init.c,
- * sb700_lpc_init(), where the comment says:
+ /* inspired by coreboot, src/southbridge/amd/sb700/sb700_early_init.c,
+ * sb700_lpc_init(), where the comment says:
* NOTE: Set BootTimerDisable, otherwise it would keep rebooting!!
* This bit has no meaning if debug strap is not enabled. So if the
* board keeps rebooting and the code fails to reach here, we could
diff --git a/SerialICE/mainboard/asus_p2b.c b/SerialICE/mainboard/asus_p2b.c
index c93045a..068229a 100644
--- a/SerialICE/mainboard/asus_p2b.c
+++ b/SerialICE/mainboard/asus_p2b.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 Mark Marshall <mark.marshall(a)csr.com>
*
diff --git a/SerialICE/mainboard/dell_s1850.c b/SerialICE/mainboard/dell_s1850.c
index b970650..861479f 100644
--- a/SerialICE/mainboard/dell_s1850.c
+++ b/SerialICE/mainboard/dell_s1850.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 coresystems GmbH
*
@@ -32,8 +32,8 @@ static void mainboard_set_ich5(void)
pci_write_config8(PCI_ADDR(0, 0x1f, 0, 0xe3), 0xc0);
pci_write_config8(PCI_ADDR(0, 0x1f, 0, 0xf0), 0x0);
/* disable certain devices -- see data sheet -- this is from
- * dell settings via lspci
- * Note that they leave SMBUS disabled -- 8f6f.
+ * dell settings via lspci
+ * Note that they leave SMBUS disabled -- 8f6f.
* we leave it enabled and visible in config space -- 8f66
*/
pci_write_config16(PCI_ADDR(0, 0x1f, 0, 0xf2), 0x8f66);
@@ -54,7 +54,7 @@ static void mainboard_set_ich5(void)
static inline void ibfzero(void)
{
- while(inb(ipmicsr) & IBF)
+ while(inb(ipmicsr) & IBF)
;
}
static inline void clearobf(void)
@@ -64,7 +64,7 @@ static inline void clearobf(void)
static inline void waitobf(void)
{
- while((inb(ipmicsr) & OBF) == 0)
+ while((inb(ipmicsr) & OBF) == 0)
;
}
diff --git a/SerialICE/mainboard/hp_dl165_g6.c b/SerialICE/mainboard/hp_dl165_g6.c
index 3301ad5..6aff1e9 100644
--- a/SerialICE/mainboard/hp_dl165_g6.c
+++ b/SerialICE/mainboard/hp_dl165_g6.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 Uwe Hermann <uwe(a)hermann-uwe.de>
* Copyright (C) 2010 Arne Georg Gleditsch <arne.gleditsch(a)numascale.com>
diff --git a/SerialICE/mainboard/intel_d94x.c b/SerialICE/mainboard/intel_d94x.c
index 02eb701..50bbe87 100644
--- a/SerialICE/mainboard/intel_d94x.c
+++ b/SerialICE/mainboard/intel_d94x.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 coresystems GmbH
*
diff --git a/SerialICE/mainboard/kontron_986lcd-m.c b/SerialICE/mainboard/kontron_986lcd-m.c
index 62d8c46..abde14f 100644
--- a/SerialICE/mainboard/kontron_986lcd-m.c
+++ b/SerialICE/mainboard/kontron_986lcd-m.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 coresystems GmbH
*
diff --git a/SerialICE/mainboard/msi_ms6178.c b/SerialICE/mainboard/msi_ms6178.c
index f0a505a..a4edb5a 100644
--- a/SerialICE/mainboard/msi_ms6178.c
+++ b/SerialICE/mainboard/msi_ms6178.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 Uwe Hermann <uwe(a)hermann-uwe.de>
*
diff --git a/SerialICE/mainboard/rca_rm4100.c b/SerialICE/mainboard/rca_rm4100.c
index 81ff089..bd4aa02 100644
--- a/SerialICE/mainboard/rca_rm4100.c
+++ b/SerialICE/mainboard/rca_rm4100.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 Joseph Smith <joe(a)settoplinux.org>
*
@@ -18,7 +18,7 @@
*/
/* This is a chipset init file for the RCA RM4100 mainboard */
-
+
const char boardname[33]="RCA RM4100 ";
/* Hardware specific functions */
diff --git a/SerialICE/mainboard/roda_rk886ex.c b/SerialICE/mainboard/roda_rk886ex.c
index 048f30d..b93b5c0 100644
--- a/SerialICE/mainboard/roda_rk886ex.c
+++ b/SerialICE/mainboard/roda_rk886ex.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 coresystems GmbH
*
diff --git a/SerialICE/mainboard/televideo_tc7010.c b/SerialICE/mainboard/televideo_tc7010.c
index 9c79e05..b22df9a 100644
--- a/SerialICE/mainboard/televideo_tc7010.c
+++ b/SerialICE/mainboard/televideo_tc7010.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2010 Peter Bannis
*
diff --git a/SerialICE/mainboard/thomson_ip1000.c b/SerialICE/mainboard/thomson_ip1000.c
index d558e42..ff20930 100644
--- a/SerialICE/mainboard/thomson_ip1000.c
+++ b/SerialICE/mainboard/thomson_ip1000.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 Joseph Smith <joe(a)settoplinux.org>
*
diff --git a/SerialICE/mainboard/tyan_s2912.c b/SerialICE/mainboard/tyan_s2912.c
index ad7184a..5afbc62 100644
--- a/SerialICE/mainboard/tyan_s2912.c
+++ b/SerialICE/mainboard/tyan_s2912.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 Uwe Hermann <uwe(a)hermann-uwe.de>
* Copyright (C) 2010 Arne Georg Gleditsch <arne.gleditsch(a)numascale.com>
diff --git a/SerialICE/mainboard/wyse_s50.c b/SerialICE/mainboard/wyse_s50.c
index d23d5a9..57a54c5 100644
--- a/SerialICE/mainboard/wyse_s50.c
+++ b/SerialICE/mainboard/wyse_s50.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2011 Nils Jacobs
*
@@ -117,4 +117,4 @@ cs5536_setup_extmsr();
cs5536_setup_iobase();
serial_init();
}
-
+
diff --git a/SerialICE/serial.c b/SerialICE/serial.c
index b5b0778..9188deb 100644
--- a/SerialICE/serial.c
+++ b/SerialICE/serial.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 coresystems GmbH
*
@@ -104,7 +104,7 @@ static void sio_put8(u8 data)
{
int i;
u8 c;
-
+
c = (data >> 4) & 0xf;
sio_put_nibble(c);
@@ -193,5 +193,3 @@ static u32 sio_get32(void)
return data;
}
-
-
diff --git a/SerialICE/serialice.c b/SerialICE/serialice.c
index 649ee11..56f6dac 100644
--- a/SerialICE/serialice.c
+++ b/SerialICE/serialice.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 coresystems GmbH
*
@@ -168,7 +168,7 @@ static void serialice_cpuinfo(void)
/* This code looks quite crappy but this way we don't
* have to worry about running out of registers if we
- * occupy eax, ebx, ecx, edx at the same time
+ * occupy eax, ebx, ecx, edx at the same time
*/
reg32 = cpuid_eax(eax, ecx);
sio_put32(reg32);
diff --git a/SerialICE/serialice.h b/SerialICE/serialice.h
index 40dae1c..ab8a26a 100644
--- a/SerialICE/serialice.h
+++ b/SerialICE/serialice.h
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 coresystems GmbH
*
diff --git a/SerialICE/serialice.ld b/SerialICE/serialice.ld
index 163a4c5..f43d9f2 100644
--- a/SerialICE/serialice.ld
+++ b/SerialICE/serialice.ld
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 coresystems GmbH
*
diff --git a/SerialICE/simba/replay.lua b/SerialICE/simba/replay.lua
index 4632c05..8ec3b0a 100644
--- a/SerialICE/simba/replay.lua
+++ b/SerialICE/simba/replay.lua
@@ -121,7 +121,7 @@ end
function parse_cpuid(line)
local id_op = "CPUID%: eax%: (%x+)%; ecx%: (%x+) => (%x+).(%x+).(%x+).(%x+)"
local id_op_old = "CPU%: CPUID eax%: (%x+)%; ecx%: (%x+) => (%x+).(%x+).(%x+).(%x+)"
- local found, idx0, idx1, eax, ebx, ecx, edx
+ local found, idx0, idx1, eax, ebx, ecx, edx
found, _, idx0, idx1, eax, ebx, ecx, edx = string.find(line, id_op)
if not found then
found, _, idx0, idx1, eax, ebx, ecx, edx = string.find(line, id_op_old)
@@ -196,7 +196,7 @@ function parse_file()
end
if not iplog then
- iplog, _, a, b, f, cs, eip, str =
+ iplog, _, a, b, f, cs, eip, str =
string.find(line, "(%x+)[%.:](%x+)%s+([^ ]*)%s+%[(%x+):(%x+)%]...(.*)")
if iplog and not f then
f = "R###"
diff --git a/SerialICE/start.S b/SerialICE/start.S
index 1e43f98..2ec0bb3 100644
--- a/SerialICE/start.S
+++ b/SerialICE/start.S
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 coresystems GmbH
*
diff --git a/SerialICE/types.h b/SerialICE/types.h
index a712b09..7ddeafa 100644
--- a/SerialICE/types.h
+++ b/SerialICE/types.h
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 coresystems GmbH
*
diff --git a/SerialICE/util/kconfig/lex.zconf.c_shipped b/SerialICE/util/kconfig/lex.zconf.c_shipped
index 1911092..a22db46 100644
--- a/SerialICE/util/kconfig/lex.zconf.c_shipped
+++ b/SerialICE/util/kconfig/lex.zconf.c_shipped
@@ -52,7 +52,7 @@
#if __STDC_VERSION__ >= 199901L
/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
- * if you want the limit (max/min) macros for int types.
+ * if you want the limit (max/min) macros for int types.
*/
#ifndef __STDC_LIMIT_MACROS
#define __STDC_LIMIT_MACROS 1
@@ -69,7 +69,7 @@ typedef uint32_t flex_uint32_t;
typedef signed char flex_int8_t;
typedef short int flex_int16_t;
typedef int flex_int32_t;
-typedef unsigned char flex_uint8_t;
+typedef unsigned char flex_uint8_t;
typedef unsigned short int flex_uint16_t;
typedef unsigned int flex_uint32_t;
#endif /* ! C99 */
@@ -179,7 +179,7 @@ extern FILE *zconfin, *zconfout;
#define EOB_ACT_LAST_MATCH 2
#define YY_LESS_LINENO(n)
-
+
/* Return all but the first "n" matched characters back to the input stream. */
#define yyless(n) \
do \
@@ -246,7 +246,7 @@ struct yy_buffer_state
int yy_bs_lineno; /**< The line count. */
int yy_bs_column; /**< The column count. */
-
+
/* Whether to try to fill the input buffer when we reach the
* end of it.
*/
@@ -866,7 +866,7 @@ extern int zconfwrap (void );
#endif
static void yyunput (int c,char *buf_ptr );
-
+
#ifndef yytext_ptr
static void yy_flex_strncpy (char *,yyconst char *,int );
#endif
@@ -971,7 +971,7 @@ YY_DECL
register yy_state_type yy_current_state;
register char *yy_cp, *yy_bp;
register int yy_act;
-
+
int str = 0;
int ts, i;
@@ -1574,7 +1574,7 @@ static int yy_get_next_buffer (void)
{
register yy_state_type yy_current_state;
register char *yy_cp;
-
+
yy_current_state = (yy_start);
for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
@@ -1593,7 +1593,7 @@ static int yy_get_next_buffer (void)
static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
{
register int yy_is_jam;
-
+
yy_current_state = yy_nxt[yy_current_state][1];
yy_is_jam = (yy_current_state <= 0);
@@ -1603,7 +1603,7 @@ static int yy_get_next_buffer (void)
static void yyunput (int c, register char * yy_bp )
{
register char *yy_cp;
-
+
yy_cp = (yy_c_buf_p);
/* undo effects of setting up zconftext */
@@ -1646,7 +1646,7 @@ static int yy_get_next_buffer (void)
{
int c;
-
+
*(yy_c_buf_p) = (yy_hold_char);
if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
@@ -1713,12 +1713,12 @@ static int yy_get_next_buffer (void)
/** Immediately switch to a different input stream.
* @param input_file A readable stream.
- *
+ *
* @note This function does not reset the start condition to @c INITIAL .
*/
void zconfrestart (FILE * input_file )
{
-
+
if ( ! YY_CURRENT_BUFFER ){
zconfensure_buffer_stack ();
YY_CURRENT_BUFFER_LVALUE =
@@ -1731,11 +1731,11 @@ static int yy_get_next_buffer (void)
/** Switch to a different input buffer.
* @param new_buffer The new input buffer.
- *
+ *
*/
void zconf_switch_to_buffer (YY_BUFFER_STATE new_buffer )
{
-
+
/* TODO. We should be able to replace this entire function body
* with
* zconfpop_buffer_state();
@@ -1775,13 +1775,13 @@ static void zconf_load_buffer_state (void)
/** Allocate and initialize an input buffer state.
* @param file A readable stream.
* @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
- *
+ *
* @return the allocated buffer state.
*/
YY_BUFFER_STATE zconf_create_buffer (FILE * file, int size )
{
YY_BUFFER_STATE b;
-
+
b = (YY_BUFFER_STATE) zconfalloc(sizeof( struct yy_buffer_state ) );
if ( ! b )
YY_FATAL_ERROR( "out of dynamic memory in zconf_create_buffer()" );
@@ -1804,11 +1804,11 @@ static void zconf_load_buffer_state (void)
/** Destroy the buffer.
* @param b a buffer created with zconf_create_buffer()
- *
+ *
*/
void zconf_delete_buffer (YY_BUFFER_STATE b )
{
-
+
if ( ! b )
return;
@@ -1829,7 +1829,7 @@ static void zconf_load_buffer_state (void)
{
int oerrno = errno;
-
+
zconf_flush_buffer(b );
b->yy_input_file = file;
@@ -1845,13 +1845,13 @@ static void zconf_load_buffer_state (void)
}
b->yy_is_interactive = 0;
-
+
errno = oerrno;
}
/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
* @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
- *
+ *
*/
void zconf_flush_buffer (YY_BUFFER_STATE b )
{
@@ -1880,7 +1880,7 @@ static void zconf_load_buffer_state (void)
* the current state. This function will allocate the stack
* if necessary.
* @param new_buffer The new state.
- *
+ *
*/
void zconfpush_buffer_state (YY_BUFFER_STATE new_buffer )
{
@@ -1910,7 +1910,7 @@ void zconfpush_buffer_state (YY_BUFFER_STATE new_buffer )
/** Removes and deletes the top of the stack, if present.
* The next element becomes the new top.
- *
+ *
*/
void zconfpop_buffer_state (void)
{
@@ -1934,7 +1934,7 @@ void zconfpop_buffer_state (void)
static void zconfensure_buffer_stack (void)
{
int num_to_alloc;
-
+
if (!(yy_buffer_stack)) {
/* First allocation is just for 2 elements, since we don't know if this
@@ -1973,13 +1973,13 @@ static void zconfensure_buffer_stack (void)
/** Setup the input buffer state to scan directly from a user-specified character buffer.
* @param base the character buffer
* @param size the size in bytes of the character buffer
- *
- * @return the newly allocated buffer state object.
+ *
+ * @return the newly allocated buffer state object.
*/
YY_BUFFER_STATE zconf_scan_buffer (char * base, yy_size_t size )
{
YY_BUFFER_STATE b;
-
+
if ( size < 2 ||
base[size-2] != YY_END_OF_BUFFER_CHAR ||
base[size-1] != YY_END_OF_BUFFER_CHAR )
@@ -2008,14 +2008,14 @@ YY_BUFFER_STATE zconf_scan_buffer (char * base, yy_size_t size )
/** Setup the input buffer state to scan a string. The next call to zconflex() will
* scan from a @e copy of @a str.
* @param str a NUL-terminated string to scan
- *
+ *
* @return the newly allocated buffer state object.
* @note If you want to scan bytes that may contain NUL values, then use
* zconf_scan_bytes() instead.
*/
YY_BUFFER_STATE zconf_scan_string (yyconst char * yystr )
{
-
+
return zconf_scan_bytes(yystr,strlen(yystr) );
}
@@ -2023,7 +2023,7 @@ YY_BUFFER_STATE zconf_scan_string (yyconst char * yystr )
* scan from a @e copy of @a bytes.
* @param bytes the byte buffer to scan
* @param len the number of bytes in the buffer pointed to by @a bytes.
- *
+ *
* @return the newly allocated buffer state object.
*/
YY_BUFFER_STATE zconf_scan_bytes (yyconst char * yybytes, int _yybytes_len )
@@ -2032,7 +2032,7 @@ YY_BUFFER_STATE zconf_scan_bytes (yyconst char * yybytes, int _yybytes_len )
char *buf;
yy_size_t n;
int i;
-
+
/* Get memory for full buffer, including space for trailing EOB's. */
n = _yybytes_len + 2;
buf = (char *) zconfalloc(n );
@@ -2086,16 +2086,16 @@ static void yy_fatal_error (yyconst char* msg )
/* Accessor methods (get/set functions) to struct members. */
/** Get the current line number.
- *
+ *
*/
int zconfget_lineno (void)
{
-
+
return zconflineno;
}
/** Get the input stream.
- *
+ *
*/
FILE *zconfget_in (void)
{
@@ -2103,7 +2103,7 @@ FILE *zconfget_in (void)
}
/** Get the output stream.
- *
+ *
*/
FILE *zconfget_out (void)
{
@@ -2111,7 +2111,7 @@ FILE *zconfget_out (void)
}
/** Get the length of the current token.
- *
+ *
*/
int zconfget_leng (void)
{
@@ -2119,7 +2119,7 @@ int zconfget_leng (void)
}
/** Get the current token.
- *
+ *
*/
char *zconfget_text (void)
@@ -2129,18 +2129,18 @@ char *zconfget_text (void)
/** Set the current line number.
* @param line_number
- *
+ *
*/
void zconfset_lineno (int line_number )
{
-
+
zconflineno = line_number;
}
/** Set the input stream. This does not discard the current
* input buffer.
* @param in_str A readable stream.
- *
+ *
* @see zconf_switch_to_buffer
*/
void zconfset_in (FILE * in_str )
@@ -2194,7 +2194,7 @@ static int yy_init_globals (void)
/* zconflex_destroy is for both reentrant and non-reentrant scanners. */
int zconflex_destroy (void)
{
-
+
/* Pop the buffer stack, destroying each element. */
while(YY_CURRENT_BUFFER){
zconf_delete_buffer(YY_CURRENT_BUFFER );
diff --git a/SerialICE/util/kconfig/lxdialog/BIG.FAT.WARNING b/SerialICE/util/kconfig/lxdialog/BIG.FAT.WARNING
index a8999d8..7cb5a7e 100644
--- a/SerialICE/util/kconfig/lxdialog/BIG.FAT.WARNING
+++ b/SerialICE/util/kconfig/lxdialog/BIG.FAT.WARNING
@@ -1,4 +1,4 @@
This is NOT the official version of dialog. This version has been
significantly modified from the original. It is for use by the Linux
-kernel configuration script. Please do not bother Savio Lam with
+kernel configuration script. Please do not bother Savio Lam with
questions about this program.
diff --git a/SerialICE/util/kconfig/lxdialog/menubox.c b/SerialICE/util/kconfig/lxdialog/menubox.c
index fa9d633..c689fc0 100644
--- a/SerialICE/util/kconfig/lxdialog/menubox.c
+++ b/SerialICE/util/kconfig/lxdialog/menubox.c
@@ -26,7 +26,7 @@
*
* *) A bugfix for the Page-Down problem
*
- * *) Formerly when I used Page Down and Page Up, the cursor would be set
+ * *) Formerly when I used Page Down and Page Up, the cursor would be set
* to the first position in the menu box. Now lxdialog is a bit
* smarter and works more like other menu systems (just have a look at
* it).
diff --git a/SerialICE/util/kconfig/regex.c b/SerialICE/util/kconfig/regex.c
index 8169880..e63c814 100644
--- a/SerialICE/util/kconfig/regex.c
+++ b/SerialICE/util/kconfig/regex.c
@@ -75,7 +75,7 @@ char *realloc ();
/* This must be nonzero for the wordchar and notwordchar pattern
commands in re_match_2. */
-#ifndef Sword
+#ifndef Sword
#define Sword 1
#endif
@@ -173,8 +173,8 @@ init_syntax_once ()
use `alloca' instead of `malloc'. This is because using malloc in
re_search* or re_match* could cause memory leaks when C-g is used in
Emacs; also, malloc is slower and causes storage fragmentation. On
- the other hand, malloc is more portable, and easier to debug.
-
+ the other hand, malloc is more portable, and easier to debug.
+
Because we sometimes use alloca, some routines have to be macros,
not functions -- `alloca'-allocated space disappears at the end of the
function it is called in. */
@@ -199,7 +199,7 @@ init_syntax_once ()
#ifndef _AIX /* Already did AIX, up at the top. */
char *alloca ();
#endif /* not _AIX */
-#endif /* not HAVE_ALLOCA_H */
+#endif /* not HAVE_ALLOCA_H */
#endif /* not __GNUC__ */
#endif /* not alloca */
@@ -302,9 +302,9 @@ typedef enum
/* Analogously, for end of buffer/string. */
endbuf,
-
+
/* Followed by two byte relative address to which to jump. */
- jump,
+ jump,
/* Same as jump, but marks the end of an alternative. */
jump_past_alt,
@@ -312,11 +312,11 @@ typedef enum
/* Followed by two-byte relative address of place to resume at
in case of failure. */
on_failure_jump,
-
+
/* Like on_failure_jump, but pushes a placeholder instead of the
current string position when executed. */
on_failure_keep_string_jump,
-
+
/* Throw away latest failure point and then jump to following
two-byte relative address. */
pop_failure_jump,
@@ -412,7 +412,7 @@ extract_number (dest, source)
int *dest;
unsigned char *source;
{
- int temp = SIGN_EXTEND_CHAR (*(source + 1));
+ int temp = SIGN_EXTEND_CHAR (*(source + 1));
*dest = *source & 0377;
*dest += temp << 8;
}
@@ -438,7 +438,7 @@ static void
extract_number_and_incr (destination, source)
int *destination;
unsigned char **source;
-{
+{
extract_number (destination, *source);
*source += 2;
}
@@ -487,8 +487,8 @@ print_fastmap (fastmap)
char *fastmap;
{
unsigned was_a_range = 0;
- unsigned i = 0;
-
+ unsigned i = 0;
+
while (i < (1 << BYTEWIDTH))
{
if (fastmap[i++])
@@ -507,7 +507,7 @@ print_fastmap (fastmap)
}
}
}
- putchar ('\n');
+ putchar ('\n');
}
@@ -528,7 +528,7 @@ print_partial_compiled_pattern (start, end)
printf ("(null)\n");
return;
}
-
+
/* Loop over pattern commands. */
while (p < pend)
{
@@ -574,14 +574,14 @@ print_partial_compiled_pattern (start, end)
printf ("/charset%s",
(re_opcode_t) *(p - 1) == charset_not ? "_not" : "");
-
+
assert (p + *p < pend);
for (c = 0; c < *p; c++)
{
unsigned bit;
unsigned char map_byte = p[1 + c];
-
+
putchar ('/');
for (bit = 0; bit < BYTEWIDTH; bit++)
@@ -618,7 +618,7 @@ print_partial_compiled_pattern (start, end)
case push_dummy_failure:
printf ("/push_dummy_failure");
break;
-
+
case maybe_pop_jump:
extract_number_and_incr (&mcnt, &p);
printf ("/maybe_pop_jump/0/%d", mcnt);
@@ -627,36 +627,36 @@ print_partial_compiled_pattern (start, end)
case pop_failure_jump:
extract_number_and_incr (&mcnt, &p);
printf ("/pop_failure_jump/0/%d", mcnt);
- break;
-
+ break;
+
case jump_past_alt:
extract_number_and_incr (&mcnt, &p);
printf ("/jump_past_alt/0/%d", mcnt);
- break;
-
+ break;
+
case jump:
extract_number_and_incr (&mcnt, &p);
printf ("/jump/0/%d", mcnt);
break;
- case succeed_n:
+ case succeed_n:
extract_number_and_incr (&mcnt, &p);
extract_number_and_incr (&mcnt2, &p);
printf ("/succeed_n/0/%d/0/%d", mcnt, mcnt2);
break;
-
- case jump_n:
+
+ case jump_n:
extract_number_and_incr (&mcnt, &p);
extract_number_and_incr (&mcnt2, &p);
printf ("/jump_n/0/%d/0/%d", mcnt, mcnt2);
break;
-
- case set_number_at:
+
+ case set_number_at:
extract_number_and_incr (&mcnt, &p);
extract_number_and_incr (&mcnt2, &p);
printf ("/set_number_at/0/%d/0/%d", mcnt, mcnt2);
break;
-
+
case wordbound:
printf ("/wordbound");
break;
@@ -668,10 +668,10 @@ print_partial_compiled_pattern (start, end)
case wordbeg:
printf ("/wordbeg");
break;
-
+
case wordend:
printf ("/wordend");
-
+
#ifdef emacs
case before_dot:
printf ("/before_dot");
@@ -690,7 +690,7 @@ print_partial_compiled_pattern (start, end)
mcnt = *p++;
printf ("/%d", mcnt);
break;
-
+
case notsyntaxspec:
printf ("/notsyntaxspec");
mcnt = *p++;
@@ -701,7 +701,7 @@ print_partial_compiled_pattern (start, end)
case wordchar:
printf ("/wordchar");
break;
-
+
case notwordchar:
printf ("/notwordchar");
break;
@@ -758,7 +758,7 @@ print_double_string (where, string1, size1, string2, size2)
int size2;
{
unsigned this_char;
-
+
if (where == NULL)
printf ("(null)");
else
@@ -768,7 +768,7 @@ print_double_string (where, string1, size1, string2, size2)
for (this_char = where - string1; this_char < size1; this_char++)
printchar (string1[this_char]);
- where = string2;
+ where = string2;
}
for (this_char = where - string2; this_char < size2; this_char++)
@@ -809,7 +809,7 @@ re_set_syntax (syntax)
reg_syntax_t syntax;
{
reg_syntax_t ret = re_syntax_options;
-
+
re_syntax_options = syntax;
return ret;
}
@@ -845,7 +845,7 @@ static boolean at_begline_loc_p (), at_endline_loc_p ();
static boolean group_in_compile_stack ();
static reg_errcode_t compile_range ();
-/* Fetch the next character in the uncompiled pattern---translating it
+/* Fetch the next character in the uncompiled pattern---translating it
if necessary. Also cast from a signed character in the constant
string passed to us by the user to an unsigned char that we can use
as an array index (in, e.g., `translate'). */
@@ -985,7 +985,7 @@ typedef struct
pattern_offset_t begalt_offset;
pattern_offset_t fixup_alt_jump;
pattern_offset_t inner_group_offset;
- pattern_offset_t laststart_offset;
+ pattern_offset_t laststart_offset;
regnum_t regnum;
} compile_stack_elt_t;
@@ -1028,7 +1028,7 @@ typedef struct
PATFETCH (c); \
} \
} \
- }
+ }
#define CHAR_CLASS_MAX_LENGTH 6 /* Namely, `xdigit'. */
@@ -1054,7 +1054,7 @@ typedef struct
`fastmap_accurate' is zero;
`re_nsub' is the number of subexpressions in PATTERN;
`not_bol' and `not_eol' are zero;
-
+
The `fastmap' and `newline_anchor' fields are neither
examined nor set. */
@@ -1069,20 +1069,20 @@ regex_compile (pattern, size, syntax, bufp)
`char *' (i.e., signed), we declare these variables as unsigned, so
they can be reliably used as array indices. */
register unsigned char c, c1;
-
+
/* A random tempory spot in PATTERN. */
const char *p1;
/* Points to the end of the buffer, where we should append. */
register unsigned char *b;
-
+
/* Keeps track of unclosed groups. */
compile_stack_type compile_stack;
/* Points to the current (ending) position in the pattern. */
const char *p = pattern;
const char *pend = pattern + size;
-
+
/* How to translate the characters in the pattern. */
char *translate = bufp->translate;
@@ -1103,7 +1103,7 @@ regex_compile (pattern, size, syntax, bufp)
/* Place in the uncompiled pattern (i.e., the {) to
which to go back if the interval is invalid. */
const char *beg_interval;
-
+
/* Address of the place where a forward jump should go to the end of
the containing expression. Each alternative of an `or' -- except the
last -- ends with a forward jump of this sort. */
@@ -1119,7 +1119,7 @@ regex_compile (pattern, size, syntax, bufp)
if (debug)
{
unsigned debug_count;
-
+
for (debug_count = 0; debug_count < size; debug_count++)
printchar (pattern[debug_count]);
putchar ('\n');
@@ -1143,9 +1143,9 @@ regex_compile (pattern, size, syntax, bufp)
printer (for debugging) will think there's no pattern. We reset it
at the end. */
bufp->used = 0;
-
+
/* Always count groups, whether or not bufp->no_sub is set. */
- bufp->re_nsub = 0;
+ bufp->re_nsub = 0;
#if !defined (emacs) && !defined (SYNTAX_TABLE)
/* Initialize the syntax table. */
@@ -1196,7 +1196,7 @@ regex_compile (pattern, size, syntax, bufp)
case '$':
{
if ( /* If at end of pattern, it's an operator. */
- p == pend
+ p == pend
/* If context independent, it's an operator. */
|| syntax & RE_CONTEXT_INDEP_ANCHORS
/* Otherwise, depends on what's next. */
@@ -1227,7 +1227,7 @@ regex_compile (pattern, size, syntax, bufp)
{
/* Are we optimizing this jump? */
boolean keep_string_p = false;
-
+
/* 1 means zero (many) matches is allowed. */
char zero_times_ok = 0, many_times_ok = 0;
@@ -1275,7 +1275,7 @@ regex_compile (pattern, size, syntax, bufp)
/* Star, etc. applied to an empty pattern is equivalent
to an empty pattern. */
- if (!laststart)
+ if (!laststart)
break;
/* Now we know whether or not zero matches is allowed
@@ -1284,7 +1284,7 @@ regex_compile (pattern, size, syntax, bufp)
{ /* More than one repetition is allowed, so put in at the
end a backward relative jump from `b' to before the next
jump we're going to put in below (which jumps from
- laststart to after this jump).
+ laststart to after this jump).
But if we are at the `*' in the exact sequence `.*\n',
insert an unconditional jump backwards to the .,
@@ -1361,7 +1361,7 @@ regex_compile (pattern, size, syntax, bufp)
/* We test `*p == '^' twice, instead of using an if
statement, so we only need one BUF_PUSH. */
- BUF_PUSH (*p == '^' ? charset_not : charset);
+ BUF_PUSH (*p == '^' ? charset_not : charset);
if (*p == '^')
p++;
@@ -1411,8 +1411,8 @@ regex_compile (pattern, size, syntax, bufp)
was a character: if this is a hyphen not at the
beginning or the end of a list, then it's the range
operator. */
- if (c == '-'
- && !(p - 2 >= pattern && p[-2] == '[')
+ if (c == '-'
+ && !(p - 2 >= pattern && p[-2] == '[')
&& !(p - 3 >= pattern && p[-3] == '[' && p[-2] == '^')
&& *p != ']')
{
@@ -1427,7 +1427,7 @@ regex_compile (pattern, size, syntax, bufp)
/* Move past the `-'. */
PATFETCH (c1);
-
+
ret = compile_range (&p, pend, translate, syntax, b);
if (ret != REG_NOERROR) return ret;
}
@@ -1456,7 +1456,7 @@ regex_compile (pattern, size, syntax, bufp)
str[c1] = '\0';
/* If isn't a word bracketed by `[:' and:`]':
- undo the ending character, the letters, and leave
+ undo the ending character, the letters, and leave
the leading `:' and `[' (but set bits for them). */
if (c == ':' && *p == ']')
{
@@ -1473,12 +1473,12 @@ regex_compile (pattern, size, syntax, bufp)
boolean is_space = STREQ (str, "space");
boolean is_upper = STREQ (str, "upper");
boolean is_xdigit = STREQ (str, "xdigit");
-
+
if (!IS_CHAR_CLASS (str)) return REG_ECTYPE;
/* Throw away the ] at the end of the character
class. */
- PATFETCH (c);
+ PATFETCH (c);
if (p == pend) return REG_EBRACK;
@@ -1503,7 +1503,7 @@ regex_compile (pattern, size, syntax, bufp)
else
{
c1++;
- while (c1--)
+ while (c1--)
PATUNFETCH;
SET_LIST_BIT ('[');
SET_LIST_BIT (':');
@@ -1519,8 +1519,8 @@ regex_compile (pattern, size, syntax, bufp)
/* Discard any (non)matching list bytes that are all 0 at the
end of the map. Decrease the map-length byte too. */
- while ((int) b[-1] > 0 && b[b[-1] - 1] == 0)
- b[-1]--;
+ while ((int) b[-1] > 0 && b[b[-1] - 1] == 0)
+ b[-1]--;
b += b[-1];
}
break;
@@ -1580,7 +1580,7 @@ regex_compile (pattern, size, syntax, bufp)
regnum++;
if (COMPILE_STACK_FULL)
- {
+ {
RETALLOC (compile_stack.stack, compile_stack.size << 1,
compile_stack_elt_t);
if (compile_stack.stack == NULL) return REG_ESPACE;
@@ -1593,7 +1593,7 @@ regex_compile (pattern, size, syntax, bufp)
whole pattern moves because of realloc, they will still
be valid. */
COMPILE_STACK_TOP.begalt_offset = begalt - bufp->buffer;
- COMPILE_STACK_TOP.fixup_alt_jump
+ COMPILE_STACK_TOP.fixup_alt_jump
= fixup_alt_jump ? fixup_alt_jump - bufp->buffer + 1 : 0;
COMPILE_STACK_TOP.laststart_offset = b - bufp->buffer;
COMPILE_STACK_TOP.regnum = regnum;
@@ -1607,7 +1607,7 @@ regex_compile (pattern, size, syntax, bufp)
COMPILE_STACK_TOP.inner_group_offset = b - bufp->buffer + 2;
BUF_PUSH_3 (start_memory, regnum, 0);
}
-
+
compile_stack.avail++;
fixup_alt_jump = 0;
@@ -1636,7 +1636,7 @@ regex_compile (pattern, size, syntax, bufp)
`pop_failure_jump' to pop. See comments at
`push_dummy_failure' in `re_match_2'. */
BUF_PUSH (push_dummy_failure);
-
+
/* We allocated space for this jump when we assigned
to `fixup_alt_jump', in the `handle_alt' case below. */
STORE_JUMP (jump_past_alt, fixup_alt_jump, b - 1);
@@ -1658,11 +1658,11 @@ regex_compile (pattern, size, syntax, bufp)
as in `(ab)c(de)' -- the second group is #2. */
regnum_t this_group_regnum;
- compile_stack.avail--;
+ compile_stack.avail--;
begalt = bufp->buffer + COMPILE_STACK_TOP.begalt_offset;
fixup_alt_jump
= COMPILE_STACK_TOP.fixup_alt_jump
- ? bufp->buffer + COMPILE_STACK_TOP.fixup_alt_jump - 1
+ ? bufp->buffer + COMPILE_STACK_TOP.fixup_alt_jump - 1
: 0;
laststart = bufp->buffer + COMPILE_STACK_TOP.laststart_offset;
this_group_regnum = COMPILE_STACK_TOP.regnum;
@@ -1677,7 +1677,7 @@ regex_compile (pattern, size, syntax, bufp)
{
unsigned char *inner_group_loc
= bufp->buffer + COMPILE_STACK_TOP.inner_group_offset;
-
+
*inner_group_loc = regnum - this_group_regnum;
BUF_PUSH_3 (stop_memory, this_group_regnum,
regnum - this_group_regnum);
@@ -1706,10 +1706,10 @@ regex_compile (pattern, size, syntax, bufp)
jump (put in below, which in turn will jump to the next
(if any) alternative's such jump, etc.). The last such
jump jumps to the correct final destination. A picture:
- _____ _____
- | | | |
- | v | v
- a | b | c
+ _____ _____
+ | | | |
+ | v | v
+ a | b | c
If we are at `b', then fixup_alt_jump right now points to a
three-byte space after `a'. We'll put in the jump, set
@@ -1731,10 +1731,10 @@ regex_compile (pattern, size, syntax, bufp)
break;
- case '{':
+ case '{':
/* If \{ is a literal. */
if (!(syntax & RE_INTERVALS)
- /* If we're at `\{' and it's not the open-interval
+ /* If we're at `\{' and it's not the open-interval
operator. */
|| ((syntax & RE_INTERVALS) && (syntax & RE_NO_BK_BRACES))
|| (p - 2 == pattern && p == pend))
@@ -1773,11 +1773,11 @@ regex_compile (pattern, size, syntax, bufp)
{
if (syntax & RE_NO_BK_BRACES)
goto unfetch_interval;
- else
+ else
return REG_BADBR;
}
- if (!(syntax & RE_NO_BK_BRACES))
+ if (!(syntax & RE_NO_BK_BRACES))
{
if (c != '\\') return REG_EBRACE;
@@ -1788,7 +1788,7 @@ regex_compile (pattern, size, syntax, bufp)
{
if (syntax & RE_NO_BK_BRACES)
goto unfetch_interval;
- else
+ else
return REG_BADBR;
}
@@ -1824,7 +1824,7 @@ regex_compile (pattern, size, syntax, bufp)
jump_n <succeed_n addr> <jump count>
(The upper bound and `jump_n' are omitted if
`upper_bound' is 1, though.) */
- else
+ else
{ /* If the upper bound is > 1, we need to insert
more at the end of the loop. */
unsigned nbytes = 10 + (upper_bound > 1) * 10;
@@ -1841,7 +1841,7 @@ regex_compile (pattern, size, syntax, bufp)
lower_bound);
b += 5;
- /* Code to initialize the lower bound. Insert
+ /* Code to initialize the lower bound. Insert
before the `succeed_n'. The `5' is the last two
bytes of this `set_number_at', plus 3 bytes of
the following `succeed_n'. */
@@ -1852,7 +1852,7 @@ regex_compile (pattern, size, syntax, bufp)
{ /* More than one repetition is allowed, so
append a backward jump to the `succeed_n'
that starts this interval.
-
+
When we've reached this during matching,
we'll have matched the interval once, so
jump back only `upper_bound - 1' times. */
@@ -1870,7 +1870,7 @@ regex_compile (pattern, size, syntax, bufp)
so everything is getting moved up by 5.
Conclusion: (b - 2) - (laststart + 3) + 5,
i.e., b - laststart.
-
+
We insert this at the beginning of the loop
so that if we fail during matching, we'll
reinitialize the bounds. */
@@ -1891,7 +1891,7 @@ regex_compile (pattern, size, syntax, bufp)
beg_interval = NULL;
/* normal_char and normal_backslash need `c'. */
- PATFETCH (c);
+ PATFETCH (c);
if (!(syntax & RE_NO_BK_BRACES))
{
@@ -1907,7 +1907,7 @@ regex_compile (pattern, size, syntax, bufp)
BUF_PUSH (at_dot);
break;
- case 's':
+ case 's':
laststart = b;
PATFETCH (c);
BUF_PUSH_2 (syntaxspec, syntax_spec_code[c]);
@@ -1998,11 +1998,11 @@ regex_compile (pattern, size, syntax, bufp)
/* Expects the character in `c'. */
normal_char:
/* If no exactn currently being built. */
- if (!pending_exact
+ if (!pending_exact
/* If last exactn not at current position. */
|| pending_exact + *pending_exact + 1 != b
-
+
/* We have only one byte following the exactn for the count. */
|| *pending_exact == (1 << BYTEWIDTH) - 1
@@ -2017,26 +2017,26 @@ regex_compile (pattern, size, syntax, bufp)
: (p[0] == '\\' && p[1] == '{'))))
{
/* Start building a new exactn. */
-
+
laststart = b;
BUF_PUSH_2 (exactn, 0);
pending_exact = b - 1;
}
-
+
BUF_PUSH (c);
(*pending_exact)++;
break;
} /* switch (c) */
} /* while p != pend */
-
+
/* Through the pattern now. */
-
+
if (fixup_alt_jump)
STORE_JUMP (jump_past_alt, fixup_alt_jump, b);
- if (!COMPILE_STACK_EMPTY)
+ if (!COMPILE_STACK_EMPTY)
return REG_EPAREN;
free (compile_stack.stack);
@@ -2092,14 +2092,14 @@ insert_op1 (op, loc, arg, end)
re_opcode_t op;
unsigned char *loc;
int arg;
- unsigned char *end;
+ unsigned char *end;
{
register unsigned char *pfrom = end;
register unsigned char *pto = end + 3;
while (pfrom != loc)
*--pto = *--pfrom;
-
+
store_op1 (op, loc, arg);
}
@@ -2111,14 +2111,14 @@ insert_op2 (op, loc, arg1, arg2, end)
re_opcode_t op;
unsigned char *loc;
int arg1, arg2;
- unsigned char *end;
+ unsigned char *end;
{
register unsigned char *pfrom = end;
register unsigned char *pto = end + 5;
while (pfrom != loc)
*--pto = *--pfrom;
-
+
store_op2 (op, loc, arg1, arg2);
}
@@ -2134,7 +2134,7 @@ at_begline_loc_p (pattern, p, syntax)
{
const char *prev = p - 2;
boolean prev_prev_backslash = prev > pattern && prev[-1] == '\\';
-
+
return
/* After a subexpression? */
(*prev == '(' && (syntax & RE_NO_BK_PARENS || prev_prev_backslash))
@@ -2154,7 +2154,7 @@ at_endline_loc_p (p, pend, syntax)
const char *next = p;
boolean next_backslash = *next == '\\';
const char *next_next = p + 1 < pend ? p + 1 : NULL;
-
+
return
/* Before a subexpression? */
(syntax & RE_NO_BK_PARENS ? *next == ')'
@@ -2165,7 +2165,7 @@ at_endline_loc_p (p, pend, syntax)
}
-/* Returns true if REGNUM is in one of COMPILE_STACK's elements and
+/* Returns true if REGNUM is in one of COMPILE_STACK's elements and
false if it's not. */
static boolean
@@ -2175,8 +2175,8 @@ group_in_compile_stack (compile_stack, regnum)
{
int this_element;
- for (this_element = compile_stack.avail - 1;
- this_element >= 0;
+ for (this_element = compile_stack.avail - 1;
+ this_element >= 0;
this_element--)
if (compile_stack.stack[this_element].regnum == regnum)
return true;
@@ -2190,9 +2190,9 @@ group_in_compile_stack (compile_stack, regnum)
starting character is in `P[-2]'. (`P[-1]' is the character `-'.)
Then we set the translation of all bits between the starting and
ending characters (inclusive) in the compiled pattern B.
-
+
Return an error code.
-
+
We use these short variable names so we can use the same macros as
`regex_compile' itself. */
@@ -2207,7 +2207,7 @@ compile_range (p_ptr, pend, translate, syntax, b)
const char *p = *p_ptr;
int range_start, range_end;
-
+
if (p == pend)
return REG_ERANGE;
@@ -2216,7 +2216,7 @@ compile_range (p_ptr, pend, translate, syntax, b)
is set, the range endpoints will be negative if we fetch using a
signed char *.
- We also want to fetch the endpoints without translating them; the
+ We also want to fetch the endpoints without translating them; the
appropriate translation is done in the bit-setting loop below. */
range_start = ((unsigned char *) p)[-2];
range_end = ((unsigned char *) p)[0];
@@ -2237,14 +2237,14 @@ compile_range (p_ptr, pend, translate, syntax, b)
{
SET_LIST_BIT (TRANSLATE (this_char));
}
-
+
return REG_NOERROR;
}
/* Failure stack declarations and macros; both re_compile_fastmap and
re_match_2 use a failure stack. These have to be macros because of
REGEX_ALLOCATE. */
-
+
/* Number of failure points for which to initially allocate space
when matching. If this number is exceeded, we allocate more
@@ -2292,8 +2292,8 @@ typedef struct
/* Double the size of FAIL_STACK, up to approximately `re_max_failures' items.
Return 1 if succeeds, and 0 if either ran out of memory
- allocating space for it or it was already too large.
-
+ allocating space for it or it was already too large.
+
REGEX_REALLOCATE requires `destination' be declared. */
#define DOUBLE_FAIL_STACK(fail_stack) \
@@ -2310,7 +2310,7 @@ typedef struct
1)))
-/* Push PATTERN_OP on FAIL_STACK.
+/* Push PATTERN_OP on FAIL_STACK.
Return 1 if was able to do so and 0 if ran out of memory allocating
space to do so. */
@@ -2341,12 +2341,12 @@ typedef struct
/* Push the information about the state we will need
- if we ever fail back to it.
-
+ if we ever fail back to it.
+
Requires variables fail_stack, regstart, regend, reg_info, and
num_regs be declared. DOUBLE_FAIL_STACK requires `destination' be
declared.
-
+
Does `return FAILURE_CODE' if runs out of memory. */
#define PUSH_FAILURE_POINT(pattern_place, string_place, failure_code) \
@@ -2454,7 +2454,7 @@ typedef struct
LOW_REG, HIGH_REG -- the highest and lowest active registers.
REGSTART, REGEND -- arrays of string positions.
REG_INFO -- array of information about each subexpression.
-
+
Also assumes the variables `fail_stack' and (if debugging), `bufp',
`pend', `string1', `size1', `string2', and `size2'. */
@@ -2522,7 +2522,7 @@ typedef struct
The caller must supply the address of a (1 << BYTEWIDTH)-byte data
area as BUFP->fastmap.
-
+
We set the `fastmap', `fastmap_accurate', and `can_be_null' fields in
the pattern buffer.
@@ -2539,7 +2539,7 @@ re_compile_fastmap (bufp)
#endif
/* We don't push any register information onto the failure stack. */
unsigned num_regs = 0;
-
+
register char *fastmap = bufp->fastmap;
unsigned char *pattern = bufp->buffer;
unsigned long size = bufp->used;
@@ -2556,27 +2556,27 @@ re_compile_fastmap (bufp)
boolean succeed_n_p = false;
assert (fastmap != NULL && p != NULL);
-
+
INIT_FAIL_STACK ();
bzero (fastmap, 1 << BYTEWIDTH); /* Assume nothing's valid. */
bufp->fastmap_accurate = 1; /* It will be when we're done. */
bufp->can_be_null = 0;
-
+
while (p != pend || !FAIL_STACK_EMPTY ())
{
if (p == pend)
{
bufp->can_be_null |= path_can_be_null;
-
+
/* Reset for next path. */
path_can_be_null = true;
-
+
p = fail_stack.stack[--fail_stack.avail];
}
/* We should never be about to go beyond the end of the pattern. */
assert (p < pend);
-
+
#ifdef SWITCH_ENUM_BUG
switch ((int) ((re_opcode_t) *p++))
#else
@@ -2700,10 +2700,10 @@ re_compile_fastmap (bufp)
case jump_past_alt:
case dummy_failure_jump:
EXTRACT_NUMBER_AND_INCR (j, p);
- p += j;
+ p += j;
if (j > 0)
continue;
-
+
/* Jump backward implies we just went through the body of a
loop and matched nothing. Opcode jumped to should be
`on_failure_jump' or `succeed_n'. Just treat it like an
@@ -2715,10 +2715,10 @@ re_compile_fastmap (bufp)
p++;
EXTRACT_NUMBER_AND_INCR (j, p);
- p += j;
-
+ p += j;
+
/* If what's on the stack is where we are now, pop it. */
- if (!FAIL_STACK_EMPTY ()
+ if (!FAIL_STACK_EMPTY ()
&& fail_stack.stack[fail_stack.avail - 1] == p)
fail_stack.avail--;
@@ -2756,7 +2756,7 @@ re_compile_fastmap (bufp)
case succeed_n:
/* Get to the number of times to succeed. */
- p += 2;
+ p += 2;
/* Increment p past the n for when k != 0. */
EXTRACT_NUMBER_AND_INCR (k, p);
@@ -2847,7 +2847,7 @@ re_search (bufp, string, size, startpos, range, regs)
int size, startpos, range;
struct re_registers *regs;
{
- return re_search_2 (bufp, NULL, 0, string, size, startpos, range,
+ return re_search_2 (bufp, NULL, 0, string, size, startpos, range,
regs, size);
}
@@ -2855,17 +2855,17 @@ re_search (bufp, string, size, startpos, range, regs)
/* Using the compiled pattern in BUFP->buffer, first tries to match the
virtual concatenation of STRING1 and STRING2, starting first at index
STARTPOS, then at STARTPOS + 1, and so on.
-
+
STRING1 and STRING2 have length SIZE1 and SIZE2, respectively.
-
+
RANGE is how far to scan while trying to match. RANGE = 0 means try
only at STARTPOS; in general, the last start tried is STARTPOS +
RANGE.
-
+
In REGS, return the indices of the virtual concatenation of STRING1
and STRING2 that matched the entire BUFP->buffer and its contained
subexpressions.
-
+
Do not consider matching one past the index STOP in the virtual
concatenation of STRING1 and STRING2.
@@ -2892,7 +2892,7 @@ re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop)
/* Check for out-of-range STARTPOS. */
if (startpos < 0 || startpos > total_size)
return -1;
-
+
/* Fix up RANGE if it might eventually take us outside
the virtual concatenation of STRING1 and STRING2. */
if (endpos < -1)
@@ -2914,10 +2914,10 @@ re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop)
if (fastmap && !bufp->fastmap_accurate)
if (re_compile_fastmap (bufp) == -2)
return -2;
-
+
/* Loop through the string, looking for a place to start matching. */
for (;;)
- {
+ {
/* If a fastmap is supplied, skip quickly over characters that
cannot be the start of a match. If the pattern can match the
null string, however, we don't need to skip characters; we want
@@ -2934,7 +2934,7 @@ re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop)
lim = range - (size1 - startpos);
d = (startpos >= size1 ? string2 - size1 : string1) + startpos;
-
+
/* Written out as an if-else to avoid testing `translate'
inside the loop. */
if (translate)
@@ -2951,7 +2951,7 @@ re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop)
else /* Searching backwards. */
{
register char c = (size1 == 0 || startpos >= size1
- ? string2[startpos - size1]
+ ? string2[startpos - size1]
: string1[startpos]);
if (!fastmap[(unsigned char) TRANSLATE (c)])
@@ -2968,21 +2968,21 @@ re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop)
startpos, regs, stop);
if (val >= 0)
return startpos;
-
+
if (val == -2)
return -2;
advance:
- if (!range)
+ if (!range)
break;
- else if (range > 0)
+ else if (range > 0)
{
- range--;
+ range--;
startpos++;
}
else
{
- range++;
+ range++;
startpos--;
}
}
@@ -3001,8 +3001,8 @@ static boolean alt_match_null_string_p (),
onto the failure stack. Other register information, such as the
starting and ending positions (which are addresses), and the list of
inner groups (which is a bits list) are maintained in separate
- variables.
-
+ variables.
+
We are making a (strictly speaking) nonportable assumption here: that
the compiler will pack our bit fields into something that fits into
the type of `word', i.e., is something that fits into one item on the
@@ -3076,7 +3076,7 @@ typedef union
/* Test if at very beginning or at very end of the virtual concatenation
of `string1' and `string2'. If only one string, it's `string2'. */
#define AT_STRINGS_BEG(d) ((d) == (size1 ? string1 : string2) || !size2)
-#define AT_STRINGS_END(d) ((d) == end2)
+#define AT_STRINGS_END(d) ((d) == end2)
/* Test if D points to a character which is word-constituent. We have
@@ -3139,7 +3139,7 @@ re_match (bufp, string, size, pos, regs)
int size, pos;
struct re_registers *regs;
{
- return re_match_2 (bufp, NULL, 0, string, size, pos, regs, size);
+ return re_match_2 (bufp, NULL, 0, string, size, pos, regs, size);
}
#endif /* not emacs */
@@ -3148,7 +3148,7 @@ re_match (bufp, string, size, pos, regs)
the (virtual) concatenation of STRING1 and STRING2 (of length SIZE1
and SIZE2, respectively). We start matching at POS, and stop
matching at STOP.
-
+
If REGS is non-null and the `no_sub' field of BUFP is nonzero, we
store offsets for the substring each group matched in REGS. See the
documentation for exactly how many groups we fill.
@@ -3179,7 +3179,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
/* Where we are in the data, and the end of the current string. */
const char *d, *dend;
-
+
/* Where we are in the pattern, and the end of the pattern. */
unsigned char *p = bufp->buffer;
register unsigned char *pend = p + bufp->used;
@@ -3206,7 +3206,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
return, for use in backreferences. The number here includes
an element for register zero. */
unsigned num_regs = bufp->re_nsub + 1;
-
+
/* The currently active registers. */
unsigned lowest_active_reg = NO_LOWEST_ACTIVE_REG;
unsigned highest_active_reg = NO_HIGHEST_ACTIVE_REG;
@@ -3233,15 +3233,15 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
matched any of the pattern so far this time through the reg_num-th
subexpression. These two fields get reset each time through any
loop their register is in. */
- register_info_type *reg_info;
+ register_info_type *reg_info;
/* The following record the register info as found in the above
- variables when we find a match better than any we've seen before.
+ variables when we find a match better than any we've seen before.
This happens as we backtrack through the failure points, which in
turn happens only if we have not yet matched the entire string. */
unsigned best_regs_set = false;
const char **best_regstart, **best_regend;
-
+
/* Logically, this is `best_regend[0]'. But we don't want to have to
allocate space for that if we're not allocating space for anything
else (see below). Also, we never need info about register 0 for
@@ -3258,13 +3258,13 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
#ifdef DEBUG
/* Counts the total number of registers pushed. */
- unsigned num_regs_pushed = 0;
+ unsigned num_regs_pushed = 0;
#endif
DEBUG_PRINT1 ("\n\nEntering re_match_2.\n");
-
+
INIT_FAIL_STACK ();
-
+
/* Do not bother to initialize all the register variables if there are
no groups in the pattern, as it takes a fair amount of time. If
there are groups, we include space for register 0 (the whole
@@ -3282,8 +3282,8 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
reg_dummy = REGEX_TALLOC (num_regs, const char *);
reg_info_dummy = REGEX_TALLOC (num_regs, register_info_type);
- if (!(regstart && regend && old_regstart && old_regend && reg_info
- && best_regstart && best_regend && reg_dummy && reg_info_dummy))
+ if (!(regstart && regend && old_regstart && old_regend && reg_info
+ && best_regstart && best_regend && reg_dummy && reg_info_dummy))
{
FREE_VARIABLES ();
return -2;
@@ -3306,21 +3306,21 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
FREE_VARIABLES ();
return -1;
}
-
+
/* Initialize subexpression text positions to -1 to mark ones that no
start_memory/stop_memory has been seen for. Also initialize the
register information struct. */
for (mcnt = 1; mcnt < num_regs; mcnt++)
{
- regstart[mcnt] = regend[mcnt]
+ regstart[mcnt] = regend[mcnt]
= old_regstart[mcnt] = old_regend[mcnt] = REG_UNSET_VALUE;
-
+
REG_MATCH_NULL_STRING_P (reg_info[mcnt]) = MATCH_NULL_UNSET_VALUE;
IS_ACTIVE (reg_info[mcnt]) = 0;
MATCHED_SOMETHING (reg_info[mcnt]) = 0;
EVER_MATCHED_SOMETHING (reg_info[mcnt]) = 0;
}
-
+
/* We move `string1' into `string2' if the latter's empty -- but not if
`string1' is null. */
if (size2 == 0 && string1 != NULL)
@@ -3345,7 +3345,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
end_match_2 = string2 + stop - size1;
}
- /* `p' scans through the pattern as `d' scans through the data.
+ /* `p' scans through the pattern as `d' scans through the data.
`dend' is the end of the input string that `d' points within. `d'
is advanced into the following input string whenever necessary, but
this happens before fetching; therefore, at the beginning of the
@@ -3367,7 +3367,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
DEBUG_PRINT1 ("The string to match is: `");
DEBUG_PRINT_DOUBLE_STRING (d, string1, size1, string2, size2);
DEBUG_PRINT1 ("'\n");
-
+
/* This loops over pattern commands. It exits by returning from the
function if the match is complete, or it drops through if the match
fails at this starting point in the input data. */
@@ -3378,16 +3378,16 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
if (p == pend)
{ /* End of pattern means we might have succeeded. */
DEBUG_PRINT1 ("end of pattern ... ");
-
+
/* If we haven't matched the entire string, and we want the
longest match, try backtracking. */
if (d != end_match_2)
{
DEBUG_PRINT1 ("backtracking.\n");
-
+
if (!FAIL_STACK_EMPTY ())
{ /* More failure points to try. */
- boolean same_str_p = (FIRST_STRING_P (match_end)
+ boolean same_str_p = (FIRST_STRING_P (match_end)
== MATCHING_IN_FIRST_STRING);
/* If exceeds best match so far, save it. */
@@ -3397,20 +3397,20 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
{
best_regs_set = true;
match_end = d;
-
+
DEBUG_PRINT1 ("\nSAVING match as best so far.\n");
-
+
for (mcnt = 1; mcnt < num_regs; mcnt++)
{
best_regstart[mcnt] = regstart[mcnt];
best_regend[mcnt] = regend[mcnt];
}
}
- goto fail;
+ goto fail;
}
/* If no failure points, don't restore garbage. */
- else if (best_regs_set)
+ else if (best_regs_set)
{
restore_best_regs:
/* Restore best match. It may happen that `dend ==
@@ -3419,7 +3419,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
strings `x-' and `y-z-', if the two strings are
not consecutive in memory. */
DEBUG_PRINT1 ("Restoring best registers.\n");
-
+
d = match_end;
dend = ((d >= string1 && d <= end1)
? end_match_1 : end_match_2);
@@ -3474,7 +3474,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
regs->end[0] = (MATCHING_IN_FIRST_STRING ? d - string1
: d - string2 + size1);
}
-
+
/* Go through the first `min (num_regs, regs->num_regs)'
registers, since that is all we initialized. */
for (mcnt = 1; mcnt < MIN (num_regs, regs->num_regs); mcnt++)
@@ -3487,7 +3487,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
regs->end[mcnt] = POINTER_TO_OFFSET (regend[mcnt]);
}
}
-
+
/* If the regs structure we return has more elements than
were in the pattern, set the extra elements to -1. If
we (re)allocated the registers, this is the case,
@@ -3503,8 +3503,8 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
nfailure_points_pushed - nfailure_points_popped);
DEBUG_PRINT2 ("%u registers pushed.\n", num_regs_pushed);
- mcnt = d - pos - (MATCHING_IN_FIRST_STRING
- ? string1
+ mcnt = d - pos - (MATCHING_IN_FIRST_STRING
+ ? string1
: string2 - size1);
DEBUG_PRINT2 ("Returning %d from re_match_2.\n", mcnt);
@@ -3594,7 +3594,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
p += 1 + *p;
if (!not) goto fail;
-
+
SET_REGS_MATCHED ();
d++;
break;
@@ -3611,9 +3611,9 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
/* Find out if this group can match the empty string. */
p1 = p; /* To send to group_match_null_string_p. */
-
+
if (REG_MATCH_NULL_STRING_P (reg_info[*p]) == MATCH_NULL_UNSET_VALUE)
- REG_MATCH_NULL_STRING_P (reg_info[*p])
+ REG_MATCH_NULL_STRING_P (reg_info[*p])
= group_match_null_string_p (&p1, pend, reg_info);
/* Save the position in the string where we were the last time
@@ -3624,7 +3624,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
old_regstart[*p] = REG_MATCH_NULL_STRING_P (reg_info[*p])
? REG_UNSET (regstart[*p]) ? d : regstart[*p]
: regstart[*p];
- DEBUG_PRINT2 (" old_regstart: %d\n",
+ DEBUG_PRINT2 (" old_regstart: %d\n",
POINTER_TO_OFFSET (old_regstart[*p]));
regstart[*p] = d;
@@ -3632,10 +3632,10 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
IS_ACTIVE (reg_info[*p]) = 1;
MATCHED_SOMETHING (reg_info[*p]) = 0;
-
+
/* This is the new highest active register. */
highest_active_reg = *p;
-
+
/* If nothing was active before, this is the new lowest active
register. */
if (lowest_active_reg == NO_LOWEST_ACTIVE_REG)
@@ -3651,7 +3651,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
number, and the number of inner groups. */
case stop_memory:
DEBUG_PRINT3 ("EXECUTING stop_memory %d (%d):\n", *p, p[1]);
-
+
/* We need to save the string position the last time we were at
this close-group operator in case the group is operated
upon by a repetition operator, e.g., with `((a*)*(b*)*)*'
@@ -3660,7 +3660,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
old_regend[*p] = REG_MATCH_NULL_STRING_P (reg_info[*p])
? REG_UNSET (regend[*p]) ? d : regend[*p]
: regend[*p];
- DEBUG_PRINT2 (" old_regend: %d\n",
+ DEBUG_PRINT2 (" old_regend: %d\n",
POINTER_TO_OFFSET (old_regend[*p]));
regend[*p] = d;
@@ -3668,7 +3668,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
/* This register isn't active anymore. */
IS_ACTIVE (reg_info[*p]) = 0;
-
+
/* If this was the only register active, nothing is active
anymore. */
if (lowest_active_reg == highest_active_reg)
@@ -3684,7 +3684,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
unsigned char r = *p - 1;
while (r > 0 && !IS_ACTIVE (reg_info[r]))
r--;
-
+
/* If we end up at register zero, that means that we saved
the registers as the result of an `on_failure_jump', not
a `start_memory', and we jumped to past the innermost
@@ -3700,7 +3700,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
else
highest_active_reg = r;
}
-
+
/* If just failed to match something this time around with a
group that's operated on by a repetition operator, try to
force exit from the ``loop'', and restore the register
@@ -3708,10 +3708,10 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
last match. */
if ((!MATCHED_SOMETHING (reg_info[*p])
|| (re_opcode_t) p[-3] == start_memory)
- && (p + 2) < pend)
+ && (p + 2) < pend)
{
boolean is_a_jump_n = false;
-
+
p1 = p + 2;
mcnt = 0;
switch ((re_opcode_t) *p1++)
@@ -3726,12 +3726,12 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
if (is_a_jump_n)
p1 += 2;
break;
-
+
default:
/* do nothing */ ;
}
p1 += mcnt;
-
+
/* If the next operation is a jump backwards in the pattern
to an on_failure_jump right before the start_memory
corresponding to this stop_memory, exit from the loop
@@ -3745,17 +3745,17 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
failed match, e.g., with `(a*)*b' against `ab' for
regstart[1], and, e.g., with `((a*)*(b*)*)*'
against `aba' for regend[3].
-
+
Also restore the registers for inner groups for,
e.g., `((a*)(b*))*' against `aba' (register 3 would
otherwise get trashed). */
-
+
if (EVER_MATCHED_SOMETHING (reg_info[*p]))
{
- unsigned r;
-
+ unsigned r;
+
EVER_MATCHED_SOMETHING (reg_info[*p]) = 0;
-
+
/* Restore this and inner groups' (if any) registers. */
for (r = *p; r < *p + *(p + 1); r++)
{
@@ -3764,7 +3764,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
/* xx why this test? */
if ((int) old_regend[r] >= (int) regstart[r])
regend[r] = old_regend[r];
- }
+ }
}
p1++;
EXTRACT_NUMBER_AND_INCR (mcnt, p1);
@@ -3773,7 +3773,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
goto fail;
}
}
-
+
/* Move past the register number and the inner group count. */
p += 2;
break;
@@ -3790,16 +3790,16 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
/* Can't back reference a group which we've never matched. */
if (REG_UNSET (regstart[regno]) || REG_UNSET (regend[regno]))
goto fail;
-
+
/* Where in input to try to start matching. */
d2 = regstart[regno];
-
+
/* Where to stop matching; if both the place to start and
the place to stop matching are in the same string, then
set to the place to stop, otherwise, for now have to use
the end of the first string. */
- dend2 = ((FIRST_STRING_P (regstart[regno])
+ dend2 = ((FIRST_STRING_P (regstart[regno])
== FIRST_STRING_P (regend[regno]))
? regend[regno] : end_match_1);
for (;;)
@@ -3823,16 +3823,16 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
/* How many characters left in this segment to match. */
mcnt = dend - d;
-
+
/* Want how many consecutive characters we can match in
one shot, so, if necessary, adjust the count. */
if (mcnt > dend2 - d2)
mcnt = dend2 - d2;
-
+
/* Compare that many; failure if mismatch, else move
past them. */
- if (translate
- ? bcmp_translate (d, d2, mcnt, translate)
+ if (translate
+ ? bcmp_translate (d, d2, mcnt, translate)
: bcmp (d, d2, mcnt))
goto fail;
d += mcnt, d2 += mcnt;
@@ -3846,7 +3846,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
`newline_anchor' is set, after newlines. */
case begline:
DEBUG_PRINT1 ("EXECUTING begline.\n");
-
+
if (AT_STRINGS_BEG (d))
{
if (!bufp->not_bol) break;
@@ -3867,7 +3867,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
{
if (!bufp->not_eol) break;
}
-
+
/* We have to ``prefetch'' the next character. */
else if ((d == end1 ? *string2 : *d) == '\n'
&& bufp->newline_anchor)
@@ -3901,7 +3901,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
then the . fails against the \n. But the next thing we want
to do is match the \n against the \n; if we restored the
string value, we would be back at the foo.
-
+
Because this is used only in specific cases, we don't need to
check all the things that `on_failure_jump' does, to make
sure the right things get saved on the stack. Hence we don't
@@ -3911,7 +3911,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
case; that seems worse than this. */
case on_failure_keep_string_jump:
DEBUG_PRINT1 ("EXECUTING on_failure_keep_string_jump");
-
+
EXTRACT_NUMBER_AND_INCR (mcnt, p);
DEBUG_PRINT3 (" %d (to 0x%x):\n", mcnt, p + mcnt);
@@ -3920,7 +3920,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
/* Uses of on_failure_jump:
-
+
Each alternative starts with an on_failure_jump that points
to the beginning of the next alternative. Each alternative
except the last ends with a jump that in effect jumps past
@@ -3986,7 +3986,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
would have to backtrack because of (as in, e.g., `a*a')
then we can change to pop_failure_jump, because we'll
never have to backtrack.
-
+
This is not true in the case of alternatives: in
`(a|ab)*' we do need to backtrack to the `ab' alternative
(e.g., if the string was `ab'). But instead of trying to
@@ -4018,7 +4018,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
p1 = p + mcnt;
/* p1[0] ... p1[2] are the `on_failure_jump' corresponding
- to the `maybe_finalize_jump' of this case. Examine what
+ to the `maybe_finalize_jump' of this case. Examine what
follows. */
if ((re_opcode_t) p1[3] == exactn && p1[5] != c)
{
@@ -4026,12 +4026,12 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
DEBUG_PRINT3 (" %c != %c => pop_failure_jump.\n",
c, p1[5]);
}
-
+
else if ((re_opcode_t) p1[3] == charset
|| (re_opcode_t) p1[3] == charset_not)
{
int not = (re_opcode_t) p1[3] == charset_not;
-
+
if (c < (unsigned char) (p1[4] * BYTEWIDTH)
&& p1[5 + c / BYTEWIDTH] & (1 << (c % BYTEWIDTH)))
not = !not;
@@ -4080,7 +4080,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
}
/* Note fall through. */
-
+
/* Unconditionally jump (without popping any failure points). */
case jump:
unconditional_jump:
@@ -4090,7 +4090,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
DEBUG_PRINT2 ("(to 0x%x).\n", p);
break;
-
+
/* We need this opcode so we can detect where alternatives end
in `group_match_null_string_p' et al. */
case jump_past_alt:
@@ -4125,7 +4125,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
/* Have to succeed matching what follows at least n times.
After that, handle like `on_failure_jump'. */
- case succeed_n:
+ case succeed_n:
EXTRACT_NUMBER (mcnt, p + 2);
DEBUG_PRINT2 ("EXECUTING succeed_n %d.\n", mcnt);
@@ -4146,8 +4146,8 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
goto on_failure;
}
break;
-
- case jump_n:
+
+ case jump_n:
EXTRACT_NUMBER (mcnt, p + 2);
DEBUG_PRINT2 ("EXECUTING jump_n %d.\n", mcnt);
@@ -4156,13 +4156,13 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
{
mcnt--;
STORE_NUMBER (p + 2, mcnt);
- goto unconditional_jump;
+ goto unconditional_jump;
}
/* If don't have to jump any more, skip over the rest of command. */
- else
- p += 4;
+ else
+ p += 4;
break;
-
+
case set_number_at:
{
DEBUG_PRINT1 ("EXECUTING set_number_at.\n");
@@ -4207,13 +4207,13 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
if (PTR_CHAR_POS ((unsigned char *) d) >= point)
goto fail;
break;
-
+
case at_dot:
DEBUG_PRINT1 ("EXECUTING at_dot.\n");
if (PTR_CHAR_POS ((unsigned char *) d) != point)
goto fail;
break;
-
+
case after_dot:
DEBUG_PRINT1 ("EXECUTING after_dot.\n");
if (PTR_CHAR_POS ((unsigned char *) d) <= point)
@@ -4266,7 +4266,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
SET_REGS_MATCHED ();
d++;
break;
-
+
case notwordchar:
DEBUG_PRINT1 ("EXECUTING non-Emacs notwordchar.\n");
PREFETCH ();
@@ -4276,7 +4276,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
d++;
break;
#endif /* not emacs */
-
+
default:
abort ();
}
@@ -4301,7 +4301,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
if (p < pend)
{
boolean is_a_jump_n = false;
-
+
/* If failed to a backwards jump that's part of a repetition
loop, need to pop this failure point and use the next one. */
switch ((re_opcode_t) *p)
@@ -4313,7 +4313,7 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
case jump:
p1 = p + 1;
EXTRACT_NUMBER_AND_INCR (mcnt, p1);
- p1 += mcnt;
+ p1 += mcnt;
if ((is_a_jump_n && (re_opcode_t) *p1 == succeed_n)
|| (!is_a_jump_n
@@ -4344,10 +4344,10 @@ re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
/* We are passed P pointing to a register number after a start_memory.
-
+
Return true if the pattern up to the corresponding stop_memory can
match the empty string, and false otherwise.
-
+
If we find the matching stop_memory, sets P to point to one past its number.
Otherwise, sets P to an undefined byte less than or equal to END.
@@ -4361,20 +4361,20 @@ group_match_null_string_p (p, end, reg_info)
int mcnt;
/* Point to after the args to the start_memory. */
unsigned char *p1 = *p + 2;
-
+
while (p1 < end)
{
/* Skip over opcodes that can match nothing, and return true or
false, as appropriate, when we get to one that can't, or to the
matching stop_memory. */
-
+
switch ((re_opcode_t) *p1)
{
/* Could be either a loop or a series of alternatives. */
case on_failure_jump:
p1++;
EXTRACT_NUMBER_AND_INCR (mcnt, p1);
-
+
/* If the next operation is not a jump backwards in the
pattern. */
@@ -4388,7 +4388,7 @@ group_match_null_string_p (p, end, reg_info)
/on_failure_jump/0/6/exactn/1/a/jump_past_alt/0/6
/on_failure_jump/0/6/exactn/1/b/jump_past_alt/0/3
- /exactn/1/c
+ /exactn/1/c
So, we have to first go through the first (n-1)
alternatives and then deal with the last one separately. */
@@ -4404,19 +4404,19 @@ group_match_null_string_p (p, end, reg_info)
is, including the ending `jump_past_alt' and
its number. */
- if (!alt_match_null_string_p (p1, p1 + mcnt - 3,
+ if (!alt_match_null_string_p (p1, p1 + mcnt - 3,
reg_info))
return false;
/* Move to right after this alternative, including the
jump_past_alt. */
- p1 += mcnt;
+ p1 += mcnt;
/* Break if it's the beginning of an n-th alternative
that doesn't begin with an on_failure_jump. */
if ((re_opcode_t) *p1 != on_failure_jump)
break;
-
+
/* Still have to check that it's not an n-th
alternative that starts with an on_failure_jump. */
p1++;
@@ -4441,14 +4441,14 @@ group_match_null_string_p (p, end, reg_info)
} /* if mcnt > 0 */
break;
-
+
case stop_memory:
assert (p1[1] == **p);
*p = p1 + 2;
return true;
-
- default:
+
+ default:
if (!common_op_match_null_string_p (&p1, end, reg_info))
return false;
}
@@ -4461,7 +4461,7 @@ group_match_null_string_p (p, end, reg_info)
/* Similar to group_match_null_string_p, but doesn't deal with alternatives:
It expects P to be the first byte of a single alternative and END one
byte past the last. The alternative can contain groups. */
-
+
static boolean
alt_match_null_string_p (p, end, reg_info)
unsigned char *p, *end;
@@ -4469,12 +4469,12 @@ alt_match_null_string_p (p, end, reg_info)
{
int mcnt;
unsigned char *p1 = p;
-
+
while (p1 < end)
{
- /* Skip over opcodes that can match nothing, and break when we get
+ /* Skip over opcodes that can match nothing, and break when we get
to one that can't. */
-
+
switch ((re_opcode_t) *p1)
{
/* It's a loop. */
@@ -4483,8 +4483,8 @@ alt_match_null_string_p (p, end, reg_info)
EXTRACT_NUMBER_AND_INCR (mcnt, p1);
p1 += mcnt;
break;
-
- default:
+
+ default:
if (!common_op_match_null_string_p (&p1, end, reg_info))
return false;
}
@@ -4495,8 +4495,8 @@ alt_match_null_string_p (p, end, reg_info)
/* Deals with the ops common to group_match_null_string_p and
- alt_match_null_string_p.
-
+ alt_match_null_string_p.
+
Sets P to one after the op and its arguments, if any. */
static boolean
@@ -4531,7 +4531,7 @@ common_op_match_null_string_p (p, end, reg_info)
reg_no = *p1;
assert (reg_no > 0 && reg_no <= MAX_REGNUM);
ret = group_match_null_string_p (&p1, end, reg_info);
-
+
/* Have to set this here in case we're checking a group which
contains a group and a back reference to it. */
@@ -4541,7 +4541,7 @@ common_op_match_null_string_p (p, end, reg_info)
if (!ret)
return false;
break;
-
+
/* If this is an optimized succeed_n for zero times, make the jump. */
case jump:
EXTRACT_NUMBER_AND_INCR (mcnt, p1);
@@ -4553,7 +4553,7 @@ common_op_match_null_string_p (p, end, reg_info)
case succeed_n:
/* Get to the number of times to succeed. */
- p1 += 2;
+ p1 += 2;
EXTRACT_NUMBER_AND_INCR (mcnt, p1);
if (mcnt == 0)
@@ -4566,7 +4566,7 @@ common_op_match_null_string_p (p, end, reg_info)
return false;
break;
- case duplicate:
+ case duplicate:
if (!REG_MATCH_NULL_STRING_P (reg_info[*p1]))
return false;
break;
@@ -4586,7 +4586,7 @@ common_op_match_null_string_p (p, end, reg_info)
/* Return zero if TRANSLATE[S1] and TRANSLATE[S2] are identical for LEN
bytes; nonzero otherwise. */
-
+
static int
bcmp_translate (s1, s2, len, translate)
unsigned char *s1, *s2;
@@ -4607,10 +4607,10 @@ bcmp_translate (s1, s2, len, translate)
/* re_compile_pattern is the GNU regular expression compiler: it
compiles PATTERN (of length SIZE) and puts the result in BUFP.
Returns 0 if the pattern was valid, otherwise an error string.
-
+
Assumes the `allocated' (and perhaps `buffer') and `translate' fields
are set in BUFP on entry.
-
+
We call regex_compile to do the actual compilation. */
const char *
@@ -4620,23 +4620,23 @@ re_compile_pattern (pattern, length, bufp)
struct re_pattern_buffer *bufp;
{
reg_errcode_t ret;
-
+
/* GNU code is written to assume at least RE_NREGS registers will be set
(and at least one extra will be -1). */
bufp->regs_allocated = REGS_UNALLOCATED;
-
+
/* And GNU code determines whether or not to get register information
by passing null for the REGS argument to re_match, etc., not by
setting no_sub. */
bufp->no_sub = 0;
-
+
/* Match anchors at newline. */
bufp->newline_anchor = 1;
-
+
ret = regex_compile (pattern, length, re_syntax_options, bufp);
return re_error_msg[(int) ret];
-}
+}
/* Entry points compatible with 4.2 BSD regex library. We don't define
them if this is an Emacs or POSIX compilation. */
@@ -4651,7 +4651,7 @@ re_comp (s)
const char *s;
{
reg_errcode_t ret;
-
+
if (!s)
{
if (!re_comp_buf.buffer)
@@ -4678,7 +4678,7 @@ re_comp (s)
re_comp_buf.newline_anchor = 1;
ret = regex_compile (s, strlen (s), re_syntax_options, &re_comp_buf);
-
+
/* Yes, we're discarding `const' here. */
return (char *) re_error_msg[(int) ret];
}
@@ -4735,7 +4735,7 @@ re_exec (s)
int
regcomp (preg, pattern, cflags)
regex_t *preg;
- const char *pattern;
+ const char *pattern;
int cflags;
{
reg_errcode_t ret;
@@ -4746,17 +4746,17 @@ regcomp (preg, pattern, cflags)
/* regex_compile will allocate the space for the compiled pattern. */
preg->buffer = 0;
preg->allocated = 0;
-
+
/* Don't bother to use a fastmap when searching. This simplifies the
REG_NEWLINE case: if we used a fastmap, we'd have to put all the
characters after newlines into the fastmap. This way, we just try
every character. */
preg->fastmap = 0;
-
+
if (cflags & REG_ICASE)
{
unsigned i;
-
+
preg->translate = (char *) malloc (CHAR_SET_SIZE);
if (preg->translate == NULL)
return (int) REG_ESPACE;
@@ -4781,38 +4781,38 @@ regcomp (preg, pattern, cflags)
preg->no_sub = !!(cflags & REG_NOSUB);
- /* POSIX says a null character in the pattern terminates it, so we
+ /* POSIX says a null character in the pattern terminates it, so we
can use strlen here in compiling the pattern. */
ret = regex_compile (pattern, strlen (pattern), syntax, preg);
-
+
/* POSIX doesn't distinguish between an unmatched open-group and an
unmatched close-group: both are REG_EPAREN. */
if (ret == REG_ERPAREN) ret = REG_EPAREN;
-
+
return (int) ret;
}
/* regexec searches for a given pattern, specified by PREG, in the
string STRING.
-
+
If NMATCH is zero or REG_NOSUB was set in the cflags argument to
`regcomp', we ignore PMATCH. Otherwise, we assume PMATCH has at
least NMATCH elements, and we set them to the offsets of the
corresponding matched substrings.
-
+
EFLAGS specifies `execution flags' which affect matching: if
REG_NOTBOL is set, then ^ does not match at the beginning of the
string; if REG_NOTEOL is set, then $ does not match at the end.
-
+
We return 0 if we find a match and REG_NOMATCH if not. */
int
regexec (preg, string, nmatch, pmatch, eflags)
const regex_t *preg;
- const char *string;
- size_t nmatch;
- regmatch_t pmatch[];
+ const char *string;
+ size_t nmatch;
+ regmatch_t pmatch[];
int eflags;
{
int ret;
@@ -4822,15 +4822,15 @@ regexec (preg, string, nmatch, pmatch, eflags)
boolean want_reg_info = !preg->no_sub && nmatch > 0;
private_preg = *preg;
-
+
private_preg.not_bol = !!(eflags & REG_NOTBOL);
private_preg.not_eol = !!(eflags & REG_NOTEOL);
-
+
/* The user has told us exactly how many registers to return
information about, via `nmatch'. We have to pass that on to the
matching routines. */
private_preg.regs_allocated = REGS_FIXED;
-
+
if (want_reg_info)
{
regs.num_regs = nmatch;
@@ -4844,7 +4844,7 @@ regexec (preg, string, nmatch, pmatch, eflags)
ret = re_search (&private_preg, string, len,
/* start: */ 0, /* range: */ len,
want_reg_info ? ®s : (struct re_registers *) 0);
-
+
/* Copy the register information to the POSIX structure. */
if (want_reg_info)
{
@@ -4884,7 +4884,7 @@ regerror (errcode, preg, errbuf, errbuf_size)
if (errcode < 0
|| errcode >= (sizeof (re_error_msg) / sizeof (re_error_msg[0])))
- /* Only error codes returned by the rest of the code should be passed
+ /* Only error codes returned by the rest of the code should be passed
to this routine. If we are given anything else, or if other regex
code generates an invalid error code, then the program has a bug.
Dump core so we can fix it. */
@@ -4898,7 +4898,7 @@ regerror (errcode, preg, errbuf, errbuf_size)
msg = "Success";
msg_size = strlen (msg) + 1; /* Includes the null. */
-
+
if (errbuf_size != 0)
{
if (msg_size > errbuf_size)
@@ -4923,7 +4923,7 @@ regfree (preg)
if (preg->buffer != NULL)
free (preg->buffer);
preg->buffer = NULL;
-
+
preg->allocated = 0;
preg->used = 0;
diff --git a/SerialICE/util/kconfig/regex.h b/SerialICE/util/kconfig/regex.h
index 408dd21..41ebf24 100644
--- a/SerialICE/util/kconfig/regex.h
+++ b/SerialICE/util/kconfig/regex.h
@@ -42,7 +42,7 @@ typedef unsigned reg_syntax_t;
#define RE_BACKSLASH_ESCAPE_IN_LISTS (1)
/* If this bit is not set, then + and ? are operators, and \+ and \? are
- literals.
+ literals.
If set, then \+ and \? are operators and + and ? are literals. */
#define RE_BK_PLUS_QM (RE_BACKSLASH_ESCAPE_IN_LISTS << 1)
@@ -58,7 +58,7 @@ typedef unsigned reg_syntax_t;
^ is an anchor if it is at the beginning of a regular
expression or after an open-group or an alternation operator;
$ is an anchor if it is at the end of a regular expression, or
- before a close-group or an alternation operator.
+ before a close-group or an alternation operator.
This bit could be (re)combined with RE_CONTEXT_INDEP_OPS, because
POSIX draft 11.2 says that * etc. in leading positions is undefined.
@@ -69,7 +69,7 @@ typedef unsigned reg_syntax_t;
/* If this bit is set, then special characters are always special
regardless of where they are in the pattern.
If this bit is not set, then special characters are special only in
- some contexts; otherwise they are ordinary. Specifically,
+ some contexts; otherwise they are ordinary. Specifically,
* + ? and intervals are only special when not after the beginning,
open-group, or alternation operator. */
#define RE_CONTEXT_INDEP_OPS (RE_CONTEXT_INDEP_ANCHORS << 1)
@@ -91,7 +91,7 @@ typedef unsigned reg_syntax_t;
#define RE_HAT_LISTS_NOT_NEWLINE (RE_DOT_NOT_NULL << 1)
/* If this bit is set, either \{...\} or {...} defines an
- interval, depending on RE_NO_BK_BRACES.
+ interval, depending on RE_NO_BK_BRACES.
If not set, \{, \}, {, and } are literals. */
#define RE_INTERVALS (RE_HAT_LISTS_NOT_NEWLINE << 1)
@@ -116,7 +116,7 @@ typedef unsigned reg_syntax_t;
If not set, then \<digit> is a back-reference. */
#define RE_NO_BK_REFS (RE_NO_BK_PARENS << 1)
-/* If this bit is set, then | is an alternation operator, and \| is literal.
+/* If this bit is set, then | is an alternation operator, and \| is literal.
If not set, then \| is an alternation operator, and | is literal. */
#define RE_NO_BK_VBAR (RE_NO_BK_REFS << 1)
@@ -138,7 +138,7 @@ extern reg_syntax_t re_syntax_options;
/* Define combinations of the above bits for the standard possibilities.
(The [[[ comments delimit what gets put into the Texinfo file, so
- don't delete them!) */
+ don't delete them!) */
/* [[[begin syntaxes]]] */
#define RE_SYNTAX_EMACS 0
@@ -205,7 +205,7 @@ extern reg_syntax_t re_syntax_options;
#ifdef RE_DUP_MAX
#undef RE_DUP_MAX
#endif
-#define RE_DUP_MAX ((1 << 15) - 1)
+#define RE_DUP_MAX ((1 << 15) - 1)
/* POSIX `cflags' bits (i.e., information for `regcomp'). */
@@ -217,7 +217,7 @@ extern reg_syntax_t re_syntax_options;
/* If this bit is set, then ignore case when matching.
If not set, then case is significant. */
#define REG_ICASE (REG_EXTENDED << 1)
-
+
/* If this bit is set, then anchors do not match at newline
characters in the string.
If not set, then anchors do match at newlines. */
@@ -256,7 +256,7 @@ typedef enum
REG_EESCAPE, /* Trailing backslash. */
REG_ESUBREG, /* Invalid back reference. */
REG_EBRACK, /* Unmatched left bracket. */
- REG_EPAREN, /* Parenthesis imbalance. */
+ REG_EPAREN, /* Parenthesis imbalance. */
REG_EBRACE, /* Unmatched \{. */
REG_BADBR, /* Invalid contents of \{\}. */
REG_ERANGE, /* Invalid range end. */
@@ -331,7 +331,7 @@ struct re_pattern_buffer
unsigned no_sub : 1;
/* If set, a beginning-of-line anchor doesn't match at the
- beginning of the string. */
+ beginning of the string. */
unsigned not_bol : 1;
/* Similarly for an end-of-line anchor. */
@@ -443,7 +443,7 @@ extern int re_match
/* Relates to `re_match' as `re_search_2' relates to `re_search'. */
-extern int re_match_2
+extern int re_match_2
_RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1,
int length1, const char *string2, int length2,
int start, struct re_registers *regs, int stop));
diff --git a/SerialICE/util/kconfig/zconf.tab.c_shipped b/SerialICE/util/kconfig/zconf.tab.c_shipped
index 0f14cdb..97b2772 100644
--- a/SerialICE/util/kconfig/zconf.tab.c_shipped
+++ b/SerialICE/util/kconfig/zconf.tab.c_shipped
@@ -1393,7 +1393,7 @@ yyparse ()
#endif
#endif
{
-
+
int yystate;
int yyn;
int yyresult;
diff --git a/SerialICE/util/romcc.c b/SerialICE/util/romcc.c
index 0d1f118..7078cd3 100644
--- a/SerialICE/util/romcc.c
+++ b/SerialICE/util/romcc.c
@@ -25,9 +25,9 @@
#define MAX_CWD_SIZE 4096
#define MAX_ALLOCATION_PASSES 100
-/* NOTE: Before you even start thinking to touch anything
+/* NOTE: Before you even start thinking to touch anything
* in this code, set DEBUG_ROMCC_WARNINGS to 1 to get an
- * insight on the original author's thoughts. We introduced
+ * insight on the original author's thoughts. We introduced
* this switch as romcc was about the only thing producing
* massive warnings in our code..
*/
@@ -61,7 +61,7 @@
#endif
/* Control flow graph of a loop without goto.
- *
+ *
* AAA
* +---/
* /
@@ -74,31 +74,31 @@
* |\ GGG HHH | continue;
* | \ \ | |
* | \ III | /
- * | \ | / /
- * | vvv /
- * +----BBB /
+ * | \ | / /
+ * | vvv /
+ * +----BBB /
* | /
* vv
* JJJ
*
- *
+ *
* AAA
* +-----+ | +----+
* | \ | / |
* | BBB +-+ |
* | / \ / | |
* | CCC JJJ / /
- * | / \ / /
- * | DDD EEE / /
+ * | / \ / /
+ * | DDD EEE / /
* | | +-/ /
- * | FFF /
- * | / \ /
- * | GGG HHH /
+ * | FFF /
+ * | / \ /
+ * | GGG HHH /
* | | +-/
* | III
- * +--+
+ * +--+
+ *
*
- *
* DFlocal(X) = { Y <- Succ(X) | idom(Y) != X }
* DFup(Z) = { Y <- DF(Z) | idom(Y) != X }
*
@@ -117,7 +117,7 @@
* DDD EEE DDD: [ ] ( BBB ) EEE: [ JJJ ] ()
* |
* FFF FFF: [ ] ( BBB )
- * / \
+ * / \
* GGG HHH GGG: [ ] ( BBB ) HHH: [ BBB ] ()
* |
* III III: [ BBB ] ()
@@ -125,7 +125,7 @@
*
* BBB and JJJ are definitely the dominance frontier.
* Where do I place phi functions and how do I make that decision.
- *
+ *
*/
static void die(char *fmt, ...)
{
@@ -223,7 +223,7 @@ static char *slurp_file(const char *dirname, const char *filename, off_t *r_size
off_t size, progress;
ssize_t result;
FILE* file;
-
+
if (!filename) {
*r_size = 0;
return 0;
@@ -398,14 +398,14 @@ struct token {
#define OP_SUB 9
#define OP_SL 10
#define OP_USR 11
-#define OP_SSR 12
-#define OP_AND 13
+#define OP_SSR 12
+#define OP_AND 13
#define OP_XOR 14
#define OP_OR 15
#define OP_POS 16 /* Dummy positive operator don't use it */
#define OP_NEG 17
#define OP_INVERT 18
-
+
#define OP_EQ 20
#define OP_NOTEQ 21
#define OP_SLESS 22
@@ -416,7 +416,7 @@ struct token {
#define OP_ULESSEQ 27
#define OP_SMOREEQ 28
#define OP_UMOREEQ 29
-
+
#define OP_LFALSE 30 /* Test if the expression is logically false */
#define OP_LTRUE 31 /* Test if the expression is logcially true */
@@ -475,7 +475,7 @@ struct token {
* assigned yet, or variables whose value we simply do not know.
*/
-#define OP_WRITE 60
+#define OP_WRITE 60
/* OP_WRITE moves one pseudo register to another.
* MISC(0) holds the destination pseudo register, which must be an OP_DECL.
* RHS(0) holds the psuedo to move.
@@ -544,10 +544,10 @@ struct token {
* The value represented by an OP_TUPLE is held in N registers.
* LHS(0..N-1) refer to those registers.
* ->use is a list of statements that use the value.
- *
+ *
* Although OP_TUPLE always has register sized pieces they are not
* used until structures are flattened/decomposed into their register
- * components.
+ * components.
* ???? registers ????
*/
@@ -561,10 +561,10 @@ struct token {
#define OP_FCALL 72
-/* OP_FCALL performs a procedure call.
+/* OP_FCALL performs a procedure call.
* MISC(0) holds a pointer to the OP_LIST of a function
* RHS(x) holds argument x of a function
- *
+ *
* Currently not seen outside of expressions.
*/
#define OP_PROG 73
@@ -614,16 +614,16 @@ struct token {
* ->use is the list of all branches that use this label.
*/
-#define OP_ADECL 87
+#define OP_ADECL 87
/* OP_ADECL is a triple that establishes an lvalue for assignments.
* A variable takes N registers to contain.
* LHS(0..N-1) refer to an OP_PIECE triple that represents
* the Xth register that the variable is stored in.
* ->use is a list of statements that use the variable.
- *
+ *
* Although OP_ADECL always has register sized pieces they are not
* used until structures are flattened/decomposed into their register
- * components.
+ * components.
*/
#define OP_SDECL 88
@@ -635,12 +635,12 @@ struct token {
#define OP_PHI 89
-/* OP_PHI is a triple used in SSA form code.
+/* OP_PHI is a triple used in SSA form code.
* It is used when multiple code paths merge and a variable needs
* a single assignment from any of those code paths.
* The operation is a cross between OP_DECL and OP_WRITE, which
* is what OP_PHI is generated from.
- *
+ *
* RHS(x) points to the value from code path x
* The number of RHS entries is the number of control paths into the block
* in which OP_PHI resides. The elements of the array point to point
@@ -653,12 +653,12 @@ struct token {
/* continuation helpers
*/
#define OP_CPS_BRANCH 90 /* an unconditional branch */
-/* OP_CPS_BRANCH calls a continuation
+/* OP_CPS_BRANCH calls a continuation
* RHS(x) holds argument x of the function
* TARG(0) holds OP_CPS_START target
*/
#define OP_CPS_CBRANCH 91 /* a conditional branch */
-/* OP_CPS_CBRANCH conditionally calls one of two continuations
+/* OP_CPS_CBRANCH conditionally calls one of two continuations
* RHS(0) holds the branch condition
* RHS(x + 1) holds argument x of the function
* TARG(0) holds the OP_CPS_START to jump to when true
@@ -672,7 +672,7 @@ struct token {
* ->next holds where the OP_CPS_RET will return to.
*/
#define OP_CPS_RET 93
-/* OP_CPS_RET conditionally calls one of two continuations
+/* OP_CPS_RET conditionally calls one of two continuations
* RHS(0) holds the variable with the return function address
* RHS(x + 1) holds argument x of the function
* The branch target may be any OP_CPS_START
@@ -813,7 +813,7 @@ static const struct op_info table_ops[] = {
[OP_CONVERT ] = OP( 0, 1, 0, 0, PURE | DEF | BLOCK, "convert"),
[OP_PIECE ] = OP( 0, 0, 1, 0, PURE | DEF | STRUCTURAL | PART, "piece"),
[OP_ASM ] = OP(-1, -1, 0, 0, PURE, "asm"),
-[OP_DEREF ] = OP( 0, 1, 0, 0, 0 | DEF | BLOCK, "deref"),
+[OP_DEREF ] = OP( 0, 1, 0, 0, 0 | DEF | BLOCK, "deref"),
[OP_DOT ] = OP( 0, 0, 1, 0, PURE | DEF | PART, "dot"),
[OP_INDEX ] = OP( 0, 0, 1, 0, PURE | DEF | PART, "index"),
@@ -884,7 +884,7 @@ static const struct op_info table_ops[] = {
#undef OP
#define OP_MAX (sizeof(table_ops)/sizeof(table_ops[0]))
-static const char *tops(int index)
+static const char *tops(int index)
{
static const char unknown[] = "unknown op";
if (index < 0) {
@@ -995,7 +995,7 @@ struct block {
struct block_set *ipdomfrontier;
struct block *ipdom;
int vertex;
-
+
};
struct symbol {
@@ -1170,11 +1170,11 @@ struct compile_state {
* make up the union.
* type->elements hold the length of the linked list
*/
-#define TYPE_POINTER 0x1200
+#define TYPE_POINTER 0x1200
/* For TYPE_POINTER:
* type->left holds the type pointed to.
*/
-#define TYPE_FUNCTION 0x1300
+#define TYPE_FUNCTION 0x1300
/* For TYPE_FUNCTION:
* type->left holds the return type.
* type->right holds the type of the arguments
@@ -1196,7 +1196,7 @@ struct compile_state {
* type->elements holds the number of elements.
*/
#define TYPE_TUPLE 0x1900
-/* TYPE_TUPLE is a basic building block when defining
+/* TYPE_TUPLE is a basic building block when defining
* positionally reference type conglomerations. (i.e. closures)
* In essence it is a wrapper for TYPE_PRODUCT, like TYPE_STRUCT
* except it has no field names.
@@ -1205,7 +1205,7 @@ struct compile_state {
* type->elements hold the number of elements in the closure.
*/
#define TYPE_JOIN 0x1a00
-/* TYPE_JOIN is a basic building block when defining
+/* TYPE_JOIN is a basic building block when defining
* positionally reference type conglomerations. (i.e. closures)
* In essence it is a wrapper for TYPE_OVERLAP, like TYPE_UNION
* except it has no field names.
@@ -1298,9 +1298,9 @@ static struct reg_info arch_reg_constraint(
struct compile_state *state, struct type *type, const char *constraint);
static struct reg_info arch_reg_clobber(
struct compile_state *state, const char *clobber);
-static struct reg_info arch_reg_lhs(struct compile_state *state,
+static struct reg_info arch_reg_lhs(struct compile_state *state,
struct triple *ins, int index);
-static struct reg_info arch_reg_rhs(struct compile_state *state,
+static struct reg_info arch_reg_rhs(struct compile_state *state,
struct triple *ins, int index);
static int arch_reg_size(int reg);
static struct triple *transform_to_arch_instruction(
@@ -1481,9 +1481,9 @@ static int set_arg(
}
return result;
}
-
-static void flag_usage(FILE *fp, const struct compiler_flag *ptr,
+
+static void flag_usage(FILE *fp, const struct compiler_flag *ptr,
const char *prefix, const char *invert_prefix)
{
for(;ptr->name; ptr++) {
@@ -1500,7 +1500,7 @@ static void arg_usage(FILE *fp, const struct compiler_arg *ptr,
for(;ptr->name; ptr++) {
const struct compiler_flag *flag;
for(flag = &ptr->flags[0]; flag->name; flag++) {
- fprintf(fp, "%s%s=%s\n",
+ fprintf(fp, "%s%s=%s\n",
prefix, ptr->name, flag->name);
}
}
@@ -1513,7 +1513,7 @@ static int append_string(size_t *max, const char ***vec, const char *str,
count = ++(*max);
*vec = xrealloc(*vec, sizeof(char *)*count, "name");
(*vec)[count -1] = 0;
- (*vec)[count -2] = str;
+ (*vec)[count -2] = str;
return 0;
}
@@ -1544,7 +1544,7 @@ static int append_define(struct compiler_state *compiler, const char *str)
rest = identifier(str, end);
if (rest != end) {
int len = end - str - 1;
- arg_error("Invalid name cannot define macro: `%*.*s'\n",
+ arg_error("Invalid name cannot define macro: `%*.*s'\n",
len, len, str);
}
result = append_string(&compiler->define_count,
@@ -1561,7 +1561,7 @@ static int append_undef(struct compiler_state *compiler, const char *str)
rest = identifier(str, end);
if (rest != end) {
int len = end - str - 1;
- arg_error("Invalid name cannot undefine macro: `%*.*s'\n",
+ arg_error("Invalid name cannot undefine macro: `%*.*s'\n",
len, len, str);
}
result = append_string(&compiler->undef_count,
@@ -1733,7 +1733,7 @@ static int get_col(struct file_state *file)
for(col = 0; ptr < end; ptr++) {
if (*ptr != '\t') {
col++;
- }
+ }
else {
col = (col & ~7) + 8;
}
@@ -1747,7 +1747,7 @@ static void loc(FILE *fp, struct compile_state *state, struct triple *triple)
if (triple && triple->occurance) {
struct occurance *spot;
for(spot = triple->occurance; spot; spot = spot->parent) {
- fprintf(fp, "%s:%d.%d: ",
+ fprintf(fp, "%s:%d.%d: ",
spot->filename, spot->line, spot->col);
}
return;
@@ -1756,11 +1756,11 @@ static void loc(FILE *fp, struct compile_state *state, struct triple *triple)
return;
}
col = get_col(state->file);
- fprintf(fp, "%s:%d.%d: ",
+ fprintf(fp, "%s:%d.%d: ",
state->file->report_name, state->file->report_line, col);
}
-static void __attribute__ ((noreturn)) internal_error(struct compile_state *state, struct triple *ptr,
+static void __attribute__ ((noreturn)) internal_error(struct compile_state *state, struct triple *ptr,
const char *fmt, ...)
{
FILE *fp = state->errout;
@@ -1780,7 +1780,7 @@ static void __attribute__ ((noreturn)) internal_error(struct compile_state *stat
}
-static void internal_warning(struct compile_state *state, struct triple *ptr,
+static void internal_warning(struct compile_state *state, struct triple *ptr,
const char *fmt, ...)
{
FILE *fp = state->errout;
@@ -1798,7 +1798,7 @@ static void internal_warning(struct compile_state *state, struct triple *ptr,
-static void __attribute__ ((noreturn)) error(struct compile_state *state, struct triple *ptr,
+static void __attribute__ ((noreturn)) error(struct compile_state *state, struct triple *ptr,
const char *fmt, ...)
{
FILE *fp = state->errout;
@@ -1819,14 +1819,14 @@ static void __attribute__ ((noreturn)) error(struct compile_state *state, struct
exit(1);
}
-static void warning(struct compile_state *state, struct triple *ptr,
+static void warning(struct compile_state *state, struct triple *ptr,
const char *fmt, ...)
{
FILE *fp = state->errout;
va_list args;
va_start(args, fmt);
loc(fp, state, ptr);
- fprintf(fp, "warning: ");
+ fprintf(fp, "warning: ");
if (ptr && (state->compiler->debug & DEBUG_ABORT_ON_ERROR)) {
fprintf(fp, "%p %-10s ", ptr, tops(ptr->op));
}
@@ -1894,7 +1894,7 @@ static void use_triple(struct triple *used, struct triple *user)
}
ptr = &(*ptr)->next;
}
- /* Append new to the head of the list,
+ /* Append new to the head of the list,
* copy_func and rename_block_variables
* depends on this.
*/
@@ -1969,7 +1969,7 @@ static struct occurance *new_occurance(struct compile_state *state)
(last->line == line) &&
(last->function == function) &&
((last->filename == filename) ||
- (strcmp(last->filename, filename) == 0)))
+ (strcmp(last->filename, filename) == 0)))
{
get_occurance(last);
return last;
@@ -2065,7 +2065,7 @@ static struct triple unknown_triple = {
static size_t registers_of(struct compile_state *state, struct type *type);
-static struct triple *alloc_triple(struct compile_state *state,
+static struct triple *alloc_triple(struct compile_state *state,
int op, struct type *type, int lhs_wanted, int rhs_wanted,
struct occurance *occurance)
{
@@ -2165,7 +2165,7 @@ static struct triple *copy_triple(struct compile_state *state, struct triple *sr
return copy;
}
-static struct triple *new_triple(struct compile_state *state,
+static struct triple *new_triple(struct compile_state *state,
int op, struct type *type, int lhs, int rhs)
{
struct triple *ret;
@@ -2175,7 +2175,7 @@ static struct triple *new_triple(struct compile_state *state,
return ret;
}
-static struct triple *build_triple(struct compile_state *state,
+static struct triple *build_triple(struct compile_state *state,
int op, struct type *type, struct triple *left, struct triple *right,
struct occurance *occurance)
{
@@ -2192,7 +2192,7 @@ static struct triple *build_triple(struct compile_state *state,
return ret;
}
-static struct triple *triple(struct compile_state *state,
+static struct triple *triple(struct compile_state *state,
int op, struct type *type, struct triple *left, struct triple *right)
{
struct triple *ret;
@@ -2208,7 +2208,7 @@ static struct triple *triple(struct compile_state *state,
return ret;
}
-static struct triple *branch(struct compile_state *state,
+static struct triple *branch(struct compile_state *state,
struct triple *targ, struct triple *test)
{
struct triple *ret;
@@ -2251,7 +2251,7 @@ static void insert_triple(struct compile_state *state,
static int triple_stores_block(struct compile_state *state, struct triple *ins)
{
- /* This function is used to determine if u.block
+ /* This function is used to determine if u.block
* is utilized to store the current block number.
*/
int stores_block;
@@ -2261,7 +2261,7 @@ static int triple_stores_block(struct compile_state *state, struct triple *ins)
}
static int triple_is_branch(struct compile_state *state, struct triple *ins);
-static struct block *block_of_triple(struct compile_state *state,
+static struct block *block_of_triple(struct compile_state *state,
struct triple *ins)
{
struct triple *first;
@@ -2270,8 +2270,8 @@ static struct block *block_of_triple(struct compile_state *state,
}
first = state->first;
while(ins != first && !triple_is_branch(state, ins->prev) &&
- !triple_stores_block(state, ins))
- {
+ !triple_stores_block(state, ins))
+ {
if (ins == ins->prev) {
internal_error(state, ins, "ins == ins->prev?");
}
@@ -2447,30 +2447,30 @@ static void display_triple(FILE *fp, struct triple *ins)
}
else if (ins->op == OP_INTCONST) {
fprintf(fp, "(%p) %c%c%c %-7s %-2d %-10s <0x%08lx> ",
- ins, pre, post, vol, reg, ins->template_id, tops(ins->op),
+ ins, pre, post, vol, reg, ins->template_id, tops(ins->op),
(unsigned long)(ins->u.cval));
}
else if (ins->op == OP_ADDRCONST) {
fprintf(fp, "(%p) %c%c%c %-7s %-2d %-10s %-10p <0x%08lx>",
- ins, pre, post, vol, reg, ins->template_id, tops(ins->op),
+ ins, pre, post, vol, reg, ins->template_id, tops(ins->op),
MISC(ins, 0), (unsigned long)(ins->u.cval));
}
else if (ins->op == OP_INDEX) {
fprintf(fp, "(%p) %c%c%c %-7s %-2d %-10s %-10p <0x%08lx>",
- ins, pre, post, vol, reg, ins->template_id, tops(ins->op),
+ ins, pre, post, vol, reg, ins->template_id, tops(ins->op),
RHS(ins, 0), (unsigned long)(ins->u.cval));
}
else if (ins->op == OP_PIECE) {
fprintf(fp, "(%p) %c%c%c %-7s %-2d %-10s %-10p <0x%08lx>",
- ins, pre, post, vol, reg, ins->template_id, tops(ins->op),
+ ins, pre, post, vol, reg, ins->template_id, tops(ins->op),
MISC(ins, 0), (unsigned long)(ins->u.cval));
}
else {
int i, count;
- fprintf(fp, "(%p) %c%c%c %-7s %-2d %-10s",
+ fprintf(fp, "(%p) %c%c%c %-7s %-2d %-10s",
ins, pre, post, vol, reg, ins->template_id, tops(ins->op));
if (table_ops[ins->op].flags & BITFIELD) {
- fprintf(fp, " <%2d-%2d:%2d>",
+ fprintf(fp, " <%2d-%2d:%2d>",
ins->u.bitfield.offset,
ins->u.bitfield.offset + ins->u.bitfield.size,
ins->u.bitfield.size);
@@ -2500,9 +2500,9 @@ static void display_triple(FILE *fp, struct triple *ins)
fprintf(fp, " @");
for(ptr = ins->occurance; ptr; ptr = ptr->parent) {
fprintf(fp, " %s,%s:%d.%d",
- ptr->function,
+ ptr->function,
ptr->filename,
- ptr->line,
+ ptr->line,
ptr->col);
}
if (ins->op == OP_ASM) {
@@ -2523,9 +2523,9 @@ static void display_triple_changes(
orig_count = TRIPLE_SIZE(orig);
if ((new->op != orig->op) ||
(new_count != orig_count) ||
- (memcmp(orig->param, new->param,
+ (memcmp(orig->param, new->param,
orig_count * sizeof(orig->param[0])) != 0) ||
- (memcmp(&orig->u, &new->u, sizeof(orig->u)) != 0))
+ (memcmp(&orig->u, &new->u, sizeof(orig->u)) != 0))
{
struct occurance *ptr;
int i, min_count, indent;
@@ -2533,7 +2533,7 @@ static void display_triple_changes(
if (orig->op == new->op) {
fprintf(fp, " %-11s", tops(orig->op));
} else {
- fprintf(fp, " [%-10s %-10s]",
+ fprintf(fp, " [%-10s %-10s]",
tops(new->op), tops(orig->op));
}
min_count = new_count;
@@ -2542,12 +2542,12 @@ static void display_triple_changes(
}
for(indent = i = 0; i < min_count; i++) {
if (orig->param[i] == new->param[i]) {
- fprintf(fp, " %-11p",
+ fprintf(fp, " %-11p",
orig->param[i]);
indent += 12;
} else {
fprintf(fp, " [%-10p %-10p]",
- new->param[i],
+ new->param[i],
orig->param[i]);
indent += 24;
}
@@ -2562,7 +2562,7 @@ static void display_triple_changes(
}
if ((new->op == OP_INTCONST)||
(new->op == OP_ADDRCONST)) {
- fprintf(fp, " <0x%08lx>",
+ fprintf(fp, " <0x%08lx>",
(unsigned long)(new->u.cval));
indent += 13;
}
@@ -2583,11 +2583,11 @@ static void display_triple_changes(
fprintf(fp, " @");
for(ptr = orig->occurance; ptr; ptr = ptr->parent) {
fprintf(fp, " %s,%s:%d.%d",
- ptr->function,
+ ptr->function,
ptr->filename,
- ptr->line,
+ ptr->line,
ptr->col);
-
+
}
fprintf(fp, "\n");
fflush(fp);
@@ -2597,7 +2597,7 @@ static void display_triple_changes(
static int triple_is_pure(struct compile_state *state, struct triple *ins, unsigned id)
{
/* Does the triple have no side effects.
- * I.e. Rexecuting the triple with the same arguments
+ * I.e. Rexecuting the triple with the same arguments
* gives the same value.
*/
unsigned pure;
@@ -2610,7 +2610,7 @@ static int triple_is_pure(struct compile_state *state, struct triple *ins, unsig
return (pure == PURE) && !(id & TRIPLE_FLAG_VOLATILE);
}
-static int triple_is_branch_type(struct compile_state *state,
+static int triple_is_branch_type(struct compile_state *state,
struct triple *ins, unsigned type)
{
/* Is this one of the passed branch types? */
@@ -2651,7 +2651,7 @@ static int triple_is_ret(struct compile_state *state, struct triple *ins)
/* Is this triple a return instruction? */
return triple_is_branch_type(state, ins, RETBRANCH);
}
-
+
#if DEBUG_ROMCC_WARNING
static int triple_is_simple_ubranch(struct compile_state *state, struct triple *ins)
{
@@ -2732,27 +2732,27 @@ static struct triple **triple_iter(struct compile_state *state,
}
}
return ret;
-
+
}
static struct triple **triple_lhs(struct compile_state *state,
struct triple *ins, struct triple **last)
{
- return triple_iter(state, ins->lhs, &LHS(ins,0),
+ return triple_iter(state, ins->lhs, &LHS(ins,0),
ins, last);
}
static struct triple **triple_rhs(struct compile_state *state,
struct triple *ins, struct triple **last)
{
- return triple_iter(state, ins->rhs, &RHS(ins,0),
+ return triple_iter(state, ins->rhs, &RHS(ins,0),
ins, last);
}
static struct triple **triple_misc(struct compile_state *state,
struct triple *ins, struct triple **last)
{
- return triple_iter(state, ins->misc, &MISC(ins,0),
+ return triple_iter(state, ins->misc, &MISC(ins,0),
ins, last);
}
@@ -2820,7 +2820,7 @@ static struct triple **triple_targ(struct compile_state *state,
static struct triple **triple_edge_targ(struct compile_state *state,
struct triple *ins, struct triple **last)
{
- return do_triple_targ(state, ins, last,
+ return do_triple_targ(state, ins, last,
state->functions_joined, !state->functions_joined);
}
@@ -2851,7 +2851,7 @@ static struct triple *after_lhs(struct compile_state *state, struct triple *ins)
}
/* Function piece accessor functions */
-static struct triple *do_farg(struct compile_state *state,
+static struct triple *do_farg(struct compile_state *state,
struct triple *func, unsigned index)
{
struct type *ftype;
@@ -2880,7 +2880,7 @@ static struct triple *fretaddr(struct compile_state *state, struct triple *func)
{
return do_farg(state, func, 1);
}
-static struct triple *farg(struct compile_state *state,
+static struct triple *farg(struct compile_state *state,
struct triple *func, unsigned index)
{
return do_farg(state, func, index + 2);
@@ -2929,7 +2929,7 @@ static void verify_use(struct compile_state *state,
}
}
-static int find_rhs_use(struct compile_state *state,
+static int find_rhs_use(struct compile_state *state,
struct triple *user, struct triple *used)
{
struct triple **param;
@@ -3162,7 +3162,7 @@ static void print_blocks(struct compile_state *state, const char *func, FILE *fp
#define TOK_FIRST_MACRO TOK_MDEFINE
#define TOK_LAST_MACRO TOK_MENDIF
-
+
#define TOK_MIF 112
#define TOK_MELSE 113
#define TOK_MIDENT 114
@@ -3282,7 +3282,7 @@ static const char *tokens[] = {
[TOK_MIF ] = "#if",
[TOK_MELSE ] = "#else",
[TOK_MIDENT ] = "#:ident:",
-[TOK_EOL ] = "EOL",
+[TOK_EOL ] = "EOL",
[TOK_EOF ] = "EOF",
};
@@ -3306,7 +3306,7 @@ static struct hash_entry *lookup(
unsigned int index;
index = hash(name, name_len);
entry = state->hash_table[index];
- while(entry &&
+ while(entry &&
((entry->name_len != name_len) ||
(memcmp(entry->name, name, name_len) != 0))) {
entry = entry->next;
@@ -3336,7 +3336,7 @@ static void ident_to_keyword(struct compile_state *state, struct token *tk)
entry = tk->ident;
if (entry && ((entry->tok == TOK_TYPE_NAME) ||
(entry->tok == TOK_ENUM_CONST) ||
- ((entry->tok >= TOK_FIRST_KEYWORD) &&
+ ((entry->tok >= TOK_FIRST_KEYWORD) &&
(entry->tok <= TOK_LAST_KEYWORD)))) {
tk->tok = entry->tok;
}
@@ -3397,7 +3397,7 @@ static void symbol(
romcc_symbol(state, ident, chain, def, type, state->scope_depth);
}
-static void var_symbol(struct compile_state *state,
+static void var_symbol(struct compile_state *state,
struct hash_entry *ident, struct triple *def)
{
if ((def->type->type & TYPE_MASK) == TYPE_PRODUCT) {
@@ -3406,7 +3406,7 @@ static void var_symbol(struct compile_state *state,
symbol(state, ident, &ident->sym_ident, def, def->type);
}
-static void label_symbol(struct compile_state *state,
+static void label_symbol(struct compile_state *state,
struct hash_entry *ident, struct triple *label, int depth)
{
romcc_symbol(state, ident, &ident->sym_label, label, &void_type, depth);
@@ -3435,7 +3435,7 @@ static void end_scope(struct compile_state *state)
int i;
int depth;
/* Walk through the hash table and remove all symbols
- * in the current scope.
+ * in the current scope.
*/
depth = state->scope_depth;
for(i = 0; i < HASH_TABLE_SIZE; i++) {
@@ -3518,7 +3518,7 @@ static void undef_macro(struct compile_state *state, struct hash_entry *ident)
struct macro_arg *arg, *anext;
macro = ident->sym_define;
ident->sym_define = 0;
-
+
/* Free the macro arguments... */
anext = macro->args;
while(anext) {
@@ -3535,8 +3535,8 @@ static void undef_macro(struct compile_state *state, struct hash_entry *ident)
}
}
-static void do_define_macro(struct compile_state *state,
- struct hash_entry *ident, const char *body,
+static void do_define_macro(struct compile_state *state,
+ struct hash_entry *ident, const char *body,
int argc, struct macro_arg *args)
{
struct macro *macro;
@@ -3550,7 +3550,7 @@ static void do_define_macro(struct compile_state *state,
int identical_bodies, identical_args;
struct macro_arg *oarg;
/* Explicitly allow identical redfinitions of the same macro */
- identical_bodies =
+ identical_bodies =
(macro->buf_len == body_len) &&
(memcmp(macro->buf, body, body_len) == 0);
identical_args = macro->argc == argc;
@@ -3580,7 +3580,7 @@ static void do_define_macro(struct compile_state *state,
ident->sym_define = macro;
}
-
+
static void define_macro(
struct compile_state *state,
struct hash_entry *ident,
@@ -3632,7 +3632,7 @@ static void register_builtin_macros(struct compile_state *state)
register_builtin_macro(state, "__STDC__", "0");
/* In particular I don't conform to C99 */
register_builtin_macro(state, "__STDC_VERSION__", "199901L");
-
+
}
static void process_cmdline_macros(struct compile_state *state)
@@ -3679,7 +3679,7 @@ static int digitp(int c)
{
int ret = 0;
switch(c) {
- case '0': case '1': case '2': case '3': case '4':
+ case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
ret = 1;
break;
@@ -3699,7 +3699,7 @@ static int hexdigitp(int c)
{
int ret = 0;
switch(c) {
- case '0': case '1': case '2': case '3': case '4':
+ case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
@@ -3708,7 +3708,7 @@ static int hexdigitp(int c)
}
return ret;
}
-static int hexdigval(int c)
+static int hexdigval(int c)
{
int val = -1;
if ((c >= '0') && (c <= '9')) {
@@ -3727,7 +3727,7 @@ static int octdigitp(int c)
{
int ret = 0;
switch(c) {
- case '0': case '1': case '2': case '3':
+ case '0': case '1': case '2': case '3':
case '4': case '5': case '6': case '7':
ret = 1;
break;
@@ -3800,7 +3800,7 @@ static int char_value(struct compile_state *state,
case '?': c = '?'; str++; break;
case '\'': c = '\''; str++; break;
case '"': c = '"'; str++; break;
- case 'x':
+ case 'x':
c = 0;
str++;
while((str < end) && hexdigitp(*str)) {
@@ -3809,7 +3809,7 @@ static int char_value(struct compile_state *state,
str++;
}
break;
- case '0': case '1': case '2': case '3':
+ case '0': case '1': case '2': case '3':
case '4': case '5': case '6': case '7':
c = 0;
while((str < end) && octdigitp(*str)) {
@@ -3836,7 +3836,7 @@ static const char *next_char(struct file_state *file, const char *pos, int index
int c = *pos;
/* Is this a trigraph? */
if (file->trigraphs &&
- (c == '?') && ((end - pos) >= 3) && (pos[1] == '?'))
+ (c == '?') && ((end - pos) >= 3) && (pos[1] == '?'))
{
switch(pos[2]) {
case '=': c = '#'; break;
@@ -3890,7 +3890,7 @@ static int get_char(struct file_state *file, const char *pos)
c = *pos;
/* If it is a trigraph get the trigraph value */
if (file->trigraphs &&
- (c == '?') && ((end - pos) >= 3) && (pos[1] == '?'))
+ (c == '?') && ((end - pos) >= 3) && (pos[1] == '?'))
{
switch(pos[2]) {
case '=': c = '#'; break;
@@ -3935,7 +3935,7 @@ static size_t char_strlen(struct file_state *file, const char *src, const char *
return len;
}
-static void char_strcpy(char *dest,
+static void char_strcpy(char *dest,
struct file_state *file, const char *src, const char *end)
{
while(src < end) {
@@ -3946,7 +3946,7 @@ static void char_strcpy(char *dest,
}
}
-static char *char_strdup(struct file_state *file,
+static char *char_strdup(struct file_state *file,
const char *start, const char *end, const char *id)
{
char *str;
@@ -4006,7 +4006,7 @@ static void save_string(struct file_state *file,
tk->str_len = strlen(str);
}
-static void raw_next_token(struct compile_state *state,
+static void raw_next_token(struct compile_state *state,
struct file_state *file, struct token *tk)
{
const char *token;
@@ -4043,7 +4043,7 @@ static void raw_next_token(struct compile_state *state,
tokp = next_char(file, tokp, 1);
while((c = get_char(file, tokp)) != -1) {
/* Advance to the next character only after we verify
- * the current character is not a newline.
+ * the current character is not a newline.
* EOL is special to the preprocessor so we don't
* want to loose any.
*/
@@ -4135,12 +4135,12 @@ static void raw_next_token(struct compile_state *state,
/* Save the character value */
save_string(file, tk, token, tokp, "literal character");
}
- /* integer and floating constants
+ /* integer and floating constants
* Integer Constants
* {digits}
* 0[Xx]{hexdigits}
* 0{octdigit}+
- *
+ *
* Floating constants
* {digits}.{digits}[Ee][+-]?{digits}
* {digits}.{digits}
@@ -4250,9 +4250,9 @@ static void raw_next_token(struct compile_state *state,
}
}
/* C99 alternate macro characters */
- else if ((c == '%') && (c1 == ':') && (c2 == '%') && (c3 == ':')) {
+ else if ((c == '%') && (c1 == ':') && (c2 == '%') && (c3 == ':')) {
eat += 3;
- tok = TOK_CONCATENATE;
+ tok = TOK_CONCATENATE;
}
else if ((c == '.') && (c1 == '.') && (c2 == '.')) { eat += 2; tok = TOK_DOTS; }
else if ((c == '<') && (c1 == '<') && (c2 == '=')) { eat += 2; tok = TOK_SLEQ; }
@@ -4335,7 +4335,7 @@ struct macro_arg_value {
size_t len;
};
static struct macro_arg_value *read_macro_args(
- struct compile_state *state, struct macro *macro,
+ struct compile_state *state, struct macro *macro,
struct file_state *file, struct token *tk)
{
struct macro_arg_value *argv;
@@ -4357,15 +4357,15 @@ static struct macro_arg_value *read_macro_args(
}
paren_depth = 0;
i = 0;
-
+
for(;;) {
const char *start;
size_t len;
start = file->pos;
raw_next_token(state, file, tk);
-
+
if (!paren_depth && (tk->tok == TOK_COMMA) &&
- (argv[i].ident != state->i___VA_ARGS__))
+ (argv[i].ident != state->i___VA_ARGS__))
{
i++;
if (i >= macro->argc) {
@@ -4374,11 +4374,11 @@ static struct macro_arg_value *read_macro_args(
}
continue;
}
-
+
if (tk->tok == TOK_LPAREN) {
paren_depth++;
}
-
+
if (tk->tok == TOK_RPAREN) {
if (paren_depth == 0) {
break;
@@ -4396,7 +4396,7 @@ static struct macro_arg_value *read_macro_args(
argv[i].len += len;
}
if (i != macro->argc -1) {
- error(state, 0, "missing %s arg %d\n",
+ error(state, 0, "missing %s arg %d\n",
macro->ident->name, i +2);
}
return argv;
@@ -4458,14 +4458,14 @@ static void append_macro_chars(struct compile_state *state,
buf->pos += flen;
}
-static int compile_macro(struct compile_state *state,
+static int compile_macro(struct compile_state *state,
struct file_state **filep, struct token *tk);
-static void macro_expand_args(struct compile_state *state,
+static void macro_expand_args(struct compile_state *state,
struct macro *macro, struct macro_arg_value *argv, struct token *tk)
{
int i;
-
+
for(i = 0; i < macro->argc; i++) {
struct file_state fmacro, *file;
struct macro_buf buf;
@@ -4492,7 +4492,7 @@ static void macro_expand_args(struct compile_state *state,
file = &fmacro;
for(;;) {
raw_next_token(state, file, tk);
-
+
/* If we have recursed into another macro body
* get out of it.
*/
@@ -4518,7 +4518,7 @@ static void macro_expand_args(struct compile_state *state,
append_macro_chars(state, macro->ident->name, &buf,
file, tk->pos, file->pos);
}
-
+
xfree(argv[i].value);
argv[i].value = buf.str;
argv[i].len = buf.pos;
@@ -4551,12 +4551,12 @@ static void expand_macro(struct compile_state *state,
fmacro.macro = 1;
fmacro.trigraphs = 0;
fmacro.join_lines = 0;
-
+
/* Allocate a buffer to hold the macro expansion */
buf->len = macro->buf_len + 3;
buf->str = xmalloc(buf->len, macro->ident->name);
buf->pos = 0;
-
+
fstart = fmacro.pos;
raw_next_token(state, &fmacro, tk);
while(tk->tok != TOK_EOF) {
@@ -4600,7 +4600,7 @@ static void expand_macro(struct compile_state *state,
if (*str == '\\') {
str = "\\";
len = 2;
- }
+ }
else if (*str == '"') {
str = "\\\"";
len = 2;
@@ -4642,7 +4642,7 @@ static void expand_macro(struct compile_state *state,
}
append_macro_text(state, macro->ident->name, buf, fstart, flen);
-
+
fstart = fmacro.pos;
raw_next_token(state, &fmacro, tk);
}
@@ -4674,19 +4674,19 @@ static void tag_macro_name(struct compile_state *state,
fmacro.macro = 1;
fmacro.trigraphs = 0;
fmacro.join_lines = 0;
-
+
/* Allocate a new macro expansion buffer */
buf->len = macro->buf_len + 3;
buf->str = xmalloc(buf->len, macro->ident->name);
buf->pos = 0;
-
+
fstart = fmacro.pos;
raw_next_token(state, &fmacro, tk);
while(tk->tok != TOK_EOF) {
flen = fmacro.pos - fstart;
if ((tk->tok == TOK_IDENT) &&
(tk->ident == macro->ident) &&
- (tk->val.notmacro == 0))
+ (tk->val.notmacro == 0))
{
append_macro_text(state, macro->ident->name, buf, fstart, flen);
fstart = "$";
@@ -4694,14 +4694,14 @@ static void tag_macro_name(struct compile_state *state,
}
append_macro_text(state, macro->ident->name, buf, fstart, flen);
-
+
fstart = fmacro.pos;
raw_next_token(state, &fmacro, tk);
}
xfree(fmacro.buf);
}
-static int compile_macro(struct compile_state *state,
+static int compile_macro(struct compile_state *state,
struct file_state **filep, struct token *tk)
{
struct file_state *file;
@@ -4808,7 +4808,7 @@ static int if_value(struct compile_state *state)
offset = state->if_depth % CHAR_BIT;
return !!(state->if_bytes[index] & (1 << (offset)));
}
-static void set_if_value(struct compile_state *state, int value)
+static void set_if_value(struct compile_state *state, int value)
{
int index, offset;
index = state->if_depth / CHAR_BIT;
@@ -4871,8 +4871,8 @@ static void raw_token(struct compile_state *state, struct token *tk)
rescan = 0;
file = state->file;
/* Exit out of an include directive or macro call */
- if ((tk->tok == TOK_EOF) &&
- (file != state->macro_file) && file->prev)
+ if ((tk->tok == TOK_EOF) &&
+ (file != state->macro_file) && file->prev)
{
state->file = file->prev;
/* file->basename is used keep it */
@@ -4939,8 +4939,8 @@ static void token(struct compile_state *state, struct token *tk)
pp_token(state, tk);
}
}
- /* Eat tokens disabled by the preprocessor
- * (Unless we are parsing a preprocessor directive
+ /* Eat tokens disabled by the preprocessor
+ * (Unless we are parsing a preprocessor directive
*/
else if (if_eat(state) && (state->token_base == 0)) {
pp_token(state, tk);
@@ -4974,7 +4974,7 @@ static struct token *do_eat_token(struct compile_state *state, int tok)
struct token *tk;
int i;
check_tok(state, get_token(state, 1), tok);
-
+
/* Free the old token value */
tk = get_token(state, 0);
if (tk->str_len) {
@@ -5152,7 +5152,7 @@ static void preprocess(struct compile_state *state, struct token *current_token)
*/
int old_token_base;
int tok;
-
+
state->macro_file = state->file;
old_token_base = state->token_base;
@@ -5236,7 +5236,7 @@ static void preprocess(struct compile_state *state, struct token *current_token)
pp_eat(state, TOK_MUNDEF);
if (if_eat(state)) /* quit early when #if'd out */
break;
-
+
ident = pp_eat(state, TOK_MIDENT)->ident;
undef_macro(state, ident);
@@ -5246,7 +5246,7 @@ static void preprocess(struct compile_state *state, struct token *current_token)
pp_eat(state, TOK_MPRAGMA);
if (if_eat(state)) /* quit early when #if'd out */
break;
- warning(state, 0, "Ignoring pragma");
+ warning(state, 0, "Ignoring pragma");
break;
case TOK_MELIF:
pp_eat(state, TOK_MELIF);
@@ -5257,7 +5257,7 @@ static void preprocess(struct compile_state *state, struct token *current_token)
if (if_value(state)) {
eat_tokens(state, TOK_MENDIF);
}
- /* If the previous #if was not taken see if the #elif enables the
+ /* If the previous #if was not taken see if the #elif enables the
* trailing code.
*/
else {
@@ -5349,11 +5349,11 @@ static void preprocess(struct compile_state *state, struct token *current_token)
else if (tok == TOK_DOTS) {
pp_eat(state, TOK_DOTS);
aident = state->i___VA_ARGS__;
- }
+ }
else {
aident = pp_eat(state, TOK_MIDENT)->ident;
}
-
+
narg = xcmalloc(sizeof(*arg), "macro arg");
narg->ident = aident;
@@ -5395,7 +5395,7 @@ static void preprocess(struct compile_state *state, struct token *current_token)
mend = get_token(state, 1)->pos;
}
}
-
+
/* Now that I have found the body defined the token */
do_define_macro(state, ident,
char_strdup(state->file, mstart, mend, "macro buf"),
@@ -5406,7 +5406,7 @@ static void preprocess(struct compile_state *state, struct token *current_token)
{
const char *start, *end;
int len;
-
+
pp_eat(state, TOK_MERROR);
/* Find the start of the line */
raw_peek(state);
@@ -5427,13 +5427,13 @@ static void preprocess(struct compile_state *state, struct token *current_token)
{
const char *start, *end;
int len;
-
+
pp_eat(state, TOK_MWARNING);
/* Find the start of the line */
raw_peek(state);
start = get_token(state, 1)->pos;
-
+
/* Find the end of the line */
while((tok = raw_peek(state)) != TOK_EOL) {
raw_eat(state, tok);
@@ -5520,7 +5520,7 @@ static void preprocess(struct compile_state *state, struct token *current_token)
if (tok == TOK_MIDENT) {
name2 = get_token(state, 1)->ident->name;
}
- error(state, 0, "Invalid preprocessor directive: %s %s",
+ error(state, 0, "Invalid preprocessor directive: %s %s",
name1, name2);
break;
}
@@ -5605,7 +5605,7 @@ static struct type *invalid_type(struct compile_state *state, struct type *type)
case TYPE_STRUCT:
case TYPE_TUPLE:
member = type->left;
- while(member && (invalid == 0) &&
+ while(member && (invalid == 0) &&
((member->type & TYPE_MASK) == TYPE_PRODUCT)) {
invalid = invalid_type(state, member->left);
member = member->right;
@@ -5631,7 +5631,7 @@ static struct type *invalid_type(struct compile_state *state, struct type *type)
break;
}
return invalid;
-
+
}
#define MASK_UCHAR(X) ((X) & ((ulong_t)0xff))
@@ -5666,7 +5666,7 @@ static struct type void_ptr_type = {
};
#if DEBUG_ROMCC_WARNING
-static struct type void_func_type = {
+static struct type void_func_type = {
.type = TYPE_FUNCTION,
.left = &void_type,
.right = &void_type,
@@ -5799,19 +5799,19 @@ static void name_of(FILE *fp, struct type *type)
name_of(fp, type->right);
break;
case TYPE_ENUM:
- fprintf(fp, "enum %s",
+ fprintf(fp, "enum %s",
(type->type_ident)? type->type_ident->name : "");
qual_of(fp, type);
break;
case TYPE_STRUCT:
- fprintf(fp, "struct %s { ",
+ fprintf(fp, "struct %s { ",
(type->type_ident)? type->type_ident->name : "");
name_of(fp, type->left);
fprintf(fp, " } ");
qual_of(fp, type);
break;
case TYPE_UNION:
- fprintf(fp, "union %s { ",
+ fprintf(fp, "union %s { ",
(type->type_ident)? type->type_ident->name : "");
name_of(fp, type->left);
fprintf(fp, " } ");
@@ -5828,7 +5828,7 @@ static void name_of(FILE *fp, struct type *type)
fprintf(fp, " [%ld]", (long)(type->elements));
break;
case TYPE_TUPLE:
- fprintf(fp, "tuple { ");
+ fprintf(fp, "tuple { ");
name_of(fp, type->left);
fprintf(fp, " } ");
qual_of(fp, type);
@@ -5975,7 +5975,7 @@ static size_t align_of_in_bytes(struct compile_state *state, struct type *type)
static size_t size_of(struct compile_state *state, struct type *type);
static size_t reg_size_of(struct compile_state *state, struct type *type);
-static size_t needed_padding(struct compile_state *state,
+static size_t needed_padding(struct compile_state *state,
struct type *type, size_t offset)
{
size_t padding, align;
@@ -5997,7 +5997,7 @@ static size_t needed_padding(struct compile_state *state,
return padding;
}
-static size_t reg_needed_padding(struct compile_state *state,
+static size_t reg_needed_padding(struct compile_state *state,
struct type *type, size_t offset)
{
size_t padding, align;
@@ -6006,7 +6006,7 @@ static size_t reg_needed_padding(struct compile_state *state,
* fit into the current register.
*/
if (((type->type & TYPE_MASK) == TYPE_BITFIELD) &&
- (((offset + type->elements)/REG_SIZEOF_REG) != (offset/REG_SIZEOF_REG)))
+ (((offset + type->elements)/REG_SIZEOF_REG) != (offset/REG_SIZEOF_REG)))
{
align = REG_SIZEOF_REG;
}
@@ -6203,7 +6203,7 @@ static size_t size_of_in_bytes(struct compile_state *state, struct type *type)
return bits_to_bytes(size_of(state, type));
}
-static size_t field_offset(struct compile_state *state,
+static size_t field_offset(struct compile_state *state,
struct type *type, struct hash_entry *field)
{
struct type *member;
@@ -6244,7 +6244,7 @@ static size_t field_offset(struct compile_state *state,
return size;
}
-static size_t field_reg_offset(struct compile_state *state,
+static size_t field_reg_offset(struct compile_state *state,
struct type *type, struct hash_entry *field)
{
struct type *member;
@@ -6285,7 +6285,7 @@ static size_t field_reg_offset(struct compile_state *state,
return size;
}
-static struct type *field_type(struct compile_state *state,
+static struct type *field_type(struct compile_state *state,
struct type *type, struct hash_entry *field)
{
struct type *member;
@@ -6314,14 +6314,14 @@ static struct type *field_type(struct compile_state *state,
else {
internal_error(state, 0, "field_type only works on structures and unions");
}
-
+
if (!member || (member->field_ident != field)) {
error(state, 0, "member %s not present", field->name);
}
return member;
}
-static size_t index_offset(struct compile_state *state,
+static size_t index_offset(struct compile_state *state,
struct type *type, ulong_t index)
{
struct type *member;
@@ -6367,14 +6367,14 @@ static size_t index_offset(struct compile_state *state,
}
}
else {
- internal_error(state, 0,
+ internal_error(state, 0,
"request for index %u in something not an array, tuple or join",
index);
}
return size;
}
-static size_t index_reg_offset(struct compile_state *state,
+static size_t index_reg_offset(struct compile_state *state,
struct type *type, ulong_t index)
{
struct type *member;
@@ -6401,7 +6401,7 @@ static size_t index_reg_offset(struct compile_state *state,
if (i != index) {
internal_error(state, 0, "Missing member index: %u", index);
}
-
+
}
else if ((type->type & TYPE_MASK) == TYPE_JOIN) {
ulong_t i;
@@ -6421,7 +6421,7 @@ static size_t index_reg_offset(struct compile_state *state,
}
}
else {
- internal_error(state, 0,
+ internal_error(state, 0,
"request for index %u in something not an array, tuple or join",
index);
}
@@ -6472,7 +6472,7 @@ static struct type *index_type(struct compile_state *state,
}
else {
member = 0;
- internal_error(state, 0,
+ internal_error(state, 0,
"request for index %u in something not an array, tuple or join",
index);
}
@@ -6697,7 +6697,7 @@ static struct type *reg_type(
name_of(state->errout, type);
fprintf(state->errout, "\n");
internal_error(state, 0, "reg_type not yet defined for type");
-
+
}
}
/* If I have a single register compound type not a bit-field
@@ -6725,7 +6725,7 @@ static struct type *reg_type(
}
static struct type *next_field(struct compile_state *state,
- struct type *type, struct type *prev_member)
+ struct type *type, struct type *prev_member)
{
struct type *member;
if ((type->type & TYPE_MASK) != TYPE_STRUCT) {
@@ -6746,13 +6746,13 @@ static struct type *next_field(struct compile_state *state,
prev_member = 0;
}
if (prev_member) {
- internal_error(state, 0, "prev_member %s not present",
+ internal_error(state, 0, "prev_member %s not present",
prev_member->field_ident->name);
}
return member;
}
-typedef void (*walk_type_fields_cb_t)(struct compile_state *state, struct type *type,
+typedef void (*walk_type_fields_cb_t)(struct compile_state *state, struct type *type,
size_t ret_offset, size_t mem_offset, void *arg);
static void walk_type_fields(struct compile_state *state,
@@ -6775,15 +6775,15 @@ static void walk_struct_fields(struct compile_state *state,
if ((mtype->type & TYPE_MASK) == TYPE_PRODUCT) {
mtype = mtype->left;
}
- walk_type_fields(state, mtype,
- reg_offset +
+ walk_type_fields(state, mtype,
+ reg_offset +
field_reg_offset(state, type, mtype->field_ident),
- mem_offset +
+ mem_offset +
field_offset(state, type, mtype->field_ident),
cb, arg);
tptr = tptr->right;
}
-
+
}
static void walk_type_fields(struct compile_state *state,
@@ -7070,7 +7070,7 @@ static struct type *compatible_ptrs(struct type *left, struct type *right)
result = new_type(qual_type, result, 0);
}
return result;
-
+
}
static struct triple *integral_promotion(
struct compile_state *state, struct triple *def)
@@ -7090,7 +7090,7 @@ static struct triple *integral_promotion(
def->type = new_type(int_type, 0, 0);
}
else {
- def = triple(state, OP_CONVERT,
+ def = triple(state, OP_CONVERT,
new_type(int_type, 0, 0), def, 0);
}
}
@@ -7149,7 +7149,7 @@ static int is_compound_type(struct type *type)
case TYPE_STRUCT:
case TYPE_TUPLE:
case TYPE_UNION:
- case TYPE_JOIN:
+ case TYPE_JOIN:
is_compound = 1;
break;
default:
@@ -7189,8 +7189,8 @@ static int is_lvalue(struct compile_state *state, struct triple *def)
if (!def) {
return 0;
}
- if ((def->op == OP_ADECL) ||
- (def->op == OP_SDECL) ||
+ if ((def->op == OP_ADECL) ||
+ (def->op == OP_SDECL) ||
(def->op == OP_DEREF) ||
(def->op == OP_BLOBCONST) ||
(def->op == OP_LIST)) {
@@ -7207,7 +7207,7 @@ static void clvalue(struct compile_state *state, struct triple *def)
if (!def) {
internal_error(state, def, "nothing where lvalue expected?");
}
- if (!is_lvalue(state, def)) {
+ if (!is_lvalue(state, def)) {
error(state, def, "lvalue expected");
}
}
@@ -7251,7 +7251,7 @@ static struct triple *int_const(
static struct triple *read_expr(struct compile_state *state, struct triple *def);
-static struct triple *do_mk_addr_expr(struct compile_state *state,
+static struct triple *do_mk_addr_expr(struct compile_state *state,
struct triple *expr, struct type *type, ulong_t offset)
{
struct triple *result;
@@ -7260,7 +7260,7 @@ static struct triple *do_mk_addr_expr(struct compile_state *state,
ptr_type = new_type(TYPE_POINTER | (type->type & QUAL_MASK), type, 0);
-
+
result = 0;
if (expr->op == OP_ADECL) {
error(state, expr, "address of auto variables not supported");
@@ -7436,7 +7436,7 @@ static struct triple *read_expr(struct compile_state *state, struct triple *def)
return def;
}
-int is_write_compatible(struct compile_state *state,
+int is_write_compatible(struct compile_state *state,
struct type *dest, struct type *rval)
{
int compatible = 0;
@@ -7588,7 +7588,7 @@ struct type *ptr_arithmetic_result(
/* Sanity checks to ensure I am working with the proper types */
ptr_arithmetic(state, left);
arithmetic(state, right);
- if (TYPE_ARITHMETIC(left->type->type) &&
+ if (TYPE_ARITHMETIC(left->type->type) &&
TYPE_ARITHMETIC(right->type->type)) {
type = arithmetic_result(state, left, right);
}
@@ -7604,7 +7604,7 @@ struct type *ptr_arithmetic_result(
/* boolean helper function */
-static struct triple *ltrue_expr(struct compile_state *state,
+static struct triple *ltrue_expr(struct compile_state *state,
struct triple *expr)
{
switch(expr->op) {
@@ -7620,7 +7620,7 @@ static struct triple *ltrue_expr(struct compile_state *state,
return expr;
}
-static struct triple *lfalse_expr(struct compile_state *state,
+static struct triple *lfalse_expr(struct compile_state *state,
struct triple *expr)
{
return triple(state, OP_LFALSE, &int_type, expr, 0);
@@ -7636,15 +7636,15 @@ static struct triple *mkland_expr(
/* Generate some intermediate triples */
end = label(state);
var = variable(state, &int_type);
-
+
/* Store the left hand side value */
lstore = write_expr(state, var, left);
/* Jump if the value is false */
- jmp = branch(state, end,
+ jmp = branch(state, end,
lfalse_expr(state, read_expr(state, var)));
mid = label(state);
-
+
/* Store the right hand side value */
rstore = write_expr(state, var, right);
@@ -7653,7 +7653,7 @@ static struct triple *mkland_expr(
/* Generate the prog for a logical and */
def = mkprog(state, var, lstore, jmp, mid, rstore, end, val, 0UL);
-
+
return def;
}
@@ -7666,17 +7666,17 @@ static struct triple *mklor_expr(
/* Generate some intermediate triples */
end = label(state);
var = variable(state, &int_type);
-
+
/* Store the left hand side value */
left = write_expr(state, var, left);
-
+
/* Jump if the value is true */
jmp = branch(state, end, read_expr(state, var));
mid = label(state);
-
+
/* Store the right hand side value */
right = write_expr(state, var, right);
-
+
/* An expression for the computed value*/
val = read_expr(state, var);
@@ -7687,7 +7687,7 @@ static struct triple *mklor_expr(
}
static struct triple *mkcond_expr(
- struct compile_state *state,
+ struct compile_state *state,
struct triple *test, struct triple *left, struct triple *right)
{
struct triple *def, *val, *var, *jmp1, *jmp2, *top, *mid, *end;
@@ -7742,7 +7742,7 @@ static struct triple *mkcond_expr(
/* Store the right hand side value */
right = write_expr(state, var, right);
-
+
/* An expression for the computed value */
val = read_expr(state, var);
@@ -7834,7 +7834,7 @@ static struct triple *flatten_generic(
insert_triple(state, first, ptr);
ptr->id |= TRIPLE_FLAG_FLATTENED;
ptr->id &= ~TRIPLE_FLAG_LOCAL;
-
+
/* Now flatten the lhs elements */
for(i = 0; i < lhs; i++) {
struct triple **ins = &LHS(ptr, i);
@@ -7865,7 +7865,7 @@ static struct triple *flatten_prog(
unuse_triple(first, body->prev);
use_triple(body, body->prev);
}
-
+
if (!(val->id & TRIPLE_FLAG_FLATTENED)) {
internal_error(state, val, "val not flattened?");
}
@@ -7977,7 +7977,7 @@ static struct triple *flatten(
base = MISC(ptr, 0);
offset = bits_to_bytes(field_offset(state, base->type, ptr->u.field));
left = RHS(base, 0);
- ptr = triple(state, OP_ADD, left->type,
+ ptr = triple(state, OP_ADD, left->type,
read_expr(state, left),
int_const(state, &ulong_type, offset));
free_triple(state, base);
@@ -8198,8 +8198,8 @@ static struct triple *mk_add_expr(
if (!equiv_types(right->type, ptr_math)) {
right = mk_cast_expr(state, ptr_math, right);
}
- right = triple(state, op, ptr_math, right,
- int_const(state, ptr_math,
+ right = triple(state, op, ptr_math, right,
+ int_const(state, ptr_math,
size_of_in_bytes(state, left->type->left)));
}
return triple(state, OP_ADD, result_type, left, right);
@@ -8225,8 +8225,8 @@ static struct triple *mk_sub_expr(
if (!equiv_types(right->type, ptr_math)) {
right = mk_cast_expr(state, ptr_math, right);
}
- right = triple(state, op, ptr_math, right,
- int_const(state, ptr_math,
+ right = triple(state, op, ptr_math, right,
+ int_const(state, ptr_math,
size_of_in_bytes(state, left->type->left)));
}
return triple(state, OP_SUB, result_type, left, right);
@@ -8272,7 +8272,7 @@ static struct triple *mk_post_dec_expr(
struct triple *val;
lvalue(state, def);
val = read_expr(state, def);
- return triple(state, OP_VAL, def->type,
+ return triple(state, OP_VAL, def->type,
write_expr(state, def,
mk_sub_expr(state, val, int_const(state, &int_type, 1)))
, val);
@@ -8304,12 +8304,12 @@ static int is_simple_const(struct triple *ins)
/* Is this a constant that u.cval has the value.
* Or equivalently is this a constant that read_const
* works on.
- * So far only OP_INTCONST qualifies.
+ * So far only OP_INTCONST qualifies.
*/
return (ins->op == OP_INTCONST);
}
-static int constants_equal(struct compile_state *state,
+static int constants_equal(struct compile_state *state,
struct triple *left, struct triple *right)
{
int equal;
@@ -8386,7 +8386,7 @@ static long_t bit_count(ulong_t value)
}
}
return count;
-
+
}
#endif
@@ -8449,12 +8449,12 @@ static ulong_t read_const(struct compile_state *state,
struct triple *ins, struct triple *rhs)
{
switch(rhs->type->type &TYPE_MASK) {
- case TYPE_CHAR:
+ case TYPE_CHAR:
case TYPE_SHORT:
case TYPE_INT:
case TYPE_LONG:
- case TYPE_UCHAR:
- case TYPE_USHORT:
+ case TYPE_UCHAR:
+ case TYPE_USHORT:
case TYPE_UINT:
case TYPE_ULONG:
case TYPE_POINTER:
@@ -8504,7 +8504,7 @@ int const_eq(struct compile_state *state, struct triple *ins,
rval = read_const(state, ins, right);
result = (lval == rval);
}
- else if ((left->op == OP_ADDRCONST) &&
+ else if ((left->op == OP_ADDRCONST) &&
(right->op == OP_ADDRCONST)) {
result = (MISC(left, 0) == MISC(right, 0)) &&
(left->u.cval == right->u.cval);
@@ -8514,7 +8514,7 @@ int const_eq(struct compile_state *state, struct triple *ins,
result = -1;
}
return result;
-
+
}
int const_ucmp(struct compile_state *state, struct triple *ins,
@@ -8539,7 +8539,7 @@ int const_ucmp(struct compile_state *state, struct triple *ins,
result = -1;
}
}
- else if ((left->op == OP_ADDRCONST) &&
+ else if ((left->op == OP_ADDRCONST) &&
(right->op == OP_ADDRCONST) &&
(MISC(left, 0) == MISC(right, 0))) {
result = 0;
@@ -8636,7 +8636,7 @@ static void check_lhs(struct compile_state *state, struct triple *ins)
for(;expr;expr = triple_lhs(state, ins, expr)) {
internal_error(state, ins, "unexpected lhs");
}
-
+
}
#endif
@@ -8694,7 +8694,7 @@ static void wipe_branch(struct compile_state *state, struct triple *ins)
}
#endif
-static void mkcopy(struct compile_state *state,
+static void mkcopy(struct compile_state *state,
struct triple *ins, struct triple *rhs)
{
struct block *block;
@@ -8716,7 +8716,7 @@ static void mkcopy(struct compile_state *state,
use_triple(RHS(ins, 0), ins);
}
-static void mkconst(struct compile_state *state,
+static void mkconst(struct compile_state *state,
struct triple *ins, ulong_t value)
{
if (!is_integral(ins) && !is_pointer(ins)) {
@@ -8746,7 +8746,7 @@ static void mkaddr_const(struct compile_state *state,
}
#if DEBUG_DECOMPOSE_PRINT_TUPLES
-static void print_tuple(struct compile_state *state,
+static void print_tuple(struct compile_state *state,
struct triple *ins, struct triple *tuple)
{
FILE *fp = state->dbgout;
@@ -8757,11 +8757,11 @@ static void print_tuple(struct compile_state *state,
name_of(fp, LHS(tuple, 0)->type);
}
fprintf(fp, "\n");
-
+
}
#endif
-static struct triple *decompose_with_tuple(struct compile_state *state,
+static struct triple *decompose_with_tuple(struct compile_state *state,
struct triple *ins, struct triple *tuple)
{
struct triple *next;
@@ -8783,7 +8783,7 @@ static struct triple *decompose_with_tuple(struct compile_state *state,
propogate_use(state, ins, tuple);
release_triple(state, ins);
-
+
return next;
}
@@ -8801,7 +8801,7 @@ static struct triple *decompose_unknownval(struct compile_state *state,
#endif
get_occurance(ins->occurance);
- tuple = alloc_triple(state, OP_TUPLE, ins->type, -1, -1,
+ tuple = alloc_triple(state, OP_TUPLE, ins->type, -1, -1,
ins->occurance);
for(i = 0; i < tuple->lhs; i++) {
@@ -8818,7 +8818,7 @@ static struct triple *decompose_unknownval(struct compile_state *state,
}
-static struct triple *decompose_read(struct compile_state *state,
+static struct triple *decompose_read(struct compile_state *state,
struct triple *ins)
{
struct triple *tuple, *lval;
@@ -8834,7 +8834,7 @@ static struct triple *decompose_read(struct compile_state *state,
ins->occurance);
if ((tuple->lhs != lval->lhs) &&
- (!triple_is_def(state, lval) || (tuple->lhs != 1)))
+ (!triple_is_def(state, lval) || (tuple->lhs != 1)))
{
internal_error(state, ins, "lhs size inconsistency?");
}
@@ -8854,7 +8854,7 @@ static struct triple *decompose_read(struct compile_state *state,
}
get_occurance(tuple->occurance);
- read = alloc_triple(state, OP_READ, piece->type, -1, -1,
+ read = alloc_triple(state, OP_READ, piece->type, -1, -1,
tuple->occurance);
RHS(read, 0) = piece;
@@ -8881,12 +8881,12 @@ static struct triple *decompose_read(struct compile_state *state,
return decompose_with_tuple(state, ins, tuple);
}
-static struct triple *decompose_write(struct compile_state *state,
+static struct triple *decompose_write(struct compile_state *state,
struct triple *ins)
{
struct triple *tuple, *lval, *val;
ulong_t i;
-
+
lval = MISC(ins, 0);
val = RHS(ins, 0);
get_occurance(ins->occurance);
@@ -8894,7 +8894,7 @@ static struct triple *decompose_write(struct compile_state *state,
ins->occurance);
if ((tuple->lhs != lval->lhs) &&
- (!triple_is_def(state, lval) || tuple->lhs != 1))
+ (!triple_is_def(state, lval) || tuple->lhs != 1))
{
internal_error(state, ins, "lhs size inconsistency?");
}
@@ -8914,7 +8914,7 @@ static struct triple *decompose_write(struct compile_state *state,
}
pval = LHS(val, i);
}
-
+
/* See if the piece is really a bitref */
bitref = 0;
if (piece->op == OP_BITREF) {
@@ -8942,7 +8942,7 @@ static struct triple *decompose_write(struct compile_state *state,
}
get_occurance(tuple->occurance);
- write = alloc_triple(state, OP_WRITE, piece->type, -1, -1,
+ write = alloc_triple(state, OP_WRITE, piece->type, -1, -1,
tuple->occurance);
MISC(write, 0) = piece;
RHS(write, 0) = pval;
@@ -8961,7 +8961,7 @@ static void decompose_load_cb(struct compile_state *state,
{
struct decompose_load_info *info = arg;
struct triple *load;
-
+
if (reg_offset > info->tuple->lhs) {
internal_error(state, info->tuple, "lhs to small?");
}
@@ -8971,7 +8971,7 @@ static void decompose_load_cb(struct compile_state *state,
LHS(info->tuple, reg_offset/REG_SIZEOF_REG) = load;
}
-static struct triple *decompose_load(struct compile_state *state,
+static struct triple *decompose_load(struct compile_state *state,
struct triple *ins)
{
struct triple *tuple;
@@ -9004,7 +9004,7 @@ static void decompose_store_cb(struct compile_state *state,
{
struct decompose_store_info *info = arg;
struct triple *store;
-
+
if (reg_offset > info->tuple->lhs) {
internal_error(state, info->tuple, "lhs to small?");
}
@@ -9015,7 +9015,7 @@ static void decompose_store_cb(struct compile_state *state,
LHS(info->tuple, reg_offset/REG_SIZEOF_REG) = store;
}
-static struct triple *decompose_store(struct compile_state *state,
+static struct triple *decompose_store(struct compile_state *state,
struct triple *ins)
{
struct triple *tuple;
@@ -9037,7 +9037,7 @@ static struct triple *decompose_store(struct compile_state *state,
return decompose_with_tuple(state, ins, tuple);
}
-static struct triple *decompose_dot(struct compile_state *state,
+static struct triple *decompose_dot(struct compile_state *state,
struct triple *ins)
{
struct triple *tuple, *lval;
@@ -9059,7 +9059,7 @@ static struct triple *decompose_dot(struct compile_state *state,
#endif
get_occurance(ins->occurance);
- tuple = alloc_triple(state, OP_TUPLE, type, -1, -1,
+ tuple = alloc_triple(state, OP_TUPLE, type, -1, -1,
ins->occurance);
if (((ins->type->type & TYPE_MASK) == TYPE_BITFIELD) &&
@@ -9094,7 +9094,7 @@ static struct triple *decompose_dot(struct compile_state *state,
piece->u.bitfield.offset = reg_offset % REG_SIZEOF_REG;
}
else if ((reg_offset % REG_SIZEOF_REG) != 0) {
- internal_error(state, ins,
+ internal_error(state, ins,
"request for a nonbitfield sub register?");
}
@@ -9104,7 +9104,7 @@ static struct triple *decompose_dot(struct compile_state *state,
return decompose_with_tuple(state, ins, tuple);
}
-static struct triple *decompose_index(struct compile_state *state,
+static struct triple *decompose_index(struct compile_state *state,
struct triple *ins)
{
struct triple *tuple, *lval;
@@ -9124,7 +9124,7 @@ static struct triple *decompose_index(struct compile_state *state,
#endif
get_occurance(ins->occurance);
- tuple = alloc_triple(state, OP_TUPLE, type, -1, -1,
+ tuple = alloc_triple(state, OP_TUPLE, type, -1, -1,
ins->occurance);
for(i = 0; i < tuple->lhs; i++, idx++) {
@@ -9194,7 +9194,7 @@ static void decompose_compound_types(struct compile_state *state)
case OP_INDEX:
next = decompose_index(state, ins);
break;
-
+
}
#if DEBUG_DECOMPOSE_HIRES
fprintf(fp, "decompose next: %p \n", next);
@@ -9218,7 +9218,7 @@ static void decompose_compound_types(struct compile_state *state)
else {
release_triple(state, ins);
}
- }
+ }
ins = next;
} while(ins != first);
ins = first;
@@ -9227,7 +9227,7 @@ static void decompose_compound_types(struct compile_state *state)
if (ins->op == OP_BITREF) {
if (ins->use) {
internal_error(state, ins, "bitref used");
- }
+ }
else {
release_triple(state, ins);
}
@@ -9957,7 +9957,7 @@ static void simplify_sextract(struct compile_state *state, struct triple *ins)
val &= mask;
val <<= (SIZEOF_LONG - ins->u.bitfield.size);
sval = val;
- sval >>= (SIZEOF_LONG - ins->u.bitfield.size);
+ sval >>= (SIZEOF_LONG - ins->u.bitfield.size);
mkconst(state, ins, sval);
}
}
@@ -10078,7 +10078,7 @@ static struct triple *branch_target(struct compile_state *state, struct triple *
* loop back onto themselves. If I see one don't advance the
* target.
*/
- while(triple_is_structural(state, targ) &&
+ while(triple_is_structural(state, targ) &&
(targ->next != targ) && (targ->next != state->first)) {
targ = targ->next;
}
@@ -10095,7 +10095,7 @@ static void simplify_branch(struct compile_state *state, struct triple *ins)
if (ins->use != 0) {
internal_error(state, ins, "branch use");
}
- /* The challenge here with simplify branch is that I need to
+ /* The challenge here with simplify branch is that I need to
* make modifications to the control flow graph as well
* as to the branch instruction itself. That is handled
* by rebuilding the basic blocks after simplify all is called.
@@ -10112,7 +10112,7 @@ static void simplify_branch(struct compile_state *state, struct triple *ins)
struct triple *targ;
simplified = 0;
targ = branch_target(state, ins);
- if ((targ != ins) && (targ->op == OP_BRANCH) &&
+ if ((targ != ins) && (targ->op == OP_BRANCH) &&
!phi_dependency(targ->u.block))
{
unuse_triple(TARG(ins, 0), ins);
@@ -10192,7 +10192,7 @@ static void simplify_label(struct compile_state *state, struct triple *ins)
unuse_triple(ins, use);
use_triple(ins->prev, use);
}
-
+
}
}
if (ins->use) {
@@ -10229,7 +10229,7 @@ static void simplify_phi(struct compile_state *state, struct triple *ins)
return;
}
}
-
+
/* See if all of rhs members of a phi are the same */
value = slot[0];
for(i = 1; i < zrhs; i++) {
@@ -10357,11 +10357,11 @@ static const struct simplify_table {
[OP_BSF ] = { simplify_bsf, COMPILER_SIMPLIFY_OP },
[OP_BSR ] = { simplify_bsr, COMPILER_SIMPLIFY_OP },
[OP_RDMSR ] = { simplify_noop, COMPILER_SIMPLIFY_OP },
-[OP_WRMSR ] = { simplify_noop, COMPILER_SIMPLIFY_OP },
+[OP_WRMSR ] = { simplify_noop, COMPILER_SIMPLIFY_OP },
[OP_HLT ] = { simplify_noop, COMPILER_SIMPLIFY_OP },
};
-static inline void debug_simplify(struct compile_state *state,
+static inline void debug_simplify(struct compile_state *state,
simplify_t do_simplify, struct triple *ins)
{
#if DEBUG_SIMPLIFY_HIRES
@@ -10396,14 +10396,14 @@ static void simplify(struct compile_state *state, struct triple *ins)
else {
do_simplify = table_simplify[op].func;
}
- if (do_simplify &&
+ if (do_simplify &&
!(state->compiler->flags & table_simplify[op].flag)) {
do_simplify = simplify_noop;
}
if (do_simplify && (ins->id & TRIPLE_FLAG_VOLATILE)) {
do_simplify = simplify_noop;
}
-
+
if (!do_simplify) {
internal_error(state, ins, "cannot simplify op: %d %s",
op, tops(op));
@@ -10532,7 +10532,7 @@ static void register_builtin_function(struct compile_state *state,
ident = lookup(state, name, name_len);
ftype->type_ident = ident;
symbol(state, ident, &ident->sym_ident, def, ftype);
-
+
state->file = file.prev;
state->function = 0;
state->main_function = 0;
@@ -10579,7 +10579,7 @@ static struct type *register_builtin_type(struct compile_state *state,
name_len = strlen(name);
ident = lookup(state, name, name_len);
-
+
if ((type->type & TYPE_MASK) == TYPE_PRODUCT) {
ulong_t elements = 0;
struct type *field;
@@ -10628,23 +10628,23 @@ static void register_builtins(struct compile_state *state)
register_builtin_function(state, "__builtin_uldiv", OP_UDIVT, uldiv_type,
&ulong_type, &ulong_type);
- register_builtin_function(state, "__builtin_inb", OP_INB, &uchar_type,
+ register_builtin_function(state, "__builtin_inb", OP_INB, &uchar_type,
&ushort_type);
register_builtin_function(state, "__builtin_inw", OP_INW, &ushort_type,
&ushort_type);
- register_builtin_function(state, "__builtin_inl", OP_INL, &uint_type,
+ register_builtin_function(state, "__builtin_inl", OP_INL, &uint_type,
&ushort_type);
- register_builtin_function(state, "__builtin_outb", OP_OUTB, &void_type,
+ register_builtin_function(state, "__builtin_outb", OP_OUTB, &void_type,
&uchar_type, &ushort_type);
- register_builtin_function(state, "__builtin_outw", OP_OUTW, &void_type,
+ register_builtin_function(state, "__builtin_outw", OP_OUTW, &void_type,
&ushort_type, &ushort_type);
- register_builtin_function(state, "__builtin_outl", OP_OUTL, &void_type,
+ register_builtin_function(state, "__builtin_outl", OP_OUTL, &void_type,
&uint_type, &ushort_type);
-
- register_builtin_function(state, "__builtin_bsf", OP_BSF, &int_type,
+
+ register_builtin_function(state, "__builtin_bsf", OP_BSF, &int_type,
&int_type);
- register_builtin_function(state, "__builtin_bsr", OP_BSR, &int_type,
+ register_builtin_function(state, "__builtin_bsr", OP_BSR, &int_type,
&int_type);
msr_type = register_builtin_type(state, "__builtin_msr_t",
@@ -10655,13 +10655,13 @@ static void register_builtins(struct compile_state *state)
&ulong_type);
register_builtin_function(state, "__builtin_wrmsr", OP_WRMSR, &void_type,
&ulong_type, &ulong_type, &ulong_type);
-
- register_builtin_function(state, "__builtin_hlt", OP_HLT, &void_type,
+
+ register_builtin_function(state, "__builtin_hlt", OP_HLT, &void_type,
&void_type);
}
static struct type *declarator(
- struct compile_state *state, struct type *type,
+ struct compile_state *state, struct type *type,
struct hash_entry **ident, int need_ident);
static void decl(struct compile_state *state, struct triple *first);
static struct type *specifier_qualifier_list(struct compile_state *state);
@@ -11189,8 +11189,8 @@ static struct triple *shift_expr(struct compile_state *state)
right = read_expr(state, add_expr(state));
integral(state, right);
right = integral_promotion(state, right);
-
- op = (tok == TOK_SL)? OP_SL :
+
+ op = (tok == TOK_SL)? OP_SL :
is_signed(left->type)? OP_SSR: OP_USR;
def = triple(state, op, left->type, left, right);
@@ -11364,7 +11364,7 @@ static struct triple *lor_expr(struct compile_state *state)
right = read_expr(state, land_expr(state));
bool(state, right);
- def = mklor_expr(state,
+ def = mklor_expr(state,
ltrue_expr(state, left),
ltrue_expr(state, right));
}
@@ -11438,7 +11438,7 @@ static struct triple *eval_const_expr(
do {
valid_ins(state, ptr);
if ((ptr->op == OP_PHI) || (ptr->op == OP_LIST)) {
- internal_error(state, ptr,
+ internal_error(state, ptr,
"unexpected %s in constant expression",
tops(ptr->op));
}
@@ -11453,8 +11453,8 @@ static struct triple *eval_const_expr(
else if (triple_is_cbranch(state, ptr)) {
struct triple *cond_val;
cond_val = get_cv(state, cv, RHS(ptr, 0));
- if (!cond_val || !is_const(cond_val) ||
- (cond_val->op != OP_INTCONST))
+ if (!cond_val || !is_const(cond_val) ||
+ (cond_val->op != OP_INTCONST))
{
internal_error(state, ptr, "bad branch condition");
}
@@ -11470,16 +11470,16 @@ static struct triple *eval_const_expr(
else if (ptr->op == OP_WRITE) {
struct triple *val;
val = get_cv(state, cv, RHS(ptr, 0));
-
- set_cv(state, cv, MISC(ptr, 0),
+
+ set_cv(state, cv, MISC(ptr, 0),
copy_triple(state, val));
- set_cv(state, cv, ptr,
+ set_cv(state, cv, ptr,
copy_triple(state, val));
ptr = ptr->next;
}
else if (ptr->op == OP_READ) {
- set_cv(state, cv, ptr,
- copy_triple(state,
+ set_cv(state, cv, ptr,
+ copy_triple(state,
get_cv(state, cv, RHS(ptr, 0))));
ptr = ptr->next;
}
@@ -11500,7 +11500,7 @@ static struct triple *eval_const_expr(
else {
error(state, ptr, "impure operation in constant expression");
}
-
+
} while(ptr != head);
/* Get the result value */
@@ -11546,7 +11546,7 @@ static struct triple *assignment_expr(struct compile_state *state)
* a larger set of statements than standard C. As long
* as the subset of the grammar that is standard C behaves
* correctly this should cause no problems.
- *
+ *
* For the extra token strings accepted by the grammar
* none of them should produce a valid lvalue, so they
* should not produce functioning programs.
@@ -11559,7 +11559,7 @@ static struct triple *assignment_expr(struct compile_state *state)
case TOK_EQ:
lvalue(state, left);
eat(state, TOK_EQ);
- def = write_expr(state, left,
+ def = write_expr(state, left,
read_expr(state, assignment_expr(state)));
break;
case TOK_TIMESEQ:
@@ -11579,7 +11579,7 @@ static struct triple *assignment_expr(struct compile_state *state)
case TOK_MODEQ: op = sign? OP_SMOD : OP_UMOD; break;
}
def = write_expr(state, left,
- triple(state, op, left->type,
+ triple(state, op, left->type,
read_expr(state, left), right));
break;
case TOK_PLUSEQ:
@@ -11615,7 +11615,7 @@ static struct triple *assignment_expr(struct compile_state *state)
case TOK_OREQ: op = OP_OR; break;
}
def = write_expr(state, left,
- triple(state, op, left->type,
+ triple(state, op, left->type,
read_expr(state, left), right));
break;
}
@@ -11692,7 +11692,7 @@ static void for_statement(struct compile_state *state, struct triple *first)
head = test = tail = jmp1 = jmp2 = 0;
if (peek(state) != TOK_SEMI) {
head = expr(state);
- }
+ }
eat(state, TOK_SEMI);
if (peek(state) != TOK_SEMI) {
test = expr(state);
@@ -11824,7 +11824,7 @@ static void return_statement(struct compile_state *state, struct triple *first)
eat(state, TOK_SEMI);
/* See if this last statement in a function */
- last = ((peek(state) == TOK_RBRACE) &&
+ last = ((peek(state) == TOK_RBRACE) &&
(state->scope_depth == GLOBAL_SCOPE_DEPTH +2));
/* Find the return variable */
@@ -12167,7 +12167,7 @@ static void asm_statement(struct compile_state *state, struct triple *first)
for(i = 0; i < out; i++) {
struct triple *constraint;
constraint = out_param[i].constraint;
- info->tmpl.lhs[i] = arch_reg_constraint(state,
+ info->tmpl.lhs[i] = arch_reg_constraint(state,
out_param[i].expr->type, constraint->u.blob);
free_triple(state, constraint);
}
@@ -12197,9 +12197,9 @@ static void asm_statement(struct compile_state *state, struct triple *first)
}
info->tmpl.lhs[val] = cinfo;
info->tmpl.rhs[i] = cinfo;
-
+
} else {
- info->tmpl.rhs[i] = arch_reg_constraint(state,
+ info->tmpl.rhs[i] = arch_reg_constraint(state,
in_param[i].expr->type, str);
}
free_triple(state, constraint);
@@ -12219,7 +12219,7 @@ static void asm_statement(struct compile_state *state, struct triple *first)
size_t size = arch_reg_size(info->tmpl.lhs[i].reg);
if (size >= SIZEOF_LONG) {
type = &ulong_type;
- }
+ }
else if (size >= SIZEOF_INT) {
type = &uint_type;
}
@@ -12296,7 +12296,7 @@ static void statement(struct compile_state *state, struct triple *first)
compound_statement(state, first);
}
else if (tok == TOK_IF) {
- if_statement(state, first);
+ if_statement(state, first);
}
else if (tok == TOK_FOR) {
for_statement(state, first);
@@ -12326,7 +12326,7 @@ static void statement(struct compile_state *state, struct triple *first)
asm_statement(state, first);
}
else if ((tok == TOK_IDENT) && (peek2(state) == TOK_COLON)) {
- labeled_statement(state, first);
+ labeled_statement(state, first);
}
else if (tok == TOK_CASE) {
case_statement(state, first);
@@ -12348,7 +12348,7 @@ static struct type *param_decl(struct compile_state *state)
struct type *type;
struct hash_entry *ident;
/* Cheat so the declarator will know we are not global */
- start_scope(state);
+ start_scope(state);
ident = 0;
type = decl_specifiers(state);
type = declarator(state, type, &ident, 0);
@@ -12388,7 +12388,7 @@ static struct type *type_name(struct compile_state *state)
}
static struct type *direct_declarator(
- struct compile_state *state, struct type *type,
+ struct compile_state *state, struct type *type,
struct hash_entry **pident, int need_ident)
{
struct hash_entry *ident;
@@ -12466,7 +12466,7 @@ static struct type *direct_declarator(
}
static struct type *declarator(
- struct compile_state *state, struct type *type,
+ struct compile_state *state, struct type *type,
struct hash_entry **pident, int need_ident)
{
while(peek(state) == TOK_STAR) {
@@ -12485,7 +12485,7 @@ static struct type *typedef_name(
ident = eat(state, TOK_TYPE_NAME)->ident;
type = ident->sym_ident->type;
specifiers |= type->type & QUAL_MASK;
- if ((specifiers & (STOR_MASK | QUAL_MASK)) !=
+ if ((specifiers & (STOR_MASK | QUAL_MASK)) !=
(type->type & (STOR_MASK | QUAL_MASK))) {
type = clone_type(specifiers, type);
}
@@ -12519,7 +12519,7 @@ static struct type *enum_specifier(
struct type *entry;
eident = eat(state, TOK_IDENT)->ident;
if (eident->sym_ident) {
- error(state, 0, "%s already declared",
+ error(state, 0, "%s already declared",
eident->name);
}
eident->tok = TOK_ENUM_CONST;
@@ -12652,13 +12652,13 @@ static struct type *struct_or_union_specifier(
symbol(state, ident, &ident->sym_tag, 0, struct_type);
}
}
- if (ident && ident->sym_tag &&
- ident->sym_tag->type &&
+ if (ident && ident->sym_tag &&
+ ident->sym_tag->type &&
((ident->sym_tag->type->type & TYPE_MASK) == type_main)) {
struct_type = clone_type(spec, ident->sym_tag->type);
}
else if (ident && !struct_type) {
- error(state, 0, "%s %s undeclared",
+ error(state, 0, "%s %s undeclared",
(type_main == TYPE_STRUCT)?"struct" : "union",
ident->name);
}
@@ -12943,7 +12943,7 @@ static struct type *type_specifier(
type = typedef_name(state, spec);
break;
default:
- error(state, 0, "bad type specifier %s",
+ error(state, 0, "bad type specifier %s",
tokens[tok]);
break;
}
@@ -13123,7 +13123,7 @@ static struct triple *initializer(
(equiv_types(type->left, result->type->left))) {
type->elements = result->type->elements;
}
- if (is_lvalue(state, result) &&
+ if (is_lvalue(state, result) &&
((result->type->type & TYPE_MASK) == TYPE_ARRAY) &&
(type->type & TYPE_MASK) != TYPE_ARRAY)
{
@@ -13189,7 +13189,7 @@ static struct triple *initializer(
}
dest = ((char *)buf) + bits_to_bytes(info.offset);
#if DEBUG_INITIALIZER
- fprintf(state->errout, "dest = buf + %d max_offset: %d value_size: %d op: %d\n",
+ fprintf(state->errout, "dest = buf + %d max_offset: %d value_size: %d op: %d\n",
dest - buf,
bits_to_bytes(max_offset),
bits_to_bytes(value_size),
@@ -13221,7 +13221,7 @@ static struct triple *initializer(
info.offset += value_size;
if ((type->type & TYPE_MASK) == TYPE_STRUCT) {
info.type = next_field(state, type, info.type);
- info.offset = field_offset(state, type,
+ info.offset = field_offset(state, type,
info.type->field_ident);
}
} while(comma && (peek(state) != TOK_RBRACE));
@@ -13316,7 +13316,7 @@ static struct triple *function_definition(
if (((param->type & TYPE_MASK) != TYPE_VOID) && !param->field_ident) {
error(state, 0, "No identifier for paramter %d\n", i);
}
-
+
/* Get a list of statements for this function. */
def = triple(state, OP_LIST, type, 0, 0);
@@ -13339,7 +13339,7 @@ static struct triple *function_definition(
ctype->elements = 1;
/* Add a variable for the return value */
- crtype = new_type(TYPE_TUPLE,
+ crtype = new_type(TYPE_TUPLE,
/* Remove all type qualifiers from the return type */
new_type(TYPE_PRODUCT, ctype, clone_type(0, type->left)), 0);
crtype->elements = 2;
@@ -13372,7 +13372,7 @@ static struct triple *function_definition(
}
/* Add the declaration static const char __func__ [] = "func-name" */
- fname_type = new_type(TYPE_ARRAY,
+ fname_type = new_type(TYPE_ARRAY,
clone_type(QUAL_CONST | STOR_STATIC, &char_type), 0);
fname_type->type |= QUAL_CONST | STOR_STATIC;
fname_type->elements = strlen(state->function) + 1;
@@ -13417,7 +13417,7 @@ static struct triple *function_definition(
return def;
}
-static struct triple *do_decl(struct compile_state *state,
+static struct triple *do_decl(struct compile_state *state,
struct type *type, struct hash_entry *ident)
{
struct triple *def;
@@ -13451,7 +13451,7 @@ static struct triple *do_decl(struct compile_state *state,
if ((type->type & TYPE_MASK) == TYPE_FUNCTION) {
error(state, 0, "Function prototypes not supported");
}
- if (ident &&
+ if (ident &&
((type->type & STOR_MASK) == STOR_STATIC) &&
((type->type & QUAL_CONST) == 0)) {
error(state, 0, "non const static variables not supported");
@@ -13494,8 +13494,8 @@ static void decl(struct compile_state *state, struct triple *first)
}
eat(state, TOK_EQ);
flatten(state, first,
- init_expr(state,
- ident->sym_ident->def,
+ init_expr(state,
+ ident->sym_ident->def,
initializer(state, type)));
}
arrays_complete(state, type);
@@ -13531,7 +13531,7 @@ static void decls(struct compile_state *state)
}
}
-/*
+/*
* Function inlining
*/
struct triple_reg_set {
@@ -13554,21 +13554,21 @@ static void walk_blocks(struct compile_state *state, struct basic_blocks *bb,
void *arg);
static void print_block(
struct compile_state *state, struct block *block, void *arg);
-static int do_triple_set(struct triple_reg_set **head,
+static int do_triple_set(struct triple_reg_set **head,
struct triple *member, struct triple *new_member);
static void do_triple_unset(struct triple_reg_set **head, struct triple *member);
static struct reg_block *compute_variable_lifetimes(
struct compile_state *state, struct basic_blocks *bb);
-static void free_variable_lifetimes(struct compile_state *state,
+static void free_variable_lifetimes(struct compile_state *state,
struct basic_blocks *bb, struct reg_block *blocks);
#if DEBUG_EXPLICIT_CLOSURES
-static void print_live_variables(struct compile_state *state,
+static void print_live_variables(struct compile_state *state,
struct basic_blocks *bb, struct reg_block *rb, FILE *fp);
#endif
static struct triple *call(struct compile_state *state,
- struct triple *retvar, struct triple *ret_addr,
+ struct triple *retvar, struct triple *ret_addr,
struct triple *targ, struct triple *ret)
{
struct triple *call;
@@ -13647,19 +13647,19 @@ static void mark_live(struct compile_state *state, struct triple *func, void *ar
static void mark_live_functions(struct compile_state *state)
{
- /* Ensure state->main_function is the last function in
+ /* Ensure state->main_function is the last function in
* the list of functions.
*/
if ((state->main_function->next != state->functions) ||
(state->functions->prev != state->main_function)) {
- internal_error(state, 0,
+ internal_error(state, 0,
"state->main_function is not at the end of the function list ");
}
state->main_function->u.cval = 1;
reverse_walk_functions(state, mark_live, 0);
}
-static int local_triple(struct compile_state *state,
+static int local_triple(struct compile_state *state,
struct triple *func, struct triple *ins)
{
int local = (ins->id & TRIPLE_FLAG_LOCAL);
@@ -13673,7 +13673,7 @@ static int local_triple(struct compile_state *state,
return local;
}
-struct triple *copy_func(struct compile_state *state, struct triple *ofunc,
+struct triple *copy_func(struct compile_state *state, struct triple *ofunc,
struct occurance *base_occurance)
{
struct triple *nfunc;
@@ -13716,7 +13716,7 @@ struct triple *copy_func(struct compile_state *state, struct triple *ofunc,
}
new->id |= TRIPLE_FLAG_FLATTENED;
new->id |= old->id & TRIPLE_FLAG_COPY;
-
+
/* During the copy remember new as user of old */
use_triple(old, new);
@@ -13755,7 +13755,7 @@ struct triple *copy_func(struct compile_state *state, struct triple *ofunc,
old = old->next;
new = new->next;
} while((old != ofirst) && (new != nfirst));
-
+
/* Make a third pass to cleanup the extra useses */
old = ofirst;
new = nfirst;
@@ -13804,7 +13804,7 @@ static void expand_inline_call(
}
result = 0;
if ((nfunc->type->left->type & TYPE_MASK) != TYPE_VOID) {
- result = read_expr(state,
+ result = read_expr(state,
deref_index(state, fresult(state, nfunc), 1));
}
if (state->compiler->debug & DEBUG_INLINE) {
@@ -13816,8 +13816,8 @@ static void expand_inline_call(
fprintf(fp, "__________ %s _________ done\n\n", __FUNCTION__);
}
- /*
- * Get rid of the extra triples
+ /*
+ * Get rid of the extra triples
*/
/* Remove the read of the return address */
ins = RHS(nfunc, 0)->prev->prev;
@@ -13833,7 +13833,7 @@ static void expand_inline_call(
release_triple(state, ins);
/* Remove the retaddres variable */
retvar = fretaddr(state, nfunc);
- if ((retvar->lhs != 1) ||
+ if ((retvar->lhs != 1) ||
(retvar->op != OP_ADECL) ||
(retvar->next->op != OP_PIECE) ||
(MISC(retvar->next, 0) != retvar)) {
@@ -13876,7 +13876,7 @@ static void expand_inline_call(
/*
*
* Type of the result variable.
- *
+ *
* result
* |
* +----------+------------+
@@ -13886,7 +13886,7 @@ static void expand_inline_call(
* +------------------+---------------+
* | |
* closure1 ... closuerN
- * | |
+ * | |
* +----+--+-+--------+-----+ +----+----+---+-----+
* | | | | | | | | |
* var1 var2 var3 ... varN result var1 var2 ... varN result
@@ -13904,7 +13904,7 @@ static void expand_inline_call(
* var1 var2 ... varN result var1 var2 ... varN result
*/
-static int add_closure_type(struct compile_state *state,
+static int add_closure_type(struct compile_state *state,
struct triple *func, struct type *closure_type)
{
struct type *type, *ctype, **next;
@@ -13937,19 +13937,19 @@ static int add_closure_type(struct compile_state *state,
fprintf(fp, "new_type: ");
name_of(fp, type);
fprintf(fp, "\n");
- fprintf(fp, "ctype: %p %d bits: %d ",
+ fprintf(fp, "ctype: %p %d bits: %d ",
ctype, ctype->elements, reg_size_of(state, ctype));
name_of(fp, ctype);
fprintf(fp, "\n");
#endif
-
+
/* Regenerate the variable with the new type definition */
new_var = pre_triple(state, var, OP_ADECL, type, 0, 0);
new_var->id |= TRIPLE_FLAG_FLATTENED;
for(i = 0; i < new_var->lhs; i++) {
LHS(new_var, i)->id |= TRIPLE_FLAG_FLATTENED;
}
-
+
/* Point everyone at the new variable */
propogate_use(state, var, new_var);
@@ -13958,7 +13958,7 @@ static int add_closure_type(struct compile_state *state,
release_triple(state, LHS(var, i));
}
release_triple(state, var);
-
+
/* Return the index of the added closure type */
return ctype->elements - 1;
}
@@ -14053,7 +14053,7 @@ static int lookup_closure_index(struct compile_state *state,
for(index0 = ins->next->next;
(index0->op == OP_INDEX) &&
(MISC(index0, 0) == result) &&
- (index0->u.cval == 0) ;
+ (index0->u.cval == 0) ;
index0 = write->next)
{
index1 = index0->next;
@@ -14097,12 +14097,12 @@ static void compute_closure_variables(struct compile_state *state,
int i, max_index;
#define MAX_INDICIES (sizeof(used_indicies)*CHAR_BIT)
#define ID_BITS(X) ((X) & (TRIPLE_FLAG_LOCAL -1))
- struct {
+ struct {
unsigned id;
int index;
} *info;
-
+
/* Find the basic blocks of this function */
bb.func = me;
bb.first = RHS(me, 0);
@@ -14151,7 +14151,7 @@ static void compute_closure_variables(struct compile_state *state,
ins = ins->next;
} while(ins != first);
- /*
+ /*
* Build the list of variables to enclose.
*
* A target it to put the same variable in the
@@ -14336,7 +14336,7 @@ static void expand_function_call(
if (!*closure_next) {
*closure_next = type;
} else {
- *closure_next = new_type(TYPE_PRODUCT, *closure_next,
+ *closure_next = new_type(TYPE_PRODUCT, *closure_next,
type);
closure_next = &(*closure_next)->right;
}
@@ -14396,22 +14396,22 @@ static void expand_function_call(
/* Initialize the return value */
if ((rtype->type & TYPE_MASK) != TYPE_VOID) {
- flatten(state, ret_loc,
- write_expr(state,
+ flatten(state, ret_loc,
+ write_expr(state,
deref_index(state, fresult(state, func), 1),
new_triple(state, OP_UNKNOWNVAL, rtype, 0, 0)));
}
ret_addr = flatten(state, ret_loc, ret_addr);
ret_set = flatten(state, ret_loc, write_expr(state, retvar, ret_addr));
- jmp = flatten(state, ret_loc,
+ jmp = flatten(state, ret_loc,
call(state, retvar, ret_addr, func_first, func_last));
/* Find the result */
if ((rtype->type & TYPE_MASK) != TYPE_VOID) {
struct triple * result;
- result = flatten(state, first,
- read_expr(state,
+ result = flatten(state, first,
+ read_expr(state,
deref_index(state, fresult(state, func), 1)));
propogate_use(state, fcall, result);
@@ -14430,7 +14430,7 @@ static void expand_function_call(
}
/* Generate an expression for the value */
new = flatten(state, first,
- read_expr(state,
+ read_expr(state,
closure_expr(state, func, closure_idx, i)));
@@ -14443,7 +14443,7 @@ static void expand_function_call(
/*
* If the original is a value update the dominated uses.
*/
-
+
/* Analyze the basic blocks so I can see who dominates whom */
bb.func = me;
bb.first = RHS(me, 0);
@@ -14451,7 +14451,7 @@ static void expand_function_call(
bb.func = 0;
}
analyze_basic_blocks(state, &bb);
-
+
#if DEBUG_EXPLICIT_CLOSURES
fprintf(state->errout, "Updating domindated uses: %p -> %p\n",
@@ -14459,7 +14459,7 @@ static void expand_function_call(
#endif
/* If fcall dominates the use update the expression */
for(use = set->member->use; use; use = next) {
- /* Replace use modifies the use chain and
+ /* Replace use modifies the use chain and
* removes use, so I must take a copy of the
* next entry early.
*/
@@ -14652,7 +14652,7 @@ static void insert_function(struct compile_state *state,
if (state->compiler->debug & DEBUG_INLINE) {
FILE *fp = state->errout;
- fprintf(fp, "%s func count: %d\n",
+ fprintf(fp, "%s func count: %d\n",
func->type->type_ident->name, func->u.cval);
}
if (func->u.cval == 0) {
@@ -14677,7 +14677,7 @@ struct triple *input_asm(struct compile_state *state)
struct asm_info *info;
struct triple *def;
int i, out;
-
+
info = xcmalloc(sizeof(*info), "asm_info");
info->str = "";
@@ -14687,7 +14687,7 @@ struct triple *input_asm(struct compile_state *state)
def = new_triple(state, OP_ASM, &void_type, out, 0);
def->u.ainfo = info;
def->id |= TRIPLE_FLAG_VOLATILE;
-
+
for(i = 0; i < out; i++) {
struct triple *piece;
piece = triple(state, OP_PIECE, &int_type, def, 0);
@@ -14703,7 +14703,7 @@ struct triple *output_asm(struct compile_state *state)
struct asm_info *info;
struct triple *def;
int in;
-
+
info = xcmalloc(sizeof(*info), "asm_info");
info->str = "";
@@ -14713,7 +14713,7 @@ struct triple *output_asm(struct compile_state *state)
def = new_triple(state, OP_ASM, &void_type, 0, in);
def->u.ainfo = info;
def->id |= TRIPLE_FLAG_VOLATILE;
-
+
return def;
}
@@ -14750,11 +14750,11 @@ static void join_functions(struct compile_state *state)
/* Verify the external arguments */
if (registers_of(state, args_type) > ARCH_INPUT_REGS) {
- error(state, state->main_function,
+ error(state, state->main_function,
"Too many external input arguments");
}
if (registers_of(state, result_type) > ARCH_OUTPUT_REGS) {
- error(state, state->main_function,
+ error(state, state->main_function,
"Too many external output arguments");
}
@@ -14784,8 +14784,8 @@ static void join_functions(struct compile_state *state)
param = param->left;
}
if (registers_of(state, param) != 1) {
- error(state, state->main_function,
- "Arg: %d %s requires multiple registers",
+ error(state, state->main_function,
+ "Arg: %d %s requires multiple registers",
idx + 1, param->field_ident->name);
}
expr = read_expr(state, LHS(in, idx));
@@ -14793,7 +14793,7 @@ static void join_functions(struct compile_state *state)
expr = flatten(state, call, expr);
use_triple(expr, call);
- idx++;
+ idx++;
}
@@ -14832,7 +14832,7 @@ static void join_functions(struct compile_state *state)
}
/* Allocate a dummy containing function */
- func = triple(state, OP_LIST,
+ func = triple(state, OP_LIST,
new_type(TYPE_FUNCTION, &void_type, &void_type), 0, 0);
func->type->type_ident = lookup(state, "", 0);
RHS(func, 0) = state->first;
@@ -14861,7 +14861,7 @@ static void join_functions(struct compile_state *state)
static int do_use_block(
- struct block *used, struct block_set **head, struct block *user,
+ struct block *used, struct block_set **head, struct block *user,
int front)
{
struct block_set **ptr, *new;
@@ -14916,13 +14916,13 @@ static void use_block(struct block *used, struct block *user)
/* Append new to the head of the list, print_block
* depends on this.
*/
- count = do_use_block(used, &used->use, user, 1);
+ count = do_use_block(used, &used->use, user, 1);
used->users += count;
}
static void unuse_block(struct block *used, struct block *unuser)
{
int count;
- count = do_unuse_block(used, &used->use, unuser);
+ count = do_unuse_block(used, &used->use, unuser);
used->users -= count;
}
@@ -14981,7 +14981,7 @@ static void unipdomf_block(struct block *block, struct block *unipdomf)
}
static int walk_triples(
- struct compile_state *state,
+ struct compile_state *state,
int (*cb)(struct compile_state *state, struct triple *ptr, void *arg),
void *arg)
{
@@ -15014,7 +15014,7 @@ static int do_print_triple(struct compile_state *state, struct triple *ins, void
}
display_triple(fp, ins);
- if (triple_is_branch(state, ins) && ins->use &&
+ if (triple_is_branch(state, ins) && ins->use &&
(ins->op != OP_RET) && (ins->op != OP_FCALL)) {
internal_error(state, ins, "branch used?");
}
@@ -15135,7 +15135,7 @@ static void free_basic_block(struct compile_state *state, struct block *block)
while((edge = block->edges)) {
child = edge->member;
remove_block_edge(block, child);
-
+
if (child && (child->vertex != -1)) {
free_basic_block(state, child);
}
@@ -15146,7 +15146,7 @@ static void free_basic_block(struct compile_state *state, struct block *block)
#endif
}
-static void free_basic_blocks(struct compile_state *state,
+static void free_basic_blocks(struct compile_state *state,
struct basic_blocks *bb)
{
struct triple *first, *ins;
@@ -15161,10 +15161,10 @@ static void free_basic_blocks(struct compile_state *state,
}
ins = ins->next;
} while(ins != first);
-
+
}
-static struct block *basic_block(struct compile_state *state,
+static struct block *basic_block(struct compile_state *state,
struct basic_blocks *bb, struct triple *first)
{
struct block *block;
@@ -15183,7 +15183,7 @@ static struct block *basic_block(struct compile_state *state,
block->vertex = bb->last_vertex;
ptr = first;
do {
- if ((ptr != first) && triple_is_label(state, ptr) && (ptr->use)) {
+ if ((ptr != first) && triple_is_label(state, ptr) && (ptr->use)) {
break;
}
block->last = ptr;
@@ -15198,7 +15198,7 @@ static struct block *basic_block(struct compile_state *state,
} while (ptr != bb->first);
if ((ptr == bb->first) ||
((ptr->next == bb->first) && (
- triple_is_end(state, ptr) ||
+ triple_is_end(state, ptr) ||
triple_is_ret(state, ptr))))
{
/* The block has no outflowing edges */
@@ -15263,7 +15263,7 @@ static struct block *basic_block(struct compile_state *state,
struct block_set *edge;
FILE *fp = state->errout;
fprintf(fp, "basic_block: %10p [%2d] ( %10p - %10p )",
- block, block->vertex,
+ block, block->vertex,
block->first, block->last);
for(edge = block->edges; edge; edge = edge->next) {
fprintf(fp, " %10p [%2d]",
@@ -15307,7 +15307,7 @@ static void print_block(
FILE *fp = arg;
fprintf(fp, "\nblock: %p (%d) ",
- block,
+ block,
block->vertex);
for(edge = block->edges; edge; edge = edge->next) {
@@ -15331,7 +15331,7 @@ static void print_block(
}
fprintf(fp, "users %d: ", block->users);
for(user = block->use; user; user = user->next) {
- fprintf(fp, "%p (%d) ",
+ fprintf(fp, "%p (%d) ",
user->member,
user->member->vertex);
}
@@ -15357,7 +15357,7 @@ static void print_blocks(struct compile_state *state, const char *func, FILE *fp
}
}
-static void prune_nonblock_triples(struct compile_state *state,
+static void prune_nonblock_triples(struct compile_state *state,
struct basic_blocks *bb)
{
struct block *block;
@@ -15389,7 +15389,7 @@ static void prune_nonblock_triples(struct compile_state *state,
} while(ins != first);
}
-static void setup_basic_blocks(struct compile_state *state,
+static void setup_basic_blocks(struct compile_state *state,
struct basic_blocks *bb)
{
if (!triple_stores_block(state, bb->first)) {
@@ -15404,8 +15404,8 @@ static void setup_basic_blocks(struct compile_state *state,
bb->first_block = basic_block(state, bb, bb->first);
/* Be certain the last instruction of a function, or the
- * entire program is in a basic block. When it is not find
- * the start of the block, insert a label if necessary and build
+ * entire program is in a basic block. When it is not find
+ * the start of the block, insert a label if necessary and build
* basic block. Then add a fake edge from the start block
* to the final block.
*/
@@ -15421,7 +15421,7 @@ static void setup_basic_blocks(struct compile_state *state,
add_block_edge(bb->first_block, tail, 0);
use_block(tail, bb->first_block);
}
-
+
/* Find the last basic block.
*/
bb->last_block = block_of_triple(state, bb->first->prev);
@@ -15522,7 +15522,7 @@ static int initialize_spdblock(
return vertex;
}
-static int setup_spdblocks(struct compile_state *state,
+static int setup_spdblocks(struct compile_state *state,
struct basic_blocks *bb, struct sdom_block *sd)
{
struct block *block;
@@ -15532,7 +15532,7 @@ static int setup_spdblocks(struct compile_state *state,
/* Walk through the graph and find unconnected blocks. Add a
* fake edge from the unconnected blocks to the end of the
- * graph.
+ * graph.
*/
block = bb->first_block->last->next->u.block;
for(; block && block != bb->first_block; block = block->last->next->u.block) {
@@ -15576,16 +15576,16 @@ static void compress_ancestors(struct sdom_block *v)
}
}
-static void compute_sdom(struct compile_state *state,
+static void compute_sdom(struct compile_state *state,
struct basic_blocks *bb, struct sdom_block *sd)
{
int i;
- /* // step 2
+ /* // step 2
* for each v <= pred(w) {
* u = EVAL(v);
- * if (semi[u] < semi[w] {
- * semi[w] = semi[u];
- * }
+ * if (semi[u] < semi[w] {
+ * semi[w] = semi[u];
+ * }
* }
* add w to bucket(vertex(semi[w]));
* LINK(parent(w), w);
@@ -15620,22 +15620,22 @@ static void compute_sdom(struct compile_state *state,
next = v->sdom_next;
unsdom_block(v);
u = (!v->ancestor) ? v : (compress_ancestors(v), v->label);
- v->block->idom = (u->sdom->vertex < v->sdom->vertex)?
+ v->block->idom = (u->sdom->vertex < v->sdom->vertex)?
u->block : parent->block;
}
}
}
-static void compute_spdom(struct compile_state *state,
+static void compute_spdom(struct compile_state *state,
struct basic_blocks *bb, struct sdom_block *sd)
{
int i;
- /* // step 2
+ /* // step 2
* for each v <= pred(w) {
* u = EVAL(v);
- * if (semi[u] < semi[w] {
- * semi[w] = semi[u];
- * }
+ * if (semi[u] < semi[w] {
+ * semi[w] = semi[u];
+ * }
* }
* add w to bucket(vertex(semi[w]));
* LINK(parent(w), w);
@@ -15669,13 +15669,13 @@ static void compute_spdom(struct compile_state *state,
next = v->sdom_next;
unsdom_block(v);
u = (!v->ancestor) ? v : (compress_ancestors(v), v->label);
- v->block->ipdom = (u->sdom->vertex < v->sdom->vertex)?
+ v->block->ipdom = (u->sdom->vertex < v->sdom->vertex)?
u->block : parent->block;
}
}
}
-static void compute_idom(struct compile_state *state,
+static void compute_idom(struct compile_state *state,
struct basic_blocks *bb, struct sdom_block *sd)
{
int i;
@@ -15690,7 +15690,7 @@ static void compute_idom(struct compile_state *state,
sd[1].block->idom = 0;
}
-static void compute_ipdom(struct compile_state *state,
+static void compute_ipdom(struct compile_state *state,
struct basic_blocks *bb, struct sdom_block *sd)
{
int i;
@@ -15707,13 +15707,13 @@ static void compute_ipdom(struct compile_state *state,
/* Theorem 1:
* Every vertex of a flowgraph G = (V, E, r) except r has
- * a unique immediate dominator.
+ * a unique immediate dominator.
* The edges {(idom(w), w) |w <= V - {r}} form a directed tree
- * rooted at r, called the dominator tree of G, such that
+ * rooted at r, called the dominator tree of G, such that
* v dominates w if and only if v is a proper ancestor of w in
* the dominator tree.
*/
- /* Lemma 1:
+ /* Lemma 1:
* If v and w are vertices of G such that v <= w,
* than any path from v to w must contain a common ancestor
* of v and w in T.
@@ -15726,7 +15726,7 @@ static void compute_ipdom(struct compile_state *state,
* sdom(u) >= sdom(w). Then idom(w) = sdom(w).
*/
/* Theorem 3:
- * Let w != r and let u be a vertex for which sdom(u) is
+ * Let w != r and let u be a vertex for which sdom(u) is
* minimum amoung vertices u satisfying sdom(w) -> u -> w.
* Then sdom(u) <= sdom(w) and idom(u) = idom(w).
*/
@@ -15744,11 +15744,11 @@ static void find_immediate_dominators(struct compile_state *state,
/* Theorem 4:
* For any vertex w != r.
* sdom(w) = min(
- * {v|(v,w) <= E and v < w } U
+ * {v|(v,w) <= E and v < w } U
* {sdom(u) | u > w and there is an edge (v, w) such that u -> v})
*/
/* Corollary 1:
- * Let w != r and let u be a vertex for which sdom(u) is
+ * Let w != r and let u be a vertex for which sdom(u) is
* minimum amoung vertices u satisfying sdom(w) -> u -> w.
* Then:
* { sdom(w) if sdom(w) = sdom(u),
@@ -15756,7 +15756,7 @@ static void find_immediate_dominators(struct compile_state *state,
* { idom(u) otherwise
*/
/* The algorithm consists of the following 4 steps.
- * Step 1. Carry out a depth-first search of the problem graph.
+ * Step 1. Carry out a depth-first search of the problem graph.
* Number the vertices from 1 to N as they are reached during
* the search. Initialize the variables used in succeeding steps.
* Step 2. Compute the semidominators of all vertices by applying
@@ -15896,7 +15896,7 @@ static void print_dominated2(
for(i = 0; i < depth; i++) {
fprintf(fp, " ");
}
- fprintf(fp, "%3d: %p (%p - %p) @",
+ fprintf(fp, "%3d: %p (%p - %p) @",
block->vertex, block, block->first, block->last);
ins = block->first;
while(ins != block->last && (ins->occurance->line == 0)) {
@@ -15947,7 +15947,7 @@ static int print_frontiers(
fprintf(fp, " %d", user->member->vertex);
}
fprintf(fp, "\n");
-
+
for(edge = block->edges; edge; edge = edge->next) {
vertex = print_frontiers(state, fp, edge->member, vertex);
}
@@ -15958,7 +15958,7 @@ static void print_dominance_frontiers(struct compile_state *state,
{
fprintf(fp, "\ndominance frontiers\n");
print_frontiers(state, fp, bb->first_block, 0);
-
+
}
static void analyze_idominators(struct compile_state *state, struct basic_blocks *bb)
@@ -16024,7 +16024,7 @@ static void print_ipdominance_frontiers(struct compile_state *state,
{
fprintf(fp, "\nipdominance frontiers\n");
print_pfrontiers(state, fp, bb->last_block, 0);
-
+
}
static void analyze_ipdominators(struct compile_state *state,
@@ -16060,7 +16060,7 @@ static int tdominates(struct compile_state *state,
bsub = block_of_triple(state, sub);
if (bdom != bsub) {
result = bdominates(state, bdom, bsub);
- }
+ }
else {
struct triple *ins;
if (!bdom || !bsub) {
@@ -16106,7 +16106,7 @@ static void insert_phi_operations(struct compile_state *state)
if (!triple_is_auto_var(state, var) || !var->use) {
continue;
}
-
+
iter += 1;
work_list = 0;
work_list_tail = &work_list;
@@ -16119,7 +16119,7 @@ static void insert_phi_operations(struct compile_state *state)
continue;
}
if (user->member->op != OP_WRITE) {
- internal_error(state, user->member,
+ internal_error(state, user->member,
"bad variable access");
}
block = user->member->u.block;
@@ -16152,7 +16152,7 @@ static void insert_phi_operations(struct compile_state *state)
/* Insert a phi function for this variable */
get_occurance(var->occurance);
phi = alloc_triple(
- state, OP_PHI, var->type, -1, in_edges,
+ state, OP_PHI, var->type, -1, in_edges,
var->occurance);
phi->u.block = front;
MISC(phi, 0) = var;
@@ -16555,7 +16555,7 @@ static void prune_unused_phis(struct compile_state *state)
struct triple *first, *phi;
struct phi_triple *live;
int phis, i;
-
+
/* Find the first instruction */
first = state->first;
@@ -16566,7 +16566,7 @@ static void prune_unused_phis(struct compile_state *state)
phis += 1;
}
}
-
+
/* Mark them all dead */
live = xcmalloc(sizeof(*live) * (phis + 1), "phi_triple");
phis = 0;
@@ -16580,7 +16580,7 @@ static void prune_unused_phis(struct compile_state *state)
phi->id = phis;
phis += 1;
}
-
+
/* Mark phis alive that are used by non phis */
for(i = 0; i < phis; i++) {
struct triple_set *set;
@@ -16613,7 +16613,7 @@ static void prune_unused_phis(struct compile_state *state)
slot[j] = unknown;
use_triple(unknown, phi);
transform_to_arch_instruction(state, unknown);
-#if 0
+#if 0
warning(state, phi, "variable not set at index %d on all paths to use", j);
#endif
}
@@ -16747,7 +16747,7 @@ static void transform_from_ssa_form(struct compile_state *state)
}
var = post_triple(state, phi, OP_ADECL, phi->type, 0, 0);
var = var->next; /* point at the var */
-
+
/* Replaces use of phi with var */
propogate_use(state, phi, var);
@@ -16800,7 +16800,7 @@ static void transform_from_ssa_form(struct compile_state *state)
if (!eblock->first) {
internal_error(state, 0, "empty block?");
}
-
+
/* Make certain the write is placed in the edge block... */
/* Walk through the edge block backwards to find an
* appropriate location for the OP_WRITE.
@@ -16847,7 +16847,7 @@ static void transform_from_ssa_form(struct compile_state *state)
/* Release the phi function */
release_triple(state, phi);
}
-
+
/* Walk all of the operations to find the adecls */
for(var = first->next; var != first ; var = var->next) {
struct triple_set *use, *use_next;
@@ -16864,7 +16864,7 @@ static void transform_from_ssa_form(struct compile_state *state)
int zrhs, i, used;
use_next = use->next;
user = use->member;
-
+
/* Generate a read of var */
read = pre_triple(state, user, OP_READ, var->type, var, 0);
use_triple(var, read);
@@ -16883,7 +16883,7 @@ static void transform_from_ssa_form(struct compile_state *state)
if (used) {
unuse_triple(var, user);
use_triple(read, user);
- }
+ }
/* If we didn't use it release the extra triple */
else {
release_triple(state, read);
@@ -16895,7 +16895,7 @@ static void transform_from_ssa_form(struct compile_state *state)
#define HI() if (state->compiler->debug & DEBUG_REBUILD_SSA_FORM) { \
FILE *fp = state->dbgout; \
fprintf(fp, "@ %s:%d\n", __FILE__, __LINE__); romcc_print_blocks(state, fp); \
- }
+ }
static void rebuild_ssa_form(struct compile_state *state)
{
@@ -16910,7 +16910,7 @@ HI();
HI();
rename_variables(state);
HI();
-
+
prune_block_variables(state, state->bb.first_block);
HI();
prune_unused_phis(state);
@@ -16918,7 +16918,7 @@ HI();
}
#undef HI
-/*
+/*
* Register conflict resolution
* =========================================================
*/
@@ -16948,7 +16948,7 @@ static struct reg_info find_def_color(
if (tinfo.reg >= MAX_REGISTERS) {
tinfo.reg = REG_UNSET;
}
- if ((tinfo.reg != REG_UNSET) &&
+ if ((tinfo.reg != REG_UNSET) &&
(info.reg != REG_UNSET) &&
(tinfo.reg != info.reg)) {
internal_error(state, def, "register conflict");
@@ -17201,7 +17201,7 @@ static struct triple *typed_pre_copy(
use_triple(in, ins);
transform_to_arch_instruction(state, in);
return in;
-
+
}
static struct triple *pre_copy(
struct compile_state *state, struct triple *ins, int index)
@@ -17258,7 +17258,7 @@ static void insert_copies_to_phi(struct compile_state *state)
move->u.block = eblock;
move->id |= TRIPLE_FLAG_PRE_SPLIT;
use_triple(val, move);
-
+
slot[edge] = move;
unuse_triple(val, phi);
use_triple(move, phi);
@@ -17315,7 +17315,7 @@ struct triple_reg_set;
struct reg_block;
-static int do_triple_set(struct triple_reg_set **head,
+static int do_triple_set(struct triple_reg_set **head,
struct triple *member, struct triple *new_member)
{
struct triple_reg_set **ptr, *new;
@@ -17433,7 +17433,7 @@ static struct triple *part_to_piece(struct compile_state *state, struct triple *
return ins;
}
-static int this_def(struct compile_state *state,
+static int this_def(struct compile_state *state,
struct triple *ins, struct triple *other)
{
if (ins == other) {
@@ -17611,7 +17611,7 @@ static struct reg_block *compute_variable_lifetimes(
return blocks;
}
-static void free_variable_lifetimes(struct compile_state *state,
+static void free_variable_lifetimes(struct compile_state *state,
struct basic_blocks *bb, struct reg_block *blocks)
{
int i;
@@ -17634,16 +17634,16 @@ static void free_variable_lifetimes(struct compile_state *state,
}
typedef void (*wvl_cb_t)(
- struct compile_state *state,
- struct reg_block *blocks, struct triple_reg_set *live,
+ struct compile_state *state,
+ struct reg_block *blocks, struct triple_reg_set *live,
struct reg_block *rb, struct triple *ins, void *arg);
static void walk_variable_lifetimes(struct compile_state *state,
- struct basic_blocks *bb, struct reg_block *blocks,
+ struct basic_blocks *bb, struct reg_block *blocks,
wvl_cb_t cb, void *arg)
{
int i;
-
+
for(i = 1; i <= state->bb.last_vertex; i++) {
struct triple_reg_set *live;
struct triple_reg_set *entry, *next;
@@ -17678,7 +17678,7 @@ static void walk_variable_lifetimes(struct compile_state *state,
* going on.
*/
cb(state, blocks, live, rb, ptr, arg);
-
+
/* Remove the current definition from live */
do_triple_unset(&live, ptr);
@@ -17731,7 +17731,7 @@ static void print_live_variables_block(
block, block->vertex);
for(edge = block->edges; edge; edge = edge->next) {
fprintf(fp, " %p<-%p",
- edge->member,
+ edge->member,
edge->member && edge->member->use?edge->member->use->member : 0);
}
fprintf(fp, "\n");
@@ -17785,7 +17785,7 @@ static void print_live_variables_block(
fprintf(fp, "\n");
}
-static void print_live_variables(struct compile_state *state,
+static void print_live_variables(struct compile_state *state,
struct basic_blocks *bb, struct reg_block *rb, FILE *fp)
{
struct print_live_variable_info info;
@@ -17821,7 +17821,7 @@ struct dead_triple {
#define TRIPLE_FLAG_FREE 1
};
-static void print_dead_triples(struct compile_state *state,
+static void print_dead_triples(struct compile_state *state,
struct dead_triple *dtriple)
{
struct triple *first, *ins;
@@ -17839,7 +17839,7 @@ static void print_dead_triples(struct compile_state *state,
if ((ins->op == OP_LABEL) && (ins->use)) {
fprintf(fp, "\n%p:\n", ins);
}
- fprintf(fp, "%c",
+ fprintf(fp, "%c",
(dt->flags & TRIPLE_FLAG_ALIVE)?' ': '-');
display_triple(fp, ins);
if (triple_is_branch(state, ins)) {
@@ -17906,7 +17906,7 @@ static void eliminate_inefectual_code(struct compile_state *state)
/* Now put then in an array and mark all of the triples dead */
dtriple = xcmalloc(sizeof(*dtriple) * (triples + 1), "dtriples");
-
+
ins = first;
i = 1;
block = 0;
@@ -17977,7 +17977,7 @@ static void eliminate_inefectual_code(struct compile_state *state)
}
print_dead_triples(state, dtriple);
for(dt = &dtriple[1]; dt <= &dtriple[triples]; dt++) {
- if ((dt->triple->op == OP_NOOP) &&
+ if ((dt->triple->op == OP_NOOP) &&
(dt->flags & TRIPLE_FLAG_ALIVE)) {
internal_error(state, dt->triple, "noop effective?");
}
@@ -18036,13 +18036,13 @@ static void insert_mandatory_copies(struct compile_state *state)
if (i < 0) {
continue;
}
-
+
/* Find the users color requirements */
rinfo = arch_reg_rhs(state, entry->member, i);
if (rinfo.reg >= MAX_REGISTERS) {
rinfo.reg = REG_UNSET;
}
-
+
/* See if I need a pre_copy */
if (rinfo.reg != REG_UNSET) {
if ((reg != REG_UNSET) && (reg != rinfo.reg)) {
@@ -18059,14 +18059,14 @@ static void insert_mandatory_copies(struct compile_state *state)
* They do not take up any registers until a
* copy places them in one.
*/
- if ((info.reg == REG_UNNEEDED) &&
+ if ((info.reg == REG_UNNEEDED) &&
(rinfo.reg != REG_UNNEEDED)) {
do_pre_copy = 1;
}
}
do_post_copy =
!do_pre_copy &&
- (((info.reg != REG_UNSET) &&
+ (((info.reg != REG_UNSET) &&
(reg != REG_UNSET) &&
(info.reg != reg)) ||
((info.regcm & regcm) == 0));
@@ -18082,7 +18082,7 @@ static void insert_mandatory_copies(struct compile_state *state)
if (i < 0) {
continue;
}
-
+
/* Find the users color requirements */
rinfo = arch_reg_rhs(state, entry->member, i);
if (rinfo.reg >= MAX_REGISTERS) {
@@ -18131,7 +18131,7 @@ static void insert_mandatory_copies(struct compile_state *state)
}
}
regcm &= rinfo.regcm;
-
+
}
if (do_post_copy) {
struct reg_info pre, post;
@@ -18225,7 +18225,7 @@ static void print_interference_block(
block, block->vertex);
for(edge = block->edges; edge; edge = edge->next) {
fprintf(fp, " %p<-%p",
- edge->member,
+ edge->member,
edge->member && edge->member->use?edge->member->use->member : 0);
}
fprintf(fp, "\n");
@@ -18271,7 +18271,7 @@ static void print_interference_block(
op = ptr->op;
done = (ptr == block->last);
lr = rstate->lrd[ptr->id].lr;
-
+
id = ptr->id;
ptr->id = rstate->lrd[id].orig_id;
SET_REG(ptr->id, lr->color);
@@ -18436,7 +18436,7 @@ static struct lre_hash **lre_probe(struct reg_state *rstate,
right = tmp;
}
index = hash_live_edge(left, right);
-
+
ptr = &rstate->hash[index];
while(*ptr) {
if (((*ptr)->left == left) && ((*ptr)->right == right)) {
@@ -18455,7 +18455,7 @@ static int interfere(struct reg_state *rstate,
return ptr && *ptr;
}
-static void add_live_edge(struct reg_state *rstate,
+static void add_live_edge(struct reg_state *rstate,
struct live_range *left, struct live_range *right)
{
/* FIXME the memory allocation overhead is noticeable here... */
@@ -18494,7 +18494,7 @@ static void add_live_edge(struct reg_state *rstate,
edge->node = right;
left->edges = edge;
left->degree += 1;
-
+
edge = xmalloc(sizeof(*edge), "live_range_edge");
edge->next = right->edges;
edge->node = left;
@@ -18546,7 +18546,7 @@ static void remove_live_edges(struct reg_state *rstate, struct live_range *range
}
}
-static void transfer_live_edges(struct reg_state *rstate,
+static void transfer_live_edges(struct reg_state *rstate,
struct live_range *dest, struct live_range *src)
{
struct live_range_edge *edge, *next;
@@ -18561,7 +18561,7 @@ static void transfer_live_edges(struct reg_state *rstate,
/* Interference graph...
- *
+ *
* new(n) --- Return a graph with n nodes but no edges.
* add(g,x,y) --- Return a graph including g with an between x and y
* interfere(g, x, y) --- Return true if there exists an edge between the nodes
@@ -18574,11 +18574,11 @@ static void transfer_live_edges(struct reg_state *rstate,
* The adjacency vectors support an efficient implementation of neighbors.
*/
-/*
+/*
* +---------------------------------------------------+
* | +--------------+ |
* v v | |
- * renumber -> build graph -> colalesce -> spill_costs -> simplify -> select
+ * renumber -> build graph -> colalesce -> spill_costs -> simplify -> select
*
* -- In simplify implment optimistic coloring... (No backtracking)
* -- Implement Rematerialization it is the only form of spilling we can perform
@@ -18594,7 +18594,7 @@ static void transfer_live_edges(struct reg_state *rstate,
#if DEBUG_ROMCC_WARNING
static void different_colored(
- struct compile_state *state, struct reg_state *rstate,
+ struct compile_state *state, struct reg_state *rstate,
struct triple *parent, struct triple *ins)
{
struct live_range *lr;
@@ -18630,13 +18630,13 @@ static struct live_range *coalesce_ranges(
}
if ((lr1->color == REG_UNNEEDED) ||
(lr2->color == REG_UNNEEDED)) {
- internal_error(state, 0,
+ internal_error(state, 0,
"cannot coalesce live ranges without a possible color");
}
if ((lr1->color != lr2->color) &&
(lr1->color != REG_UNSET) &&
(lr2->color != REG_UNSET)) {
- internal_error(state, lr1->defs->def,
+ internal_error(state, lr1->defs->def,
"cannot coalesce live ranges of different colors");
}
color = lr1->color;
@@ -18667,7 +18667,7 @@ static struct live_range *coalesce_ranges(
/* If there is a clear dominate live range put it in lr1,
* For purposes of this test phi functions are
* considered dominated by the definitions that feed into
- * them.
+ * them.
*/
if ((lr1->defs->prev->def->op == OP_PHI) ||
((lr2->defs->prev->def->op != OP_PHI) &&
@@ -18698,12 +18698,12 @@ static struct live_range *coalesce_ranges(
lr2->defs->def,
lr2->color);
#endif
-
+
/* Append lr2 onto lr1 */
#if DEBUG_ROMCC_WARNINGS
#warning "FIXME should this be a merge instead of a splice?"
#endif
- /* This FIXME item applies to the correctness of live_range_end
+ /* This FIXME item applies to the correctness of live_range_end
* and to the necessity of making multiple passes of coalesce_live_ranges.
* A failure to find some coalesce opportunities in coaleace_live_ranges
* does not impact the correct of the compiler just the efficiency with
@@ -18713,7 +18713,7 @@ static struct live_range *coalesce_ranges(
mid1 = lr1->defs->prev;
mid2 = lr2->defs;
end = lr2->defs->prev;
-
+
head->prev = end;
end->next = head;
@@ -18818,7 +18818,7 @@ static void initialize_live_ranges(
rstate->lr[i].classes = info.regcm;
rstate->lr[i].degree = 0;
rstate->lrd[j].lr = &rstate->lr[i];
- }
+ }
/* Otherwise give the triple the dummy live range. */
else {
rstate->lrd[j].lr = &rstate->lr[0];
@@ -18845,7 +18845,7 @@ static void initialize_live_ranges(
if (ins->id > rstate->defs) {
internal_error(state, ins, "bad id");
}
-
+
/* Walk through the template of ins and coalesce live ranges */
zlhs = ins->lhs;
if ((zlhs == 0) && triple_is_def(state, ins)) {
@@ -18891,7 +18891,7 @@ static void initialize_live_ranges(
}
if (rinfo.reg == linfo.reg) {
- coalesce_ranges(state, rstate,
+ coalesce_ranges(state, rstate,
lhs->lr, rhs->lr);
}
}
@@ -18901,8 +18901,8 @@ static void initialize_live_ranges(
}
static void graph_ins(
- struct compile_state *state,
- struct reg_block *blocks, struct triple_reg_set *live,
+ struct compile_state *state,
+ struct reg_block *blocks, struct triple_reg_set *live,
struct reg_block *rb, struct triple *ins, void *arg)
{
struct reg_state *rstate = arg;
@@ -18917,7 +18917,7 @@ static void graph_ins(
return;
}
def = rstate->lrd[ins->id].lr;
-
+
/* Create an edge between ins and everything that is
* alive, unless the live_range cannot share
* a physical register with ins.
@@ -18965,8 +18965,8 @@ static struct live_range *get_verify_live_range(
}
static void verify_graph_ins(
- struct compile_state *state,
- struct reg_block *blocks, struct triple_reg_set *live,
+ struct compile_state *state,
+ struct reg_block *blocks, struct triple_reg_set *live,
struct reg_block *rb, struct triple *ins, void *arg)
{
struct reg_state *rstate = arg;
@@ -18987,17 +18987,17 @@ static void verify_graph_ins(
}
lr2 = get_verify_live_range(state, rstate, entry2->member);
if (lr1 == lr2) {
- internal_error(state, entry2->member,
+ internal_error(state, entry2->member,
"live range with 2 values simultaneously alive");
}
if (!arch_regcm_intersect(lr1->classes, lr2->classes)) {
continue;
}
if (!interfere(rstate, lr1, lr2)) {
- internal_error(state, entry2->member,
+ internal_error(state, entry2->member,
"edges don't interfere?");
}
-
+
lr1_found = 0;
lr2_degree = 0;
for(edge2 = lr2->edges; edge2; edge2 = edge2->next) {
@@ -19021,8 +19021,8 @@ static void verify_graph_ins(
#endif
static void print_interference_ins(
- struct compile_state *state,
- struct reg_block *blocks, struct triple_reg_set *live,
+ struct compile_state *state,
+ struct reg_block *blocks, struct triple_reg_set *live,
struct reg_block *rb, struct triple *ins, void *arg)
{
struct reg_state *rstate = arg;
@@ -19092,7 +19092,7 @@ static int coalesce_live_ranges(
* Forcing a value to stay in a single register
* for an extended period of time does have
* limitations when applied to non homogenous
- * register pool.
+ * register pool.
*
* The two cases I have identified are:
* 1) Two forced register assignments may
@@ -19110,7 +19110,7 @@ static int coalesce_live_ranges(
* functions. This creates a 2 headed live
* range that cannot be sanely split.
*
- * - phi functions (coalesced in initialize_live_ranges)
+ * - phi functions (coalesced in initialize_live_ranges)
* are handled as pre split live ranges so we will
* never attempt to split them.
*/
@@ -19160,7 +19160,7 @@ static int coalesce_live_ranges(
if ((lr1->classes & lr2->classes) == 0) {
continue;
}
-
+
if (interfere(rstate, lr1, lr2)) {
continue;
}
@@ -19235,7 +19235,7 @@ static int correct_coalesce_conflicts(
{
int conflicts;
conflicts = 0;
- walk_variable_lifetimes(state, &state->bb, blocks,
+ walk_variable_lifetimes(state, &state->bb, blocks,
fix_coalesce_conflicts, &conflicts);
return conflicts;
}
@@ -19251,7 +19251,7 @@ static void replace_set_use(struct compile_state *state,
}
}
-static void replace_block_use(struct compile_state *state,
+static void replace_block_use(struct compile_state *state,
struct reg_block *blocks, struct triple *orig, struct triple *new)
{
int i;
@@ -19343,7 +19343,7 @@ static struct triple *resolve_tangle(
}
info = find_lhs_color(state, tangle, 0);
SET_INFO(tangle->id, info);
-
+
return copy;
}
@@ -19369,7 +19369,7 @@ static void fix_tangles(struct compile_state *state,
}
reg_inc_used(state, used, info.reg);
}
-
+
/* Now find the least dominated definition of a register in
* conflict I have seen so far.
*/
@@ -19382,7 +19382,7 @@ static void fix_tangles(struct compile_state *state,
/* Changing copies that feed into phi functions
* is incorrect.
*/
- if (set->member->use &&
+ if (set->member->use &&
(set->member->use->member->op == OP_PHI)) {
continue;
}
@@ -19412,7 +19412,7 @@ static int correct_tangles(
int tangles;
tangles = 0;
color_instructions(state);
- walk_variable_lifetimes(state, &state->bb, blocks,
+ walk_variable_lifetimes(state, &state->bb, blocks,
fix_tangles, &tangles);
return tangles;
}
@@ -19443,7 +19443,7 @@ struct triple *find_constrained_def(
if (regcm == info.regcm) {
continue;
}
-
+
/* If there is just one use.
* That use cannot accept a larger register class.
* There are no intervening definitions except
@@ -19454,7 +19454,7 @@ struct triple *find_constrained_def(
#if DEBUG_ROMCC_WARNINGS
#warning "FIXME ignore cases that cannot be fixed (a definition followed by a use)"
#endif
-
+
/* Of the constrained live ranges deal with the
* least dominated one first.
@@ -19463,7 +19463,7 @@ struct triple *find_constrained_def(
fprintf(state->errout, "canidate: %p %-8s regcm: %x %x\n",
lrd->def, tops(lrd->def->op), regcm, info.regcm);
}
- if (!constrained ||
+ if (!constrained ||
tdominates(state, lrd->def, constrained))
{
constrained = lrd->def;
@@ -19473,13 +19473,13 @@ struct triple *find_constrained_def(
}
static int split_constrained_ranges(
- struct compile_state *state, struct reg_state *rstate,
+ struct compile_state *state, struct reg_state *rstate,
struct live_range *range)
{
/* Walk through the edges in conflict and our current live
* range, and find definitions that are more severly constrained
* than they type of data they contain require.
- *
+ *
* Then pick one of those ranges and relax the constraints.
*/
struct live_range_edge *edge;
@@ -19507,14 +19507,14 @@ static int split_constrained_ranges(
}
return !!constrained;
}
-
+
static int split_ranges(
struct compile_state *state, struct reg_state *rstate,
char *used, struct live_range *range)
{
int split;
if (state->compiler->debug & DEBUG_RANGE_CONFLICTS) {
- fprintf(state->errout, "split_ranges %d %s %p\n",
+ fprintf(state->errout, "split_ranges %d %s %p\n",
rstate->passes, tops(range->defs->def->op), range->defs->def);
}
if ((range->color == REG_UNNEEDED) ||
@@ -19524,7 +19524,7 @@ static int split_ranges(
split = split_constrained_ranges(state, rstate, range);
/* Ideally I would split the live range that will not be used
- * for the longest period of time in hopes that this will
+ * for the longest period of time in hopes that this will
* (a) allow me to spill a register or
* (b) allow me to place a value in another register.
*
@@ -19538,7 +19538,7 @@ static int split_ranges(
#if DEBUG_ROMCC_WARNINGS
#warning "WISHLIST implement live range splitting..."
#endif
-
+
if (!split && (state->compiler->debug & DEBUG_RANGE_CONFLICTS2)) {
FILE *fp = state->errout;
print_interference_blocks(state, rstate, fp, 0);
@@ -19590,7 +19590,7 @@ static void cgdebug_loc(struct compile_state *state, struct triple *ins)
}
}
-static int select_free_color(struct compile_state *state,
+static int select_free_color(struct compile_state *state,
struct reg_state *rstate, struct live_range *range)
{
struct triple_set *entry;
@@ -19620,7 +19620,7 @@ static int select_free_color(struct compile_state *state,
for(edge = range->edges; edge; edge = edge->next) {
i++;
}
- cgdebug_printf(state, "\n%s edges: %d",
+ cgdebug_printf(state, "\n%s edges: %d",
tops(range->defs->def->op), i);
cgdebug_loc(state, range->defs->def);
cgdebug_printf(state, "\n");
@@ -19630,7 +19630,7 @@ static int select_free_color(struct compile_state *state,
arch_reg_str(i));
}
}
- }
+ }
/* If a color is already assigned see if it will work */
if (range->color != REG_UNSET) {
@@ -19758,7 +19758,7 @@ static int select_free_color(struct compile_state *state,
* pick the first color that is free.
*/
if (range->color == REG_UNSET) {
- range->color =
+ range->color =
arch_select_free_register(state, used, range->classes);
}
if (range->color == REG_UNSET) {
@@ -19784,7 +19784,7 @@ static int select_free_color(struct compile_state *state,
tops(lrd->def->op), lrd->def);
lrd = lrd->next;
} while(lrd != range->defs);
-
+
warning(state, range->defs->def, "classes: %x",
range->classes);
for(i = 0; i < MAX_REGISTERS; i++) {
@@ -19897,7 +19897,7 @@ static void verify_colors(struct compile_state *state, struct reg_state *rstate)
do {
if (triple_is_def(state, ins)) {
if ((ins->id < 0) || (ins->id > rstate->defs)) {
- internal_error(state, ins,
+ internal_error(state, ins,
"triple without a live range def");
}
lr = rstate->lrd[ins->id].lr;
@@ -19932,7 +19932,7 @@ static void color_triples(struct compile_state *state, struct reg_state *rstate)
ins = first;
do {
if ((ins->id < 0) || (ins->id > rstate->defs)) {
- internal_error(state, ins,
+ internal_error(state, ins,
"triple without a live range");
}
lrd = &rstate->lrd[ins->id];
@@ -19953,7 +19953,7 @@ static struct live_range *merge_sort_lr(
mid = first + size/2;
first = merge_sort_lr(first, mid -1);
mid = merge_sort_lr(mid, last);
-
+
join = 0;
join_tail = &join;
/* merge the two lists */
@@ -19982,7 +19982,7 @@ static struct live_range *merge_sort_lr(
/* Splice the remaining list */
pick = (first)? first : mid;
*join_tail = pick;
- if (pick) {
+ if (pick) {
pick->group_prev = join_tail;
}
}
@@ -19995,7 +19995,7 @@ static struct live_range *merge_sort_lr(
return join;
}
-static void ids_from_rstate(struct compile_state *state,
+static void ids_from_rstate(struct compile_state *state,
struct reg_state *rstate)
{
struct triple *ins, *first;
@@ -20091,14 +20091,14 @@ static void allocate_registers(struct compile_state *state)
tangles = correct_tangles(state, rstate.blocks);
} while(tangles);
-
+
print_blocks(state, "resolve_tangles", state->dbgout);
verify_consistency(state);
-
+
/* Allocate and initialize the live ranges */
initialize_live_ranges(state, &rstate);
- /* Note currently doing coalescing in a loop appears to
+ /* Note currently doing coalescing in a loop appears to
* buys me nothing. The code is left this way in case
* there is some value in it. Or if a future bugfix
* yields some benefit.
@@ -20113,18 +20113,18 @@ static void allocate_registers(struct compile_state *state)
/* Compute the interference graph */
walk_variable_lifetimes(
- state, &state->bb, rstate.blocks,
+ state, &state->bb, rstate.blocks,
graph_ins, &rstate);
-
+
/* Display the interference graph if desired */
if (state->compiler->debug & DEBUG_INTERFERENCE) {
print_interference_blocks(state, &rstate, state->dbgout, 1);
fprintf(state->dbgout, "\nlive variables by instruction\n");
walk_variable_lifetimes(
- state, &state->bb, rstate.blocks,
+ state, &state->bb, rstate.blocks,
print_interference_ins, &rstate);
}
-
+
coalesced = coalesce_live_ranges(state, &rstate);
if (state->compiler->debug & DEBUG_COALESCING) {
@@ -20138,13 +20138,13 @@ static void allocate_registers(struct compile_state *state)
# endif
/* Verify the interference graph */
walk_variable_lifetimes(
- state, &state->bb, rstate.blocks,
+ state, &state->bb, rstate.blocks,
verify_graph_ins, &rstate);
# if 0
fprintf(state->errout, "verify_graph_ins done\n");
#endif
#endif
-
+
/* Build the groups low and high. But with the nodes
* first sorted by degree order.
*/
@@ -20164,13 +20164,13 @@ static void allocate_registers(struct compile_state *state)
struct live_range *range;
next = &(*point)->group_next;
range = *point;
-
+
/* If it has a low degree or it already has a color
* place the node in low.
*/
if ((range->degree < regc_max_size(state, range->classes)) ||
(range->color != REG_UNSET)) {
- cgdebug_printf(state, "Lo: %5d degree %5d%s\n",
+ cgdebug_printf(state, "Lo: %5d degree %5d%s\n",
range - rstate.lr, range->degree,
(range->color != REG_UNSET) ? " (colored)": "");
*range->group_prev = range->group_next;
@@ -20187,7 +20187,7 @@ static void allocate_registers(struct compile_state *state)
next = point;
}
else {
- cgdebug_printf(state, "hi: %5d degree %5d%s\n",
+ cgdebug_printf(state, "hi: %5d degree %5d%s\n",
range - rstate.lr, range->degree,
(range->color != REG_UNSET) ? " (colored)": "");
}
@@ -20280,7 +20280,7 @@ static int is_lattice_lo(struct compile_state *state, struct lattice_node *lnode
return (lnode->val != lnode->def) && !is_scc_const(state, lnode->val);
}
-static void scc_add_fedge(struct compile_state *state, struct scc_state *scc,
+static void scc_add_fedge(struct compile_state *state, struct scc_state *scc,
struct flow_edge *fedge)
{
if (state->compiler->debug & DEBUG_SCC_TRANSFORM2) {
@@ -20410,12 +20410,12 @@ static void initialize_scc_state(
ins_count, ssa_edge_count, state->bb.last_vertex);
}
scc->ins_count = ins_count;
- scc->lattice =
+ scc->lattice =
xcmalloc(sizeof(*scc->lattice)*(ins_count + 1), "lattice");
- scc->ssa_edges =
+ scc->ssa_edges =
xcmalloc(sizeof(*scc->ssa_edges)*(ssa_edge_count + 1), "ssa_edges");
- scc->flow_blocks =
- xcmalloc(sizeof(*scc->flow_blocks)*(state->bb.last_vertex + 1),
+ scc->flow_blocks =
+ xcmalloc(sizeof(*scc->flow_blocks)*(state->bb.last_vertex + 1),
"flow_blocks");
/* Initialize pass one collect up the nodes */
@@ -20554,7 +20554,7 @@ static void initialize_scc_state(
fedge->out_next = 0;
fedge->executable = 0;
fedge->dst->in = fedge;
-
+
/* Initialize the work lists */
scc->flow_work_list = 0;
scc->ssa_work_list = 0;
@@ -20566,7 +20566,7 @@ static void initialize_scc_state(
}
}
-
+
static void free_scc_state(
struct compile_state *state, struct scc_state *scc)
{
@@ -20582,7 +20582,7 @@ static void free_scc_state(
xfree(scc->flow_blocks);
xfree(scc->ssa_edges);
xfree(scc->lattice);
-
+
}
static struct lattice_node *triple_to_lattice(
@@ -20611,7 +20611,7 @@ static struct triple *preserve_lval(
return old;
}
-static int lval_changed(struct compile_state *state,
+static int lval_changed(struct compile_state *state,
struct triple *old, struct lattice_node *lnode)
{
int changed;
@@ -20646,7 +20646,7 @@ static void scc_debug_lnode(
struct triple *val, **expr;
val = lnode->val? lnode->val : lnode->def;
fprintf(fp, "%p %s %3d %10s (",
- lnode->def,
+ lnode->def,
((lnode->def->op == OP_PHI)? "phi: ": "expr:"),
lnode->def->id,
tops(lnode->def->op));
@@ -20674,7 +20674,7 @@ static int compute_lnode_val(struct compile_state *state, struct scc_state *scc,
struct triple *old, *scratch;
struct triple **dexpr, **vexpr;
int count, i;
-
+
/* Store the original value */
old = preserve_lval(state, lnode);
@@ -20731,9 +20731,9 @@ static int compute_lnode_val(struct compile_state *state, struct scc_state *scc,
lnode->val = 0; /* Lattice low by definition */
}
/* Find the case when I am lattice high */
- if (lnode->val &&
+ if (lnode->val &&
(lnode->val->op == lnode->def->op) &&
- (memcmp(lnode->val->param, lnode->def->param,
+ (memcmp(lnode->val->param, lnode->def->param,
count * sizeof(lnode->val->param[0])) == 0) &&
(memcmp(&lnode->val->u, &lnode->def->u, sizeof(lnode->def->u)) == 0)) {
lnode->val = lnode->def;
@@ -20756,7 +20756,7 @@ static int compute_lnode_val(struct compile_state *state, struct scc_state *scc,
}
}
/* Find the cases that are always lattice lo */
- if (lnode->val &&
+ if (lnode->val &&
triple_is_def(state, lnode->val) &&
!triple_is_pure(state, lnode->val, lnode->old_id)) {
lnode->val = 0;
@@ -20764,7 +20764,7 @@ static int compute_lnode_val(struct compile_state *state, struct scc_state *scc,
/* See if the lattice value has changed */
changed = lval_changed(state, old, lnode);
/* See if this value should not change */
- if ((lnode->val != lnode->def) &&
+ if ((lnode->val != lnode->def) &&
(( !triple_is_def(state, lnode->def) &&
!triple_is_cbranch(state, lnode->def)) ||
(lnode->def->op == OP_PIECE))) {
@@ -20781,7 +20781,7 @@ static int compute_lnode_val(struct compile_state *state, struct scc_state *scc,
if (lnode->val != scratch) {
xfree(scratch);
}
-
+
return changed;
}
@@ -20808,7 +20808,7 @@ static void scc_visit_cbranch(struct compile_state *state, struct scc_state *scc
fprintf(fp, "%s: %d (",
tops(lnode->def->op),
lnode->def->id);
-
+
for(fedge = lnode->fblock->out; fedge; fedge = fedge->out_next) {
fprintf(fp, " %d", fedge->dst->block->vertex);
}
@@ -20856,7 +20856,7 @@ static void scc_visit_cbranch(struct compile_state *state, struct scc_state *scc
}
-static void scc_add_sedge_dst(struct compile_state *state,
+static void scc_add_sedge_dst(struct compile_state *state,
struct scc_state *scc, struct ssa_edge *sedge)
{
if (triple_is_cbranch(state, sedge->dst->def)) {
@@ -20867,7 +20867,7 @@ static void scc_add_sedge_dst(struct compile_state *state,
}
}
-static void scc_visit_phi(struct compile_state *state, struct scc_state *scc,
+static void scc_visit_phi(struct compile_state *state, struct scc_state *scc,
struct lattice_node *lnode)
{
struct lattice_node *tmp;
@@ -20887,7 +20887,7 @@ static void scc_visit_phi(struct compile_state *state, struct scc_state *scc,
index = 0;
for(fedge = lnode->fblock->in; fedge; index++, fedge = fedge->in_next) {
if (state->compiler->debug & DEBUG_SCC_TRANSFORM) {
- fprintf(state->errout, "Examining edge: %d vertex: %d executable: %d\n",
+ fprintf(state->errout, "Examining edge: %d vertex: %d executable: %d\n",
index,
fedge->dst->block->vertex,
fedge->executable
@@ -20975,14 +20975,14 @@ static void scc_writeback_values(
struct flow_edge *fedge;
int executable;
executable = 0;
- for(fedge = lnode->fblock->in;
+ for(fedge = lnode->fblock->in;
!executable && fedge; fedge = fedge->in_next) {
executable |= fedge->executable;
}
if (executable) {
internal_warning(state, lnode->def,
"lattice node %d %s->%s still high?",
- ins->id,
+ ins->id,
tops(lnode->def->op),
tops(lnode->val->op));
}
@@ -20998,7 +20998,7 @@ static void scc_writeback_values(
mkconst(state, ins, lnode->val->u.cval);
break;
case OP_ADDRCONST:
- mkaddr_const(state, ins,
+ mkaddr_const(state, ins,
MISC(lnode->val, 0), lnode->val->u.cval);
break;
default:
@@ -21057,9 +21057,9 @@ static void scc_transform(struct compile_state *state)
reps++;
}
}
-
+
if (state->compiler->debug & DEBUG_SCC_TRANSFORM) {
- fprintf(state->errout, "vertex: %d reps: %d\n",
+ fprintf(state->errout, "vertex: %d reps: %d\n",
block->vertex, reps);
}
@@ -21112,11 +21112,11 @@ static void scc_transform(struct compile_state *state)
}
}
}
-
+
scc_writeback_values(state, &scc);
free_scc_state(state, &scc);
rebuild_ssa_form(state);
-
+
print_blocks(state, __func__, state->dbgout);
}
@@ -21129,7 +21129,7 @@ static void transform_to_arch_instructions(struct compile_state *state)
do {
ins = transform_to_arch_instruction(state, ins);
} while(ins != first);
-
+
print_blocks(state, __func__, state->dbgout);
}
@@ -21200,7 +21200,7 @@ static void verify_uses(struct compile_state *state)
}
ins = ins->next;
} while(ins != first);
-
+
}
static void verify_blocks_present(struct compile_state *state)
{
@@ -21214,14 +21214,14 @@ static void verify_blocks_present(struct compile_state *state)
valid_ins(state, ins);
if (triple_stores_block(state, ins)) {
if (!ins->u.block) {
- internal_error(state, ins,
+ internal_error(state, ins,
"%p not in a block?", ins);
}
}
ins = ins->next;
} while(ins != first);
-
-
+
+
}
static int edge_present(struct compile_state *state, struct block *block, struct triple *edge)
@@ -21306,12 +21306,12 @@ static void verify_blocks(struct compile_state *state)
}
}
if (block->users != users) {
- internal_error(state, block->first,
+ internal_error(state, block->first,
"computed users %d != stored users %d",
users, block->users);
}
if (!triple_stores_block(state, block->last->next)) {
- internal_error(state, block->last->next,
+ internal_error(state, block->last->next,
"cannot find next block");
}
block = block->last->next->u.block;
@@ -21333,7 +21333,7 @@ static void verify_domination(struct compile_state *state)
if (!state->bb.first_block) {
return;
}
-
+
first = state->first;
ins = first;
do {
@@ -21360,7 +21360,7 @@ static void verify_domination(struct compile_state *state)
bset = bset->next;
}
if (!bset) {
- internal_error(state, set->member,
+ internal_error(state, set->member,
"no edge for phi rhs %d", i);
}
use_point = bset->member->last;
@@ -21369,11 +21369,11 @@ static void verify_domination(struct compile_state *state)
if (use_point &&
!tdominates(state, ins, use_point)) {
if (is_const(ins)) {
- internal_warning(state, ins,
+ internal_warning(state, ins,
"non dominated rhs use point %p?", use_point);
}
else {
- internal_error(state, ins,
+ internal_error(state, ins,
"non dominated rhs use point %p?", use_point);
}
}
@@ -21438,7 +21438,7 @@ static void verify_piece(struct compile_state *state)
static void verify_ins_colors(struct compile_state *state)
{
struct triple *first, *ins;
-
+
first = state->first;
ins = first;
do {
@@ -21555,7 +21555,7 @@ static void verify_consistency(struct compile_state *state)
fprintf(state->dbgout, "consistency verified\n");
}
}
-#else
+#else
static void verify_consistency(struct compile_state *state) {}
#endif /* DEBUG_CONSISTENCY */
@@ -21668,7 +21668,7 @@ static void print_op_asm(struct compile_state *state,
param);
}
piece = (param < lhs)? LHS(ins, param) : RHS(ins, param - lhs);
- fprintf(fp, "%s",
+ fprintf(fp, "%s",
arch_reg_str(ID_REG(piece->id)));
ptr = next -1;
}
@@ -21928,14 +21928,14 @@ static int arch_regcm_intersect(unsigned regcm1, unsigned regcm2)
{
/* See if two register classes may have overlapping registers */
unsigned gpr_mask = REGCM_GPR8 | REGCM_GPR8_LO | REGCM_GPR16_8 | REGCM_GPR16 |
- REGCM_GPR32_8 | REGCM_GPR32 |
+ REGCM_GPR32_8 | REGCM_GPR32 |
REGCM_DIVIDEND32 | REGCM_DIVIDEND64;
/* Special case for the immediates */
if ((regcm1 & (REGCM_IMM32 | REGCM_IMM16 | REGCM_IMM8)) &&
((regcm1 & ~(REGCM_IMM32 | REGCM_IMM16 | REGCM_IMM8)) == 0) &&
(regcm2 & (REGCM_IMM32 | REGCM_IMM16 | REGCM_IMM8)) &&
- ((regcm2 & ~(REGCM_IMM32 | REGCM_IMM16 | REGCM_IMM8)) == 0)) {
+ ((regcm2 & ~(REGCM_IMM32 | REGCM_IMM16 | REGCM_IMM8)) == 0)) {
return 0;
}
return (regcm1 & regcm2) ||
@@ -21968,7 +21968,7 @@ static void arch_reg_equivs(
*equiv++ = REG_DXAX;
*equiv++ = REG_EDXEAX;
break;
- case REG_BL:
+ case REG_BL:
#if X86_4_8BIT_GPRS
*equiv++ = REG_BH;
#endif
@@ -22028,19 +22028,19 @@ static void arch_reg_equivs(
*equiv++ = REG_BH;
*equiv++ = REG_EBX;
break;
- case REG_CX:
+ case REG_CX:
*equiv++ = REG_CL;
*equiv++ = REG_CH;
*equiv++ = REG_ECX;
break;
- case REG_DX:
+ case REG_DX:
*equiv++ = REG_DL;
*equiv++ = REG_DH;
*equiv++ = REG_EDX;
*equiv++ = REG_DXAX;
*equiv++ = REG_EDXEAX;
break;
- case REG_SI:
+ case REG_SI:
*equiv++ = REG_ESI;
break;
case REG_DI:
@@ -22076,19 +22076,19 @@ static void arch_reg_equivs(
*equiv++ = REG_DXAX;
*equiv++ = REG_EDXEAX;
break;
- case REG_ESI:
+ case REG_ESI:
*equiv++ = REG_SI;
break;
- case REG_EDI:
+ case REG_EDI:
*equiv++ = REG_DI;
break;
- case REG_EBP:
+ case REG_EBP:
*equiv++ = REG_BP;
break;
- case REG_ESP:
+ case REG_ESP:
*equiv++ = REG_SP;
break;
- case REG_DXAX:
+ case REG_DXAX:
*equiv++ = REG_AL;
*equiv++ = REG_AH;
*equiv++ = REG_DL;
@@ -22099,7 +22099,7 @@ static void arch_reg_equivs(
*equiv++ = REG_EDX;
*equiv++ = REG_EDXEAX;
break;
- case REG_EDXEAX:
+ case REG_EDXEAX:
*equiv++ = REG_AL;
*equiv++ = REG_AH;
*equiv++ = REG_DL;
@@ -22111,15 +22111,15 @@ static void arch_reg_equivs(
*equiv++ = REG_DXAX;
break;
}
- *equiv++ = REG_UNSET;
+ *equiv++ = REG_UNSET;
}
static unsigned arch_avail_mask(struct compile_state *state)
{
unsigned avail_mask;
/* REGCM_GPR8 is not available */
- avail_mask = REGCM_GPR8_LO | REGCM_GPR16_8 | REGCM_GPR16 |
- REGCM_GPR32 | REGCM_GPR32_8 |
+ avail_mask = REGCM_GPR8_LO | REGCM_GPR16_8 | REGCM_GPR16 |
+ REGCM_GPR32 | REGCM_GPR32_8 |
REGCM_DIVIDEND32 | REGCM_DIVIDEND64 |
REGCM_IMM32 | REGCM_IMM16 | REGCM_IMM8 | REGCM_FLAGS;
if (state->arch->features & X86_MMX_REGS) {
@@ -22162,7 +22162,7 @@ static unsigned arch_regcm_reg_normalize(struct compile_state *state, unsigned r
/* Remove the immediate register classes */
regcm &= ~(REGCM_IMM32 | REGCM_IMM16 | REGCM_IMM8);
return regcm;
-
+
}
static unsigned arch_reg_regcm(struct compile_state *state, int reg)
@@ -22306,7 +22306,7 @@ static struct reg_info arch_reg_clobber(
return result;
}
-static int do_select_reg(struct compile_state *state,
+static int do_select_reg(struct compile_state *state,
char *used, int reg, unsigned classes)
{
unsigned mask;
@@ -22331,7 +22331,7 @@ static int arch_select_free_register(
* increase the odds the register allocator will work when
* it guesses first give out registers from register classes
* least likely to run out of registers.
- *
+ *
*/
int i, reg;
reg = REG_UNSET;
@@ -22366,7 +22366,7 @@ static int arch_select_free_register(
}
-static unsigned arch_type_to_regcm(struct compile_state *state, struct type *type)
+static unsigned arch_type_to_regcm(struct compile_state *state, struct type *type)
{
#if DEBUG_ROMCC_WARNINGS
@@ -22376,13 +22376,13 @@ static unsigned arch_type_to_regcm(struct compile_state *state, struct type *typ
mask = 0;
switch(type->type & TYPE_MASK) {
case TYPE_ARRAY:
- case TYPE_VOID:
- mask = 0;
+ case TYPE_VOID:
+ mask = 0;
break;
case TYPE_CHAR:
case TYPE_UCHAR:
mask = REGCM_GPR8 | REGCM_GPR8_LO |
- REGCM_GPR16 | REGCM_GPR16_8 |
+ REGCM_GPR16 | REGCM_GPR16_8 |
REGCM_GPR32 | REGCM_GPR32_8 |
REGCM_DIVIDEND32 | REGCM_DIVIDEND64 |
REGCM_MMX | REGCM_XMM |
@@ -22433,7 +22433,7 @@ static int is_imm32(struct triple *imm)
{
return ((imm->op == OP_INTCONST) && (imm->u.cval <= 0xffffffffUL)) ||
(imm->op == OP_ADDRCONST);
-
+
}
static int is_imm16(struct triple *imm)
{
@@ -22549,13 +22549,13 @@ static int get_imm8(struct triple *ins, struct triple **expr)
#endif
#define COPY8_REGCM (REGCM_DIVIDEND64 | REGCM_DIVIDEND32 | REGCM_GPR32 | REGCM_GPR16 | REGCM_GPR8_LO | REGCM_MMX | REGCM_XMM)
-#define COPY16_REGCM (REGCM_DIVIDEND64 | REGCM_DIVIDEND32 | REGCM_GPR32 | REGCM_GPR16 | REGCM_MMX | REGCM_XMM)
+#define COPY16_REGCM (REGCM_DIVIDEND64 | REGCM_DIVIDEND32 | REGCM_GPR32 | REGCM_GPR16 | REGCM_MMX | REGCM_XMM)
#define COPY32_REGCM (REGCM_DIVIDEND64 | REGCM_DIVIDEND32 | REGCM_GPR32 | REGCM_MMX | REGCM_XMM)
static struct ins_template templates[] = {
[TEMPLATE_NOP] = {
- .lhs = {
+ .lhs = {
[ 0] = { REG_UNNEEDED, REGCM_IMMALL },
[ 1] = { REG_UNNEEDED, REGCM_IMMALL },
[ 2] = { REG_UNNEEDED, REGCM_IMMALL },
@@ -22622,10 +22622,10 @@ static struct ins_template templates[] = {
[63] = { REG_UNNEEDED, REGCM_IMMALL },
},
},
- [TEMPLATE_INTCONST8] = {
+ [TEMPLATE_INTCONST8] = {
.lhs = { [0] = { REG_UNNEEDED, REGCM_IMM8 } },
},
- [TEMPLATE_INTCONST32] = {
+ [TEMPLATE_INTCONST32] = {
.lhs = { [0] = { REG_UNNEEDED, REGCM_IMM32 } },
},
[TEMPLATE_UNKNOWNVAL] = {
@@ -22655,32 +22655,32 @@ static struct ins_template templates[] = {
.lhs = { [0] = { REG_UNSET, COPY32_REGCM } },
.rhs = { [0] = { REG_UNNEEDED, REGCM_IMM32 | REGCM_IMM16 | REGCM_IMM8 } },
},
- [TEMPLATE_PHI8] = {
+ [TEMPLATE_PHI8] = {
.lhs = { [0] = { REG_VIRT0, COPY8_REGCM } },
.rhs = { [0] = { REG_VIRT0, COPY8_REGCM } },
},
- [TEMPLATE_PHI16] = {
+ [TEMPLATE_PHI16] = {
.lhs = { [0] = { REG_VIRT0, COPY16_REGCM } },
- .rhs = { [0] = { REG_VIRT0, COPY16_REGCM } },
+ .rhs = { [0] = { REG_VIRT0, COPY16_REGCM } },
},
- [TEMPLATE_PHI32] = {
+ [TEMPLATE_PHI32] = {
.lhs = { [0] = { REG_VIRT0, COPY32_REGCM } },
- .rhs = { [0] = { REG_VIRT0, COPY32_REGCM } },
+ .rhs = { [0] = { REG_VIRT0, COPY32_REGCM } },
},
[TEMPLATE_STORE8] = {
- .rhs = {
+ .rhs = {
[0] = { REG_UNSET, REGCM_GPR32 },
[1] = { REG_UNSET, REGCM_GPR8_LO },
},
},
[TEMPLATE_STORE16] = {
- .rhs = {
+ .rhs = {
[0] = { REG_UNSET, REGCM_GPR32 },
[1] = { REG_UNSET, REGCM_GPR16 },
},
},
[TEMPLATE_STORE32] = {
- .rhs = {
+ .rhs = {
[0] = { REG_UNSET, REGCM_GPR32 },
[1] = { REG_UNSET, REGCM_GPR32 },
},
@@ -22699,84 +22699,84 @@ static struct ins_template templates[] = {
},
[TEMPLATE_BINARY8_REG] = {
.lhs = { [0] = { REG_VIRT0, REGCM_GPR8_LO } },
- .rhs = {
+ .rhs = {
[0] = { REG_VIRT0, REGCM_GPR8_LO },
[1] = { REG_UNSET, REGCM_GPR8_LO },
},
},
[TEMPLATE_BINARY16_REG] = {
.lhs = { [0] = { REG_VIRT0, REGCM_GPR16 } },
- .rhs = {
+ .rhs = {
[0] = { REG_VIRT0, REGCM_GPR16 },
[1] = { REG_UNSET, REGCM_GPR16 },
},
},
[TEMPLATE_BINARY32_REG] = {
.lhs = { [0] = { REG_VIRT0, REGCM_GPR32 } },
- .rhs = {
+ .rhs = {
[0] = { REG_VIRT0, REGCM_GPR32 },
[1] = { REG_UNSET, REGCM_GPR32 },
},
},
[TEMPLATE_BINARY8_IMM] = {
.lhs = { [0] = { REG_VIRT0, REGCM_GPR8_LO } },
- .rhs = {
+ .rhs = {
[0] = { REG_VIRT0, REGCM_GPR8_LO },
[1] = { REG_UNNEEDED, REGCM_IMM8 },
},
},
[TEMPLATE_BINARY16_IMM] = {
.lhs = { [0] = { REG_VIRT0, REGCM_GPR16 } },
- .rhs = {
+ .rhs = {
[0] = { REG_VIRT0, REGCM_GPR16 },
[1] = { REG_UNNEEDED, REGCM_IMM16 },
},
},
[TEMPLATE_BINARY32_IMM] = {
.lhs = { [0] = { REG_VIRT0, REGCM_GPR32 } },
- .rhs = {
+ .rhs = {
[0] = { REG_VIRT0, REGCM_GPR32 },
[1] = { REG_UNNEEDED, REGCM_IMM32 },
},
},
[TEMPLATE_SL8_CL] = {
.lhs = { [0] = { REG_VIRT0, REGCM_GPR8_LO } },
- .rhs = {
+ .rhs = {
[0] = { REG_VIRT0, REGCM_GPR8_LO },
[1] = { REG_CL, REGCM_GPR8_LO },
},
},
[TEMPLATE_SL16_CL] = {
.lhs = { [0] = { REG_VIRT0, REGCM_GPR16 } },
- .rhs = {
+ .rhs = {
[0] = { REG_VIRT0, REGCM_GPR16 },
[1] = { REG_CL, REGCM_GPR8_LO },
},
},
[TEMPLATE_SL32_CL] = {
.lhs = { [0] = { REG_VIRT0, REGCM_GPR32 } },
- .rhs = {
+ .rhs = {
[0] = { REG_VIRT0, REGCM_GPR32 },
[1] = { REG_CL, REGCM_GPR8_LO },
},
},
[TEMPLATE_SL8_IMM] = {
.lhs = { [0] = { REG_VIRT0, REGCM_GPR8_LO } },
- .rhs = {
+ .rhs = {
[0] = { REG_VIRT0, REGCM_GPR8_LO },
[1] = { REG_UNNEEDED, REGCM_IMM8 },
},
},
[TEMPLATE_SL16_IMM] = {
.lhs = { [0] = { REG_VIRT0, REGCM_GPR16 } },
- .rhs = {
+ .rhs = {
[0] = { REG_VIRT0, REGCM_GPR16 },
[1] = { REG_UNNEEDED, REGCM_IMM8 },
},
},
[TEMPLATE_SL32_IMM] = {
.lhs = { [0] = { REG_VIRT0, REGCM_GPR32 } },
- .rhs = {
+ .rhs = {
[0] = { REG_VIRT0, REGCM_GPR32 },
[1] = { REG_UNNEEDED, REGCM_IMM8 },
},
@@ -22858,19 +22858,19 @@ static struct ins_template templates[] = {
.rhs = { [0] = { REG_UNSET, REGCM_GPR32 } },
},
[TEMPLATE_INB_DX] = {
- .lhs = { [0] = { REG_AL, REGCM_GPR8_LO } },
+ .lhs = { [0] = { REG_AL, REGCM_GPR8_LO } },
.rhs = { [0] = { REG_DX, REGCM_GPR16 } },
},
[TEMPLATE_INB_IMM] = {
- .lhs = { [0] = { REG_AL, REGCM_GPR8_LO } },
+ .lhs = { [0] = { REG_AL, REGCM_GPR8_LO } },
.rhs = { [0] = { REG_UNNEEDED, REGCM_IMM8 } },
},
- [TEMPLATE_INW_DX] = {
- .lhs = { [0] = { REG_AX, REGCM_GPR16 } },
+ [TEMPLATE_INW_DX] = {
+ .lhs = { [0] = { REG_AX, REGCM_GPR16 } },
.rhs = { [0] = { REG_DX, REGCM_GPR16 } },
},
- [TEMPLATE_INW_IMM] = {
- .lhs = { [0] = { REG_AX, REGCM_GPR16 } },
+ [TEMPLATE_INW_IMM] = {
+ .lhs = { [0] = { REG_AX, REGCM_GPR16 } },
.rhs = { [0] = { REG_UNNEEDED, REGCM_IMM8 } },
},
[TEMPLATE_INL_DX] = {
@@ -22881,19 +22881,19 @@ static struct ins_template templates[] = {
.lhs = { [0] = { REG_EAX, REGCM_GPR32 } },
.rhs = { [0] = { REG_UNNEEDED, REGCM_IMM8 } },
},
- [TEMPLATE_OUTB_DX] = {
+ [TEMPLATE_OUTB_DX] = {
.rhs = {
[0] = { REG_AL, REGCM_GPR8_LO },
[1] = { REG_DX, REGCM_GPR16 },
},
},
- [TEMPLATE_OUTB_IMM] = {
+ [TEMPLATE_OUTB_IMM] = {
.rhs = {
- [0] = { REG_AL, REGCM_GPR8_LO },
+ [0] = { REG_AL, REGCM_GPR8_LO },
[1] = { REG_UNNEEDED, REGCM_IMM8 },
},
},
- [TEMPLATE_OUTW_DX] = {
+ [TEMPLATE_OUTW_DX] = {
.rhs = {
[0] = { REG_AX, REGCM_GPR16 },
[1] = { REG_DX, REGCM_GPR16 },
@@ -22901,19 +22901,19 @@ static struct ins_template templates[] = {
},
[TEMPLATE_OUTW_IMM] = {
.rhs = {
- [0] = { REG_AX, REGCM_GPR16 },
+ [0] = { REG_AX, REGCM_GPR16 },
[1] = { REG_UNNEEDED, REGCM_IMM8 },
},
},
- [TEMPLATE_OUTL_DX] = {
+ [TEMPLATE_OUTL_DX] = {
.rhs = {
[0] = { REG_EAX, REGCM_GPR32 },
[1] = { REG_DX, REGCM_GPR16 },
},
},
- [TEMPLATE_OUTL_IMM] = {
+ [TEMPLATE_OUTL_IMM] = {
.rhs = {
- [0] = { REG_EAX, REGCM_GPR32 },
+ [0] = { REG_EAX, REGCM_GPR32 },
[1] = { REG_UNNEEDED, REGCM_IMM8 },
},
},
@@ -22922,7 +22922,7 @@ static struct ins_template templates[] = {
.rhs = { [0] = { REG_UNSET, REGCM_GPR32 } },
},
[TEMPLATE_RDMSR] = {
- .lhs = {
+ .lhs = {
[0] = { REG_EAX, REGCM_GPR32 },
[1] = { REG_EDX, REGCM_GPR32 },
},
@@ -22937,27 +22937,27 @@ static struct ins_template templates[] = {
},
[TEMPLATE_UMUL8] = {
.lhs = { [0] = { REG_AX, REGCM_GPR16 } },
- .rhs = {
+ .rhs = {
[0] = { REG_AL, REGCM_GPR8_LO },
[1] = { REG_UNSET, REGCM_GPR8_LO },
},
},
[TEMPLATE_UMUL16] = {
.lhs = { [0] = { REG_DXAX, REGCM_DIVIDEND32 } },
- .rhs = {
+ .rhs = {
[0] = { REG_AX, REGCM_GPR16 },
[1] = { REG_UNSET, REGCM_GPR16 },
},
},
[TEMPLATE_UMUL32] = {
.lhs = { [0] = { REG_EDXEAX, REGCM_DIVIDEND64 } },
- .rhs = {
+ .rhs = {
[0] = { REG_EAX, REGCM_GPR32 },
[1] = { REG_UNSET, REGCM_GPR32 },
},
},
[TEMPLATE_DIV8] = {
- .lhs = {
+ .lhs = {
[0] = { REG_AL, REGCM_GPR8_LO },
[1] = { REG_AH, REGCM_GPR8 },
},
@@ -22967,7 +22967,7 @@ static struct ins_template templates[] = {
},
},
[TEMPLATE_DIV16] = {
- .lhs = {
+ .lhs = {
[0] = { REG_AX, REGCM_GPR16 },
[1] = { REG_DX, REGCM_GPR16 },
},
@@ -22977,7 +22977,7 @@ static struct ins_template templates[] = {
},
},
[TEMPLATE_DIV32] = {
- .lhs = {
+ .lhs = {
[0] = { REG_EAX, REGCM_GPR32 },
[1] = { REG_EDX, REGCM_GPR32 },
},
@@ -22998,7 +22998,7 @@ static void fixup_branch(struct compile_state *state,
}
test = pre_triple(state, branch,
cmp_op, cmp_type, left, right);
- test->template_id = TEMPLATE_TEST32;
+ test->template_id = TEMPLATE_TEST32;
if (cmp_op == OP_CMP) {
test->template_id = TEMPLATE_CMP32_REG;
if (get_imm32(test, &RHS(test, 1))) {
@@ -23032,13 +23032,13 @@ static void fixup_branches(struct compile_state *state,
right = RHS(cmp, 1);
}
branch = entry->member;
- fixup_branch(state, branch, jmp_op,
+ fixup_branch(state, branch, jmp_op,
cmp->op, cmp->type, left, right);
}
}
}
-static void bool_cmp(struct compile_state *state,
+static void bool_cmp(struct compile_state *state,
struct triple *ins, int cmp_op, int jmp_op, int set_op)
{
struct triple_set *entry, *next;
@@ -23105,7 +23105,7 @@ struct reg_info arch_reg_lhs(struct compile_state *state, struct triple *ins, in
break;
default:
if (ins->template_id > LAST_TEMPLATE) {
- internal_error(state, ins, "bad template number %d",
+ internal_error(state, ins, "bad template number %d",
ins->template_id);
}
template = &templates[ins->template_id];
@@ -23140,7 +23140,7 @@ struct reg_info arch_reg_rhs(struct compile_state *state, struct triple *ins, in
/* Fall through */
default:
if (ins->template_id > LAST_TEMPLATE) {
- internal_error(state, ins, "bad template number %d",
+ internal_error(state, ins, "bad template number %d",
ins->template_id);
}
template = &templates[ins->template_id];
@@ -23158,7 +23158,7 @@ static struct triple *mod_div(struct compile_state *state,
struct triple *ins, int div_op, int index)
{
struct triple *div, *piece0, *piece1;
-
+
/* Generate the appropriate division instruction */
div = post_triple(state, ins, div_op, ins->type, 0, 0);
RHS(div, 0) = RHS(ins, 0);
@@ -23468,8 +23468,8 @@ static struct triple *transform_to_arch_instruction(
case OP_NEG:
ins->template_id = TEMPLATE_UNARY32;
break;
- case OP_EQ:
- bool_cmp(state, ins, OP_CMP, OP_JMP_EQ, OP_SET_EQ);
+ case OP_EQ:
+ bool_cmp(state, ins, OP_CMP, OP_JMP_EQ, OP_SET_EQ);
break;
case OP_NOTEQ:
bool_cmp(state, ins, OP_CMP, OP_JMP_NOTEQ, OP_SET_NOTEQ);
@@ -23509,7 +23509,7 @@ static struct triple *transform_to_arch_instruction(
ins->template_id = TEMPLATE_NOP;
break;
case OP_CBRANCH:
- fixup_branch(state, ins, OP_JMP_NOTEQ, OP_TEST,
+ fixup_branch(state, ins, OP_JMP_NOTEQ, OP_TEST,
RHS(ins, 0)->type, RHS(ins, 0), 0);
break;
case OP_CALL:
@@ -23615,20 +23615,20 @@ static void generate_local_labels(struct compile_state *state)
first = state->first;
label = first;
do {
- if ((label->op == OP_LABEL) ||
+ if ((label->op == OP_LABEL) ||
(label->op == OP_SDECL)) {
if (label->use) {
label->u.cval = next_label(state);
} else {
label->u.cval = 0;
}
-
+
}
label = label->next;
} while(label != first);
}
-static int check_reg(struct compile_state *state,
+static int check_reg(struct compile_state *state,
struct triple *triple, int classes)
{
unsigned mask;
@@ -23659,7 +23659,7 @@ static const char *arch_regs[] = {
"%edx:%eax",
"%dx:%ax",
"%mm0", "%mm1", "%mm2", "%mm3", "%mm4", "%mm5", "%mm6", "%mm7",
- "%xmm0", "%xmm1", "%xmm2", "%xmm3",
+ "%xmm0", "%xmm1", "%xmm2", "%xmm3",
"%xmm4", "%xmm5", "%xmm6", "%xmm7",
};
static const char *arch_reg_str(int reg)
@@ -23718,7 +23718,7 @@ static int reg_size(struct compile_state *state, struct triple *ins)
}
return arch_reg_size(reg);
}
-
+
const char *type_suffix(struct compile_state *state, struct type *type)
@@ -23741,7 +23741,7 @@ static void print_const_val(
{
switch(ins->op) {
case OP_INTCONST:
- fprintf(fp, " $%ld ",
+ fprintf(fp, " $%ld ",
(long)(ins->u.cval));
break;
case OP_ADDRCONST:
@@ -23754,7 +23754,7 @@ static void print_const_val(
internal_error(state, ins, "unlabeled constant");
}
fprintf(fp, " $L%s%lu+%lu ",
- state->compiler->label_prefix,
+ state->compiler->label_prefix,
(unsigned long)(MISC(ins, 0)->u.cval),
(unsigned long)(ins->u.cval));
break;
@@ -23772,12 +23772,12 @@ static void print_const(struct compile_state *state,
switch(ins->type->type & TYPE_MASK) {
case TYPE_CHAR:
case TYPE_UCHAR:
- fprintf(fp, ".byte 0x%02lx\n",
+ fprintf(fp, ".byte 0x%02lx\n",
(unsigned long)(ins->u.cval));
break;
case TYPE_SHORT:
case TYPE_USHORT:
- fprintf(fp, ".short 0x%04lx\n",
+ fprintf(fp, ".short 0x%04lx\n",
(unsigned long)(ins->u.cval));
break;
case TYPE_INT:
@@ -23785,7 +23785,7 @@ static void print_const(struct compile_state *state,
case TYPE_LONG:
case TYPE_ULONG:
case TYPE_POINTER:
- fprintf(fp, ".int %lu\n",
+ fprintf(fp, ".int %lu\n",
(unsigned long)(ins->u.cval));
break;
default:
@@ -23795,7 +23795,7 @@ static void print_const(struct compile_state *state,
internal_error(state, ins, "Unknown constant type. Val: %lu",
(unsigned long)(ins->u.cval));
}
-
+
break;
case OP_ADDRCONST:
if ((MISC(ins, 0)->op != OP_SDECL) &&
@@ -23867,7 +23867,7 @@ static long get_mask_pool_ref(
}
static void print_binary_op(struct compile_state *state,
- const char *op, struct triple *ins, FILE *fp)
+ const char *op, struct triple *ins, FILE *fp)
{
unsigned mask;
mask = REGCM_GPR32 | REGCM_GPR16 | REGCM_GPR8_LO;
@@ -23894,7 +23894,7 @@ static void print_binary_op(struct compile_state *state,
reg(state, RHS(ins, 0), mask));
}
}
-static void print_unary_op(struct compile_state *state,
+static void print_unary_op(struct compile_state *state,
const char *op, struct triple *ins, FILE *fp)
{
unsigned mask;
@@ -23958,7 +23958,7 @@ static void print_op_in(struct compile_state *state, struct triple *ins, FILE *f
internal_error(state, ins, "src != %%dx");
}
fprintf(fp, "\t%s %s, %s\n",
- op,
+ op,
reg(state, RHS(ins, 0), REGCM_GPR16),
reg(state, ins, mask));
}
@@ -23984,7 +23984,7 @@ static void print_op_out(struct compile_state *state, struct triple *ins, FILE *
internal_error(state, ins, "src != %%eax");
}
if (is_const(RHS(ins, 1))) {
- fprintf(fp, "\t%s %s,",
+ fprintf(fp, "\t%s %s,",
op, reg(state, RHS(ins, 0), mask));
print_const_val(state, RHS(ins, 1), fp);
fprintf(fp, "\n");
@@ -23996,7 +23996,7 @@ static void print_op_out(struct compile_state *state, struct triple *ins, FILE *
internal_error(state, ins, "dst != %%dx");
}
fprintf(fp, "\t%s %s, %s\n",
- op,
+ op,
reg(state, RHS(ins, 0), mask),
reg(state, RHS(ins, 1), REGCM_GPR16));
}
@@ -24046,7 +24046,7 @@ static void print_op_move(struct compile_state *state,
src_regcm = arch_reg_regcm(state, src_reg);
dst_regcm = arch_reg_regcm(state, dst_reg);
/* If the class is the same just move the register */
- if (src_regcm & dst_regcm &
+ if (src_regcm & dst_regcm &
(REGCM_GPR8_LO | REGCM_GPR16 | REGCM_GPR32)) {
if ((src_reg != dst_reg) || !omit_copy) {
fprintf(fp, "\tmov %s, %s\n",
@@ -24060,7 +24060,7 @@ static void print_op_move(struct compile_state *state,
src_reg = (src_reg - REGC_GPR32_FIRST) + REGC_GPR16_FIRST;
if ((src_reg != dst_reg) || !omit_copy) {
fprintf(fp, "\tmovw %s, %s\n",
- arch_reg_str(src_reg),
+ arch_reg_str(src_reg),
arch_reg_str(dst_reg));
}
}
@@ -24097,7 +24097,7 @@ static void print_op_move(struct compile_state *state,
}
}
/* Move 8/16bit to 16/32bit */
- else if ((src_regcm & (REGCM_GPR8_LO | REGCM_GPR16)) &&
+ else if ((src_regcm & (REGCM_GPR8_LO | REGCM_GPR16)) &&
(dst_regcm & (REGCM_GPR16 | REGCM_GPR32))) {
const char *op;
op = is_signed(src->type)? "movsx": "movzx";
@@ -24169,7 +24169,7 @@ static void print_op_move(struct compile_state *state,
const char *extend;
extend = is_signed(src->type)? "cltd":"movl $0, %edx";
fprintf(fp, "\tmov %s, %%eax\n\t%s\n",
- arch_reg_str(src_reg),
+ arch_reg_str(src_reg),
extend);
}
/* Move from 64bit gpr to gpr */
@@ -24177,7 +24177,7 @@ static void print_op_move(struct compile_state *state,
(dst_regcm & (REGCM_GPR32 | REGCM_GPR16 | REGCM_GPR8_LO))) {
if (dst_regcm & REGCM_GPR32) {
src_reg = REG_EAX;
- }
+ }
else if (dst_regcm & REGCM_GPR16) {
src_reg = REG_AX;
}
@@ -24382,19 +24382,19 @@ static void print_op_move(struct compile_state *state,
}
if (dst_regcm & (REGCM_GPR32 | REGCM_GPR16 | REGCM_GPR8_LO)) {
- fprintf(fp, "\tshl $%d, %s\n",
- shift_bits,
+ fprintf(fp, "\tshl $%d, %s\n",
+ shift_bits,
reg(state, dst, REGCM_GPR32 | REGCM_GPR16 | REGCM_GPR8_LO));
- fprintf(fp, "\tsar $%d, %s\n",
- shift_bits,
+ fprintf(fp, "\tsar $%d, %s\n",
+ shift_bits,
reg(state, dst, REGCM_GPR32 | REGCM_GPR16 | REGCM_GPR8_LO));
}
else if (dst_regcm & (REGCM_MMX | REGCM_XMM)) {
fprintf(fp, "\tpslld $%d, %s\n",
- shift_bits,
+ shift_bits,
reg(state, dst, REGCM_MMX | REGCM_XMM));
fprintf(fp, "\tpsrad $%d, %s\n",
- shift_bits,
+ shift_bits,
reg(state, dst, REGCM_MMX | REGCM_XMM));
}
else {
@@ -24425,7 +24425,7 @@ static void print_op_load(struct compile_state *state,
case TYPE_INT: case TYPE_UINT:
case TYPE_LONG: case TYPE_ULONG:
case TYPE_POINTER:
- op = "movl";
+ op = "movl";
break;
default:
internal_error(state, ins, "unknown type in load");
@@ -24433,7 +24433,7 @@ static void print_op_load(struct compile_state *state,
break;
}
fprintf(fp, "\t%s (%s), %s\n",
- op,
+ op,
reg(state, src, REGCM_GPR32),
reg(state, dst, REGCM_GPR32));
}
@@ -24468,8 +24468,8 @@ static void print_op_store(struct compile_state *state,
reg(state, src, REGCM_GPR8_LO | REGCM_GPR16 | REGCM_GPR32),
reg(state, dst, REGCM_GPR32));
}
-
-
+
+
}
static void print_op_smul(struct compile_state *state,
@@ -24570,7 +24570,7 @@ static void print_op_branch(struct compile_state *state,
internal_error(state, branch, "Invalid branch op");
break;
}
-
+
}
#if 1
if (branch->op == OP_CALL) {
@@ -24578,7 +24578,7 @@ static void print_op_branch(struct compile_state *state,
}
#endif
fprintf(fp, "\t%s L%s%lu\n",
- bop,
+ bop,
state->compiler->label_prefix,
(unsigned long)(TARG(branch, 0)->u.cval));
}
@@ -24624,19 +24624,19 @@ static void print_op_set(struct compile_state *state,
sop, reg(state, set, REGCM_GPR8_LO));
}
-static void print_op_bit_scan(struct compile_state *state,
- struct triple *ins, FILE *fp)
+static void print_op_bit_scan(struct compile_state *state,
+ struct triple *ins, FILE *fp)
{
const char *op;
switch(ins->op) {
case OP_BSF: op = "bsf"; break;
case OP_BSR: op = "bsr"; break;
- default:
+ default:
internal_error(state, ins, "unknown bit scan");
op = 0;
break;
}
- fprintf(fp,
+ fprintf(fp,
"\t%s %s, %s\n"
"\tjnz 1f\n"
"\tmovl $-1, %s\n"
@@ -24653,18 +24653,18 @@ static void print_sdecl(struct compile_state *state,
{
fprintf(fp, ".section \"" DATA_SECTION "\"\n");
fprintf(fp, ".balign %ld\n", (long int)align_of_in_bytes(state, ins->type));
- fprintf(fp, "L%s%lu:\n",
+ fprintf(fp, "L%s%lu:\n",
state->compiler->label_prefix, (unsigned long)(ins->u.cval));
print_const(state, MISC(ins, 0), fp);
fprintf(fp, ".section \"" TEXT_SECTION "\"\n");
-
+
}
static void print_instruction(struct compile_state *state,
struct triple *ins, FILE *fp)
{
/* Assumption: after I have exted the register allocator
- * everything is in a valid register.
+ * everything is in a valid register.
*/
switch(ins->op) {
case OP_ASM:
@@ -24696,7 +24696,7 @@ static void print_instruction(struct compile_state *state,
case OP_SDECL:
print_sdecl(state, ins, fp);
break;
- case OP_COPY:
+ case OP_COPY:
case OP_CONVERT:
print_op_move(state, ins, fp);
break;
@@ -24731,10 +24731,10 @@ static void print_instruction(struct compile_state *state,
print_op_set(state, ins, fp);
break;
case OP_INB: case OP_INW: case OP_INL:
- print_op_in(state, ins, fp);
+ print_op_in(state, ins, fp);
break;
case OP_OUTB: case OP_OUTW: case OP_OUTL:
- print_op_out(state, ins, fp);
+ print_op_out(state, ins, fp);
break;
case OP_BSF:
case OP_BSR:
@@ -24763,7 +24763,7 @@ static void print_instruction(struct compile_state *state,
if (!ins->use) {
return;
}
- fprintf(fp, "L%s%lu:\n",
+ fprintf(fp, "L%s%lu:\n",
state->compiler->label_prefix, (unsigned long)(ins->u.cval));
break;
case OP_ADECL:
@@ -24810,7 +24810,7 @@ static void print_instructions(struct compile_state *state)
first = state->first;
ins = first;
do {
- if (print_location &&
+ if (print_location &&
last_occurance != ins->occurance) {
if (!ins->occurance->parent) {
fprintf(fp, "\t/* %s,%s:%d.%d */\n",
@@ -24857,7 +24857,7 @@ static void generate_code(struct compile_state *state)
{
generate_local_labels(state);
print_instructions(state);
-
+
}
static void print_preprocessed_tokens(struct compile_state *state)
@@ -24878,7 +24878,7 @@ static void print_preprocessed_tokens(struct compile_state *state)
break;
}
tk = eat(state, tok);
- token_str =
+ token_str =
tk->ident ? tk->ident->name :
tk->str_len ? tk->val.str :
tokens[tk->tok];
@@ -24887,8 +24887,8 @@ static void print_preprocessed_tokens(struct compile_state *state)
while(file->macro && file->prev) {
file = file->prev;
}
- if (!file->macro &&
- ((file->line != line) || (file->basename != filename)))
+ if (!file->macro &&
+ ((file->line != line) || (file->basename != filename)))
{
int i, col;
if ((file->basename == filename) &&
@@ -24909,9 +24909,9 @@ static void print_preprocessed_tokens(struct compile_state *state)
fprintf(fp, " ");
}
}
-
+
fprintf(fp, "%s ", token_str);
-
+
if (state->compiler->debug & DEBUG_TOKENS) {
loc(state->dbgout, state, 0);
fprintf(state->dbgout, "%s <- `%s'\n",
@@ -25009,8 +25009,8 @@ static void compile(const char *filename, const char *includefile,
/* Exit the global definition scope */
end_scope(&state);
- /* Now that basic compilation has happened
- * optimize the intermediate code
+ /* Now that basic compilation has happened
+ * optimize the intermediate code
*/
optimize(&state);
@@ -25067,8 +25067,8 @@ int main(int argc, char **argv)
struct compiler_state compiler;
struct arch_state arch;
int all_opts;
-
-
+
+
/* I don't want any surprises */
setlocale(LC_ALL, "C");
diff --git a/SerialICE/util/xmmstack.c b/SerialICE/util/xmmstack.c
index 7dcc041..8a14a95 100644
--- a/SerialICE/util/xmmstack.c
+++ b/SerialICE/util/xmmstack.c
@@ -109,7 +109,7 @@ int main(int argc,char **argv)
int param;
int inapp;
- if (argc<2)
+ if (argc<2)
{
printf("Usage: \n\txmmstack [-xmm] [-mmx] file.s\nThis program is for use with:\n"
"\tgcc -fomit-frame-pointer -fno-stack-protector *.c\n"
@@ -552,7 +552,7 @@ getxmml:\n\
);
while(!feof(f))
- {
+ {
*buf=0;
fgets(buf,sizeof(buf)-1,f);
chomp(buf);len=strlen(buf);
@@ -616,7 +616,7 @@ getxmml:\n\
case 2:fprintf(w,"jmp getxmmw\n");break;
case 4:fprintf(w,"jmp getxmml\n");break;
}
- if (!strcmp(find[2],"%eax")||!strcmp(find[2],"%ax")||!strcmp(find[2],"%al"))
+ if (!strcmp(find[2],"%eax")||!strcmp(find[2],"%ax")||!strcmp(find[2],"%al"))
{
fprintf(w,"movl %%edx,%%esp #NOSTACK\n");
fprintf(w,"movl %%dr0,%%edx #NOSTACK\n");
@@ -669,7 +669,7 @@ getxmml:\n\
case 2:fprintf(w,"%s %%ax,%s\n",find[1],find[3]);break;
case 4:fprintf(w,"%s %%eax,%s\n",find[1],find[3]);break;
}
- if (strcmp(find[3],"%eax")&&strcmp(find[3],"%ax")&&strcmp(find[3],"%al"))
+ if (strcmp(find[3],"%eax")&&strcmp(find[3],"%ax")&&strcmp(find[3],"%al"))
//Nota, només pot ser un registre, (tot ha de ser const, ni malloc's ni res)
fprintf(w,"movl %%dr0,%%eax #NOSTACK\n");
continue;
@@ -737,7 +737,7 @@ getxmml:\n\
fprintf(w,"movl $.+10,%%esp\n");
fprintf(w,"jmp docall\n");
fprintf(w,"movl %%dr0,%%eax #NOSTACK\n");
- fprintf(w,".byte 0xe9\n.long %s-4-. #NOSTACK\n",find[1]);//jmp, not works with .global??? gcc???
+ fprintf(w,".byte 0xe9\n.long %s-4-. #NOSTACK\n",find[1]);//jmp, not works with .global??? gcc???
continue;
}
if (regexp("^(rep\\s*;\\s*|)ret$",buf,len,find))
@@ -753,7 +753,7 @@ getxmml:\n\
fprintf(w,"movl %%eax,%%esp\n");
fprintf(w,"movl %%dr0,%%eax #NOSTACK\n");
fprintf(w,"jmp *%%esp #NOSTACK\n");
-
+
continue;
}
fprintf(w,"%s\n",buf);
@@ -763,5 +763,3 @@ getxmml:\n\
return 0;
}
-
-
Edward O'Callaghan (eocallaghan(a)alterapraxis.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/5215
-gerrit
commit 0dcae57b00ff7e9a356df15dc51e06844ac1aec6
Author: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
Date: Fri Feb 14 01:53:18 2014 +1100
SerialICE/Makefile: Create gitconfig target.
Provide for gitconfig Makefile target and some example pre-commit lint
check hooks.
Change-Id: I49ce2791f740089f5867fe2221cbbbd1e1c6a8a7
Signed-off-by: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
---
Makefile | 34 +++++++
util/gitconfig/commit-msg | 173 +++++++++++++++++++++++++++++++++++
util/gitconfig/pre-commit | 2 +
util/lint/lint-000-license-headers | 35 +++++++
util/lint/lint-stable-003-whitespace | 44 +++++++++
5 files changed, 288 insertions(+)
diff --git a/Makefile b/Makefile
index 46d4657..95d2bb1 100644
--- a/Makefile
+++ b/Makefile
@@ -60,3 +60,37 @@ buildall:
mv build build-$$board; \
done
+#######################################################################
+# Development utilities
+lint lint-stable:
+ FAILED=0; LINTLOG=`mktemp .tmpconfig.lintXXXXX`; \
+ for script in util/lint/$@-*; do \
+ echo; echo `basename $$script`; \
+ grep "^# DESCR:" $$script | sed "s,.*DESCR: *,," ; \
+ echo ========; \
+ $$script > $$LINTLOG; \
+ if [ `cat $$LINTLOG | wc -l` -eq 0 ]; then \
+ printf "success\n\n"; \
+ else \
+ echo test failed: ; \
+ cat $$LINTLOG; \
+ rm -f $$LINTLOG; \
+ FAILED=$$(( $$FAILED + 1 )); \
+ fi; \
+ echo ========; \
+ done; \
+ test $$FAILED -eq 0 || { echo "ERROR: $$FAILED test(s) failed." && exit 1; }; \
+ rm -f $$LINTLOG
+
+gitconfig:
+ mkdir -p .git/hooks
+ for hook in commit-msg pre-commit ; do \
+ if [ util/gitconfig/$$hook -nt .git/hooks/$$hook -o \
+ ! -x .git/hooks/$$hook ]; then \
+ cp util/gitconfig/$$hook .git/hooks/$$hook; \
+ chmod +x .git/hooks/$$hook; \
+ fi; \
+ done
+ git config remote.origin.push HEAD:refs/for/master
+ (git config --global user.name >/dev/null && git config --global user.email >/dev/null) || (printf 'Please configure your name and email in git:\n\n git config --global user.name "Your Name Comes Here"\n git config --global user.email your.email(a)example.com\n'; exit 1)
+
diff --git a/util/gitconfig/commit-msg b/util/gitconfig/commit-msg
new file mode 100755
index 0000000..82f0581
--- /dev/null
+++ b/util/gitconfig/commit-msg
@@ -0,0 +1,173 @@
+#!/bin/sh
+#
+# Part of Gerrit Code Review (http://code.google.com/p/gerrit/ )
+#
+# Copyright (C) 2009 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+CHANGE_ID_AFTER="Bug|Issue"
+MSG="$1"
+
+# Check for, and add if missing, a unique Change-Id
+#
+add_ChangeId() {
+ clean_message=`sed -e '
+ /^diff --git a\/.*/{
+ s///
+ q
+ }
+ /^Signed-off-by:/d
+ /^#/d
+ ' "$MSG" | git stripspace`
+ if test -z "$clean_message"
+ then
+ return
+ fi
+
+ # Does Change-Id: already exist? if so, exit (no change).
+ if grep -i '^Change-Id: I[0-9a-f]\{40\}$' "$MSG" >/dev/null
+ then
+ return
+ fi
+
+ id=`_gen_ChangeId`
+ T="$MSG.tmp.$$"
+ AWK=awk
+ if [ -x /usr/xpg4/bin/awk ]; then
+ # Solaris AWK is just too broken
+ AWK=/usr/xpg4/bin/awk
+ fi
+
+ # How this works:
+ # - parse the commit message as (textLine+ blankLine*)*
+ # - assume textLine+ to be a footer until proven otherwise
+ # - exception: the first block is not footer (as it is the title)
+ # - read textLine+ into a variable
+ # - then count blankLines
+ # - once the next textLine appears, print textLine+ blankLine* as these
+ # aren't footer
+ # - in END, the last textLine+ block is available for footer parsing
+ $AWK '
+ BEGIN {
+ # while we start with the assumption that textLine+
+ # is a footer, the first block is not.
+ isFooter = 0
+ footerComment = 0
+ blankLines = 0
+ }
+
+ # Skip lines starting with "#" without any spaces before it.
+ /^#/ { next }
+
+ # Skip the line starting with the diff command and everything after it,
+ # up to the end of the file, assuming it is only patch data.
+ # If more than one line before the diff was empty, strip all but one.
+ /^diff --git a/ {
+ blankLines = 0
+ while (getline) { }
+ next
+ }
+
+ # Count blank lines outside footer comments
+ /^$/ && (footerComment == 0) {
+ blankLines++
+ next
+ }
+
+ # Catch footer comment
+ /^\[[a-zA-Z0-9-]+:/ && (isFooter == 1) {
+ footerComment = 1
+ }
+
+ /]$/ && (footerComment == 1) {
+ footerComment = 2
+ }
+
+ # We have a non-blank line after blank lines. Handle this.
+ (blankLines > 0) {
+ print lines
+ for (i = 0; i < blankLines; i++) {
+ print ""
+ }
+
+ lines = ""
+ blankLines = 0
+ isFooter = 1
+ footerComment = 0
+ }
+
+ # Detect that the current block is not the footer
+ (footerComment == 0) && (!/^\[?[a-zA-Z0-9-]+:/ || /^[a-zA-Z0-9-]+:\/\//) {
+ isFooter = 0
+ }
+
+ {
+ # We need this information about the current last comment line
+ if (footerComment == 2) {
+ footerComment = 0
+ }
+ if (lines != "") {
+ lines = lines "\n";
+ }
+ lines = lines $0
+ }
+
+ # Footer handling:
+ # If the last block is considered a footer, splice in the Change-Id at the
+ # right place.
+ # Look for the right place to inject Change-Id by considering
+ # CHANGE_ID_AFTER. Keys listed in it (case insensitive) come first,
+ # then Change-Id, then everything else (eg. Signed-off-by:).
+ #
+ # Otherwise just print the last block, a new line and the Change-Id as a
+ # block of its own.
+ END {
+ unprinted = 1
+ if (isFooter == 0) {
+ print lines "\n"
+ lines = ""
+ }
+ changeIdAfter = "^(" tolower("'"$CHANGE_ID_AFTER"'") "):"
+ numlines = split(lines, footer, "\n")
+ for (line = 1; line <= numlines; line++) {
+ if (unprinted && match(tolower(footer[line]), changeIdAfter) != 1) {
+ unprinted = 0
+ print "Change-Id: I'"$id"'"
+ }
+ print footer[line]
+ }
+ if (unprinted) {
+ print "Change-Id: I'"$id"'"
+ }
+ }' "$MSG" > $T && mv $T "$MSG" || rm -f $T
+}
+_gen_ChangeIdInput() {
+ echo "tree `git write-tree`"
+ if parent=`git rev-parse "HEAD^0" 2>/dev/null`
+ then
+ echo "parent $parent"
+ fi
+ echo "author `git var GIT_AUTHOR_IDENT`"
+ echo "committer `git var GIT_COMMITTER_IDENT`"
+ echo
+ printf '%s' "$clean_message"
+}
+_gen_ChangeId() {
+ _gen_ChangeIdInput |
+ git hash-object -t commit --stdin
+}
+
+
+add_ChangeId
diff --git a/util/gitconfig/pre-commit b/util/gitconfig/pre-commit
new file mode 100755
index 0000000..8ab3e56
--- /dev/null
+++ b/util/gitconfig/pre-commit
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec make lint-stable
diff --git a/util/lint/lint-000-license-headers b/util/lint/lint-000-license-headers
new file mode 100755
index 0000000..9165aa6
--- /dev/null
+++ b/util/lint/lint-000-license-headers
@@ -0,0 +1,35 @@
+#!/bin/sh
+# This file is part of the coreboot project.
+#
+# Copyright (C) 2010 coresystems GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
+#
+# DESCR: Check that all files in src/ and util/ have valid license headers
+
+LC_ALL=C export LC_ALL
+find SerialICE util -name .git -type d -prune -o \
+ -name README -prune -o \
+ -name LICENSE -prune -o \
+ -name TODO -prune -o \
+ -name COPYING -prune -o \
+ -name microcode-\*.h -prune -o \
+ -name \*.[18] -prune -o \
+ -name romcc -type d -prune -o \
+ -name crossgcc -type d -prune -o \
+ -name vendorcode -type d -prune -o \
+ -type f -exec \
+ grep -L "51 Franklin St, Fifth Floor, Boston" {} + | \
+ sed -e "s,^.*$,File & has no valid GPL header.,"
diff --git a/util/lint/lint-stable-003-whitespace b/util/lint/lint-stable-003-whitespace
new file mode 100755
index 0000000..c2f5b3c
--- /dev/null
+++ b/util/lint/lint-stable-003-whitespace
@@ -0,0 +1,44 @@
+#!/bin/sh
+# This file is part of the coreboot project.
+#
+# Copyright (C) 2011 Patrick Georgi <patrick(a)georgi-clan.de>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
+# DESCR: Check for superfluous whitespace in the tree
+
+LC_ALL=C export LC_ALL
+find SerialICE util -name .git -type d -prune -o \
+ -type f -perm /111 -prune -o \
+ -name README -prune -o \
+ -name LICENSE -prune -o \
+ -name TODO -prune -o \
+ -name COPYING -prune -o \
+ -name \*.patch -prune -o \
+ -name \*.diff -prune -o \
+ -name \*.txt -prune -o \
+ -name \*.exe -prune -o \
+ -name \*.o -prune -o \
+ -name microcode-\*.h -prune -o \
+ -name \*.?_shipped -prune -o \
+ -name \*.[18] -prune -o \
+ -name \*~ -prune -o \
+ -name kconfig -type d -prune -o \
+ -name romcc -type d -prune -o \
+ -name crossgcc -type d -prune -o \
+ -name vendorcode -type d -prune -o \
+ -type f -exec \
+ grep -l "[[:space:]][[:space:]]*$" {} + | \
+ sed -e "s,^.*$,File & has lines ending with whitespace.,"
+
Edward O'Callaghan (eocallaghan(a)alterapraxis.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/5221
-gerrit
commit 2c56c294655af1ae87b3d151d7fc362ddaf80862
Author: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
Date: Fri Feb 14 19:30:38 2014 +1100
SerialICE: Remove superfluous whitespace in the tree.
Change-Id: I14cf959ff4601ede921b8086e460fc36bb40bc4f
Signed-off-by: Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
---
SerialICE/Makefile | 6 +-
SerialICE/README.GDB | 12 +-
SerialICE/README.SHELL | 5 +-
SerialICE/chipset.c | 2 +-
SerialICE/io.h | 2 +-
SerialICE/mainboard/amd_serengeti-cheetah.c | 2 +-
SerialICE/mainboard/asrock_939a785gmh.c | 2 +-
SerialICE/mainboard/asus_k8v-x.c | 2 +-
SerialICE/mainboard/asus_m2v-mx_se.c | 2 +-
SerialICE/mainboard/asus_m4a77td-pro.c | 6 +-
SerialICE/mainboard/asus_p2b.c | 2 +-
SerialICE/mainboard/dell_s1850.c | 10 +-
SerialICE/mainboard/hp_dl165_g6.c | 2 +-
SerialICE/mainboard/intel_d94x.c | 2 +-
SerialICE/mainboard/kontron_986lcd-m.c | 2 +-
SerialICE/mainboard/msi_ms6178.c | 2 +-
SerialICE/mainboard/rca_rm4100.c | 4 +-
SerialICE/mainboard/roda_rk886ex.c | 2 +-
SerialICE/mainboard/televideo_tc7010.c | 2 +-
SerialICE/mainboard/thomson_ip1000.c | 2 +-
SerialICE/mainboard/tyan_s2912.c | 2 +-
SerialICE/mainboard/wyse_s50.c | 4 +-
SerialICE/serial.c | 6 +-
SerialICE/serialice.c | 4 +-
SerialICE/serialice.h | 2 +-
SerialICE/serialice.ld | 2 +-
SerialICE/simba/replay.lua | 4 +-
SerialICE/start.S | 2 +-
SerialICE/types.h | 2 +-
SerialICE/util/kconfig/lex.zconf.c_shipped | 82 +-
SerialICE/util/kconfig/lxdialog/BIG.FAT.WARNING | 2 +-
SerialICE/util/kconfig/lxdialog/menubox.c | 2 +-
SerialICE/util/kconfig/regex.c | 556 ++++-----
SerialICE/util/kconfig/regex.h | 22 +-
SerialICE/util/kconfig/zconf.tab.c_shipped | 2 +-
SerialICE/util/romcc.c | 1396 +++++++++++------------
SerialICE/util/xmmstack.c | 14 +-
37 files changed, 1085 insertions(+), 1090 deletions(-)
diff --git a/SerialICE/Makefile b/SerialICE/Makefile
index f4a7580..e764992 100644
--- a/SerialICE/Makefile
+++ b/SerialICE/Makefile
@@ -1,5 +1,5 @@
##
-## SerialICE
+## SerialICE
##
## Copyright (C) 2009 coresystems GmbH
##
@@ -116,7 +116,7 @@ $(obj)/serialice.rom: $(obj)/serialice.elf
$(obj)/serialice.elf: $(obj)/serialice.o $(obj)/start.o $(src)/serialice.ld
$(Q)printf " LINK $(subst $(shell pwd)/,,$(@))\n"
- $(Q)$(CC) $(LDFLAGS) -o $@ $(obj)/serialice.o $(obj)/start.o
+ $(Q)$(CC) $(LDFLAGS) -o $@ $(obj)/serialice.o $(obj)/start.o
$(Q)$(NM) $@ | sort -u > $(obj)/serialice.map
$(obj)/serialice.S: $(SOURCES) $(obj)/romcc
@@ -143,7 +143,7 @@ $(obj)/serialice-gcc.rom: $(obj)/serialice-gcc.elf
$(obj)/serialice-gcc.elf: $(obj)/serialice-gcc.o $(obj)/start.o serialice.ld
$(Q)printf " LINK $(subst $(shell pwd)/,,$(@))\n"
- $(Q)$(CC) $(LDFLAGS) -o $@ $(obj)/serialice-gcc.o $(obj)/start.o
+ $(Q)$(CC) $(LDFLAGS) -o $@ $(obj)/serialice-gcc.o $(obj)/start.o
$(Q)$(NM) $@ | sort -u > $(obj)/serialice-gcc.map
$(obj)/serialice-pre.s: $(SOURCES) $(obj)/xmmstack
diff --git a/SerialICE/README.GDB b/SerialICE/README.GDB
index d842a05..3498a7a 100644
--- a/SerialICE/README.GDB
+++ b/SerialICE/README.GDB
@@ -52,9 +52,9 @@ To disassemble code at the current position, you can do this:
0xec23c: loop 0xec226
0xec23e: mov %bh,%al
0xec240: out %al,$0x61
-0xec242: ret
+0xec242: ret
0xec243: lcall $0xe5db,$0x1ac0
-(gdb)
+(gdb)
Now for the fun part:
@@ -78,7 +78,7 @@ ds 0x1838 6200
es 0x0 0
fs 0xe5db 58843
gs 0xe895 59541
-(gdb)
+(gdb)
Or, with a little bit of context:
(gdb) x/20i ($cs*16)+$eip - 0x10
@@ -88,7 +88,7 @@ Of course you can also change registers:
(gdb) set var $ecx=0x20
(gdb) print $ecx
$1 = 32
-(gdb)
+(gdb)
This is an excellent method to skip long loops.
@@ -101,12 +101,12 @@ Go back to the GDB shell at any time with CTRL-C
^C
Program received signal SIGINT, Interrupt.
0x000038d6 in ?? ()
-(gdb)
+(gdb)
(gdb) display /i ($cs * 16) + $pc
-That will output the current instruction each time you call nexti, stepi, etc.
+That will output the current instruction each time you call nexti, stepi, etc.
It's possible to trace execution with
diff --git a/SerialICE/README.SHELL b/SerialICE/README.SHELL
index 12fe7cd..909aa2b 100644
--- a/SerialICE/README.SHELL
+++ b/SerialICE/README.SHELL
@@ -13,7 +13,7 @@ meant to be used together with a SerialICE capable Qemu (See README.QEMU)
GETTING STARTED
---------------
-First, you have to compile the SerialICE shell for your mainboard.
+First, you have to compile the SerialICE shell for your mainboard.
Configure the SerialICE shell for your mainboard:
$ make menuconfig
@@ -30,7 +30,7 @@ LICENSE AND COPYRIGHT
---------------------
SerialICE mini shell is copyright (C) 2009 coresystems GmbH.
-It is released under the GNU General Public License version 2.
+It is released under the GNU General Public License version 2.
For questions contact <info(a)coresystems.de>
PORTING THE SHELL TO NEW MAINBOARDS
@@ -145,4 +145,3 @@ character command code.
SerialICE v1.5 (Nov 26 2009)
>
-
diff --git a/SerialICE/chipset.c b/SerialICE/chipset.c
index 8ab4515..c9f75ab 100644
--- a/SerialICE/chipset.c
+++ b/SerialICE/chipset.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 coresystems GmbH
*
diff --git a/SerialICE/io.h b/SerialICE/io.h
index a47feef..30accc2 100644
--- a/SerialICE/io.h
+++ b/SerialICE/io.h
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 coresystems GmbH
*
diff --git a/SerialICE/mainboard/amd_serengeti-cheetah.c b/SerialICE/mainboard/amd_serengeti-cheetah.c
index 78505ad..3179b62 100644
--- a/SerialICE/mainboard/amd_serengeti-cheetah.c
+++ b/SerialICE/mainboard/amd_serengeti-cheetah.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 Uwe Hermann <uwe(a)hermann-uwe.de>
* Copyright (C) 2010 Arne Georg Gleditsch <arne.gleditsch(a)numascale.com>
diff --git a/SerialICE/mainboard/asrock_939a785gmh.c b/SerialICE/mainboard/asrock_939a785gmh.c
index 6f8c9be..5c5b588 100644
--- a/SerialICE/mainboard/asrock_939a785gmh.c
+++ b/SerialICE/mainboard/asrock_939a785gmh.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2006 Uwe Hermann <uwe(a)hermann-uwe.de>
* Copyright (C) 2009 Rudolf Marek <r.marek(a)assembler.cz>
diff --git a/SerialICE/mainboard/asus_k8v-x.c b/SerialICE/mainboard/asus_k8v-x.c
index bc3dbe9..68ad177 100644
--- a/SerialICE/mainboard/asus_k8v-x.c
+++ b/SerialICE/mainboard/asus_k8v-x.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2006 Uwe Hermann <uwe(a)hermann-uwe.de>
* Copyright (C) 2009 Rudolf Marek <r.marek(a)assembler.cz>
diff --git a/SerialICE/mainboard/asus_m2v-mx_se.c b/SerialICE/mainboard/asus_m2v-mx_se.c
index cd694fd..06a8ec9 100644
--- a/SerialICE/mainboard/asus_m2v-mx_se.c
+++ b/SerialICE/mainboard/asus_m2v-mx_se.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2006 Uwe Hermann <uwe(a)hermann-uwe.de>
* Copyright (C) 2009 Rudolf Marek <r.marek(a)assembler.cz>
diff --git a/SerialICE/mainboard/asus_m4a77td-pro.c b/SerialICE/mainboard/asus_m4a77td-pro.c
index 6b91f80..3bc15a5 100644
--- a/SerialICE/mainboard/asus_m4a77td-pro.c
+++ b/SerialICE/mainboard/asus_m4a77td-pro.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2006 Uwe Hermann <uwe(a)hermann-uwe.de>
* Copyright (C) 2010 Rudolf Marek <r.marek(a)assembler.cz>
@@ -44,8 +44,8 @@ static void superio_init(void)
static void chipset_init(void)
{
/* stop the mainboard from rebooting */
- /* inspired by coreboot, src/southbridge/amd/sb700/sb700_early_init.c,
- * sb700_lpc_init(), where the comment says:
+ /* inspired by coreboot, src/southbridge/amd/sb700/sb700_early_init.c,
+ * sb700_lpc_init(), where the comment says:
* NOTE: Set BootTimerDisable, otherwise it would keep rebooting!!
* This bit has no meaning if debug strap is not enabled. So if the
* board keeps rebooting and the code fails to reach here, we could
diff --git a/SerialICE/mainboard/asus_p2b.c b/SerialICE/mainboard/asus_p2b.c
index c93045a..068229a 100644
--- a/SerialICE/mainboard/asus_p2b.c
+++ b/SerialICE/mainboard/asus_p2b.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 Mark Marshall <mark.marshall(a)csr.com>
*
diff --git a/SerialICE/mainboard/dell_s1850.c b/SerialICE/mainboard/dell_s1850.c
index b970650..861479f 100644
--- a/SerialICE/mainboard/dell_s1850.c
+++ b/SerialICE/mainboard/dell_s1850.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 coresystems GmbH
*
@@ -32,8 +32,8 @@ static void mainboard_set_ich5(void)
pci_write_config8(PCI_ADDR(0, 0x1f, 0, 0xe3), 0xc0);
pci_write_config8(PCI_ADDR(0, 0x1f, 0, 0xf0), 0x0);
/* disable certain devices -- see data sheet -- this is from
- * dell settings via lspci
- * Note that they leave SMBUS disabled -- 8f6f.
+ * dell settings via lspci
+ * Note that they leave SMBUS disabled -- 8f6f.
* we leave it enabled and visible in config space -- 8f66
*/
pci_write_config16(PCI_ADDR(0, 0x1f, 0, 0xf2), 0x8f66);
@@ -54,7 +54,7 @@ static void mainboard_set_ich5(void)
static inline void ibfzero(void)
{
- while(inb(ipmicsr) & IBF)
+ while(inb(ipmicsr) & IBF)
;
}
static inline void clearobf(void)
@@ -64,7 +64,7 @@ static inline void clearobf(void)
static inline void waitobf(void)
{
- while((inb(ipmicsr) & OBF) == 0)
+ while((inb(ipmicsr) & OBF) == 0)
;
}
diff --git a/SerialICE/mainboard/hp_dl165_g6.c b/SerialICE/mainboard/hp_dl165_g6.c
index 3301ad5..6aff1e9 100644
--- a/SerialICE/mainboard/hp_dl165_g6.c
+++ b/SerialICE/mainboard/hp_dl165_g6.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 Uwe Hermann <uwe(a)hermann-uwe.de>
* Copyright (C) 2010 Arne Georg Gleditsch <arne.gleditsch(a)numascale.com>
diff --git a/SerialICE/mainboard/intel_d94x.c b/SerialICE/mainboard/intel_d94x.c
index 02eb701..50bbe87 100644
--- a/SerialICE/mainboard/intel_d94x.c
+++ b/SerialICE/mainboard/intel_d94x.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 coresystems GmbH
*
diff --git a/SerialICE/mainboard/kontron_986lcd-m.c b/SerialICE/mainboard/kontron_986lcd-m.c
index 62d8c46..abde14f 100644
--- a/SerialICE/mainboard/kontron_986lcd-m.c
+++ b/SerialICE/mainboard/kontron_986lcd-m.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 coresystems GmbH
*
diff --git a/SerialICE/mainboard/msi_ms6178.c b/SerialICE/mainboard/msi_ms6178.c
index f0a505a..a4edb5a 100644
--- a/SerialICE/mainboard/msi_ms6178.c
+++ b/SerialICE/mainboard/msi_ms6178.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 Uwe Hermann <uwe(a)hermann-uwe.de>
*
diff --git a/SerialICE/mainboard/rca_rm4100.c b/SerialICE/mainboard/rca_rm4100.c
index 81ff089..bd4aa02 100644
--- a/SerialICE/mainboard/rca_rm4100.c
+++ b/SerialICE/mainboard/rca_rm4100.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 Joseph Smith <joe(a)settoplinux.org>
*
@@ -18,7 +18,7 @@
*/
/* This is a chipset init file for the RCA RM4100 mainboard */
-
+
const char boardname[33]="RCA RM4100 ";
/* Hardware specific functions */
diff --git a/SerialICE/mainboard/roda_rk886ex.c b/SerialICE/mainboard/roda_rk886ex.c
index 048f30d..b93b5c0 100644
--- a/SerialICE/mainboard/roda_rk886ex.c
+++ b/SerialICE/mainboard/roda_rk886ex.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 coresystems GmbH
*
diff --git a/SerialICE/mainboard/televideo_tc7010.c b/SerialICE/mainboard/televideo_tc7010.c
index 9c79e05..b22df9a 100644
--- a/SerialICE/mainboard/televideo_tc7010.c
+++ b/SerialICE/mainboard/televideo_tc7010.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2010 Peter Bannis
*
diff --git a/SerialICE/mainboard/thomson_ip1000.c b/SerialICE/mainboard/thomson_ip1000.c
index d558e42..ff20930 100644
--- a/SerialICE/mainboard/thomson_ip1000.c
+++ b/SerialICE/mainboard/thomson_ip1000.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 Joseph Smith <joe(a)settoplinux.org>
*
diff --git a/SerialICE/mainboard/tyan_s2912.c b/SerialICE/mainboard/tyan_s2912.c
index ad7184a..5afbc62 100644
--- a/SerialICE/mainboard/tyan_s2912.c
+++ b/SerialICE/mainboard/tyan_s2912.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 Uwe Hermann <uwe(a)hermann-uwe.de>
* Copyright (C) 2010 Arne Georg Gleditsch <arne.gleditsch(a)numascale.com>
diff --git a/SerialICE/mainboard/wyse_s50.c b/SerialICE/mainboard/wyse_s50.c
index d23d5a9..57a54c5 100644
--- a/SerialICE/mainboard/wyse_s50.c
+++ b/SerialICE/mainboard/wyse_s50.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2011 Nils Jacobs
*
@@ -117,4 +117,4 @@ cs5536_setup_extmsr();
cs5536_setup_iobase();
serial_init();
}
-
+
diff --git a/SerialICE/serial.c b/SerialICE/serial.c
index b5b0778..9188deb 100644
--- a/SerialICE/serial.c
+++ b/SerialICE/serial.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 coresystems GmbH
*
@@ -104,7 +104,7 @@ static void sio_put8(u8 data)
{
int i;
u8 c;
-
+
c = (data >> 4) & 0xf;
sio_put_nibble(c);
@@ -193,5 +193,3 @@ static u32 sio_get32(void)
return data;
}
-
-
diff --git a/SerialICE/serialice.c b/SerialICE/serialice.c
index 649ee11..56f6dac 100644
--- a/SerialICE/serialice.c
+++ b/SerialICE/serialice.c
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 coresystems GmbH
*
@@ -168,7 +168,7 @@ static void serialice_cpuinfo(void)
/* This code looks quite crappy but this way we don't
* have to worry about running out of registers if we
- * occupy eax, ebx, ecx, edx at the same time
+ * occupy eax, ebx, ecx, edx at the same time
*/
reg32 = cpuid_eax(eax, ecx);
sio_put32(reg32);
diff --git a/SerialICE/serialice.h b/SerialICE/serialice.h
index 40dae1c..ab8a26a 100644
--- a/SerialICE/serialice.h
+++ b/SerialICE/serialice.h
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 coresystems GmbH
*
diff --git a/SerialICE/serialice.ld b/SerialICE/serialice.ld
index 163a4c5..f43d9f2 100644
--- a/SerialICE/serialice.ld
+++ b/SerialICE/serialice.ld
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 coresystems GmbH
*
diff --git a/SerialICE/simba/replay.lua b/SerialICE/simba/replay.lua
index 4632c05..8ec3b0a 100644
--- a/SerialICE/simba/replay.lua
+++ b/SerialICE/simba/replay.lua
@@ -121,7 +121,7 @@ end
function parse_cpuid(line)
local id_op = "CPUID%: eax%: (%x+)%; ecx%: (%x+) => (%x+).(%x+).(%x+).(%x+)"
local id_op_old = "CPU%: CPUID eax%: (%x+)%; ecx%: (%x+) => (%x+).(%x+).(%x+).(%x+)"
- local found, idx0, idx1, eax, ebx, ecx, edx
+ local found, idx0, idx1, eax, ebx, ecx, edx
found, _, idx0, idx1, eax, ebx, ecx, edx = string.find(line, id_op)
if not found then
found, _, idx0, idx1, eax, ebx, ecx, edx = string.find(line, id_op_old)
@@ -196,7 +196,7 @@ function parse_file()
end
if not iplog then
- iplog, _, a, b, f, cs, eip, str =
+ iplog, _, a, b, f, cs, eip, str =
string.find(line, "(%x+)[%.:](%x+)%s+([^ ]*)%s+%[(%x+):(%x+)%]...(.*)")
if iplog and not f then
f = "R###"
diff --git a/SerialICE/start.S b/SerialICE/start.S
index 1e43f98..2ec0bb3 100644
--- a/SerialICE/start.S
+++ b/SerialICE/start.S
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 coresystems GmbH
*
diff --git a/SerialICE/types.h b/SerialICE/types.h
index a712b09..7ddeafa 100644
--- a/SerialICE/types.h
+++ b/SerialICE/types.h
@@ -1,5 +1,5 @@
/*
- * SerialICE
+ * SerialICE
*
* Copyright (C) 2009 coresystems GmbH
*
diff --git a/SerialICE/util/kconfig/lex.zconf.c_shipped b/SerialICE/util/kconfig/lex.zconf.c_shipped
index 1911092..a22db46 100644
--- a/SerialICE/util/kconfig/lex.zconf.c_shipped
+++ b/SerialICE/util/kconfig/lex.zconf.c_shipped
@@ -52,7 +52,7 @@
#if __STDC_VERSION__ >= 199901L
/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
- * if you want the limit (max/min) macros for int types.
+ * if you want the limit (max/min) macros for int types.
*/
#ifndef __STDC_LIMIT_MACROS
#define __STDC_LIMIT_MACROS 1
@@ -69,7 +69,7 @@ typedef uint32_t flex_uint32_t;
typedef signed char flex_int8_t;
typedef short int flex_int16_t;
typedef int flex_int32_t;
-typedef unsigned char flex_uint8_t;
+typedef unsigned char flex_uint8_t;
typedef unsigned short int flex_uint16_t;
typedef unsigned int flex_uint32_t;
#endif /* ! C99 */
@@ -179,7 +179,7 @@ extern FILE *zconfin, *zconfout;
#define EOB_ACT_LAST_MATCH 2
#define YY_LESS_LINENO(n)
-
+
/* Return all but the first "n" matched characters back to the input stream. */
#define yyless(n) \
do \
@@ -246,7 +246,7 @@ struct yy_buffer_state
int yy_bs_lineno; /**< The line count. */
int yy_bs_column; /**< The column count. */
-
+
/* Whether to try to fill the input buffer when we reach the
* end of it.
*/
@@ -866,7 +866,7 @@ extern int zconfwrap (void );
#endif
static void yyunput (int c,char *buf_ptr );
-
+
#ifndef yytext_ptr
static void yy_flex_strncpy (char *,yyconst char *,int );
#endif
@@ -971,7 +971,7 @@ YY_DECL
register yy_state_type yy_current_state;
register char *yy_cp, *yy_bp;
register int yy_act;
-
+
int str = 0;
int ts, i;
@@ -1574,7 +1574,7 @@ static int yy_get_next_buffer (void)
{
register yy_state_type yy_current_state;
register char *yy_cp;
-
+
yy_current_state = (yy_start);
for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
@@ -1593,7 +1593,7 @@ static int yy_get_next_buffer (void)
static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
{
register int yy_is_jam;
-
+
yy_current_state = yy_nxt[yy_current_state][1];
yy_is_jam = (yy_current_state <= 0);
@@ -1603,7 +1603,7 @@ static int yy_get_next_buffer (void)
static void yyunput (int c, register char * yy_bp )
{
register char *yy_cp;
-
+
yy_cp = (yy_c_buf_p);
/* undo effects of setting up zconftext */
@@ -1646,7 +1646,7 @@ static int yy_get_next_buffer (void)
{
int c;
-
+
*(yy_c_buf_p) = (yy_hold_char);
if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
@@ -1713,12 +1713,12 @@ static int yy_get_next_buffer (void)
/** Immediately switch to a different input stream.
* @param input_file A readable stream.
- *
+ *
* @note This function does not reset the start condition to @c INITIAL .
*/
void zconfrestart (FILE * input_file )
{
-
+
if ( ! YY_CURRENT_BUFFER ){
zconfensure_buffer_stack ();
YY_CURRENT_BUFFER_LVALUE =
@@ -1731,11 +1731,11 @@ static int yy_get_next_buffer (void)
/** Switch to a different input buffer.
* @param new_buffer The new input buffer.
- *
+ *
*/
void zconf_switch_to_buffer (YY_BUFFER_STATE new_buffer )
{
-
+
/* TODO. We should be able to replace this entire function body
* with
* zconfpop_buffer_state();
@@ -1775,13 +1775,13 @@ static void zconf_load_buffer_state (void)
/** Allocate and initialize an input buffer state.
* @param file A readable stream.
* @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
- *
+ *
* @return the allocated buffer state.
*/
YY_BUFFER_STATE zconf_create_buffer (FILE * file, int size )
{
YY_BUFFER_STATE b;
-
+
b = (YY_BUFFER_STATE) zconfalloc(sizeof( struct yy_buffer_state ) );
if ( ! b )
YY_FATAL_ERROR( "out of dynamic memory in zconf_create_buffer()" );
@@ -1804,11 +1804,11 @@ static void zconf_load_buffer_state (void)
/** Destroy the buffer.
* @param b a buffer created with zconf_create_buffer()
- *
+ *
*/
void zconf_delete_buffer (YY_BUFFER_STATE b )
{
-
+
if ( ! b )
return;
@@ -1829,7 +1829,7 @@ static void zconf_load_buffer_state (void)
{
int oerrno = errno;
-
+
zconf_flush_buffer(b );
b->yy_input_file = file;
@@ -1845,13 +1845,13 @@ static void zconf_load_buffer_state (void)
}
b->yy_is_interactive = 0;
-
+
errno = oerrno;
}
/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
* @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
- *
+ *
*/
void zconf_flush_buffer (YY_BUFFER_STATE b )
{
@@ -1880,7 +1880,7 @@ static void zconf_load_buffer_state (void)
* the current state. This function will allocate the stack
* if necessary.
* @param new_buffer The new state.
- *
+ *
*/
void zconfpush_buffer_state (YY_BUFFER_STATE new_buffer )
{
@@ -1910,7 +1910,7 @@ void zconfpush_buffer_state (YY_BUFFER_STATE new_buffer )
/** Removes and deletes the top of the stack, if present.
* The next element becomes the new top.
- *
+ *
*/
void zconfpop_buffer_state (void)
{
@@ -1934,7 +1934,7 @@ void zconfpop_buffer_state (void)
static void zconfensure_buffer_stack (void)
{
int num_to_alloc;
-
+
if (!(yy_buffer_stack)) {
/* First allocation is just for 2 elements, since we don't know if this
@@ -1973,13 +1973,13 @@ static void zconfensure_buffer_stack (void)
/** Setup the input buffer state to scan directly from a user-specified character buffer.
* @param base the character buffer
* @param size the size in bytes of the character buffer
- *
- * @return the newly allocated buffer state object.
+ *
+ * @return the newly allocated buffer state object.
*/
YY_BUFFER_STATE zconf_scan_buffer (char * base, yy_size_t size )
{
YY_BUFFER_STATE b;
-
+
if ( size < 2 ||
base[size-2] != YY_END_OF_BUFFER_CHAR ||
base[size-1] != YY_END_OF_BUFFER_CHAR )
@@ -2008,14 +2008,14 @@ YY_BUFFER_STATE zconf_scan_buffer (char * base, yy_size_t size )
/** Setup the input buffer state to scan a string. The next call to zconflex() will
* scan from a @e copy of @a str.
* @param str a NUL-terminated string to scan
- *
+ *
* @return the newly allocated buffer state object.
* @note If you want to scan bytes that may contain NUL values, then use
* zconf_scan_bytes() instead.
*/
YY_BUFFER_STATE zconf_scan_string (yyconst char * yystr )
{
-
+
return zconf_scan_bytes(yystr,strlen(yystr) );
}
@@ -2023,7 +2023,7 @@ YY_BUFFER_STATE zconf_scan_string (yyconst char * yystr )
* scan from a @e copy of @a bytes.
* @param bytes the byte buffer to scan
* @param len the number of bytes in the buffer pointed to by @a bytes.
- *
+ *
* @return the newly allocated buffer state object.
*/
YY_BUFFER_STATE zconf_scan_bytes (yyconst char * yybytes, int _yybytes_len )
@@ -2032,7 +2032,7 @@ YY_BUFFER_STATE zconf_scan_bytes (yyconst char * yybytes, int _yybytes_len )
char *buf;
yy_size_t n;
int i;
-
+
/* Get memory for full buffer, including space for trailing EOB's. */
n = _yybytes_len + 2;
buf = (char *) zconfalloc(n );
@@ -2086,16 +2086,16 @@ static void yy_fatal_error (yyconst char* msg )
/* Accessor methods (get/set functions) to struct members. */
/** Get the current line number.
- *
+ *
*/
int zconfget_lineno (void)
{
-
+
return zconflineno;
}
/** Get the input stream.
- *
+ *
*/
FILE *zconfget_in (void)
{
@@ -2103,7 +2103,7 @@ FILE *zconfget_in (void)
}
/** Get the output stream.
- *
+ *
*/
FILE *zconfget_out (void)
{
@@ -2111,7 +2111,7 @@ FILE *zconfget_out (void)
}
/** Get the length of the current token.
- *
+ *
*/
int zconfget_leng (void)
{
@@ -2119,7 +2119,7 @@ int zconfget_leng (void)
}
/** Get the current token.
- *
+ *
*/
char *zconfget_text (void)
@@ -2129,18 +2129,18 @@ char *zconfget_text (void)
/** Set the current line number.
* @param line_number
- *
+ *
*/
void zconfset_lineno (int line_number )
{
-
+
zconflineno = line_number;
}
/** Set the input stream. This does not discard the current
* input buffer.
* @param in_str A readable stream.
- *
+ *
* @see zconf_switch_to_buffer
*/
void zconfset_in (FILE * in_str )
@@ -2194,7 +2194,7 @@ static int yy_init_globals (void)
/* zconflex_destroy is for both reentrant and non-reentrant scanners. */
int zconflex_destroy (void)
{
-
+
/* Pop the buffer stack, destroying each element. */
while(YY_CURRENT_BUFFER){
zconf_delete_buffer(YY_CURRENT_BUFFER );
diff --git a/SerialICE/util/kconfig/lxdialog/BIG.FAT.WARNING b/SerialICE/util/kconfig/lxdialog/BIG.FAT.WARNING
index a8999d8..7cb5a7e 100644
--- a/SerialICE/util/kconfig/lxdialog/BIG.FAT.WARNING
+++ b/SerialICE/util/kconfig/lxdialog/BIG.FAT.WARNING
@@ -1,4 +1,4 @@
This is NOT the official version of dialog. This version has been
significantly modified from the original. It is for use by the Linux
-kernel configuration script. Please do not bother Savio Lam with
+kernel configuration script. Please do not bother Savio Lam with
questions about this program.
diff --git a/SerialICE/util/kconfig/lxdialog/menubox.c b/SerialICE/util/kconfig/lxdialog/menubox.c
index fa9d633..c689fc0 100644
--- a/SerialICE/util/kconfig/lxdialog/menubox.c
+++ b/SerialICE/util/kconfig/lxdialog/menubox.c
@@ -26,7 +26,7 @@
*
* *) A bugfix for the Page-Down problem
*
- * *) Formerly when I used Page Down and Page Up, the cursor would be set
+ * *) Formerly when I used Page Down and Page Up, the cursor would be set
* to the first position in the menu box. Now lxdialog is a bit
* smarter and works more like other menu systems (just have a look at
* it).
diff --git a/SerialICE/util/kconfig/regex.c b/SerialICE/util/kconfig/regex.c
index 8169880..e63c814 100644
--- a/SerialICE/util/kconfig/regex.c
+++ b/SerialICE/util/kconfig/regex.c
@@ -75,7 +75,7 @@ char *realloc ();
/* This must be nonzero for the wordchar and notwordchar pattern
commands in re_match_2. */
-#ifndef Sword
+#ifndef Sword
#define Sword 1
#endif
@@ -173,8 +173,8 @@ init_syntax_once ()
use `alloca' instead of `malloc'. This is because using malloc in
re_search* or re_match* could cause memory leaks when C-g is used in
Emacs; also, malloc is slower and causes storage fragmentation. On
- the other hand, malloc is more portable, and easier to debug.
-
+ the other hand, malloc is more portable, and easier to debug.
+
Because we sometimes use alloca, some routines have to be macros,
not functions -- `alloca'-allocated space disappears at the end of the
function it is called in. */
@@ -199,7 +199,7 @@ init_syntax_once ()
#ifndef _AIX /* Already did AIX, up at the top. */
char *alloca ();
#endif /* not _AIX */
-#endif /* not HAVE_ALLOCA_H */
+#endif /* not HAVE_ALLOCA_H */
#endif /* not __GNUC__ */
#endif /* not alloca */
@@ -302,9 +302,9 @@ typedef enum
/* Analogously, for end of buffer/string. */
endbuf,
-
+
/* Followed by two byte relative address to which to jump. */
- jump,
+ jump,
/* Same as jump, but marks the end of an alternative. */
jump_past_alt,
@@ -312,11 +312,11 @@ typedef enum
/* Followed by two-byte relative address of place to resume at
in case of failure. */
on_failure_jump,
-
+
/* Like on_failure_jump, but pushes a placeholder instead of the
current string position when executed. */
on_failure_keep_string_jump,
-
+
/* Throw away latest failure point and then jump to following
two-byte relative address. */
pop_failure_jump,
@@ -412,7 +412,7 @@ extract_number (dest, source)
int *dest;
unsigned char *source;
{
- int temp = SIGN_EXTEND_CHAR (*(source + 1));
+ int temp = SIGN_EXTEND_CHAR (*(source + 1));
*dest = *source & 0377;
*dest += temp << 8;
}
@@ -438,7 +438,7 @@ static void
extract_number_and_incr (destination, source)
int *destination;
unsigned char **source;
-{
+{
extract_number (destination, *source);
*source += 2;
}
@@ -487,8 +487,8 @@ print_fastmap (fastmap)
char *fastmap;
{
unsigned was_a_range = 0;
- unsigned i = 0;
-
+ unsigned i = 0;
+
while (i < (1 << BYTEWIDTH))
{
if (fastmap[i++])
@@ -507,7 +507,7 @@ print_fastmap (fastmap)
}
}
}
- putchar ('\n');
+ putchar ('\n');
}
@@ -528,7 +528,7 @@ print_partial_compiled_pattern (start, end)
printf ("(null)\n");
return;
}
-
+
/* Loop over pattern commands. */
while (p < pend)
{
@@ -574,14 +574,14 @@ print_partial_compiled_pattern (start, end)
printf ("/charset%s",
(re_opcode_t) *(p - 1) == charset_not ? "_not" : "");
-
+
assert (p + *p < pend);
for (c = 0; c < *p; c++)
{
unsigned bit;
unsigned char map_byte = p[1 + c];
-
+
putchar ('/');
for (bit = 0; bit < BYTEWIDTH; bit++)
@@ -618,7 +618,7 @@ print_partial_compiled_pattern (start, end)
case push_dummy_failure:
printf ("/push_dummy_failure");
break;
-
+
case maybe_pop_jump:
extract_number_and_incr (&mcnt, &p);
printf ("/maybe_pop_jump/0/%d", mcnt);
@@ -627,36 +627,36 @@ print_partial_compiled_pattern (start, end)
case pop_failure_jump:
extract_number_and_incr (&mcnt, &p);
printf ("/pop_failure_jump/0/%d", mcnt);
- break;
-
+ break;
+
case jump_past_alt:
extract_number_and_incr (&mcnt, &p);
printf ("/jump_past_alt/0/%d", mcnt);
- break;
-
+ break;
+
case jump:
extract_number_and_incr (&mcnt, &p);
printf ("/jump/0/%d", mcnt);
break;
- case succeed_n:
+ case succeed_n:
extract_number_and_incr (&mcnt, &p);
extract_number_and_incr (&mcnt2, &p);
printf ("/succeed_n/0/%d/0/%d", mcnt, mcnt2);
break;
-
- case jump_n:
+
+ case jump_n:
extract_number_and_incr (&mcnt, &p);
extract_number_and_incr (&mcnt2, &p);
printf ("/jump_n/0/%d/0/%d", mcnt, mcnt2);
break;
-
- case set_number_at:
+
+ case set_number_at:
extract_number_and_incr (&mcnt, &p);
extract_number_and_incr (&mcnt2, &p);
printf ("/set_number_at/0/%d/0/%d", mcnt, mcnt2);
break;
-
+
case wordbound:
printf ("/wordbound");
break;
@@ -668,10 +668,10 @@ print_partial_compiled_pattern (start, end)
case wordbeg:
printf ("/wordbeg");
break;
-
+
case wordend:
printf ("/wordend");
-
+
#ifdef emacs
case before_dot:
printf ("/before_dot");
@@ -690,7 +690,7 @@ print_partial_compiled_pattern (start, end)
mcnt = *p++;
printf ("/%d", mcnt);
break;
-
+
case notsyntaxspec:
printf ("/notsyntaxspec");
mcnt = *p++;
@@ -701,7 +701,7 @@ print_partial_compiled_pattern (start, end)
case wordchar:
printf ("/wordchar");
break;
-
+
case notwordchar:
printf ("/notwordchar");
break;
@@ -758,7 +758,7 @@ print_double_string (where, string1, size1, string2, size2)
int size2;
{
unsigned this_char;
-
+
if (where == NULL)
printf ("(null)");
else
@@ -768,7 +768,7 @@ print_double_string (where, string1, size1, string2, size2)
for (this_char = where - string1; this_char < size1; this_char++)
printchar (string1[this_char]);
- where = string2;
+ where = string2;
}
for (this_char = where - string2; this_char < size2; this_char++)
@@ -809,7 +809,7 @@ re_set_syntax (syntax)
reg_syntax_t syntax;
{
reg_syntax_t ret = re_syntax_options;
-
+
re_syntax_options = syntax;
return ret;
}
@@ -845,7 +845,7 @@ static boolean at_begline_loc_p (), at_endline_loc_p ();
static boolean group_in_compile_stack ();
static reg_errcode_t compile_range ();
-/* Fetch the next character in the uncompiled pattern---translating it
+/* Fetch the next character in the uncompiled pattern---translating it
if necessary. Also cast from a signed character in the constant
string passed to us by the user to an unsigned char that we can use
as an array index (in, e.g., `translate'). */
@@ -985,7 +985,7 @@ typedef struct
pattern_offset_t begalt_offset;
pattern_offset_t fixup_alt_jump;
pattern_offset_t inner_group_offset;
- pattern_offset_t laststart_offset;
+ pattern_offset_t laststart_offset;
regnum_t regnum;
} compile_stack_elt_t;
@@ -1028,7 +1028,7 @@ typedef struct
PATFETCH (c); \
} \
} \
- }
+ }
#define CHAR_CLASS_MAX_LENGTH 6 /* Namely, `xdigit'. */
@@ -1054,7 +1054,7 @@ typedef struct
`fastmap_accurate' is zero;
`re_nsub' is the number of subexpressions in PATTERN;
`not_bol' and `not_eol' are zero;
-
+
The `fastmap' and `newline_anchor' fields are neither
examined nor set. */
@@ -1069,20 +1069,20 @@ regex_compile (pattern, size, syntax, bufp)
`char *' (i.e., signed), we declare these variables as unsigned, so
they can be reliably used as array indices. */
register unsigned char c, c1;
-
+
/* A random tempory spot in PATTERN. */
const char *p1;
/* Points to the end of the buffer, where we should append. */
register unsigned char *b;
-
+
/* Keeps track of unclosed groups. */
compile_stack_type compile_stack;
/* Points to the current (ending) position in the pattern. */
const char *p = pattern;
const char *pend = pattern + size;
-
+
/* How to translate the characters in the pattern. */
char *translate = bufp->translate;
@@ -1103,7 +1103,7 @@ regex_compile (pattern, size, syntax, bufp)
/* Place in the uncompiled pattern (i.e., the {) to
which to go back if the interval is invalid. */
const char *beg_interval;
-
+
/* Address of the place where a forward jump should go to the end of
the containing expression. Each alternative of an `or' -- except the
last -- ends with a forward jump of this sort. */
@@ -1119,7 +1119,7 @@ regex_compile (pattern, size, syntax, bufp)
if (debug)
{
unsigned debug_count;
-
+
for (debug_count = 0; debug_count < size; debug_count++)
printchar (pattern[debug_count]);
putchar ('\n');
@@ -1143,9 +1143,9 @@ regex_compile (pattern, size, syntax, bufp)
printer (for debugging) will think there's no pattern. We reset it
at the end. */
bufp->used = 0;
-
+
/* Always count groups, whether or not bufp->no_sub is set. */
- bufp->re_nsub = 0;
+ bufp->re_nsub = 0;
#if !defined (emacs) && !defined (SYNTAX_TABLE)
/* Initialize the syntax table. */
@@ -1196,7 +1196,7 @@ regex_compile (pattern, size, syntax, bufp)
case '$':
{
if ( /* If at end of pattern, it's an operator. */
- p == pend
+ p == pend
/* If context independent, it's an operator. */
|| syntax & RE_CONTEXT_INDEP_ANCHORS
/* Otherwise, depends on what's next. */
@@ -1227,7 +1227,7 @@ regex_compile (pattern, size, syntax, bufp)
{
/* Are we optimizing this jump? */
boolean keep_string_p = false;
-
+
/* 1 means zero (many) matches is allowed. */
char zero_times_ok = 0, many_times_ok = 0;
@@ -1275,7 +1275,7 @@ regex_compile (pattern, size, syntax, bufp)
/* Star, etc. applied to an empty pattern is equivalent
to an empty pattern. */
- if (!laststart)
+ if (!laststart)
break;
/* Now we know whether or not zero matches is allowed
@@ -1284,7 +1284,7 @@ regex_compile (pattern, size, syntax, bufp)
{ /* More than one repetition is allowed, so put in at the
end a backward relative jump from `b' to before the next
jump we're going to put in below (which jumps from
- laststart to after this jump).
+ laststart to after this jump).
But if we are at the `*' in the exact sequence `.*\n',
insert an unconditional jump backwards to the .,
@@ -1361,7 +1361,7 @@ regex_compile (pattern, size, syntax, bufp)
/* We test `*p == '^' twice, instead of using an if
statement, so we only need one BUF_PUSH. */
- BUF_PUSH (*p == '^' ? charset_not : charset);
+ BUF_PUSH (*p == '^' ? charset_not : charset);
if (*p == '^')
p++;
@@ -1411,8 +1411,8 @@ regex_compile (pattern, size, syntax, bufp)
was a character: if this is a hyphen not at the
beginning or the end of a list, then it's the range
operator. */
- if (c == '-'
- && !(p - 2 >= pattern && p[-2] == '[')
+ if (c == '-'
+ && !(p - 2 >= pattern && p[-2] == '[')