Commit Graph

28382 Commits

Author SHA1 Message Date
John McCall
f4ce88878a Remove the reference accessor to ValueDecl::Init.
Swift SVN r945
2011-12-21 03:06:27 +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
fe4a1ffeed diagnose uses of integers that are too large for their datatype.
Swift SVN r935
2011-12-14 23:53:21 +00:00
Chris Lattner
eb61c1568f diagnose implementations of convert_from_integer_literal
with an incorrect type.


Swift SVN r933
2011-12-14 21:51:07 +00:00
Chris Lattner
27d1eb3b44 diagnose ambiguous integer conversions.
Swift SVN r931
2011-12-14 21:20:53 +00:00
Chris Lattner
6dc19d4744 check that literal types have the required method, rejecting invalid conversions of literals to (e.g.) bool.
Swift SVN r930
2011-12-14 21:01:41 +00:00
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
a1f7eefba3 Extract out decl attributes into a separately-allocated structure.
Swift SVN r920
2011-12-10 00:39:10 +00:00
John McCall
6b935588e5 On second thought, components need to be known in the AST.
Swift SVN r918
2011-12-07 03:57:41 +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
Chris Lattner
be5120b180 rearrange code in x.y to only dig into structs to handle tuple lookup.
Swift SVN r915
2011-12-07 00:18:14 +00:00
Chris Lattner
ff130c602e implement dot lookup in extensions!
Swift SVN r913
2011-12-07 00:11:01 +00:00
Chris Lattner
5da9f8ade2 add TinyPtrVector to LLVM.h
Swift SVN r905
2011-12-06 01:46:23 +00:00
Chris Lattner
32b248b7e3 [gs]etterize various members of Module, and make them check the invariants they depend on.
Swift SVN r903
2011-12-06 01:02:09 +00:00
Chris Lattner
212b56afec actually, the ASTStage should be on Translation unit. There can be multiple modules in a context and they can all be in different phases of translation.
Swift SVN r902
2011-12-06 00:51:56 +00:00
Chris Lattner
eaa6fcb12a move prototype for the verifier into Subsystems.
Swift SVN r901
2011-12-06 00:34:16 +00:00
Chris Lattner
02c9d9a3f1 Make the AST "phase" part of ASTContext, this is generally useful for assertions.
Swift SVN r900
2011-12-06 00:32:00 +00:00
Chris Lattner
3d8fe587c1 the world has moved to using getters, conform.
Swift SVN r894
2011-11-29 22:47:23 +00:00
Chris Lattner
ef5fc52220 add basic type checking.
Swift SVN r893
2011-11-29 22:45:38 +00:00
Chris Lattner
d666cc4fda define ExtensionDecl.
Swift SVN r892
2011-11-29 22:40:24 +00:00
John McCall
94021a90be Finish getterizing Decl.h.
Swift SVN r889
2011-11-18 01:29:31 +00:00
John McCall
32736ea2ab Rename hasSingleElement to isTransparentType to better
capture what's being tested.  This also makes IR gen
correctly avoid a discriminator for a non-transparent
single-element oneof.



Swift SVN r887
2011-11-18 01:17:53 +00:00
John McCall
b700f171a2 More getters.
Swift SVN r886
2011-11-18 01:10:03 +00:00
John McCall
d716f82984 Getterize ValueDecl.
Swift SVN r885
2011-11-18 01:04:12 +00:00
John McCall
9079154ded Getterize TypeAliasDecl.
Swift SVN r884
2011-11-18 00:48:14 +00:00
John McCall
50fb0d63f6 More incremental getterization.
.w



Swift SVN r883
2011-11-18 00:29:15 +00:00
John McCall
d74f17259c Incremental getterization of Decl.h.
Swift SVN r882
2011-11-18 00:17:20 +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
John McCall
d3f1048644 When type-checking blah.$2, be sure to set 2 as the field index
on the expression.



Swift SVN r873
2011-11-17 09:28:47 +00:00
John McCall
8022ee67cc Fix a bug with folding sequences of left-associative
operators that was caught by Doug's source-range
verifier.  Thanks, Doug!



Swift SVN r870
2011-11-17 05:01:31 +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
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
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
Doug Gregor
b1c98e1731 Introduce Lexer::getLocForEndOfToken() to adjust source locations to
the end of the current token, and use it for proper translation from
SourceRange to SMRange when printing diagnostics.



Swift SVN r853
2011-11-09 22:03:30 +00:00
Doug Gregor
dc8d4d7df9 Teach CMake about the various header files in the lib subdirectories, so they show up in the project.
Swift SVN r849
2011-11-09 18:02:12 +00:00
Doug Gregor
7f1ad8111e Make a few more diagnose() methods return InFlightDiagnostic.
Swift SVN r848
2011-11-09 18:01:37 +00:00
Doug Gregor
cd7a21de83 Introduce support for adding source ranges to diagnostics.
We don't yet properly perform the SourceRange -> llvm::SMRange mapping. 

Swift SVN r847
2011-11-09 17:53:30 +00:00
Chris Lattner
9e9f421f1a getAliasType() doesn't need an ASTContext argument anymore.
Swift SVN r816
2011-11-01 18:37:05 +00:00
Chris Lattner
d2ed4c2f3f remove some unneeded ASTContext arguments from subsystem entrypoints
now that it is reachable from TU


Swift SVN r815
2011-11-01 18:33:48 +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
5daed86322 give TypeChecker the current translation unit being scanned, instead of just the ASTContext.
Swift SVN r813
2011-11-01 06:48:35 +00:00
Chris Lattner
2dcaed352b tidy up
Swift SVN r812
2011-11-01 06:47:50 +00:00
Chris Lattner
164ab0ffee move lookupTypeName out to Module::lookupGlobalType and have it look in the current
module as well for consistency.


Swift SVN r811
2011-11-01 06:27:24 +00:00
Chris Lattner
e0a18996cd move lookupGlobalValue into Module, making it accessable to all of sema.
Swift SVN r810
2011-11-01 06:22:44 +00:00
Chris Lattner
5d8d0fd2f6 Have the name binder publish the list of imported modules into the TranslationUnit,
making it a real part of the AST.  Also, rework TUModuleCache to do its computation
when it is constructed, instead of trying in each query.


Swift SVN r809
2011-11-01 06:19:36 +00:00
Chris Lattner
1f42ec4679 rename method for consistency.
Swift SVN r808
2011-11-01 06:01:45 +00:00
Chris Lattner
623de6cefc now that ModuleProvider is gone, we can match against the module name
instead of the access path.  Tracking just the access path in the
imports list greatly simplifies all of the client and means that we
don't have to create a bogus ImportDecl for the builtin module just
to make name lookup work.


Swift SVN r807
2011-11-01 05:40:55 +00:00
Chris Lattner
17fd6242fc now that Module's have their own cache of name lookup info... including the current
module we're working on, eliminate the cloned version of the value lookup code
from NameBinder.


Swift SVN r806
2011-11-01 05:36:57 +00:00
Chris Lattner
69fb3842fc give name binder the translation unit it is binding.
Swift SVN r805
2011-11-01 05:34:18 +00:00
Chris Lattner
dd63b23985 strength reduce.
Swift SVN r804
2011-11-01 05:25:54 +00:00