Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions clang/lib/StaticAnalyzer/Checkers/Yaml.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#ifndef LLVM_CLANG_LIB_STATICANALYZER_CHECKER_YAML_H
#define LLVM_CLANG_LIB_STATICANALYZER_CHECKER_YAML_H

#include "clang/Basic/SourceManager.h"
#include "clang/StaticAnalyzer/Core/CheckerManager.h"
#include "llvm/Support/VirtualFileSystem.h"
#include "llvm/Support/YAMLTraits.h"
Expand All @@ -31,9 +32,12 @@ std::optional<T> getConfiguration(CheckerManager &Mgr, Checker *Chk,
if (ConfigFile.trim().empty())
return std::nullopt;

llvm::vfs::FileSystem *FS = llvm::vfs::getRealFileSystem().get();
auto &VFS = Mgr.getASTContext()
.getSourceManager()
.getFileManager()
.getVirtualFileSystem();
llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> Buffer =
FS->getBufferForFile(ConfigFile.str());
VFS.getBufferForFile(ConfigFile.str());

if (Buffer.getError()) {
Mgr.reportInvalidCheckerOptionValue(Chk, Option,
Expand Down