Commit Graph

22610 Commits

Author SHA1 Message Date
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
Chris Lattner
5f1f4d8ce9 simplify code in Parser::actOnOneOfType now that oneof's always have names.
Give OneOfType an ivar for its TypeAlias.  It already knew its DeclContext.



Swift SVN r923
2011-12-13 01:41:19 +00:00
John McCall
4167366d02 Parse resilience attributes.
Swift SVN r921
2011-12-10 02:43:40 +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
3456720d86 Extract decl attributes out into their own file.
Swift SVN r919
2011-12-08 00:22:16 +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
ff130c602e implement dot lookup in extensions!
Swift SVN r913
2011-12-07 00:11:01 +00:00
John McCall
c756d37afd Basic Component interface.
Swift SVN r911
2011-12-06 21:48:27 +00:00
Chris Lattner
900d45f3c0 implement a Module::lookupExtensions method to find all the extensions for a
given type in a given module.  This depends on llvm r145898.


Swift SVN r906
2011-12-06 02:07:13 +00:00
Chris Lattner
5da9f8ade2 add TinyPtrVector to LLVM.h
Swift SVN r905
2011-12-06 01:46:23 +00:00
Chris Lattner
fcdddd8d97 move ASTStage up to Module, sigh.
Swift SVN r904
2011-12-06 01:20:18 +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
8d53c9f3b9 restrict 'extension' to only exist at file scope.
Swift SVN r899
2011-12-06 00:11:13 +00:00
Chris Lattner
d9c15ebb9a make ExtensionDecl be a DeclContext, install members into it properly.
Swift SVN r896
2011-12-05 23:22:04 +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
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
Chris Lattner
4f7c4c535e random tidying
Swift SVN r868
2011-11-10 22:12:09 +00:00
Chris Lattner
7e96d0d53e embrace macro metaprogramming for decls.
Swift SVN r867
2011-11-10 22:08:46 +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
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
Doug Gregor
fc183b9cc3 Decouple the lexer from the ASTContext and specific BufferID. They
aren't needed for the lexer proper (which just needs a buffer to dig
through). Also, make it possible to suppress lexer diagnostics merely
by not giving it a diagnostic engine to work with.


Swift SVN r852
2011-11-09 21:49:40 +00:00
Doug Gregor
725298a2da Introduce a DiagnosticConsumer abstract interface that is used to
actually render emitted diagnostics. This is both a useful
generalization (we expect to have a number of other
DiagnosticConsumers down the road, as Clang does) and is also
important now to avoid a layering violation when adjusting the source
location at the end of a SourceRange to the end of the token.

 


Swift SVN r850
2011-11-09 18:59:39 +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
Doug Gregor
e12215b1be Introduce InFlightDiagnostic, a move-only class that will be used to emit "extra" information (ranges, Fix-Its, etc.) for a diagnostic. It's quite similar in design to Clang's DiagnosticBuilder, but slightly cleaner/more restrictive.
Note that I had to re-implement llvm::Optional, since it lamely requires a default constructor. At some point, I'll push a proper implementation back to LLVM.

Swift SVN r845
2011-11-09 17:19:30 +00:00
Doug Gregor
7106232181 Generalize the Diag<...> specializations within Diagnostic and
DiagnosticEngine so that they work properly (without extensions) for
zero arguments. Then, eliminate the zero-argument specializations.


Swift SVN r844
2011-11-09 16:00:36 +00:00
Chris Lattner
ffa9a55002 implement skeleton of extension body parsing.
Swift SVN r839
2011-11-09 00:49:54 +00:00
Chris Lattner
0b9b982758 rework parseDecl to do validation itself, allow decls in oneof's
Swift SVN r837
2011-11-08 22:41:27 +00:00
Chris Lattner
d95aadc8bf structs can now contain any 'decl'
Swift SVN r831
2011-11-08 19:45:24 +00:00
Chris Lattner
eac219bee8 Rework the decl grammar a bit: now "decl" doesn't include import
declarations, but they are explicitly allowed at translation unit scope.
This also introduces a parseDecl method which does the obvious thing.



Swift SVN r830
2011-11-08 19:30:00 +00:00
Chris Lattner
b61fe6db10 reject unnamed members in structs.
Swift SVN r829
2011-11-08 00:08:05 +00:00
Chris Lattner
ff63661812 disallow operators in structs.
Swift SVN r827
2011-11-07 23:39:15 +00:00
Chris Lattner
32af5d5038 add a test for .area on rects.
Swift SVN r825
2011-11-03 22:37:24 +00:00