mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-14 11:39:35 +00:00
I predict that HeaderSearch will need the ability to generate
diagnostics in the future. Make it so. llvm-svn: 144347
This commit is contained in:
parent
f311655e3f
commit
197ac203af
@ -21,7 +21,8 @@
|
||||
#include <vector>
|
||||
|
||||
namespace clang {
|
||||
|
||||
|
||||
class DiagnosticsEngine;
|
||||
class ExternalIdentifierLookup;
|
||||
class FileEntry;
|
||||
class FileManager;
|
||||
@ -118,6 +119,7 @@ public:
|
||||
/// file referenced by a #include or #include_next, (sub-)framework lookup, etc.
|
||||
class HeaderSearch {
|
||||
FileManager &FileMgr;
|
||||
DiagnosticsEngine &Diags;
|
||||
/// #include search path information. Requests for #include "x" search the
|
||||
/// directory of the #including file first, then each directory in SearchDirs
|
||||
/// consecutively. Requests for <x> search the current dir first, then each
|
||||
@ -180,7 +182,7 @@ class HeaderSearch {
|
||||
explicit HeaderSearch(const HeaderSearch&);
|
||||
void operator=(const HeaderSearch&);
|
||||
public:
|
||||
HeaderSearch(FileManager &FM);
|
||||
HeaderSearch(FileManager &FM, DiagnosticsEngine &Diags);
|
||||
~HeaderSearch();
|
||||
|
||||
FileManager &getFileMgr() const { return FileMgr; }
|
||||
|
@ -664,7 +664,8 @@ ASTUnit *ASTUnit::LoadFromASTFile(const std::string &Filename,
|
||||
AST->FileMgr = new FileManager(FileSystemOpts);
|
||||
AST->SourceMgr = new SourceManager(AST->getDiagnostics(),
|
||||
AST->getFileManager());
|
||||
AST->HeaderInfo.reset(new HeaderSearch(AST->getFileManager()));
|
||||
AST->HeaderInfo.reset(new HeaderSearch(AST->getFileManager(),
|
||||
AST->getDiagnostics()));
|
||||
|
||||
for (unsigned I = 0; I != NumRemappedFiles; ++I) {
|
||||
FilenameOrMemBuf fileOrBuf = RemappedFiles[I].second;
|
||||
|
@ -250,7 +250,8 @@ void CompilerInstance::createPreprocessor() {
|
||||
PTHMgr = PTHManager::Create(PPOpts.TokenCache, getDiagnostics());
|
||||
|
||||
// Create the Preprocessor.
|
||||
HeaderSearch *HeaderInfo = new HeaderSearch(getFileManager());
|
||||
HeaderSearch *HeaderInfo = new HeaderSearch(getFileManager(),
|
||||
getDiagnostics());
|
||||
PP = new Preprocessor(getDiagnostics(), getLangOpts(), &getTarget(),
|
||||
getSourceManager(), *HeaderInfo, *this, PTHMgr,
|
||||
/*OwnsHeaderSearch=*/true);
|
||||
|
@ -36,8 +36,9 @@ HeaderFileInfo::getControllingMacro(ExternalIdentifierLookup *External) {
|
||||
|
||||
ExternalHeaderFileInfoSource::~ExternalHeaderFileInfoSource() {}
|
||||
|
||||
HeaderSearch::HeaderSearch(FileManager &FM)
|
||||
: FileMgr(FM), FrameworkMap(64) {
|
||||
HeaderSearch::HeaderSearch(FileManager &FM, DiagnosticsEngine &Diags)
|
||||
: FileMgr(FM), Diags(Diags), FrameworkMap(64)
|
||||
{
|
||||
AngledDirIdx = 0;
|
||||
SystemDirIdx = 0;
|
||||
NoCurDirSearch = false;
|
||||
|
Loading…
Reference in New Issue
Block a user