Chris Lattner
b737b112e7
modernize ProtocolType a bit to follow the form of OneOfType
...
Swift SVN r991
2012-01-05 21:51:48 +00:00
John McCall
05495d67d9
Check that assignments are to l-values. It really is this easy.
...
Now back to debugging the crashing test.
Swift SVN r990
2012-01-05 07:59:41 +00:00
John McCall
b2569c7786
Provide PrettyStackTraceEntries for Expr* and Stmt* as well,
...
and type-check functions within the former.
Swift SVN r989
2011-12-23 03:53:23 +00:00
John McCall
5bdea18fc4
Introduce a PrettyStackTraceEntry implementation for
...
processing declarations and use it in debug builds whenever
the tree walker walks into a Decl.
Swift SVN r984
2011-12-23 01:58:26 +00:00
Chris Lattner
19b7a934a1
rename BuiltinFloatingPointType to BuiltinFloatType.
...
Swift SVN r980
2011-12-23 00:07:58 +00:00
Chris Lattner
320e4747cc
Codegen was silently truncating IntegerLiteralExpr's to 64 bits, bad codegen!
...
Swift SVN r979
2011-12-23 00:04:06 +00:00
Chris Lattner
926a3fe671
completely reimplement floating point literals to follow the model of integer literals.
...
Among other things, this gives us the amazing power to accept "var x : float = 0.0"
Swift SVN r978
2011-12-22 23:50:03 +00:00
Chris Lattner
27f4709e05
remove #if 0 code.
...
Swift SVN r974
2011-12-22 22:17:40 +00:00
Chris Lattner
c91c1d9db1
generalize builtin floating point types to support all of the FP types
...
that LLVM supports. The standard library still only exports float and double,
but the swift core should be more general. Yay for PPC128 :)
Swift SVN r973
2011-12-22 22:01:07 +00:00
Chris Lattner
d525ba5fda
simplify builtin type processing by eliminating BuiltinTypeKind.
...
Swift SVN r967
2011-12-22 07:38:17 +00:00
Chris Lattner
6a51dbba34
Remove hard coded list of integer types from ASTContext, making BuiltinIntegerType have a "plus" factory method to create them like other types.
...
Swift SVN r966
2011-12-22 07:07:01 +00:00
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