aboutsummaryrefslogtreecommitdiff
path: root/libtcc.c
Commit message (Collapse)AuthorAgeFilesLines
* libtcc: cleanup -x<filetype> switch codegrischka2016-10-011-21/+18
| | | | | Abusing filename[0] as type is just too much of a hack. -- From 05364072042ff37904a7b0b14cdd85a1ea1ca11d
* Revert "ability to compile multiple *.c files with -c switch"grischka2016-10-011-16/+5
| | | | | | | copy & paste coding, twisted control flow This reverts commit a13f183e4c2c4b4d1d40e142b57a4298672dfd2c. Also, set linker args for DLLs also.
* tccpp: restore -D symbols for multiple sourcesgrischka2016-10-011-8/+2
| | | | | | | | | | | | | | | ... also for built-in defines The case: $ tcc -D FOO a.c b.c with // a.c #undef FOO // b.c #ifndef FOO # error -D FOO has been lost #endif
* Revert "--whole-archive support"grischka2016-10-011-13/+1
| | | | | | | | | | | | - would parse linker args in two different places - would mess up "tcc -v ..." output: tcc -v test.c -> test.c +> test.c - would use function "tcc_load_alacarte()" to do the contrary of what its name suggests. This reverts commit 19a169ceb896f78205bc23b847938c58f14d1dda.
* Prevent tail spin crash when option -pthread is used.Jean-Claude Beaudoin2016-09-291-2/+4
|
* Rein in unintended external functions on Windows.Jean-Claude Beaudoin2016-09-271-2/+2
|
* pstrcpy looks to be needed by Windows win32/win64 builds. Reverted as ↵Christian Jullien2016-09-261-1/+1
| | | | PUB_FUNC to allow tcc.exe build again.
* Merge branch 'mob' of git://repo.or.cz/tinycc into mypatchChristian Jullien2016-09-261-6/+6
|\ | | | | | | Add Visual Studio processor identification
| * Rein in unintended external functions.Jean-Claude Beaudoin2016-09-251-6/+6
| |
* | Add Microsoft processor identificationChristian Jullien2016-09-261-0/+6
|/
* Improve __*LP*__ predefined macrosChristian Jullien2016-09-251-2/+9
|
* Redo "fix line number in macro redefined message"grischka2016-05-251-1/+1
| | | | | | Smaller change to fix more cases This reverts commit 0f36f60faa05da7e250a4b4eebd4b534e8a2b537.
* --whole-archive supportseyko2016-05-201-1/+13
| | | | | | | | | | | | | | | A patch is implemented as suggested in tinycc-devel mail list. From: Reuben Thomas Date: Thu, 31 Jul 2014 16:52:53 +0100 Subject: [PATCH] Add --{no,}-whole-archive support I resurrected the patch supplied to the mailing list in 2009 Since --whole-archive is a useful flag to get tcc working with autotools, and of course in its own right, I suggest you have a look at the patch and see if it is acceptable. I cannot see any suggestion that it was actively rejected last time round, just no evidence that it was ever added.
* memory model macros __{L,}LP64__seyko2016-05-151-0/+2
| | | | | | | a patch from tcc bugzilla. From: Reuben Thomas Date: Thu, 31 Jul 2014 13:50:13 +0100 Subject: [PATCH] libtcc.c: add memory model macros __{L,}LP64__
* tccpp: cleanup options -dD -dM, remove -Cgrischka2016-05-051-36/+14
| | | | | | | The lexer is for reading files, not for writing. Also : - macro_is_equal(): avoid crash if redefining __FILE__
* tccgen: scope levels for local symbolsgrischka2016-05-051-1/+0
| | | | | | | | | | | | | | | | | | ... for fast redeclaration checks Also, check function parameters too: void foo(int a) { int a; ... } Also, try to fix struct/union/enum's on different scopes: { struct xxx { int x; }; { struct xxx { int y; }; ... }} and some (probably not all) combination with incomplete declarations "struct xxx;" Replaces 2bfedb18675228c3837c23fa523231f55e102c12 and 07d896c8e5d1b46bf4aebd403c78e5f7ffebe02a Fixes cf95ac399cbce1ea8a519f91dd36a5cfd4ea7943
* -fno-type-redefinition-checkseyko2016-05-041-0/+1
| | | | | | | | | | | | | don't catch redefinition for local vars. With this option on tcc accepts the following code: int main() { int a = 0; long a = 0; } But if you shure there is no problem with your local variables, then a compilation speed can be improved if you have a lots of the local variables (50000+)
* section alignmentseyko2016-04-221-1/+1
| | | | | | Alignment of unknown sections changed from 32 to PTR_SIZE This is gcc/pcc default value. This helps to use tcc as linux kernel compiler.
* Improve hash performanceVlad Vissoultchev2016-04-171-7/+8
| | | | | | | | | | | | - better `TOK_HASH_FUNC` - increases `hash_ident` initial size to 16k (from 8k) - `cstr_cat` uses single `realloc` + `memcpy` - `cstr_cat` can append terminating zero - `tok_str_realloc` initial size to 16 (from 8) - `parse_define` uses static `tokstr_buf` - `next` uses static `tokstr_buf` - fixes two latent bugs (wrong deallocations in libtcc.c:482 and tccpp.c:2987)
* allow to compile tcc by pccseyko2016-04-151-1/+1
| | | | | * pcc have only __linux__ macro (and no __linux) * pcc don't have __clear_cache proc
* preprocessor oprtion -C (keep comments)seyko2016-04-151-0/+20
| | | | | This is done by impression of the pcc -C option. Usual execution path and speed are not changed.
* Simplify @listfiles parsingVlad Vissoultchev2016-04-131-39/+17
| | | | This moves listfiles parsing inline in `tcc_parse_args1`
* Allow tcc arguments to be read from @listfilesseyko2016-04-131-27/+84
| | | | | | | | | | | | | | | | | From: Vlad Vissoultchev Date: Tue, 12 Apr 2016 20:43:15 +0300 Subject: Allow tcc arguments to be read from @listfiles This allows all @ prefixed arguments to be treated as listfiles containing list of source files or tcc options where each one is on a separate line. Can be used to benchmark compilation speed with non-trivial amount of source files. The impl of `tcc_parse_args` had to be moved to a new function that is able to be called recursively w/ the original one remaining as a driver of the new one. Listfiles parsing happens in a new `args_parser_add_listfile` function that uses `tcc_open`/`tcc_close/inp` for buffered file input.
* Implement -dM preprocessor option as in gccVlad Vissoultchev2016-04-061-2/+4
| | | | | | There was already support for -dD option but in contrast -dM dumps only `#define` directives w/o actual preprocessor output. The original -dD output differs from gcc output by additional comment in front of `#define`s so this quirk is left for -dM as well.
* -fnormalize-inc-dirsseyko2016-04-031-0/+93
| | | | | | remove non-existent or duplicate directories from include paths if -fnormalize-inc-dirs is specified. This will help to compile current coreutils package
* tccpp: cleanup #include_nextgrischka2015-11-201-92/+0
| | | | | | | | | | | | | | | | tcc_normalize_inc_dirs: normally no problem to be absolutly gcc compatible as long as it can be done the tiny way. This reverts to the state before recent related commits and reimplements a (small) part of it to fix the reported problem. Also: Revert "parsing "..." sequence" c3975cf27c792d493e76a2058a1eaf588324053e && p[1] == '.' is not a reliable way to lookahead
* tccgen: asm_label cleanupgrischka2015-11-201-1/+1
| | | | | | | - avoid memory allocation by using its (int) token number - avoid additional function parameter by using Attribute Also: fix some strange looking error messages
* Trivial changes to avoid some compiler warnings.Edmund Grimley Evans2015-11-191-1/+1
|
* libtcc.c: Completely replace tcc_normalize_inc_dirs.Edmund Grimley Evans2015-11-111-73/+26
|
* win: include dirs: add some docs, minor refactorAvi Halachmi (:avih)2015-11-081-4/+18
|
* fix tcc_mormalize_inc_dirs namingseyko2015-11-081-2/+2
|
* win: fix incorrect directory detectionAvi Halachmi (:avih)2015-11-081-1/+2
| | | | Allow other flags too...
* win: fix dir comparison during include dirs processingAvi Halachmi (:avih)2015-11-081-16/+60
| | | | Use native Windows API via wrapper with stat-like API.
* normalize inc dirs, symplify include_nextseyko2015-11-051-0/+80
| | | | | | | | | include dirs are prepared as in gcc - for each duplicate path keep just the first one - remove each include_path that exists in sysinclude_paths include_next streamlined by introducing inc_path_index in the BufferedFile
* Define __WINT_TYPE__ as int in NetBSDKamil Rytarowski2015-10-111-1/+1
|
* Add support for -D__NetBSD__Kamil Rytarowski2015-10-111-0/+5
|
* Revert all of my changes to directories & codingstyle.gus knight2015-07-291-0/+2322
|
* Reorganize the source tree.gus knight2015-07-271-2322/+0
| | | | | | | | | | * Documentation is now in "docs". * Source code is now in "src". * Misc. fixes here and there so that everything still works. I think I got everything in this commit, but I only tested this on Linux (Make) and Windows (CMake), so I might've messed something up on other platforms...
* Clean up lots of rogue tabs.gus knight2015-07-271-9/+9
| | | | | | Still some more tabs to be taken care of. arm-gen.c and tcccoff.c have so many style issues that I'm just going to throw clang-format at them.
* Trim trailing spaces everywhere.gus knight2015-07-271-1/+1
|
* redo of the -dD optionseyko2015-05-131-1/+16
| | | | | | | | functionality was broken some time ago and was removed by the "tccpp: fix issues, add tests" fix: LINE_MACRO_OUTPUT_FORMAT_NONE in pp_line() means: output '\n' and not "don't output at all"
* some -bench fixesseyko2015-05-121-1/+1
| | | | print stats to stderr, not to stdout
* minor pp optimizationsseyko2015-05-121-0/+4
| | | | | | * remove free_defines() from tcc_preprocess() all cleanup will be done in tcc_delete * move a preprocessor file closing to tcc_delete too
* restore a max memory usage printing for a new MEM_DEBUG when -benchseyko2015-05-121-3/+6
|
* a new version of the MEM_DEBUGseyko2015-05-121-25/+180
|
* allow to use MEM_DEBUG with libtccseyko2015-05-111-0/+1
|
* tcc_add_dll is not used if TCC_TARGET_PEseyko2015-05-101-0/+2
| | | | after "tccpp: fix issues, add tests"
* define __OPTIMIZE__ if -ON (N != 0)seyko2015-05-101-0/+9
| | | | this is gcc behaviour
* warn if multile -o option is givenseyko2015-05-101-0/+4
|
* tccpp: fix issues, add testsgrischka2015-05-091-55/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * fix some macro expansion issues * add some pp tests in tests/pp * improved tcc -E output for better diff'ability * remove -dD feature (quirky code, exotic feature, didn't work well) Based partially on ideas / researches from PipCet Some issues remain with VA_ARGS macros (if used in a rather tricky way). Also, to keep it simple, the pp doesn't automtically add any extra spaces to separate tokens which otherwise would form wrong tokens if re-read from tcc -E output (such as '+' '=') GCC does that, other compilers don't. * cleanups - #line 01 "file" / # 01 "file" processing - #pragma comment(lib,"foo") - tcc -E: forward some pragmas to output (pack, comment(lib)) - fix macro parameter list parsing mess from a3fc54345949535524d01319e1ca6378b7c2c201 a715d7143d9d17da17e67fec6af1c01409a71a31 (some coffee might help, next time ;) - introduce TOK_PPSTR - to have character constants as written in the file (similar to TOK_PPNUM) - allow '\' appear in macros - new functions begin/end_macro to: - fix switching macro levels during expansion - allow unget_tok to unget more than one tok - slight speedup by using bitflags in isidnum_table Also: - x86_64.c : fix decl after statements - i386-gen,c : fix a vstack leak with VLA on windows - configure/Makefile : build on windows (MSYS) was broken - tcc_warning: fflush stderr to keep output order (win32)