File indexing completed on 2026-05-10 08:37:05
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef LLVM_CLANG_SEMA_TEMPLATEINSTCALLBACK_H
0015 #define LLVM_CLANG_SEMA_TEMPLATEINSTCALLBACK_H
0016
0017 #include "clang/Sema/Sema.h"
0018
0019 namespace clang {
0020
0021
0022
0023 class TemplateInstantiationCallback {
0024 public:
0025 virtual ~TemplateInstantiationCallback() = default;
0026
0027
0028 virtual void initialize(const Sema &TheSema) = 0;
0029
0030
0031 virtual void finalize(const Sema &TheSema) = 0;
0032
0033
0034 virtual void atTemplateBegin(const Sema &TheSema,
0035 const Sema::CodeSynthesisContext &Inst) = 0;
0036
0037
0038 virtual void atTemplateEnd(const Sema &TheSema,
0039 const Sema::CodeSynthesisContext &Inst) = 0;
0040 };
0041
0042 template <class TemplateInstantiationCallbackPtrs>
0043 void initialize(TemplateInstantiationCallbackPtrs &Callbacks,
0044 const Sema &TheSema) {
0045 for (auto &C : Callbacks) {
0046 if (C)
0047 C->initialize(TheSema);
0048 }
0049 }
0050
0051 template <class TemplateInstantiationCallbackPtrs>
0052 void finalize(TemplateInstantiationCallbackPtrs &Callbacks,
0053 const Sema &TheSema) {
0054 for (auto &C : Callbacks) {
0055 if (C)
0056 C->finalize(TheSema);
0057 }
0058 }
0059
0060 template <class TemplateInstantiationCallbackPtrs>
0061 void atTemplateBegin(TemplateInstantiationCallbackPtrs &Callbacks,
0062 const Sema &TheSema,
0063 const Sema::CodeSynthesisContext &Inst) {
0064 for (auto &C : Callbacks) {
0065 if (C)
0066 C->atTemplateBegin(TheSema, Inst);
0067 }
0068 }
0069
0070 template <class TemplateInstantiationCallbackPtrs>
0071 void atTemplateEnd(TemplateInstantiationCallbackPtrs &Callbacks,
0072 const Sema &TheSema,
0073 const Sema::CodeSynthesisContext &Inst) {
0074 for (auto &C : Callbacks) {
0075 if (C)
0076 C->atTemplateEnd(TheSema, Inst);
0077 }
0078 }
0079
0080 }
0081
0082 #endif