* device/lib/pic16/libc/stdlib/itoa.c (new)
* device/lib/pic16/libc/stdlib/Makefile: have itoa.c built
* device/lib/pic16/libio/Makefile: exclude subdir according to
${subdir}.ignore for certain PICs (lacking e.g. i2c)
* device/lib/pic16/libio/i2c.ignore (new): pic18f1220 has no I2C support
* src/pic16/gen.c (genFunction): prevent annoying warning
* src/pic16/pcode.c: renamed stack_t to dynstack_t to prevent
nameclashes on BeOS
* support/cpp2/cppmain.c (cpp_output_string): new
* support/cpp2/cpplib.c (_cpp_do__Pragma): fixed _Pragma (""),
fixes bug
1116802
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3756
4a8a32a2-be11-0410-ad9d-
d568d2c75423
+2005-05-14 Raphael Neider <rneider AT web.de>
+
+ * device/lib/pic16/Makefile.common.in: add --optimize-df to OPT_FLAGS
+ * device/lib/pic16/libc/stdlib/itoa.c (new)
+ * device/lib/pic16/libc/stdlib/Makefile: have itoa.c built
+ * device/lib/pic16/libio/Makefile: exclude subdir according to
+ ${subdir}.ignore for certain PICs (lacking e.g. i2c)
+ * device/lib/pic16/libio/i2c.ignore (new): pic18f1220 has no I2C support
+ * src/pic16/gen.c (genFunction): prevent annoying warning
+ * src/pic16/pcode.c: renamed stack_t to dynstack_t to prevent
+ nameclashes on BeOS
+ * support/cpp2/cppmain.c (cpp_output_string): new
+ * support/cpp2/cpplib.c (_cpp_do__Pragma): fixed _Pragma(""),
+ fixes bug 1116802
+
2005-05-13 Borut Razem <borut.razem AT siol.net>
* src/SDCCmain.c (linkEdit): fixed bug 1195202
OPT_FLAGS += --denable-peeps
OPT_FLAGS += --obanksel=9
OPT_FLAGS += --optimize-goto
+OPT_FLAGS += --optimize-df
OPT_FLAGS += --i-code-in-asm
atol \
calloc \
free \
+ itoa \
ltoa \
malloc \
memfree \
--- /dev/null
+/*-------------------------------------------------------------------
+ itoa.c - convert (unsigned) int to strings
+
+ written by: Raphael Neider <rneider@web.de>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ $Id$
+-------------------------------------------------------------------*/
+
+#include <stdlib.h>
+
+void uitoa (unsigned int value, __data char *str, unsigned char radix)
+{
+ ultoa (value, str, radix);
+}
+
+void itoa (int value, __data char *str, unsigned char radix)
+{
+ ltoa (value, str, radix);
+}
+
build-processor-library:
for dir in $(DIRS) ; do \
$(MAKE) -C $$dir clean ; \
- $(MAKE) -C $$dir build-io-lib MCU=18f$(MMCU); \
+ grep $(MMCU) "$${dir}.ignore" > /dev/null 2>&1 || $(MAKE) -C $$dir build-io-lib MCU=18f$(MMCU); \
done;
- gplib -c $(LIB) $(LOBJS)
+ make invoke-gplib
mv -v $(LIB) ../bin
-
+
+# needed so that make updates the list of .o files correctly...
+invoke-gplib:
+ gplib -c $(LIB) $(foreach dir,$(DIRS),$(wildcard $(dir)/*.o))
clean-intermediate:
@for dir in $(DIRS) ; do \
pic16_addpCode2pBlock(apb, pic16_newpCodeCharP(";-----------------------------------------"));
pic16_addpCode2pBlock(apb, pic16_newpCodeFunction(moduleName, asym->name));
//pic16_addpCode2pBlock(apb, pic16_newpCode(POC_GOTO, pic16_popGetWithString( sym->rname )));
- pic16_addpCode2pBlock(apb, pic16_newpCode(POC_GOTO, pic16_newpCodeOpLabel (sym->rname, 0)));
+ //pic16_addpCode2pBlock(apb, pic16_newpCode(POC_GOTO, pic16_newpCodeOpLabel (sym->rname, 0)));
+ pic16_addpCode2pBlock(apb, pic16_newpCodeAsmDir ("GOTO", "%s", sym->rname)); /* this suppresses a warning in LinkFlow */
/* mark the end of this tiny function */
pic16_addpCode2pBlock(apb,pic16_newpCodeFunction(NULL,NULL));
struct stack_s *next;
} stackitem_t;
-typedef stackitem_t *stack_t;
+typedef stackitem_t *dynstack_t;
static stackitem_t *free_stackitems = NULL;
/* Create a stack with one item. */
-static stack_t *newStack () {
- stack_t *s = (stack_t *) Safe_malloc (sizeof (stack_t));
+static dynstack_t *newStack () {
+ dynstack_t *s = (dynstack_t *) Safe_malloc (sizeof (dynstack_t));
*s = NULL;
return s;
}
/* Remove a stack -- its items are only marked free. */
-static void deleteStack (stack_t *s) {
+static void deleteStack (dynstack_t *s) {
stackitem_t *i;
while (*s) {
} // while
}
-static void stackPush (stack_t *stack, void *data) {
+static void stackPush (dynstack_t *stack, void *data) {
stackitem_t *i;
if (free_stackitems) {
*stack = i;
}
-static void *stackPop (stack_t *stack) {
+static void *stackPop (dynstack_t *stack) {
void *data;
stackitem_t *i;
}
#if 0
-static int stackContains (stack_t *s, void *data) {
+static int stackContains (dynstack_t *s, void *data) {
stackitem_t *i;
if (!s) return 0;
i = *s;
}
#endif
-static int stackIsEmpty (stack_t *s) {
+static int stackIsEmpty (dynstack_t *s) {
return (*s == NULL);
}
Safe_free (s);
}
-static int stateIsNew (state_t *state, stack_t *todo, stack_t *done) {
+static int stateIsNew (state_t *state, dynstack_t *todo, dynstack_t *done) {
stackitem_t *i;
/* scan working list for state */
pCodeFlow *curr;
pCodeFlowLink *succ;
state_t *state;
- stack_t *todo; /** stack of state_t */
- stack_t *done; /** stack of state_t */
+ dynstack_t *todo; /** stack of state_t */
+ dynstack_t *done; /** stack of state_t */
int firstState, n_defs;
static int pic16_isAlive (symbol_t sym, pCode *pc) {
int mask, visit;
defmap_t *map;
- stack_t *todo, *done;
+ dynstack_t *todo, *done;
state_t *state;
pCodeFlow *pcfl;
pCodeFlowLink *succ;
const struct answer *));
static void handle_assertion PARAMS ((cpp_reader *, const char *, int));
+extern cpp_output_string (const char *s);
+
/* This is the table of directive handlers. It is ordered by
frequency of occurrence; the numbers at the end are directive
counts from all the source code I have lying around (egcs and libc
}
buffer = destringize (&string.val.str, &len);
- run_directive (pfile, T_PRAGMA, BUF_PRAGMA, (char *) buffer, len);
+ buffer[len] = 0;
+ cpp_output_string ("\n#pragma "); cpp_output_string (buffer); cpp_output_string ("\n");
+ //run_directive (pfile, T_PRAGMA, BUF_PRAGMA, (char *) buffer, len);
free ((PTR) buffer);
}
print.lineno++;
}
+void
+cpp_output_string (const char *s) {
+ fputs (s, print.outf);
+}
+
/* Dump out the hash table. */
static int
dump_macro (pfile, node, v)