Commit Graph

766 Commits

Author SHA1 Message Date
swift-ci
28f97c08ca Merge remote-tracking branch 'origin/master' into master-next 2018-05-03 10:09:45 -07:00
Adrian Prantl
2c7a69852b Emits a DW_OP_deref for global variables in a fixed size buffer.
Note that this is only correct unless the variable uses inline
storage. This makes the majority of resilient types in Foundation work
as global variables.  The correct solution would be for LLDB to poke
at the runtime to figure out whether the storage is inline or not, but
until then this is the next best thing.

rdar://problem/39722386
2018-05-02 15:40:16 -07:00
swift-ci
e3149d49f6 Merge remote-tracking branch 'origin/master' into master-next 2018-04-16 13:08:55 -07:00
Vedant Kumar
84a652285f [DebugInfo] Remove option to pass None into setCurrentLoc, NFC
Passing in some SILLocation to IRGenDebugInfo setCurrentLoc() will now
be mandatory.

(cherry picked from commit 8bd783fff4)
2018-04-16 10:35:19 -07:00
Vedant Kumar
6b1372206a [DebugInfo] Remove a default location argument from setCurrentLoc
Having a default location of None doesn't seem to enhance readability.

(cherry picked from commit c3ba8ff1ff)
2018-04-16 10:35:18 -07:00
swift-ci
703e269574 Merge remote-tracking branch 'origin/master' into master-next 2018-04-15 00:09:23 -07:00
Andrew Trick
53a0676cc2 Revert "[DebugInfo] Set the autogenerated bit to request recycled locations" 2018-04-14 18:48:31 -07:00
swift-ci
25d7dbcccf Merge remote-tracking branch 'origin/master' into master-next 2018-04-13 16:02:39 -07:00
Vedant Kumar
8bd783fff4 [DebugInfo] Remove option to pass None into setCurrentLoc, NFC
Passing in some SILLocation to IRGenDebugInfo setCurrentLoc() will now
be mandatory.
2018-04-13 14:50:49 -07:00
Vedant Kumar
c3ba8ff1ff [DebugInfo] Remove a default location argument from setCurrentLoc
Having a default location of None doesn't seem to enhance readability.
2018-04-13 14:38:54 -07:00
swift-ci
cf753d97f0 Merge remote-tracking branch 'origin/master' into master-next 2018-03-27 06:57:44 -07:00
Sho Ikeda
08644c1d8f [gardening][IRGen] Replace typedef with using 2018-03-27 09:06:33 +09:00
swift-ci
29011402dd Merge remote-tracking branch 'origin/master' into master-next 2018-03-26 09:11:11 -07:00
Doug Gregor
b2b69e8abf Rename BoundNameAliasType to NameAliasType.
NameAliasType is dead! Long live NameAliasType!
2018-03-25 21:35:17 -07:00
Doug Gregor
c43f96a855 [AST] Remove now-unused NameAliasType. 2018-03-25 21:35:16 -07:00
Bob Wilson
4dd5d4eeee master-next: Adjust for LLVM r328165 moving a header file
The "llvm/Transforms/Utils/Local.h" header was moved to
"llvm/Analysis/Utils/Local.h".
2018-03-23 16:42:39 -07:00
Doug Gregor
80eae200b6 [AST] Preserve type sugar for generic typealiases
Introduce a new Type node, BoundNameAliasType, which describes a
reference to a typealias that requires substitutions to produce the
underlying type. This new type node is used both for references to
generic typealiases and for references to (non-generic) typealiases
that occur within generic contexts, e.g., Array<Int>.Element.

At present, the new type node is mainly useful in preserving type
sugar for diagnostics purposes, as well as being reflected in other
tools (indexing, code completion, etc.). The intent is to completely
replace NameAliasType in the future.
2018-03-21 23:49:17 -07:00
Adrian Prantl
6663462c53 Debug Info: Fix the emission of vector types.
Thanks to an improved IR verifier upstream we found that support for
vector types has been incomplete.

<rdar://problem/38324861>
2018-03-12 12:25:22 -07:00
Sho Ikeda
26d650292f [gardening] Use empty() over size() == 0 2018-03-05 14:43:13 +09:00
David Ungar
fec411e9bc reformatted 2018-02-15 15:34:55 -07:00
David Ungar
1f9a4f3591 Pass around arguments for primary-specific filenames.
Get rid of IRGenOpts attributes that won’t work for batch mode and also remove fakeNamesStub.
2018-02-15 15:34:55 -07:00
Mark Lacey
fdd86fe069 Remove ImplicitlyUnwrappedOptionalType.
We haven't been creating these since
https://github.com/apple/swift/pull/14299 but there was more
groundwork before we could actually remove the type definition.
2018-02-05 23:59:01 -08:00
Adrian Prantl
b4781f63ef Debug Info: Create artificial functions in a virtual file <compiler-generated>.
For the majority of artificial helper functions the filename is
actively misleading since it usually represents the file of the caller
that triggered the helper to be generated. Instead, this patch creates
a virtual filname `<compiler-generated>` to make it very obvious that
the function has not correspondence to any source code.

<rdar://problem/33809560>
2018-01-17 11:09:35 -08:00
John McCall
7f0f8830cd Split AccessorDecl out from FuncDecl. NFC.
This has three principal advantages:

- It gives some additional type-safety when working
  with known accessors.

- It makes it significantly easier to test whether a declaration
  is an accessor and encourages the use of a common idiom.

- It saves a small amount of memory in both FuncDecl and its
  serialized form.
2018-01-12 14:20:27 -05:00
David Zarzycki
9b48b5074a [AST] Perf: Unite DictionaryType with SyntaxSugarType
1) Move existing SyntaxSugarTypes under a new subclass called UnarySyntaxSugarType.
2) Make DictionaryType subclass SyntaxSugarType.

This helps improve getDesugaredType() performance by ensuring that
ImplOrContext is stored at the same field offset in memory.

This also de-boilerplates some AST walking.
2018-01-02 15:14:07 -05:00
swift-ci
b4f5a5806c Merge pull request #12973 from adrian-prantl/33809560-0 2017-11-16 14:06:10 -08:00
Adrian Prantl
112809e7d8 Remove dead API IRGenDebugInfo::setArtificialTrapLocation().
<rdar://problem/33809560>
2017-11-16 13:20:49 -08:00
Adrian Prantl
e574aa765f Don't emit shadow copies for anonymous variables.
Switch statements generate at least one anonymous match variable per
case, which consumes both a lot of stack space and an explosion of
range extension depencies due to the way case statements are scoped.

rdar://problem/34326355
2017-11-16 10:41:40 -08:00
Slava Pestov
72ad29a5fb Merge pull request #12935 from adrian-prantl/cherry
master-next: Update IRGenDebugInfo.cpp for LLVM r313825
2017-11-14 20:25:43 -08:00
Bob Wilson
ddf8148afc master-next: Update IRGenDebugInfo.cpp for LLVM r313825
LLVM r313825 replaced llvm::FindAllocaDbgDeclare with FindDbgAddrUses,
and we also need to include LLVM's IntrinsicInst.h header now.

rdar://problem/34574938
(cherry picked from commit 6b446a0d38)
2017-11-14 16:43:25 -08:00
Erik Eckstein
90c21be191 Unify the implementation of optimization mode in various option classes.
This commit is mostly refactoring.

*) Introduce a new OptimizationMode enum and use that in SILOptions and IRGenOptions
*) Allow the optimization mode also be specified for specific SILFunctions. This is not used in this commit yet and thus still a NFC.

Also, fixes a minor bug: we didn’t run mandatory IRGen passes for functions with @_semantics("optimize.sil.never")
2017-11-14 11:25:02 -08:00
John McCall
7743be30f6 Add a "token" type to SIL to allow dependencies to be expressed without
allowing abstraction.
2017-11-13 04:03:21 -05:00
Adrian Prantl
578fca1ee3 Move the logic for ignoring the debug locations for closure setup code into SILGen.
NFC-ish.
2017-11-10 14:37:32 -08:00
Davide Italiano
330fb1ce2f [gardening] Remove some unused variables. NFCI. 2017-10-30 15:19:55 -07:00
Adrian Prantl
44aa4822e0 Debug Info: Represent private discriminators in DWARF.
... using an inline namespace as the parent of the outermost
declaration(s) that have private or fileprivate accessability. Once
LLDB supports this we can retire the existing hack of storing it as a
fake command line argument.

rdar://problem/18296829
2017-10-09 15:32:06 -07:00
Adrian Prantl
f7742121a5 Debug Info: Record the base name for inout types and fix tests for i386.
rdar://problem/33761763
2017-08-09 15:22:13 -07:00
Adrian Prantl
ff0397bdaa Update to upstream llvm changes (remove offset from llvm.dbg.value)
rdar://problem/33580047
2017-07-28 14:16:10 -07:00
Adrian Prantl
b85f1d679b Update for LLVM IR metadata changes (DIImportedEntity now needs a DIFile).
rdar://problem/32993231
2017-07-18 18:09:55 -07:00
Alex Hoppen
f8c2692f79 Introduce special decl names
Special DeclNames represent names that do not have an identifier in the
surface language. This implies serializing the information about whether
a name is special together with its identifier (if it is not special)
in both the module file and the swift lookup table.
2017-07-11 19:04:13 +02:00
Alex Hoppen
2078ec6f0a Remove getName from ValueDecl
Push the getName method from ValueDecl down to only those types that are
guaranteed to have a name that is backed by an identifier and that will
not be special.
2017-06-15 21:49:34 +02:00
Adrian Prantl
efc41d9153 Add a virtual destructor to avoid leaking the new private impl's memory.
rdar://problem/32520596
2017-06-01 15:53:58 -07:00
swift-ci
935535414d Merge pull request #9913 from adrian-prantl/32327266 2017-05-24 15:27:02 -07:00
Adrian Prantl
17496f3012 Simplify IRGenDebugInfo submodule creation and support homonymous submodules. 2017-05-24 14:00:07 -07:00
Adrian Prantl
84d9238315 Emit llvm.dbg.declare intrisics immediately after the described alloca.
This cleanup change doesn't change the semantics, but it makes the
resulting IR much easier to read and debug.
2017-05-24 09:13:41 -07:00
Adrian Prantl
0b2b0c036c Revert "Emit llvm.dbg.declare intrisics immediately after the described alloca."
This reverts commit 8660fd489a.
2017-05-23 11:42:13 -07:00
Adrian Prantl
8660fd489a Emit llvm.dbg.declare intrisics immediately after the described alloca.
This cleanup change doesn't change the semantics, but it makes the
resulting IR much easier to read and debug.
2017-05-23 09:23:41 -07:00
Adrian Prantl
f344e535f3 Debug info: Avoid emitting module imports twice when access path differs.
This fixes a recent regression from 68a5cadb90.
rdar://problem/32327266
2017-05-22 11:53:12 -07:00
swift-ci
f023fcefac Merge pull request #9732 from adrian-prantl/29793594 2017-05-18 11:24:43 -07:00
Adrian Prantl
78d6b8df7e Change DIFileCache from a DenseMap to a StringMap.
We have received crash reports indicating a crash in
DensMap::lookupBucketFor. This change avoids a crash caused by a
filename being a stale reference.

rdar://problem/29793594
2017-05-18 09:40:19 -07:00
Adrian Prantl
68a5cadb90 Debug Info: Generate imported entities for implicitly imported parent modules.
The Swift compiler uses an ugly hack that auto-imports a submodule's
top-level-module, even if we didn't ask for it. Reflect that in the
debug info.

<rdar://problem/31310320>
2017-05-17 12:58:04 -07:00