llvm/clang/tools/libclang/CIndex.cpp

//===- CIndex.cpp - Clang-C Source Indexing Library -----------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// This file implements the main API hooks in the Clang-C Source Indexing
// library.
//
//===----------------------------------------------------------------------===//

#include "CIndexDiagnostic.h"
#include "CIndexer.h"
#include "CLog.h"
#include "CXCursor.h"
#include "CXFile.h"
#include "CXSourceLocation.h"
#include "CXString.h"
#include "CXTranslationUnit.h"
#include "CXType.h"
#include "CursorVisitor.h"
#include "clang-c/FatalErrorHandler.h"
#include "clang/AST/Attr.h"
#include "clang/AST/AttrVisitor.h"
#include "clang/AST/DeclObjCCommon.h"
#include "clang/AST/Expr.h"
#include "clang/AST/ExprCXX.h"
#include "clang/AST/Mangle.h"
#include "clang/AST/OpenACCClause.h"
#include "clang/AST/OpenMPClause.h"
#include "clang/AST/OperationKinds.h"
#include "clang/AST/StmtVisitor.h"
#include "clang/Basic/Diagnostic.h"
#include "clang/Basic/DiagnosticCategories.h"
#include "clang/Basic/DiagnosticIDs.h"
#include "clang/Basic/Stack.h"
#include "clang/Basic/TargetInfo.h"
#include "clang/Basic/Version.h"
#include "clang/Frontend/ASTUnit.h"
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Index/CommentToXML.h"
#include "clang/Lex/HeaderSearch.h"
#include "clang/Lex/Lexer.h"
#include "clang/Lex/PreprocessingRecord.h"
#include "clang/Lex/Preprocessor.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/Config/llvm-config.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/CrashRecoveryContext.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/Program.h"
#include "llvm/Support/SaveAndRestore.h"
#include "llvm/Support/Signals.h"
#include "llvm/Support/TargetSelect.h"
#include "llvm/Support/Threading.h"
#include "llvm/Support/Timer.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Support/thread.h"
#include <mutex>
#include <optional>

#if LLVM_ENABLE_THREADS != 0 && defined(__APPLE__)
#define USE_DARWIN_THREADS
#endif

#ifdef USE_DARWIN_THREADS
#include <pthread.h>
#endif

usingnamespaceclang;
usingnamespaceclang::cxcursor;
usingnamespaceclang::cxtu;
usingnamespaceclang::cxindex;

CXTranslationUnit cxtu::MakeCXTranslationUnit(CIndexer *CIdx,
                                              std::unique_ptr<ASTUnit> AU) {}

bool cxtu::isASTReadError(ASTUnit *AU) {}

cxtu::CXTUOwner::~CXTUOwner() {}

/// Compare two source ranges to determine their relative position in
/// the translation unit.
static RangeComparisonResult RangeCompare(SourceManager &SM, SourceRange R1,
                                          SourceRange R2) {}

/// Determine if a source location falls within, before, or after a
///   a given source range.
static RangeComparisonResult LocationCompare(SourceManager &SM,
                                             SourceLocation L, SourceRange R) {}

/// Translate a Clang source range into a CIndex source range.
///
/// Clang internally represents ranges where the end location points to the
/// start of the token at the end. However, for external clients it is more
/// useful to have a CXSourceRange be a proper half-open interval. This routine
/// does the appropriate translation.
CXSourceRange cxloc::translateSourceRange(const SourceManager &SM,
                                          const LangOptions &LangOpts,
                                          const CharSourceRange &R) {}

CharSourceRange cxloc::translateCXRangeToCharRange(CXSourceRange R) {}

//===----------------------------------------------------------------------===//
// Cursor visitor.
//===----------------------------------------------------------------------===//

static SourceRange getRawCursorExtent(CXCursor C);
static SourceRange getFullCursorExtent(CXCursor C, SourceManager &SrcMgr);

RangeComparisonResult CursorVisitor::CompareRegionOfInterest(SourceRange R) {}

/// Visit the given cursor and, if requested by the visitor,
/// its children.
///
/// \param Cursor the cursor to visit.
///
/// \param CheckedRegionOfInterest if true, then the caller already checked
/// that this cursor is within the region of interest.
///
/// \returns true if the visitation should be aborted, false if it
/// should continue.
bool CursorVisitor::Visit(CXCursor Cursor, bool CheckedRegionOfInterest) {}

static bool visitPreprocessedEntitiesInRange(SourceRange R,
                                             PreprocessingRecord &PPRec,
                                             CursorVisitor &Visitor) {}

bool CursorVisitor::visitFileRegion() {}

static bool isInLexicalContext(Decl *D, DeclContext *DC) {}

bool CursorVisitor::visitDeclsFromFileRegion(FileID File, unsigned Offset,
                                             unsigned Length) {}

bool CursorVisitor::visitPreprocessedEntitiesInRegion() {}

template <typename InputIterator>
bool CursorVisitor::visitPreprocessedEntities(InputIterator First,
                                              InputIterator Last,
                                              PreprocessingRecord &PPRec,
                                              FileID FID) {}

/// Visit the children of the given cursor.
///
/// \returns true if the visitation should be aborted, false if it
/// should continue.
bool CursorVisitor::VisitChildren(CXCursor Cursor) {}

bool CursorVisitor::VisitBlockDecl(BlockDecl *B) {}

std::optional<bool> CursorVisitor::shouldVisitCursor(CXCursor Cursor) {}

bool CursorVisitor::VisitDeclContext(DeclContext *DC) {}

std::optional<bool> CursorVisitor::handleDeclForVisitation(const Decl *D) {}

bool CursorVisitor::VisitTranslationUnitDecl(TranslationUnitDecl *D) {}

bool CursorVisitor::VisitTypeAliasTemplateDecl(TypeAliasTemplateDecl *D) {}

bool CursorVisitor::VisitTypeAliasDecl(TypeAliasDecl *D) {}

bool CursorVisitor::VisitTypedefDecl(TypedefDecl *D) {}

bool CursorVisitor::VisitTagDecl(TagDecl *D) {}

bool CursorVisitor::VisitClassTemplateSpecializationDecl(
    ClassTemplateSpecializationDecl *D) {}

bool CursorVisitor::VisitClassTemplatePartialSpecializationDecl(
    ClassTemplatePartialSpecializationDecl *D) {}

bool CursorVisitor::VisitTemplateTypeParmDecl(TemplateTypeParmDecl *D) {}

bool CursorVisitor::VisitEnumConstantDecl(EnumConstantDecl *D) {}

bool CursorVisitor::VisitDeclaratorDecl(DeclaratorDecl *DD) {}

static bool HasTrailingReturnType(FunctionDecl *ND) {}

/// Compare two base or member initializers based on their source order.
static int CompareCXXCtorInitializers(CXXCtorInitializer *const *X,
                                      CXXCtorInitializer *const *Y) {}

bool CursorVisitor::VisitFunctionDecl(FunctionDecl *ND) {}

bool CursorVisitor::VisitFieldDecl(FieldDecl *D) {}

bool CursorVisitor::VisitVarDecl(VarDecl *D) {}

bool CursorVisitor::VisitNonTypeTemplateParmDecl(NonTypeTemplateParmDecl *D) {}

bool CursorVisitor::VisitFunctionTemplateDecl(FunctionTemplateDecl *D) {}

bool CursorVisitor::VisitClassTemplateDecl(ClassTemplateDecl *D) {}

bool CursorVisitor::VisitTemplateTemplateParmDecl(TemplateTemplateParmDecl *D) {}

bool CursorVisitor::VisitObjCTypeParamDecl(ObjCTypeParamDecl *D) {}

bool CursorVisitor::VisitObjCMethodDecl(ObjCMethodDecl *ND) {}

template <typename DeclIt>
static void addRangedDeclsInContainer(DeclIt *DI_current, DeclIt DE_current,
                                      SourceManager &SM, SourceLocation EndLoc,
                                      SmallVectorImpl<Decl *> &Decls) {}

bool CursorVisitor::VisitObjCContainerDecl(ObjCContainerDecl *D) {}

bool CursorVisitor::VisitObjCCategoryDecl(ObjCCategoryDecl *ND) {}

bool CursorVisitor::VisitObjCProtocolDecl(ObjCProtocolDecl *PID) {}

bool CursorVisitor::VisitObjCPropertyDecl(ObjCPropertyDecl *PD) {}

bool CursorVisitor::VisitObjCTypeParamList(ObjCTypeParamList *typeParamList) {}

bool CursorVisitor::VisitObjCInterfaceDecl(ObjCInterfaceDecl *D) {}

bool CursorVisitor::VisitObjCImplDecl(ObjCImplDecl *D) {}

bool CursorVisitor::VisitObjCCategoryImplDecl(ObjCCategoryImplDecl *D) {}

bool CursorVisitor::VisitObjCImplementationDecl(ObjCImplementationDecl *D) {}

bool CursorVisitor::VisitObjCPropertyImplDecl(ObjCPropertyImplDecl *PD) {}

bool CursorVisitor::VisitNamespaceDecl(NamespaceDecl *D) {}

bool CursorVisitor::VisitNamespaceAliasDecl(NamespaceAliasDecl *D) {}

bool CursorVisitor::VisitUsingDecl(UsingDecl *D) {}

bool CursorVisitor::VisitUsingDirectiveDecl(UsingDirectiveDecl *D) {}

bool CursorVisitor::VisitUnresolvedUsingValueDecl(UnresolvedUsingValueDecl *D) {}

bool CursorVisitor::VisitUnresolvedUsingTypenameDecl(
    UnresolvedUsingTypenameDecl *D) {}

bool CursorVisitor::VisitStaticAssertDecl(StaticAssertDecl *D) {}

bool CursorVisitor::VisitFriendDecl(FriendDecl *D) {}

bool CursorVisitor::VisitDecompositionDecl(DecompositionDecl *D) {}

bool CursorVisitor::VisitConceptDecl(ConceptDecl *D) {}

bool CursorVisitor::VisitTypeConstraint(const TypeConstraint &TC) {}

bool CursorVisitor::VisitConceptRequirement(const concepts::Requirement &R) {}

bool CursorVisitor::VisitDeclarationNameInfo(DeclarationNameInfo Name) {}

bool CursorVisitor::VisitNestedNameSpecifier(NestedNameSpecifier *NNS,
                                             SourceRange Range) {}

bool CursorVisitor::VisitNestedNameSpecifierLoc(
    NestedNameSpecifierLoc Qualifier) {}

bool CursorVisitor::VisitTemplateParameters(
    const TemplateParameterList *Params) {}

bool CursorVisitor::VisitTemplateName(TemplateName Name, SourceLocation Loc) {}

bool CursorVisitor::VisitTemplateArgumentLoc(const TemplateArgumentLoc &TAL) {}

bool CursorVisitor::VisitLinkageSpecDecl(LinkageSpecDecl *D) {}

bool CursorVisitor::VisitQualifiedTypeLoc(QualifiedTypeLoc TL) {}

bool CursorVisitor::VisitBuiltinTypeLoc(BuiltinTypeLoc TL) {}

bool CursorVisitor::VisitTypedefTypeLoc(TypedefTypeLoc TL) {}

bool CursorVisitor::VisitUnresolvedUsingTypeLoc(UnresolvedUsingTypeLoc TL) {}

bool CursorVisitor::VisitTagTypeLoc(TagTypeLoc TL) {}

bool CursorVisitor::VisitTemplateTypeParmTypeLoc(TemplateTypeParmTypeLoc TL) {}

bool CursorVisitor::VisitObjCInterfaceTypeLoc(ObjCInterfaceTypeLoc TL) {}

bool CursorVisitor::VisitObjCTypeParamTypeLoc(ObjCTypeParamTypeLoc TL) {}

bool CursorVisitor::VisitObjCObjectTypeLoc(ObjCObjectTypeLoc TL) {}

bool CursorVisitor::VisitObjCObjectPointerTypeLoc(ObjCObjectPointerTypeLoc TL) {}

bool CursorVisitor::VisitParenTypeLoc(ParenTypeLoc TL) {}

bool CursorVisitor::VisitMacroQualifiedTypeLoc(MacroQualifiedTypeLoc TL) {}

bool CursorVisitor::VisitPointerTypeLoc(PointerTypeLoc TL) {}

bool CursorVisitor::VisitBlockPointerTypeLoc(BlockPointerTypeLoc TL) {}

bool CursorVisitor::VisitMemberPointerTypeLoc(MemberPointerTypeLoc TL) {}

bool CursorVisitor::VisitLValueReferenceTypeLoc(LValueReferenceTypeLoc TL) {}

bool CursorVisitor::VisitRValueReferenceTypeLoc(RValueReferenceTypeLoc TL) {}

bool CursorVisitor::VisitUsingTypeLoc(UsingTypeLoc TL) {}

bool CursorVisitor::VisitAttributedTypeLoc(AttributedTypeLoc TL) {}

bool CursorVisitor::VisitCountAttributedTypeLoc(CountAttributedTypeLoc TL) {}

bool CursorVisitor::VisitBTFTagAttributedTypeLoc(BTFTagAttributedTypeLoc TL) {}

bool CursorVisitor::VisitHLSLAttributedResourceTypeLoc(
    HLSLAttributedResourceTypeLoc TL) {}

bool CursorVisitor::VisitFunctionTypeLoc(FunctionTypeLoc TL,
                                         bool SkipResultType) {}

bool CursorVisitor::VisitArrayTypeLoc(ArrayTypeLoc TL) {}

bool CursorVisitor::VisitDecayedTypeLoc(DecayedTypeLoc TL) {}

bool CursorVisitor::VisitAdjustedTypeLoc(AdjustedTypeLoc TL) {}

bool CursorVisitor::VisitDeducedTemplateSpecializationTypeLoc(
    DeducedTemplateSpecializationTypeLoc TL) {}

bool CursorVisitor::VisitTemplateSpecializationTypeLoc(
    TemplateSpecializationTypeLoc TL) {}

bool CursorVisitor::VisitTypeOfExprTypeLoc(TypeOfExprTypeLoc TL) {}

bool CursorVisitor::VisitTypeOfTypeLoc(TypeOfTypeLoc TL) {}

bool CursorVisitor::VisitUnaryTransformTypeLoc(UnaryTransformTypeLoc TL) {}

bool CursorVisitor::VisitDependentNameTypeLoc(DependentNameTypeLoc TL) {}

bool CursorVisitor::VisitDependentTemplateSpecializationTypeLoc(
    DependentTemplateSpecializationTypeLoc TL) {}

bool CursorVisitor::VisitElaboratedTypeLoc(ElaboratedTypeLoc TL) {}

bool CursorVisitor::VisitPackExpansionTypeLoc(PackExpansionTypeLoc TL) {}

bool CursorVisitor::VisitDecltypeTypeLoc(DecltypeTypeLoc TL) {}

bool CursorVisitor::VisitPackIndexingTypeLoc(PackIndexingTypeLoc TL) {}

bool CursorVisitor::VisitInjectedClassNameTypeLoc(InjectedClassNameTypeLoc TL) {}

bool CursorVisitor::VisitAtomicTypeLoc(AtomicTypeLoc TL) {}

bool CursorVisitor::VisitPipeTypeLoc(PipeTypeLoc TL) {}

#define DEFAULT_TYPELOC_IMPL(CLASS, PARENT)

DEFAULT_TYPELOC_IMPL()
DEFAULT_TYPELOC_IMPL()
DEFAULT_TYPELOC_IMPL()
DEFAULT_TYPELOC_IMPL()
DEFAULT_TYPELOC_IMPL()
DEFAULT_TYPELOC_IMPL()
DEFAULT_TYPELOC_IMPL()
DEFAULT_TYPELOC_IMPL()
DEFAULT_TYPELOC_IMPL()
DEFAULT_TYPELOC_IMPL()
DEFAULT_TYPELOC_IMPL()
DEFAULT_TYPELOC_IMPL()
DEFAULT_TYPELOC_IMPL()
DEFAULT_TYPELOC_IMPL()
DEFAULT_TYPELOC_IMPL()
DEFAULT_TYPELOC_IMPL()
DEFAULT_TYPELOC_IMPL()
DEFAULT_TYPELOC_IMPL()
DEFAULT_TYPELOC_IMPL()
DEFAULT_TYPELOC_IMPL()
DEFAULT_TYPELOC_IMPL()
DEFAULT_TYPELOC_IMPL()

bool CursorVisitor::VisitCXXRecordDecl(CXXRecordDecl *D) {}

bool CursorVisitor::VisitAttributes(Decl *D) {}

//===----------------------------------------------------------------------===//
// Data-recursive visitor methods.
//===----------------------------------------------------------------------===//

namespace {
#define DEF_JOB

DEF_JOB(StmtVisit, Stmt, StmtVisitKind)
DEF_JOB(MemberExprParts, MemberExpr, MemberExprPartsKind)
DEF_JOB(DeclRefExprParts, DeclRefExpr, DeclRefExprPartsKind)
DEF_JOB(OverloadExprParts, OverloadExpr, OverloadExprPartsKind)
DEF_JOB(SizeOfPackExprParts, SizeOfPackExpr, SizeOfPackExprPartsKind)
DEF_JOB(LambdaExprParts, LambdaExpr, LambdaExprPartsKind)
DEF_JOB(ConceptSpecializationExprVisit, ConceptSpecializationExpr,
        ConceptSpecializationExprVisitKind)
DEF_JOB(RequiresExprVisit, RequiresExpr, RequiresExprVisitKind)
DEF_JOB
#undef DEF_JOB

class ExplicitTemplateArgsVisit : public VisitorJob {};
class DeclVisit : public VisitorJob {};
class TypeLocVisit : public VisitorJob {};

class LabelRefVisit : public VisitorJob {};

class NestedNameSpecifierLocVisit : public VisitorJob {};

class DeclarationNameInfoVisit : public VisitorJob {};
class MemberRefVisit : public VisitorJob {};
class EnqueueVisitor : public ConstStmtVisitor<EnqueueVisitor, void>,
                       public ConstAttrVisitor<EnqueueVisitor, void> {};
} // namespace

void EnqueueVisitor::AddDeclarationNameInfo(const Stmt *S) {}

void EnqueueVisitor::AddNestedNameSpecifierLoc(
    NestedNameSpecifierLoc Qualifier) {}

void EnqueueVisitor::AddStmt(const Stmt *S) {}
void EnqueueVisitor::AddDecl(const Decl *D, bool isFirst) {}
void EnqueueVisitor::AddExplicitTemplateArgs(const TemplateArgumentLoc *A,
                                             unsigned NumTemplateArgs) {}
void EnqueueVisitor::AddMemberRef(const FieldDecl *D, SourceLocation L) {}
void EnqueueVisitor::AddTypeLoc(TypeSourceInfo *TI) {}
void EnqueueVisitor::EnqueueChildren(const Stmt *S) {}
namespace {
class OMPClauseEnqueue : public ConstOMPClauseVisitor<OMPClauseEnqueue> {};

void OMPClauseEnqueue::VisitOMPClauseWithPreInit(
    const OMPClauseWithPreInit *C) {}

void OMPClauseEnqueue::VisitOMPClauseWithPostUpdate(
    const OMPClauseWithPostUpdate *C) {}

void OMPClauseEnqueue::VisitOMPIfClause(const OMPIfClause *C) {}

void OMPClauseEnqueue::VisitOMPFinalClause(const OMPFinalClause *C) {}

void OMPClauseEnqueue::VisitOMPNumThreadsClause(const OMPNumThreadsClause *C) {}

void OMPClauseEnqueue::VisitOMPSafelenClause(const OMPSafelenClause *C) {}

void OMPClauseEnqueue::VisitOMPSimdlenClause(const OMPSimdlenClause *C) {}

void OMPClauseEnqueue::VisitOMPSizesClause(const OMPSizesClause *C) {}

void OMPClauseEnqueue::VisitOMPFullClause(const OMPFullClause *C) {}

void OMPClauseEnqueue::VisitOMPPartialClause(const OMPPartialClause *C) {}

void OMPClauseEnqueue::VisitOMPAllocatorClause(const OMPAllocatorClause *C) {}

void OMPClauseEnqueue::VisitOMPCollapseClause(const OMPCollapseClause *C) {}

void OMPClauseEnqueue::VisitOMPDefaultClause(const OMPDefaultClause *C) {}

void OMPClauseEnqueue::VisitOMPProcBindClause(const OMPProcBindClause *C) {}

void OMPClauseEnqueue::VisitOMPScheduleClause(const OMPScheduleClause *C) {}

void OMPClauseEnqueue::VisitOMPOrderedClause(const OMPOrderedClause *C) {}

void OMPClauseEnqueue::VisitOMPDetachClause(const OMPDetachClause *C) {}

void OMPClauseEnqueue::VisitOMPNowaitClause(const OMPNowaitClause *) {}

void OMPClauseEnqueue::VisitOMPUntiedClause(const OMPUntiedClause *) {}

void OMPClauseEnqueue::VisitOMPMergeableClause(const OMPMergeableClause *) {}

void OMPClauseEnqueue::VisitOMPReadClause(const OMPReadClause *) {}

void OMPClauseEnqueue::VisitOMPWriteClause(const OMPWriteClause *) {}

void OMPClauseEnqueue::VisitOMPUpdateClause(const OMPUpdateClause *) {}

void OMPClauseEnqueue::VisitOMPCaptureClause(const OMPCaptureClause *) {}

void OMPClauseEnqueue::VisitOMPCompareClause(const OMPCompareClause *) {}

void OMPClauseEnqueue::VisitOMPFailClause(const OMPFailClause *) {}

void OMPClauseEnqueue::VisitOMPAbsentClause(const OMPAbsentClause *) {}

void OMPClauseEnqueue::VisitOMPHoldsClause(const OMPHoldsClause *) {}

void OMPClauseEnqueue::VisitOMPContainsClause(const OMPContainsClause *) {}

void OMPClauseEnqueue::VisitOMPNoOpenMPClause(const OMPNoOpenMPClause *) {}

void OMPClauseEnqueue::VisitOMPNoOpenMPRoutinesClause(
    const OMPNoOpenMPRoutinesClause *) {}

void OMPClauseEnqueue::VisitOMPNoParallelismClause(
    const OMPNoParallelismClause *) {}

void OMPClauseEnqueue::VisitOMPSeqCstClause(const OMPSeqCstClause *) {}

void OMPClauseEnqueue::VisitOMPAcqRelClause(const OMPAcqRelClause *) {}

void OMPClauseEnqueue::VisitOMPAcquireClause(const OMPAcquireClause *) {}

void OMPClauseEnqueue::VisitOMPReleaseClause(const OMPReleaseClause *) {}

void OMPClauseEnqueue::VisitOMPRelaxedClause(const OMPRelaxedClause *) {}

void OMPClauseEnqueue::VisitOMPWeakClause(const OMPWeakClause *) {}

void OMPClauseEnqueue::VisitOMPThreadsClause(const OMPThreadsClause *) {}

void OMPClauseEnqueue::VisitOMPSIMDClause(const OMPSIMDClause *) {}

void OMPClauseEnqueue::VisitOMPNogroupClause(const OMPNogroupClause *) {}

void OMPClauseEnqueue::VisitOMPInitClause(const OMPInitClause *C) {}

void OMPClauseEnqueue::VisitOMPUseClause(const OMPUseClause *C) {}

void OMPClauseEnqueue::VisitOMPDestroyClause(const OMPDestroyClause *C) {}

void OMPClauseEnqueue::VisitOMPNovariantsClause(const OMPNovariantsClause *C) {}

void OMPClauseEnqueue::VisitOMPNocontextClause(const OMPNocontextClause *C) {}

void OMPClauseEnqueue::VisitOMPFilterClause(const OMPFilterClause *C) {}

void OMPClauseEnqueue::VisitOMPAlignClause(const OMPAlignClause *C) {}

void OMPClauseEnqueue::VisitOMPUnifiedAddressClause(
    const OMPUnifiedAddressClause *) {}

void OMPClauseEnqueue::VisitOMPUnifiedSharedMemoryClause(
    const OMPUnifiedSharedMemoryClause *) {}

void OMPClauseEnqueue::VisitOMPReverseOffloadClause(
    const OMPReverseOffloadClause *) {}

void OMPClauseEnqueue::VisitOMPDynamicAllocatorsClause(
    const OMPDynamicAllocatorsClause *) {}

void OMPClauseEnqueue::VisitOMPAtomicDefaultMemOrderClause(
    const OMPAtomicDefaultMemOrderClause *) {}

void OMPClauseEnqueue::VisitOMPAtClause(const OMPAtClause *) {}

void OMPClauseEnqueue::VisitOMPSeverityClause(const OMPSeverityClause *) {}

void OMPClauseEnqueue::VisitOMPMessageClause(const OMPMessageClause *) {}

void OMPClauseEnqueue::VisitOMPDeviceClause(const OMPDeviceClause *C) {}

void OMPClauseEnqueue::VisitOMPNumTeamsClause(const OMPNumTeamsClause *C) {}

void OMPClauseEnqueue::VisitOMPThreadLimitClause(
    const OMPThreadLimitClause *C) {}

void OMPClauseEnqueue::VisitOMPPriorityClause(const OMPPriorityClause *C) {}

void OMPClauseEnqueue::VisitOMPGrainsizeClause(const OMPGrainsizeClause *C) {}

void OMPClauseEnqueue::VisitOMPNumTasksClause(const OMPNumTasksClause *C) {}

void OMPClauseEnqueue::VisitOMPHintClause(const OMPHintClause *C) {}

template <typename T> void OMPClauseEnqueue::VisitOMPClauseList(T *Node) {}

void OMPClauseEnqueue::VisitOMPInclusiveClause(const OMPInclusiveClause *C) {}
void OMPClauseEnqueue::VisitOMPExclusiveClause(const OMPExclusiveClause *C) {}
void OMPClauseEnqueue::VisitOMPAllocateClause(const OMPAllocateClause *C) {}
void OMPClauseEnqueue::VisitOMPPrivateClause(const OMPPrivateClause *C) {}
void OMPClauseEnqueue::VisitOMPFirstprivateClause(
    const OMPFirstprivateClause *C) {}
void OMPClauseEnqueue::VisitOMPLastprivateClause(
    const OMPLastprivateClause *C) {}
void OMPClauseEnqueue::VisitOMPSharedClause(const OMPSharedClause *C) {}
void OMPClauseEnqueue::VisitOMPReductionClause(const OMPReductionClause *C) {}
void OMPClauseEnqueue::VisitOMPTaskReductionClause(
    const OMPTaskReductionClause *C) {}
void OMPClauseEnqueue::VisitOMPInReductionClause(
    const OMPInReductionClause *C) {}
void OMPClauseEnqueue::VisitOMPLinearClause(const OMPLinearClause *C) {}
void OMPClauseEnqueue::VisitOMPAlignedClause(const OMPAlignedClause *C) {}
void OMPClauseEnqueue::VisitOMPCopyinClause(const OMPCopyinClause *C) {}
void OMPClauseEnqueue::VisitOMPCopyprivateClause(
    const OMPCopyprivateClause *C) {}
void OMPClauseEnqueue::VisitOMPFlushClause(const OMPFlushClause *C) {}
void OMPClauseEnqueue::VisitOMPDepobjClause(const OMPDepobjClause *C) {}
void OMPClauseEnqueue::VisitOMPDependClause(const OMPDependClause *C) {}
void OMPClauseEnqueue::VisitOMPMapClause(const OMPMapClause *C) {}
void OMPClauseEnqueue::VisitOMPDistScheduleClause(
    const OMPDistScheduleClause *C) {}
void OMPClauseEnqueue::VisitOMPDefaultmapClause(
    const OMPDefaultmapClause * /*C*/) {}
void OMPClauseEnqueue::VisitOMPToClause(const OMPToClause *C) {}
void OMPClauseEnqueue::VisitOMPFromClause(const OMPFromClause *C) {}
void OMPClauseEnqueue::VisitOMPUseDevicePtrClause(
    const OMPUseDevicePtrClause *C) {}
void OMPClauseEnqueue::VisitOMPUseDeviceAddrClause(
    const OMPUseDeviceAddrClause *C) {}
void OMPClauseEnqueue::VisitOMPIsDevicePtrClause(
    const OMPIsDevicePtrClause *C) {}
void OMPClauseEnqueue::VisitOMPHasDeviceAddrClause(
    const OMPHasDeviceAddrClause *C) {}
void OMPClauseEnqueue::VisitOMPNontemporalClause(
    const OMPNontemporalClause *C) {}
void OMPClauseEnqueue::VisitOMPOrderClause(const OMPOrderClause *C) {}
void OMPClauseEnqueue::VisitOMPUsesAllocatorsClause(
    const OMPUsesAllocatorsClause *C) {}
void OMPClauseEnqueue::VisitOMPAffinityClause(const OMPAffinityClause *C) {}
void OMPClauseEnqueue::VisitOMPBindClause(const OMPBindClause *C) {}
void OMPClauseEnqueue::VisitOMPXDynCGroupMemClause(
    const OMPXDynCGroupMemClause *C) {}
void OMPClauseEnqueue::VisitOMPDoacrossClause(const OMPDoacrossClause *C) {}
void OMPClauseEnqueue::VisitOMPXAttributeClause(const OMPXAttributeClause *C) {}
void OMPClauseEnqueue::VisitOMPXBareClause(const OMPXBareClause *C) {}

} // namespace

void EnqueueVisitor::EnqueueChildren(const OMPClause *S) {}

namespace {
class OpenACCClauseEnqueue : public OpenACCClauseVisitor<OpenACCClauseEnqueue> {};

void OpenACCClauseEnqueue::VisitDefaultClause(const OpenACCDefaultClause &C) {}
void OpenACCClauseEnqueue::VisitIfClause(const OpenACCIfClause &C) {}
void OpenACCClauseEnqueue::VisitSelfClause(const OpenACCSelfClause &C) {}
void OpenACCClauseEnqueue::VisitNumWorkersClause(
    const OpenACCNumWorkersClause &C) {}
void OpenACCClauseEnqueue::VisitVectorLengthClause(
    const OpenACCVectorLengthClause &C) {}
void OpenACCClauseEnqueue::VisitNumGangsClause(const OpenACCNumGangsClause &C) {}

void OpenACCClauseEnqueue::VisitTileClause(const OpenACCTileClause &C) {}

void OpenACCClauseEnqueue::VisitPrivateClause(const OpenACCPrivateClause &C) {}

void OpenACCClauseEnqueue::VisitFirstPrivateClause(
    const OpenACCFirstPrivateClause &C) {}

void OpenACCClauseEnqueue::VisitPresentClause(const OpenACCPresentClause &C) {}
void OpenACCClauseEnqueue::VisitNoCreateClause(const OpenACCNoCreateClause &C) {}
void OpenACCClauseEnqueue::VisitCopyClause(const OpenACCCopyClause &C) {}
void OpenACCClauseEnqueue::VisitCopyInClause(const OpenACCCopyInClause &C) {}
void OpenACCClauseEnqueue::VisitCopyOutClause(const OpenACCCopyOutClause &C) {}
void OpenACCClauseEnqueue::VisitCreateClause(const OpenACCCreateClause &C) {}
void OpenACCClauseEnqueue::VisitAttachClause(const OpenACCAttachClause &C) {}
void OpenACCClauseEnqueue::VisitDevicePtrClause(
    const OpenACCDevicePtrClause &C) {}
void OpenACCClauseEnqueue::VisitAsyncClause(const OpenACCAsyncClause &C) {}
void OpenACCClauseEnqueue::VisitWaitClause(const OpenACCWaitClause &C) {}
void OpenACCClauseEnqueue::VisitDeviceTypeClause(
    const OpenACCDeviceTypeClause &C) {}
void OpenACCClauseEnqueue::VisitReductionClause(
    const OpenACCReductionClause &C) {}
void OpenACCClauseEnqueue::VisitAutoClause(const OpenACCAutoClause &C) {}
void OpenACCClauseEnqueue::VisitIndependentClause(
    const OpenACCIndependentClause &C) {}
void OpenACCClauseEnqueue::VisitSeqClause(const OpenACCSeqClause &C) {}
void OpenACCClauseEnqueue::VisitCollapseClause(const OpenACCCollapseClause &C) {}
} // namespace

void EnqueueVisitor::EnqueueChildren(const OpenACCClause *C) {}

void EnqueueVisitor::EnqueueChildren(const AnnotateAttr *A) {}

void EnqueueVisitor::VisitAddrLabelExpr(const AddrLabelExpr *E) {}
void EnqueueVisitor::VisitBlockExpr(const BlockExpr *B) {}
void EnqueueVisitor::VisitCompoundLiteralExpr(const CompoundLiteralExpr *E) {}
void EnqueueVisitor::VisitCompoundStmt(const CompoundStmt *S) {}
void EnqueueVisitor::VisitMSDependentExistsStmt(
    const MSDependentExistsStmt *S) {}

void EnqueueVisitor::VisitCXXDependentScopeMemberExpr(
    const CXXDependentScopeMemberExpr *E) {}
void EnqueueVisitor::VisitCXXNewExpr(const CXXNewExpr *E) {}
void EnqueueVisitor::VisitCXXOperatorCallExpr(const CXXOperatorCallExpr *CE) {}
void EnqueueVisitor::VisitCXXPseudoDestructorExpr(
    const CXXPseudoDestructorExpr *E) {}
void EnqueueVisitor::VisitCXXScalarValueInitExpr(
    const CXXScalarValueInitExpr *E) {}
void EnqueueVisitor::VisitCXXTemporaryObjectExpr(
    const CXXTemporaryObjectExpr *E) {}
void EnqueueVisitor::VisitCXXTypeidExpr(const CXXTypeidExpr *E) {}

void EnqueueVisitor::VisitCXXUnresolvedConstructExpr(
    const CXXUnresolvedConstructExpr *E) {}
void EnqueueVisitor::VisitCXXUuidofExpr(const CXXUuidofExpr *E) {}

void EnqueueVisitor::VisitCXXCatchStmt(const CXXCatchStmt *S) {}

void EnqueueVisitor::VisitCXXForRangeStmt(const CXXForRangeStmt *S) {}

void EnqueueVisitor::VisitDeclRefExpr(const DeclRefExpr *DR) {}
void EnqueueVisitor::VisitDependentScopeDeclRefExpr(
    const DependentScopeDeclRefExpr *E) {}
void EnqueueVisitor::VisitDeclStmt(const DeclStmt *S) {}
void EnqueueVisitor::VisitDesignatedInitExpr(const DesignatedInitExpr *E) {}
void EnqueueVisitor::VisitExplicitCastExpr(const ExplicitCastExpr *E) {}
void EnqueueVisitor::VisitForStmt(const ForStmt *FS) {}
void EnqueueVisitor::VisitGotoStmt(const GotoStmt *GS) {}
void EnqueueVisitor::VisitIfStmt(const IfStmt *If) {}
void EnqueueVisitor::VisitInitListExpr(const InitListExpr *IE) {}
void EnqueueVisitor::VisitMemberExpr(const MemberExpr *M) {}
void EnqueueVisitor::VisitObjCEncodeExpr(const ObjCEncodeExpr *E) {}
void EnqueueVisitor::VisitObjCMessageExpr(const ObjCMessageExpr *M) {}
void EnqueueVisitor::VisitOffsetOfExpr(const OffsetOfExpr *E) {}
void EnqueueVisitor::VisitOverloadExpr(const OverloadExpr *E) {}
void EnqueueVisitor::VisitUnaryExprOrTypeTraitExpr(
    const UnaryExprOrTypeTraitExpr *E) {}
void EnqueueVisitor::VisitStmt(const Stmt *S) {}
void EnqueueVisitor::VisitSwitchStmt(const SwitchStmt *S) {}

void EnqueueVisitor::VisitWhileStmt(const WhileStmt *W) {}

void EnqueueVisitor::VisitTypeTraitExpr(const TypeTraitExpr *E) {}

void EnqueueVisitor::VisitArrayTypeTraitExpr(const ArrayTypeTraitExpr *E) {}

void EnqueueVisitor::VisitExpressionTraitExpr(const ExpressionTraitExpr *E) {}

void EnqueueVisitor::VisitUnresolvedMemberExpr(const UnresolvedMemberExpr *U) {}
void EnqueueVisitor::VisitVAArgExpr(const VAArgExpr *E) {}
void EnqueueVisitor::VisitSizeOfPackExpr(const SizeOfPackExpr *E) {}
void EnqueueVisitor::VisitOpaqueValueExpr(const OpaqueValueExpr *E) {}
void EnqueueVisitor::VisitLambdaExpr(const LambdaExpr *E) {}
void EnqueueVisitor::VisitConceptSpecializationExpr(
    const ConceptSpecializationExpr *E) {}
void EnqueueVisitor::VisitRequiresExpr(const RequiresExpr *E) {}
void EnqueueVisitor::VisitCXXParenListInitExpr(const CXXParenListInitExpr *E) {}
void EnqueueVisitor::VisitPseudoObjectExpr(const PseudoObjectExpr *E) {}

void EnqueueVisitor::VisitOMPExecutableDirective(
    const OMPExecutableDirective *D) {}

void EnqueueVisitor::VisitOMPLoopBasedDirective(
    const OMPLoopBasedDirective *D) {}

void EnqueueVisitor::VisitOMPLoopDirective(const OMPLoopDirective *D) {}

void EnqueueVisitor::VisitOMPParallelDirective(const OMPParallelDirective *D) {}

void EnqueueVisitor::VisitOMPSimdDirective(const OMPSimdDirective *D) {}

void EnqueueVisitor::VisitOMPLoopTransformationDirective(
    const OMPLoopTransformationDirective *D) {}

void EnqueueVisitor::VisitOMPTileDirective(const OMPTileDirective *D) {}

void EnqueueVisitor::VisitOMPUnrollDirective(const OMPUnrollDirective *D) {}

void EnqueueVisitor::VisitOMPReverseDirective(const OMPReverseDirective *D) {}

void EnqueueVisitor::VisitOMPInterchangeDirective(
    const OMPInterchangeDirective *D) {}

void EnqueueVisitor::VisitOMPForDirective(const OMPForDirective *D) {}

void EnqueueVisitor::VisitOMPForSimdDirective(const OMPForSimdDirective *D) {}

void EnqueueVisitor::VisitOMPSectionsDirective(const OMPSectionsDirective *D) {}

void EnqueueVisitor::VisitOMPSectionDirective(const OMPSectionDirective *D) {}

void EnqueueVisitor::VisitOMPSingleDirective(const OMPSingleDirective *D) {}

void EnqueueVisitor::VisitOMPMasterDirective(const OMPMasterDirective *D) {}

void EnqueueVisitor::VisitOMPCriticalDirective(const OMPCriticalDirective *D) {}

void EnqueueVisitor::VisitOMPParallelForDirective(
    const OMPParallelForDirective *D) {}

void EnqueueVisitor::VisitOMPParallelForSimdDirective(
    const OMPParallelForSimdDirective *D) {}

void EnqueueVisitor::VisitOMPParallelMasterDirective(
    const OMPParallelMasterDirective *D) {}

void EnqueueVisitor::VisitOMPParallelMaskedDirective(
    const OMPParallelMaskedDirective *D) {}

void EnqueueVisitor::VisitOMPParallelSectionsDirective(
    const OMPParallelSectionsDirective *D) {}

void EnqueueVisitor::VisitOMPTaskDirective(const OMPTaskDirective *D) {}

void EnqueueVisitor::VisitOMPTaskyieldDirective(
    const OMPTaskyieldDirective *D) {}

void EnqueueVisitor::VisitOMPBarrierDirective(const OMPBarrierDirective *D) {}

void EnqueueVisitor::VisitOMPTaskwaitDirective(const OMPTaskwaitDirective *D) {}

void EnqueueVisitor::VisitOMPAssumeDirective(const OMPAssumeDirective *D) {}

void EnqueueVisitor::VisitOMPErrorDirective(const OMPErrorDirective *D) {}

void EnqueueVisitor::VisitOMPTaskgroupDirective(
    const OMPTaskgroupDirective *D) {}

void EnqueueVisitor::VisitOMPFlushDirective(const OMPFlushDirective *D) {}

void EnqueueVisitor::VisitOMPDepobjDirective(const OMPDepobjDirective *D) {}

void EnqueueVisitor::VisitOMPScanDirective(const OMPScanDirective *D) {}

void EnqueueVisitor::VisitOMPOrderedDirective(const OMPOrderedDirective *D) {}

void EnqueueVisitor::VisitOMPAtomicDirective(const OMPAtomicDirective *D) {}

void EnqueueVisitor::VisitOMPTargetDirective(const OMPTargetDirective *D) {}

void EnqueueVisitor::VisitOMPTargetDataDirective(
    const OMPTargetDataDirective *D) {}

void EnqueueVisitor::VisitOMPTargetEnterDataDirective(
    const OMPTargetEnterDataDirective *D) {}

void EnqueueVisitor::VisitOMPTargetExitDataDirective(
    const OMPTargetExitDataDirective *D) {}

void EnqueueVisitor::VisitOMPTargetParallelDirective(
    const OMPTargetParallelDirective *D) {}

void EnqueueVisitor::VisitOMPTargetParallelForDirective(
    const OMPTargetParallelForDirective *D) {}

void EnqueueVisitor::VisitOMPTeamsDirective(const OMPTeamsDirective *D) {}

void EnqueueVisitor::VisitOMPCancellationPointDirective(
    const OMPCancellationPointDirective *D) {}

void EnqueueVisitor::VisitOMPCancelDirective(const OMPCancelDirective *D) {}

void EnqueueVisitor::VisitOMPTaskLoopDirective(const OMPTaskLoopDirective *D) {}

void EnqueueVisitor::VisitOMPTaskLoopSimdDirective(
    const OMPTaskLoopSimdDirective *D) {}

void EnqueueVisitor::VisitOMPMasterTaskLoopDirective(
    const OMPMasterTaskLoopDirective *D) {}

void EnqueueVisitor::VisitOMPMaskedTaskLoopDirective(
    const OMPMaskedTaskLoopDirective *D) {}

void EnqueueVisitor::VisitOMPMasterTaskLoopSimdDirective(
    const OMPMasterTaskLoopSimdDirective *D) {}

void EnqueueVisitor::VisitOMPMaskedTaskLoopSimdDirective(
    const OMPMaskedTaskLoopSimdDirective *D) {}

void EnqueueVisitor::VisitOMPParallelMasterTaskLoopDirective(
    const OMPParallelMasterTaskLoopDirective *D) {}

void EnqueueVisitor::VisitOMPParallelMaskedTaskLoopDirective(
    const OMPParallelMaskedTaskLoopDirective *D) {}

void EnqueueVisitor::VisitOMPParallelMasterTaskLoopSimdDirective(
    const OMPParallelMasterTaskLoopSimdDirective *D) {}

void EnqueueVisitor::VisitOMPParallelMaskedTaskLoopSimdDirective(
    const OMPParallelMaskedTaskLoopSimdDirective *D) {}

void EnqueueVisitor::VisitOMPDistributeDirective(
    const OMPDistributeDirective *D) {}

void EnqueueVisitor::VisitOMPDistributeParallelForDirective(
    const OMPDistributeParallelForDirective *D) {}

void EnqueueVisitor::VisitOMPDistributeParallelForSimdDirective(
    const OMPDistributeParallelForSimdDirective *D) {}

void EnqueueVisitor::VisitOMPDistributeSimdDirective(
    const OMPDistributeSimdDirective *D) {}

void EnqueueVisitor::VisitOMPTargetParallelForSimdDirective(
    const OMPTargetParallelForSimdDirective *D) {}

void EnqueueVisitor::VisitOMPTargetSimdDirective(
    const OMPTargetSimdDirective *D) {}

void EnqueueVisitor::VisitOMPTeamsDistributeDirective(
    const OMPTeamsDistributeDirective *D) {}

void EnqueueVisitor::VisitOMPTeamsDistributeSimdDirective(
    const OMPTeamsDistributeSimdDirective *D) {}

void EnqueueVisitor::VisitOMPTeamsDistributeParallelForSimdDirective(
    const OMPTeamsDistributeParallelForSimdDirective *D) {}

void EnqueueVisitor::VisitOMPTeamsDistributeParallelForDirective(
    const OMPTeamsDistributeParallelForDirective *D) {}

void EnqueueVisitor::VisitOMPTargetTeamsDirective(
    const OMPTargetTeamsDirective *D) {}

void EnqueueVisitor::VisitOMPTargetTeamsDistributeDirective(
    const OMPTargetTeamsDistributeDirective *D) {}

void EnqueueVisitor::VisitOMPTargetTeamsDistributeParallelForDirective(
    const OMPTargetTeamsDistributeParallelForDirective *D) {}

void EnqueueVisitor::VisitOMPTargetTeamsDistributeParallelForSimdDirective(
    const OMPTargetTeamsDistributeParallelForSimdDirective *D) {}

void EnqueueVisitor::VisitOMPTargetTeamsDistributeSimdDirective(
    const OMPTargetTeamsDistributeSimdDirective *D) {}

void EnqueueVisitor::VisitOpenACCComputeConstruct(
    const OpenACCComputeConstruct *C) {}

void EnqueueVisitor::VisitOpenACCLoopConstruct(const OpenACCLoopConstruct *C) {}

void EnqueueVisitor::VisitAnnotateAttr(const AnnotateAttr *A) {}

void CursorVisitor::EnqueueWorkList(VisitorWorkList &WL, const Stmt *S) {}

void CursorVisitor::EnqueueWorkList(VisitorWorkList &WL, const Attr *A) {}

bool CursorVisitor::IsInRegionOfInterest(CXCursor C) {}

bool CursorVisitor::RunVisitorWorkList(VisitorWorkList &WL) {}

bool CursorVisitor::Visit(const Stmt *S) {}

bool CursorVisitor::Visit(const Attr *A) {}

namespace {
RefNamePieces;
RefNamePieces buildPieces(unsigned NameFlags, bool IsMemberRefExpr,
                          const DeclarationNameInfo &NI, SourceRange QLoc,
                          const SourceRange *TemplateArgsLoc = nullptr) {}
} // namespace

//===----------------------------------------------------------------------===//
// Misc. API hooks.
//===----------------------------------------------------------------------===//

namespace {
struct RegisterFatalErrorHandler {};
} // namespace

static llvm::ManagedStatic<RegisterFatalErrorHandler>
    RegisterFatalErrorHandlerOnce;

static CIndexer *clang_createIndex_Impl(
    int excludeDeclarationsFromPCH, int displayDiagnostics,
    unsigned char threadBackgroundPriorityForIndexing = CXChoice_Default,
    unsigned char threadBackgroundPriorityForEditing = CXChoice_Default) {}

CXIndex clang_createIndex(int excludeDeclarationsFromPCH,
                          int displayDiagnostics) {}

void clang_disposeIndex(CXIndex CIdx) {}

CXIndex clang_createIndexWithOptions(const CXIndexOptions *options) {}

void clang_CXIndex_setGlobalOptions(CXIndex CIdx, unsigned options) {}

unsigned clang_CXIndex_getGlobalOptions(CXIndex CIdx) {}

void clang_CXIndex_setInvocationEmissionPathOption(CXIndex CIdx,
                                                   const char *Path) {}

void clang_toggleCrashRecovery(unsigned isEnabled) {}

CXTranslationUnit clang_createTranslationUnit(CXIndex CIdx,
                                              const char *ast_filename) {}

enum CXErrorCode clang_createTranslationUnit2(CXIndex CIdx,
                                              const char *ast_filename,
                                              CXTranslationUnit *out_TU) {}

unsigned clang_defaultEditingTranslationUnitOptions() {}

CXTranslationUnit clang_createTranslationUnitFromSourceFile(
    CXIndex CIdx, const char *source_filename, int num_command_line_args,
    const char *const *command_line_args, unsigned num_unsaved_files,
    struct CXUnsavedFile *unsaved_files) {}

static CXErrorCode
clang_parseTranslationUnit_Impl(CXIndex CIdx, const char *source_filename,
                                const char *const *command_line_args,
                                int num_command_line_args,
                                ArrayRef<CXUnsavedFile> unsaved_files,
                                unsigned options, CXTranslationUnit *out_TU) {}

CXTranslationUnit
clang_parseTranslationUnit(CXIndex CIdx, const char *source_filename,
                           const char *const *command_line_args,
                           int num_command_line_args,
                           struct CXUnsavedFile *unsaved_files,
                           unsigned num_unsaved_files, unsigned options) {}

enum CXErrorCode clang_parseTranslationUnit2(
    CXIndex CIdx, const char *source_filename,
    const char *const *command_line_args, int num_command_line_args,
    struct CXUnsavedFile *unsaved_files, unsigned num_unsaved_files,
    unsigned options, CXTranslationUnit *out_TU) {}

enum CXErrorCode clang_parseTranslationUnit2FullArgv(
    CXIndex CIdx, const char *source_filename,
    const char *const *command_line_args, int num_command_line_args,
    struct CXUnsavedFile *unsaved_files, unsigned num_unsaved_files,
    unsigned options, CXTranslationUnit *out_TU) {}

CXString clang_Type_getObjCEncoding(CXType CT) {}

static const IdentifierInfo *getMacroIdentifier(CXCursor C) {}

unsigned clang_Cursor_isMacroFunctionLike(CXCursor C) {}

unsigned clang_Cursor_isMacroBuiltin(CXCursor C) {}

unsigned clang_Cursor_isFunctionInlined(CXCursor C) {}

static StringLiteral *getCFSTR_value(CallExpr *callExpr) {}

struct ExprEvalResult {};

void clang_EvalResult_dispose(CXEvalResult E) {}

CXEvalResultKind clang_EvalResult_getKind(CXEvalResult E) {}

int clang_EvalResult_getAsInt(CXEvalResult E) {}

long long clang_EvalResult_getAsLongLong(CXEvalResult E) {}

unsigned clang_EvalResult_isUnsignedInt(CXEvalResult E) {}

unsigned long long clang_EvalResult_getAsUnsigned(CXEvalResult E) {}

double clang_EvalResult_getAsDouble(CXEvalResult E) {}

const char *clang_EvalResult_getAsStr(CXEvalResult E) {}

static const ExprEvalResult *evaluateExpr(Expr *expr, CXCursor C) {}

static const Expr *evaluateDeclExpr(const Decl *D) {}

static const Expr *evaluateCompoundStmtExpr(const CompoundStmt *CS) {}

CXEvalResult clang_Cursor_Evaluate(CXCursor C) {}

unsigned clang_Cursor_hasAttrs(CXCursor C) {}
unsigned clang_defaultSaveOptions(CXTranslationUnit TU) {}

static CXSaveError clang_saveTranslationUnit_Impl(CXTranslationUnit TU,
                                                  const char *FileName,
                                                  unsigned options) {}

int clang_saveTranslationUnit(CXTranslationUnit TU, const char *FileName,
                              unsigned options) {}

void clang_disposeTranslationUnit(CXTranslationUnit CTUnit) {}

unsigned clang_suspendTranslationUnit(CXTranslationUnit CTUnit) {}

unsigned clang_defaultReparseOptions(CXTranslationUnit TU) {}

static CXErrorCode
clang_reparseTranslationUnit_Impl(CXTranslationUnit TU,
                                  ArrayRef<CXUnsavedFile> unsaved_files,
                                  unsigned options) {}

int clang_reparseTranslationUnit(CXTranslationUnit TU,
                                 unsigned num_unsaved_files,
                                 struct CXUnsavedFile *unsaved_files,
                                 unsigned options) {}

CXString clang_getTranslationUnitSpelling(CXTranslationUnit CTUnit) {}

CXCursor clang_getTranslationUnitCursor(CXTranslationUnit TU) {}

CXTargetInfo clang_getTranslationUnitTargetInfo(CXTranslationUnit CTUnit) {}

CXString clang_TargetInfo_getTriple(CXTargetInfo TargetInfo) {}

int clang_TargetInfo_getPointerWidth(CXTargetInfo TargetInfo) {}

void clang_TargetInfo_dispose(CXTargetInfo TargetInfo) {}

//===----------------------------------------------------------------------===//
// CXFile Operations.
//===----------------------------------------------------------------------===//

CXString clang_getFileName(CXFile SFile) {}

time_t clang_getFileTime(CXFile SFile) {}

CXFile clang_getFile(CXTranslationUnit TU, const char *file_name) {}

const char *clang_getFileContents(CXTranslationUnit TU, CXFile file,
                                  size_t *size) {}

unsigned clang_isFileMultipleIncludeGuarded(CXTranslationUnit TU, CXFile file) {}

int clang_getFileUniqueID(CXFile file, CXFileUniqueID *outID) {}

int clang_File_isEqual(CXFile file1, CXFile file2) {}

CXString clang_File_tryGetRealPathName(CXFile SFile) {}

//===----------------------------------------------------------------------===//
// CXCursor Operations.
//===----------------------------------------------------------------------===//

static const Decl *getDeclFromExpr(const Stmt *E) {}

static SourceLocation getLocationFromExpr(const Expr *E) {}

extern "C" {

unsigned clang_visitChildren(CXCursor parent, CXCursorVisitor visitor,
                             CXClientData client_data) {}

#ifndef __has_feature
#define __has_feature
#endif
#if __has_feature(blocks)
typedef enum CXChildVisitResult (^CXCursorVisitorBlock)(CXCursor cursor,
                                                        CXCursor parent);

static enum CXChildVisitResult visitWithBlock(CXCursor cursor, CXCursor parent,
                                              CXClientData client_data) {
  CXCursorVisitorBlock block = (CXCursorVisitorBlock)client_data;
  return block(cursor, parent);
}
#else
// If we are compiled with a compiler that doesn't have native blocks support,
// define and call the block manually, so the
CXCursorVisitorBlock;

static enum CXChildVisitResult visitWithBlock(CXCursor cursor, CXCursor parent,
                                              CXClientData client_data) {}
#endif

unsigned clang_visitChildrenWithBlock(CXCursor parent,
                                      CXCursorVisitorBlock block) {}

static CXString getDeclSpelling(const Decl *D) {}

CXString clang_getCursorSpelling(CXCursor C) {}

CXSourceRange clang_Cursor_getSpellingNameRange(CXCursor C, unsigned pieceIndex,
                                                unsigned options) {}

CXString clang_Cursor_getMangling(CXCursor C) {}

CXStringSet *clang_Cursor_getCXXManglings(CXCursor C) {}

CXStringSet *clang_Cursor_getObjCManglings(CXCursor C) {}

CXPrintingPolicy clang_getCursorPrintingPolicy(CXCursor C) {}

void clang_PrintingPolicy_dispose(CXPrintingPolicy Policy) {}

unsigned
clang_PrintingPolicy_getProperty(CXPrintingPolicy Policy,
                                 enum CXPrintingPolicyProperty Property) {}

void clang_PrintingPolicy_setProperty(CXPrintingPolicy Policy,
                                      enum CXPrintingPolicyProperty Property,
                                      unsigned Value) {}

CXString clang_getCursorPrettyPrinted(CXCursor C, CXPrintingPolicy cxPolicy) {}

CXString clang_getCursorDisplayName(CXCursor C) {}

CXString clang_getCursorKindSpelling(enum CXCursorKind Kind) {}

struct GetCursorData {};

static enum CXChildVisitResult
GetCursorVisitor(CXCursor cursor, CXCursor parent, CXClientData client_data) {}

CXCursor clang_getCursor(CXTranslationUnit TU, CXSourceLocation Loc) {}

CXCursor clang_getNullCursor(void) {}

unsigned clang_equalCursors(CXCursor X, CXCursor Y) {}

unsigned clang_hashCursor(CXCursor C) {}

unsigned clang_isInvalid(enum CXCursorKind K) {}

unsigned clang_isDeclaration(enum CXCursorKind K) {}

unsigned clang_isInvalidDeclaration(CXCursor C) {}

unsigned clang_isReference(enum CXCursorKind K) {}

unsigned clang_isExpression(enum CXCursorKind K) {}

unsigned clang_isStatement(enum CXCursorKind K) {}

unsigned clang_isAttribute(enum CXCursorKind K) {}

unsigned clang_isTranslationUnit(enum CXCursorKind K) {}

unsigned clang_isPreprocessing(enum CXCursorKind K) {}

unsigned clang_isUnexposed(enum CXCursorKind K) {}

CXCursorKind clang_getCursorKind(CXCursor C) {}

CXSourceLocation clang_getCursorLocation(CXCursor C) {}

} // end extern "C"

CXCursor cxcursor::getCursor(CXTranslationUnit TU, SourceLocation SLoc) {}

static SourceRange getRawCursorExtent(CXCursor C) {}

/// Retrieves the "raw" cursor extent, which is then extended to include
/// the decl-specifier-seq for declarations.
static SourceRange getFullCursorExtent(CXCursor C, SourceManager &SrcMgr) {}

CXSourceRange clang_getCursorExtent(CXCursor C) {}

CXCursor clang_getCursorReferenced(CXCursor C) {}

CXCursor clang_getCursorDefinition(CXCursor C) {}

unsigned clang_isCursorDefinition(CXCursor C) {}

CXCursor clang_getCanonicalCursor(CXCursor C) {}

int clang_Cursor_getObjCSelectorIndex(CXCursor cursor) {}

unsigned clang_getNumOverloadedDecls(CXCursor C) {}

CXCursor clang_getOverloadedDecl(CXCursor cursor, unsigned index) {}

void clang_getDefinitionSpellingAndExtent(
    CXCursor C, const char **startBuf, const char **endBuf, unsigned *startLine,
    unsigned *startColumn, unsigned *endLine, unsigned *endColumn) {}

CXSourceRange clang_getCursorReferenceNameRange(CXCursor C, unsigned NameFlags,
                                                unsigned PieceIndex) {}

void clang_enableStackTraces(void) {}

void clang_executeOnThread(void (*fn)(void *), void *user_data,
                           unsigned stack_size) {}

//===----------------------------------------------------------------------===//
// Token-based Operations.
//===----------------------------------------------------------------------===//

/* CXToken layout:
 *   int_data[0]: a CXTokenKind
 *   int_data[1]: starting token location
 *   int_data[2]: token length
 *   int_data[3]: reserved
 *   ptr_data: for identifiers and keywords, an IdentifierInfo*.
 *   otherwise unused.
 */
CXTokenKind clang_getTokenKind(CXToken CXTok) {}

CXString clang_getTokenSpelling(CXTranslationUnit TU, CXToken CXTok) {}

CXSourceLocation clang_getTokenLocation(CXTranslationUnit TU, CXToken CXTok) {}

CXSourceRange clang_getTokenExtent(CXTranslationUnit TU, CXToken CXTok) {}

static void getTokens(ASTUnit *CXXUnit, SourceRange Range,
                      SmallVectorImpl<CXToken> &CXTokens) {}

CXToken *clang_getToken(CXTranslationUnit TU, CXSourceLocation Location) {}

void clang_tokenize(CXTranslationUnit TU, CXSourceRange Range, CXToken **Tokens,
                    unsigned *NumTokens) {}

void clang_disposeTokens(CXTranslationUnit TU, CXToken *Tokens,
                         unsigned NumTokens) {}

//===----------------------------------------------------------------------===//
// Token annotation APIs.
//===----------------------------------------------------------------------===//

static enum CXChildVisitResult AnnotateTokensVisitor(CXCursor cursor,
                                                     CXCursor parent,
                                                     CXClientData client_data);
static bool AnnotateTokensPostChildrenVisitor(CXCursor cursor,
                                              CXClientData client_data);

namespace {
class AnnotateTokensWorker {};
} // namespace

void AnnotateTokensWorker::AnnotateTokens() {}

bool AnnotateTokensWorker::IsIgnoredChildCursor(CXCursor cursor) const {}

const CXXOperatorCallExpr *GetSubscriptOrCallOperator(CXCursor Cursor) {}

AnnotateTokensWorker::PostChildrenActions
AnnotateTokensWorker::DetermineChildActions(CXCursor Cursor) const {}

static inline void updateCursorAnnotation(CXCursor &Cursor,
                                          const CXCursor &updateC) {}

/// It annotates and advances tokens with a cursor until the comparison
//// between the cursor location and the source range is the same as
/// \arg compResult.
///
/// Pass RangeBefore to annotate tokens with a cursor until a range is reached.
/// Pass RangeOverlap to annotate tokens inside a range.
void AnnotateTokensWorker::annotateAndAdvanceTokens(
    CXCursor updateC, RangeComparisonResult compResult, SourceRange range) {}

/// Special annotation handling for macro argument tokens.
/// \returns true if it advanced beyond all macro tokens, false otherwise.
bool AnnotateTokensWorker::annotateAndAdvanceFunctionMacroTokens(
    CXCursor updateC, RangeComparisonResult compResult, SourceRange range) {}

enum CXChildVisitResult AnnotateTokensWorker::Visit(CXCursor cursor,
                                                    CXCursor parent) {}

bool AnnotateTokensWorker::postVisitChildren(CXCursor cursor) {}

void AnnotateTokensWorker::HandlePostPonedChildCursors(
    const PostChildrenInfo &Info) {}

void AnnotateTokensWorker::HandlePostPonedChildCursor(
    CXCursor Cursor, unsigned StartTokenIndex) {}

static enum CXChildVisitResult AnnotateTokensVisitor(CXCursor cursor,
                                                     CXCursor parent,
                                                     CXClientData client_data) {}

static bool AnnotateTokensPostChildrenVisitor(CXCursor cursor,
                                              CXClientData client_data) {}

namespace {

/// Uses the macro expansions in the preprocessing record to find
/// and mark tokens that are macro arguments. This info is used by the
/// AnnotateTokensWorker.
class MarkMacroArgTokensVisitor {};

} // end anonymous namespace

static CXChildVisitResult
MarkMacroArgTokensVisitorDelegate(CXCursor cursor, CXCursor parent,
                                  CXClientData client_data) {}

/// Used by \c annotatePreprocessorTokens.
/// \returns true if lexing was finished, false otherwise.
static bool lexNext(Lexer &Lex, Token &Tok, unsigned &NextIdx,
                    unsigned NumTokens) {}

static void annotatePreprocessorTokens(CXTranslationUnit TU,
                                       SourceRange RegionOfInterest,
                                       CXCursor *Cursors, CXToken *Tokens,
                                       unsigned NumTokens) {}

// This gets run a separate thread to avoid stack blowout.
static void clang_annotateTokensImpl(CXTranslationUnit TU, ASTUnit *CXXUnit,
                                     CXToken *Tokens, unsigned NumTokens,
                                     CXCursor *Cursors) {}

void clang_annotateTokens(CXTranslationUnit TU, CXToken *Tokens,
                          unsigned NumTokens, CXCursor *Cursors) {}

//===----------------------------------------------------------------------===//
// Operations for querying linkage of a cursor.
//===----------------------------------------------------------------------===//

CXLinkageKind clang_getCursorLinkage(CXCursor cursor) {}

//===----------------------------------------------------------------------===//
// Operations for querying visibility of a cursor.
//===----------------------------------------------------------------------===//

CXVisibilityKind clang_getCursorVisibility(CXCursor cursor) {}

//===----------------------------------------------------------------------===//
// Operations for querying language of a cursor.
//===----------------------------------------------------------------------===//

static CXLanguageKind getDeclLanguage(const Decl *D) {}

static CXAvailabilityKind getCursorAvailabilityForDecl(const Decl *D) {}

enum CXAvailabilityKind clang_getCursorAvailability(CXCursor cursor) {}

static CXVersion convertVersion(VersionTuple In) {}

static void getCursorPlatformAvailabilityForDecl(
    const Decl *D, int *always_deprecated, CXString *deprecated_message,
    int *always_unavailable, CXString *unavailable_message,
    SmallVectorImpl<AvailabilityAttr *> &AvailabilityAttrs) {}

int clang_getCursorPlatformAvailability(CXCursor cursor, int *always_deprecated,
                                        CXString *deprecated_message,
                                        int *always_unavailable,
                                        CXString *unavailable_message,
                                        CXPlatformAvailability *availability,
                                        int availability_size) {}

void clang_disposeCXPlatformAvailability(CXPlatformAvailability *availability) {}

CXLanguageKind clang_getCursorLanguage(CXCursor cursor) {}

CXTLSKind clang_getCursorTLSKind(CXCursor cursor) {}

/// If the given cursor is the "templated" declaration
/// describing a class or function template, return the class or
/// function template.
static const Decl *maybeGetTemplateCursor(const Decl *D) {}

enum CX_StorageClass clang_Cursor_getStorageClass(CXCursor C) {}

CXCursor clang_getCursorSemanticParent(CXCursor cursor) {}

CXCursor clang_getCursorLexicalParent(CXCursor cursor) {}

CXFile clang_getIncludedFile(CXCursor cursor) {}

unsigned clang_Cursor_getObjCPropertyAttributes(CXCursor C, unsigned reserved) {}

CXString clang_Cursor_getObjCPropertyGetterName(CXCursor C) {}

CXString clang_Cursor_getObjCPropertySetterName(CXCursor C) {}

unsigned clang_Cursor_getObjCDeclQualifiers(CXCursor C) {}

unsigned clang_Cursor_isObjCOptional(CXCursor C) {}

unsigned clang_Cursor_isVariadic(CXCursor C) {}

unsigned clang_Cursor_isExternalSymbol(CXCursor C, CXString *language,
                                       CXString *definedIn,
                                       unsigned *isGenerated) {}

enum CX_BinaryOperatorKind clang_Cursor_getBinaryOpcode(CXCursor C) {}

CXString clang_Cursor_getBinaryOpcodeStr(enum CX_BinaryOperatorKind Op) {}

CXSourceRange clang_Cursor_getCommentRange(CXCursor C) {}

CXString clang_Cursor_getRawCommentText(CXCursor C) {}

CXString clang_Cursor_getBriefCommentText(CXCursor C) {}

CXModule clang_Cursor_getModule(CXCursor C) {}

CXModule clang_getModuleForFile(CXTranslationUnit TU, CXFile File) {}

CXFile clang_Module_getASTFile(CXModule CXMod) {}

CXModule clang_Module_getParent(CXModule CXMod) {}

CXString clang_Module_getName(CXModule CXMod) {}

CXString clang_Module_getFullName(CXModule CXMod) {}

int clang_Module_isSystem(CXModule CXMod) {}

unsigned clang_Module_getNumTopLevelHeaders(CXTranslationUnit TU,
                                            CXModule CXMod) {}

CXFile clang_Module_getTopLevelHeader(CXTranslationUnit TU, CXModule CXMod,
                                      unsigned Index) {}

//===----------------------------------------------------------------------===//
// C++ AST instrospection.
//===----------------------------------------------------------------------===//

unsigned clang_CXXConstructor_isDefaultConstructor(CXCursor C) {}

unsigned clang_CXXConstructor_isCopyConstructor(CXCursor C) {}

unsigned clang_CXXConstructor_isMoveConstructor(CXCursor C) {}

unsigned clang_CXXConstructor_isConvertingConstructor(CXCursor C) {}

unsigned clang_CXXField_isMutable(CXCursor C) {}

unsigned clang_CXXMethod_isPureVirtual(CXCursor C) {}

unsigned clang_CXXMethod_isConst(CXCursor C) {}

unsigned clang_CXXMethod_isDefaulted(CXCursor C) {}

unsigned clang_CXXMethod_isDeleted(CXCursor C) {}

unsigned clang_CXXMethod_isStatic(CXCursor C) {}

unsigned clang_CXXMethod_isVirtual(CXCursor C) {}

unsigned clang_CXXMethod_isCopyAssignmentOperator(CXCursor C) {}

unsigned clang_CXXMethod_isMoveAssignmentOperator(CXCursor C) {}

unsigned clang_CXXMethod_isExplicit(CXCursor C) {}

unsigned clang_CXXRecord_isAbstract(CXCursor C) {}

unsigned clang_EnumDecl_isScoped(CXCursor C) {}

//===----------------------------------------------------------------------===//
// Attribute introspection.
//===----------------------------------------------------------------------===//

CXType clang_getIBOutletCollectionType(CXCursor C) {}

//===----------------------------------------------------------------------===//
// Inspecting memory usage.
//===----------------------------------------------------------------------===//

MemUsageEntries;

static inline void createCXTUResourceUsageEntry(MemUsageEntries &entries,
                                                enum CXTUResourceUsageKind k,
                                                unsigned long amount) {}

const char *clang_getTUResourceUsageName(CXTUResourceUsageKind kind) {}

CXTUResourceUsage clang_getCXTUResourceUsage(CXTranslationUnit TU) {}

void clang_disposeCXTUResourceUsage(CXTUResourceUsage usage) {}

CXSourceRangeList *clang_getSkippedRanges(CXTranslationUnit TU, CXFile file) {}

CXSourceRangeList *clang_getAllSkippedRanges(CXTranslationUnit TU) {}

void clang_disposeSourceRangeList(CXSourceRangeList *ranges) {}

void clang::PrintLibclangResourceUsage(CXTranslationUnit TU) {}

CXCursor clang_Cursor_getVarDeclInitializer(CXCursor cursor) {}

int clang_Cursor_hasVarDeclGlobalStorage(CXCursor cursor) {}

int clang_Cursor_hasVarDeclExternalStorage(CXCursor cursor) {}

//===----------------------------------------------------------------------===//
// Misc. utility functions.
//===----------------------------------------------------------------------===//

/// Default to using our desired 8 MB stack size on "safety" threads.
static unsigned SafetyStackThreadSize =;

namespace clang {

bool RunSafely(llvm::CrashRecoveryContext &CRC, llvm::function_ref<void()> Fn,
               unsigned Size) {}

unsigned GetSafetyThreadStackSize() {}

void SetSafetyThreadStackSize(unsigned Value) {}

} // namespace clang

void clang::setThreadBackgroundPriority() {}

void cxindex::printDiagsToStderr(ASTUnit *Unit) {}

MacroInfo *cxindex::getMacroInfo(const IdentifierInfo &II,
                                 SourceLocation MacroDefLoc,
                                 CXTranslationUnit TU) {}

const MacroInfo *cxindex::getMacroInfo(const MacroDefinitionRecord *MacroDef,
                                       CXTranslationUnit TU) {}

MacroDefinitionRecord *
cxindex::checkForMacroInMacroDefinition(const MacroInfo *MI, const Token &Tok,
                                        CXTranslationUnit TU) {}

MacroDefinitionRecord *
cxindex::checkForMacroInMacroDefinition(const MacroInfo *MI, SourceLocation Loc,
                                        CXTranslationUnit TU) {}

CXString clang_getClangVersion() {}

Logger &cxindex::Logger::operator<<(CXTranslationUnit TU) {}

Logger &cxindex::Logger::operator<<(FileEntryRef FE) {}

Logger &cxindex::Logger::operator<<(CXCursor cursor) {}

Logger &cxindex::Logger::operator<<(CXSourceLocation Loc) {}

Logger &cxindex::Logger::operator<<(CXSourceRange range) {}

Logger &cxindex::Logger::operator<<(CXString Str) {}

Logger &cxindex::Logger::operator<<(const llvm::format_object_base &Fmt) {}

static llvm::ManagedStatic<std::mutex> LoggingMutex;

cxindex::Logger::~Logger() {}

CXString clang_getBinaryOperatorKindSpelling(enum CXBinaryOperatorKind kind) {}

enum CXBinaryOperatorKind clang_getCursorBinaryOperatorKind(CXCursor cursor) {}

CXString clang_getUnaryOperatorKindSpelling(enum CXUnaryOperatorKind kind) {}

enum CXUnaryOperatorKind clang_getCursorUnaryOperatorKind(CXCursor cursor) {}