1 //===-- CompilerInstance.h - Clang Compiler Instance ------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_CLANG_FRONTEND_COMPILERINSTANCE_H_
11 #define LLVM_CLANG_FRONTEND_COMPILERINSTANCE_H_
13 #include "clang/AST/ASTConsumer.h"
14 #include "clang/Basic/Diagnostic.h"
15 #include "clang/Basic/SourceManager.h"
16 #include "clang/Frontend/CompilerInvocation.h"
17 #include "clang/Frontend/PCHContainerOperations.h"
18 #include "clang/Frontend/Utils.h"
19 #include "clang/Lex/HeaderSearchOptions.h"
20 #include "clang/Lex/ModuleLoader.h"
21 #include "llvm/ADT/ArrayRef.h"
22 #include "llvm/ADT/DenseMap.h"
23 #include "llvm/ADT/IntrusiveRefCntPtr.h"
24 #include "llvm/ADT/StringRef.h"
40 class CodeCompleteConsumer;
41 class DiagnosticsEngine;
42 class DiagnosticConsumer;
43 class ExternalASTSource;
53 /// CompilerInstance - Helper class for managing a single instance of the Clang
56 /// The CompilerInstance serves two purposes:
57 /// (1) It manages the various objects which are necessary to run the compiler,
58 /// for example the preprocessor, the target information, and the AST
60 /// (2) It provides utility routines for constructing and manipulating the
61 /// common Clang objects.
63 /// The compiler instance generally owns the instance of all the objects that it
64 /// manages. However, clients can still share objects by manually setting the
65 /// object and retaking ownership prior to destroying the CompilerInstance.
67 /// The compiler instance is intended to simplify clients, but not to lock them
68 /// in to the compiler instance for everything. When possible, utility functions
69 /// come in two forms; a short form that reuses the CompilerInstance objects,
70 /// and a long form that takes explicit instances of any required objects.
71 class CompilerInstance : public ModuleLoader {
72 /// The options used in this compiler instance.
73 std::shared_ptr<CompilerInvocation> Invocation;
75 /// The diagnostics engine instance.
76 IntrusiveRefCntPtr<DiagnosticsEngine> Diagnostics;
78 /// The target being compiled for.
79 IntrusiveRefCntPtr<TargetInfo> Target;
81 /// Auxiliary Target info.
82 IntrusiveRefCntPtr<TargetInfo> AuxTarget;
84 /// The virtual file system.
85 IntrusiveRefCntPtr<vfs::FileSystem> VirtualFileSystem;
88 IntrusiveRefCntPtr<FileManager> FileMgr;
90 /// The source manager.
91 IntrusiveRefCntPtr<SourceManager> SourceMgr;
94 std::shared_ptr<Preprocessor> PP;
97 IntrusiveRefCntPtr<ASTContext> Context;
99 /// An optional sema source that will be attached to sema.
100 IntrusiveRefCntPtr<ExternalSemaSource> ExternalSemaSrc;
102 /// The AST consumer.
103 std::unique_ptr<ASTConsumer> Consumer;
105 /// The code completion consumer.
106 std::unique_ptr<CodeCompleteConsumer> CompletionConsumer;
108 /// \brief The semantic analysis object.
109 std::unique_ptr<Sema> TheSema;
111 /// \brief The frontend timer group.
112 std::unique_ptr<llvm::TimerGroup> FrontendTimerGroup;
114 /// \brief The frontend timer.
115 std::unique_ptr<llvm::Timer> FrontendTimer;
117 /// \brief The ASTReader, if one exists.
118 IntrusiveRefCntPtr<ASTReader> ModuleManager;
120 /// \brief The module dependency collector for crashdumps
121 std::shared_ptr<ModuleDependencyCollector> ModuleDepCollector;
123 /// \brief The module provider.
124 std::shared_ptr<PCHContainerOperations> ThePCHContainerOperations;
126 /// \brief The dependency file generator.
127 std::unique_ptr<DependencyFileGenerator> TheDependencyFileGenerator;
129 std::vector<std::shared_ptr<DependencyCollector>> DependencyCollectors;
131 /// \brief The set of top-level modules that has already been loaded,
132 /// along with the module map
133 llvm::DenseMap<const IdentifierInfo *, Module *> KnownModules;
135 /// \brief The location of the module-import keyword for the last module
137 SourceLocation LastModuleImportLoc;
139 /// \brief The result of the last module import.
141 ModuleLoadResult LastModuleImportResult;
143 /// \brief Whether we should (re)build the global module index once we
144 /// have finished with this translation unit.
145 bool BuildGlobalModuleIndex;
147 /// \brief We have a full global module index, with all modules.
148 bool HaveFullGlobalModuleIndex;
150 /// \brief One or more modules failed to build.
151 bool ModuleBuildFailed;
153 /// \brief Holds information about the output file.
155 /// If TempFilename is not empty we must rename it to Filename at the end.
156 /// TempFilename may be empty and Filename non-empty if creating the temporary
159 std::string Filename;
160 std::string TempFilename;
162 OutputFile(std::string filename, std::string tempFilename)
163 : Filename(std::move(filename)), TempFilename(std::move(tempFilename)) {
167 /// If the output doesn't support seeking (terminal, pipe). we switch
168 /// the stream to a buffer_ostream. These are the buffer and the original
170 std::unique_ptr<llvm::raw_fd_ostream> NonSeekStream;
172 /// The list of active output files.
173 std::list<OutputFile> OutputFiles;
175 CompilerInstance(const CompilerInstance &) = delete;
176 void operator=(const CompilerInstance &) = delete;
178 explicit CompilerInstance(
179 std::shared_ptr<PCHContainerOperations> PCHContainerOps =
180 std::make_shared<PCHContainerOperations>(),
181 bool BuildingModule = false);
182 ~CompilerInstance() override;
184 /// @name High-Level Operations
187 /// ExecuteAction - Execute the provided action against the compiler's
188 /// CompilerInvocation object.
190 /// This function makes the following assumptions:
192 /// - The invocation options should be initialized. This function does not
193 /// handle the '-help' or '-version' options, clients should handle those
196 /// - The diagnostics engine should have already been created by the client.
198 /// - No other CompilerInstance state should have been initialized (this is
199 /// an unchecked error).
201 /// - Clients should have initialized any LLVM target features that may be
204 /// - Clients should eventually call llvm_shutdown() upon the completion of
205 /// this routine to ensure that any managed objects are properly destroyed.
207 /// Note that this routine may write output to 'stderr'.
209 /// \param Act - The action to execute.
210 /// \return - True on success.
212 // FIXME: This function should take the stream to write any debugging /
213 // verbose output to as an argument.
215 // FIXME: Eliminate the llvm_shutdown requirement, that should either be part
216 // of the context or else not CompilerInstance specific.
217 bool ExecuteAction(FrontendAction &Act);
220 /// @name Compiler Invocation and Options
223 bool hasInvocation() const { return Invocation != nullptr; }
225 CompilerInvocation &getInvocation() {
226 assert(Invocation && "Compiler instance has no invocation!");
230 /// setInvocation - Replace the current invocation.
231 void setInvocation(std::shared_ptr<CompilerInvocation> Value);
233 /// \brief Indicates whether we should (re)build the global module index.
234 bool shouldBuildGlobalModuleIndex() const;
236 /// \brief Set the flag indicating whether we should (re)build the global
238 void setBuildGlobalModuleIndex(bool Build) {
239 BuildGlobalModuleIndex = Build;
243 /// @name Forwarding Methods
246 AnalyzerOptionsRef getAnalyzerOpts() {
247 return Invocation->getAnalyzerOpts();
250 CodeGenOptions &getCodeGenOpts() {
251 return Invocation->getCodeGenOpts();
253 const CodeGenOptions &getCodeGenOpts() const {
254 return Invocation->getCodeGenOpts();
257 DependencyOutputOptions &getDependencyOutputOpts() {
258 return Invocation->getDependencyOutputOpts();
260 const DependencyOutputOptions &getDependencyOutputOpts() const {
261 return Invocation->getDependencyOutputOpts();
264 DiagnosticOptions &getDiagnosticOpts() {
265 return Invocation->getDiagnosticOpts();
267 const DiagnosticOptions &getDiagnosticOpts() const {
268 return Invocation->getDiagnosticOpts();
271 FileSystemOptions &getFileSystemOpts() {
272 return Invocation->getFileSystemOpts();
274 const FileSystemOptions &getFileSystemOpts() const {
275 return Invocation->getFileSystemOpts();
278 FrontendOptions &getFrontendOpts() {
279 return Invocation->getFrontendOpts();
281 const FrontendOptions &getFrontendOpts() const {
282 return Invocation->getFrontendOpts();
285 HeaderSearchOptions &getHeaderSearchOpts() {
286 return Invocation->getHeaderSearchOpts();
288 const HeaderSearchOptions &getHeaderSearchOpts() const {
289 return Invocation->getHeaderSearchOpts();
291 std::shared_ptr<HeaderSearchOptions> getHeaderSearchOptsPtr() const {
292 return Invocation->getHeaderSearchOptsPtr();
295 LangOptions &getLangOpts() {
296 return *Invocation->getLangOpts();
298 const LangOptions &getLangOpts() const {
299 return *Invocation->getLangOpts();
302 PreprocessorOptions &getPreprocessorOpts() {
303 return Invocation->getPreprocessorOpts();
305 const PreprocessorOptions &getPreprocessorOpts() const {
306 return Invocation->getPreprocessorOpts();
309 PreprocessorOutputOptions &getPreprocessorOutputOpts() {
310 return Invocation->getPreprocessorOutputOpts();
312 const PreprocessorOutputOptions &getPreprocessorOutputOpts() const {
313 return Invocation->getPreprocessorOutputOpts();
316 TargetOptions &getTargetOpts() {
317 return Invocation->getTargetOpts();
319 const TargetOptions &getTargetOpts() const {
320 return Invocation->getTargetOpts();
324 /// @name Diagnostics Engine
327 bool hasDiagnostics() const { return Diagnostics != nullptr; }
329 /// Get the current diagnostics engine.
330 DiagnosticsEngine &getDiagnostics() const {
331 assert(Diagnostics && "Compiler instance has no diagnostics!");
335 /// setDiagnostics - Replace the current diagnostics engine.
336 void setDiagnostics(DiagnosticsEngine *Value);
338 DiagnosticConsumer &getDiagnosticClient() const {
339 assert(Diagnostics && Diagnostics->getClient() &&
340 "Compiler instance has no diagnostic client!");
341 return *Diagnostics->getClient();
345 /// @name Target Info
348 bool hasTarget() const { return Target != nullptr; }
350 TargetInfo &getTarget() const {
351 assert(Target && "Compiler instance has no target!");
355 /// Replace the current Target.
356 void setTarget(TargetInfo *Value);
359 /// @name AuxTarget Info
362 TargetInfo *getAuxTarget() const { return AuxTarget.get(); }
364 /// Replace the current AuxTarget.
365 void setAuxTarget(TargetInfo *Value);
368 /// @name Virtual File System
371 bool hasVirtualFileSystem() const { return VirtualFileSystem != nullptr; }
373 vfs::FileSystem &getVirtualFileSystem() const {
374 assert(hasVirtualFileSystem() &&
375 "Compiler instance has no virtual file system");
376 return *VirtualFileSystem;
379 /// \brief Replace the current virtual file system.
381 /// \note Most clients should use setFileManager, which will implicitly reset
382 /// the virtual file system to the one contained in the file manager.
383 void setVirtualFileSystem(IntrusiveRefCntPtr<vfs::FileSystem> FS) {
384 VirtualFileSystem = std::move(FS);
388 /// @name File Manager
391 bool hasFileManager() const { return FileMgr != nullptr; }
393 /// Return the current file manager to the caller.
394 FileManager &getFileManager() const {
395 assert(FileMgr && "Compiler instance has no file manager!");
399 void resetAndLeakFileManager() {
400 BuryPointer(FileMgr.get());
401 FileMgr.resetWithoutRelease();
404 /// \brief Replace the current file manager and virtual file system.
405 void setFileManager(FileManager *Value);
408 /// @name Source Manager
411 bool hasSourceManager() const { return SourceMgr != nullptr; }
413 /// Return the current source manager.
414 SourceManager &getSourceManager() const {
415 assert(SourceMgr && "Compiler instance has no source manager!");
419 void resetAndLeakSourceManager() {
420 BuryPointer(SourceMgr.get());
421 SourceMgr.resetWithoutRelease();
424 /// setSourceManager - Replace the current source manager.
425 void setSourceManager(SourceManager *Value);
428 /// @name Preprocessor
431 bool hasPreprocessor() const { return PP != nullptr; }
433 /// Return the current preprocessor.
434 Preprocessor &getPreprocessor() const {
435 assert(PP && "Compiler instance has no preprocessor!");
439 std::shared_ptr<Preprocessor> getPreprocessorPtr() { return PP; }
441 void resetAndLeakPreprocessor() {
442 BuryPointer(new std::shared_ptr<Preprocessor>(PP));
445 /// Replace the current preprocessor.
446 void setPreprocessor(std::shared_ptr<Preprocessor> Value);
452 bool hasASTContext() const { return Context != nullptr; }
454 ASTContext &getASTContext() const {
455 assert(Context && "Compiler instance has no AST context!");
459 void resetAndLeakASTContext() {
460 BuryPointer(Context.get());
461 Context.resetWithoutRelease();
464 /// setASTContext - Replace the current AST context.
465 void setASTContext(ASTContext *Value);
467 /// \brief Replace the current Sema; the compiler instance takes ownership
469 void setSema(Sema *S);
472 /// @name ASTConsumer
475 bool hasASTConsumer() const { return (bool)Consumer; }
477 ASTConsumer &getASTConsumer() const {
478 assert(Consumer && "Compiler instance has no AST consumer!");
482 /// takeASTConsumer - Remove the current AST consumer and give ownership to
484 std::unique_ptr<ASTConsumer> takeASTConsumer() { return std::move(Consumer); }
486 /// setASTConsumer - Replace the current AST consumer; the compiler instance
487 /// takes ownership of \p Value.
488 void setASTConsumer(std::unique_ptr<ASTConsumer> Value);
491 /// @name Semantic analysis
493 bool hasSema() const { return (bool)TheSema; }
495 Sema &getSema() const {
496 assert(TheSema && "Compiler instance has no Sema object!");
500 std::unique_ptr<Sema> takeSema();
501 void resetAndLeakSema();
504 /// @name Module Management
507 IntrusiveRefCntPtr<ASTReader> getModuleManager() const;
508 void setModuleManager(IntrusiveRefCntPtr<ASTReader> Reader);
510 std::shared_ptr<ModuleDependencyCollector> getModuleDepCollector() const;
511 void setModuleDepCollector(
512 std::shared_ptr<ModuleDependencyCollector> Collector);
514 std::shared_ptr<PCHContainerOperations> getPCHContainerOperations() const {
515 return ThePCHContainerOperations;
518 /// Return the appropriate PCHContainerWriter depending on the
519 /// current CodeGenOptions.
520 const PCHContainerWriter &getPCHContainerWriter() const {
521 assert(Invocation && "cannot determine module format without invocation");
522 StringRef Format = getHeaderSearchOpts().ModuleFormat;
523 auto *Writer = ThePCHContainerOperations->getWriterOrNull(Format);
526 Diagnostics->Report(diag::err_module_format_unhandled) << Format;
527 llvm::report_fatal_error("unknown module format");
532 /// Return the appropriate PCHContainerReader depending on the
533 /// current CodeGenOptions.
534 const PCHContainerReader &getPCHContainerReader() const {
535 assert(Invocation && "cannot determine module format without invocation");
536 StringRef Format = getHeaderSearchOpts().ModuleFormat;
537 auto *Reader = ThePCHContainerOperations->getReaderOrNull(Format);
540 Diagnostics->Report(diag::err_module_format_unhandled) << Format;
541 llvm::report_fatal_error("unknown module format");
547 /// @name Code Completion
550 bool hasCodeCompletionConsumer() const { return (bool)CompletionConsumer; }
552 CodeCompleteConsumer &getCodeCompletionConsumer() const {
553 assert(CompletionConsumer &&
554 "Compiler instance has no code completion consumer!");
555 return *CompletionConsumer;
558 /// setCodeCompletionConsumer - Replace the current code completion consumer;
559 /// the compiler instance takes ownership of \p Value.
560 void setCodeCompletionConsumer(CodeCompleteConsumer *Value);
563 /// @name Frontend timer
566 bool hasFrontendTimer() const { return (bool)FrontendTimer; }
568 llvm::Timer &getFrontendTimer() const {
569 assert(FrontendTimer && "Compiler instance has no frontend timer!");
570 return *FrontendTimer;
574 /// @name Output Files
577 /// addOutputFile - Add an output file onto the list of tracked output files.
579 /// \param OutFile - The output file info.
580 void addOutputFile(OutputFile &&OutFile);
582 /// clearOutputFiles - Clear the output file list. The underlying output
583 /// streams must have been closed beforehand.
585 /// \param EraseFiles - If true, attempt to erase the files from disk.
586 void clearOutputFiles(bool EraseFiles);
589 /// @name Construction Utility Methods
592 /// Create the diagnostics engine using the invocation's diagnostic options
593 /// and replace any existing one with it.
595 /// Note that this routine also replaces the diagnostic client,
596 /// allocating one if one is not provided.
598 /// \param Client If non-NULL, a diagnostic client that will be
599 /// attached to (and, then, owned by) the DiagnosticsEngine inside this AST
602 /// \param ShouldOwnClient If Client is non-NULL, specifies whether
603 /// the diagnostic object should take ownership of the client.
604 void createDiagnostics(DiagnosticConsumer *Client = nullptr,
605 bool ShouldOwnClient = true);
607 /// Create a DiagnosticsEngine object with a the TextDiagnosticPrinter.
609 /// If no diagnostic client is provided, this creates a
610 /// DiagnosticConsumer that is owned by the returned diagnostic
611 /// object, if using directly the caller is responsible for
612 /// releasing the returned DiagnosticsEngine's client eventually.
614 /// \param Opts - The diagnostic options; note that the created text
615 /// diagnostic object contains a reference to these options.
617 /// \param Client If non-NULL, a diagnostic client that will be
618 /// attached to (and, then, owned by) the returned DiagnosticsEngine
621 /// \param CodeGenOpts If non-NULL, the code gen options in use, which may be
622 /// used by some diagnostics printers (for logging purposes only).
624 /// \return The new object on success, or null on failure.
625 static IntrusiveRefCntPtr<DiagnosticsEngine>
626 createDiagnostics(DiagnosticOptions *Opts,
627 DiagnosticConsumer *Client = nullptr,
628 bool ShouldOwnClient = true,
629 const CodeGenOptions *CodeGenOpts = nullptr);
631 /// Create the file manager and replace any existing one with it.
632 void createFileManager();
634 /// Create the source manager and replace any existing one with it.
635 void createSourceManager(FileManager &FileMgr);
637 /// Create the preprocessor, using the invocation, file, and source managers,
638 /// and replace any existing one with it.
639 void createPreprocessor(TranslationUnitKind TUKind);
641 std::string getSpecificModuleCachePath();
643 /// Create the AST context.
644 void createASTContext();
646 /// Create an external AST source to read a PCH file and attach it to the AST
648 void createPCHExternalASTSource(StringRef Path, bool DisablePCHValidation,
649 bool AllowPCHWithCompilerErrors,
650 void *DeserializationListener,
651 bool OwnDeserializationListener);
653 /// Create an external AST source to read a PCH file.
655 /// \return - The new object on success, or null on failure.
656 static IntrusiveRefCntPtr<ASTReader> createPCHExternalASTSource(
657 StringRef Path, StringRef Sysroot, bool DisablePCHValidation,
658 bool AllowPCHWithCompilerErrors, Preprocessor &PP, ASTContext &Context,
659 const PCHContainerReader &PCHContainerRdr,
660 ArrayRef<std::shared_ptr<ModuleFileExtension>> Extensions,
661 void *DeserializationListener, bool OwnDeserializationListener,
662 bool Preamble, bool UseGlobalModuleIndex);
664 /// Create a code completion consumer using the invocation; note that this
665 /// will cause the source manager to truncate the input source file at the
666 /// completion point.
667 void createCodeCompletionConsumer();
669 /// Create a code completion consumer to print code completion results, at
670 /// \p Filename, \p Line, and \p Column, to the given output stream \p OS.
671 static CodeCompleteConsumer *createCodeCompletionConsumer(
672 Preprocessor &PP, StringRef Filename, unsigned Line, unsigned Column,
673 const CodeCompleteOptions &Opts, raw_ostream &OS);
675 /// \brief Create the Sema object to be used for parsing.
676 void createSema(TranslationUnitKind TUKind,
677 CodeCompleteConsumer *CompletionConsumer);
679 /// Create the frontend timer and replace any existing one with it.
680 void createFrontendTimer();
682 /// Create the default output file (from the invocation's options) and add it
683 /// to the list of tracked output files.
685 /// The files created by this function always use temporary files to write to
686 /// their result (that is, the data is written to a temporary file which will
687 /// atomically replace the target output on success).
689 /// \return - Null on error.
690 std::unique_ptr<raw_pwrite_stream>
691 createDefaultOutputFile(bool Binary = true, StringRef BaseInput = "",
692 StringRef Extension = "");
694 /// Create a new output file and add it to the list of tracked output files,
695 /// optionally deriving the output path name.
697 /// \return - Null on error.
698 std::unique_ptr<raw_pwrite_stream>
699 createOutputFile(StringRef OutputPath, bool Binary, bool RemoveFileOnSignal,
700 StringRef BaseInput, StringRef Extension, bool UseTemporary,
701 bool CreateMissingDirectories = false);
703 /// Create a new output file, optionally deriving the output path name.
705 /// If \p OutputPath is empty, then createOutputFile will derive an output
706 /// path location as \p BaseInput, with any suffix removed, and \p Extension
707 /// appended. If \p OutputPath is not stdout and \p UseTemporary
708 /// is true, createOutputFile will create a new temporary file that must be
709 /// renamed to \p OutputPath in the end.
711 /// \param OutputPath - If given, the path to the output file.
712 /// \param Error [out] - On failure, the error.
713 /// \param BaseInput - If \p OutputPath is empty, the input path name to use
714 /// for deriving the output path.
715 /// \param Extension - The extension to use for derived output names.
716 /// \param Binary - The mode to open the file in.
717 /// \param RemoveFileOnSignal - Whether the file should be registered with
718 /// llvm::sys::RemoveFileOnSignal. Note that this is not safe for
719 /// multithreaded use, as the underlying signal mechanism is not reentrant
720 /// \param UseTemporary - Create a new temporary file that must be renamed to
721 /// OutputPath in the end.
722 /// \param CreateMissingDirectories - When \p UseTemporary is true, create
723 /// missing directories in the output path.
724 /// \param ResultPathName [out] - If given, the result path name will be
725 /// stored here on success.
726 /// \param TempPathName [out] - If given, the temporary file path name
727 /// will be stored here on success.
728 std::unique_ptr<raw_pwrite_stream>
729 createOutputFile(StringRef OutputPath, std::error_code &Error, bool Binary,
730 bool RemoveFileOnSignal, StringRef BaseInput,
731 StringRef Extension, bool UseTemporary,
732 bool CreateMissingDirectories, std::string *ResultPathName,
733 std::string *TempPathName);
735 std::unique_ptr<raw_pwrite_stream> createNullOutputFile();
738 /// @name Initialization Utility Methods
741 /// InitializeSourceManager - Initialize the source manager to set InputFile
742 /// as the main file.
744 /// \return True on success.
745 bool InitializeSourceManager(const FrontendInputFile &Input);
747 /// InitializeSourceManager - Initialize the source manager to set InputFile
748 /// as the main file.
750 /// \return True on success.
751 static bool InitializeSourceManager(const FrontendInputFile &Input,
752 DiagnosticsEngine &Diags,
753 FileManager &FileMgr,
754 SourceManager &SourceMgr,
756 DependencyOutputOptions &DepOpts,
757 const FrontendOptions &Opts);
761 // Create module manager.
762 void createModuleManager();
764 bool loadModuleFile(StringRef FileName);
766 ModuleLoadResult loadModule(SourceLocation ImportLoc, ModuleIdPath Path,
767 Module::NameVisibilityKind Visibility,
768 bool IsInclusionDirective) override;
770 void makeModuleVisible(Module *Mod, Module::NameVisibilityKind Visibility,
771 SourceLocation ImportLoc) override;
773 bool hadModuleLoaderFatalFailure() const {
774 return ModuleLoader::HadFatalFailure;
777 GlobalModuleIndex *loadGlobalModuleIndex(SourceLocation TriggerLoc) override;
779 bool lookupMissingImports(StringRef Name, SourceLocation TriggerLoc) override;
781 void addDependencyCollector(std::shared_ptr<DependencyCollector> Listener) {
782 DependencyCollectors.push_back(std::move(Listener));
785 void setExternalSemaSource(IntrusiveRefCntPtr<ExternalSemaSource> ESS);
788 } // end namespace clang