Commit Graph

255 Commits

Author SHA1 Message Date
Adrian Prantl
e02f42a460 Debug info: make sure we're using the internal DW_LANG_Swift enum for now.
Swift SVN r17748
2014-05-09 00:55:28 +00:00
Adrian Prantl
6389760e26 Debug info: Support DynamicSelf type.
Swift SVN r17704
2014-05-08 17:49:59 +00:00
Adrian Prantl
91d6140aa5 Rename a couple of variables for consistency.
Swift SVN r17592
2014-05-07 00:29:58 +00:00
Adrian Prantl
b0aa5e34e0 Debug info: Do not emit static variables for metatypes for global class
definitions.

<rdar://problem/16783583> Evaluating expressions in contexts containing class declarations fails

Swift SVN r17591
2014-05-07 00:29:57 +00:00
Ted Kremenek
050fd53af7 Rename UncheckedOptional to ImplicitlyUnwrappedOptional.
Swift SVN r17232
2014-05-02 06:13:57 +00:00
Chris Lattner
a7012f23ef Remove swift::ArrayType. It is dead and vestigial code for supporting fixed size
arrays, which never got baked.  Remove it until we have time to do things right.


Swift SVN r16995
2014-04-28 21:18:27 +00:00
Adrian Prantl
9a19300489 Debug info: Emit all srtruct types with Swift as runtime language so the
accelerator-table mangled-name logic in LLVM works as expected.
<rdar://problem/16730603> Debug info for variable of type NSError does not provide mangled name

Swift SVN r16846
2014-04-25 22:30:31 +00:00
Adrian Prantl
08178d4520 Debug info: Mark allocating constructors artificial.
<rdar://problem/16349779> line table for _allocating_init constructor is odd

Swift SVN r16727
2014-04-23 23:55:46 +00:00
Adrian Prantl
f68f0e81d1 Debug info: represent function pointers as indirect function types.
<rdar://problem/14960518> Incorrect debug info for function pointer

Swift SVN r16716
2014-04-23 20:59:45 +00:00
Adrian Prantl
146c559ee7 remove dead code.
Swift SVN r16714
2014-04-23 20:59:43 +00:00
Adrian Prantl
23f47790e5 Debug info: Retire DW_TAG_meta_type now and use a proper mangled name
instead.
<rdar://problem/16439075> LLDB is trying to print type metadata as an instance

Swift SVN r16710
2014-04-23 19:52:19 +00:00
John McCall
b38a63950d Implement @unowned(unsafe).
This was part of the original weak design that
there was never any particular reason to rush the
implementation for.  It's convenient to do this now
so that we can use it to implement Unmanaged<T> for
importing CF types.

Swift SVN r16693
2014-04-23 08:51:23 +00:00
Adrian Prantl
b1d9d186a0 [please update llvm] Debug info: Use the mangled name as unique identifier
for types where possible.

We use the DICompositeType's UniqueIdentifier field to store the mangled
name, the name field to store the base name and Apple-llvm will emit the
unique identifier as DW_AT_name if RunTimeLang == Swift. This way the
metadata format is compatible between swift and non-Apple clang.
As bonus, we get mangled-name-based type uniquing for swift.

<rdar://problem/16303510> apple-types accelerator table should include basename for swift types

Swift SVN r16665
2014-04-22 21:55:32 +00:00
John McCall
8681963bcb A couple of long-overdue renames.
Builtin.ObjectPointer -> Builtin.NativeObject
Builtin.ObjCPointer -> Builtin.UnknownObject

Swift SVN r16634
2014-04-22 00:17:08 +00:00
Adrian Prantl
a17c8cccc0 Debug Info: Emit all types (with the exception of builtins and qualified
types) in their actual context rather than the context of their first use.
Fixes several FIXMEs and <rdar://problem/16654720>.

Swift SVN r16596
2014-04-20 19:32:35 +00:00
Andrew Trick
65f5a7a1e6 Fix a missing check for null SILDebugScope.
Fixes a crash building Foundation.swift with
SWIFT_ASSERTS=NO
-g -O2 Foundation.swift

The following function had no debug scope:
// reabstraction thunk helper from @callee_owned (@owned Swift.UncheckedOptional<Swift.String>, @unowned C._NSRange, @unowned C._NSRange, @owned Swift.CMutablePointer<ObjectiveC.ObjCBool>) -> (@unowned ()) to @callee_unowned @objc_block (@unowned Swift.UncheckedOptional<ObjectiveC.NSString>, @unowned C._NSRange, @unowned C._NSRange, @unowned Swift.UnsafePointer<ObjectiveC.ObjCBool>) -> (@unowned ())
sil shared [transparent] @_TTRXFo_oGSQSS_dVSC8_NSRangedS_oGVSs15CMutablePointerV10ObjectiveC8ObjCBool__dT__XFdCb_dGSQCSo8NSString_dS_dS_dGVSs13UnsafePointerS2___dT__ : $@cc(cdecl) @thin

Swift SVN r16496
2014-04-18 05:13:34 +00:00
Joe Groff
f7cf592777 Add a SIL-only '@block_storage T' type to represent on-stack storage for blocks.
Blocks need to be born on the stack, so we need a way to represent that on-stack storage. @block_storage T will represent the layout of a block that contains storage for a capture of type T.

Swift SVN r16355
2014-04-15 03:56:09 +00:00
Adrian Prantl
9306fef294 Debug info: Emit the appropriate decl_file/line for import declarations.
rdar://problem/16565308

Swift SVN r16353
2014-04-15 03:08:22 +00:00
Adrian Prantl
79feaa894f [update LLVM] Debug info: Emit modules as DW_TAG_module.
<rdar://problem/16513629> Cleanup DWARF output for WWDC
<rdar://problem/16565308> Fix debug info for modules after LLVM r205685

Swift SVN r16352
2014-04-15 02:31:10 +00:00
Adrian Prantl
3db3eab09c Debug info: Cleanup: use a single catch-all for all internal opaque types.
Swift SVN r16132
2014-04-09 22:09:03 +00:00
Joe Groff
8adaab0233 Fold ExtInfo::isThin and ::isBlock into a "Representation" enum.
These bits are orthogonal to each other, so combine them into one, and diagnose attempts to produce a type that's both. Spot-fix a bunch of places this revealed by inspection that we would have crashed in SILGen or IRGen if blocks were be handled.

Swift SVN r16088
2014-04-09 00:37:26 +00:00
Adrian Prantl
8d0e1d3376 [PLEASE UPDATE LLVM/CLANG] Debug info: Rebase DWARF output for imported
modules on LLVM/trunk.
This should fix most open module related bugs and in a way that is
compatible with upstream LLVM.

<rdar://problem/16539726> Fix debug info for modules after LLVM r205685
<rdar://problem/16504765> Emit DW_TAG_namespace entry for the current module into DWARF

Swift SVN r16086
2014-04-09 00:11:02 +00:00
Adrian Prantl
f3de7e6b17 Debug info: use the proper version string, now that we have one.
Swift SVN r16085
2014-04-09 00:11:01 +00:00
Doug Gregor
91629378c1 Unbreak the build after r205685, although now we have test failures.
Swift SVN r16005
2014-04-07 06:15:16 +00:00
John McCall
f1180f5e6d in order to work correctly for non-@objc protocols.
Language features like erasing concrete metatype
values are also left for the future.  Still, baby steps.

The singleton ordinary metatype for existential types
is still potentially useful; we allow it to be written
as P.Protocol.

I've been somewhat cavalier in making code accept
AnyMetatypeType instead of a more specific type, and
it's likely that a number of these places can and
should be more restrictive.
When T is an existential type, parse T.Type as an
ExistentialMetatypeType instead of a MetatypeType.

An existential metatype is the formal type
 \exists t:P . (t.Type)
whereas the ordinary metatype is the formal type
 (\exists t:P . t).Type
which is singleton.  Our inability to express that
difference was leading to an ever-increasing cascade
of hacks where information is shadily passed behind
the scenes in order to make various operations with
static members of protocols work correctly.

This patch takes the first step towards fixing that
by splitting out existential metatypes and giving
them a pointer representation.  Eventually, we will
need them to be able to carry protocol witness tables

Swift SVN r15716
2014-04-01 00:38:28 +00:00
Doug Gregor
1cdd295182 Move the @objc attribute over to a DeclAttribute.
Swift SVN r15517
2014-03-26 19:33:07 +00:00
Adrian Prantl
493eab817c Debug info: don't crash on implicit clang decls. rdar://problem/16307518.
Swift SVN r15173
2014-03-18 00:29:52 +00:00
Adrian Prantl
9f8adfa401 silence warning
Swift SVN r15172
2014-03-18 00:29:46 +00:00
Chris Lattner
2593a52b99 implement <rdar://problem/16191398> add an 'oldValue' to didSet so you can implement "didChange" properties
This names the implicit argument "oldValue".  Whether we keep implicit arguments or not
is a subject of debate, tracked by rdar://16268361.



Swift SVN r14819
2014-03-08 02:15:01 +00:00
Greg Parker
a11eff260f Adapt to header file changes in llvm r203038 and r203046.
Swift SVN r14716
2014-03-06 02:04:32 +00:00
Argyrios Kyrtzidis
918abab467 Update for llvm API change in r202736.
Swift SVN r14612
2014-03-03 22:00:33 +00:00
Michael Gottesman
4c3ae242d9 Disable debug info for "*_external" linkage functions and an assertion on certain SILLocations to avoid the fact we don't serialize DebugScopes.
The specific SILLocations are: SILFileKind, InlineKind, and
MandatoryInlineKind.

This was done in coordination with Adrian Prantl.

Swift SVN r14580
2014-03-03 03:15:36 +00:00
Adrian Prantl
8948375658 Debug Info: Cleanup: Remove debug scope from DebugTypeInfo.
Swift SVN r14548
2014-03-01 00:50:50 +00:00
Argyrios Kyrtzidis
eeb9589d2c [AST] Introduce "hasName()" convenience methods and replace "getName().empty()" callers.
Swift SVN r14206
2014-02-21 15:00:38 +00:00
Adrian Prantl
c1eda9c7e7 Debug info: do not emit linetable info for ObjC thunks and other auto_gen
code.
<rdar://problem/15975329> Don't emit line numbers for Thunks

Swift SVN r13872
2014-02-13 20:33:33 +00:00
Adrian Prantl
89ca27aebd fix 80-column violations.
Swift SVN r13871
2014-02-13 20:33:32 +00:00
Joe Groff
42677b21d1 IRGenDebugInfo: Stub out debug info for dependent types.
Build debug info for function types using the interface types of their lowered SILFunctionTypes. We can't use the archetype path to declare dependent parameter types of a generic function, since the function type can't be tied to any specific decl context, so stub them out as an UnspecifiedType for now.

Swift SVN r13722
2014-02-09 22:25:58 +00:00
Mark Lacey
08fb77b0b9 Revert "IRGenDebugInfo: Contextualize interface types to get archetype parameter types."
This reverts commit r13693, which breaks the stdlib build.

Swift SVN r13704
2014-02-09 09:09:08 +00:00
Joe Groff
3899d1bfd5 IRGenDebugInfo: Contextualize interface types to get archetype parameter types.
Use the debug DeclContext to contextualize interface types before emitting debug info for them.

Swift SVN r13693
2014-02-09 03:25:10 +00:00
Adrian Prantl
bacd2d3c04 Debug info: Fix the locations for branches in case statements.
<rdar://problem/15899195> Step from a case the middle of a switch goes to the beginning of the containing function

Swift SVN r13623
2014-02-07 02:37:36 +00:00
Chris Lattner
827acad533 Various inout improvements:
- purge @inout from comments in the compiler except for places talking about
   the SIL argument convention.
 - change diagnostics to not refer to @inout
 - Change the astprinter to print InoutType without the @, so it doesn't show
   up in diagnostics or in closure argument types in code completion.
 - Implement type parsing support for the new inout syntax (before we just 
   handled patterns).
 - Switch the last couple of uses in the stdlib (in types) to inout.
 - Various testcase updates (more to come).



Swift SVN r13564
2014-02-06 06:22:27 +00:00
Argyrios Kyrtzidis
48023490de [AST] Move AccessorKind enum to top-level so it can be forward declared.
No functionality change.

Swift SVN r13299
2014-02-01 08:50:15 +00:00
Doug Gregor
030770a8c2 Make DynamicSelf into its own special type node.
Making DynamicSelf its own special type node makes it easier to opt-in
to the behavior we want rather than opting out of the behavior we
don't want. Some things already work better with this representation,
such as mangling and overriding; others are more broken, such as the
handling of DynamicSelf within generic classes and the lookup of the
DynamicSelf type.


Swift SVN r13141
2014-01-30 05:36:20 +00:00
Adrian Prantl
72984b44dc add an assertion
Swift SVN r13123
2014-01-29 22:15:53 +00:00
Adrian Prantl
18b4ec2f5b simplify code
Swift SVN r13122
2014-01-29 22:15:51 +00:00
Chris Lattner
290a58494e Implement debug info for willset/didset, and teach dispatch to be non-virtual
to didset/will set since we don't drop these in the class vtable.


Swift SVN r13056
2014-01-28 06:33:31 +00:00
Chris Lattner
5b0ecdace1 This went with r12994
Swift SVN r12995
2014-01-27 17:57:54 +00:00
Adrian Prantl
e1387cf7ef reorder functions in the file
Swift SVN r12804
2014-01-22 22:42:07 +00:00
Adrian Prantl
eef4a53bcd Cleanup: Move code to a more appropriate location.
Swift SVN r12802
2014-01-22 22:42:06 +00:00
Doug Gregor
d52cec4b20 Eliminate a pile of literal identifiers for self, init, destructor, etc.
... because I can't stomach adding another one of these.


Swift SVN r12687
2014-01-22 01:09:49 +00:00