14#ifndef LLVM_CLANG_LIB_STATICANALYZER_CHECKER_YAML_H
15#define LLVM_CLANG_LIB_STATICANALYZER_CHECKER_YAML_H
19#include "llvm/Support/VirtualFileSystem.h"
20#include "llvm/Support/YAMLTraits.h"
29template <
class T,
class Checker>
31 StringRef Option, StringRef ConfigFile) {
32 if (ConfigFile.trim().empty())
39 llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> Buffer =
40 VFS.getBufferForFile(ConfigFile.str());
42 if (Buffer.getError()) {
44 "a valid filename instead of '" +
45 std::string(ConfigFile) +
"'");
49 llvm::yaml::Input Input(Buffer.get()->getBuffer());
53 if (std::error_code ec = Input.error()) {
55 "a valid yaml file: " + ec.message());
Defines the SourceManager interface.
SourceManager & getSourceManager()
llvm::vfs::FileSystem & getVirtualFileSystem() const
FileManager & getFileManager() const
ASTContext & getASTContext() const
void reportInvalidCheckerOptionValue(const CheckerFrontend *Checker, StringRef OptionName, StringRef ExpectedValueDesc) const
Emits an error through a DiagnosticsEngine about an invalid user supplied checker option value.
Simple checker classes that implement one frontend (i.e.
std::optional< T > getConfiguration(CheckerManager &Mgr, Checker *Chk, StringRef Option, StringRef ConfigFile)
Read the given file from the filesystem and parse it as a yaml file.
The JSON file list parser is used to communicate input to InstallAPI.
const FunctionProtoType * T