File tree Expand file tree Collapse file tree 4 files changed +15
-7
lines changed Expand file tree Collapse file tree 4 files changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -467,9 +467,8 @@ template <typename ContextT> class GenericUniformityAnalysisImpl {
467
467
ConstValueRefT Val) const ;
468
468
};
469
469
470
- template <typename ContextT>
471
- void GenericUniformityInfo<ContextT>::ImplDeleter::operator ()(
472
- GenericUniformityAnalysisImpl<ContextT> *Impl) {
470
+ template <typename ImplT>
471
+ void GenericUniformityAnalysisImplDeleter<ImplT>::operator ()(ImplT *Impl) {
473
472
delete Impl;
474
473
}
475
474
Original file line number Diff line number Diff line change @@ -24,6 +24,14 @@ namespace llvm {
24
24
class TargetTransformInfo ;
25
25
26
26
template <typename ContextT> class GenericUniformityAnalysisImpl ;
27
+ template <typename ImplT> struct GenericUniformityAnalysisImplDeleter {
28
+ // Ugly hack around the fact that recent (> 15.0) clang will run into an
29
+ // is_invocable() check in some GNU libc++'s unique_ptr implementation
30
+ // and reject this deleter if you just make it callable with an ImplT *,
31
+ // whether or not the type of ImplT is spelled out.
32
+ using pointer = ImplT *;
33
+ void operator ()(ImplT *Impl);
34
+ };
27
35
28
36
template <typename ContextT> class GenericUniformityInfo {
29
37
public:
@@ -63,12 +71,9 @@ template <typename ContextT> class GenericUniformityInfo {
63
71
64
72
private:
65
73
using ImplT = GenericUniformityAnalysisImpl<ContextT>;
66
- struct ImplDeleter {
67
- void operator ()(GenericUniformityAnalysisImpl<ContextT> *Impl);
68
- };
69
74
70
75
FunctionT *F;
71
- std::unique_ptr<ImplT, ImplDeleter > DA;
76
+ std::unique_ptr<ImplT, GenericUniformityAnalysisImplDeleter<ImplT> > DA;
72
77
73
78
GenericUniformityInfo (const GenericUniformityInfo &) = delete ;
74
79
GenericUniformityInfo &operator =(const GenericUniformityInfo &) = delete ;
Original file line number Diff line number Diff line change @@ -87,6 +87,8 @@ bool llvm::GenericUniformityAnalysisImpl<SSAContext>::usesValueFromCycle(
87
87
// This ensures explicit instantiation of
88
88
// GenericUniformityAnalysisImpl::ImplDeleter::operator()
89
89
template class llvm ::GenericUniformityInfo<SSAContext>;
90
+ template struct llvm ::GenericUniformityAnalysisImplDeleter<
91
+ llvm::GenericUniformityAnalysisImpl<SSAContext>>;
90
92
91
93
// ===----------------------------------------------------------------------===//
92
94
// UniformityInfoAnalysis and related pass implementations
Original file line number Diff line number Diff line change @@ -113,6 +113,8 @@ bool llvm::GenericUniformityAnalysisImpl<MachineSSAContext>::usesValueFromCycle(
113
113
// This ensures explicit instantiation of
114
114
// GenericUniformityAnalysisImpl::ImplDeleter::operator()
115
115
template class llvm ::GenericUniformityInfo<MachineSSAContext>;
116
+ template struct llvm ::GenericUniformityAnalysisImplDeleter<
117
+ llvm::GenericUniformityAnalysisImpl<MachineSSAContext>>;
116
118
117
119
MachineUniformityInfo
118
120
llvm::computeMachineUniformityInfo (MachineFunction &F,
You can’t perform that action at this time.
0 commit comments