HomePhabricator

Revert "Use std::is_trivially_copyable", breaks MSVC build

Authored by rnk on Dec 2 2020, 1:48 PM.

Description

Revert "Use std::is_trivially_copyable", breaks MSVC build

Revert "Delete llvm::is_trivially_copyable and CMake variable HAVE_STD_IS_TRIVIALLY_COPYABLE"

This reverts commit 4d4bd40b578d77b8c5bc349ded405fb58c333c78.

This reverts commit 557b00e0afb2dc1776f50948094ca8cc62d97be4.

Event Timeline

MaskRay added a subscriber: MaskRay.Dec 2 2020, 2:43 PM

Is there a sample MSVC failure? llvm-clang-x86_64-win-fast (http://lab.llvm.org:8011/#/builders/86) appeared to be good...

rnk added a comment.Dec 2 2020, 3:14 PM

I reprod it locally with some MSVC 2019 version, and it's also visible in the harbormaster pre commit checks on every phab patch upload.

My buildbot is unhealthy at the moment for unrelated reasons.

I know this is settled already, but I just wanted to confirm that I'm currently seeing this issue in my downstream. When building opt, line 254 of CodeGen/WasEHPrepare.cpp fails to compile:

1>[prefix omitted]\llvm\include\llvm/ADT/BreadthFirstIterator.h(96,12): error C2280: 'llvm::Optional<std::pair<llvm::DomTreeNodeBase<llvm::BasicBlock> *,llvm::Optional<llvm::DomTreeNodeBase<llvm::BasicBlock> *const *>>> &llvm::Optional<std::pair<llvm::DomTreeNodeBase<llvm::BasicBlock> *,llvm::Optional<llvm::DomTreeNodeBase<llvm::BasicBlock> *const *>>>::operator =(const llvm::Optional<std::pair<llvm::DomTreeNodeBase<llvm::BasicBlock> *,llvm::Optional<llvm::DomTreeNodeBase<llvm::BasicBlock> *const *>>> &)': attempting to reference a deleted function
1>[prefix omitted]\llvm\include\llvm/ADT/Optional.h(250): message : see declaration of 'llvm::Optional<std::pair<llvm::DomTreeNodeBase<llvm::BasicBlock> *,llvm::Optional<llvm::DomTreeNodeBase<llvm::BasicBlock> *const *>>>::operator ='
1>[prefix omitted]\llvm\include\llvm/ADT/Optional.h(250,13): message : 'llvm::Optional<std::pair<llvm::DomTreeNodeBase<llvm::BasicBlock> *,llvm::Optional<llvm::DomTreeNodeBase<llvm::BasicBlock> *const *>>> &llvm::Optional<std::pair<llvm::DomTreeNodeBase<llvm::BasicBlock> *,llvm::Optional<llvm::DomTreeNodeBase<llvm::BasicBlock> *const *>>>::operator =(const llvm::Optional<std::pair<llvm::DomTreeNodeBase<llvm::BasicBlock> *,llvm::Optional<llvm::DomTreeNodeBase<llvm::BasicBlock> *const *>>> &)': function was implicitly deleted because a data member invokes a deleted or inaccessible function 'llvm::optional_detail::OptionalStorage<T,true> &llvm::optional_detail::OptionalStorage<T,true>::operator =(const llvm::optional_detail::OptionalStorage<T,true> &)'
1>        with
1>        [
1>            T=std::pair<llvm::DomTreeNodeBase<llvm::BasicBlock> *,llvm::Optional<llvm::DomTreeNodeBase<llvm::BasicBlock> *const *>>
1>        ]
1>[prefix omitted]\llvm\include\llvm/ADT/Optional.h(156,20): message : 'llvm::optional_detail::OptionalStorage<T,true> &llvm::optional_detail::OptionalStorage<T,true>::operator =(const llvm::optional_detail::OptionalStorage<T,true> &)': function was implicitly deleted because 'llvm::optional_detail::OptionalStorage<T,true>' has a variant data member 'llvm::optional_detail::OptionalStorage<T,true>::value' with a non-trivial copy assignment operator
1>        with
1>        [
1>            T=std::pair<llvm::DomTreeNodeBase<llvm::BasicBlock> *,llvm::Optional<llvm::DomTreeNodeBase<llvm::BasicBlock> *const *>>
1>        ]
1>[prefix omitted]\llvm\include\llvm/ADT/Optional.h(144): message : see declaration of 'llvm::optional_detail::OptionalStorage<T,true>::value'
1>        with
1>        [
1>            T=std::pair<llvm::DomTreeNodeBase<llvm::BasicBlock> *,llvm::Optional<llvm::DomTreeNodeBase<llvm::BasicBlock> *const *>>
1>        ]
1>[prefix omitted]\llvm\include\llvm/ADT/BreadthFirstIterator.h(77): message : while compiling class template member function 'void llvm::bf_iterator<llvm::DominatorTree *,llvm::SmallPtrSet<NodeRef,8>,llvm::GraphTraits<llvm::DominatorTree*>>::toNext(void)'
1>        with
1>        [
1>            NodeRef=llvm::DomTreeNode *
1>        ]
1>[prefix omitted]\llvm\include\llvm/ADT/BreadthFirstIterator.h(133): message : see reference to function template instantiation 'void llvm::bf_iterator<llvm::DominatorTree *,llvm::SmallPtrSet<NodeRef,8>,llvm::GraphTraits<llvm::DominatorTree*>>::toNext(void)' being compiled
1>        with
1>        [
1>            NodeRef=llvm::DomTreeNode *
1>        ]
1>[prefix omitted]\llvm\include\llvm/ADT/iterator_range.h(31): message : see reference to class template instantiation 'llvm::bf_iterator<llvm::DominatorTree *,llvm::SmallPtrSet<NodeRef,8>,llvm::GraphTraits<llvm::DominatorTree*>>' being compiled
1>        with
1>        [
1>            NodeRef=llvm::DomTreeNode *
1>        ]
1>[prefix omitted]\llvm\lib\CodeGen\WasmEHPrepare.cpp(254): message : see reference to class template instantiation 'llvm::iterator_range<llvm::bf_iterator<llvm::DominatorTree *,llvm::SmallPtrSet<NodeRef,8>,llvm::GraphTraits<llvm::DominatorTree*>>>' being compiled
1>        with
1>        [
1>            NodeRef=llvm::DomTreeNode *
1>        ]

I can just cherry-pick the revert and move on with my life, but perhaps this info is useful for @MaskRay if they decide to reattempt adding this.