Skip to content

Conversation

gmittert
Copy link
Contributor

SILBuilder contains a SILBuilderContext which contains a SILModule which
has a deleted operator=. Assigning an Optional<BeginApplySite> causes MSVC
to attempt to create operator= for SILBuilder which fails due to the
deleted operator=. This changes BeginApplySite to use a SILBuilder*
instead of a SILBuilder& to get around it.

Previously:

C:\Users\jmittertreiner\LocalSwift\llvm\include\llvm/ADT/Optional.h(54): error C2280: 'swift::BeginApplySite &swift::BeginApplySite::operator =(const swift::BeginApplySite &)': attempting to reference a deleted function
C:\Users\jmittertreiner\LocalSwift\swift\lib\SILOptimizer\Utils\SILInliner.cpp(226): note: compiler has generated 'swift::BeginApplySite::operator =' here
C:\Users\jmittertreiner\LocalSwift\swift\lib\SILOptimizer\Utils\SILInliner.cpp(226): note: 'swift::BeginApplySite &swift::BeginApplySite::operator =(const swift::BeginApplySite &)': function was implicitly deleted because 'swift::BeginApplySite' has a data member 'swift::BeginApplySite::Builder' of reference type
C:\Users\jmittertreiner\LocalSwift\swift\lib\SILOptimizer\Utils\SILInliner.cpp(75): note: see declaration of 'swift::BeginApplySite::Builder'
C:\Users\jmittertreiner\LocalSwift\llvm\include\llvm/ADT/Optional.h(52): note: while compiling class template member function 'llvm::optional_detail::OptionalStorage<T,false> &llvm::optional_detail::OptionalStorage<T,false>::operator =(T &&)'
        with
        [
            T=swift::BeginApplySite
        ]
C:\Users\jmittertreiner\LocalSwift\llvm\include\llvm/ADT/Optional.h(65): note: see reference to function template instantiation 'llvm::optional_detail::OptionalStorage<T,false> &llvm::optional_detail::OptionalStorage<T,false>::operator =(T &&)' being compiled
        with
        [
            T=swift::BeginApplySite
        ]
C:\Users\jmittertreiner\LocalSwift\llvm\include\llvm/ADT/Optional.h(132): note: see reference to class template instantiation 'llvm::optional_detail::OptionalStorage<T,false>' being compiled
        with
        [
            T=swift::BeginApplySite
        ]
C:\Users\jmittertreiner\LocalSwift\swift\lib\SILOptimizer\Utils\SILInliner.cpp(93): note: see reference to class template instantiation 'llvm::Optional<swift::BeginApplySite>' being compiled

@gottesmm
Copy link
Contributor

gottesmm commented Oct 26, 2018

Just a meta comment (this is not a functionality review). Can you run this through git-clang-format? Swift c++'s style uses Type *, not Type*

SILBuilder contains a SILBuilderContext which contains a SILModule which
has a deleted operator=. Assigning an Optional<BeginApplySite> causes MSVC
to attempt to create operator= for SILBuilder which fails due to the
deleted operator=. This changes BeginApplySite to use a SILBuilder*
instead of a SILBuilder& to get around it.
@gmittert gmittert force-pushed the UsePointerInSILInlineer branch from 64df767 to 39f1767 Compare October 26, 2018 18:45
@compnerd
Copy link
Member

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 64df7671ffaa4c884e6c392172980de8b57bc1dc

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 64df7671ffaa4c884e6c392172980de8b57bc1dc

@compnerd
Copy link
Member

@swift-ci please test macOS platform

@atrick
Copy link
Contributor

atrick commented Oct 28, 2018

LGTM

@compnerd compnerd merged commit 5c6eacd into swiftlang:master Oct 29, 2018
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.

5 participants