Skip to content

Commit b511c5f

Browse files
authored
Merge pull request #13012 from github/redsun82/swift-json
Swift: add infrastructure for emitting JSON diagnostics
2 parents 4035b16 + 7ce1189 commit b511c5f

24 files changed

+294
-76
lines changed

misc/bazel/workspace.bzl

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,3 @@ def codeql_workspace(repository_name = "codeql"):
4343
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.4.1/bazel-skylib-1.4.1.tar.gz",
4444
],
4545
)
46-
47-
maybe(
48-
repo_rule = http_archive,
49-
name = "absl",
50-
sha256 = "cec2e5bf780532bd0ac672eb8d43c0f8bbe84ca5df8718320184034b7f59a398",
51-
urls = [
52-
"https://github.com/abseil/abseil-cpp/archive/d2c5297a3c3948de765100cb7e5cccca1210d23c.tar.gz",
53-
],
54-
strip_prefix = "abseil-cpp-d2c5297a3c3948de765100cb7e5cccca1210d23c",
55-
)

swift/extractor/SwiftExtractor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include "swift/extractor/infra/SwiftLocationExtractor.h"
1616
#include "swift/extractor/infra/SwiftBodyEmissionStrategy.h"
1717
#include "swift/extractor/mangler/SwiftMangler.h"
18-
#include "swift/extractor/infra/log/SwiftAssert.h"
18+
#include "swift/logging/SwiftAssert.h"
1919

2020
using namespace codeql;
2121
using namespace std::string_literals;

swift/extractor/infra/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ swift_cc_library(
88
deps = [
99
"//swift/extractor/config",
1010
"//swift/extractor/infra/file",
11-
"//swift/extractor/infra/log",
1211
"//swift/extractor/trap",
12+
"//swift/logging",
1313
"//swift/third_party/swift-llvm-support",
1414
],
1515
)

swift/extractor/infra/SwiftDispatcher.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include "swift/extractor/infra/SwiftBodyEmissionStrategy.h"
1414
#include "swift/extractor/infra/SwiftMangledName.h"
1515
#include "swift/extractor/config/SwiftExtractorState.h"
16-
#include "swift/extractor/infra/log/SwiftAssert.h"
16+
#include "swift/logging/SwiftAssert.h"
1717

1818
namespace codeql {
1919

swift/extractor/infra/file/BUILD.bazel

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,16 @@ load("//swift:rules.bzl", "swift_cc_library")
22

33
swift_cc_library(
44
name = "file",
5-
srcs = glob(["*.cpp", "FsLogger.h"]),
6-
hdrs = glob(["*.h"], exclude=["FsLogger.h"]) + [":path_hash_workaround"],
5+
srcs = glob([
6+
"*.cpp",
7+
"FsLogger.h",
8+
]),
9+
hdrs = glob(
10+
["*.h"],
11+
exclude = ["FsLogger.h"],
12+
) + [":path_hash_workaround"],
713
visibility = ["//swift:__subpackages__"],
8-
deps = ["//swift/extractor/infra/log"],
14+
deps = ["//swift/logging"],
915
)
1016

1117
genrule(

swift/extractor/infra/file/FsLogger.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "swift/extractor/infra/log/SwiftLogging.h"
1+
#include "swift/logging/SwiftLogging.h"
22

33
namespace codeql {
44
namespace fs_logger {

swift/extractor/infra/file/TargetFile.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include "swift/extractor/infra/file/TargetFile.h"
22
#include "swift/extractor/infra/file/FsLogger.h"
3-
#include "swift/extractor/infra/log/SwiftLogging.h"
4-
#include "swift/extractor/infra/log/SwiftAssert.h"
3+
#include "swift/logging/SwiftLogging.h"
4+
#include "swift/logging/SwiftAssert.h"
55

66
#include <cassert>
77
#include <cstdio>

swift/extractor/invocation/SwiftInvocationExtractor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include "swift/extractor/trap/generated/TrapTags.h"
55
#include "swift/extractor/infra/file/TargetFile.h"
66
#include "swift/extractor/infra/file/Path.h"
7-
#include "swift/extractor/infra/log/SwiftAssert.h"
7+
#include "swift/logging/SwiftAssert.h"
88
#include "swift/extractor/mangler/SwiftMangler.h"
99

1010
namespace fs = std::filesystem;

swift/extractor/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
#include "swift/extractor/invocation/SwiftInvocationExtractor.h"
1919
#include "swift/extractor/trap/TrapDomain.h"
2020
#include "swift/extractor/infra/file/Path.h"
21-
#include "swift/extractor/infra/log/SwiftAssert.h"
21+
#include "swift/logging/SwiftAssert.h"
2222

2323
using namespace std::string_literals;
2424
using namespace codeql::main_logger;
2525

26-
const std::string_view codeql::logRootName = "extractor";
26+
const std::string_view codeql::programName = "extractor";
2727

2828
// must be called before processFrontendOptions modifies output paths
2929
static void lockOutputSwiftModuleTraps(codeql::SwiftExtractorState& state,

swift/extractor/remapping/SwiftFileInterception.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
#include "swift/extractor/infra/file/PathHash.h"
1616
#include "swift/extractor/infra/file/Path.h"
17-
#include "swift/extractor/infra/log/SwiftAssert.h"
17+
#include "swift/logging/SwiftAssert.h"
1818

1919
#ifdef __APPLE__
2020
// path is hardcoded as otherwise redirection could break when setting DYLD_FALLBACK_LIBRARY_PATH

0 commit comments

Comments
 (0)