Commit Graph

453 Commits

Author SHA1 Message Date
John McCall
16cb523c3a AST support for accessors.
Swift SVN r22228
2014-09-23 20:34:19 +00:00
John McCall
75050f8166 Generate an implicit 'materializeForSet' accessor
along with getters and setters.

Just generate it for now.

Swift SVN r22011
2014-09-17 08:08:03 +00:00
Adrian Prantl
4dca38a8b3 Debug info: Remove the special handling of AnyFunctionType to add an extra
OpDeref to function objects (since Swift doesn't have function *pointer*
types). It confuses the debugger and is inconsistent with how we handle
other types such as classes.

<rdar://problem/18272602> Function pointers in local variables have incorrect DWARF locations

Swift SVN r21792
2014-09-08 23:39:27 +00:00
Adrian Prantl
3de439e574 Support debug info when compiling textual SIL files.
- Use SILFileLocations when compiling .sil with -g.
- Fix a crash when trying to find the Builtin module.

Part of <rdar://problem/17999350> `swiftc -g` crashes in some Swift tests

Swift SVN r21425
2014-08-22 22:48:12 +00:00
Dmitri Hrybenko
e45fe991b0 Update for upstream LLVM API changes in debug info gerenation
Swift SVN r21408
2014-08-22 08:27:57 +00:00
Jordan Rose
903cfacfa5 [DebugInfo] When looking up an imported module, don't include the scope.
i.e. for "import func Darwin.C.sqrt", use the module path "Darwin.C",
not the full path "Darwin.C.sqrt".

<rdar://problem/17895650>

Swift SVN r21097
2014-08-07 21:26:34 +00:00
Adrian Prantl
9fafa1c13c Make deserialized locations default to line 0, which tells the debugger
to ignore them, while still referencing the module file needed to perform
type lookups, etc.
<rdar://problem/17648201> After setting a breakpoint, the first step action is malfunctioning

Swift SVN r20801
2014-07-31 01:39:12 +00:00
Erik Eckstein
3751991798 Adapt to llvm debuginfo change: use DITypeArray instead of DIArray in some places
Swift SVN r20672
2014-07-29 15:13:21 +00:00
Adrian Prantl
f205552b61 [LLVM sync] Adopt the new API introduced in LLVM r214115.
Swift SVN r20651
2014-07-28 22:41:10 +00:00
Adrian Prantl
0d2d2d32b1 Debug info: Improve handling of storage-less variables.
Swift SVN r20546
2014-07-25 16:47:59 +00:00
Adrian Prantl
b4b2b31dd1 Remove debug code that was accidentally committed.
Swift SVN r20504
2014-07-24 18:34:16 +00:00
Jordan Rose
b6818046a8 Eliminate optimization levels 0-3 in favor of -Onone/-O/-Ofast.
We were already effectively doing this everywhere /except/ when building
the standard library (which used -O2), so just use the model we want going
forward.

Swift SVN r20455
2014-07-24 01:12:59 +00:00
Dmitri Hrybenko
e7b4e6c370 Punycode encoder/decoder: separate core and parts that depend on UTF8
encoder/decoder


Swift SVN r20309
2014-07-22 15:01:12 +00:00
Dmitri Hrybenko
734c0a9ba1 Revert "Punycode encoder/decoder: separate core and parts that depend on UTF8"
It broke tests.

Swift SVN r20308
2014-07-22 14:44:20 +00:00
Dmitri Hrybenko
56342b0cfa Punycode encoder/decoder: separate core and parts that depend on UTF8
encoder/decoder


Swift SVN r20307
2014-07-22 14:37:37 +00:00
Dmitri Hrybenko
e33bb4c8de Demangler: remove SmallVector from punycode encoder and decoder interface
Swift SVN r20250
2014-07-21 14:37:16 +00:00
Joe Groff
45eec9a2e9 Remove 'interface' from the method names of SILFunctionType.
SILFunctionTypes are always interface types now. NFC.

Swift SVN r19952
2014-07-14 22:03:46 +00:00
Adrian Prantl
400f1774e9 Add support for a #line directive.
This patch extends the syntax with a new #line directive that is inspired
by the homonymous CPP directive. It can be specified in all locations a #if
is legal (Stmt, Decl).

Semantics
---------

#line 42 "file.swift"
This makes diagnostics and debug information behave as if the subsequent
lines came from file.swift+42.

#line // without arguments
This switches back to the main source file and the switches back to the
normal line numbering. Any previous #line directives will result in gaps
in the main file.

Rationale
---------

LLDB and the REPL need this for making expressions that are entered into
the expression evaluator or REPL debugable. For more info see
<rdar://problem/17441710> Need #line directive or something similar so we can enhance the debugging of expressions and REPL

Also, I believe the stdlib would benefit from this and it would allow us
to get rid of the line-directive wrapper script.

Swift SVN r19384
2014-06-30 23:50:11 +00:00
Adrian Prantl
3ae5326d21 Tweak the scope guessing for instructions without SILDebugScopes to reuse
the scope of the previous instruction.

<rdar://problem/17021591> Gap in lexical block coincides with the first line-table entry for a line => no variables at that line

Swift SVN r19318
2014-06-28 02:08:26 +00:00
Doug Gregor
07a7059934 Preserve dictionary type sugar in the type system.
Another piece of <rdar://problem/17460972>.


Swift SVN r19253
2014-06-26 21:12:19 +00:00
Greg Clayton
707505f3f5 Revert fix for being able to generate debug info in JIT'ed expressions until we can pass all regression tests.
Swift SVN r19111
2014-06-24 00:12:18 +00:00
Greg Clayton
cddae42bac Don't crash (via assert) when trying to enable debug info in Swift JIT'ed expressions.
Swift SVN r19102
2014-06-23 22:21:44 +00:00
Adrian Prantl
b1a7a7af1b Reference-count inlined functions to keep them alive until we emit debug
info for them and generally clean up the inline scope handling a bit.
Fix the debug scope handling for all clients of SILCloner, especially
the SIL-level spezializers and inliners.
This also adds a ton of additional assertions that will ensure that
future optimization passes won't mess with the debug info in a way that
could confuse the LLVM backend.

Swift SVN r18984
2014-06-18 22:34:10 +00:00
Jordan Rose
574054b8fd Distance SourceManager from llvm::SourceMgr.
...in preparation for non-source locations, i.e. locations that don't come
frome source buffers.

No functionality change, but a fair bit of SourceManager API and idioms have
changed.

Swift SVN r18942
2014-06-17 01:15:47 +00:00
Michael Gottesman
9b72aa0e47 Revert "Update to ToT which removed std::error_code"
This reverts commit r18853. This was already fixed by the previous
commit.

Swift SVN r18855
2014-06-13 04:34:18 +00:00
Pete Cooper
676b005839 Update to ToT which removed std::error_code
Swift SVN r18853
2014-06-13 03:50:33 +00:00
Justin Bogner
a0c0dc25be Use std::error_code rather than llvm::error_code
std::error_code is no longer available via the llvm namespace as of
r210835.

Swift SVN r18851
2014-06-13 02:54:07 +00:00
Bob Wilson
2df66cf8c4 Implement inline scopes for the performance inliner.
Mandatory-inlined (aka transparent functions) are still treated as if they
had the location and scope of the call site. <rdar://problem/14845844>
Support inline scopes once we have an optimizing SIL-based inliner

Patch by Adrian Prantl.

Swift SVN r18835
2014-06-12 19:48:43 +00:00
Bob Wilson
9ab1136ba8 Update error_code usage to match llvm trunk.
LLVM's system_error.h has been changed to forward to the standard
version of the same. Update usage for the minor API changes that this
entails.

Based in part on a patch by Justin Bogner.

Swift SVN r18832
2014-06-12 19:48:39 +00:00
Adrian Prantl
4e7fa3c19a Remove this assertion. Bridging headers will not have an owning module.
Swift SVN r18793
2014-06-10 23:50:08 +00:00
Adrian Prantl
0b7f82bcc9 Linetable: Make sure the function prologue ends after manipulating the
stackpointer.
<rdar://problem/16903725> Line tables seem to assume prologue ends one instruction too early

Swift SVN r18284
2014-05-17 23:41:07 +00:00
Doug Gregor
5783d0b313 Revert r19185: Add T* syntactic sugar type for UnsafePointer<T>.
Swift SVN r18255
2014-05-17 16:43:46 +00:00
Adrian Prantl
98383a5c6a Debug info: Use WeakVHs in DIRefMap so LLDB can safely invoke IRGen more
than once (at least as far as IRGenDebugInfo is concerned).

No new testcases, but it comes with new assertions.

Part of <rdar://problem/15283227> A crash in llvm's getFnAttributes when IRGen is called more than once.

Swift SVN r18214
2014-05-16 21:26:06 +00:00
Doug Gregor
806daf3a87 Add T* syntactic sugar type for UnsafePointer<T>.
This is the basic plumbing for <rdar://problem/16912508>.


Swift SVN r18195
2014-05-16 15:30:26 +00:00
Adrian Prantl
22beacddf8 Debug Info: Linetable. Emit the end location for ImplicitReturnLocations.
<rdar://problem/15204469> Odd line table when passing closure to function

Swift SVN r18174
2014-05-16 04:32:09 +00:00
Adrian Prantl
f5325f9cf4 Debug Info: Do a marginally better job of supporting enums by emitting
the argument types and underlying raw types.
In the long run we'd really want to emit them as DW_TAG_variant_types.

<rdar://problem/14845818> Support enums

Swift SVN r18170
2014-05-16 03:51:08 +00:00
Adrian Prantl
3848f9a069 Debug info: Emit the mangled name for function types, if it is possible.
<rdar://problem/16450045> variables of closure type cause "warning: swift types not handled in"... warnings

Swift SVN r18091
2014-05-15 01:01:17 +00:00
Adrian Prantl
6378a66628 Debug Info: Emit the remaining pointer types with pointer size.
Swift SVN r18052
2014-05-14 01:16:39 +00:00
Adrian Prantl
22522637b3 Debug Info: Emit archetypes with the size and alignment of a pointer.
Swift SVN r18050
2014-05-14 01:16:32 +00:00
Adrian Prantl
fcc346c874 Run clang-format on IRGenDebugInfo.*
Swift SVN r18035
2014-05-13 22:48:35 +00:00
Adrian Prantl
bb9be80edf Debug Info: Factor out createPointerSizedStruct for leaf types that
have mangled names.

Swift SVN r18034
2014-05-13 22:48:31 +00:00
Adrian Prantl
93f423da32 Debug Info: To make life easier for LLDB, emit inout types as structs with
an appropriate mangled name.
rdar://problem/16900833

Swift SVN r18023
2014-05-13 21:05:31 +00:00
Adrian Prantl
9cfb375a96 Debug info: Fix a struct layout bug with zero-sized members.
<rdar://problem/16898394> Library won't build with optimization off

Swift SVN r18015
2014-05-13 18:48:51 +00:00
Adrian Prantl
95168bb97c Temporarily soft-fail this assertion.
<rdar://problem/16898394> Library won't build with optimization off

Swift SVN r18005
2014-05-13 16:06:43 +00:00
John McCall
d7b44f2dc6 Correctly substitute field types when building debug info
for specializations of generic types.

Also remove some impossible error handling and simplify an API.

Swift SVN r17989
2014-05-13 02:09:22 +00:00
Adrian Prantl
baae246fb8 Debug Info: Do not crash when the size of a piece cannot be determined.
Swift SVN r17958
2014-05-12 20:59:57 +00:00
Adrian Prantl
932d08d89b [update LLVM+LLDB] Switch to the custom DW_LANG_Swift specifier.
Retire DW_TAG_restrict in favor of DW_TAG_APPLE_metatype.

<rdar://problem/16513629> Cleanup DWARF output for WWDC

Swift SVN r17949
2014-05-12 19:17:54 +00:00
Adrian Prantl
c0b5da0d7f [please update LLVM] Debug info: Support multi-valued explosions, e.g.,
tuples and structs that are passed to a function by value.

<rdar://problem/15928331> Need to support DW_OP_piece for multi-Value variables/arguments
<rdar://problem/16599747> Variables not displayed at all in SwiftDemo02b_Closure (back again)

Swift SVN r17923
2014-05-12 03:31:07 +00:00
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