Skip to content

[Swift 3] ClangImporter: enable -fblocks on non-Darwin platforms #4305

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
Aug 16, 2016
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
5 changes: 4 additions & 1 deletion lib/ClangImporter/ClangImporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,9 @@ getNormalInvocationArguments(std::vector<std::string> &invocationArgStrs,
// Don't emit LLVM IR.
"-fsyntax-only",

// enable block support
"-fblocks",

"-fretain-comments-from-system-headers",

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

// Define macros that Swift bridging headers use.
"-DSWIFT_CLASS_EXTRA=__attribute__((annotate(\""
Expand Down
2 changes: 0 additions & 2 deletions test/ClangModules/cfuncs_parse.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -parse -verify -I %S/Inputs %s

// XFAIL: linux

import cfuncs

func test_cfunc1(_ i: Int) {
Expand Down
2 changes: 0 additions & 2 deletions test/ClangModules/cstring_parse.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -parse -verify -module-cache-path %t/clang-module-cache -I %S/Inputs %s
// RUN: ls -lR %t/clang-module-cache | %FileCheck %s

// XFAIL: linux

// CHECK: cfuncs{{.*}}.pcm

import cfuncs
Expand Down