Commit Graph

1184 Commits

Author SHA1 Message Date
Chris Lattner
d4a5cea2c7 consolidate routines for applying a type to an integer literal, and move our current sema for too-large integer values to it.
Swift SVN r924
2011-12-13 19:37:13 +00:00
John McCall
d74f17259c Incremental getterization of Decl.h.
Swift SVN r882
2011-11-18 00:17:20 +00:00
Doug Gregor
1ed6cdbb09 Fix broken source-range information for expressions of the form "x.y".
Swift SVN r861
2011-11-10 17:25:08 +00:00
Chris Lattner
9e783adda1 introduce and use a new parseMatchingToken method.
Swift SVN r841
2011-11-09 01:09:07 +00:00
Chris Lattner
f02dc055d3 introduce a form of parseToken that returns the location of the parsed token
on success, allowing simplifications in clients.


Swift SVN r840
2011-11-09 00:56:52 +00:00
Chris Lattner
828045f8b5 make the dot optional in tuple literals, now you can use
foo(x = 4, 7) instead of foo(.x = 4, 7).  This resolves
rdar://10157455


Swift SVN r817
2011-11-01 21:06:22 +00:00
Chris Lattner
da564d50d3 A long journey later, implement support for type inference of integer literals instead of
forcing them to int64 all the time.  Now the integer_literal_type in the standard library
is only used to resolve ambiguity in expressions.  Among other amazing things, we now
correctly accept:

  var x8 : int8 = 4

without a cast.

This still isn't doing any bounds checking and isn't checking the inferred type to tell if
it is compatible with integer literals (i.e. has a primitive conversion function from the
LLVM IR type).  Enough for now though.

This is progress towards rdar://10357238.



Swift SVN r814
2011-11-01 06:51:50 +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
dfd529ce3a rename diags::foo to diag::foo
Swift SVN r779
2011-10-22 00:36:19 +00:00
Chris Lattner
a1781fed38 switch expr parsing to the new diagnostics subsystem
Swift SVN r766
2011-10-20 20:41:48 +00:00
Chris Lattner
8c07ba4034 switch parseStmtBrace to the new diagnostics api
Swift SVN r764
2011-10-20 20:18:36 +00:00
Chris Lattner
d8343e9a42 convert parseToken to new diagnostic api
Swift SVN r763
2011-10-20 20:09:04 +00:00
Chris Lattner
fcc547d000 switch parseIdentifier and all its uses to the new diagnostics machinery.
Swift SVN r759
2011-10-19 00:57:50 +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
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
b351394b6e Getterify the rest of Expr.h.
Swift SVN r719
2011-09-20 00:18:57 +00:00
Chris Lattner
8eaddc1cda AST support for floating point literals.
Swift SVN r707
2011-09-15 21:37:46 +00:00
Chris Lattner
9d240a1d18 add lexer and langref support for floating point literals. No AST/CodeGen support yet.
Swift SVN r706
2011-09-15 21:29:12 +00:00
John McCall
8a3f79b5bc Document the scope-qualifier grammar correctly in the parser comments.
Swift SVN r695
2011-09-06 21:55:41 +00:00
John McCall
4a0f713e62 Progress towards a builtin module.
Swift SVN r682
2011-09-03 05:35:49 +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
a84673d781 We don't save the access path anywhere when computing function
arguments.



Swift SVN r642
2011-08-30 06:41:19 +00:00
John McCall
34714f3796 CurContext -> CurDeclContext
Swift SVN r641
2011-08-30 06:36:38 +00:00
Chris Lattner
a071b37639 optimize out trivial accessors.
Swift SVN r626
2011-08-25 23:46:51 +00:00
John McCall
b2bd8e12a7 Introduce the idea of a DeclContext.
Swift SVN r623
2011-08-25 19:26:50 +00:00
Chris Lattner
b04c19e647 introduce a enw AST/AST.h umbrella header and use it to
simplify #includes.



Swift SVN r578
2011-08-22 21:02:44 +00:00
Chris Lattner
28f05f0348 add parser and sema support for user defined unary operators.
Swift SVN r572
2011-08-20 00:27:11 +00:00
Chris Lattner
41a924e723 synch up the grammar in the parser and langref, and make the
expression section of langref make more sense.



Swift SVN r571
2011-08-19 23:10:13 +00:00
Chris Lattner
88964126fe remove the old SemaDecl and Sema classes.
Swift SVN r563
2011-08-14 00:33:00 +00:00
Chris Lattner
cb18028c45 rework all of the scope and name lookup logic, introducing a new ScopeInfo class
and moving a bunch more stuff out of SemaDecl.


Swift SVN r561
2011-08-14 00:27:24 +00:00
Chris Lattner
26f66a8b24 move all the parser headers into lib/Parse since they are now all private.
I chose to just delete the -lex action in swift, since it was only useful for
about 10 minutes during bringup and probably never will be again.




Swift SVN r557
2011-08-13 22:51:04 +00:00
Chris Lattner
c863bea58d merge SemaExpr into ParseExpr.cpp
Swift SVN r554
2011-08-13 22:33:33 +00:00
Chris Lattner
047ecf3b27 split expr parsing out to its own file.
Swift SVN r553
2011-08-13 22:17:50 +00:00