Skip to content

Commit b2b40e2

Browse files
committed
Swift: support redirecting .pcm files
1 parent 7e66477 commit b2b40e2

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

swift/extractor/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ static void processFrontendOptions(codeql::SwiftExtractorState& state,
5353
swift::PrimarySpecificPaths psp{};
5454
if (std::filesystem::path output = input.getPrimarySpecificPaths().OutputFilename;
5555
!output.empty()) {
56-
if (output.extension() == ".swiftmodule") {
56+
if (output.extension() == ".swiftmodule" || output.extension() == ".pcm") {
5757
psp.OutputFilename = codeql::redirect(output);
5858
} else {
5959
psp.OutputFilename = "/dev/null";

swift/extractor/remapping/SwiftFileInterception.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ auto& fileInterceptorInstance() {
7575

7676
bool mayBeRedirected(const char* path, int flags = O_RDONLY) {
7777
return (!fileInterceptorInstance().expired() && (flags & O_ACCMODE) == O_RDONLY &&
78-
endsWith(path, ".swiftmodule"));
78+
(endsWith(path, ".swiftmodule") || endsWith(path, ".pcm")));
7979
}
8080

8181
std::optional<std::string> hashFile(const fs::path& path) {

swift/tools/tracing-config.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,14 @@ function RegisterExtractorPack(id)
5353
strip_unsupported_arg(args, '-stack-check', 0)
5454
strip_unsupported_arg(args, '-experimental-skip-non-inlinable-function-bodies-without-types', 0)
5555
strip_unsupported_clang_arg(args, '-ivfsstatcache', 1)
56+
strip_unsupported_clang_arg(args, '-fstack-check', 1)
57+
strip_unsupported_clang_arg(args, '-fno-odr-hash-protocols', 1)
58+
strip_unsupported_clang_arg(args, '-clang-vendor-feature=+disableNonDependentMemberExprInCurrentInstantiation', 1)
59+
strip_unsupported_clang_arg(args, '-clang-vendor-feature=+enableAggressiveVLAFolding', 1)
60+
strip_unsupported_clang_arg(args, '-clang-vendor-feature=+revert09abecef7bbf', 1)
61+
strip_unsupported_clang_arg(args, '-clang-vendor-feature=+thisNoAlignAttr', 1)
62+
strip_unsupported_clang_arg(args, '-clang-vendor-feature=+thisNoNullAttr', 1)
63+
strip_unsupported_clang_arg(args, '-clang-vendor-feature=+disableAtImportPrivateFrameworkInImplementationError', 1)
5664
end
5765

5866
-- xcodebuild does not always specify the -resource-dir in which case the compiler falls back

0 commit comments

Comments
 (0)