Add syntax configuration file for gtksourceview (this allows QC code syntax highlighting for GNOMEs default text view in nautilus, gedit, and sandy + other gtksouceview based editors).
Wolfgang Bumiller [Wed, 17 Apr 2013 16:23:30 +0000 (18:23 +0200)]
parser_const_string now uses hashtables; hashtables may want to dup an empty string without it becoming NULL - also replacing ir_strdup with the new util_ one
Some inline never hurt anyone .. actually, C made a bad decision in it's design, everything should've always been implicitly inline, since most code back in the day was small, if you had large bodies, there should've been an 'outline' keyword for that instead :P
Use hashtable for macro definitions in the preprocessor, this speeds up the search for them, and the removal of them making it O(1) instead of O(n). This also makes my 30 second xonotic compiles take only 13 seconds
Rewrote memory tracking, now prints highest water mark (most used memory at a given time during compile). Changes all byte representation to MB representation. Added ability to print the contents of the leaked memory to the console when -debug is on (infact the lost messages only print during -debug), -memchk simply reports the memory info at the end (it is also printed when -debug). You can set the memory dump columns with -memdumpcols=# where # is the number of columns you want (default is 16)
More flattening. I don't know why I turned off buffering, that makes output to console even slower due to all the flushes, which actually slows down compilation.
flatten the use of strcpy, 90% of the cases we already knew the length of the string either at compile-time, or already within the scope we where, thus letting us use strncpy, which can be further optimized (unrolled if static)
Dale Weiler [Thu, 21 Mar 2013 02:02:41 +0000 (02:02 +0000)]
Cross architecture stuff for distro build scripts. If you have an x86_64 capable system with a compiler and make (the OS doesn't even matter), simply changing to "distro" directory and typing "make" is sufficent to make archlinux i686/x86_64, and debian i686/x86_64 packages.
Dale Weiler [Sat, 9 Mar 2013 08:53:39 +0000 (08:53 +0000)]
Implemented smart intrinsic / builtin system. When you use trivial math functions like "pow", if they don't exist as a builtin, the compiler will implement its own versions, likewise, if a compiler builtin depends on a function that exists, it will use it, likewise if it doesn't it will implement it. If you explicitally use __builtin_ (prefixed) versions, the compiler again will select the best option it can, be it a combination of both builtins and compiler builtins, all compiler builtins, OR, all builtins (most performant).
Dale Weiler [Fri, 8 Mar 2013 09:17:54 +0000 (09:17 +0000)]
Implemented __builtin_mod, and % operator. Added floor builtin to the standalone executor. Mod works so long as the compiler can find a suitable definition of "float floor(float)", otherwise it prints a diagnostic and gives up (original id1 Quake had floor so we can depend on it).
Dale Weiler [Fri, 8 Mar 2013 08:01:45 +0000 (08:01 +0000)]
Implemented concept of enumeration attributes (can be further extended, but currently only "flag" is implemented as an attribute). An enumeration with a flag attribute will act as a "flagged enumeration", one that automatically handles exponentiation of the constants defined inside it, i.e enum : flag { A, B, C }, A,B,C will equal 2, 4, 8.
Dale Weiler [Thu, 7 Mar 2013 23:05:40 +0000 (23:05 +0000)]
Actually generate an ast_call for __builtin_pow for the ** operator, otherwise the operator yeilds a ast_function, making "a ** b" not work, but since it's a function, allows **(a, b). Also added tests for exponentiation operator.