Skip to content

Commit 6309f28

Browse files
Add support for direct CASAPI access from libToolchainCASPlugin.dylib
Add initial CAS support through libToolchainCASPlugin.dylib
1 parent 688a840 commit 6309f28

File tree

17 files changed

+713
-17
lines changed

17 files changed

+713
-17
lines changed

Package.swift

+5
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,18 @@ let package = Package(
4646
.target(name: "CSwiftScan",
4747
exclude: [ "CMakeLists.txt" ]),
4848

49+
/// C modules wrapper for ToolchainCASPlugin.
50+
.target(name: "CToolchainCASPlugin",
51+
exclude: [ "CMakeLists.txt" ]),
52+
4953
/// The driver library.
5054
.target(
5155
name: "SwiftDriver",
5256
dependencies: [
5357
"SwiftOptions",
5458
.product(name: "SwiftToolsSupport-auto", package: "swift-tools-support-core"),
5559
"CSwiftScan",
60+
"CToolchainCASPlugin",
5661
.product(name: "Yams", package: "yams"),
5762
],
5863
exclude: ["CMakeLists.txt"]),

Sources/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
# See http://swift.org/CONTRIBUTORS.txt for Swift project authors
88

99
add_subdirectory(CSwiftScan)
10+
add_subdirectory(CToolchainCASPlugin)
1011
add_subdirectory(SwiftOptions)
1112
add_subdirectory(SwiftDriver)
1213
add_subdirectory(SwiftDriverExecution)

Sources/CSwiftScan/include/swiftscan_header.h

+5
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,11 @@ typedef struct {
275275

276276
//=== Scanner CAS Operations ----------------------------------------------===//
277277
swiftscan_cas_t (*swiftscan_cas_create)(const char *path);
278+
swiftscan_cas_t (*swiftscan_cas_create_from_plugin)(const char *plugin_path,
279+
const char *ondisk_path,
280+
int argc,
281+
const char **keys,
282+
const char **values);
278283
void (*swiftscan_cas_dispose)(swiftscan_cas_t cas);
279284
swiftscan_string_ref_t (*swiftscan_cas_store)(swiftscan_cas_t cas,
280285
uint8_t *data, unsigned size);
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# This source file is part of the Swift.org open source project
2+
#
3+
# Copyright (c) 2014 - 2020 Apple Inc. and the Swift project authors
4+
# Licensed under Apache License v2.0 with Runtime Library Exception
5+
#
6+
# See http://swift.org/LICENSE.txt for license information
7+
# See http://swift.org/CONTRIBUTORS.txt for Swift project authors
8+
9+
add_library(CToolchainCASPlugin STATIC
10+
ToolchainCASPluginImpl.c)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// This file is here to prevent the package manager from warning about a
2+
// target with no sources.
3+
#include "include/ToolchainCASPlugin_CAPI.h"

0 commit comments

Comments
 (0)