aboutsummaryrefslogtreecommitdiffstats
path: root/src/llvm.cpp
AgeCommit message (Collapse)AuthorFilesLines
2010-12-31Use standard LLVM optimization passes, and optimize entire module (much more ↵David Robillard1-11/+15
aggressive optimization than previous code). git-svn-id: http://svn.drobilla.net/resp/resp@398 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-31Compile match 'else' case to unreachable instruction.David Robillard1-5/+7
git-svn-id: http://svn.drobilla.net/resp/resp@395 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-31Define named (and possibly recursive) types for closures and functions.David Robillard1-24/+66
Compile type definitions all the way to LLVM IR (including recursive types). git-svn-id: http://svn.drobilla.net/resp/resp@388 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-31Remove unused Engine::objectType().David Robillard1-8/+0
git-svn-id: http://svn.drobilla.net/resp/resp@386 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-31Remove duplicated type compilation code.David Robillard1-26/+4
git-svn-id: http://svn.drobilla.net/resp/resp@385 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-30More human readable names for allocated memory in output IR.David Robillard1-2/+3
git-svn-id: http://svn.drobilla.net/resp/resp@383 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-30Rename allocation function to __resp_alloc.David Robillard1-1/+1
git-svn-id: http://svn.drobilla.net/resp/resp@375 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-29Destructuring (i.e. working `match').David Robillard1-0/+7
git-svn-id: http://svn.drobilla.net/resp/resp@374 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-29Literal lists (i.e. list quoting).David Robillard1-18/+86
Compile type expressions. Only compile a top-level function if program has code to run (i.e. isn't just definitions). Cast tuples to Object when necessary to avoid LLVM IR type mismatches (for cons stores and return values). Fix memory leaks. git-svn-id: http://svn.drobilla.net/resp/resp@369 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-28Use fst ("first") instead of head and rst ("rest") instead of tail.David Robillard1-3/+3
git-svn-id: http://svn.drobilla.net/resp/resp@366 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-28Add quote form, to allow expressions literal symbols and lists (lists not ↵David Robillard1-1/+4
yet implemented). Quoting is a thin lexical concept - a quote of a symbol/list compiles to a symbol/list, rather than interpreted as code (i.e. a variable/call, respectively). A quote of anything else is equivalent to its quotee, e.g. a quote of a String is simply that string (the quote is removed at an early stage by the compiler). There is no Quote data type, or explicit unquoting, or anything like that. git-svn-id: http://svn.drobilla.net/resp/resp@365 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-28Tidy.David Robillard1-15/+15
git-svn-id: http://svn.drobilla.net/resp/resp@363 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-27Remove weird __tag_is form by adding a T_LITSYM type and using = operator.David Robillard1-10/+0
Step towards having first class symbols... git-svn-id: http://svn.drobilla.net/resp/resp@362 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-27Kill AType.David Robillard1-49/+48
git-svn-id: http://svn.drobilla.net/resp/resp@359 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-26Remove AType::PRIM.David Robillard1-6/+5
git-svn-id: http://svn.drobilla.net/resp/resp@357 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-26Update headers.David Robillard1-1/+1
git-svn-id: http://svn.drobilla.net/resp/resp@352 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-25Use type of primitive rather than type of first argument to determine type ↵David Robillard1-2/+2
of operation. git-svn-id: http://svn.drobilla.net/resp/resp@349 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-10Simplify if into nested 2-branch (scheme style) ifs at simplify stage.David Robillard1-46/+24
git-svn-id: http://svn.drobilla.net/resp/resp@346 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-09Strip trailing whitespace.David Robillard1-5/+5
git-svn-id: http://svn.drobilla.net/resp/resp@336 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-09Fix cpplint warnings.David Robillard1-0/+5
git-svn-id: http://svn.drobilla.net/resp/resp@329 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-09Make environment always referenced by symbols.David Robillard1-1/+1
Intern symbol strings, but not ASymbol objects themselves, so each symbol can have a different Cursor. Fixes missing locations in error reporting. git-svn-id: http://svn.drobilla.net/resp/resp@324 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-09Consistent engine global[Set|Get] interface.David Robillard1-3/+3
git-svn-id: http://svn.drobilla.net/resp/resp@321 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-09Clean up engine code.David Robillard1-124/+135
git-svn-id: http://svn.drobilla.net/resp/resp@320 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-09Tidy.David Robillard1-107/+107
git-svn-id: http://svn.drobilla.net/resp/resp@319 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-08Remove Engine::compileMatch.David Robillard1-23/+10
git-svn-id: http://svn.drobilla.net/resp/resp@318 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-08Eliminate some backend specific code in LLVMEngine::compileMatch (towards ↵David Robillard1-4/+3
moving it to compile.cpp). git-svn-id: http://svn.drobilla.net/resp/resp@317 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-08Remove Engine::compileIfDavid Robillard1-33/+17
git-svn-id: http://svn.drobilla.net/resp/resp@316 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-08Use factored out if compilation methods to compile match.David Robillard1-49/+23
git-svn-id: http://svn.drobilla.net/resp/resp@315 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-08Consistent naming for Engine compile methods.David Robillard1-2/+2
git-svn-id: http://svn.drobilla.net/resp/resp@314 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-08Clean up function compilation stuff.David Robillard1-13/+15
Add some utilities to for using named types. git-svn-id: http://svn.drobilla.net/resp/resp@313 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-08compileTup => compileConsDavid Robillard1-2/+2
git-svn-id: http://svn.drobilla.net/resp/resp@310 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-07Saner recursive descent lexer/parser.David Robillard1-5/+0
git-svn-id: http://svn.drobilla.net/resp/resp@306 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-07Factor if compilation into smaller bits (towards a more assembly like IR ↵David Robillard1-45/+83
stage before actual backend code emission). git-svn-id: http://svn.drobilla.net/resp/resp@304 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-04More const-correctness (remove all use of const_cast).David Robillard1-1/+1
git-svn-id: http://svn.drobilla.net/resp/resp@297 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-03Remove use of RTTI for AST.David Robillard1-28/+25
git-svn-id: http://svn.drobilla.net/resp/resp@290 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-03Merge ACall and ATuple.David Robillard1-8/+8
git-svn-id: http://svn.drobilla.net/resp/resp@285 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-03Remove AFn.David Robillard1-3/+3
git-svn-id: http://svn.drobilla.net/resp/resp@284 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-02Remove ACall subclasses.David Robillard1-6/+6
git-svn-id: http://svn.drobilla.net/resp/resp@282 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-02Remove use of ACall class hierarchy from compile phase.David Robillard1-4/+4
git-svn-id: http://svn.drobilla.net/resp/resp@281 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-02Work towards removing different classes for each type of expression.David Robillard1-9/+9
git-svn-id: http://svn.drobilla.net/resp/resp@278 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-12-02Represent code as list structure (i.e. traditional LISP lists built from ↵David Robillard1-10/+10
pairs), rather than tuple structure. Remove unused/crufty depoly stage. Remove cps from AST interface (but keep cps.cpp code around for later). Improved command line interface for compilation stages (options -T -L -S). git-svn-id: http://svn.drobilla.net/resp/resp@277 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-09-30Preliminary work on algebraic data types and run-time typing.David Robillard1-7/+67
git-svn-id: http://svn.drobilla.net/resp/resp@270 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-08-22Simplify Engine function compilation interface.David Robillard1-36/+15
Removes duplicated code in various backends and reduces Engine code knowledge of AFn specifics (which belongs in compile.cpp). git-svn-id: http://svn.drobilla.net/resp/resp@268 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-08-22Simplify Engine::startFunction.David Robillard1-10/+4
git-svn-id: http://svn.drobilla.net/resp/resp@267 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-08-22Fix boolean compilation.David Robillard1-1/+1
git-svn-id: http://svn.drobilla.net/resp/resp@266 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-08-20Make AST::compile const and make Module compilation API take const AST*.David Robillard1-16/+16
git-svn-id: http://svn.drobilla.net/resp/resp@265 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-08-19Generalise `cons': a call to any symbol beginning with an uppercase characterDavid Robillard1-1/+1
(i.e. a type symbol), e.g. (Thing 2), is a call to a type constructor which creates a Tup containing the arguments, with the symbol as the first element in the type expression, e.g. (Thing 2) has type (Thing Int) and compiles to a tuple containing a single Int. The type constructor `Tup' can be used as a `cons' replacement to construct generic tuples. git-svn-id: http://svn.drobilla.net/resp/resp@264 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-08-19Add quote to syntax (currently only a lexeme is quotable, no lists...)David Robillard1-0/+4
git-svn-id: http://svn.drobilla.net/resp/resp@262 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-08-19Coherent AString and Lexeme implementation.David Robillard1-5/+30
A Lexeme is any "token" read from input, a lexeme has not yet beeen parsed and could parse to anything, e.g. a string, an expression, a number, etc. Lexemes are not (yet?) exposed to the language or ever compiled. A String is a string literal, which can contain any character directly except " and \. There are two special escapes: \" and \\, any other character following a \ is a syntax error. Fix garbage collection of REPL objects, leading to type errors from type variable re-use because a type variable for a given AST's /address/ exists, but that address has actually been deleted and reused by new (i.e. make top level REPL expressions and types be GC roots). git-svn-id: http://svn.drobilla.net/resp/resp@261 ad02d1e2-f140-0410-9f75-f8b11f17cedd
2010-08-18Update for LLVM 2.7.David Robillard1-8/+6
Factor out mostly duplicated code in Env::topLevel and Env::innerMost. git-svn-id: http://svn.drobilla.net/resp/resp@259 ad02d1e2-f140-0410-9f75-f8b11f17cedd