Skip to content

SIL: Round-trip DynamicSelfType properly #4126

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

Conversation

slavapestov
Copy link
Contributor

@slavapestov slavapestov commented Aug 8, 2016

@swiftix Still a work in progress, but feel free to take a look.

rdar://problem/27735857

@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@tkremenek
Copy link
Member

/Users/buildnode/jenkins/workspace/swift-PR-osx-smoke-test/swift/lib/RemoteAST/RemoteAST.cpp:429:9: error: no matching function for call to 'performTypeLocChecking'
    if (performTypeLocChecking(Ctx, loc, /*SILType*/ false, dc,
        ^~~~~~~~~~~~~~~~~~~~~~
/Users/buildnode/jenkins/workspace/swift-PR-osx-smoke-test/swift/include/swift/Subsystems.h:204:8: note: candidate function not viable: no known conversion from 'bool' to 'swift::DeclContext *' for 5th argument
  bool performTypeLocChecking(ASTContext &Ctx, TypeLoc &T,
       ^
/Users/buildnode/jenkins/workspace/swift-PR-osx-smoke-test/swift/include/swift/Subsystems.h:194:8: note: candidate function not viable: requires at most 4 arguments, but 5 were provided
  bool performTypeLocChecking(ASTContext &Ctx, TypeLoc &T,
       ^

@slavapestov slavapestov force-pushed the sil-dynamic-self-round-tripping branch from 0f2520e to d7249e2 Compare August 9, 2016 09:13
@CodaFi
Copy link
Contributor

CodaFi commented Aug 9, 2016

@swift-ci please smoke test

@tkremenek
Copy link
Member

******************** TEST 'Swift(macosx-x86_64) :: SIL/Parser/self.swift' FAILED ********************
Script:
--
/Users/buildnode/jenkins/workspace/swift-PR-osx-smoke-test/buildbot_incremental/swift-macosx-x86_64/bin/swiftc -frontend -target x86_64-apple-macosx10.9  -module-cache-path '/var/folders/_8/79jmzf2142z2xydc_01btlx00000gn/T/swift-testsuite-clang-module-cacheQSjcoz' -sdk /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk  /Users/buildnode/jenkins/workspace/swift-PR-osx-smoke-test/swift/test/SIL/Parser/self.swift -emit-silgen | xcrun --toolchain default --sdk /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk /Users/buildnode/jenkins/workspace/swift-PR-osx-smoke-test/buildbot_incremental/swift-macosx-x86_64/bin/sil-opt -target x86_64-apple-macosx10.9  -module-cache-path '/var/folders/_8/79jmzf2142z2xydc_01btlx00000gn/T/swift-testsuite-clang-module-cacheQSjcoz'
--
Exit Code: 139

Command Output (stderr):
--
/Users/buildnode/jenkins/workspace/swift-PR-osx-smoke-test/swift/test/SIL/Parser/self.swift:6:18: warning: 'where' clause next to generic parameters is deprecated and will be removed in the future version of Swift
    S : Sequence where S.Iterator.Element == Self
                ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

<stdin>:8:26: warning: 'where' clause next to generic parameters is deprecated and will be removed in the future version of Swift
  func join<S : Sequence where S.Iterator.Element == Self>(elements: S) -> @dynamic_self Self
                        ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                                              where S.Iterator.Element == Self
0  sil-opt                  0x0000000108b7becb llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 43
1  sil-opt                  0x0000000108b7b0f6 llvm::sys::RunSignalHandlers() + 70
2  sil-opt                  0x0000000108b7c7a1 SignalHandler(int) + 641
3  libsystem_platform.dylib 0x00007fff985e352a _sigtramp + 26
4  libsystem_platform.dylib 0x0000000000000001 _sigtramp + 1738656497
5  sil-opt                  0x00000001068e1c7c swift::TypeChecker::validateGenericFuncSignature(swift::AbstractFunctionDecl*) + 1036
6  sil-opt                  0x00000001068b7993 (anonymous namespace)::DeclChecker::visitFuncDecl(swift::FuncDecl*) + 2739
7  sil-opt                  0x00000001068a7080 (anonymous namespace)::DeclChecker::visit(swift::Decl*) + 480
8  sil-opt                  0x00000001068b520b (anonymous namespace)::DeclChecker::visitProtocolDecl(swift::ProtocolDecl*) + 699
9  sil-opt                  0x00000001068a7060 (anonymous namespace)::DeclChecker::visit(swift::Decl*) + 448
10 sil-opt                  0x00000001068a6e8c swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 156
11 sil-opt                  0x00000001068ca971 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) + 1297
12 sil-opt                  0x000000010643de10 swift::CompilerInstance::performSema() + 3664
13 sil-opt                  0x00000001064206a1 main + 2097
14 libdyld.dylib            0x00007fff939af5ad start + 1
15 libdyld.dylib            0x0000000000000005 start + 1818561113
Stack dump:
0.  Program arguments: /Users/buildnode/jenkins/workspace/swift-PR-osx-smoke-test/buildbot_incremental/swift-macosx-x86_64/bin/sil-opt -target x86_64-apple-macosx10.9 -module-cache-path /var/folders/_8/79jmzf2142z2xydc_01btlx00000gn/T/swift-testsuite-clang-module-cacheQSjcoz 
1.  While type-checking 'P' at <stdin>:7:1
/Users/buildnode/jenkins/workspace/swift-PR-osx-smoke-test/buildbot_incremental/swift-macosx-x86_64/test-macosx-x86_64/SIL/Parser/Output/self.swift.script: line 1: 26314 Done                    /Users/buildnode/jenkins/workspace/swift-PR-osx-smoke-test/buildbot_incremental/swift-macosx-x86_64/bin/swiftc -frontend -target x86_64-apple-macosx10.9 -module-cache-path '/var/folders/_8/79jmzf2142z2xydc_01btlx00000gn/T/swift-testsuite-clang-module-cacheQSjcoz' -sdk /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk /Users/buildnode/jenkins/workspace/swift-PR-osx-smoke-test/swift/test/SIL/Parser/self.swift -emit-silgen
     26315 Segmentation fault: 11  | xcrun --toolchain default --sdk /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk /Users/buildnode/jenkins/workspace/swift-PR-osx-smoke-test/buildbot_incremental/swift-macosx-x86_64/bin/sil-opt -target x86_64-apple-macosx10.9 -module-cache-path '/var/folders/_8/79jmzf2142z2xydc_01btlx00000gn/T/swift-testsuite-clang-module-cacheQSjcoz'

@slavapestov
Copy link
Contributor Author

Hi @tkremenek, I know this patch is still broken :) It's a work in progress. Will be done after some higher priority stuff. I don't think Roman needs it very urgently.

When DynamicSelfType occurs outside of a class body (for example,
inside of a SIL function), it is not enough to simply utter 'Self',
because then we lose the underlying type.

Instead, print it out as '@dynamic_self Foo', where 'Foo' is the
underlying class type or archetype, and add parser support for
the same.

Fixes <rdar://problem/27735857>.
@slavapestov slavapestov force-pushed the sil-dynamic-self-round-tripping branch from d7249e2 to 173658a Compare August 9, 2016 21:18
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

1 similar comment
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@slavapestov slavapestov merged commit adee860 into swiftlang:master Aug 9, 2016
@slavapestov slavapestov deleted the sil-dynamic-self-round-tripping branch August 19, 2016 05:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants