Skip to content

Commit 6404ac4

Browse files
authored
Merge pull request #4305 from dgrove-oss/fblocks-for-linux-swift3.0
[Swift 3] ClangImporter: enable -fblocks on non-Darwin platforms
2 parents 617ff34 + 170311c commit 6404ac4

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

lib/ClangImporter/ClangImporter.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,9 @@ getNormalInvocationArguments(std::vector<std::string> &invocationArgStrs,
332332
// Don't emit LLVM IR.
333333
"-fsyntax-only",
334334

335+
// enable block support
336+
"-fblocks",
337+
335338
"-fretain-comments-from-system-headers",
336339

337340
SHIMS_INCLUDE_FLAG, searchPathOpts.RuntimeResourcePath,
@@ -341,7 +344,7 @@ getNormalInvocationArguments(std::vector<std::string> &invocationArgStrs,
341344
if (triple.isOSDarwin()) {
342345
invocationArgStrs.insert(invocationArgStrs.end(), {
343346
// Darwin uses Objective-C ARC.
344-
"-x", "objective-c", "-std=gnu11", "-fobjc-arc", "-fblocks",
347+
"-x", "objective-c", "-std=gnu11", "-fobjc-arc",
345348

346349
// Define macros that Swift bridging headers use.
347350
"-DSWIFT_CLASS_EXTRA=__attribute__((annotate(\""

test/ClangModules/cfuncs_parse.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -parse -verify -I %S/Inputs %s
22

3-
// XFAIL: linux
4-
53
import cfuncs
64

75
func test_cfunc1(_ i: Int) {

test/ClangModules/cstring_parse.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -parse -verify -module-cache-path %t/clang-module-cache -I %S/Inputs %s
66
// RUN: ls -lR %t/clang-module-cache | %FileCheck %s
77

8-
// XFAIL: linux
9-
108
// CHECK: cfuncs{{.*}}.pcm
119

1210
import cfuncs

0 commit comments

Comments
 (0)