Skip to content

[Dependency Scanning] Collect and report each module dependency's Link Libraries #73907

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion include/swift-c/DependencyScan/DependencyScan.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
/// SWIFTSCAN_VERSION_MINOR should increase when there are API additions.
/// SWIFTSCAN_VERSION_MAJOR is intended for "major" source/ABI breaking changes.
#define SWIFTSCAN_VERSION_MAJOR 0
#define SWIFTSCAN_VERSION_MINOR 9
#define SWIFTSCAN_VERSION_MINOR 10

SWIFTSCAN_BEGIN_DECLS

Expand All @@ -46,6 +46,9 @@ typedef struct swiftscan_module_details_s *swiftscan_module_details_t;
/// Opaque container to a dependency info of a given module.
typedef struct swiftscan_dependency_info_s *swiftscan_dependency_info_t;

/// Opaque container to a link library info.
typedef struct swiftscan_link_library_info_s *swiftscan_link_library_info_t;

/// Opaque container to an overall result of a dependency scan.
typedef struct swiftscan_dependency_graph_s *swiftscan_dependency_graph_t;

Expand All @@ -64,6 +67,12 @@ typedef struct {
size_t count;
} swiftscan_dependency_set_t;

/// Set of linked libraries
typedef struct {
swiftscan_link_library_info_t *link_libraries;
size_t count;
} swiftscan_link_library_set_t;

typedef enum {
SWIFTSCAN_DIAGNOSTIC_SEVERITY_ERROR = 0,
SWIFTSCAN_DIAGNOSTIC_SEVERITY_WARNING = 1,
Expand Down Expand Up @@ -127,9 +136,21 @@ swiftscan_module_info_get_source_files(swiftscan_dependency_info_t info);
SWIFTSCAN_PUBLIC swiftscan_string_set_t *
swiftscan_module_info_get_direct_dependencies(swiftscan_dependency_info_t info);

SWIFTSCAN_PUBLIC swiftscan_link_library_set_t *
swiftscan_module_info_get_link_libraries(swiftscan_dependency_info_t info);

SWIFTSCAN_PUBLIC swiftscan_module_details_t
swiftscan_module_info_get_details(swiftscan_dependency_info_t info);

//=== Link Library Info Functions ------------------------------------===//
SWIFTSCAN_PUBLIC swiftscan_string_ref_t
swiftscan_link_library_info_get_link_name(
swiftscan_link_library_info_t info);
SWIFTSCAN_PUBLIC bool swiftscan_link_library_info_get_is_framework(
swiftscan_link_library_info_t info);
SWIFTSCAN_PUBLIC bool swiftscan_link_library_info_get_should_force_load(
swiftscan_link_library_info_t info);

//=== Dependency Module Info Details Functions ----------------------------===//

SWIFTSCAN_PUBLIC swiftscan_dependency_info_kind_t
Expand Down
3 changes: 3 additions & 0 deletions include/swift/AST/IRGenOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,9 @@ class IRGenOptions {
/// Whether we should disable inserting autolink directives altogether.
unsigned DisableAllAutolinking : 1;

/// Whether we should disable inserting __swift_FORCE_LOAD_ symbols.
unsigned DisableForceLoadSymbols : 1;

/// Print the LLVM inline tree at the end of the LLVM pass pipeline.
unsigned PrintInlineTree : 1;

Expand Down
3 changes: 3 additions & 0 deletions include/swift/AST/Import.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
namespace swift {
class ASTContext;
class ModuleDecl;
class ImportDecl;

// MARK: - Fundamental import enums

Expand Down Expand Up @@ -102,6 +103,8 @@ using ImportOptions = OptionSet<ImportFlags>;

void simple_display(llvm::raw_ostream &out, ImportOptions options);

ImportOptions getImportOptions(ImportDecl *ID);

// MARK: - Import Paths

namespace detail {
Expand Down
Loading