Chris Lattner
8e1c6c8ac6
flatten ModuleKind discriminator into DeclContext's one. Now Module is an
...
abstract class and we have an actual AST-level concept of the builtin module.
Swift SVN r798
2011-11-01 04:07:57 +00:00
Chris Lattner
9298082ebb
move Diagnostics header to include/swift/AST to match .cpp files.
...
Swift SVN r782
2011-10-22 00:47:35 +00:00
Chris Lattner
30b6007b61
move the diagnostics stuff from Basic -> AST to fix layering.
...
Swift SVN r781
2011-10-22 00:41:24 +00:00
Chris Lattner
f92f616aaf
remove hte ASTContext::hadError bool.
...
Swift SVN r778
2011-10-22 00:32:39 +00:00
Chris Lattner
51680e3fdc
remove the deprecated error/warning/note methods, finally.
...
Swift SVN r776
2011-10-22 00:26:34 +00:00
Chris Lattner
9f906da738
sink (a copy of) HadError into DiagnosticEngine, so that errors produced by it trigger error returns from main().
...
Swift SVN r768
2011-10-20 20:55:22 +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
c9d8f92186
remove an assert used for testing.
...
Swift SVN r756
2011-10-18 22:33:23 +00:00
Chris Lattner
7aaf0c5e0c
rework the canonical type system a bit to make it so that all Types can access
...
their ASTContext without bloating everything. Basically, now instead of having
a canonical type point to itself when canonical, it points to the ASTContext
when canonical. This means that Canonical types always have direct access to
their context and non-canonical ones just indirect through the canonical type
pointer to get to it (so it's two jumps away) by using a PointerUnion.
This should make type manipulation more straight-forward.
While we're at it, we actually memoize type canonicalization. Before we
forgot to remember the result in the canonical type pointer in Type.
Swift SVN r755
2011-10-18 22:32:56 +00:00
Chris Lattner
55651745b5
remove helper method, it is the same as T->isEqual(S, Ctx)
...
Swift SVN r752
2011-10-18 21:47:08 +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
6b27921ce3
Propagate around l-value-ness. There aren't any interesting invariants
...
here yet.
Swift SVN r740
2011-09-27 23:46:08 +00:00
Doug Gregor
3d15bf3d55
Introduce a diagnostic-formatting engine and port most of the parser's
...
diagnostics over to it.
There are a few differences between this diagnostic engine and Clang's
engine:
- Diagnostics are specified by a .def file (Diagnostics.def), rather
than via tblgen, which drastically simplifies the build and makes
code completion work when you add a new diagnostic.
- Calls to the "diagnose()" method are safely typed based on the
argument types specified in the .def file, so it's harder to write a
diagnostic whose expected arguments (in the string) and whose actual
arguments (in the code) don't match.
- It uses variadic templates, so it hangs with the cool kids.
Swift SVN r734
2011-09-26 23:46:28 +00:00
John McCall
3603e5bab7
Punt on verification if there's an error in the translation unit.
...
This will be required until there's some sort of error marking
in the AST, at which point that marking will just turn off
shouldVerify for that subtree.
Swift SVN r732
2011-09-24 09:45:02 +00:00
John McCall
709177e000
Simplify adding new verifications by stage. Add a
...
verification of assignment statements.
Swift SVN r730
2011-09-24 09:28:42 +00:00
John McCall
05459eced0
Add a convenience method for checking whether two types are
...
equivalent.
Swift SVN r729
2011-09-24 03:34:15 +00:00
John McCall
5fddb24ddc
Basic verifier framework.
...
Swift SVN r728
2011-09-23 23:50:02 +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
John McCall
c61c807589
Mangle types for all declarations. Save the names of modules and mangle
...
those in, too.
Swift SVN r713
2011-09-18 09:21:42 +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
Chris Lattner
8e369b34da
make builtins.cpp include its header first (exposing that it isn't actually self-contained),
...
and switch to AST.h
Swift SVN r699
2011-09-09 04:58:39 +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
54ff2ccf4a
Lop the last word off ModuleDecl and TranslationUnitDecl.
...
Swift SVN r693
2011-09-06 21:43:46 +00:00
Chris Lattner
f2ae02a7b2
switch a couple of files to use AST.h umbrella header. Swift eagerly awaits clang modules...
...
Swift SVN r691
2011-09-06 07:01:03 +00:00
John McCall
ccb2d4e98f
Framework for builtin lookup.
...
Swift SVN r685
2011-09-03 06:51:34 +00:00
John McCall
4a0f713e62
Progress towards a builtin module.
...
Swift SVN r682
2011-09-03 05:35:49 +00:00
Chris Lattner
0090c43b80
all members of a protocol have to be NamedDecl's, tighten up
...
typing. Various tidying up.
Swift SVN r678
2011-09-02 00:58:38 +00:00
Chris Lattner
34ec8bc4aa
implement support for var members of protocols.
...
Swift SVN r672
2011-09-01 21:57:35 +00:00
Chris Lattner
a838f412f4
eliminate ProtocolFuncElementDecl, just use FuncDecl instead.
...
Swift SVN r668
2011-09-01 18:17:12 +00:00
Chris Lattner
70bbb65241
make ProtocolType a DeclContext, add AST and trivial sema support for
...
ProtocolFuncElementDecl, the first thing we will allow in a protocol.
Swift SVN r664
2011-08-31 23:31:42 +00:00
Chris Lattner
cd66133b48
simplify interface to OneOfType::getNew.
...
Swift SVN r663
2011-08-31 23:11:05 +00:00
Chris Lattner
bd9e21ed01
add a method to get an ASTContext from a DeclContext.
...
Swift SVN r662
2011-08-31 23:09:32 +00:00
Chris Lattner
74b804a03a
rearrange DeclContext arguments so that they are at the end, not the beginning.
...
Swift SVN r661
2011-08-31 23:05:51 +00:00
John McCall
6dfa91282d
'float' -> 'float32', 'double' -> 'float64'
...
Swift SVN r654
2011-08-31 19:57:52 +00:00
Chris Lattner
f9b024adb0
implement parser and AST support for trivial (empty) protocol types.
...
Swift SVN r652
2011-08-31 19:43:06 +00:00
John McCall
58b81c8da0
Add builtin float and double types.
...
Swift SVN r650
2011-08-31 18:43:22 +00:00
John McCall
6daf126d7a
Remove spurious colons from tuple type elements.
...
Swift SVN r649
2011-08-31 03:11:50 +00:00
John McCall
b2bd8e12a7
Introduce the idea of a DeclContext.
...
Swift SVN r623
2011-08-25 19:26:50 +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