Commit Graph

82 Commits

Author SHA1 Message Date
Andreas Rumpf
c383e4d35e preparations for string optimizations 2017-09-22 09:57:18 +02:00
Ruslan Mustakov
926563f0e6 Ignore constant-conversion warning (#5696) 2017-04-12 22:09:00 +02:00
Emery Hemingway
7e351fc7fa support for the Genode OS framework (#5560) 2017-03-31 23:13:06 +02:00
Samantha Marshall
93753926f5 adding support for using llvm ASAN (#5536) 2017-03-14 23:33:56 +01:00
Ruslan Mustakov
9608acf200 Check if __STDC_VERSION__ is defined (#5488) 2017-03-07 09:56:46 +01:00
Ruslan Mustakov
32159ee827 Ignore pointer-bool-conversion warning (#5468) 2017-03-02 08:55:17 +01:00
Andreas Rumpf
fab69661ad new name mangling rules for easier debugging 2017-02-02 16:27:48 +01:00
Jacek Sieka
fa86571448 abi check: prefer nim constant to enable, document 2016-11-03 22:30:00 +08:00
Jacek Sieka
be1e3c4e09 add a simple sizeof checker to compare nim & c types 2016-11-03 21:11:39 +08:00
Araq
646a569421 fixes #3279 2016-09-12 22:57:12 +02:00
andri lim
5b7efba3ae fixed #4590 Visual Studio C4090 warning 2016-08-09 20:34:15 +07:00
Andreas Rumpf
7f752db0e3 improve error message if C and Nim disagree on pointer size 2016-07-08 15:55:42 +02:00
Jacek Sieka
64b0485207 fix types of ansi_c/sysio to more closely match C ABI
also fixes some instances of using C library functions when there are
nim alternatives available
2016-06-05 12:03:20 +08:00
mjendrusch
174205bcae Fixes #4093
Added COMMA macro to nimbase.h,
changed code generation for c++ template types to insert COMMA im
between the arguments, instead of ",".
2016-04-17 17:10:24 +02:00
def
3e78930bcd fix typo in nimbase.h 2016-03-15 13:39:34 +01:00
Anatoly Galiulin
0968771785 Fixed threading issues for tcc backend 2016-03-10 17:45:11 +06:00
Anatoly Galiulin
1a1710c3ec Fixed NIM_THREADVAR definition in nimbase.h 2016-03-01 17:23:10 +06:00
Yuriy Glukhov
9aceaa0c05 Added -Wpragmas ignore 2016-02-13 21:49:07 +02:00
Ruslan Mustakov
82dd2545fb Added pragmas to ignore warnings in Nim-generated files for gcc, clang, vcc 2016-02-10 19:19:01 +06:00
Reimer Behrends
f664c576c2 Fix code generation issues with TNimType.
This is an alternative attempt to fix issue #2841 in a way that does not
rely on non-standard C compiler behavior.

The underlying problem is that the typeinfo module includes
system/hti.nim, but system/hti.nim is also included by system.nim. The
result is that the compiler at any given point has two instances of
TNimType with the same external name and will generate code either for
one or both of them. Code generation for the second version is normally
suppressed by using {.importc.}, but that results in a missing type
declaration for modules that only use the second version. This happens
for modules that import typeinfo, because the the second component of
typeinfo.Any has type PNimType = ptr TNimType, which generates a
"TNimType *" struct member.

The previous solution was to have a typedef for TNimType in nimbase.h;
however, this results in duplicate typedefs (specifically, but not only
for the code generated for typeinfo.nim). Duplicate typedefs with the
same type name are allowed in C++ and C11, but are explicitly forbidden
in C89 and C99. Modern versions of gcc and clang accept them anyway, but
this is not standard-compliant and may break for other C compilers or
older versions of gcc and clang.

This patch attempts to fix the issue by making the second component of
typeinfo.Nim a pointer instead of a PNimType and casting back and forth
as needed. Thus, the second version of TNimType occurs only within the
code for typeinfo.nim, where it can be safely omitted.
2015-12-15 13:33:38 +01:00
Araq
c0ad9a96ce fixes #3237 2015-08-25 22:44:53 +02:00
rku
24ad2cb392 Merge branch 'devel' into coroutines 2015-08-20 17:54:55 +03:00
Yuriy Glukhov
c42b05adb4 Fixed --debugger:on option. Removed c_line from termios. 2015-08-12 12:04:26 +03:00
rku
43bfda057b Coroutine support for i386/amd64 platforms unix/windows OSes markAndSweep/refCounting GCs. 2015-07-31 17:59:50 +03:00
Araq
8594faa543 fixes #2841 2015-07-22 17:08:21 +02:00
Araq
ecc0090939 fixes #2551; fixes #2212; breaks bootstrapping in debug mode; bootstrap with -d:release 2015-04-25 23:16:57 +02:00
Andreas Rumpf
e390d8ec4a Merge pull request #2225 from dyu/freebsd
compile nim on freebsd
2015-03-08 13:01:55 +01:00
Araq
d61f326f38 prevent name mangling for C++ DLLs 2015-03-05 01:34:09 +01:00
dyu
19354b62f6 compile nim on freebsd 2015-02-27 17:45:07 +08:00
Araq
f7f87a7709 merged #2083 manually 2015-02-08 13:38:04 +01:00
Guillaume Gelin
3119fe087d Happy new year! 2015-01-06 15:26:33 +01:00
Araq
e65c296bcc implemented mixed mode codegen 2014-10-03 01:21:35 +02:00
Araq
d576fbb39a implemented locking levels; still incomplete 2014-09-27 15:06:06 +02:00
Reimer Behrends
80255d8889 Fix the C++ exception struct in nimbase.h.
The struct NimException still referred to the old exception type
E_Base, which has since been renamed to Exception. This made the
C++ backend fail on any code that used exceptions.
2014-09-21 18:30:03 +02:00
Araq
ed226eba6d added stack overflow prevention 2014-07-16 22:32:09 +02:00
ReneSac
83661492e7 Fix typo in previous commit. 2014-04-06 14:20:51 -03:00
Zahary Karadjov
1546d210c5 fix #971 2014-03-10 18:13:48 +02:00
ReneSac
a88a635847 Added comment explaining 'assert_numbits' error. 2014-03-06 18:18:25 -03:00
Araq
5506e8491d implemented 'union' and 'unchecked' pragmas 2014-03-05 20:19:04 +01:00
Araq
52851b722d --os:standalone works again 2013-06-30 21:15:28 +02:00
Araq
9604df8431 fixes #466 2013-06-06 23:15:05 +02:00
Simon Hafner
e88c179982 nimbase.h doesn't need signal.h 2013-05-18 15:58:11 -05:00
Grzegorz Adam Hankiewicz
72a3e21f28 Removes executable bit for text files. 2013-03-16 23:53:07 +01:00
Araq
a64d4dc35c documented object constrs; endb works again 2013-03-09 20:43:56 +01:00
Zahary Karadjov
0cb95891d3 fixes nimrtl compilation 2013-01-28 00:47:41 +02:00
Zahary Karadjov
d0edb1826b adds an option to interleave the generated code with snippets from the original source
Lines from the original source are outputted as comments next to line directives.
Hopefully, this will make debugging codegen problems easier.

Other changes:
The frame setup code now uses a single-line C macro. My motivation was to reduce
the noise in the generated output and make it easier to step over the boiler-plate
code, but counter-intuitively this also improved the overall compilation speed a
little bit so I applied the same treatment to line tracking too (this reduces the size of
the generated files and the explanation is that probably the I/O overhead dominates
the macro expansion costs).
2012-12-02 20:36:29 +02:00
Araq
b4ad97a036 fixes #256 (I hope) 2012-11-20 21:33:22 +01:00
Araq
2133fbfcce bugfix: wrong assertions for C++ code generation; some solaris support; first steps to an effect system 2012-10-30 22:29:03 +01:00
Araq
12bc0419da fixes 182 2012-08-02 23:25:17 +02:00
Araq
58a66a0d70 more reliable NI/NU definitions 2012-07-28 17:28:36 +02:00