Skip to content

Commit 57ee54c

Browse files
authored
Merge pull request #4285 from swiftwasm/main
2 parents d302532 + b004396 commit 57ee54c

Some content is hidden

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

56 files changed

+2982
-444
lines changed

include/swift/ABI/ObjectFile.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ class SwiftObjectFileFormat {
2828
virtual llvm::Optional<llvm::StringRef> getSegmentName() {
2929
return {};
3030
}
31+
/// Get the name of the segment in the symbol rich binary that may contain
32+
/// Swift meteadata.
33+
virtual llvm::Optional<llvm::StringRef> getSymbolRichSegmentName() {
34+
return {};
35+
}
3136
/// Predicate to identify if the named section can contain reflection data.
3237
virtual bool sectionContainsReflectionData(llvm::StringRef sectionName) = 0;
3338
};
@@ -45,10 +50,15 @@ class SwiftObjectFileFormatMachO : public SwiftObjectFileFormat {
4550
}
4651
llvm_unreachable("Section type not found.");
4752
}
53+
4854
llvm::Optional<llvm::StringRef> getSegmentName() override {
4955
return {"__TEXT"};
5056
}
5157

58+
llvm::Optional<llvm::StringRef> getSymbolRichSegmentName() override {
59+
return {"__DWARF"};
60+
}
61+
5262
bool sectionContainsReflectionData(llvm::StringRef sectionName) override {
5363
return sectionName.startswith("__swift5_") || sectionName == "__const";
5464
}

include/swift/AST/ASTContext.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1167,7 +1167,7 @@ class ASTContext final {
11671167
/// conformance itself, along with a bit indicating whether this diagnostic
11681168
/// produces an error.
11691169
struct DelayedConformanceDiag {
1170-
ValueDecl *Requirement;
1170+
const ValueDecl *Requirement;
11711171
std::function<void()> Callback;
11721172
bool IsError;
11731173
};

include/swift/AST/ClangModuleLoader.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ class ClangModuleLoader : public ModuleLoader {
268268
clang::DeclarationName givenName = clang::DeclarationName()) = 0;
269269

270270
/// Determine the effective Clang context for the given Swift nominal type.
271-
EffectiveClangContext virtual getEffectiveClangContext(
271+
virtual EffectiveClangContext getEffectiveClangContext(
272272
const NominalTypeDecl *nominal) = 0;
273273
};
274274

include/swift/AST/Decl.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3495,7 +3495,9 @@ class NominalTypeDecl : public GenericTypeDecl, public IterableDeclContext {
34953495
SmallVectorImpl<ProtocolConformance *> &conformances) const;
34963496

34973497
/// Retrieve all of the protocols that this nominal type conforms to.
3498-
SmallVector<ProtocolDecl *, 2> getAllProtocols() const;
3498+
///
3499+
/// \param sorted Whether to sort the protocols in canonical order.
3500+
SmallVector<ProtocolDecl *, 2> getAllProtocols(bool sorted = false) const;
34993501

35003502
/// Retrieve all of the protocol conformances for this nominal type.
35013503
SmallVector<ProtocolConformance *, 2> getAllConformances(

include/swift/AST/FileUnit.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ class FileUnit : public DeclContext, public ASTAllocated<FileUnit> {
246246
///
247247
/// This can differ from \c getTopLevelDecls, e.g. it returns decls from a
248248
/// shadowed clang module.
249-
virtual void getDisplayDecls(SmallVectorImpl<Decl*> &results) const {
249+
virtual void getDisplayDecls(SmallVectorImpl<Decl*> &results, bool recursive = false) const {
250250
getTopLevelDecls(results);
251251
}
252252

include/swift/AST/Module.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,7 @@ class ModuleDecl
780780
/// shadowed clang module. It does not force synthesized top-level decls that
781781
/// should be printed to be added; use \c swift::getTopLevelDeclsForDisplay()
782782
/// for that.
783-
void getDisplayDecls(SmallVectorImpl<Decl*> &results) const;
783+
void getDisplayDecls(SmallVectorImpl<Decl*> &results, bool recursive = false) const;
784784

785785
using LinkLibraryCallback = llvm::function_ref<void(LinkLibrary)>;
786786

include/swift/Basic/LangOptions.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,9 @@ namespace swift {
530530
RequirementMachineMode RequirementMachineInferredSignatures =
531531
RequirementMachineMode::Disabled;
532532

533+
/// Enables dumping type witness systems from associated type inference.
534+
bool DumpTypeWitnessSystems = false;
535+
533536
/// Sets the target we are building for and updates platform conditions
534537
/// to match.
535538
///

include/swift/ClangImporter/ClangModule.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class ClangModuleUnit final : public LoadedFile {
9191

9292
virtual void getTopLevelDecls(SmallVectorImpl<Decl*> &results) const override;
9393

94-
virtual void getDisplayDecls(SmallVectorImpl<Decl*> &results) const override;
94+
virtual void getDisplayDecls(SmallVectorImpl<Decl*> &results, bool recursive = false) const override;
9595

9696
virtual void
9797
getImportedModules(SmallVectorImpl<ImportedModule> &imports,

include/swift/IRGen/IRGenPublic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class IRGenModule;
3131
std::pair<IRGenerator *, IRGenModule *>
3232
createIRGenModule(SILModule *SILMod, StringRef OutputFilename,
3333
StringRef MainInputFilenameForDebugInfo,
34-
StringRef PrivateDiscriminator);
34+
StringRef PrivateDiscriminator, IRGenOptions &options);
3535

3636
/// Delete the IRGenModule and IRGenerator obtained by the above call.
3737
void deleteIRGenModule(std::pair<IRGenerator *, IRGenModule *> &Module);

include/swift/Option/FrontendOptions.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,9 @@ def requirement_machine_max_concrete_nesting : Joined<["-"], "requirement-machin
352352
Flags<[FrontendOption, HelpHidden, DoesNotAffectIncrementalBuild]>,
353353
HelpText<"Set the maximum concrete type nesting depth before giving up">;
354354

355+
def dump_type_witness_systems : Flag<["-"], "dump-type-witness-systems">,
356+
HelpText<"Enables dumping type witness systems from associated type inference">;
357+
355358
def debug_generic_signatures : Flag<["-"], "debug-generic-signatures">,
356359
HelpText<"Debug generic signatures">;
357360

0 commit comments

Comments
 (0)