History

Accept option "-Os" and define "__OPTIMIZE_SIZE__"

Some headers and source code change macros and implementation, when __OPTIMIZE_SIZE__ is defined. This does not change our generated code.

Detlef Riekenberg committed 4 years ago

Commit 3ce7bc61 parent b3bebdb2 files · +7 −1Browse files

Unified · Split

2 files
  1. libtcc.c +5 −1
  2. tccpp.c +2 −0
libtcc.c+5−1
@@ -1997,7 +1997,11 @@ reparse: · 1996 unmodified lines
1997 s->filetype = x | (s->filetype & ~AFF_TYPE_MASK);1997 s->filetype = x | (s->filetype & ~AFF_TYPE_MASK);
1998 break;1998 break;
1999 case TCC_OPTION_O:1999 case TCC_OPTION_O:
2000 s->optimize = atoi(optarg);2000 /* Use "-O" as alias for "-O1". */
2001 /* Other common used values: "-O0", "-O1", "-O2", "-O3" and "-Os" */
2002 /* no failure with unsupported options */
2003 x = *optarg;
2004 s->optimize = isnum(x) ? atoi(optarg) : (x) ? x : 1;
2001 break;2005 break;
2002 case TCC_OPTION_print_search_dirs:2006 case TCC_OPTION_print_search_dirs:
2003 x = OPT_PRINT_DIRS;2007 x = OPT_PRINT_DIRS;
tccpp.c+2−0
@@ -3733,6 +3733,8 @@ static void tcc_predefs(TCCState *s1, CString *cs, int is_asm) · 3732 unmodified lines
3733 putdef(cs, "__CHAR_UNSIGNED__");3733 putdef(cs, "__CHAR_UNSIGNED__");
3734 if (s1->optimize > 0)3734 if (s1->optimize > 0)
3735 putdef(cs, "__OPTIMIZE__");3735 putdef(cs, "__OPTIMIZE__");
3736 if (s1->optimize == 's')
3737 putdef(cs, "__OPTIMIZE_SIZE__");
3736 if (s1->option_pthread)3738 if (s1->option_pthread)
3737 putdef(cs, "_REENTRANT");3739 putdef(cs, "_REENTRANT");
3738 if (s1->leading_underscore)3740 if (s1->leading_underscore)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t