llvm/clang/lib/AST/Decl.cpp

//===- Decl.cpp - Declaration AST Node Implementation ---------------------===//
//
// 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 Decl subclasses.
//
//===----------------------------------------------------------------------===//

#include "clang/AST/Decl.h"
#include "Linkage.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/ASTDiagnostic.h"
#include "clang/AST/ASTLambda.h"
#include "clang/AST/ASTMutationListener.h"
#include "clang/AST/Attr.h"
#include "clang/AST/CanonicalType.h"
#include "clang/AST/DeclBase.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/DeclObjC.h"
#include "clang/AST/DeclOpenMP.h"
#include "clang/AST/DeclTemplate.h"
#include "clang/AST/DeclarationName.h"
#include "clang/AST/Expr.h"
#include "clang/AST/ExprCXX.h"
#include "clang/AST/ExternalASTSource.h"
#include "clang/AST/ODRHash.h"
#include "clang/AST/PrettyDeclStackTrace.h"
#include "clang/AST/PrettyPrinter.h"
#include "clang/AST/Randstruct.h"
#include "clang/AST/RecordLayout.h"
#include "clang/AST/Redeclarable.h"
#include "clang/AST/Stmt.h"
#include "clang/AST/TemplateBase.h"
#include "clang/AST/Type.h"
#include "clang/AST/TypeLoc.h"
#include "clang/Basic/Builtins.h"
#include "clang/Basic/IdentifierTable.h"
#include "clang/Basic/LLVM.h"
#include "clang/Basic/LangOptions.h"
#include "clang/Basic/Linkage.h"
#include "clang/Basic/Module.h"
#include "clang/Basic/NoSanitizeList.h"
#include "clang/Basic/PartialDiagnostic.h"
#include "clang/Basic/Sanitizers.h"
#include "clang/Basic/SourceLocation.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Basic/Specifiers.h"
#include "clang/Basic/TargetCXXABI.h"
#include "clang/Basic/TargetInfo.h"
#include "clang/Basic/Visibility.h"
#include "llvm/ADT/APSInt.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/TargetParser/Triple.h"
#include <algorithm>
#include <cassert>
#include <cstddef>
#include <cstring>
#include <memory>
#include <optional>
#include <string>
#include <tuple>
#include <type_traits>

usingnamespaceclang;

Decl *clang::getPrimaryMergedDecl(Decl *D) {}

void PrettyDeclStackTraceEntry::print(raw_ostream &OS) const {}

// Defined here so that it can be inlined into its direct callers.
bool Decl::isOutOfLine() const {}

TranslationUnitDecl::TranslationUnitDecl(ASTContext &ctx)
    :{}

//===----------------------------------------------------------------------===//
// NamedDecl Implementation
//===----------------------------------------------------------------------===//

// Visibility rules aren't rigorously externally specified, but here
// are the basic principles behind what we implement:
//
// 1. An explicit visibility attribute is generally a direct expression
// of the user's intent and should be honored.  Only the innermost
// visibility attribute applies.  If no visibility attribute applies,
// global visibility settings are considered.
//
// 2. There is one caveat to the above: on or in a template pattern,
// an explicit visibility attribute is just a default rule, and
// visibility can be decreased by the visibility of template
// arguments.  But this, too, has an exception: an attribute on an
// explicit specialization or instantiation causes all the visibility
// restrictions of the template arguments to be ignored.
//
// 3. A variable that does not otherwise have explicit visibility can
// be restricted by the visibility of its type.
//
// 4. A visibility restriction is explicit if it comes from an
// attribute (or something like it), not a global visibility setting.
// When emitting a reference to an external symbol, visibility
// restrictions are ignored unless they are explicit.
//
// 5. When computing the visibility of a non-type, including a
// non-type member of a class, only non-type visibility restrictions
// are considered: the 'visibility' attribute, global value-visibility
// settings, and a few special cases like __private_extern.
//
// 6. When computing the visibility of a type, including a type member
// of a class, only type visibility restrictions are considered:
// the 'type_visibility' attribute and global type-visibility settings.
// However, a 'visibility' attribute counts as a 'type_visibility'
// attribute on any declaration that only has the former.
//
// The visibility of a "secondary" entity, like a template argument,
// is computed using the kind of that entity, not the kind of the
// primary entity for which we are computing visibility.  For example,
// the visibility of a specialization of either of these templates:
//   template <class T, bool (&compare)(T, X)> bool has_match(list<T>, X);
//   template <class T, bool (&compare)(T, X)> class matcher;
// is restricted according to the type visibility of the argument 'T',
// the type visibility of 'bool(&)(T,X)', and the value visibility of
// the argument function 'compare'.  That 'has_match' is a value
// and 'matcher' is a type only matters when looking for attributes
// and settings from the immediate context.

/// Does this computation kind permit us to consider additional
/// visibility settings from attributes and the like?
static bool hasExplicitVisibilityAlready(LVComputationKind computation) {}

/// Given an LVComputationKind, return one of the same type/value sort
/// that records that it already has explicit visibility.
static LVComputationKind
withExplicitVisibilityAlready(LVComputationKind Kind) {}

static std::optional<Visibility> getExplicitVisibility(const NamedDecl *D,
                                                       LVComputationKind kind) {}

/// Is the given declaration a "type" or a "value" for the purposes of
/// visibility computation?
static bool usesTypeVisibility(const NamedDecl *D) {}

/// Does the given declaration have member specialization information,
/// and if so, is it an explicit specialization?
template <class T>
static std::enable_if_t<!std::is_base_of_v<RedeclarableTemplateDecl, T>, bool>
isExplicitMemberSpecialization(const T *D) {}

/// For templates, this question is easier: a member template can't be
/// explicitly instantiated, so there's a single bit indicating whether
/// or not this is an explicit member specialization.
static bool isExplicitMemberSpecialization(const RedeclarableTemplateDecl *D) {}

/// Given a visibility attribute, return the explicit visibility
/// associated with it.
template <class T>
static Visibility getVisibilityFromAttr(const T *attr) {}

/// Return the explicit visibility of the given declaration.
static std::optional<Visibility>
getVisibilityOf(const NamedDecl *D, NamedDecl::ExplicitVisibilityKind kind) {}

LinkageInfo LinkageComputer::getLVForType(const Type &T,
                                          LVComputationKind computation) {}

/// Get the most restrictive linkage for the types in the given
/// template parameter list.  For visibility purposes, template
/// parameters are part of the signature of a template.
LinkageInfo LinkageComputer::getLVForTemplateParameterList(
    const TemplateParameterList *Params, LVComputationKind computation) {}

static const Decl *getOutermostFuncOrBlockContext(const Decl *D) {}

/// Get the most restrictive linkage for the types and
/// declarations in the given template argument list.
///
/// Note that we don't take an LVComputationKind because we always
/// want to honor the visibility of template arguments in the same way.
LinkageInfo
LinkageComputer::getLVForTemplateArgumentList(ArrayRef<TemplateArgument> Args,
                                              LVComputationKind computation) {}

LinkageInfo
LinkageComputer::getLVForTemplateArgumentList(const TemplateArgumentList &TArgs,
                                              LVComputationKind computation) {}

static bool shouldConsiderTemplateVisibility(const FunctionDecl *fn,
                        const FunctionTemplateSpecializationInfo *specInfo) {}

/// Merge in template-related linkage and visibility for the given
/// function template specialization.
///
/// We don't need a computation kind here because we can assume
/// LVForValue.
///
/// \param[out] LV the computation to use for the parent
void LinkageComputer::mergeTemplateLV(
    LinkageInfo &LV, const FunctionDecl *fn,
    const FunctionTemplateSpecializationInfo *specInfo,
    LVComputationKind computation) {}

/// Does the given declaration have a direct visibility attribute
/// that would match the given rules?
static bool hasDirectVisibilityAttribute(const NamedDecl *D,
                                         LVComputationKind computation) {}

/// Should we consider visibility associated with the template
/// arguments and parameters of the given class template specialization?
static bool shouldConsiderTemplateVisibility(
                                 const ClassTemplateSpecializationDecl *spec,
                                 LVComputationKind computation) {}

/// Merge in template-related linkage and visibility for the given
/// class template specialization.
void LinkageComputer::mergeTemplateLV(
    LinkageInfo &LV, const ClassTemplateSpecializationDecl *spec,
    LVComputationKind computation) {}

/// Should we consider visibility associated with the template
/// arguments and parameters of the given variable template
/// specialization? As usual, follow class template specialization
/// logic up to initialization.
static bool shouldConsiderTemplateVisibility(
                                 const VarTemplateSpecializationDecl *spec,
                                 LVComputationKind computation) {}

/// Merge in template-related linkage and visibility for the given
/// variable template specialization. As usual, follow class template
/// specialization logic up to initialization.
void LinkageComputer::mergeTemplateLV(LinkageInfo &LV,
                                      const VarTemplateSpecializationDecl *spec,
                                      LVComputationKind computation) {}

static bool useInlineVisibilityHidden(const NamedDecl *D) {}

template <typename T> static bool isFirstInExternCContext(T *D) {}

static bool isSingleLineLanguageLinkage(const Decl &D) {}

static LinkageInfo getExternalLinkageFor(const NamedDecl *D) {}

static StorageClass getStorageClass(const Decl *D) {}

LinkageInfo
LinkageComputer::getLVForNamespaceScopeDecl(const NamedDecl *D,
                                            LVComputationKind computation,
                                            bool IgnoreVarTypeLinkage) {}

LinkageInfo
LinkageComputer::getLVForClassMember(const NamedDecl *D,
                                     LVComputationKind computation,
                                     bool IgnoreVarTypeLinkage) {}

void NamedDecl::anchor() {}

bool NamedDecl::isLinkageValid() const {}

bool NamedDecl::isPlaceholderVar(const LangOptions &LangOpts) const {}

ReservedIdentifierStatus
NamedDecl::isReserved(const LangOptions &LangOpts) const {}

ObjCStringFormatFamily NamedDecl::getObjCFStringFormattingFamily() const {}

Linkage NamedDecl::getLinkageInternal() const {}

static bool isExportedFromModuleInterfaceUnit(const NamedDecl *D) {}

/// Get the linkage from a semantic point of view. Entities in
/// anonymous namespaces are external (in c++98).
Linkage NamedDecl::getFormalLinkage() const {}

LinkageInfo NamedDecl::getLinkageAndVisibility() const {}

static std::optional<Visibility>
getExplicitVisibilityAux(const NamedDecl *ND,
                         NamedDecl::ExplicitVisibilityKind kind,
                         bool IsMostRecent) {}

std::optional<Visibility>
NamedDecl::getExplicitVisibility(ExplicitVisibilityKind kind) const {}

LinkageInfo LinkageComputer::getLVForClosure(const DeclContext *DC,
                                             Decl *ContextDecl,
                                             LVComputationKind computation) {}

LinkageInfo LinkageComputer::getLVForLocalDecl(const NamedDecl *D,
                                               LVComputationKind computation) {}

LinkageInfo LinkageComputer::computeLVForDecl(const NamedDecl *D,
                                              LVComputationKind computation,
                                              bool IgnoreVarTypeLinkage) {}

/// getLVForDecl - Get the linkage and visibility for the given declaration.
LinkageInfo LinkageComputer::getLVForDecl(const NamedDecl *D,
                                          LVComputationKind computation) {}

LinkageInfo LinkageComputer::getDeclLinkageAndVisibility(const NamedDecl *D) {}

Module *Decl::getOwningModuleForLinkage() const {}

void NamedDecl::printName(raw_ostream &OS, const PrintingPolicy &Policy) const {}

void NamedDecl::printName(raw_ostream &OS) const {}

std::string NamedDecl::getQualifiedNameAsString() const {}

void NamedDecl::printQualifiedName(raw_ostream &OS) const {}

void NamedDecl::printQualifiedName(raw_ostream &OS,
                                   const PrintingPolicy &P) const {}

void NamedDecl::printNestedNameSpecifier(raw_ostream &OS) const {}

void NamedDecl::printNestedNameSpecifier(raw_ostream &OS,
                                         const PrintingPolicy &P) const {}

void NamedDecl::getNameForDiagnostic(raw_ostream &OS,
                                     const PrintingPolicy &Policy,
                                     bool Qualified) const {}

template<typename T> static bool isRedeclarableImpl(Redeclarable<T> *) {}
static bool isRedeclarableImpl(...) {}
static bool isRedeclarable(Decl::Kind K) {}

bool NamedDecl::declarationReplaces(const NamedDecl *OldD,
                                    bool IsKnownNewer) const {}

bool NamedDecl::hasLinkage() const {}

NamedDecl *NamedDecl::getUnderlyingDeclImpl() {}

bool NamedDecl::isCXXInstanceMember() const {}

//===----------------------------------------------------------------------===//
// DeclaratorDecl Implementation
//===----------------------------------------------------------------------===//

template <typename DeclT>
static SourceLocation getTemplateOrInnerLocStart(const DeclT *decl) {}

SourceLocation DeclaratorDecl::getTypeSpecStartLoc() const {}

SourceLocation DeclaratorDecl::getTypeSpecEndLoc() const {}

void DeclaratorDecl::setQualifierInfo(NestedNameSpecifierLoc QualifierLoc) {}

void DeclaratorDecl::setTrailingRequiresClause(Expr *TrailingRequiresClause) {}

void DeclaratorDecl::setTemplateParameterListsInfo(
    ASTContext &Context, ArrayRef<TemplateParameterList *> TPLists) {}

SourceLocation DeclaratorDecl::getOuterLocStart() const {}

// Helper function: returns true if QT is or contains a type
// having a postfix component.
static bool typeIsPostfix(QualType QT) {}

SourceRange DeclaratorDecl::getSourceRange() const {}

void QualifierInfo::setTemplateParameterListsInfo(
    ASTContext &Context, ArrayRef<TemplateParameterList *> TPLists) {}

//===----------------------------------------------------------------------===//
// VarDecl Implementation
//===----------------------------------------------------------------------===//

const char *VarDecl::getStorageClassSpecifierString(StorageClass SC) {}

VarDecl::VarDecl(Kind DK, ASTContext &C, DeclContext *DC,
                 SourceLocation StartLoc, SourceLocation IdLoc,
                 const IdentifierInfo *Id, QualType T, TypeSourceInfo *TInfo,
                 StorageClass SC)
    :{}

VarDecl *VarDecl::Create(ASTContext &C, DeclContext *DC, SourceLocation StartL,
                         SourceLocation IdL, const IdentifierInfo *Id,
                         QualType T, TypeSourceInfo *TInfo, StorageClass S) {}

VarDecl *VarDecl::CreateDeserialized(ASTContext &C, GlobalDeclID ID) {}

void VarDecl::setStorageClass(StorageClass SC) {}

VarDecl::TLSKind VarDecl::getTLSKind() const {}

SourceRange VarDecl::getSourceRange() const {}

template<typename T>
static LanguageLinkage getDeclLanguageLinkage(const T &D) {}

template<typename T>
static bool isDeclExternC(const T &D) {}

LanguageLinkage VarDecl::getLanguageLinkage() const {}

bool VarDecl::isExternC() const {}

bool VarDecl::isInExternCContext() const {}

bool VarDecl::isInExternCXXContext() const {}

VarDecl *VarDecl::getCanonicalDecl() {}

VarDecl::DefinitionKind
VarDecl::isThisDeclarationADefinition(ASTContext &C) const {}

VarDecl *VarDecl::getActingDefinition() {}

VarDecl *VarDecl::getDefinition(ASTContext &C) {}

VarDecl::DefinitionKind VarDecl::hasDefinition(ASTContext &C) const {}

const Expr *VarDecl::getAnyInitializer(const VarDecl *&D) const {}

bool VarDecl::hasInit() const {}

Expr *VarDecl::getInit() {}

Stmt **VarDecl::getInitAddress() {}

VarDecl *VarDecl::getInitializingDeclaration() {}

bool VarDecl::isOutOfLine() const {}

void VarDecl::setInit(Expr *I) {}

bool VarDecl::mightBeUsableInConstantExpressions(const ASTContext &C) const {}

bool VarDecl::isUsableInConstantExpressions(const ASTContext &Context) const {}

/// Convert the initializer for this declaration to the elaborated EvaluatedStmt
/// form, which contains extra information on the evaluated value of the
/// initializer.
EvaluatedStmt *VarDecl::ensureEvaluatedStmt() const {}

EvaluatedStmt *VarDecl::getEvaluatedStmt() const {}

APValue *VarDecl::evaluateValue() const {}

APValue *VarDecl::evaluateValueImpl(SmallVectorImpl<PartialDiagnosticAt> &Notes,
                                    bool IsConstantInitialization) const {}

APValue *VarDecl::getEvaluatedValue() const {}

bool VarDecl::hasICEInitializer(const ASTContext &Context) const {}

bool VarDecl::hasConstantInitialization() const {}

bool VarDecl::checkForConstantInitialization(
    SmallVectorImpl<PartialDiagnosticAt> &Notes) const {}

bool VarDecl::isParameterPack() const {}

template<typename DeclT>
static DeclT *getDefinitionOrSelf(DeclT *D) {}

bool VarDecl::isEscapingByref() const {}

bool VarDecl::isNonEscapingByref() const {}

bool VarDecl::hasDependentAlignment() const {}

VarDecl *VarDecl::getTemplateInstantiationPattern() const {}

VarDecl *VarDecl::getInstantiatedFromStaticDataMember() const {}

TemplateSpecializationKind VarDecl::getTemplateSpecializationKind() const {}

TemplateSpecializationKind
VarDecl::getTemplateSpecializationKindForInstantiation() const {}

SourceLocation VarDecl::getPointOfInstantiation() const {}

VarTemplateDecl *VarDecl::getDescribedVarTemplate() const {}

void VarDecl::setDescribedVarTemplate(VarTemplateDecl *Template) {}

bool VarDecl::isKnownToBeDefined() const {}

bool VarDecl::isNoDestroy(const ASTContext &Ctx) const {}

QualType::DestructionKind
VarDecl::needsDestruction(const ASTContext &Ctx) const {}

bool VarDecl::hasFlexibleArrayInit(const ASTContext &Ctx) const {}

CharUnits VarDecl::getFlexibleArrayInitChars(const ASTContext &Ctx) const {}

MemberSpecializationInfo *VarDecl::getMemberSpecializationInfo() const {}

void VarDecl::setTemplateSpecializationKind(TemplateSpecializationKind TSK,
                                         SourceLocation PointOfInstantiation) {}

void
VarDecl::setInstantiationOfStaticDataMember(VarDecl *VD,
                                            TemplateSpecializationKind TSK) {}

//===----------------------------------------------------------------------===//
// ParmVarDecl Implementation
//===----------------------------------------------------------------------===//

ParmVarDecl *ParmVarDecl::Create(ASTContext &C, DeclContext *DC,
                                 SourceLocation StartLoc, SourceLocation IdLoc,
                                 const IdentifierInfo *Id, QualType T,
                                 TypeSourceInfo *TInfo, StorageClass S,
                                 Expr *DefArg) {}

QualType ParmVarDecl::getOriginalType() const {}

ParmVarDecl *ParmVarDecl::CreateDeserialized(ASTContext &C, GlobalDeclID ID) {}

SourceRange ParmVarDecl::getSourceRange() const {}

bool ParmVarDecl::isDestroyedInCallee() const {}

Expr *ParmVarDecl::getDefaultArg() {}

void ParmVarDecl::setDefaultArg(Expr *defarg) {}

SourceRange ParmVarDecl::getDefaultArgRange() const {}

void ParmVarDecl::setUninstantiatedDefaultArg(Expr *arg) {}

Expr *ParmVarDecl::getUninstantiatedDefaultArg() {}

bool ParmVarDecl::hasDefaultArg() const {}

void ParmVarDecl::setParameterIndexLarge(unsigned parameterIndex) {}

unsigned ParmVarDecl::getParameterIndexLarge() const {}

//===----------------------------------------------------------------------===//
// FunctionDecl Implementation
//===----------------------------------------------------------------------===//

FunctionDecl::FunctionDecl(Kind DK, ASTContext &C, DeclContext *DC,
                           SourceLocation StartLoc,
                           const DeclarationNameInfo &NameInfo, QualType T,
                           TypeSourceInfo *TInfo, StorageClass S,
                           bool UsesFPIntrin, bool isInlineSpecified,
                           ConstexprSpecKind ConstexprKind,
                           Expr *TrailingRequiresClause)
    :{}

void FunctionDecl::getNameForDiagnostic(
    raw_ostream &OS, const PrintingPolicy &Policy, bool Qualified) const {}

bool FunctionDecl::isVariadic() const {}

FunctionDecl::DefaultedOrDeletedFunctionInfo *
FunctionDecl::DefaultedOrDeletedFunctionInfo::Create(
    ASTContext &Context, ArrayRef<DeclAccessPair> Lookups,
    StringLiteral *DeletedMessage) {}

void FunctionDecl::setDefaultedOrDeletedInfo(
    DefaultedOrDeletedFunctionInfo *Info) {}

void FunctionDecl::setDeletedAsWritten(bool D, StringLiteral *Message) {}

void FunctionDecl::DefaultedOrDeletedFunctionInfo::setDeletedMessage(
    StringLiteral *Message) {}

FunctionDecl::DefaultedOrDeletedFunctionInfo *
FunctionDecl::getDefalutedOrDeletedInfo() const {}

bool FunctionDecl::hasBody(const FunctionDecl *&Definition) const {}

bool FunctionDecl::hasTrivialBody() const {}

bool FunctionDecl::isThisDeclarationInstantiatedFromAFriendDefinition() const {}

bool FunctionDecl::isDefined(const FunctionDecl *&Definition,
                             bool CheckForPendingFriendDefinition) const {}

Stmt *FunctionDecl::getBody(const FunctionDecl *&Definition) const {}

void FunctionDecl::setBody(Stmt *B) {}

void FunctionDecl::setIsPureVirtual(bool P) {}

template<std::size_t Len>
static bool isNamed(const NamedDecl *ND, const char (&Str)[Len]) {}

bool FunctionDecl::isImmediateEscalating() const {}

bool FunctionDecl::isImmediateFunction() const {}

bool FunctionDecl::isMain() const {}

bool FunctionDecl::isMSVCRTEntryPoint() const {}

bool FunctionDecl::isReservedGlobalPlacementOperator() const {}

bool FunctionDecl::isReplaceableGlobalAllocationFunction(
    std::optional<unsigned> *AlignmentParam, bool *IsNothrow) const {}

bool FunctionDecl::isInlineBuiltinDeclaration() const {}

bool FunctionDecl::isDestroyingOperatorDelete() const {}

LanguageLinkage FunctionDecl::getLanguageLinkage() const {}

bool FunctionDecl::isExternC() const {}

bool FunctionDecl::isInExternCContext() const {}

bool FunctionDecl::isInExternCXXContext() const {}

bool FunctionDecl::isGlobal() const {}

bool FunctionDecl::isNoReturn() const {}

bool FunctionDecl::isMemberLikeConstrainedFriend() const {}

MultiVersionKind FunctionDecl::getMultiVersionKind() const {}

bool FunctionDecl::isCPUDispatchMultiVersion() const {}

bool FunctionDecl::isCPUSpecificMultiVersion() const {}

bool FunctionDecl::isTargetMultiVersion() const {}

bool FunctionDecl::isTargetMultiVersionDefault() const {}

bool FunctionDecl::isTargetClonesMultiVersion() const {}

bool FunctionDecl::isTargetVersionMultiVersion() const {}

void
FunctionDecl::setPreviousDeclaration(FunctionDecl *PrevDecl) {}

FunctionDecl *FunctionDecl::getCanonicalDecl() {}

/// Returns a value indicating whether this function corresponds to a builtin
/// function.
///
/// The function corresponds to a built-in function if it is declared at
/// translation scope or within an extern "C" block and its name matches with
/// the name of a builtin. The returned value will be 0 for functions that do
/// not correspond to a builtin, a value of type \c Builtin::ID if in the
/// target-independent range \c [1,Builtin::First), or a target-specific builtin
/// value.
///
/// \param ConsiderWrapperFunctions If true, we should consider wrapper
/// functions as their wrapped builtins. This shouldn't be done in general, but
/// it's useful in Sema to diagnose calls to wrappers based on their semantics.
unsigned FunctionDecl::getBuiltinID(bool ConsiderWrapperFunctions) const {}

/// getNumParams - Return the number of parameters this function must have
/// based on its FunctionType.  This is the length of the ParamInfo array
/// after it has been created.
unsigned FunctionDecl::getNumParams() const {}

void FunctionDecl::setParams(ASTContext &C,
                             ArrayRef<ParmVarDecl *> NewParamInfo) {}

/// getMinRequiredArguments - Returns the minimum number of arguments
/// needed to call this function. This may be fewer than the number of
/// function parameters, if some of the parameters have default
/// arguments (in C++) or are parameter packs (C++11).
unsigned FunctionDecl::getMinRequiredArguments() const {}

bool FunctionDecl::hasCXXExplicitFunctionObjectParameter() const {}

unsigned FunctionDecl::getNumNonObjectParams() const {}

unsigned FunctionDecl::getMinRequiredExplicitArguments() const {}

bool FunctionDecl::hasOneParamOrDefaultArgs() const {}

/// The combination of the extern and inline keywords under MSVC forces
/// the function to be required.
///
/// Note: This function assumes that we will only get called when isInlined()
/// would return true for this FunctionDecl.
bool FunctionDecl::isMSExternInline() const {}

static bool redeclForcesDefMSVC(const FunctionDecl *Redecl) {}

static bool RedeclForcesDefC99(const FunctionDecl *Redecl) {}

/// For a function declaration in C or C++, determine whether this
/// declaration causes the definition to be externally visible.
///
/// For instance, this determines if adding the current declaration to the set
/// of redeclarations of the given functions causes
/// isInlineDefinitionExternallyVisible to change from false to true.
bool FunctionDecl::doesDeclarationForceExternallyVisibleDefinition() const {}

FunctionTypeLoc FunctionDecl::getFunctionTypeLoc() const {}

SourceRange FunctionDecl::getReturnTypeSourceRange() const {}

SourceRange FunctionDecl::getParametersSourceRange() const {}

SourceRange FunctionDecl::getExceptionSpecSourceRange() const {}

/// For an inline function definition in C, or for a gnu_inline function
/// in C++, determine whether the definition will be externally visible.
///
/// Inline function definitions are always available for inlining optimizations.
/// However, depending on the language dialect, declaration specifiers, and
/// attributes, the definition of an inline function may or may not be
/// "externally" visible to other translation units in the program.
///
/// In C99, inline definitions are not externally visible by default. However,
/// if even one of the global-scope declarations is marked "extern inline", the
/// inline definition becomes externally visible (C99 6.7.4p6).
///
/// In GNU89 mode, or if the gnu_inline attribute is attached to the function
/// definition, we use the GNU semantics for inline, which are nearly the
/// opposite of C99 semantics. In particular, "inline" by itself will create
/// an externally visible symbol, but "extern inline" will not create an
/// externally visible symbol.
bool FunctionDecl::isInlineDefinitionExternallyVisible() const {}

/// getOverloadedOperator - Which C++ overloaded operator this
/// function represents, if any.
OverloadedOperatorKind FunctionDecl::getOverloadedOperator() const {}

/// getLiteralIdentifier - The literal suffix identifier this function
/// represents, if any.
const IdentifierInfo *FunctionDecl::getLiteralIdentifier() const {}

FunctionDecl::TemplatedKind FunctionDecl::getTemplatedKind() const {}

FunctionDecl *FunctionDecl::getInstantiatedFromMemberFunction() const {}

MemberSpecializationInfo *FunctionDecl::getMemberSpecializationInfo() const {}

void
FunctionDecl::setInstantiationOfMemberFunction(ASTContext &C,
                                               FunctionDecl *FD,
                                               TemplateSpecializationKind TSK) {}

FunctionTemplateDecl *FunctionDecl::getDescribedFunctionTemplate() const {}

void FunctionDecl::setDescribedFunctionTemplate(
    FunctionTemplateDecl *Template) {}

bool FunctionDecl::isFunctionTemplateSpecialization() const {}

void FunctionDecl::setInstantiatedFromDecl(FunctionDecl *FD) {}

FunctionDecl *FunctionDecl::getInstantiatedFromDecl() const {}

bool FunctionDecl::isImplicitlyInstantiable() const {}

bool FunctionDecl::isTemplateInstantiation() const {}

FunctionDecl *
FunctionDecl::getTemplateInstantiationPattern(bool ForDefinition) const {}

FunctionTemplateDecl *FunctionDecl::getPrimaryTemplate() const {}

FunctionTemplateSpecializationInfo *
FunctionDecl::getTemplateSpecializationInfo() const {}

const TemplateArgumentList *
FunctionDecl::getTemplateSpecializationArgs() const {}

const ASTTemplateArgumentListInfo *
FunctionDecl::getTemplateSpecializationArgsAsWritten() const {}

void FunctionDecl::setFunctionTemplateSpecialization(
    ASTContext &C, FunctionTemplateDecl *Template,
    TemplateArgumentList *TemplateArgs, void *InsertPos,
    TemplateSpecializationKind TSK,
    const TemplateArgumentListInfo *TemplateArgsAsWritten,
    SourceLocation PointOfInstantiation) {}

void FunctionDecl::setDependentTemplateSpecialization(
    ASTContext &Context, const UnresolvedSetImpl &Templates,
    const TemplateArgumentListInfo *TemplateArgs) {}

DependentFunctionTemplateSpecializationInfo *
FunctionDecl::getDependentSpecializationInfo() const {}

DependentFunctionTemplateSpecializationInfo *
DependentFunctionTemplateSpecializationInfo::Create(
    ASTContext &Context, const UnresolvedSetImpl &Candidates,
    const TemplateArgumentListInfo *TArgs) {}

DependentFunctionTemplateSpecializationInfo::
    DependentFunctionTemplateSpecializationInfo(
        const UnresolvedSetImpl &Candidates,
        const ASTTemplateArgumentListInfo *TemplateArgsWritten)
    :{}

TemplateSpecializationKind FunctionDecl::getTemplateSpecializationKind() const {}

TemplateSpecializationKind
FunctionDecl::getTemplateSpecializationKindForInstantiation() const {}

void
FunctionDecl::setTemplateSpecializationKind(TemplateSpecializationKind TSK,
                                          SourceLocation PointOfInstantiation) {}

SourceLocation FunctionDecl::getPointOfInstantiation() const {}

bool FunctionDecl::isOutOfLine() const {}

SourceRange FunctionDecl::getSourceRange() const {}

unsigned FunctionDecl::getMemoryFunctionKind() const {}

unsigned FunctionDecl::getODRHash() const {}

unsigned FunctionDecl::getODRHash() {}

//===----------------------------------------------------------------------===//
// FieldDecl Implementation
//===----------------------------------------------------------------------===//

FieldDecl *FieldDecl::Create(const ASTContext &C, DeclContext *DC,
                             SourceLocation StartLoc, SourceLocation IdLoc,
                             const IdentifierInfo *Id, QualType T,
                             TypeSourceInfo *TInfo, Expr *BW, bool Mutable,
                             InClassInitStyle InitStyle) {}

FieldDecl *FieldDecl::CreateDeserialized(ASTContext &C, GlobalDeclID ID) {}

bool FieldDecl::isAnonymousStructOrUnion() const {}

Expr *FieldDecl::getInClassInitializer() const {}

void FieldDecl::setInClassInitializer(Expr *NewInit) {}

void FieldDecl::setLazyInClassInitializer(LazyDeclStmtPtr NewInit) {}

unsigned FieldDecl::getBitWidthValue(const ASTContext &Ctx) const {}

bool FieldDecl::isZeroLengthBitField(const ASTContext &Ctx) const {}

bool FieldDecl::isZeroSize(const ASTContext &Ctx) const {}

bool FieldDecl::isPotentiallyOverlapping() const {}

unsigned FieldDecl::getFieldIndex() const {}

SourceRange FieldDecl::getSourceRange() const {}

void FieldDecl::setCapturedVLAType(const VariableArrayType *VLAType) {}

void FieldDecl::printName(raw_ostream &OS, const PrintingPolicy &Policy) const {}

const FieldDecl *FieldDecl::findCountedByField() const {}

//===----------------------------------------------------------------------===//
// TagDecl Implementation
//===----------------------------------------------------------------------===//

TagDecl::TagDecl(Kind DK, TagKind TK, const ASTContext &C, DeclContext *DC,
                 SourceLocation L, IdentifierInfo *Id, TagDecl *PrevDecl,
                 SourceLocation StartL)
    :{}

SourceLocation TagDecl::getOuterLocStart() const {}

SourceRange TagDecl::getSourceRange() const {}

TagDecl *TagDecl::getCanonicalDecl() {}

void TagDecl::setTypedefNameForAnonDecl(TypedefNameDecl *TDD) {}

void TagDecl::startDefinition() {}

void TagDecl::completeDefinition() {}

TagDecl *TagDecl::getDefinition() const {}

void TagDecl::setQualifierInfo(NestedNameSpecifierLoc QualifierLoc) {}

void TagDecl::printName(raw_ostream &OS, const PrintingPolicy &Policy) const {}

void TagDecl::setTemplateParameterListsInfo(
    ASTContext &Context, ArrayRef<TemplateParameterList *> TPLists) {}

//===----------------------------------------------------------------------===//
// EnumDecl Implementation
//===----------------------------------------------------------------------===//

EnumDecl::EnumDecl(ASTContext &C, DeclContext *DC, SourceLocation StartLoc,
                   SourceLocation IdLoc, IdentifierInfo *Id, EnumDecl *PrevDecl,
                   bool Scoped, bool ScopedUsingClassTag, bool Fixed)
    :{}

void EnumDecl::anchor() {}

EnumDecl *EnumDecl::Create(ASTContext &C, DeclContext *DC,
                           SourceLocation StartLoc, SourceLocation IdLoc,
                           IdentifierInfo *Id,
                           EnumDecl *PrevDecl, bool IsScoped,
                           bool IsScopedUsingClassTag, bool IsFixed) {}

EnumDecl *EnumDecl::CreateDeserialized(ASTContext &C, GlobalDeclID ID) {}

SourceRange EnumDecl::getIntegerTypeRange() const {}

void EnumDecl::completeDefinition(QualType NewType,
                                  QualType NewPromotionType,
                                  unsigned NumPositiveBits,
                                  unsigned NumNegativeBits) {}

bool EnumDecl::isClosed() const {}

bool EnumDecl::isClosedFlag() const {}

bool EnumDecl::isClosedNonFlag() const {}

TemplateSpecializationKind EnumDecl::getTemplateSpecializationKind() const {}

void EnumDecl::setTemplateSpecializationKind(TemplateSpecializationKind TSK,
                                         SourceLocation PointOfInstantiation) {}

EnumDecl *EnumDecl::getTemplateInstantiationPattern() const {}

EnumDecl *EnumDecl::getInstantiatedFromMemberEnum() const {}

void EnumDecl::setInstantiationOfMemberEnum(ASTContext &C, EnumDecl *ED,
                                            TemplateSpecializationKind TSK) {}

unsigned EnumDecl::getODRHash() {}

SourceRange EnumDecl::getSourceRange() const {}

void EnumDecl::getValueRange(llvm::APInt &Max, llvm::APInt &Min) const {}

//===----------------------------------------------------------------------===//
// RecordDecl Implementation
//===----------------------------------------------------------------------===//

RecordDecl::RecordDecl(Kind DK, TagKind TK, const ASTContext &C,
                       DeclContext *DC, SourceLocation StartLoc,
                       SourceLocation IdLoc, IdentifierInfo *Id,
                       RecordDecl *PrevDecl)
    :{}

RecordDecl *RecordDecl::Create(const ASTContext &C, TagKind TK, DeclContext *DC,
                               SourceLocation StartLoc, SourceLocation IdLoc,
                               IdentifierInfo *Id, RecordDecl* PrevDecl) {}

RecordDecl *RecordDecl::CreateDeserialized(const ASTContext &C,
                                           GlobalDeclID ID) {}

bool RecordDecl::isInjectedClassName() const {}

bool RecordDecl::isLambda() const {}

bool RecordDecl::isCapturedRecord() const {}

void RecordDecl::setCapturedRecord() {}

bool RecordDecl::isOrContainsUnion() const {}

RecordDecl::field_iterator RecordDecl::field_begin() const {}

/// completeDefinition - Notes that the definition of this type is now
/// complete.
void RecordDecl::completeDefinition() {}

/// isMsStruct - Get whether or not this record uses ms_struct layout.
/// This which can be turned on with an attribute, pragma, or the
/// -mms-bitfields command-line option.
bool RecordDecl::isMsStruct(const ASTContext &C) const {}

void RecordDecl::reorderDecls(const SmallVectorImpl<Decl *> &Decls) {}

void RecordDecl::LoadFieldsFromExternalStorage() const {}

bool RecordDecl::mayInsertExtraPadding(bool EmitRemark) const {}

const FieldDecl *RecordDecl::findFirstNamedDataMember() const {}

unsigned RecordDecl::getODRHash() {}

//===----------------------------------------------------------------------===//
// BlockDecl Implementation
//===----------------------------------------------------------------------===//

BlockDecl::BlockDecl(DeclContext *DC, SourceLocation CaretLoc)
    :{}

void BlockDecl::setParams(ArrayRef<ParmVarDecl *> NewParamInfo) {}

void BlockDecl::setCaptures(ASTContext &Context, ArrayRef<Capture> Captures,
                            bool CapturesCXXThis) {}

bool BlockDecl::capturesVariable(const VarDecl *variable) const {}

SourceRange BlockDecl::getSourceRange() const {}

//===----------------------------------------------------------------------===//
// Other Decl Allocation/Deallocation Method Implementations
//===----------------------------------------------------------------------===//

void TranslationUnitDecl::anchor() {}

TranslationUnitDecl *TranslationUnitDecl::Create(ASTContext &C) {}

void TranslationUnitDecl::setAnonymousNamespace(NamespaceDecl *D) {}

void PragmaCommentDecl::anchor() {}

PragmaCommentDecl *PragmaCommentDecl::Create(const ASTContext &C,
                                             TranslationUnitDecl *DC,
                                             SourceLocation CommentLoc,
                                             PragmaMSCommentKind CommentKind,
                                             StringRef Arg) {}

PragmaCommentDecl *PragmaCommentDecl::CreateDeserialized(ASTContext &C,
                                                         GlobalDeclID ID,
                                                         unsigned ArgSize) {}

void PragmaDetectMismatchDecl::anchor() {}

PragmaDetectMismatchDecl *
PragmaDetectMismatchDecl::Create(const ASTContext &C, TranslationUnitDecl *DC,
                                 SourceLocation Loc, StringRef Name,
                                 StringRef Value) {}

PragmaDetectMismatchDecl *
PragmaDetectMismatchDecl::CreateDeserialized(ASTContext &C, GlobalDeclID ID,
                                             unsigned NameValueSize) {}

void ExternCContextDecl::anchor() {}

ExternCContextDecl *ExternCContextDecl::Create(const ASTContext &C,
                                               TranslationUnitDecl *DC) {}

void LabelDecl::anchor() {}

LabelDecl *LabelDecl::Create(ASTContext &C, DeclContext *DC,
                             SourceLocation IdentL, IdentifierInfo *II) {}

LabelDecl *LabelDecl::Create(ASTContext &C, DeclContext *DC,
                             SourceLocation IdentL, IdentifierInfo *II,
                             SourceLocation GnuLabelL) {}

LabelDecl *LabelDecl::CreateDeserialized(ASTContext &C, GlobalDeclID ID) {}

void LabelDecl::setMSAsmLabel(StringRef Name) {}

void ValueDecl::anchor() {}

bool ValueDecl::isWeak() const {}

bool ValueDecl::isInitCapture() const {}

void ImplicitParamDecl::anchor() {}

ImplicitParamDecl *ImplicitParamDecl::Create(ASTContext &C, DeclContext *DC,
                                             SourceLocation IdLoc,
                                             IdentifierInfo *Id, QualType Type,
                                             ImplicitParamKind ParamKind) {}

ImplicitParamDecl *ImplicitParamDecl::Create(ASTContext &C, QualType Type,
                                             ImplicitParamKind ParamKind) {}

ImplicitParamDecl *ImplicitParamDecl::CreateDeserialized(ASTContext &C,
                                                         GlobalDeclID ID) {}

FunctionDecl *
FunctionDecl::Create(ASTContext &C, DeclContext *DC, SourceLocation StartLoc,
                     const DeclarationNameInfo &NameInfo, QualType T,
                     TypeSourceInfo *TInfo, StorageClass SC, bool UsesFPIntrin,
                     bool isInlineSpecified, bool hasWrittenPrototype,
                     ConstexprSpecKind ConstexprKind,
                     Expr *TrailingRequiresClause) {}

FunctionDecl *FunctionDecl::CreateDeserialized(ASTContext &C, GlobalDeclID ID) {}

BlockDecl *BlockDecl::Create(ASTContext &C, DeclContext *DC, SourceLocation L) {}

BlockDecl *BlockDecl::CreateDeserialized(ASTContext &C, GlobalDeclID ID) {}

CapturedDecl::CapturedDecl(DeclContext *DC, unsigned NumParams)
    :{}

CapturedDecl *CapturedDecl::Create(ASTContext &C, DeclContext *DC,
                                   unsigned NumParams) {}

CapturedDecl *CapturedDecl::CreateDeserialized(ASTContext &C, GlobalDeclID ID,
                                               unsigned NumParams) {}

Stmt *CapturedDecl::getBody() const {}
void CapturedDecl::setBody(Stmt *B) {}

bool CapturedDecl::isNothrow() const {}
void CapturedDecl::setNothrow(bool Nothrow) {}

EnumConstantDecl::EnumConstantDecl(const ASTContext &C, DeclContext *DC,
                                   SourceLocation L, IdentifierInfo *Id,
                                   QualType T, Expr *E, const llvm::APSInt &V)
    :{}

EnumConstantDecl *EnumConstantDecl::Create(ASTContext &C, EnumDecl *CD,
                                           SourceLocation L,
                                           IdentifierInfo *Id, QualType T,
                                           Expr *E, const llvm::APSInt &V) {}

EnumConstantDecl *EnumConstantDecl::CreateDeserialized(ASTContext &C,
                                                       GlobalDeclID ID) {}

void IndirectFieldDecl::anchor() {}

IndirectFieldDecl::IndirectFieldDecl(ASTContext &C, DeclContext *DC,
                                     SourceLocation L, DeclarationName N,
                                     QualType T,
                                     MutableArrayRef<NamedDecl *> CH)
    :{}

IndirectFieldDecl *
IndirectFieldDecl::Create(ASTContext &C, DeclContext *DC, SourceLocation L,
                          const IdentifierInfo *Id, QualType T,
                          llvm::MutableArrayRef<NamedDecl *> CH) {}

IndirectFieldDecl *IndirectFieldDecl::CreateDeserialized(ASTContext &C,
                                                         GlobalDeclID ID) {}

SourceRange EnumConstantDecl::getSourceRange() const {}

void TypeDecl::anchor() {}

TypedefDecl *TypedefDecl::Create(ASTContext &C, DeclContext *DC,
                                 SourceLocation StartLoc, SourceLocation IdLoc,
                                 const IdentifierInfo *Id,
                                 TypeSourceInfo *TInfo) {}

void TypedefNameDecl::anchor() {}

TagDecl *TypedefNameDecl::getAnonDeclWithTypedefName(bool AnyRedecl) const {}

bool TypedefNameDecl::isTransparentTagSlow() const {}

TypedefDecl *TypedefDecl::CreateDeserialized(ASTContext &C, GlobalDeclID ID) {}

TypeAliasDecl *TypeAliasDecl::Create(ASTContext &C, DeclContext *DC,
                                     SourceLocation StartLoc,
                                     SourceLocation IdLoc,
                                     const IdentifierInfo *Id,
                                     TypeSourceInfo *TInfo) {}

TypeAliasDecl *TypeAliasDecl::CreateDeserialized(ASTContext &C,
                                                 GlobalDeclID ID) {}

SourceRange TypedefDecl::getSourceRange() const {}

SourceRange TypeAliasDecl::getSourceRange() const {}

void FileScopeAsmDecl::anchor() {}

FileScopeAsmDecl *FileScopeAsmDecl::Create(ASTContext &C, DeclContext *DC,
                                           StringLiteral *Str,
                                           SourceLocation AsmLoc,
                                           SourceLocation RParenLoc) {}

FileScopeAsmDecl *FileScopeAsmDecl::CreateDeserialized(ASTContext &C,
                                                       GlobalDeclID ID) {}

void TopLevelStmtDecl::anchor() {}

TopLevelStmtDecl *TopLevelStmtDecl::Create(ASTContext &C, Stmt *Statement) {}

TopLevelStmtDecl *TopLevelStmtDecl::CreateDeserialized(ASTContext &C,
                                                       GlobalDeclID ID) {}

SourceRange TopLevelStmtDecl::getSourceRange() const {}

void TopLevelStmtDecl::setStmt(Stmt *S) {}

void EmptyDecl::anchor() {}

EmptyDecl *EmptyDecl::Create(ASTContext &C, DeclContext *DC, SourceLocation L) {}

EmptyDecl *EmptyDecl::CreateDeserialized(ASTContext &C, GlobalDeclID ID) {}

HLSLBufferDecl::HLSLBufferDecl(DeclContext *DC, bool CBuffer,
                               SourceLocation KwLoc, IdentifierInfo *ID,
                               SourceLocation IDLoc, SourceLocation LBrace)
    :{}

HLSLBufferDecl *HLSLBufferDecl::Create(ASTContext &C,
                                       DeclContext *LexicalParent, bool CBuffer,
                                       SourceLocation KwLoc, IdentifierInfo *ID,
                                       SourceLocation IDLoc,
                                       SourceLocation LBrace) {}

HLSLBufferDecl *HLSLBufferDecl::CreateDeserialized(ASTContext &C,
                                                   GlobalDeclID ID) {}

//===----------------------------------------------------------------------===//
// ImportDecl Implementation
//===----------------------------------------------------------------------===//

/// Retrieve the number of module identifiers needed to name the given
/// module.
static unsigned getNumModuleIdentifiers(Module *Mod) {}

ImportDecl::ImportDecl(DeclContext *DC, SourceLocation StartLoc,
                       Module *Imported,
                       ArrayRef<SourceLocation> IdentifierLocs)
    :{}

ImportDecl::ImportDecl(DeclContext *DC, SourceLocation StartLoc,
                       Module *Imported, SourceLocation EndLoc)
    :{}

ImportDecl *ImportDecl::Create(ASTContext &C, DeclContext *DC,
                               SourceLocation StartLoc, Module *Imported,
                               ArrayRef<SourceLocation> IdentifierLocs) {}

ImportDecl *ImportDecl::CreateImplicit(ASTContext &C, DeclContext *DC,
                                       SourceLocation StartLoc,
                                       Module *Imported,
                                       SourceLocation EndLoc) {}

ImportDecl *ImportDecl::CreateDeserialized(ASTContext &C, GlobalDeclID ID,
                                           unsigned NumLocations) {}

ArrayRef<SourceLocation> ImportDecl::getIdentifierLocs() const {}

SourceRange ImportDecl::getSourceRange() const {}

//===----------------------------------------------------------------------===//
// ExportDecl Implementation
//===----------------------------------------------------------------------===//

void ExportDecl::anchor() {}

ExportDecl *ExportDecl::Create(ASTContext &C, DeclContext *DC,
                               SourceLocation ExportLoc) {}

ExportDecl *ExportDecl::CreateDeserialized(ASTContext &C, GlobalDeclID ID) {}

bool clang::IsArmStreamingFunction(const FunctionDecl *FD,
                                   bool IncludeLocallyStreaming) {}