CompilerInstance.h revision a9204831639e31474b927681b97c46781b758a1a
12a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar//===-- CompilerInstance.h - Clang Compiler Instance ------------*- C++ -*-===//
22a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar//
32a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar//                     The LLVM Compiler Infrastructure
42a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar//
52a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar// This file is distributed under the University of Illinois Open Source
62a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar// License. See LICENSE.TXT for details.
72a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar//
82a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar//===----------------------------------------------------------------------===//
92a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar
102a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar#ifndef LLVM_CLANG_FRONTEND_COMPILERINSTANCE_H_
112a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar#define LLVM_CLANG_FRONTEND_COMPILERINSTANCE_H_
122a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar
132a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar#include "clang/Frontend/CompilerInvocation.h"
140f800391ffbfe3820e1c60246a09a97e5f065179Daniel Dunbar#include "llvm/ADT/StringRef.h"
152a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar#include "llvm/ADT/OwningPtr.h"
1622dacfacacf5559028550ba6ddfbaa4ea6cb3944Daniel Dunbar#include <cassert>
17a9204831639e31474b927681b97c46781b758a1aDaniel Dunbar#include <list>
18a9204831639e31474b927681b97c46781b758a1aDaniel Dunbar#include <string>
192a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar
202a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbarnamespace llvm {
212a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbarclass LLVMContext;
22c2f484f1f05216a9a427ac84b5773789a4661111Daniel Dunbarclass raw_ostream;
232a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar}
242a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar
252a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbarnamespace clang {
265eb810024dc8a1d12d5f066c02c978f07c4fcb00Daniel Dunbarclass ASTContext;
27c2f484f1f05216a9a427ac84b5773789a4661111Daniel Dunbarclass CodeCompleteConsumer;
282a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbarclass Diagnostic;
292a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbarclass DiagnosticClient;
300f800391ffbfe3820e1c60246a09a97e5f065179Daniel Dunbarclass ExternalASTSource;
3116b7449d86b843d0926b04f87104cf3fff7149feDaniel Dunbarclass FileManager;
320f800391ffbfe3820e1c60246a09a97e5f065179Daniel Dunbarclass Preprocessor;
330f800391ffbfe3820e1c60246a09a97e5f065179Daniel Dunbarclass Source;
3416b7449d86b843d0926b04f87104cf3fff7149feDaniel Dunbarclass SourceManager;
352a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbarclass TargetInfo;
362a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar
372a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar/// CompilerInstance - Helper class for managing a single instance of the Clang
382a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar/// compiler.
392a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar///
402a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar/// The CompilerInstance serves two purposes:
412a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar///  (1) It manages the various objects which are necessary to run the compiler,
422a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar///      for example the preprocessor, the target information, and the AST
432a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar///      context.
442a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar///  (2) It provides utility routines for constructing and manipulating the
452a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar///      common Clang objects.
462a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar///
472a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar/// The compiler instance generally owns the instance of all the objects that it
482a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar/// manages. However, clients can still share objects by manually setting the
492a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar/// object and retaking ownership prior to destroying the CompilerInstance.
502a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar///
512a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar/// The compiler instance is intended to simplify clients, but not to lock them
522a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar/// in to the compiler instance for everything. When possible, utility functions
532a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar/// come in two forms; a short form that reuses the CompilerInstance objects,
542a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar/// and a long form that takes explicit instances of any required objects.
552a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbarclass CompilerInstance {
562a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  /// The LLVM context used for this instance.
572a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  llvm::LLVMContext *LLVMContext;
582a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  bool OwnsLLVMContext;
592a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar
602a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  /// The options used in this compiler instance.
612a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  CompilerInvocation Invocation;
622a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar
632a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  /// The diagnostics engine instance.
642a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  llvm::OwningPtr<Diagnostic> Diagnostics;
652a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar
662a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  /// The diagnostics client instance.
672a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  llvm::OwningPtr<DiagnosticClient> DiagClient;
682a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar
692a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  /// The target being compiled for.
702a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  llvm::OwningPtr<TargetInfo> Target;
712a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar
7216b7449d86b843d0926b04f87104cf3fff7149feDaniel Dunbar  /// The file manager.
7316b7449d86b843d0926b04f87104cf3fff7149feDaniel Dunbar  llvm::OwningPtr<FileManager> FileMgr;
7416b7449d86b843d0926b04f87104cf3fff7149feDaniel Dunbar
7516b7449d86b843d0926b04f87104cf3fff7149feDaniel Dunbar  /// The source manager.
7616b7449d86b843d0926b04f87104cf3fff7149feDaniel Dunbar  llvm::OwningPtr<SourceManager> SourceMgr;
7716b7449d86b843d0926b04f87104cf3fff7149feDaniel Dunbar
7822dacfacacf5559028550ba6ddfbaa4ea6cb3944Daniel Dunbar  /// The preprocessor.
7922dacfacacf5559028550ba6ddfbaa4ea6cb3944Daniel Dunbar  llvm::OwningPtr<Preprocessor> PP;
8022dacfacacf5559028550ba6ddfbaa4ea6cb3944Daniel Dunbar
815eb810024dc8a1d12d5f066c02c978f07c4fcb00Daniel Dunbar  /// The AST context.
825eb810024dc8a1d12d5f066c02c978f07c4fcb00Daniel Dunbar  llvm::OwningPtr<ASTContext> Context;
835eb810024dc8a1d12d5f066c02c978f07c4fcb00Daniel Dunbar
84c2f484f1f05216a9a427ac84b5773789a4661111Daniel Dunbar  /// The code completion consumer.
85c2f484f1f05216a9a427ac84b5773789a4661111Daniel Dunbar  llvm::OwningPtr<CodeCompleteConsumer> CompletionConsumer;
86c2f484f1f05216a9a427ac84b5773789a4661111Daniel Dunbar
87a9204831639e31474b927681b97c46781b758a1aDaniel Dunbar  /// The list of active output files.
88a9204831639e31474b927681b97c46781b758a1aDaniel Dunbar  std::list< std::pair<std::string, llvm::raw_ostream*> > OutputFiles;
89a9204831639e31474b927681b97c46781b758a1aDaniel Dunbar
902a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbarpublic:
912a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  /// Create a new compiler instance with the given LLVM context, optionally
922a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  /// taking ownership of it.
932a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  CompilerInstance(llvm::LLVMContext *_LLVMContext = 0,
942a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar                   bool _OwnsLLVMContext = true);
952a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  ~CompilerInstance();
962a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar
972a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  /// @name LLVM Context
982a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  /// {
992a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar
100704e48ae75111072eecaa20a365dff46fb49d2beDaniel Dunbar  bool hasLLVMContext() const { return LLVMContext != 0; }
101704e48ae75111072eecaa20a365dff46fb49d2beDaniel Dunbar
102704e48ae75111072eecaa20a365dff46fb49d2beDaniel Dunbar  llvm::LLVMContext &getLLVMContext() const {
10322dacfacacf5559028550ba6ddfbaa4ea6cb3944Daniel Dunbar    assert(LLVMContext && "Compiler instance has no LLVM context!");
10422dacfacacf5559028550ba6ddfbaa4ea6cb3944Daniel Dunbar    return *LLVMContext;
10522dacfacacf5559028550ba6ddfbaa4ea6cb3944Daniel Dunbar  }
1062a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar
1072a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  /// setLLVMContext - Replace the current LLVM context and take ownership of
1082a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  /// \arg Value.
1092a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  void setLLVMContext(llvm::LLVMContext *Value, bool TakeOwnership = true) {
1102a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar    LLVMContext = Value;
1112a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar    OwnsLLVMContext = TakeOwnership;
1122a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  }
1132a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar
1142a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  /// }
1152a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  /// @name Compiler Invocation and Options
1162a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  /// {
1172a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar
1182a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  CompilerInvocation &getInvocation() { return Invocation; }
1192a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  const CompilerInvocation &getInvocation() const { return Invocation; }
1202a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  void setInvocation(const CompilerInvocation &Value) { Invocation = Value; }
1212a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar
1222a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  /// }
1232a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  /// @name Forwarding Methods
1242a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  /// {
1252a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar
1262a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  AnalyzerOptions &getAnalyzerOpts() {
1272a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar    return Invocation.getAnalyzerOpts();
1282a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  }
1292a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  const AnalyzerOptions &getAnalyzerOpts() const {
1302a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar    return Invocation.getAnalyzerOpts();
1312a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  }
1322a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar
1332a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  CodeGenOptions &getCodeGenOpts() {
1342a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar    return Invocation.getCodeGenOpts();
1352a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  }
1362a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  const CodeGenOptions &getCodeGenOpts() const {
1372a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar    return Invocation.getCodeGenOpts();
1382a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  }
1392a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar
1402a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  DependencyOutputOptions &getDependencyOutputOpts() {
1412a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar    return Invocation.getDependencyOutputOpts();
1422a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  }
1432a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  const DependencyOutputOptions &getDependencyOutputOpts() const {
1442a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar    return Invocation.getDependencyOutputOpts();
1452a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  }
1462a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar
1472a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  DiagnosticOptions &getDiagnosticOpts() {
1482a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar    return Invocation.getDiagnosticOpts();
1492a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  }
1502a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  const DiagnosticOptions &getDiagnosticOpts() const {
1512a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar    return Invocation.getDiagnosticOpts();
1522a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  }
1532a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar
1542a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  FrontendOptions &getFrontendOpts() {
1552a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar    return Invocation.getFrontendOpts();
1562a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  }
1572a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  const FrontendOptions &getFrontendOpts() const {
1582a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar    return Invocation.getFrontendOpts();
1592a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  }
1602a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar
1612a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  HeaderSearchOptions &getHeaderSearchOpts() {
1622a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar    return Invocation.getHeaderSearchOpts();
1632a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  }
1642a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  const HeaderSearchOptions &getHeaderSearchOpts() const {
1652a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar    return Invocation.getHeaderSearchOpts();
1662a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  }
1672a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar
1682a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  LangOptions &getLangOpts() {
1692a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar    return Invocation.getLangOpts();
1702a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  }
1712a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  const LangOptions &getLangOpts() const {
1722a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar    return Invocation.getLangOpts();
1732a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  }
1742a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar
1752a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  PreprocessorOptions &getPreprocessorOpts() {
1762a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar    return Invocation.getPreprocessorOpts();
1772a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  }
1782a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  const PreprocessorOptions &getPreprocessorOpts() const {
1792a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar    return Invocation.getPreprocessorOpts();
1802a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  }
1812a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar
1822a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  PreprocessorOutputOptions &getPreprocessorOutputOpts() {
1832a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar    return Invocation.getPreprocessorOutputOpts();
1842a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  }
1852a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  const PreprocessorOutputOptions &getPreprocessorOutputOpts() const {
1862a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar    return Invocation.getPreprocessorOutputOpts();
1872a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  }
1882a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar
1892a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  /// }
1902a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  /// @name Diagnostics Engine
1912a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  /// {
1922a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar
193704e48ae75111072eecaa20a365dff46fb49d2beDaniel Dunbar  bool hasDiagnostics() const { return Diagnostics != 0; }
194704e48ae75111072eecaa20a365dff46fb49d2beDaniel Dunbar
19522dacfacacf5559028550ba6ddfbaa4ea6cb3944Daniel Dunbar  Diagnostic &getDiagnostics() const {
19622dacfacacf5559028550ba6ddfbaa4ea6cb3944Daniel Dunbar    assert(Diagnostics && "Compiler instance has no diagnostics!");
19722dacfacacf5559028550ba6ddfbaa4ea6cb3944Daniel Dunbar    return *Diagnostics;
19822dacfacacf5559028550ba6ddfbaa4ea6cb3944Daniel Dunbar  }
1992a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar
2002a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  /// takeDiagnostics - Remove the current diagnostics engine and give ownership
2012a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  /// to the caller.
2022a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  Diagnostic *takeDiagnostics() { return Diagnostics.take(); }
2032a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar
2042a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  /// setDiagnostics - Replace the current diagnostics engine; the compiler
2052a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  /// instance takes ownership of \arg Value.
2062a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  void setDiagnostics(Diagnostic *Value) { Diagnostics.reset(Value); }
2072a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar
2082a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  DiagnosticClient &getDiagnosticClient() const { return *DiagClient; }
2092a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar
2102a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  /// takeDiagnosticClient - Remove the current diagnostics client and give
2112a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  /// ownership to the caller.
2122a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  DiagnosticClient *takeDiagnosticClient() { return DiagClient.take(); }
2132a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar
2142a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  /// setDiagnosticClient - Replace the current diagnostics client; the compiler
2152a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  /// instance takes ownership of \arg Value.
2162a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  void setDiagnosticClient(DiagnosticClient *Value) {
2172a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar    DiagClient.reset(Value);
2182a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  }
2192a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar
2202a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  /// }
2212a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  /// @name Target Info
2222a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  /// {
2232a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar
224704e48ae75111072eecaa20a365dff46fb49d2beDaniel Dunbar  bool hasTarget() const { return Target != 0; }
225704e48ae75111072eecaa20a365dff46fb49d2beDaniel Dunbar
22622dacfacacf5559028550ba6ddfbaa4ea6cb3944Daniel Dunbar  TargetInfo &getTarget() const {
22722dacfacacf5559028550ba6ddfbaa4ea6cb3944Daniel Dunbar    assert(Target && "Compiler instance has no target!");
22822dacfacacf5559028550ba6ddfbaa4ea6cb3944Daniel Dunbar    return *Target;
22922dacfacacf5559028550ba6ddfbaa4ea6cb3944Daniel Dunbar  }
2302a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar
2312a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  /// takeTarget - Remove the current diagnostics engine and give ownership
2322a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  /// to the caller.
2332a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  TargetInfo *takeTarget() { return Target.take(); }
2342a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar
2352a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  /// setTarget - Replace the current diagnostics engine; the compiler
2362a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  /// instance takes ownership of \arg Value.
2372a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  void setTarget(TargetInfo *Value) { Target.reset(Value); }
2382a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar
2392a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar  /// }
24016b7449d86b843d0926b04f87104cf3fff7149feDaniel Dunbar  /// @name File Manager
24116b7449d86b843d0926b04f87104cf3fff7149feDaniel Dunbar  /// {
24216b7449d86b843d0926b04f87104cf3fff7149feDaniel Dunbar
243704e48ae75111072eecaa20a365dff46fb49d2beDaniel Dunbar  bool hasFileManager() const { return FileMgr != 0; }
244704e48ae75111072eecaa20a365dff46fb49d2beDaniel Dunbar
24522dacfacacf5559028550ba6ddfbaa4ea6cb3944Daniel Dunbar  FileManager &getFileManager() const {
24622dacfacacf5559028550ba6ddfbaa4ea6cb3944Daniel Dunbar    assert(FileMgr && "Compiler instance has no file manager!");
24722dacfacacf5559028550ba6ddfbaa4ea6cb3944Daniel Dunbar    return *FileMgr;
24822dacfacacf5559028550ba6ddfbaa4ea6cb3944Daniel Dunbar  }
24916b7449d86b843d0926b04f87104cf3fff7149feDaniel Dunbar
25016b7449d86b843d0926b04f87104cf3fff7149feDaniel Dunbar  /// takeFileManager - Remove the current file manager and give ownership to
25116b7449d86b843d0926b04f87104cf3fff7149feDaniel Dunbar  /// the caller.
25216b7449d86b843d0926b04f87104cf3fff7149feDaniel Dunbar  FileManager *takeFileManager() { return FileMgr.take(); }
25316b7449d86b843d0926b04f87104cf3fff7149feDaniel Dunbar
25416b7449d86b843d0926b04f87104cf3fff7149feDaniel Dunbar  /// setFileManager - Replace the current file manager; the compiler instance
25516b7449d86b843d0926b04f87104cf3fff7149feDaniel Dunbar  /// takes ownership of \arg Value.
25616b7449d86b843d0926b04f87104cf3fff7149feDaniel Dunbar  void setFileManager(FileManager *Value) { FileMgr.reset(Value); }
25716b7449d86b843d0926b04f87104cf3fff7149feDaniel Dunbar
25816b7449d86b843d0926b04f87104cf3fff7149feDaniel Dunbar  /// }
25916b7449d86b843d0926b04f87104cf3fff7149feDaniel Dunbar  /// @name Source Manager
26016b7449d86b843d0926b04f87104cf3fff7149feDaniel Dunbar  /// {
26116b7449d86b843d0926b04f87104cf3fff7149feDaniel Dunbar
262704e48ae75111072eecaa20a365dff46fb49d2beDaniel Dunbar  bool hasSourceManager() const { return SourceMgr != 0; }
263704e48ae75111072eecaa20a365dff46fb49d2beDaniel Dunbar
26422dacfacacf5559028550ba6ddfbaa4ea6cb3944Daniel Dunbar  SourceManager &getSourceManager() const {
26522dacfacacf5559028550ba6ddfbaa4ea6cb3944Daniel Dunbar    assert(SourceMgr && "Compiler instance has no source manager!");
26622dacfacacf5559028550ba6ddfbaa4ea6cb3944Daniel Dunbar    return *SourceMgr;
26722dacfacacf5559028550ba6ddfbaa4ea6cb3944Daniel Dunbar  }
26816b7449d86b843d0926b04f87104cf3fff7149feDaniel Dunbar
26916b7449d86b843d0926b04f87104cf3fff7149feDaniel Dunbar  /// takeSourceManager - Remove the current source manager and give ownership
27016b7449d86b843d0926b04f87104cf3fff7149feDaniel Dunbar  /// to the caller.
27116b7449d86b843d0926b04f87104cf3fff7149feDaniel Dunbar  SourceManager *takeSourceManager() { return SourceMgr.take(); }
27216b7449d86b843d0926b04f87104cf3fff7149feDaniel Dunbar
27316b7449d86b843d0926b04f87104cf3fff7149feDaniel Dunbar  /// setSourceManager - Replace the current source manager; the compiler
27416b7449d86b843d0926b04f87104cf3fff7149feDaniel Dunbar  /// instance takes ownership of \arg Value.
27516b7449d86b843d0926b04f87104cf3fff7149feDaniel Dunbar  void setSourceManager(SourceManager *Value) { SourceMgr.reset(Value); }
27616b7449d86b843d0926b04f87104cf3fff7149feDaniel Dunbar
27716b7449d86b843d0926b04f87104cf3fff7149feDaniel Dunbar  /// }
27822dacfacacf5559028550ba6ddfbaa4ea6cb3944Daniel Dunbar  /// @name Preprocessor
27922dacfacacf5559028550ba6ddfbaa4ea6cb3944Daniel Dunbar  /// {
28022dacfacacf5559028550ba6ddfbaa4ea6cb3944Daniel Dunbar
281704e48ae75111072eecaa20a365dff46fb49d2beDaniel Dunbar  bool hasPreprocessor() const { return PP != 0; }
282704e48ae75111072eecaa20a365dff46fb49d2beDaniel Dunbar
28322dacfacacf5559028550ba6ddfbaa4ea6cb3944Daniel Dunbar  Preprocessor &getPreprocessor() const {
28422dacfacacf5559028550ba6ddfbaa4ea6cb3944Daniel Dunbar    assert(PP && "Compiler instance has no preprocessor!");
28522dacfacacf5559028550ba6ddfbaa4ea6cb3944Daniel Dunbar    return *PP;
28622dacfacacf5559028550ba6ddfbaa4ea6cb3944Daniel Dunbar  }
28722dacfacacf5559028550ba6ddfbaa4ea6cb3944Daniel Dunbar
28822dacfacacf5559028550ba6ddfbaa4ea6cb3944Daniel Dunbar  /// takePreprocessor - Remove the current preprocessor and give ownership to
28922dacfacacf5559028550ba6ddfbaa4ea6cb3944Daniel Dunbar  /// the caller.
29022dacfacacf5559028550ba6ddfbaa4ea6cb3944Daniel Dunbar  Preprocessor *takePreprocessor() { return PP.take(); }
29122dacfacacf5559028550ba6ddfbaa4ea6cb3944Daniel Dunbar
29222dacfacacf5559028550ba6ddfbaa4ea6cb3944Daniel Dunbar  /// setPreprocessor - Replace the current preprocessor; the compiler instance
29322dacfacacf5559028550ba6ddfbaa4ea6cb3944Daniel Dunbar  /// takes ownership of \arg Value.
29422dacfacacf5559028550ba6ddfbaa4ea6cb3944Daniel Dunbar  void setPreprocessor(Preprocessor *Value) { PP.reset(Value); }
29522dacfacacf5559028550ba6ddfbaa4ea6cb3944Daniel Dunbar
29622dacfacacf5559028550ba6ddfbaa4ea6cb3944Daniel Dunbar  /// }
2975eb810024dc8a1d12d5f066c02c978f07c4fcb00Daniel Dunbar  /// @name ASTContext
2985eb810024dc8a1d12d5f066c02c978f07c4fcb00Daniel Dunbar  /// {
2995eb810024dc8a1d12d5f066c02c978f07c4fcb00Daniel Dunbar
300704e48ae75111072eecaa20a365dff46fb49d2beDaniel Dunbar  bool hasASTContext() const { return Context != 0; }
301704e48ae75111072eecaa20a365dff46fb49d2beDaniel Dunbar
3025eb810024dc8a1d12d5f066c02c978f07c4fcb00Daniel Dunbar  ASTContext &getASTContext() const {
3035eb810024dc8a1d12d5f066c02c978f07c4fcb00Daniel Dunbar    assert(Context && "Compiler instance has no AST context!");
3045eb810024dc8a1d12d5f066c02c978f07c4fcb00Daniel Dunbar    return *Context;
3055eb810024dc8a1d12d5f066c02c978f07c4fcb00Daniel Dunbar  }
3065eb810024dc8a1d12d5f066c02c978f07c4fcb00Daniel Dunbar
3075eb810024dc8a1d12d5f066c02c978f07c4fcb00Daniel Dunbar  /// takeASTContext - Remove the current AST context and give ownership to the
3085eb810024dc8a1d12d5f066c02c978f07c4fcb00Daniel Dunbar  /// caller.
3095eb810024dc8a1d12d5f066c02c978f07c4fcb00Daniel Dunbar  ASTContext *takeASTContext() { return Context.take(); }
3105eb810024dc8a1d12d5f066c02c978f07c4fcb00Daniel Dunbar
3115eb810024dc8a1d12d5f066c02c978f07c4fcb00Daniel Dunbar  /// setASTContext - Replace the current AST context; the compiler instance
3125eb810024dc8a1d12d5f066c02c978f07c4fcb00Daniel Dunbar  /// takes ownership of \arg Value.
3135eb810024dc8a1d12d5f066c02c978f07c4fcb00Daniel Dunbar  void setASTContext(ASTContext *Value) { Context.reset(Value); }
3145eb810024dc8a1d12d5f066c02c978f07c4fcb00Daniel Dunbar
3155eb810024dc8a1d12d5f066c02c978f07c4fcb00Daniel Dunbar  /// }
316c2f484f1f05216a9a427ac84b5773789a4661111Daniel Dunbar  /// @name Code Completion
317c2f484f1f05216a9a427ac84b5773789a4661111Daniel Dunbar  /// {
318c2f484f1f05216a9a427ac84b5773789a4661111Daniel Dunbar
319c2f484f1f05216a9a427ac84b5773789a4661111Daniel Dunbar  bool hasCodeCompletionConsumer() const { return CompletionConsumer != 0; }
320c2f484f1f05216a9a427ac84b5773789a4661111Daniel Dunbar
321c2f484f1f05216a9a427ac84b5773789a4661111Daniel Dunbar  CodeCompleteConsumer &getCodeCompletionConsumer() const {
322c2f484f1f05216a9a427ac84b5773789a4661111Daniel Dunbar    assert(CompletionConsumer &&
323c2f484f1f05216a9a427ac84b5773789a4661111Daniel Dunbar           "Compiler instance has no code completion consumer!");
324c2f484f1f05216a9a427ac84b5773789a4661111Daniel Dunbar    return *CompletionConsumer;
325c2f484f1f05216a9a427ac84b5773789a4661111Daniel Dunbar  }
326c2f484f1f05216a9a427ac84b5773789a4661111Daniel Dunbar
327c2f484f1f05216a9a427ac84b5773789a4661111Daniel Dunbar  /// takeCodeCompletionConsumer - Remove the current code completion consumer
328c2f484f1f05216a9a427ac84b5773789a4661111Daniel Dunbar  /// and give ownership to the caller.
329c2f484f1f05216a9a427ac84b5773789a4661111Daniel Dunbar  CodeCompleteConsumer *takeCodeCompletionConsumer() {
330c2f484f1f05216a9a427ac84b5773789a4661111Daniel Dunbar    return CompletionConsumer.take();
331c2f484f1f05216a9a427ac84b5773789a4661111Daniel Dunbar  }
332c2f484f1f05216a9a427ac84b5773789a4661111Daniel Dunbar
333c2f484f1f05216a9a427ac84b5773789a4661111Daniel Dunbar  /// setCodeCompletionConsumer - Replace the current code completion consumer;
334c2f484f1f05216a9a427ac84b5773789a4661111Daniel Dunbar  /// the compiler instance takes ownership of \arg Value.
335c2f484f1f05216a9a427ac84b5773789a4661111Daniel Dunbar  void setCodeCompletionConsumer(CodeCompleteConsumer *Value) {
336c2f484f1f05216a9a427ac84b5773789a4661111Daniel Dunbar    CompletionConsumer.reset(Value);
337c2f484f1f05216a9a427ac84b5773789a4661111Daniel Dunbar  }
338c2f484f1f05216a9a427ac84b5773789a4661111Daniel Dunbar
339c2f484f1f05216a9a427ac84b5773789a4661111Daniel Dunbar  /// }
340a9204831639e31474b927681b97c46781b758a1aDaniel Dunbar  /// @name Output Files
341a9204831639e31474b927681b97c46781b758a1aDaniel Dunbar  /// {
342a9204831639e31474b927681b97c46781b758a1aDaniel Dunbar
343a9204831639e31474b927681b97c46781b758a1aDaniel Dunbar  /// getOutputFileList - Get the list of (path, output stream) pairs of output
344a9204831639e31474b927681b97c46781b758a1aDaniel Dunbar  /// files; the path may be empty but the stream will always be non-null.
345a9204831639e31474b927681b97c46781b758a1aDaniel Dunbar  const std::list< std::pair<std::string,
346a9204831639e31474b927681b97c46781b758a1aDaniel Dunbar                             llvm::raw_ostream*> > &getOutputFileList() const;
347a9204831639e31474b927681b97c46781b758a1aDaniel Dunbar
348a9204831639e31474b927681b97c46781b758a1aDaniel Dunbar  /// addOutputFile - Add an output file onto the list of tracked output files.
349a9204831639e31474b927681b97c46781b758a1aDaniel Dunbar  ///
350a9204831639e31474b927681b97c46781b758a1aDaniel Dunbar  /// \param Path - The path to the output file, or empty.
351a9204831639e31474b927681b97c46781b758a1aDaniel Dunbar  /// \param OS - The output stream, which should be non-null.
352a9204831639e31474b927681b97c46781b758a1aDaniel Dunbar  void addOutputFile(llvm::StringRef Path, llvm::raw_ostream *OS);
353a9204831639e31474b927681b97c46781b758a1aDaniel Dunbar
354a9204831639e31474b927681b97c46781b758a1aDaniel Dunbar  /// ClearOutputFiles - Clear the output file list, destroying the contained
355a9204831639e31474b927681b97c46781b758a1aDaniel Dunbar  /// output streams.
356a9204831639e31474b927681b97c46781b758a1aDaniel Dunbar  ///
357a9204831639e31474b927681b97c46781b758a1aDaniel Dunbar  /// \param EraseFiles - If true, attempt to erase the files from disk.
358a9204831639e31474b927681b97c46781b758a1aDaniel Dunbar  void ClearOutputFiles(bool EraseFiles);
359a9204831639e31474b927681b97c46781b758a1aDaniel Dunbar
360a9204831639e31474b927681b97c46781b758a1aDaniel Dunbar  /// }
36116b7449d86b843d0926b04f87104cf3fff7149feDaniel Dunbar  /// @name Construction Utility Methods
36216b7449d86b843d0926b04f87104cf3fff7149feDaniel Dunbar  /// {
36316b7449d86b843d0926b04f87104cf3fff7149feDaniel Dunbar
3640fbb3d9a9cdd2201848be9eb017c54cd78538122Daniel Dunbar  /// Create the diagnostics engine using the invocation's diagnostic options
3650fbb3d9a9cdd2201848be9eb017c54cd78538122Daniel Dunbar  /// and replace any existing one with it.
3660fbb3d9a9cdd2201848be9eb017c54cd78538122Daniel Dunbar  ///
3670fbb3d9a9cdd2201848be9eb017c54cd78538122Daniel Dunbar  /// Note that this routine also replaces the diagnostic client.
3680fbb3d9a9cdd2201848be9eb017c54cd78538122Daniel Dunbar  void createDiagnostics(int Argc, char **Argv);
3690fbb3d9a9cdd2201848be9eb017c54cd78538122Daniel Dunbar
3700fbb3d9a9cdd2201848be9eb017c54cd78538122Daniel Dunbar  /// Create a Diagnostic object with a the TextDiagnosticPrinter.
3710fbb3d9a9cdd2201848be9eb017c54cd78538122Daniel Dunbar  ///
3720fbb3d9a9cdd2201848be9eb017c54cd78538122Daniel Dunbar  /// The \arg Argc and \arg Argv arguments are used only for logging purposes,
3730fbb3d9a9cdd2201848be9eb017c54cd78538122Daniel Dunbar  /// when the diagnostic options indicate that the compiler should output
3740fbb3d9a9cdd2201848be9eb017c54cd78538122Daniel Dunbar  /// logging information.
3750fbb3d9a9cdd2201848be9eb017c54cd78538122Daniel Dunbar  ///
3765eb810024dc8a1d12d5f066c02c978f07c4fcb00Daniel Dunbar  /// Note that this creates an unowned DiagnosticClient, if using directly the
3775eb810024dc8a1d12d5f066c02c978f07c4fcb00Daniel Dunbar  /// caller is responsible for releaseing the returned Diagnostic's client
3785eb810024dc8a1d12d5f066c02c978f07c4fcb00Daniel Dunbar  /// eventually.
3795eb810024dc8a1d12d5f066c02c978f07c4fcb00Daniel Dunbar  ///
3800fbb3d9a9cdd2201848be9eb017c54cd78538122Daniel Dunbar  /// \return The new object on success, or null on failure.
3810fbb3d9a9cdd2201848be9eb017c54cd78538122Daniel Dunbar  static Diagnostic *createDiagnostics(const DiagnosticOptions &Opts,
3820fbb3d9a9cdd2201848be9eb017c54cd78538122Daniel Dunbar                                       int Argc, char **Argv);
3830fbb3d9a9cdd2201848be9eb017c54cd78538122Daniel Dunbar
38416b7449d86b843d0926b04f87104cf3fff7149feDaniel Dunbar  /// Create the file manager and replace any existing one with it.
38516b7449d86b843d0926b04f87104cf3fff7149feDaniel Dunbar  void createFileManager();
38616b7449d86b843d0926b04f87104cf3fff7149feDaniel Dunbar
38716b7449d86b843d0926b04f87104cf3fff7149feDaniel Dunbar  /// Create the source manager and replace any existing one with it.
38816b7449d86b843d0926b04f87104cf3fff7149feDaniel Dunbar  void createSourceManager();
38916b7449d86b843d0926b04f87104cf3fff7149feDaniel Dunbar
39022dacfacacf5559028550ba6ddfbaa4ea6cb3944Daniel Dunbar  /// Create the preprocessor, using the invocation, file, and source managers,
39122dacfacacf5559028550ba6ddfbaa4ea6cb3944Daniel Dunbar  /// and replace any existing one with it.
39222dacfacacf5559028550ba6ddfbaa4ea6cb3944Daniel Dunbar  void createPreprocessor();
39322dacfacacf5559028550ba6ddfbaa4ea6cb3944Daniel Dunbar
39422dacfacacf5559028550ba6ddfbaa4ea6cb3944Daniel Dunbar  /// Create a Preprocessor object.
39522dacfacacf5559028550ba6ddfbaa4ea6cb3944Daniel Dunbar  ///
39622dacfacacf5559028550ba6ddfbaa4ea6cb3944Daniel Dunbar  /// Note that this also creates a new HeaderSearch object which will be owned
39722dacfacacf5559028550ba6ddfbaa4ea6cb3944Daniel Dunbar  /// by the resulting Preprocessor.
39822dacfacacf5559028550ba6ddfbaa4ea6cb3944Daniel Dunbar  ///
39922dacfacacf5559028550ba6ddfbaa4ea6cb3944Daniel Dunbar  /// \return The new object on success, or null on failure.
40022dacfacacf5559028550ba6ddfbaa4ea6cb3944Daniel Dunbar  static Preprocessor *createPreprocessor(Diagnostic &, const LangOptions &,
40122dacfacacf5559028550ba6ddfbaa4ea6cb3944Daniel Dunbar                                          const PreprocessorOptions &,
40222dacfacacf5559028550ba6ddfbaa4ea6cb3944Daniel Dunbar                                          const HeaderSearchOptions &,
40322dacfacacf5559028550ba6ddfbaa4ea6cb3944Daniel Dunbar                                          const DependencyOutputOptions &,
40422dacfacacf5559028550ba6ddfbaa4ea6cb3944Daniel Dunbar                                          const TargetInfo &,
40522dacfacacf5559028550ba6ddfbaa4ea6cb3944Daniel Dunbar                                          SourceManager &, FileManager &);
40622dacfacacf5559028550ba6ddfbaa4ea6cb3944Daniel Dunbar
4075eb810024dc8a1d12d5f066c02c978f07c4fcb00Daniel Dunbar  /// Create the AST context.
4085eb810024dc8a1d12d5f066c02c978f07c4fcb00Daniel Dunbar  void createASTContext();
4095eb810024dc8a1d12d5f066c02c978f07c4fcb00Daniel Dunbar
4100f800391ffbfe3820e1c60246a09a97e5f065179Daniel Dunbar  /// Create an external AST source to read a PCH file and attach it to the AST
4110f800391ffbfe3820e1c60246a09a97e5f065179Daniel Dunbar  /// context.
4120f800391ffbfe3820e1c60246a09a97e5f065179Daniel Dunbar  void createPCHExternalASTSource(llvm::StringRef Path);
4130f800391ffbfe3820e1c60246a09a97e5f065179Daniel Dunbar
4140f800391ffbfe3820e1c60246a09a97e5f065179Daniel Dunbar  /// Create an external AST source to read a PCH file.
4150f800391ffbfe3820e1c60246a09a97e5f065179Daniel Dunbar  ///
4160f800391ffbfe3820e1c60246a09a97e5f065179Daniel Dunbar  /// \return - The new object on success, or null on failure.
4170f800391ffbfe3820e1c60246a09a97e5f065179Daniel Dunbar  static ExternalASTSource *
4180f800391ffbfe3820e1c60246a09a97e5f065179Daniel Dunbar  createPCHExternalASTSource(llvm::StringRef Path, const std::string &Sysroot,
4190f800391ffbfe3820e1c60246a09a97e5f065179Daniel Dunbar                             Preprocessor &PP, ASTContext &Context);
4200f800391ffbfe3820e1c60246a09a97e5f065179Daniel Dunbar
421c2f484f1f05216a9a427ac84b5773789a4661111Daniel Dunbar  /// Create a code completion consumer using the invocation; note that this
422c2f484f1f05216a9a427ac84b5773789a4661111Daniel Dunbar  /// will cause the source manager to truncate the input source file at the
423c2f484f1f05216a9a427ac84b5773789a4661111Daniel Dunbar  /// completion point.
424c2f484f1f05216a9a427ac84b5773789a4661111Daniel Dunbar  void createCodeCompletionConsumer();
425c2f484f1f05216a9a427ac84b5773789a4661111Daniel Dunbar
426c2f484f1f05216a9a427ac84b5773789a4661111Daniel Dunbar  /// Create a code completion consumer to print code completion results, at
427c2f484f1f05216a9a427ac84b5773789a4661111Daniel Dunbar  /// \arg Filename, \arg Line, and \arg Column, to the given output stream \arg
428c2f484f1f05216a9a427ac84b5773789a4661111Daniel Dunbar  /// OS.
429c2f484f1f05216a9a427ac84b5773789a4661111Daniel Dunbar  static CodeCompleteConsumer *
430c2f484f1f05216a9a427ac84b5773789a4661111Daniel Dunbar  createCodeCompletionConsumer(Preprocessor &PP, const std::string &Filename,
431c2f484f1f05216a9a427ac84b5773789a4661111Daniel Dunbar                               unsigned Line, unsigned Column,
432c2f484f1f05216a9a427ac84b5773789a4661111Daniel Dunbar                               bool UseDebugPrinter, bool ShowMacros,
433c2f484f1f05216a9a427ac84b5773789a4661111Daniel Dunbar                               llvm::raw_ostream &OS);
434c2f484f1f05216a9a427ac84b5773789a4661111Daniel Dunbar
43516b7449d86b843d0926b04f87104cf3fff7149feDaniel Dunbar  /// }
4362a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar};
4372a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar
4382a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar} // end namespace clang
4392a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar
4402a79e162a3fde25c1941151a67966830d873f2dbDaniel Dunbar#endif
441