Commit Graph

1132 Commits

Author SHA1 Message Date
Slava Pestov
cb013b5881 DebugInfo: Bypass resilience to calculate if a global is indirect or not
Progress on <rdar://problem/39722386>.
2018-06-22 01:15:11 -07:00
swift-ci
9092ac1caf Merge remote-tracking branch 'origin/master' into master-next 2018-06-20 10:10:28 -07:00
Ellis Hoag
c93a5a5776 Add -debug-info-format=[dwarf|codeview] option (#16888) 2018-06-20 09:52:57 -07:00
swift-ci
243d603ffe Merge remote-tracking branch 'origin/master' into master-next 2018-06-15 08:29:11 -07:00
Jordan Rose
7938272c42 [DebugInfo] Don't record that the standard library imports itself (#17226)
This causes problems for cross-compilation -parse-stdlib tests that
emit debug info. At the moment we have zero of those, but we're
trying to add one.

Also, don't try to load new modules when recording imports. (This
isn't harmful, just inefficient.)
2018-06-15 08:23:11 -07:00
Bob Wilson
5df3d1f100 Merge remote-tracking branch 'origin/master' into master-next 2018-06-14 20:51:48 -07:00
John McCall
9022b5152f Rename accessor kinds from IsGetter -> IsGet, etc.
Introduce some metaprogramming of accessors and generally prepare
for storing less-structured accessor lists.

NFC except for a change to the serialization format.
2018-06-14 17:08:55 -04:00
swift-ci
76c31aff88 Merge remote-tracking branch 'origin/master' into master-next 2018-06-12 19:09:17 -07:00
Adrian Prantl
bab3000069 Use depth and index to lookup type metadata artificial variables
instead of using name and decl context.

The advantages of this approach are three-fold:
- This is necessary to support inlined generic functions.
- We can retire the debugger-specific type name manfgling mode for archetypes.
- This saves 270kb of debug information in the x86_64 libSwiftCore.dylib alone.

<rdar://problem/38306256>
2018-06-12 12:48:15 -07:00
Bob Wilson
80510b8a96 [master-next] Adapt to Utils/Local.h moving from Analysis to Transforms.
LLVM r333954 moved most of the content from the header file
"llvm/Analysis/Utils/Local.h" to "llvm/Transforms/Utils/Local.h".
Update Swift to match.
2018-06-05 19:34:56 -07:00
Vedant Kumar
105a61e50d Use LLVM_DEBUG() instead of DEBUG()
Upstream has renamed the DEBUG() macro to LLVM_DEBUG. This updates swift
accordingly:

$ find . -name \*.cpp -print -exec sed -i "" -E "s/ DEBUG\(/ LLVM_DEBUG(/g" {} \;
2018-05-24 13:10:45 -07:00
swift-ci
bcbc59b346 Merge remote-tracking branch 'origin/master' into master-next 2018-05-17 18:29:35 -07:00
Adrian Prantl
c241ff305e Emit compiler-generated debug locations for outlined transparent functions.
In the majority of the use-cases transparent functions are inlined by
the mandatory inliner which by design drops all debug info and
pretends the inlined instructions were always part of the
caller. Since an outlined copy of the function is often still
generated, attaching debug locations to it is inconsistent and can
create the false impression that it were possible to set a breakpoint
in such a function when in reality these functions are only there for
very few edge cases.

<rdar://problem/40258813>
2018-05-17 16:38:04 -07:00
Adrian Prantl
6bbabd167f Adopt to upstream LLVM API change 2018-05-15 10:20:39 -07:00
swift-ci
ad0712c02b Merge remote-tracking branch 'origin/master' into master-next 2018-05-04 08:49:40 -07:00
David Zarzycki
8c0c55539f [SIL] NFC: Rename misleading getSwiftRValueType() to getASTType()
Reference storage types are not RValues. Also, use more SILType helper
methods to avoid line wrap.
2018-05-04 08:14:38 -04:00
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