ConstValueRefT Val) const;
};
-template <typename ContextT>
-void GenericUniformityInfo<ContextT>::ImplDeleter::operator()(
- GenericUniformityAnalysisImpl<ContextT> *Impl) {
+template <typename ImplT>
+void GenericUniformityAnalysisImplDeleter<ImplT>::operator()(ImplT *Impl) {
delete Impl;
}
class TargetTransformInfo;
template <typename ContextT> class GenericUniformityAnalysisImpl;
+template <typename ImplT> struct GenericUniformityAnalysisImplDeleter {
+ // Ugly hack around the fact that recent (> 15.0) clang will run into an
+ // is_invocable() check in some GNU libc++'s unique_ptr implementation
+ // and reject this deleter if you just make it callable with an ImplT *,
+ // whether or not the type of ImplT is spelled out.
+ using pointer = ImplT *;
+ void operator()(ImplT *Impl);
+};
template <typename ContextT> class GenericUniformityInfo {
public:
private:
using ImplT = GenericUniformityAnalysisImpl<ContextT>;
- struct ImplDeleter {
- void operator()(GenericUniformityAnalysisImpl<ContextT> *Impl);
- };
FunctionT *F;
- std::unique_ptr<ImplT, ImplDeleter> DA;
+ std::unique_ptr<ImplT, GenericUniformityAnalysisImplDeleter<ImplT>> DA;
GenericUniformityInfo(const GenericUniformityInfo &) = delete;
GenericUniformityInfo &operator=(const GenericUniformityInfo &) = delete;
// This ensures explicit instantiation of
// GenericUniformityAnalysisImpl::ImplDeleter::operator()
template class llvm::GenericUniformityInfo<SSAContext>;
+template struct llvm::GenericUniformityAnalysisImplDeleter<
+ llvm::GenericUniformityAnalysisImpl<SSAContext>>;
//===----------------------------------------------------------------------===//
// UniformityInfoAnalysis and related pass implementations
// This ensures explicit instantiation of
// GenericUniformityAnalysisImpl::ImplDeleter::operator()
template class llvm::GenericUniformityInfo<MachineSSAContext>;
+template struct llvm::GenericUniformityAnalysisImplDeleter<
+ llvm::GenericUniformityAnalysisImpl<MachineSSAContext>>;
MachineUniformityInfo
llvm::computeMachineUniformityInfo(MachineFunction &F,