ASTUnit.h (198398) | ASTUnit.h (198893) |
---|---|
1//===--- ASTUnit.h - ASTUnit utility ----------------------------*- C++ -*-===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// --- 4 unchanged lines hidden (view full) --- 13 14#ifndef LLVM_CLANG_FRONTEND_ASTUNIT_H 15#define LLVM_CLANG_FRONTEND_ASTUNIT_H 16 17#include "clang/Basic/SourceManager.h" 18#include "llvm/ADT/OwningPtr.h" 19#include "clang/Frontend/TextDiagnosticBuffer.h" 20#include "clang/Basic/FileManager.h" | 1//===--- ASTUnit.h - ASTUnit utility ----------------------------*- C++ -*-===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// --- 4 unchanged lines hidden (view full) --- 13 14#ifndef LLVM_CLANG_FRONTEND_ASTUNIT_H 15#define LLVM_CLANG_FRONTEND_ASTUNIT_H 16 17#include "clang/Basic/SourceManager.h" 18#include "llvm/ADT/OwningPtr.h" 19#include "clang/Frontend/TextDiagnosticBuffer.h" 20#include "clang/Basic/FileManager.h" |
21#include "clang/Index/ASTLocation.h" |
|
21#include <string> 22 23namespace clang { 24 class FileManager; 25 class FileEntry; 26 class SourceManager; 27 class Diagnostic; 28 class TextDiagnosticBuffer; 29 class HeaderSearch; 30 class TargetInfo; 31 class Preprocessor; 32 class ASTContext; 33 class Decl; 34 | 22#include <string> 23 24namespace clang { 25 class FileManager; 26 class FileEntry; 27 class SourceManager; 28 class Diagnostic; 29 class TextDiagnosticBuffer; 30 class HeaderSearch; 31 class TargetInfo; 32 class Preprocessor; 33 class ASTContext; 34 class Decl; 35 |
36using namespace idx; 37 |
|
35/// \brief Utility class for loading a ASTContext from a PCH file. 36/// 37class ASTUnit { 38 Diagnostic Diags; 39 FileManager FileMgr; 40 41 SourceManager SourceMgr; 42 llvm::OwningPtr<HeaderSearch> HeaderInfo; 43 llvm::OwningPtr<TargetInfo> Target; 44 llvm::OwningPtr<Preprocessor> PP; 45 llvm::OwningPtr<ASTContext> Ctx; 46 bool tempFile; 47 48 // OnlyLocalDecls - when true, walking this AST should only visit declarations 49 // that come from the AST itself, not from included precompiled headers. 50 // FIXME: This is temporary; eventually, CIndex will always do this. 51 bool OnlyLocalDecls; 52 | 38/// \brief Utility class for loading a ASTContext from a PCH file. 39/// 40class ASTUnit { 41 Diagnostic Diags; 42 FileManager FileMgr; 43 44 SourceManager SourceMgr; 45 llvm::OwningPtr<HeaderSearch> HeaderInfo; 46 llvm::OwningPtr<TargetInfo> Target; 47 llvm::OwningPtr<Preprocessor> PP; 48 llvm::OwningPtr<ASTContext> Ctx; 49 bool tempFile; 50 51 // OnlyLocalDecls - when true, walking this AST should only visit declarations 52 // that come from the AST itself, not from included precompiled headers. 53 // FIXME: This is temporary; eventually, CIndex will always do this. 54 bool OnlyLocalDecls; 55 |
56 // Critical optimization when using clang_getCursor(). 57 ASTLocation LastLoc; 58 |
|
53 ASTUnit(const ASTUnit&); // DO NOT IMPLEMENT 54 ASTUnit &operator=(const ASTUnit &); // DO NOT IMPLEMENT | 59 ASTUnit(const ASTUnit&); // DO NOT IMPLEMENT 60 ASTUnit &operator=(const ASTUnit &); // DO NOT IMPLEMENT |
55 ASTUnit(); | |
56 57public: 58 ASTUnit(DiagnosticClient *diagClient = NULL); 59 ~ASTUnit(); 60 61 const SourceManager &getSourceManager() const { return SourceMgr; } 62 SourceManager &getSourceManager() { return SourceMgr; } 63 --- 11 unchanged lines hidden (view full) --- 75 76 const std::string &getOriginalSourceFileName(); 77 const std::string &getPCHFileName(); 78 79 void unlinkTemporaryFile() { tempFile = true; } 80 81 bool getOnlyLocalDecls() const { return OnlyLocalDecls; } 82 | 61 62public: 63 ASTUnit(DiagnosticClient *diagClient = NULL); 64 ~ASTUnit(); 65 66 const SourceManager &getSourceManager() const { return SourceMgr; } 67 SourceManager &getSourceManager() { return SourceMgr; } 68 --- 11 unchanged lines hidden (view full) --- 80 81 const std::string &getOriginalSourceFileName(); 82 const std::string &getPCHFileName(); 83 84 void unlinkTemporaryFile() { tempFile = true; } 85 86 bool getOnlyLocalDecls() const { return OnlyLocalDecls; } 87 |
88 void setLastASTLocation(ASTLocation ALoc) { LastLoc = ALoc; } 89 ASTLocation getLastASTLocation() const { return LastLoc; } 90 |
|
83 /// \brief Create a ASTUnit from a PCH file. 84 /// 85 /// \param Filename - The PCH file to load. 86 /// 87 /// \param diagClient - The diagnostics client to use. Specify NULL 88 /// to use a default client that emits warnings/errors to standard error. 89 /// The ASTUnit objects takes ownership of this object. 90 /// --- 16 unchanged lines hidden --- | 91 /// \brief Create a ASTUnit from a PCH file. 92 /// 93 /// \param Filename - The PCH file to load. 94 /// 95 /// \param diagClient - The diagnostics client to use. Specify NULL 96 /// to use a default client that emits warnings/errors to standard error. 97 /// The ASTUnit objects takes ownership of this object. 98 /// --- 16 unchanged lines hidden --- |