John McCall
1ec9db43c8
Provide helper methods to look through parentheses. Learning
...
from Clang, actually give these explicit high-level behavior
rules so that it's clear what should be added to them in the
future.
Swift SVN r1037
2012-01-13 10:07:17 +00:00
Chris Lattner
be666df09e
introduce a ModuleExpr node.
...
Swift SVN r1035
2012-01-13 05:07:21 +00:00
Chris Lattner
be7d7ffe2c
print the members of an overloadsetref_expr. We can handle the truth.
...
Swift SVN r1026
2012-01-12 21:34:58 +00:00
John McCall
59bed696a5
Introduce a ParenExpr to represent the special case of
...
a tuple with one element and no labels. This form is
treated specially in essentially every case, so it might
as well be its own expression kind.
Swift SVN r1021
2012-01-12 19:55:06 +00:00
Chris Lattner
4c050c0e52
Fix a nasty type checking bug (exposed by my next patch), where we would lose a
...
required type conversion in the presence of integer literals and dependent types.
Swift SVN r1016
2012-01-12 07:16:42 +00:00
Chris Lattner
0ed1f417fd
also don't crash on an integer literal type if the type is null,
...
which happens before type checking.
Swift SVN r1013
2012-01-12 06:56:12 +00:00
Chris Lattner
b693da6851
fix -ast-dump to not crash on integer literals with dependent type.
...
Swift SVN r1012
2012-01-12 06:54:31 +00:00
Chris Lattner
1d38f0d0f4
don't abbreviate the AST in -ast-dump, it is more confusing than useful.
...
Swift SVN r1011
2012-01-12 06:30:04 +00:00
Chris Lattner
9f5d37dd2f
introduce a new ConstructorCallExpr node, which is sugar node used to represent
...
the syntactic form of an argument list applied to a metatype. Semantically,
this is yet-another ApplyExpr.
Swift SVN r1008
2012-01-12 05:43:07 +00:00
John McCall
d559794e73
Introduce a new kind of sugar, ParenType. A tuple with one
...
anonymous member is actually one of these.
A func decl is curried over all of its parameter clauses,
as long as they're written without parentheses. So the body
of a func is the body of the "most curried" function:
func foo(x:int) -> (y:int) -> int {
// This is the body of the function that takes 'y'.
// It returns an int.
}
func bar(x:int) -> ((y:int) -> int) {
// This is the body of the function that takes 'x'.
// It returns a functon of type (y:int) -> int.
}
Swift SVN r993
2012-01-06 04:10:32 +00:00
John McCall
b2569c7786
Provide PrettyStackTraceEntries for Expr* and Stmt* as well,
...
and type-check functions within the former.
Swift SVN r989
2011-12-23 03:53:23 +00:00
John McCall
5bdea18fc4
Introduce a PrettyStackTraceEntry implementation for
...
processing declarations and use it in debug builds whenever
the tree walker walks into a Decl.
Swift SVN r984
2011-12-23 01:58:26 +00:00
John McCall
ce9259d2e5
Teach the walker to walk inside ExtensionDecls correctly.
...
Causes massive crashes because something else apparently
isn't doing this. Investigating.
Swift SVN r982
2011-12-23 01:19:27 +00:00
Chris Lattner
19b7a934a1
rename BuiltinFloatingPointType to BuiltinFloatType.
...
Swift SVN r980
2011-12-23 00:07:58 +00:00
Chris Lattner
320e4747cc
Codegen was silently truncating IntegerLiteralExpr's to 64 bits, bad codegen!
...
Swift SVN r979
2011-12-23 00:04:06 +00:00
Chris Lattner
926a3fe671
completely reimplement floating point literals to follow the model of integer literals.
...
Among other things, this gives us the amazing power to accept "var x : float = 0.0"
Swift SVN r978
2011-12-22 23:50:03 +00:00
Chris Lattner
8ce4737534
implement "a.b" AST and type checker support. Semantics are that 'a' is evaluated and discard. 'b' is evaluated and returned.
...
Swift SVN r950
2011-12-21 23:49:30 +00:00
Chris Lattner
eef2f69637
improve AST modeling of dot syntax calls to follow the syntactic structure instead of being weird and broken and losing source loc info.
...
Swift SVN r938
2011-12-15 00:52:58 +00:00
Chris Lattner
2bb9e992e4
fix typo
...
Swift SVN r926
2011-12-14 20:30:21 +00:00
Chris Lattner
a1b7419a36
remove support for looking up global names with dot syntax. "x.y" != "y(x)" now.
...
Swift SVN r917
2011-12-07 00:59:09 +00:00
John McCall
d716f82984
Getterize ValueDecl.
...
Swift SVN r885
2011-11-18 01:04:12 +00:00
John McCall
50fb0d63f6
More incremental getterization.
...
.w
Swift SVN r883
2011-11-18 00:29:15 +00:00
John McCall
de3c3ff04d
Build an implicit expression to record the conversion
...
of a oneof to its underlying type. Much better.
Swift SVN r881
2011-11-17 11:38:05 +00:00
Doug Gregor
55f635a0c0
Introduce an additional "context" parameter to the expression and
...
statement walk callback functions, where we can stash additional
information without breaking all of the callers.
At present, the only information in the context is the parent
statement or expression.
Swift SVN r860
2011-11-10 17:02:43 +00:00
Doug Gregor
2e49b79617
Rename WalkOrder.h to Walk.h, and introduce typedefs for the function
...
types of the expression and statement walker into it, so we don't end
up typing the same darned things over and over again.
Swift SVN r859
2011-11-10 16:36:56 +00:00
Doug Gregor
a8de31b0e0
Implement Stmt::getSourceRange() along with proper implementations for
...
each of the subclasses.
Swift SVN r857
2011-11-10 00:46:07 +00:00
Doug Gregor
9995a39aae
Switch Expr::getLoc() over to an implementation that defaults to the
...
starting location of the expression, but can be overridden by
subclasses.
Swift SVN r856
2011-11-10 00:34:40 +00:00
Doug Gregor
0223f3edf1
Implement Expr::getSourceRange() and introduce proper support for this
...
function into all of the expression nodes. Re-implement
Expr::getStartLoc() in terms of this function, and add it's brother
Expr::getEndLoc(), removing the specialized implementations.
Clean up the source ranges of implicitly-created tuple expressions in
the process.
Swift SVN r855
2011-11-10 00:25:48 +00:00
Chris Lattner
2dcaed352b
tidy up
...
Swift SVN r812
2011-11-01 06:47:50 +00:00
Chris Lattner
3c43cae8b4
now that types can get their astcontext, remove some pointless argument passing.
...
Swift SVN r757
2011-10-18 23:25:42 +00:00
Chris Lattner
a7c7d64fa0
Switch swift to use SourceLoc instead of SMLoc.
...
Also use the new getAdvancedLoc() method instead of hacking
on SMLoc directly.
Also fix the warning/note/error methods to forward through ASTContext
instead of being replicated everywhere.
Swift SVN r750
2011-10-18 01:22:29 +00:00
John McCall
f121bd5e2d
Arbitrary-associativity operator precedence parsing.
...
Swift SVN r743
2011-09-29 01:31:16 +00:00
John McCall
25ee366396
Add an lvalue-to-rvalue conversion AST node.
...
Swift SVN r742
2011-09-28 01:12:34 +00:00
John McCall
5249bc7a5b
Metaprogram getLoc() and getStartLoc().
...
Swift SVN r741
2011-09-28 01:01:15 +00:00
John McCall
b2facdae4b
Getterize Stmt.h.
...
Swift SVN r720
2011-09-20 07:07:53 +00:00
John McCall
b351394b6e
Getterify the rest of Expr.h.
...
Swift SVN r719
2011-09-20 00:18:57 +00:00
John McCall
802262a7da
More incremental getterization.
...
Swift SVN r718
2011-09-19 23:37:21 +00:00
John McCall
7a259f4bad
Differentiate between the starting location and caret location of
...
an expression. More incremental getterization.
Swift SVN r717
2011-09-19 22:45:58 +00:00
John McCall
02e47ed9ce
Privatize Expr's Ty and Kind members; introduce getters and setters.
...
Swift SVN r716
2011-09-19 22:00:20 +00:00
Chris Lattner
8eaddc1cda
AST support for floating point literals.
...
Swift SVN r707
2011-09-15 21:37:46 +00:00
Chris Lattner
77237852d2
implement a.x syntax for using elements of a protocol.
...
Swift SVN r704
2011-09-11 17:39:45 +00:00
John McCall
37b07c8691
Add builtin bindings for a bunch of primitive LLVM instructions.
...
Swift SVN r698
2011-09-08 00:21:11 +00:00
John McCall
4a0f713e62
Progress towards a builtin module.
...
Swift SVN r682
2011-09-03 05:35:49 +00:00
Chris Lattner
2711ad03c9
now that WalkOrder is in a common header, move the WalkStmt to be a
...
Stmt method, rename it to just 'walk' to follow the naming convention,
and give it an accurate doc comment for good measure.
Swift SVN r622
2011-08-25 18:24:54 +00:00
Chris Lattner
cb59d9c926
split the walkorder enum out to its own header file. This is a silly waste of
...
a file, but is needed to share it between two other heads. Header files seem
so baroque.
Swift SVN r621
2011-08-25 18:18:22 +00:00
Chris Lattner
26cee15cf3
Switch expr walking functionality to take blocks instead of function pointer + void*.
...
Swift SVN r602
2011-08-25 00:51:31 +00:00
Chris Lattner
3e02267edf
hoist the argument expression of Call/Unary/Binary up to ApplyExpr.
...
Swift SVN r581
2011-08-22 22:45:02 +00:00
Chris Lattner
035b65d407
change the representation of BinaryExpr to use an implicit tuple
...
to bind its LHS/RHS together, making it more similar to other ApplyExprs.
Swift SVN r580
2011-08-22 22:42:12 +00:00
Chris Lattner
4c9b8ecf11
add ast and sema support for unary operators. We need some serious AST refactoring
...
to unify our representation of calls, which I'll do later.
Swift SVN r570
2011-08-19 22:40:26 +00:00
Chris Lattner
414f2ae17b
apply_expr -> call_expr
...
Swift SVN r528
2011-08-12 21:23:56 +00:00