Commit Graph

247 Commits

Author SHA1 Message Date
Stefano Sanfilippo
be503447b3 Fix bug in codegen for functions with multiple parameters.
Prior to this, all mutable param variables would be bound to the same parameter.
2015-03-09 01:02:24 +01:00
Stefano Sanfilippo
3ffdcf4b88 Using C for standard library, since it can't depend on lib(std)c++. 2015-03-08 22:18:21 +01:00
Stefano Sanfilippo
95d189e244 Use target_compile_options function in CMake script. 2015-03-08 22:10:34 +01:00
Stefano Sanfilippo
8d511f46f4 Expand documentation on the Monicelli standard library. 2015-03-08 21:52:29 +01:00
Stefano Sanfilippo
0531ec531a Removing unneeded dependency on LLVM JIT. 2015-03-08 21:45:06 +01:00
Stefano Sanfilippo
79c4303219 Using PointerSet for modules in monicelli::Program. 2015-03-08 21:37:46 +01:00
Stefano Sanfilippo
04cd095e41 Removing leading __ from Monicelli type definitions. 2015-03-08 21:37:29 +01:00
Stefano Sanfilippo
711f693f55 Renaming monicelli::plist to monicelli::plist_of 2015-03-08 21:27:24 +01:00
Stefano Sanfilippo
b2e7a11b7a Introducing boost::ptr_vector and boost::ptr_unordered_set.
This is an easy way to increase the uniformity of the API.
2015-03-08 21:03:23 +01:00
Stefano Sanfilippo
19a0c656f2 Refactoring == and hash() operators for nodes that need them. 2015-03-08 21:01:27 +01:00
Stefano Sanfilippo
83a3813dd4 Updating readme. 2015-03-08 13:56:06 +01:00
Stefano Sanfilippo
6f69bf603d Add license block where missing. 2015-03-08 13:29:34 +01:00
Stefano Sanfilippo
7a456884ae Use CMake release mode. 2015-03-08 13:27:39 +01:00
Stefano Sanfilippo
b5196b1776 Replace hardcoded stdlib prototypes with a module registry. 2015-03-08 13:25:59 +01:00
Stefano Sanfilippo
3aade87599 Splitting a parser rule for function prototype. 2015-03-08 12:52:38 +01:00
Stefano Sanfilippo
e933e75c85 Removing leftover forward decl of __Monicelli_main 2015-03-08 12:48:13 +01:00
Stefano Sanfilippo
4f4ab480a3 Moving system functions names to BitcodeEmitter.cpp 2015-03-08 12:47:52 +01:00
Stefano Sanfilippo
b1aff41ce9 Moving convertAndStore to preamble of BitcodeEmitter.cpp 2015-03-08 12:47:15 +01:00
Stefano Sanfilippo
9d2413857d Using %g format for printing floating point numbers. 2015-03-08 12:34:51 +01:00
Stefano Sanfilippo
519a7f7510 Use Type::CHAR instead of Type::BOOL for stdlib functions.
This is because C has no int1 type.
2015-03-08 12:29:13 +01:00
Stefano Sanfilippo
83a331a9af Adding stdlib target to CMake, migrating runtime to C++. 2015-03-08 12:19:06 +01:00
Stefano Sanfilippo
8656d5c761 Get rid of __Monicelli_main and directly call main() 2015-03-08 12:04:46 +01:00
Stefano Sanfilippo
be60adb510 Minor cosmetic fixes (splitting lines, beautify error message). 2015-03-08 11:29:26 +01:00
Stefano Sanfilippo
f933cc3163 Extracting a FunctionPrototype node.
This will allow more flexibility in defining externed functions.
2015-03-08 11:25:41 +01:00
Stefano Sanfilippo
3f19125574 Output object file in current directory. 2015-03-07 19:56:47 +01:00
Stefano Sanfilippo
35d3dbce75 Add implicit ret void after main in bitcode. 2015-03-07 19:44:49 +01:00
Stefano Sanfilippo
354654daec Emitting a \n after printing variables in Monicelli runtime. 2015-03-07 19:44:34 +01:00
Stefano Sanfilippo
d802eddd71 Silence unused param compiler warnings because of Bison. 2015-03-07 19:44:16 +01:00
Stefano Sanfilippo
becafb4cd5 Plug new bitcode generator in main. 2015-03-07 19:43:53 +01:00
Stefano Sanfilippo
a8fa0a1bff Adding license boilerplate where missing. 2015-03-07 17:26:19 +01:00
Stefano Sanfilippo
e921a24929 Adding -Wextra -Werror to compiler flags and fixing issues. 2015-03-07 17:24:25 +01:00
Stefano Sanfilippo
226aff325f Adding LLVM stuff to CMake build script. 2015-03-07 17:23:46 +01:00
Stefano Sanfilippo
a313d4865c Implementing stdlib runtime. 2015-03-07 14:12:18 +01:00
Stefano Sanfilippo
fb42a90235 Adding forgotten RuntimePrototypes include to BitcodeEmitter 2015-03-07 14:12:00 +01:00
Stefano Sanfilippo
8d28c5e909 Fix bug in FP to integer conversion. 2015-03-07 14:11:38 +01:00
Stefano Sanfilippo
c9bff1e64b Ensure that parameters passed to function call are of the right type. 2015-03-07 14:11:25 +01:00
Stefano Sanfilippo
6725cbaf88 Implementing MonicelliType, refactoring LLVMType. 2015-03-07 14:10:49 +01:00
Stefano Sanfilippo
3968d937e0 Rename TYPE_MAP to TYPECAST_MAP (more relevant). 2015-03-07 14:09:57 +01:00
Stefano Sanfilippo
6df0801d35 Clearer error messages for BitcodeEmitter. 2015-03-07 14:08:52 +01:00
Stefano Sanfilippo
287d543b34 Extracting method BitcodeEmitter::emitFunctionPrototype() 2015-03-07 14:08:10 +01:00
Stefano Sanfilippo
c0bfd4757f Implementing system module loading for register runtime functions. 2015-03-07 14:06:58 +01:00
Stefano Sanfilippo
e476446e75 Minor refactorings to Nodes.hpp
1. Convenience ctor for Id
2. Clean spaces and redudant things.
2015-03-07 14:06:16 +01:00
Stefano Sanfilippo
0f5c138948 Renaming Module::Type to Module::ModuleType for clarity.
A monicelli::Type enum is already defined.
2015-03-07 14:05:03 +01:00
Stefano Sanfilippo
43fc82d318 Inheriting std::vector ctors in PointerList. 2015-03-07 14:04:15 +01:00
Stefano Sanfilippo
eafc7c5d94 Prototypes and lookup for standard functions. 2015-03-07 14:03:54 +01:00
Stefano Sanfilippo
bb675a09d7 Adding Type::UNKNOWN 2015-03-07 14:03:07 +01:00
Stefano Sanfilippo
754485e40b Implementing abort/assert/input/output bitcode generation. 2015-03-07 14:02:29 +01:00
Stefano Sanfilippo
4321fa5dbf Adding type coercion and deduction mechanism. 2015-03-06 16:10:35 +01:00
Stefano Sanfilippo
cac89bb476 Stubbing implicit type casting mechanism. 2015-03-06 14:51:54 +01:00
Stefano Sanfilippo
f9cfe700fa Report error when applying int-only ops to float values. 2015-03-06 14:41:02 +01:00