This patch adds a new 'pound_os' token, a new case for it in parseExprPostfix, and parsing of platform version constraints, e.g., OSX >= 10.10.
It also adds enough type checking and SILGen to get the parsing tests to run without triggering "Unimplemented" assertions.
Swift SVN r21865
-Previously the range would include the right brace of the computed variable but not the left one
-Incomplete implicit getter would trigger assertion in the AST verifier.
rdar://18189904
Swift SVN r21659
This will let the performance inliner inline a function even if the costs are too high.
This attribute is only a hint to the inliner.
If the inliner has other good reasons not to inline a function,
it will ignore this attribute. For example if it is a recursive function (which is
currently not supported by the inliner).
Note that setting the inline threshold to 0 does disable performance inlining at all and in
this case also the @inline(__always) has no effect.
Swift SVN r21452
Introduce an attribute that describes when a given CF type is
toll-free-bridged to an Objective-C class, and which class that
is. Use that information in the type checker to provide the CF <->
Objective-C toll-free-bridged conversions directly, rather than using
the user-defined conversion machinery.
Swift SVN r21376
This disables inlining at the SIL level. LLVM inlining is still enabled. We can
use this to expose one function at the SIL level - which can participate in
dominance based optimizations but which is implemented in terms of a cheap check
and an expensive check (function call) that benefits from LLVM's inlining.
Example:
The inline(late) in the example below prevents inlining of the two checks. We
can now perform dominance based optimizations on isClassOrObjExistential.
Without blocking inlining the optimizations would apply to the sizeof check
only and we would have multiple expensive function calls.
@inline(late)
func isClassOrObjExistential(t: Type) -> Bool{
return sizeof(t) == sizeof(AnyObject) &&
swift_isClassOrObjExistential(t)
}
We do want inlining of this function to happen at the LLVM level because the
first check is constant folded away - IRGen replaces sizeof by constants.
rdar://17961249
Swift SVN r21286
Also avoid printing "@sil_stored let {get}", we currently can't generate
var_decl for it. Add diagnostics when looking up members.
Fix rdar://17712570
Swift SVN r20818
This moves a crude parser check for stored properties in enums & extensions into Sema, and changes it
to be correct (rejecting the case that caused the crash in the radar) as well as more descriptive.
Swift SVN r20695
The eventual goal for extensions of generic types is to require them
to specify their generic parameters, e.g.,
extension Array<T> { ... }
rather than today's
extension Array { ... }
Start parsing (optional) generic parameters here, and update the
representation of ExtensionDecl to accomodate this new grammar
production. Aside from the parser changes, there's no intended
functionality change here.
Swift SVN r20682
The next token may be EOF and does not technically belong to this virtual
source file, so instead let's end the previous virtual source file at
the beginning of the #line token and not confuse the SourceManager.
No testcase here , because it's impossible to create such a situation
without going via LLDB.
Swift SVN r20654
...or at least the same machinery as #line. We add a (referential) mirror
of the Clang buffer to Swift's source manager, then remap that particular
line to whatever Clang currently thinks is the presumed location for that
line. (This means we respect Clang line directives too.)
This also modifies Swift's source manager to be more forgiving about adding
the same virtual file range twice; it will tell you when you try to do it.
<rdar://problem/16596800>
Swift SVN r20572
As part of this change, allow #line directives to extend to the end of the
file, rather than requiring a reset.
Note that #line regions that start or end within function bodies will not
behave correctly when in delayed parsing modes. This was true before and
after this commit. (#line regions contained entirely within a function and
not within any other #line regions should be fine.)
Swift SVN r20571
to emit fixit's when we rename something, e.g.:
t.swift:6:9: error: 'float' has been renamed to Float
var y : float
^~~~~
Float
Adopt this in the stdlib.
Swift SVN r20549
it indirectly through another pointer from Decl, just embed DeclAttributes
directly into Decl and get rid of the "getMutableAttrs" nonsense.
Swift SVN r20216
Before this commit, we were not able to differentiate between stored
property and stored_with_trivial_accessors property. This causes issues
when parsing a SILDeclRef to a trivial getter.
We add @sil_stored for stored properties and we will have 3 cases
A) for stored property: @sil_storage var x : Int
B) for stored_with_trivial_accessors property:
@sil_storage var x : Int { get set }
C) for computed property: var x : Int { get set }
Fix rdar://17715778 rdar://17381432 rdar://17347296.
Swift SVN r20189
allowing us to give them a better name and dox comment them. This elimiantes a duplicate copy from the IDE layer as well, ensuring consistency.
Swift SVN r20075
To answer "did the user specify this, or is it implicit", stick a couple
of is-implicit bits in InfixOperatorDecl, and thread them through
serializaton/deserialization.
Swift SVN r20067
Also:
- merge the test/decl/func/functions_new.swift testcase into test/Sema/immutability.swift,
where the bulk of similar tests are.
- Move the type checking logic for 'dynamic' out of ValidateAttrs into TypeCheckAttrs
- Change the encoding for 'override' to 49 so that stuff vbr's so much more densely :-)
Swift SVN r20006
attribute. As part of this, introduce a new "NotSerialized" flag in Attr.def.
This eliminates a bunch of special case code in the parser and elsewhere for handling
this modifier.
Swift SVN r19997
to operator decls, and validate the attributes in the type checker. This allows
us to reject invalid operator decls (resolving a fixme) and restores syntax coloring
of 'infix' on an operator (a regression in my last patch).
Swift SVN r19932
modifiers and with the func implementations of the operators. This resolves the rest of:
<rdar://problem/17527000> change operator declarations from "operator prefix" to "prefix operator" & make operator a keyword
Swift SVN r19931
eliminating the @'s from them when used on func's. This is progress towards
<rdar://problem/17527000> change operator declarations from "operator prefix" to "prefix operator" & make operator a keyword
This also consolidates rejection of custom operator definitions into one
place and makes it consistent, and adds postfix "?" to the list of rejected
operators.
This also changes the demangler to demangle weak/inout/postfix and related things
without the @.
Swift SVN r19929