aboutsummaryrefslogtreecommitdiff
path: root/tccgen.c
Commit message (Collapse)AuthorAgeFilesLines
* clarify support for functions returning an arrayJoe Soroka2011-03-081-5/+8
| | | | | | | | | previously, tcc would accept a prototype of a function returning an array, but not giving those functions bodies nor calling them. it seems that gcc has never supported them, so we should probably just error out... but it's possible that someone already using tcc includes some header that contains an unused prototype for one, so let's continue to support that.
* support c99 for-loop init decls (2nd attempt)Joe Soroka2011-03-081-3/+18
|
* partially revert e23194aJoe Soroka2011-03-081-19/+3
| | | | see http://lists.nongnu.org/archive/html/tinycc-devel/2011-03/msg00002.html
* revert last 3 commits. will find better way.Joe Soroka2011-03-081-96/+85
|
* small change to previous whitespace-only commitJoe Soroka2011-03-081-2/+2
|
* some indentation made prev patch pretty; removed itJoe Soroka2011-03-081-85/+81
|
* refactor post_type() to be explicit about its recursionJoe Soroka2011-03-081-5/+20
|
* added a note clarifying post_type() recursionJoe Soroka2011-03-081-0/+3
| | | | | | | | | some ancient pre-K&R C allows a function to return an array and the array brackets to be put after the arguments, such that "int c()[]" means the same as "int[] c()" see: http://llvm.org/bugs/show_bug.cgi?id=2399 http://java.sun.com/docs/books/jls/third_edition/html/classes.html#38703
* support c99 for-loop init declsJoe Soroka2011-03-071-3/+19
|
* use new weaken_symbol() to fix another real-world corner caseJoe Soroka2011-03-071-1/+1
|
* factor out symbol weakening into new functionJoe Soroka2011-03-071-10/+17
|
* weak redefinition of a symbol should weaken the originalJoe Soroka2011-03-071-0/+3
|
* __typeof(t) should not include storage modifiers of tJoe Soroka2011-03-061-0/+2
|
* tccgen: handle __attribute((alias("target")))Joe Soroka2011-03-031-1/+24
|
* collapse branch in decl(), making way for next patchJoe Soroka2011-03-031-9/+9
|
* handle post-asm-label attributes on variablesJoe Soroka2011-03-031-25/+14
|
* tcc: fix weak attribute handlingJoe Soroka2011-03-021-6/+2
|
* fix another static struct init issue (arrays with unknown size at end)Jaroslav Kysela2011-02-221-4/+18
|
* Fix complex static initializers (handle additional '}' and '{' brackets)Jaroslav Kysela2011-02-221-4/+8
| | | | | | - added an example to test suite - the "warning: assignment discards qualifiers from pointer target type" is present but harmless
* Add support of asm label for variables.Thomas Preud'homme2011-02-091-10/+23
| | | | | | | | Add support for asm labels for variables, that is the ability to rename a variable at assembly level with __asm__ ("newname") appended in its declaration. See http://gcc.gnu.org/onlinedocs/gcc-4.4.4/gcc/Asm-Labels.html for more details.
* Fix fct asm label: only valid for declarationThomas Preud'homme2011-02-091-53/+21
| | | | | | | | | - Fix function assembly label mechanism introduced in commit 9b09fc376e8c212a767c875e71ca003e3b9a0d2e to only accept alternative name for function declaration. - merge the code with the one introduced in commit 264a103610e3ee86b27b8cbb0e4ec81cd654d980. - Don't memorize token for asm label but directly the asm label.
* Fix incorrect use of basic type as bitflags.Thomas Preud'homme2011-02-071-4/+3
| | | | | Fix incorrect use of basic types as bitflags and inefficiency in commit cf36410e30b3c18be6c556158b2d0d0938f5b77d
* Complain for static fct declared w/o file scopeThomas Preud'homme2011-02-061-0/+4
| | | | | | | | | Error out on static function without file scope and give an explaination to the user This is a rewrite of e9406c09a3212ab3f120412a6bbdacb0cdd25deb but considering problems raised about static local function pointers in 632ee5a54076d417971ae7fa8a0c154441a71499.
* Revert "Implement C99 Variable Length Arrays"Thomas Preud'homme2011-02-051-130/+30
| | | | This reverts commit a5a50eaafeea0d3ca47bc8fb6baf983743470c60.
* Revert "Disable C99 VLA when alloca is unavailable."Thomas Preud'homme2011-02-051-8/+0
| | | | This reverts commit e3e5d4ad7a475e30ea13ad1ba9f23e6210d5d431.
* Disable C99 VLA when alloca is unavailable.Thomas Preud'homme2011-02-041-0/+8
| | | | | | | | | | | | | | | * Disable C99 VLA detection when alloca is unavailable and protect the new reference to TOK_alloca in decl_initializer in order to compile and run for architecture without working alloca. Not all code of C99 VLA is commented as it would required many ifdef stanza. Just the detection is commented so that VT_VLA is never set any type and the C99 VLA code is compiled but never called. However vpush_global_sym(&func_old_type, TOK_alloca) in decl_initializer needs to be protected by an ifdef stanza as well because it uses TOK_alloca. * include alloca and C99 VLA tests according to availability of TOK_alloca instead of relying on the current architecture
* Implement C99 Variable Length ArraysThomas Preud'homme2011-02-041-30/+130
| | | | | | | Implement C99 Variable Length Arrays in tinycc: - Support VLA with multiple level (nested vla) - Update documentation with regards to VT_VLA - Add a testsuite in tcctest.c
* weak definitions overrule non-weak prototypesJoe Soroka2011-02-011-0/+12
|
* support weak attribute on variablesJoe Soroka2011-02-011-0/+7
|
* Support struct arguments with stdarg.hShinichiro Hamaji2010-12-281-6/+22
| | | | | | | | - add __builtin_va_arg_types to check how arguments were passed - move most code of stdarg into libtcc1.c - remove __builtin_malloc and __builtin_free - add a test case based on the bug report (http://www.mail-archive.com/tinycc-devel@nongnu.org/msg03036.html)
* Fix binding of assignment expressions.Ben Bacarisse2010-10-251-29/+29
|
* Move asm label functions from tccasm.c to tccgen.cThomas Preud'homme2010-09-141-1/+28
| | | | | | | | | | * Move functions parse_asm_str and asm_label_instr from tccasm.c to tccgen.c * Remove CONFIG_TCC_ASM_LABEL macro as asm label are available on all archs. See: http://lists.nongnu.org/archive/html/tinycc-devel/2010-09/msg00026.html for the rationale.
* Add support of asm label for functions.Thomas Preud'homme2010-09-101-1/+24
| | | | | | Add support for asm labels for functions, that is the ability to rename a function at assembly level with __asm__ ("newname") appended in function declaration.
* Fix casts from 32bit integer types to 64bit integer types.Shinichiro Hamaji2010-08-311-5/+7
| | | | | | | This bug was reported in http://lists.gnu.org/archive/html/tinycc-devel/2010-08/msg00050.html In this case, we should not emit any code when we cast from VT_FUNC to VT_PTR.
* Revert "implemented C99 for loop with variable declaration"grischka2010-08-211-37/+4
| | | | | | | | | | | | | | | This reverts commit 433ecdfc9d1402ecf03e710de481e2063ad6de90. The patch breaks e.g. with for ((i = 10); --i;); In particular to check for a type decl. this is not sufficient: if (tok < TOK_UIDENT) { A future approach to c99 loop variables might instead use: if (parse_btype(...)) { plus refactor function decl() accordingly.
* tccgen: Revert yuanbin's recent patchesgrischka2010-06-211-19/+17
| | | | | This reverts commits 670993..d35138 Maybe these commits fixed something but also seemed to cause problems.
* implemented C99 for loop with variable declarationClaudio Bley2010-06-211-4/+37
|
* Revert "Complain for static fct declared w/o file scope"grischka2010-06-151-3/+0
| | | | | | | | | | This reverts commit e9406c09a3212ab3f120412a6bbdacb0cdd25deb. We don't want errors for static local function pointers, such as: { static void (*fn)(); ... }
* Fix last commits: remove CRLF, chmod 644 tccgen.cgrischka2010-06-151-24/+24
|
* tccgen: skip ')' in front of ',' for initializeryuanbin2010-06-131-5/+14
|
* tccgen: skip fields from same unionyuanbin2010-06-131-2/+8
|
* tccgen.c: skip fields from same unionyuanbin2010-06-131-26/+5
|
* tccgen: initial the last member of unionyuanbin2010-06-111-1/+1
|
* tccgen: initial last member of unionyuanbin2010-06-111-20/+28
|
* append ULL to big constantsDaniel Glöckner2010-05-131-3/+3
|
* Add nan, snan and inf float constantsThomas Preud'homme2010-05-061-0/+25
|
* Delete unused vtop_saved variable in unary_typeThomas Preud'homme2010-04-201-2/+0
|
* Complain for static fct declared w/o file scopeThomas Preud'homme2010-04-151-0/+3
| | | | | Error out on static function without file scope and give an explaination to the user
* Correctly support all unary expression with sizeofThomas Preud'homme2010-04-151-6/+19
| | | | | | | Unary expression can start with a parenthesis. Thus, the current test to detect which sizeof form is being parsed is inaccurate. This patch makes tcc able to handle things like sizeof (x)[1] where x is declared as char x[5]; wich is a valid unary expression
* Error out on bad char array initializationRomain Francoise2010-04-151-0/+3
| | | | | | | Error out with an explicit message when trying to initialize a character array with something that's not a literal (optionally enclosed in braces) as per C99 6.7.8:14; thanks to Antti-Juhani Kaijanaho <ajk@debian.org> who did all the work.