Commit Graph

995 Commits

Author SHA1 Message Date
Keith Smiley
8e886ab2f9 Apply -debug-prefix-map to isysroot (#32580)
* Apply -debug-prefix-map to isysroot

Previously the absolute path to the sysroot, which could differ across
machines in remote build scenarios, was included in the debug info of
object files:

```
!11 = distinct !DICompileUnit(language: DW_LANG_Swift, file: !12, producer: "Swift version 5.3-dev (LLVM 93caf26adb68d37, Swift 58b2ddc65afbd60)", isOptimized: false, runtimeVersion: 5, emissionKind: FullDebug, enums: !13, imports: !14, sysroot: "/Applications/Xcode-11.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk", sdk: "MacOSX.sdk")
```

With this change these are included in the remapping done by
`-debug-prefix-map`.

* Fix test
2020-07-01 00:40:30 -07:00
swift_jenkins
75bea14185 Merge remote-tracking branch 'origin/master' into master-next 2020-06-23 10:39:14 -07:00
Martin Boehme
d806ba53f6 Give OptionSet an initializer_list constructor.
This makes it easier to specify OptionSet arguments.

Also modify appropriate uses of ModuleDecl::ImportFilter to take
advantage of the new constructor.
2020-06-22 06:57:29 +02:00
Karoy Lorentey
68351d2110 Revert "Merge remote-tracking branch 'origin/master-next'"
This reverts commit 1c9b0908e6, reversing
changes made to 3eb82c1836.
2020-06-08 16:48:38 -07:00
Erik Eckstein
bdd337cd17 Merge remote-tracking branch 'origin/master' into master-next 2020-05-15 20:13:50 +02:00
Adrian Prantl
633f9e1a3d clang-format IRGenDebugInfo. 2020-05-13 16:58:28 -07:00
Adrian Prantl
248ba6236a Don't emit debug line numbers for Swift type forward declarations
These line numbers are consumed by LLDB and stored in the Declaration object,
but as far as I can tell no user-facing feature relies on this.

Removing the line number can reduce the churn for incremental builds
significantly, since whitespace changes in one file may trigger a recompilation
of any file that uses a type declared below the whitespace change.

<rdar://problem/63156560>
2020-05-13 16:57:44 -07:00
swift_jenkins
c60a485196 Merge remote-tracking branch 'origin/master' into master-next 2020-05-06 12:35:16 -07:00
Arnold Schwaighofer
147144baa6 SIL: Thread type expansion context through to function convention apis
This became necessary after recent function type changes that keep
substituted generic function types abstract even after substitution to
correctly handle automatic opaque result type substitution.

Instead of performing the opaque result type substitution as part of
substituting the generic args the underlying type will now be reified as
part of looking at the parameter/return types which happens as part of
the function convention apis.

rdar://62560867
2020-05-04 13:53:30 -07:00
swift_jenkins
9b6f01b6d9 Merge remote-tracking branch 'origin/master' into master-next 2020-04-30 20:37:34 -07:00
Daniel Sweeney
ea526c6383 Converting ModuleDecl::ImportedModule from std::pair to a dedicated struct. (#31360) 2020-04-30 20:26:03 -07:00
Michael Forster
01096b6a61 Fix the master-next build 2020-04-24 06:43:53 +02:00
swift_jenkins
3355318fb5 Merge remote-tracking branch 'origin/master' into master-next 2020-04-21 13:57:18 -07:00
Adrian Prantl
8ef2178f96 Make data members of DebugTypeInfo private (NFC) 2020-04-20 16:17:48 -07:00
Adrian Prantl
3bc9d43d12 Store the type parameters of bound generics in the debug info.
This is needed to anchor any typedefs that appear in bound generic parameters so
they can be resolved in the typeref-based part of the debugger without needing
to query the Swift module.
2020-04-20 14:45:58 -07:00
swift_jenkins
7d10d9ae85 Merge remote-tracking branch 'origin/master' into master-next 2020-04-10 20:40:58 -07:00
Slava Pestov
f12b0d4977 IRGen: Type reconstruction supports opaque result types now 2020-04-10 15:05:54 -04:00
swift_jenkins
14a14a232b Merge remote-tracking branch 'origin/master' into master-next 2020-04-01 09:00:36 -07:00
Anthony Latsis
d0ae3ee580 [AST] Replace FuncDecl::getName & EnumElementDecl::getName with ValueDecl::getBaseIdentifier 2020-03-29 00:35:51 +03:00
swift_jenkins
3d4661d060 Merge remote-tracking branch 'origin/master' into master-next 2020-03-13 15:44:30 -07:00
Adrian Prantl
56309f6b49 Debug Info: Store the SDK in the DICompileUnit.
This an intermediate step for PR44213
(https://bugs.llvm.org/show_bug.cgi?id=44213).

This stores the SDK *name* in the debug info, to make it possible to
`-fdebug-prefix-map`-replace the sysroot with a recognizable string and allowing
the debugger to find a fitting SDK relative to itself, not the machine the
executable was compiled on.

rdar://problem/51645582
2020-03-13 13:25:39 -07:00
Raphael Isemann
404cc48475 Adapt to API change that moved Sysroot attribute to CompileUnit
Commit 7b30370e5bcf569fcdc15204d4c592163fd78cb3 changed the Sysroot
attribute to the CompileUnit which broke the build.

(cherry picked from commit 728e8a1bde)
2020-03-11 15:58:46 -07:00
Adrian Prantl
1bd6a0a371 Adapt to upstream header file reshuffling in c915cb957dc37275ce1ca1a0b993239c82f12692. 2020-03-11 15:46:37 -07:00
swift_jenkins
4a1fa9b42c Merge remote-tracking branch 'origin/master' into master-next 2020-02-25 10:20:13 -08:00
Joe Groff
19770e6471 IRGen: Keep substituted function types out of debug info for now. 2020-02-24 12:14:21 -08:00
Raphael Isemann
728e8a1bde Adapt to API change that moved Sysroot attribute to CompileUnit
Commit 7b30370e5bcf569fcdc15204d4c592163fd78cb3 changed the Sysroot
attribute to the CompileUnit which broke the build.
2020-02-14 13:52:27 +01:00
Robert Widmann
86ea1912c4 Merge remote-tracking branch 'upstream/master' into HEAD 2020-02-11 23:03:59 -08:00
Fred Riss
4a4a5fabb0 Adapt the llvm.org DIBuilder API change. 2020-01-31 15:34:11 -08:00
Vedant Kumar
d1e6438cbb Revert "IRGenDebugInfo: Pass Sysroot to DIBuilder::createModule (#29524)" (#29572)
This reverts commit 06a829c72e.
2020-01-31 13:08:04 -08:00
Vedant Kumar
06a829c72e IRGenDebugInfo: Pass Sysroot to DIBuilder::createModule (#29524) 2020-01-28 19:32:52 -08:00
swift-ci
70fa9f3288 Merge remote-tracking branch 'origin/master' into master-rebranch 2020-01-28 16:23:20 -08:00
swift_jenkins
11cd86daa3 Merge remote-tracking branch 'origin/master' into master-next 2020-01-28 16:17:55 -08:00
Med Ismail Bennani
bf41881bcd Move swift runtime failure from linkage name to function name
Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2020-01-28 22:56:05 +01:00
Alex Langford
5b5d2f600f Adjust to upstream changes
Commit 7b30370e5bcf569fcdc15204d4c592163fd78cb3 from llvm-project changed
DIBuilder::createModule. Adjust accordingly.
2020-01-22 14:34:23 -08:00
Erik Eckstein
1b312a85bd Merge remote-tracking branch 'origin/master' into master-rebranch 2020-01-16 10:39:20 +01:00
Arnold Schwaighofer
ddafd383b5 Merge remote-tracking branch 'upstream/master' into master-next 2020-01-15 07:45:24 -08:00
Robert Widmann
eb61931012 [NFC] Grab the private discriminator for a file in IRGenDebugInfo
This was being done at an odd point in the frontend presumably because by that point the private discriminator had been fully computed.  Instead, push the conditions for generating the prefix data down to debug info generation and stop mutating IRGenOptions::DebugFlag in the frontend.
2020-01-13 22:01:41 -08:00
Adrian Prantl
10cd0fc1b7 Adapt to upstream LLVM changes.
(cherry picked from commit 06906ab6b9)
2020-01-10 09:59:56 -08:00
Adrian Prantl
06906ab6b9 Adapt to upstream LLVM changes. 2020-01-10 09:58:57 -08:00
Joe Groff
fb34044408 Merge remote-tracking branch 'origin/master' into master-next 2019-12-10 12:46:41 -08:00
Vedant Kumar
f67b9cbbdd Rename CompilerInstance::ModuleManager to match D70583 (#28625)
See: https://reviews.llvm.org/D70583
2019-12-06 14:33:05 -08:00
Joe Groff
0926d2380b SIL: Sink GenericContextScope into IRGen.
All the context dependencies in SIL type lowering have been eradicated, but IRGen's
type info lowering is still context-dependent and doesn't systemically pass generic
contexts around. Sink GenericContextScope bookkeeping entirely into IRGen for now.
2019-12-02 12:20:05 -08:00
swift-ci
6996cae94c Merge remote-tracking branch 'origin/master' into master-next 2019-11-05 08:49:43 -08:00
swift-ci
d162cc1258 Merge remote-tracking branch 'origin/master' into master-next 2019-11-04 13:50:06 -08:00
Adrian Prantl
8e9b02839b Debug Info: Avoid type uniquing clashes for bound generic structs.
This patch changes the DWARF representation of bound generic struct to a nested
struct where the (sized) outer struct is anonymous and thus distinct and the
inner struct in uniqued and sizeless.

This is anologous the the previous commit that did the same thing for bound
generic enums.

rdar://problem/56521648
2019-11-04 13:36:49 -08:00
adrian-prantl
b6b0046be2 Merge pull request #28020 from adrian-prantl/56521648
Debug Info: Avoid type uniquing clashes for bound generic enums.
2019-11-04 13:36:09 -08:00
Adrian Prantl
e881168d5e Debug Info: Avoid type uniquing clashes for bound generic enums.
This patch changes the DWARF representation of bound generic enums to a nested
struct where the (sized) outer struct is anonymous and thus distinct and the
inner struct in uniqued and sizeless.

BoundGenericEnums may have different sizes depending on what they are bound to,
but still share a mangled name.

rdar://problem/56521648
2019-11-04 08:22:00 -08:00
swift-ci
0b41d02a4d Merge remote-tracking branch 'origin/master' into master-next 2019-10-31 20:49:50 -07:00
Brent Royal-Gordon
99faa033fc [NFC] Standardize dump() methods in frontend
By convention, most structs and classes in the Swift compiler include a `dump()` method which prints debugging information. This method is meant to be called only from the debugger, but this means they’re often unused and may be eliminated from optimized binaries. On the other hand, some parts of the compiler call `dump()` methods directly despite them being intended as a pure debugging aid. clang supports attributes which can be used to avoid these problems, but they’re used very inconsistently across the compiler.

This commit adds `SWIFT_DEBUG_DUMP` and `SWIFT_DEBUG_DUMPER(<name>(<params>))` macros to declare `dump()` methods with the appropriate set of attributes and adopts this macro throughout the frontend. It does not pervasively adopt this macro in SILGen, SILOptimizer, or IRGen; these components use `dump()` methods in a different way where they’re frequently called from debugging code. Nor does it adopt it in runtime components like swiftRuntime and swiftReflection, because I’m a bit worried about size.

Despite the large number of files and lines affected, this change is NFC.
2019-10-31 18:37:42 -07:00
Xi Ge
64c0680686 Merge remote-tracking branch 'apple/master' into master-next 2019-10-28 10:19:36 -07:00