Skip to content

Commit 8839866

Browse files
committed
Merge branch 'main' of github.com:apple/swift into maxd/main-merge
# Conflicts: # lib/IRGen/GenKeyPath.cpp
2 parents b1d2093 + 5e9ff15 commit 8839866

File tree

118 files changed

+1249
-449
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+1249
-449
lines changed

docs/SIL.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3842,7 +3842,7 @@ mark_function_escape
38423842

38433843
sil-instruction ::= 'mark_function_escape' sil-operand (',' sil-operand)
38443844

3845-
%2 = mark_function_escape %1 : $*T
3845+
mark_function_escape %1 : $*T
38463846

38473847
Indicates that a function definition closes over a symbolic memory location.
38483848
This instruction is variadic, and all of its operands must be addresses.

include/swift/AST/ASTContext.h

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "swift/AST/GenericSignature.h"
2323
#include "swift/AST/Identifier.h"
2424
#include "swift/AST/Import.h"
25+
#include "swift/AST/SILOptions.h"
2526
#include "swift/AST/SearchPathOptions.h"
2627
#include "swift/AST/Type.h"
2728
#include "swift/AST/TypeAlignments.h"
@@ -38,8 +39,8 @@
3839
#include "llvm/ADT/PointerIntPair.h"
3940
#include "llvm/ADT/SetVector.h"
4041
#include "llvm/ADT/SmallPtrSet.h"
41-
#include "llvm/ADT/StringSet.h"
4242
#include "llvm/ADT/StringMap.h"
43+
#include "llvm/ADT/StringSet.h"
4344
#include "llvm/ADT/TinyPtrVector.h"
4445
#include "llvm/Support/Allocator.h"
4546
#include "llvm/Support/DataTypes.h"
@@ -221,11 +222,10 @@ class ASTContext final {
221222
void operator=(const ASTContext&) = delete;
222223

223224
ASTContext(LangOptions &langOpts, TypeCheckerOptions &typeckOpts,
224-
SearchPathOptions &SearchPathOpts,
225+
SILOptions &silOpts, SearchPathOptions &SearchPathOpts,
225226
ClangImporterOptions &ClangImporterOpts,
226227
symbolgraphgen::SymbolGraphOptions &SymbolGraphOpts,
227-
SourceManager &SourceMgr,
228-
DiagnosticEngine &Diags);
228+
SourceManager &SourceMgr, DiagnosticEngine &Diags);
229229

230230
public:
231231
// Members that should only be used by ASTContext.cpp.
@@ -237,7 +237,7 @@ class ASTContext final {
237237
void operator delete(void *Data) throw();
238238

239239
static ASTContext *get(LangOptions &langOpts, TypeCheckerOptions &typeckOpts,
240-
SearchPathOptions &SearchPathOpts,
240+
SILOptions &silOpts, SearchPathOptions &SearchPathOpts,
241241
ClangImporterOptions &ClangImporterOpts,
242242
symbolgraphgen::SymbolGraphOptions &SymbolGraphOpts,
243243
SourceManager &SourceMgr, DiagnosticEngine &Diags);
@@ -255,6 +255,9 @@ class ASTContext final {
255255
/// The type checker options.
256256
const TypeCheckerOptions &TypeCheckerOpts;
257257

258+
/// Options for SIL.
259+
const SILOptions &SILOpts;
260+
258261
/// The search path options used by this AST context.
259262
SearchPathOptions &SearchPathOpts;
260263

include/swift/AST/DiagnosticsSema.def

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4459,10 +4459,10 @@ NOTE(actor_isolated_sync_func,none,
44594459
"implicitly asynchronous",
44604460
(DescriptiveDeclKind, DeclName))
44614461
NOTE(distributed_actor_isolated_method_note,none,
4462-
"only 'distributed' functions can be called from outside the distributed actor", // TODO: improve error message
4462+
"only 'distributed' functions can be called from outside the distributed actor", // TODO(distributed): improve error message
44634463
())
44644464
ERROR(distributed_actor_isolated_method,none,
4465-
"only 'distributed' functions can be called from outside the distributed actor", // TODO: improve error message to be more like 'non-distributed' ... defined here
4465+
"only 'distributed' functions can be called from outside the distributed actor", // TODO(distributed): improve error message to be more like 'non-distributed' ... defined here
44664466
())
44674467
ERROR(distributed_actor_func_param_not_codable,none,
44684468
"distributed function parameter '%0' of type %1 does not conform to 'Codable'",

include/swift/AST/SearchPathOptions.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#define SWIFT_AST_SEARCHPATHOPTIONS_H
1515

1616
#include "swift/Basic/ArrayRefView.h"
17+
#include "swift/Basic/PathRemapper.h"
1718
#include "llvm/ADT/Hashing.h"
1819

1920
#include <string>
@@ -97,6 +98,11 @@ class SearchPathOptions {
9798

9899
/// A file containing modules we should perform batch scanning.
99100
std::string BatchScanInputFilePath;
101+
102+
/// Debug path mappings to apply to serialized search paths. These are
103+
/// specified in LLDB from the target.source-map entries.
104+
PathRemapper SearchPathRemapper;
105+
100106
private:
101107
static StringRef
102108
pathStringFromFrameworkSearchPath(const FrameworkSearchPath &next) {

include/swift/Basic/DAGNodeWorklist.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
///
2626
/// The primary API has two methods: intialize() and pop(). Others are provided
2727
/// for flexibility.
28+
///
29+
/// TODO: This also works well for cyclic graph traversal. Particularly CFG
30+
/// traversal. So we should probably just call it GraphNodeWorklist.
2831
template <typename T, unsigned SmallSize> struct DAGNodeWorklist {
2932
llvm::SmallPtrSet<T, SmallSize> nodeVisited;
3033
llvm::SmallVector<T, SmallSize> nodeVector;

include/swift/Basic/LangOptions.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include "llvm/Support/Regex.h"
3232
#include "llvm/Support/VersionTuple.h"
3333
#include "llvm/Support/raw_ostream.h"
34+
#include <atomic>
3435
#include <string>
3536
#include <vector>
3637

@@ -771,6 +772,9 @@ namespace swift {
771772
DisableOverlayModules,
772773
EnableClangSPI);
773774
}
775+
776+
std::vector<std::string> getRemappedExtraArgs(
777+
std::function<std::string(StringRef)> pathRemapCallback) const;
774778
};
775779

776780
} // end namespace swift

include/swift/Frontend/FrontendOptions.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,11 @@ class FrontendOptions {
182182
/// module appears to not be a public module.
183183
Optional<bool> SerializeOptionsForDebugging;
184184

185+
/// When true the debug prefix map entries will be applied to debugging
186+
/// options before serialization. These can be reconstructed at debug time by
187+
/// applying the inverse map in SearchPathOptions.SearchPathRemapper.
188+
bool DebugPrefixSerializedDebuggingOptions = false;
189+
185190
/// When true, check if all required SwiftOnoneSupport symbols are present in
186191
/// the module.
187192
bool CheckOnoneSupportCompleteness = false;

include/swift/Option/Options.td

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ def disable_bridging_pch : Flag<["-"], "disable-bridging-pch">,
559559
def lto : Joined<["-"], "lto=">,
560560
Flags<[FrontendOption, NoInteractiveOption]>,
561561
HelpText<"Specify the LTO type to either 'llvm-thin' or 'llvm-full'">;
562-
562+
563563
def lto_library : Separate<["-"], "lto-library">,
564564
Flags<[FrontendOption, ArgumentIsPath, NoInteractiveOption]>,
565565
HelpText<"Perform LTO with <lto-library>">, MetaVarName<"<lto-library>">;
@@ -815,6 +815,10 @@ def debug_info_format : Joined<["-"], "debug-info-format=">,
815815
Flags<[FrontendOption]>,
816816
HelpText<"Specify the debug info format type to either 'dwarf' or 'codeview'">;
817817

818+
def prefix_serialized_debugging_options : Flag<["-"], "prefix-serialized-debugging-options">,
819+
Flags<[FrontendOption]>,
820+
HelpText<"Apply debug prefix mappings to serialized debug info in Swiftmodule files">;
821+
818822
// Verify debug info
819823
def verify_debug_info : Flag<["-"], "verify-debug-info">,
820824
Flags<[NoInteractiveOption, DoesNotAffectIncrementalBuild]>,

include/swift/SIL/BasicBlockUtils.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,10 @@ void findJointPostDominatingSet(
148148
function_ref<void(SILBasicBlock *)> foundJointPostDomSetCompletionBlocks,
149149
function_ref<void(SILBasicBlock *)> inputBlocksInJointPostDomSet = {});
150150

151+
#ifndef NDEBUG
152+
bool checkDominates(SILBasicBlock *sourceBlock, SILBasicBlock *destBlock);
153+
#endif
154+
151155
} // namespace swift
152156

153157
#endif

include/swift/SIL/MemAccessUtils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
/// Each object's property or its tail storage is separately accessed.
7878
///
7979
/// In addition to the free-standing functions, the AccessBase and
80-
/// AccessStorage classes encapsulte the identity of an access. They can be
80+
/// AccessStorage classes encapsulate the identity of an access. They can be
8181
/// used to:
8282
/// - directly compare and hash access identities
8383
/// - exhaustively switch over the kinds of accesses

0 commit comments

Comments
 (0)