Commit Graph

22474 Commits

Author SHA1 Message Date
Chris Lattner
98c5f5fad4 change BuiltinIntegerType to keep its width as an ivar, eliminating the
number of switches scattered through the compiler.


Swift SVN r964
2011-12-22 06:50:34 +00:00
Chris Lattner
9c3ad3eb30 include types we're trying to convert to in a few diagnostics.
Swift SVN r962
2011-12-22 06:27:54 +00:00
Chris Lattner
ac0662003c add a note to clarify a potentially confusing case of an improperly defined conversion function. In this case we now produce:
test/expressions.swift:316:4: error: inferred type 'bool' is not compatible with integer literals
   4 //expected-error {{inferred type 'bool' is not compatible with integer literals}}
   ^
test/expressions.swift:312:3: note: while processing argument of conversion function to inferred type 'int_test5'
  plus func convert_from_integer_literal(val : bool) -> int_test5 {}  // expected-note {{while processing argument of conversion function to inferred type 'int_test5'}}
  ^
test/expressions.swift:315:1: note: while converting 'var' initializer to declared type
var il_g : int_test5 = // expected-note {{while converting 'var' initializer}}
^



Swift SVN r961
2011-12-22 06:25:50 +00:00
Chris Lattner
a2ee92258f make a diagnostic more precise and useful.
Swift SVN r960
2011-12-22 06:17:02 +00:00
Chris Lattner
98703ab7d2 switch the convert_from_integer_literal function to being a plus function and check its new type constraints.
Swift SVN r951
2011-12-22 00:19:53 +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
17b11e9bbd implement parsing, AST, and LangRef support for 'plus' methods. Dot syntax will need some work though to actually use them.
Swift SVN r949
2011-12-21 23:21:58 +00:00
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
John McCall
8a8f297bde Basic resilience query.
Swift SVN r937
2011-12-15 00:45:31 +00:00
Chris Lattner
affba280f0 fix constness.
Swift SVN r936
2011-12-15 00:37:03 +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
6315b94e6b split out integer types to their own subclass of BuiltinType.
Swift SVN r932
2011-12-14 21:49:08 +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
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