clang
6.0.0
|
#include "clang/Frontend/ASTUnit.h"
#include "clang/AST/ASTConsumer.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/DeclVisitor.h"
#include "clang/AST/StmtVisitor.h"
#include "clang/AST/TypeOrdering.h"
#include "clang/Basic/Diagnostic.h"
#include "clang/Basic/MemoryBufferCache.h"
#include "clang/Basic/TargetInfo.h"
#include "clang/Basic/TargetOptions.h"
#include "clang/Basic/VirtualFileSystem.h"
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Frontend/FrontendActions.h"
#include "clang/Frontend/FrontendDiagnostic.h"
#include "clang/Frontend/FrontendOptions.h"
#include "clang/Frontend/MultiplexConsumer.h"
#include "clang/Frontend/Utils.h"
#include "clang/Lex/HeaderSearch.h"
#include "clang/Lex/Preprocessor.h"
#include "clang/Lex/PreprocessorOptions.h"
#include "clang/Sema/Sema.h"
#include "clang/Serialization/ASTReader.h"
#include "clang/Serialization/ASTWriter.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringSet.h"
#include "llvm/Support/CrashRecoveryContext.h"
#include "llvm/Support/Host.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/Mutex.h"
#include "llvm/Support/MutexGuard.h"
#include "llvm/Support/Timer.h"
#include "llvm/Support/raw_ostream.h"
#include <atomic>
#include <cstdio>
#include <cstdlib>
Go to the source code of this file.
Classes | |
struct | clang::ASTUnit::ASTWriterData |
Typedefs | |
typedef ContinuousRangeMap< unsigned, int, 2 > | SLocRemap |
Functions | |
static unsigned | getDeclShowContexts (const NamedDecl *ND, const LangOptions &LangOpts, bool &IsNestedNameSpecifier) |
Determine the set of code-completion contexts in which this declaration should be shown. More... | |
static ASTUnit::StandaloneDiagnostic | makeStandaloneDiagnostic (const LangOptions &LangOpts, const StoredDiagnostic &InDiag) |
static bool | isNonDriverDiag (const StoredDiagnostic &StoredDiag) |
static void | checkAndRemoveNonDriverDiags (SmallVectorImpl< StoredDiagnostic > &StoredDiags) |
static void | checkAndSanitizeDiags (SmallVectorImpl< StoredDiagnostic > &StoredDiagnostics, SourceManager &SM) |
static std::pair< unsigned, unsigned > | makeStandaloneRange (CharSourceRange Range, const SourceManager &SM, const LangOptions &LangOpts) |
static ASTUnit::StandaloneFixIt | makeStandaloneFixIt (const SourceManager &SM, const LangOptions &LangOpts, const FixItHint &InFix) |
static void | CalculateHiddenNames (const CodeCompletionContext &Context, CodeCompletionResult *Results, unsigned NumResults, ASTContext &Ctx, llvm::StringSet< llvm::BumpPtrAllocator > &HiddenNames) |
Helper function that computes which global names are hidden by the local code-completion results. More... | |
static bool | serializeUnit (ASTWriter &Writer, SmallVectorImpl< char > &Buffer, Sema &S, bool hasErrors, raw_ostream &OS) |
Variables | |
const unsigned | DefaultPreambleRebuildInterval = 5 |
After failing to build a precompiled preamble (due to errors in the source that occurs in the preamble), the number of reparses during which we'll skip even trying to precompile the preamble. More... | |
static std::atomic< unsigned > | ActiveASTUnitObjects |
Tracks the number of ASTUnit objects that are currently active. More... | |
typedef ContinuousRangeMap<unsigned, int, 2> SLocRemap |
Definition at line 2260 of file ASTUnit.cpp.
|
static |
Helper function that computes which global names are hidden by the local code-completion results.
Definition at line 1872 of file ASTUnit.cpp.
|
static |
Definition at line 991 of file ASTUnit.cpp.
References isNonDriverDiag().
Referenced by checkAndSanitizeDiags(), and makeStandaloneDiagnostic().
|
static |
Definition at line 999 of file ASTUnit.cpp.
References checkAndRemoveNonDriverDiags(), clang::TargetInfo::CreateTargetInfo(), clang::ASTUnit::getDiagnostics(), clang::ASTUnit::getFileManager(), clang::ASTUnit::getSourceManager(), clang::InputKind::LLVM_IR, clang::ASTUnit::ResetForParse(), SM, and clang::InputKind::Source.
|
static |
Determine the set of code-completion contexts in which this declaration should be shown.
Definition at line 234 of file ASTUnit.cpp.
References clang::NamedDecl::getUnderlyingDecl().
|
static |
Definition at line 986 of file ASTUnit.cpp.
References clang::StoredDiagnostic::getLocation(), and clang::SourceLocation::isValid().
Referenced by checkAndRemoveNonDriverDiags().
|
static |
Definition at line 1180 of file ASTUnit.cpp.
References clang::BeginSourceFileFailed, clang::PrecompiledPreamble::Build(), checkAndRemoveNonDriverDiags(), clang::ComputePreambleBounds(), clang::CouldntCreateTargetInfo, clang::CouldntCreateTempFile, clang::CouldntCreateVFSOverlay, clang::CouldntEmitPCH, DefaultPreambleRebuildInterval, clang::ASTUnit::StandaloneDiagnostic::Filename, clang::frontend::FixIt, clang::ASTUnit::StandaloneDiagnostic::FixIts, clang::ASTUnit::getASTContext(), clang::CompilerInstance::getASTContext(), clang::CompilerInvocationBase::getDiagnosticOpts(), clang::ASTUnit::getDiagnostics(), clang::ExternalASTSource::GetExternalDecl(), clang::ASTContext::getExternalSource(), clang::SourceManager::getFileLoc(), clang::SourceManager::getFilename(), clang::SourceManager::getFileOffset(), clang::StoredDiagnostic::getFixIts(), clang::CompilerInvocation::getFrontendOpts(), clang::StoredDiagnostic::getID(), clang::CompilerInstance::getInvocation(), clang::CompilerInvocationBase::getLangOpts(), clang::StoredDiagnostic::getLevel(), clang::StoredDiagnostic::getLocation(), clang::FullSourceLoc::getManager(), clang::StoredDiagnostic::getMessage(), clang::CompilerInstance::getModuleManager(), clang::DiagnosticsEngine::getNumWarnings(), clang::CompilerInstance::getPreprocessorPtr(), clang::StoredDiagnostic::getRanges(), clang::CompilerInstance::getTarget(), clang::CompilerInstance::hadModuleLoaderFatalFailure(), clang::CompilerInstance::hasASTContext(), clang::CompilerInstance::hasInvocation(), clang::CompilerInstance::hasPreprocessor(), clang::CompilerInstance::hasTarget(), clang::ASTUnit::StandaloneDiagnostic::ID, clang::FrontendOptions::Inputs, clang::SourceLocation::isInvalid(), clang::CompilerInvocationBase::LangOpts, clang::ASTUnit::StandaloneDiagnostic::Level, clang::ASTUnit::StandaloneDiagnostic::LocOffset, makeStandaloneFixIt(), makeStandaloneRange(), clang::ASTUnit::StandaloneDiagnostic::Message, clang::PreambleIsEmpty, clang::ProcessWarningOptions(), clang::ASTUnit::StandaloneDiagnostic::Ranges, clang::DiagnosticsEngine::Reset(), clang::CompilerInstance::setFileManager(), clang::DiagnosticsEngine::setNumWarnings(), clang::CompilerInstance::setSourceManager(), clang::PreambleBounds::Size, SM, clang::CompilerInstance::takeASTConsumer(), and clang::CompilerInstance::takeSema().
|
static |
Definition at line 1167 of file ASTUnit.cpp.
References clang::ASTUnit::StandaloneFixIt::BeforePreviousInsertions, clang::FixItHint::BeforePreviousInsertions, clang::ASTUnit::StandaloneFixIt::CodeToInsert, clang::FixItHint::CodeToInsert, clang::FixItHint::InsertFromRange, clang::ASTUnit::StandaloneFixIt::InsertFromRange, makeStandaloneRange(), clang::FixItHint::RemoveRange, and clang::ASTUnit::StandaloneFixIt::RemoveRange.
Referenced by makeStandaloneDiagnostic().
|
static |
Definition at line 1159 of file ASTUnit.cpp.
References clang::CharSourceRange::getBegin(), clang::CharSourceRange::getEnd(), clang::SourceManager::getFileOffset(), and clang::Lexer::makeFileCharRange().
Referenced by makeStandaloneDiagnostic(), and makeStandaloneFixIt().
|
static |
Definition at line 2231 of file ASTUnit.cpp.
References clang::ASTWriter::WriteAST().
Referenced by clang::ASTUnit::serialize().
|
static |
Tracks the number of ASTUnit objects that are currently active.
Used for debugging purposes only.
Definition at line 183 of file ASTUnit.cpp.
const unsigned DefaultPreambleRebuildInterval = 5 |
After failing to build a precompiled preamble (due to errors in the source that occurs in the preamble), the number of reparses during which we'll skip even trying to precompile the preamble.
Definition at line 178 of file ASTUnit.cpp.
Referenced by makeStandaloneDiagnostic().