Commit graph

600 commits

Author SHA1 Message Date
Zahary Karadjov
560a3bad28 `do' keyword in the grammar for lambda blocks 2012-02-10 14:50:35 +02:00
Araq
161f6f7229 further steps for closure support 2012-02-06 08:44:18 +01:00
Araq
632aece191 further steps to closure support 2012-02-06 00:19:56 +01:00
Araq
8d19a93f1a pragma on/off improvements; endb rewritten 2012-01-28 23:22:44 +01:00
Araq
4f1b89c30c year 2012 for most copyright headers 2012-01-02 23:07:35 +01:00
Araq
e8376067ef C code gen: generate even better code for the GC 2011-12-12 22:46:21 +01:00
Araq
3c53c4c2b0 compiler takes advantage of 'new(Obj|New)RC1 2011-12-12 08:37:35 +01:00
Araq
94358e03e9 compiler generates volatile temps to keep C compiler from optimizing away stack roots 2011-12-12 01:40:23 +01:00
Araq
af792da0bb codegen uses alias analysis to generate better code 2011-12-10 01:06:32 +01:00
Araq
2962ca7890 alias analysis as required for the code gen and the HLO 2011-12-08 23:21:08 +01:00
Araq
70cf34cbdc 'assert' is now implemented without compiler magic 2011-12-04 20:14:50 +01:00
Araq
7fcbdc6d42 implemented 'let' statement 2011-11-29 17:27:48 +01:00
Araq
020a10927a fixes #31 2011-11-27 16:32:05 +01:00
Araq
703430787d C codegen: generate nimKeepAlive calls at strategic places to keep the C compiler from optimizing away all stack roots 2011-11-24 23:28:28 +01:00
Araq
fedc69f61a unused constants are optimized away 2011-11-22 18:48:00 +01:00
Araq
bec06a0649 bugfix: s[1..n] = @[] produced wrong C code 2011-11-14 08:33:44 +01:00
Araq
64e74cf484 bugfix: code gen for constant sequences 2011-11-02 19:47:33 +01:00
Araq
351e89e705 better code generation for constant aggregates 2011-11-02 00:55:29 +01:00
Araq
c517639155 lazy loading of body ast implemented 2011-10-30 20:53:04 +01:00
Araq
90db9171a2 compilation cache: various bugfixes; works for the compiler itself 2011-10-27 00:41:42 +02:00
Araq
4de84024e5 much more efficient rod file generation 2011-10-18 17:21:51 +02:00
Araq
42516c0086 code generator supports constant sequences; more consistent compile time evaluation 2011-10-07 09:02:08 +02:00
Araq
72ceda98cb implemented optional pragma for implicit discard 2011-09-24 13:55:24 +02:00
Araq
033e3dfc50 l-values are preserved modulo type distinction 2011-09-24 13:15:11 +02:00
Zahary Karadjov
0b197ade6c Multiple C lines corresponding to a single nimrod line are joined together
This patch greatly improves the "step over" operation available in debuggers.
In practice, there are often 4-8 lines of C code generated for each nimrod line
Each such line will be responsible to a single step in the debugger that is
a) not expected by the user
b) taking the user to an incorrect line in the nimrod code

To keep this working, all code generation should use the rope formatting
facilities when producing new lines (i.e. $n and $N).
New semantics for the format string are introduced:
$n means "soft new line" that could be joined/broken when lineDir is enabled.
$N means "hard new line" that will always appear as a new line.

As an alternative to this approach, I also tested producing code like this:
#line "code.nim" 154
foo = bar; \
foo(bar) \

This is better for readability of the final output, but unfortunately it didn't
produce the desired result across all compilers/debuggers.
2011-09-20 14:11:06 +03:00
Zahary Karadjov
0f0dfd6379 Nimrod can now compile itself with --lineDir enabled 2011-09-20 14:11:06 +03:00
Araq
257b16ca34 inlining of 'var openarray' iterators now work 2011-08-18 18:52:05 +02:00
Araq
a0d172cd85 bugfix topenarrayrepr works again 2011-08-16 21:24:30 +02:00
Araq
b0742c5b27 finally got rid of nkPassAsOpenArray 2011-08-16 08:56:53 +02:00
Araq
2183bf77a6 added xmltree.innerText; fixes #49 2011-08-15 19:40:00 +02:00
Araq
5131b3cea4 support for C++ code generation; importcpp and importobjc pragmas 2011-08-07 21:02:09 +02:00
Araq
f0145ba7c5 anonymous procs implemented; however no closure support yet 2011-08-01 08:39:27 +02:00
Araq
3e806a374a 'var T' for iterators 2011-07-31 22:39:17 +02:00
Araq
6a8a409f1b preparation for new 'is' operator; breaks bootstrapping again, sorry (use generated C code) 2011-07-31 00:21:32 +02:00
Araq
2f066395ba bugfixes; step one for 'var T' as return type support 2011-07-28 00:53:52 +02:00
Araq
99bcc233cd bugfix: 'set' overloadable; further steps for multi threading support 2011-07-08 01:29:15 +02:00
Araq
3091bc4958 importCompilerProc pragma introduced because the hacks for typeinfo.nim did not suffice 2011-06-27 08:33:03 +02:00
Araq
3e91b456e5 second attempt to fix code gen for pegs.nim 2011-06-26 23:55:47 +02:00
Araq
aa14667ca1 bugfix: pegs.nim compiles again 2011-06-26 22:43:38 +02:00
Araq
e25384db89 improvements to get code size down for programs that don't use GC 2011-06-26 20:17:19 +02:00
Araq
4fa80956b8 compiler can emulate thread local variables 2011-06-15 02:09:02 +02:00
Araq
9f9f0f0818 basic thread analysis working 2011-06-13 16:22:19 +02:00
dom96
8b98ba9a63 Added typeinfo module 2011-06-09 22:23:29 +01:00
Araq
958961bd8d overloading of [] for derefence operation should be possible now 2011-06-05 13:59:41 +02:00
Araq
24ed9d560f threads clean up their heap 2011-06-04 23:55:10 +02:00
Araq
3260702a60 first steps to thread local heaps 2011-06-02 13:02:40 +02:00
Araq
67a30d8371 further steps for thread support; bootstrapping should require unzip C sources and ./build.sh 2011-05-16 00:27:47 +02:00
Araq
d2e2d71d05 newStringOfCap implemented and used to optimize some procs 2011-05-08 17:38:34 +02:00
Araq
145fabeb67 const table support 2011-04-29 22:55:15 +02:00
Araq
cd292568d7 big repo cleanup 2011-04-12 01:13:42 +02:00
Renamed from rod/ccgexprs.nim (Browse further)