This is an archive of the discontinued LLVM Phabricator instance.

Include Region.h in OperationSupport.h instead of forward declaring it (NFC)
DraftPublic

Authored by mehdi_amini on Dec 3 2020, 10:56 AM.
This is a draft revision that has not yet been submitted for review.

Details

Reviewers
rriddle
Summary

This fixes the build on gcc5 toolchain where sizeof is required for
types used in SmallVector now.
This is a consequence of using std::is_trivially_copy_constructible
instead of the LLVM variant: https://reviews.llvm.org/D92543

Diff Detail

Event Timeline

mehdi_amini created this revision.Dec 3 2020, 10:56 AM
Herald added a project: Restricted Project. · View Herald Transcript
miyuki added a subscriber: miyuki.Dec 3 2020, 11:07 AM

Hi. This also affects llvm/lib/CodeGen/AsmPrinter/DebugLocStream.cpp and llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (forward declarations of llvm::DwarfCompileUnit and llvm::DwarfTypeUnit).

And another group of errors looks related as well:

[41/4081] Building CXX object lib/CodeGen/GlobalISel/CMakeFiles/LLVMGlobalISel.dir/RegBankSelect.cpp.o
FAILED: CCACHE_DIR=/work/ccache/llvm CCACHE_MAXSIZE=20G CCACHE_CPP2=yes /usr/bin/ccache /arm/devsys-tools/collections/gcc/7.3.0/1/linux_3.2-ubuntu_12.04-x86_64/gcc-4.6.3-SYSTEM/bin/g++  -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Ilib/CodeGen/GlobalISel -I/work/repos/llvm/src/llvm/lib/CodeGen/GlobalISel -Iinclude -I/work/repos/llvm/src/llvm/include -fPIC -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -fdiagnostics-color -g -fPIC    -fno-exceptions -fno-rtti -std=c++14 -MD -MT lib/CodeGen/GlobalISel/CMakeFiles/LLVMGlobalISel.dir/RegBankSelect.cpp.o -MF lib/CodeGen/GlobalISel/CMakeFiles/LLVMGlobalISel.dir/RegBankSelect.cpp.o.d -o lib/CodeGen/GlobalISel/CMakeFiles/LLVMGlobalISel.dir/RegBankSelect.cpp.o -c /work/repos/llvm/src/llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp
In file included from /arm/devsys-tools/collections/gcc/7.3.0/1/linux_3.2-ubuntu_12.04-x86_64/gcc-4.6.3-SYSTEM/include/c++/7.3.0/bits/char_traits.h:39:0,
                 from /arm/devsys-tools/collections/gcc/7.3.0/1/linux_3.2-ubuntu_12.04-x86_64/gcc-4.6.3-SYSTEM/include/c++/7.3.0/string:40,
                 from /work/repos/llvm/src/llvm/include/llvm/Support/ErrorHandling.h:18,
                 from /work/repos/llvm/src/llvm/include/llvm/ADT/SmallVector.h:18,
                 from /work/repos/llvm/src/llvm/include/llvm/CodeGen/GlobalISel/RegBankSelect.h:66,
                 from /work/repos/llvm/src/llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp:12:
/arm/devsys-tools/collections/gcc/7.3.0/1/linux_3.2-ubuntu_12.04-x86_64/gcc-4.6.3-SYSTEM/include/c++/7.3.0/bits/stl_algobase.h: In instantiation of 'static _OI std::__copy_move<false, false, std::random_access_iterator_tag>::__copy_m(_II, _II, _OI) [with _II = const std::unique_ptr<llvm::RegBankSelect::InsertPoint>*; _OI = std::unique_ptr<llvm::RegBankSelect::InsertPoint>*]':
/arm/devsys-tools/collections/gcc/7.3.0/1/linux_3.2-ubuntu_12.04-x86_64/gcc-4.6.3-SYSTEM/include/c++/7.3.0/bits/stl_algobase.h:386:44:   required from '_OI std::__copy_move_a(_II, _II, _OI) [with bool _IsMove = false; _II = const std::unique_ptr<llvm::RegBankSelect::InsertPoint>*; _OI = std::unique_ptr<llvm::RegBankSelect::InsertPoint>*]'
/arm/devsys-tools/collections/gcc/7.3.0/1/linux_3.2-ubuntu_12.04-x86_64/gcc-4.6.3-SYSTEM/include/c++/7.3.0/bits/stl_algobase.h:422:45:   required from '_OI std::__copy_move_a2(_II, _II, _OI) [with bool _IsMove = false; _II = const std::unique_ptr<llvm::RegBankSelect::InsertPoint>*; _OI = std::unique_ptr<llvm::RegBankSelect::InsertPoint>*]'
/arm/devsys-tools/collections/gcc/7.3.0/1/linux_3.2-ubuntu_12.04-x86_64/gcc-4.6.3-SYSTEM/include/c++/7.3.0/bits/stl_algobase.h:455:8:   required from '_OI std::copy(_II, _II, _OI) [with _II = const std::unique_ptr<llvm::RegBankSelect::InsertPoint>*; _OI = std::unique_ptr<llvm::RegBankSelect::InsertPoint>*]'
/work/repos/llvm/src/llvm/include/llvm/ADT/SmallVector.h:842:25:   required from 'llvm::SmallVectorImpl<T>& llvm::SmallVectorImpl<T>::operator=(const llvm::SmallVectorImpl<T>&) [with T = std::unique_ptr<llvm::RegBankSelect::InsertPoint>]'
/work/repos/llvm/src/llvm/include/llvm/ADT/SmallVector.h:995:36:   required from 'llvm::SmallVector<T, N>::SmallVector(const llvm::SmallVector<T, N>&) [with T = std::unique_ptr<llvm::RegBankSelect::InsertPoint>; unsigned int N = 2]'
/work/repos/llvm/src/llvm/include/llvm/CodeGen/GlobalISel/RegBankSelect.h:313:9:   required from 'struct std::is_trivially_copy_constructible<llvm::RegBankSelect::RepairingPlacement>'
/work/repos/llvm/src/llvm/include/llvm/ADT/SmallVector.h:281:79:   required from 'class llvm::SmallVectorImpl<llvm::RegBankSelect::RepairingPlacement>'
/work/repos/llvm/src/llvm/include/llvm/ADT/SmallVector.h:960:22:   required from 'class llvm::SmallVector<llvm::RegBankSelect::RepairingPlacement, 4>'
/work/repos/llvm/src/llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp:297:38:   required from here
/arm/devsys-tools/collections/gcc/7.3.0/1/linux_3.2-ubuntu_12.04-x86_64/gcc-4.6.3-SYSTEM/include/c++/7.3.0/bits/stl_algobase.h:324:18: error: use of deleted function 'std::unique_ptr<_Tp, _Dp>& std::unique_ptr<_Tp, _Dp>::operator=(const std::unique_ptr<_Tp, _Dp>&) [with _Tp = llvm::RegBankSelect::InsertPoint; _Dp = std::default_delete<llvm::RegBankSelect::InsertPoint>]'
        *__result = *__first;
        ~~~~~~~~~~^~~~~~~~~~
[384/4081] Building CXX object lib/Analysis/CMakeFiles/LLVMAnalysis.dir/LoopCacheAnalysis.cpp.o
FAILED: CCACHE_DIR=/work/ccache/llvm CCACHE_MAXSIZE=20G CCACHE_CPP2=yes /usr/bin/ccache /arm/devsys-tools/collections/gcc/7.3.0/1/linux_3.2-ubuntu_12.04-x86_64/gcc-4.6.3-SYSTEM/bin/g++  -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Ilib/Analysis -I/work/repos/llvm/src/llvm/lib/Analysis -Iinclude -I/work/repos/llvm/src/llvm/include -fPIC -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -fdiagnostics-color -g -fPIC    -fno-exceptions -fno-rtti -std=c++14 -MD -MT lib/Analysis/CMakeFiles/LLVMAnalysis.dir/LoopCacheAnalysis.cpp.o -MF lib/Analysis/CMakeFiles/LLVMAnalysis.dir/LoopCacheAnalysis.cpp.o.d -o lib/Analysis/CMakeFiles/LLVMAnalysis.dir/LoopCacheAnalysis.cpp.o -c /work/repos/llvm/src/llvm/lib/Analysis/LoopCacheAnalysis.cpp
In file included from /arm/devsys-tools/collections/gcc/7.3.0/1/linux_3.2-ubuntu_12.04-x86_64/gcc-4.6.3-SYSTEM/include/c++/7.3.0/memory:62:0,
                 from /work/repos/llvm/src/llvm/include/llvm/ADT/Optional.h:22,
                 from /work/repos/llvm/src/llvm/include/llvm/ADT/PostOrderIterator.h:19,
                 from /work/repos/llvm/src/llvm/include/llvm/Analysis/LoopAnalysisManager.h:32,
                 from /work/repos/llvm/src/llvm/include/llvm/Analysis/LoopCacheAnalysis.h:17,
                 from /work/repos/llvm/src/llvm/lib/Analysis/LoopCacheAnalysis.cpp:28:
/arm/devsys-tools/collections/gcc/7.3.0/1/linux_3.2-ubuntu_12.04-x86_64/gcc-4.6.3-SYSTEM/include/c++/7.3.0/bits/stl_algobase.h: In instantiation of 'static _OI std::__copy_move<false, false, std::random_access_iterator_tag>::__copy_m(_II, _II, _OI) [with _II = const std::unique_ptr<llvm::IndexedReference>*; _OI = std::unique_ptr<llvm::IndexedReference>*]':
/arm/devsys-tools/collections/gcc/7.3.0/1/linux_3.2-ubuntu_12.04-x86_64/gcc-4.6.3-SYSTEM/include/c++/7.3.0/bits/stl_algobase.h:386:44:   required from '_OI std::__copy_move_a(_II, _II, _OI) [with bool _IsMove = false; _II = const std::unique_ptr<llvm::IndexedReference>*; _OI = std::unique_ptr<llvm::IndexedReference>*]'
/arm/devsys-tools/collections/gcc/7.3.0/1/linux_3.2-ubuntu_12.04-x86_64/gcc-4.6.3-SYSTEM/include/c++/7.3.0/bits/stl_algobase.h:422:45:   required from '_OI std::__copy_move_a2(_II, _II, _OI) [with bool _IsMove = false; _II = const std::unique_ptr<llvm::IndexedReference>*; _OI = std::unique_ptr<llvm::IndexedReference>*]'
/arm/devsys-tools/collections/gcc/7.3.0/1/linux_3.2-ubuntu_12.04-x86_64/gcc-4.6.3-SYSTEM/include/c++/7.3.0/bits/stl_algobase.h:455:8:   required from '_OI std::copy(_II, _II, _OI) [with _II = const std::unique_ptr<llvm::IndexedReference>*; _OI = std::unique_ptr<llvm::IndexedReference>*]'
/work/repos/llvm/src/llvm/include/llvm/ADT/SmallVector.h:842:25:   required from 'llvm::SmallVectorImpl<T>& llvm::SmallVectorImpl<T>::operator=(const llvm::SmallVectorImpl<T>&) [with T = std::unique_ptr<llvm::IndexedReference>]'
/work/repos/llvm/src/llvm/include/llvm/ADT/SmallVector.h:995:36:   required from 'llvm::SmallVector<T, N>::SmallVector(const llvm::SmallVector<T, N>&) [with T = std::unique_ptr<llvm::IndexedReference>; unsigned int N = 8]'
/arm/devsys-tools/collections/gcc/7.3.0/1/linux_3.2-ubuntu_12.04-x86_64/gcc-4.6.3-SYSTEM/include/c++/7.3.0/type_traits:1406:12:   required from 'struct std::is_trivially_copy_constructible<llvm::SmallVector<std::unique_ptr<llvm::IndexedReference>, 8> >'
/work/repos/llvm/src/llvm/include/llvm/ADT/SmallVector.h:281:79:   required from 'class llvm::SmallVectorImpl<llvm::SmallVector<std::unique_ptr<llvm::IndexedReference>, 8> >'
/work/repos/llvm/src/llvm/include/llvm/ADT/SmallVector.h:960:22:   required from 'class llvm::SmallVector<llvm::SmallVector<std::unique_ptr<llvm::IndexedReference>, 8>, 8>'
/work/repos/llvm/src/llvm/lib/Analysis/LoopCacheAnalysis.cpp:522:21:   required from here
/arm/devsys-tools/collections/gcc/7.3.0/1/linux_3.2-ubuntu_12.04-x86_64/gcc-4.6.3-SYSTEM/include/c++/7.3.0/bits/stl_algobase.h:324:18: error: use of deleted function 'std::unique_ptr<_Tp, _Dp>& std::unique_ptr<_Tp, _Dp>::operator=(const std::unique_ptr<_Tp, _Dp>&) [with _Tp = llvm::IndexedReference; _Dp = std::default_delete<llvm::IndexedReference>]'
        *__result = *__first;
        ~~~~~~~~~~^~~~~~~~~~

(the host compiler is GCC 7.3)