clang 23.0.0git
ExtractorRegistry.cpp
Go to the documentation of this file.
1//===- ExtractorRegistry.cpp ----------------------------------------------===//
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
10#include <memory>
11
12using namespace clang;
13using namespace ssaf;
14
15// FIXME: LLVM_INSTANTIATE_REGISTRY can't be used here because it drops extra
16// type parameters.
17template class CLANG_EXPORT_TEMPLATE
18 llvm::Registry<TUSummaryExtractor, TUSummaryBuilder &>;
19
21 for (const auto &Entry : TUSummaryExtractorRegistry::entries())
22 if (Entry.getName() == SummaryName)
23 return true;
24 return false;
25}
26
27std::unique_ptr<ASTConsumer>
29 TUSummaryBuilder &Builder) {
30 for (const auto &Entry : TUSummaryExtractorRegistry::entries())
31 if (Entry.getName() == SummaryName)
32 return Entry.instantiate(Builder);
33 assert(false && "Unknown SummaryExtractor name");
34 return nullptr;
35}
Uniquely identifies an analysis summary.
Definition SummaryName.h:21
std::unique_ptr< ASTConsumer > makeTUSummaryExtractor(llvm::StringRef SummaryName, TUSummaryBuilder &Builder)
Try to instantiate a TUSummaryExtractor with a given name.
bool isTUSummaryExtractorRegistered(llvm::StringRef SummaryName)
Check if a TUSummaryExtractor was registered with a given name.
The JSON file list parser is used to communicate input to InstallAPI.