clang 23.0.0git
AnalysisTraits.h
Go to the documentation of this file.
1//===- AnalysisTraits.h -----------------------------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// Type traits for AnalysisResult subclasses.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_CLANG_SCALABLESTATICANALYSISFRAMEWORK_CORE_WHOLEPROGRAMANALYSIS_ANALYSISTRAITS_H
14#define LLVM_CLANG_SCALABLESTATICANALYSISFRAMEWORK_CORE_WHOLEPROGRAMANALYSIS_ANALYSISTRAITS_H
15
17#include <type_traits>
18
19namespace clang::ssaf {
20
21/// Type trait that checks whether \p T has a static \c analysisName() method
22/// returning \c AnalysisName. Used to enforce the convention on AnalysisResult
23/// subclasses and analysis classes at instantiation time.
24template <typename T, typename = void>
25struct HasAnalysisName : std::false_type {};
26
27template <typename T>
28struct HasAnalysisName<T, std::void_t<decltype(T::analysisName())>>
29 : std::is_same<decltype(T::analysisName()), AnalysisName> {};
30
31template <typename T>
33
34} // namespace clang::ssaf
35
36#endif // LLVM_CLANG_SCALABLESTATICANALYSISFRAMEWORK_CORE_WHOLEPROGRAMANALYSIS_ANALYSISTRAITS_H
constexpr bool HasAnalysisName_v
Type trait that checks whether T has a static analysisName() method returning AnalysisName.