[swift-dev] Compiler crash when optimisation enabled

2017-04-06 Thread Mark Woollard via swift-dev
Following upgrade to Xcode 8.3 / Swift 3.1 I have a project where the compiler is crashing when Swift optimisation is enabled in release builds (whole module or single file). Project builds fine for earlier compiler releases. The crash gives no stack trace in console. The crash occurs for one fr

Re: [swift-dev] Emitted SIL does not parse

2017-04-06 Thread Ben Ng via swift-dev
Yep, here’s a gist. Ben Ng https://benng.me On Apr 6, 2017, 9:00 PM -0400, Michael Gottesman , wrote: > > > On Apr 6, 2017, at 5:07 PM, Ben Ng wrote: > > > > It doesn’t look like it: > > > > > swift (LLVM option parsing): Unknown command line argument > > > '-assume-parsing-unqualified-ownershi

Re: [swift-dev] Emitted SIL does not parse

2017-04-06 Thread Michael Gottesman via swift-dev
> On Apr 6, 2017, at 5:07 PM, Ben Ng wrote: > > It doesn’t look like it: > > swift (LLVM option parsing): Unknown command line argument > '-assume-parsing-unqualified-ownership-sil'. Try: 'swift (LLVM option > parsing) -help' I misunderstood what you said before (I thought you said that it

Re: [swift-dev] Emitted SIL does not parse

2017-04-06 Thread Ben Ng via swift-dev
It doesn’t look like it: > swift (LLVM option parsing): Unknown command line argument > '-assume-parsing-unqualified-ownership-sil'.  Try: 'swift (LLVM option > parsing) -help' Ben Ng https://benng.me On Apr 4, 2017, 11:37 PM -0400, Michael Gottesman , wrote: > I think it is an -Xllvm option.

Re: [swift-dev] Unexpected Expr type

2017-04-06 Thread Halen Wooten via swift-dev
Ah, that makes sense. Thanks so much to you both for helping out. Hopefully I'll have a PR ready before too long! On Thu, Apr 6, 2017 at 7:11 PM, Halen Wooten wrote: > Ah, that makes sense. > > Thanks so much to you both for helping out. Hopefully I'll have a PR > ready before too long! > > Hale

Re: [swift-dev] Unexpected Expr type

2017-04-06 Thread Slava Pestov via swift-dev
Here’s what the AST looks like in this case — there is a ParenExpr but it’s inside a LoadExpr — we’re semantically loading the largest sub-expression that’s an lvalue, which here is ‘(x)’ not ‘x’: (assign_expr (declref_expr type='@lvalue Int' accessKind=write location=x.swift:3:1

Re: [swift-dev] Unexpected Expr type

2017-04-06 Thread Halen Wooten via swift-dev
Hi Jordan, Thanks for your reply. I tried the `dyn_cast(src)`, but it gives me null. Here's what I've added: bool TypeChecker::diagnoseSelfAssignment(const Expr *E) { ... auto src = AE->getSrc(); auto parenSrc = dyn_cast(src); if (parenSrc) return false; ... } On Thu, Apr 6, 20

Re: [swift-dev] Unexpected Expr type

2017-04-06 Thread Jordan Rose via swift-dev
Hi, Halen. Welcome to the compiler. :-) What you're seeing is that we don't usually use C++'s normal RTTI mechanism, but instead go with a "Kind" field that's checked by the custom 'cast', 'dyn_cast', and 'isa' functions. (More informati

Re: [swift-dev] PR test failing with clang compile error

2017-04-06 Thread mishal_shah via swift-dev
Thanks! > On Apr 6, 2017, at 3:32 PM, Jordan Rose wrote: > > Erik may have beat you to it. https://github.com/apple/swift/pull/8595 > > > Jordan > >> On Apr 6, 2017, at 15:18, mishal_shah via swift-dev > > wrote: >> >> L

Re: [swift-dev] PR test failing with clang compile error

2017-04-06 Thread Jordan Rose via swift-dev
Erik may have beat you to it. https://github.com/apple/swift/pull/8595 Jordan > On Apr 6, 2017, at 15:18, mishal_shah via swift-dev > wrote: > > Looks like this was cherry-picked in swift-clang without PR testing. > > Thanks, > Mishal Shah >> On Apr

[swift-dev] Unexpected Expr type

2017-04-06 Thread Halen Wooten via swift-dev
Hi swift devs, I'm working on SR-4464 to learn how to contribute to Swift. I think I have the solution, but I'm getting unexpected results. I'm using the swift repl within Xcode for testing. Here's my test code. var name = "name" name = (name) In TypeChecker::diagnoseSelfAssignment in CSDiag.cp

Re: [swift-dev] PR test failing with clang compile error

2017-04-06 Thread mishal_shah via swift-dev
Looks like this was cherry-picked in swift-clang without PR testing. Thanks, Mishal Shah > On Apr 6, 2017, at 3:17 PM, Slava Pestov wrote: > > I have a fix pending in this PR: https://github.com/apple/swift/pull/8594 > > > But I’m surprised this wasn’

Re: [swift-dev] PR test failing with clang compile error

2017-04-06 Thread Slava Pestov via swift-dev
I have a fix pending in this PR: https://github.com/apple/swift/pull/8594 But I’m surprised this wasn’t caught in CI. Slava > On Apr 6, 2017, at 2:58 PM, Mishal Shah wrote: > > Hi Slave, > > This started after following commits: > > https://ci.swi

Re: [swift-dev] PR test failing with clang compile error

2017-04-06 Thread Mishal Shah via swift-dev
Hi Slave, This started after following commits: https://ci.swift.org/job/oss-swift-incremental-RA-osx/9254/ Git (clang) Change -ffp-contract=fast test to run on Aarch64 (detail ) Remove -ffp-contract=fast from this test

[swift-dev] PR test failing with clang compile error

2017-04-06 Thread Slava Pestov via swift-dev
Hi all, I’m hitting this in github PR testing: /Users/buildnode/jenkins/workspace/swift-PR-osx-smoke-test/branch-master/swift/lib/ClangImporter/ImportDecl.cpp:994:34: error: no matching constructor for initialization of 'clang::BinaryOperator' auto cSetterExpr = new (Ctx) clang::BinaryOpera

Re: [swift-dev] Using gyb with benchmarks

2017-04-06 Thread Michael Gottesman via swift-dev
> On Apr 6, 2017, at 1:14 PM, Pavol Vaskovic wrote: > > On Thursday, 6 April 2017 at 19:44, Michael Gottesman wrote: >>> On Apr 6, 2017, at 6:16 AM, Pavol Vaskovic via swift-dev >>> mailto:swift-dev@swift.org)> wrote: >>> >>> ... >>> How do I make benchmarks work with gyb? >> > > Upon furthe

Re: [swift-dev] Using gyb with benchmarks

2017-04-06 Thread Luke Larson via swift-dev
> On Apr 6, 2017, at 1:14 PM, Pavol Vaskovic via swift-dev > wrote: > > On Thursday, 6 April 2017 at 19:44, Michael Gottesman wrote: >>> On Apr 6, 2017, at 6:16 AM, Pavol Vaskovic via swift-dev >>> mailto:swift-dev@swift.org)> wrote: >>> >>> ... >>> How do I make benchmarks work with gyb? >>

Re: [swift-dev] Using gyb with benchmarks

2017-04-06 Thread Pavol Vaskovic via swift-dev
On Thursday, 6 April 2017 at 19:44, Michael Gottesman wrote: > > On Apr 6, 2017, at 6:16 AM, Pavol Vaskovic via swift-dev > > mailto:swift-dev@swift.org)> wrote: > > > > ... > > How do I make benchmarks work with gyb? > Upon further inspection, one needs to regenerate harness _after_ modifyin

Re: [swift-dev] [Swift CI] Build Failure: 0. OSS - Swift Incremental RA - OS X (master) #9249

2017-04-06 Thread Andrew Trick via swift-dev
Something must have changed between the test and the merge. I’m just waiting on the PR revert’s smoke test. -Andy > On Apr 6, 2017, at 10:34 AM, no-re...@swift.org wrote: > > [FAILURE] oss-swift-incremental-RA-osx [#9249] > > Build URL:https://ci.swift.org/job/oss-swift-incremental-RA-osx/9

Re: [swift-dev] Using gyb with benchmarks

2017-04-06 Thread Michael Gottesman via swift-dev
> On Apr 6, 2017, at 6:16 AM, Pavol Vaskovic via swift-dev > wrote: > > Hi! > > I’ve been trying to use gyb to simplify maintenance of some tests in > benchmark/single-source/. > > I have created DropLast.swift.gyb, but it appears this approach is currently > not supported by the build sy

Re: [swift-dev] [SourceKit] NSRange, Swift.String, and NSString

2017-04-06 Thread Tyler Stromberg via swift-dev
We started off using those convenience APIs from SourceKitten (huge thanks for SourceKitten, BTW) but ended up moving to our own solution — for this issue due to some performance issues, particularly in large files, and for interfacing with SourceKit in general because we wanted a little more co

Re: [swift-dev] [SourceKit] NSRange, Swift.String, and NSString

2017-04-06 Thread Tyler Stromberg via swift-dev
> On Mar 24, 2017, at 12:08 PM, Ben Langmuir wrote: > > >> On Mar 24, 2017, at 10:59 AM, Tyler Stromberg via swift-dev >> wrote: >> >> I'm currently working on integrating SourceKit with a macOS application. >> AppKit APIs (e.g. NSAttributedString, NSLayoutManager, etc) deal in terms of >>

[swift-dev] Using gyb with benchmarks

2017-04-06 Thread Pavol Vaskovic via swift-dev
Hi! I’ve been trying to use gyb to simplify maintenance of some tests in benchmark/single-source/. I have created DropLast.swift.gyb, but it appears this approach is currently not supported by the build system. Doing a clean build I got the following error: > + /usr/local/bin/cmake --build