Commit Graph

1114 Commits

Author SHA1 Message Date
Adrian Prantl
0e6a0b84d1 Add debug info support for function arguments in async functions.
This commit depends on changes to the coroutine-splitting pass in LLVM.  Shadow
copies are also turned off for async function arguments, because they make it
impossible to track debug info during coroutine splitting. Instead we are
relying on LLVM's CoroSplit.cpp to emit shadow copies. The Swift frontend gives
CoroSplit license to move do this by describing the arguments using a
dbg.declare intrinsic, even though it points to chain of load/GEP/bitcase
instructions into the Swift context function argument.

rdar://71866936
2020-12-11 16:59:09 -08:00
John McCall
ee0bb0a2d5 Freeze PartialAsyncTask as a Job*.
Also fix the extra inhabitants of Builtin.RawUnsafeContinuation
and try to make adding types like this a little less boiler-plate
in the future.
2020-12-04 01:06:29 -05:00
Slava Pestov
1a89813bf5 AST: Introduce Builtin.RawUnsafeContinuation type
This is otherwise identical to Builtin.RawPointer, but has the spare
bits of a heap object pointer.
2020-12-01 20:03:22 -05:00
Brent Royal-Gordon
b440ab7331 [NFC] Move several types/functions to Import.h
To help consolidate our various types describing imports, this commit moves the following types and methods to Import.h:

* ImplicitImports
* ImplicitStdlibKind
* ImplicitImportInfo
* ModuleDecl::ImportedModule
* ModuleDecl::OrderImportedModules (as ImportedModule::Order)
* ModuleDecl::removeDuplicateImports() (as ImportedModule::removeDuplicates())
* SourceFile::ImportFlags
* SourceFile::ImportOptions
* SourceFile::ImportedModuleDesc

This commit is large and intentionally kept mechanical—nothing interesting to see here.
2020-10-09 18:57:07 -07:00
adrian-prantl
e7871c5584 Merge pull request #34037 from adrian-prantl/69393097
Store Clang module imports in addition to Swift overlay.
2020-09-24 08:39:55 -07:00
Varun Gandhi
734b8a2533 Merge pull request #33986 from varungandhi-apple/vg-import-filter-cleanup
[NFC] Clarify import filtering logic and naming.
2020-09-23 18:23:11 -07:00
Adrian Prantl
ba4c82d87e Store Clang module imports in addition to Swift overlay.
This helps the debugger resolve types in the underlying Clang module.

<rdar://problem/69393097>
2020-09-23 13:53:55 -07:00
Varun Gandhi
d3369f7711 [NFC] Rename ImportFilterKind cases to be clearer. 2020-09-23 12:50:20 -07:00
Varun Gandhi
7b967a8030 Merge pull request #33085 from varungandhi-apple/vg-clang-types-in-sil-retry
Propagate Clang function types through SIL
2020-09-22 08:48:34 -07:00
Varun Gandhi
5e9bf1f7c6 [SIL] Store ClangTypeInfo in SILFunctionType.
This patch includes a large number of changes to make sure that:
1. When ExtInfo values are created, we store a ClangTypeInfo if applicable.
2. We reduce dependence on storing SIL representations in ASTExtInfo values.
3. Reduce places where we sloppily create ASTExtInfo values which should
   store a Clang type but don't. In certain places, this is unavoidable;
   see [NOTE: ExtInfo-Clang-type-invariant].

Ideally, we would check that the appropriate SILExtInfo does always store
a ClangTypeInfo. However, the presence of the HasClangFunctionTypes option
means that we would need to condition that assertion based on a dynamic check.
Plumbing the setting down to SILExtInfoBuilder's checkInvariants would be too
much work. So we weaken the check for now; we should strengthen it once we
"turn on" HasClangFunctionTypes and remove the dynamic feature switch.
2020-09-16 10:34:42 -07:00
Brent Royal-Gordon
6da428a38e [NFC] Rename “DeclPath” -> “AccessPath”
To avoid ambiguity, ImportResolution and a few other things used the term “decl path” instead of “access path”. Switch back to the correct terminology now that the compiler is becoming more consistent about it.
2020-09-10 19:08:29 -07:00
Brent Royal-Gordon
cff4ddf13a [NFC] Adopt new ImportPath types and terminology
# Conflicts:
#	lib/IDE/CodeCompletion.cpp
2020-09-10 19:07:49 -07:00
swift_jenkins
fb946baf59 Merge remote-tracking branch 'origin/master' into master-rebranch 2020-08-28 11:08:22 -07:00
Pavel Yaskevich
78ea3de8e4 [AST] Introduce a new type to represent a type hole in constraint system
Instead of using `UnresolvedType` as a placeholder for a type hole,
let's switch over to a dedicated "rich" `HoleType` which is capable
of storing "originator" type - type variable or dependent member
type which couldn't be resolved.

This makes it easier for the solver to determine origins of
a hole which helps to diagnose certain problems better. It also
helps code completion to locate "expected type" of the context
even when it couldn't be completely resolved.
2020-08-26 16:55:39 -07:00
swift-ci
a0a181159c Merge remote-tracking branch 'origin/master' into master-rebranch 2020-07-31 16:07:19 -07:00
Slava Pestov
adb7bf541a IRGen: Replace some calls to getDeclaredType() with getDeclaredInterfaceType() 2020-07-31 13:39:02 -04:00
swift-ci
bca6fff39e Merge remote-tracking branch 'origin/master' into master-rebranch 2020-07-23 14:44:17 -07:00
zoecarver
5c3ccf5050 [cxx-interop] Temporarily disable emitting debug info for C++ types.
When we try to emit debug info from C++ types we crash because we can't deserialize them. This is a temporary fix to circumnavigate the crash before a real fix can be created.
2020-07-23 12:10:06 -07:00
swift_jenkins
99fd5e81c6 Merge remote-tracking branch 'origin/master' into master-next 2020-07-01 00:59:07 -07:00
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