#include #include #include #include #include #include "clang/AST/DeclNodes.inc"">

clang: lib/AST/DeclBase.cpp File Reference (original) (raw)

#include "[clang/AST/DeclBase.h](DeclBase%5F8h%5Fsource.html)"
#include "[clang/AST/ASTContext.h](ASTContext%5F8h%5Fsource.html)"
#include "[clang/AST/ASTLambda.h](ASTLambda%5F8h%5Fsource.html)"
#include "[clang/AST/ASTMutationListener.h](ASTMutationListener%5F8h%5Fsource.html)"
#include "[clang/AST/Attr.h](AST%5F2Attr%5F8h%5Fsource.html)"
#include "[clang/AST/AttrIterator.h](AttrIterator%5F8h%5Fsource.html)"
#include "[clang/AST/Decl.h](Decl%5F8h%5Fsource.html)"
#include "[clang/AST/DeclCXX.h](DeclCXX%5F8h%5Fsource.html)"
#include "[clang/AST/DeclContextInternals.h](DeclContextInternals%5F8h%5Fsource.html)"
#include "[clang/AST/DeclFriend.h](DeclFriend%5F8h%5Fsource.html)"
#include "[clang/AST/DeclObjC.h](DeclObjC%5F8h%5Fsource.html)"
#include "[clang/AST/DeclOpenMP.h](DeclOpenMP%5F8h%5Fsource.html)"
#include "[clang/AST/DeclTemplate.h](DeclTemplate%5F8h%5Fsource.html)"
#include "[clang/AST/DependentDiagnostic.h](DependentDiagnostic%5F8h%5Fsource.html)"
#include "[clang/AST/ExternalASTSource.h](ExternalASTSource%5F8h%5Fsource.html)"
#include "[clang/AST/Stmt.h](Stmt%5F8h%5Fsource.html)"
#include "[clang/AST/Type.h](Type%5F8h%5Fsource.html)"
#include "[clang/Basic/IdentifierTable.h](IdentifierTable%5F8h%5Fsource.html)"
#include "[clang/Basic/LLVM.h](LLVM%5F8h%5Fsource.html)"
#include "[clang/Basic/Module.h](Module%5F8h%5Fsource.html)"
#include "[clang/Basic/ObjCRuntime.h](ObjCRuntime%5F8h%5Fsource.html)"
#include "[clang/Basic/PartialDiagnostic.h](PartialDiagnostic%5F8h%5Fsource.html)"
#include "[clang/Basic/SourceLocation.h](SourceLocation%5F8h%5Fsource.html)"
#include "[clang/Basic/TargetInfo.h](include%5F2clang%5F2Basic%5F2TargetInfo%5F8h%5Fsource.html)"
#include "llvm/ADT/PointerIntPair.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/VersionTuple.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <cassert>
#include <cstddef>
#include <string>
#include <tuple>
#include <utility>
#include "clang/AST/DeclNodes.inc"

Go to the source code of this file.

Macros
#define DECL(DERIVED, BASE) static int n##DERIVED##s = 0;
#define ABSTRACT_DECL(DECL)
#define DECL(DERIVED, BASE)
#define ABSTRACT_DECL(DECL)
#define DECL(DERIVED, BASE) case DERIVED: return #DERIVED;
#define ABSTRACT_DECL(DECL)
#define DECL(DERIVED, BASE) case Decl::DERIVED: return true;
#define ABSTRACT_DECL(DECL)
#define DECL(DERIVED, BASE) case Decl::DERIVED: return #DERIVED;
#define ABSTRACT_DECL(DECL)
#define DECL(DERIVED, BASE) totalDecls += n##DERIVED##s;
#define ABSTRACT_DECL(DECL)
#define DECL(DERIVED, BASE)
#define ABSTRACT_DECL(DECL)
#define DECL(DERIVED, BASE) case DERIVED: ++n##DERIVED##s; break;
#define ABSTRACT_DECL(DECL)
#define DECL(NAME, BASE)
#define DECL_CONTEXT(NAME)
#define DECL(NAME, BASE)
#define DECL_CONTEXT(NAME)
#define DECL(NAME, BASE)
#define DECL_CONTEXT(NAME) case Decl::NAME:
Functions
static StringRef getRealizedPlatform (const AvailabilityAttr *A, const ASTContext &Context)
static AvailabilityResult CheckAvailability (ASTContext &Context, const AvailabilityAttr *A, std::string *Message, VersionTuple EnclosingVersion)
Determine the availability of the given declaration based on the target platform.
static Decl::Kind getKind (const Decl *D)
static Decl::Kind getKind (const DeclContext *DC)
template
static Decl * getNonClosureContext (T *D)
Starting at a given context (a Decl or DeclContext), look for a code context that is not a closure (a lambda, block, etc.).
static bool isLinkageSpecContext (const DeclContext *DC, LinkageSpecLanguageIDs ID)
template
static void collectAllContextsImpl (T *Self, SmallVectorImpl< DeclContext * > &Contexts)
static bool shouldBeHidden (NamedDecl *D)
shouldBeHidden - Determine whether a declaration which was declared within its semantic context should be invisible to qualified name lookup.

ABSTRACT_DECL [1/8]

| #define ABSTRACT_DECL | ( | | DECL | ) | | ---------------------- | - | | ---------------------------------------------------------- | - |

ABSTRACT_DECL [2/8]

| #define ABSTRACT_DECL | ( | | DECL | ) | | ---------------------- | - | | ---------------------------------------------------------- | - |

ABSTRACT_DECL [3/8]

| #define ABSTRACT_DECL | ( | | DECL | ) | | ---------------------- | - | | ---------------------------------------------------------- | - |

ABSTRACT_DECL [4/8]

| #define ABSTRACT_DECL | ( | | DECL | ) | | ---------------------- | - | | ---------------------------------------------------------- | - |

ABSTRACT_DECL [5/8]

| #define ABSTRACT_DECL | ( | | DECL | ) | | ---------------------- | - | | ---------------------------------------------------------- | - |

ABSTRACT_DECL [6/8]

| #define ABSTRACT_DECL | ( | | DECL | ) | | ---------------------- | - | | ---------------------------------------------------------- | - |

ABSTRACT_DECL [7/8]

| #define ABSTRACT_DECL | ( | | DECL | ) | | ---------------------- | - | | ---------------------------------------------------------- | - |

ABSTRACT_DECL [8/8]

| #define ABSTRACT_DECL | ( | | DECL | ) | | ---------------------- | - | | ---------------------------------------------------------- | - |

DECL [1/11]

| #define DECL | ( | | DERIVED, | | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | -------- | | | BASE | | | | | ) | static int n##DERIVED##s = 0; | | |

DECL [2/11]

| #define DECL | ( | | DERIVED, | | ------------ | - | | -------- | | | BASE | | | | | ) | | | |

Value:

static_assert(alignof(Decl) >= alignof(DERIVED##Decl), \

"Alignment sufficient after objects prepended to " #DERIVED);

Decl - This represents one declaration (or definition), e.g.

Definition at line 64 of file DeclBase.cpp.

DECL [3/11]

| #define DECL | ( | | DERIVED, | | ------------ | ------------------------------------------------------------------------------------------- | | -------- | | | BASE | | | | | ) | case DERIVED: return #DERIVED; | | |

DECL [4/11]

| #define DECL | ( | | DERIVED, | | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------- | | -------- | | | BASE | | | | | ) | case Decl::DERIVED: return true; | | |

DECL [5/11]

| #define DECL | ( | | DERIVED, | | ------------ | ------------------------------------------------------------------------------------------------- | | -------- | | | BASE | | | | | ) | case Decl::DERIVED: return #DERIVED; | | |

DECL [6/11]

| #define DECL | ( | | DERIVED, | | ------------ | ----------------------------------------------------------------------------------------------------------------------------------- | | -------- | | | BASE | | | | | ) | totalDecls += n##DERIVED##s; | | |

DECL [7/11]

| #define DECL | ( | | DERIVED, | | ------------ | - | | -------- | | | BASE | | | | | ) | | | |

Value:

if (n##DERIVED##s > 0) { \

totalBytes += (int)(n##DERIVED##s * sizeof(DERIVED##Decl)); \

llvm::errs() << " " << n##DERIVED##s << " " #DERIVED " decls, " \

<< sizeof(DERIVED##Decl) << " each (" \

<< n##DERIVED##s * sizeof(DERIVED##Decl) \

<< " bytes)\n"; \

}

__device__ __2f16 float __ockl_bool s

Definition at line 64 of file DeclBase.cpp.

DECL [8/11]

| #define DECL | ( | | DERIVED, | | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------- | | -------- | | | BASE | | | | | ) | case DERIVED: ++n##DERIVED##s; break; | | |

DECL [9/11]

| #define DECL | ( | | NAME, | | ------------ | - | | ----- | | | BASE | | | | | ) | | | |

DECL [10/11]

| #define DECL | ( | | NAME, | | ------------ | - | | ----- | | | BASE | | | | | ) | | | |

DECL [11/11]

| #define DECL | ( | | NAME, | | ------------ | - | | ----- | | | BASE | | | | | ) | | | |

DECL_CONTEXT [1/3]

| #define DECL_CONTEXT | ( | | NAME | ) | | --------------------- | - | | ---- | - |

Value:

case Decl::NAME: \

DeclContext - This is used only as base class of specific decl types that can act as declaration cont...

DECL_CONTEXT [2/3]

| #define DECL_CONTEXT | ( | | NAME | ) | | --------------------- | - | | ---- | - |

Value:

case Decl::NAME: \

return static_cast<NAME##Decl *>(const_cast<Decl *>(D));

DECL_CONTEXT [3/3]

| #define DECL_CONTEXT | ( | | NAME | ) | case Decl::NAME: | | --------------------- | - | | ---- | - | ---------------- |

CheckAvailability()

static AvailabilityResult CheckAvailability ( ASTContext & Context, const AvailabilityAttr * A, std::string * Message, VersionTuple EnclosingVersion ) static

Determine the availability of the given declaration based on the target platform.

When it returns an availability result other than AR_Available, if the Message parameter is non-NULL, it will be set to a string describing why the entity is unavailable.

FIXME: Make these strings localizable, since they end up in diagnostics.

Definition at line 652 of file DeclBase.cpp.

References clang::AR_Available, clang::AR_Deprecated, clang::AR_NotYetIntroduced, clang::AR_Unavailable, clang::IdentifierInfo::getName(), clang::TargetInfo::getPlatformMinVersion(), clang::TargetInfo::getPlatformName(), getRealizedPlatform(), clang::ASTContext::getTargetInfo(), and clang::TargetInfo::getTriple().

Referenced by clang::Decl::getAvailability(), and clang::Decl::isWeakImported().

collectAllContextsImpl()

getKind() [1/2]

Definition at line 1180 of file DeclBase.cpp.

References D, and clang::Decl::getKind().

Referenced by clang::ParsedAttr::asSYCLLangAS(), clang::syntax::List::canBeEmpty(), CheckNonTypeTemplatePartialSpecializationArgs(), clang::CIRGen::CIRGenTypes::convertType(), clang::CodeGen::CodeGenTypes::ConvertType(), clang::Sema::DeduceAutoType(), clang::ento::NonLoc::dumpToStream(), clang::ento::Loc::dumpToStream(), clang::CodeGen::CodeGenModule::EmitVTableTypeMetadata(), clang::ento::CoreEngine::enqueueStmtNode(), EvaluateBuiltinClassifyType(), getCommonSugarTypeNode(), clang::syntax::List::getDelimiterTokenKind(), clang::CodeCompleteConsumer::OverloadCandidate::getFunction(), clang::ento::SVal::getKindStr(), getNonClosureContext(), clang::getSimplifiedTypeClass(), clang::syntax::List::getTerminationKind(), clang::TemplateSpecializationTypeLoc::initializeArgLocs(), clang::Declarator::isCtorOrDtor(), clang::BuiltinType::isFloatingPoint(), clang::BuiltinType::isInteger(), clang::BuiltinType::isNonOverloadPlaceholderType(), isObjCReceiverType(), clang::BuiltinType::isPlaceholderType(), clang::BuiltinType::isSignedInteger(), IsStructurallyEquivalent(), clang::BuiltinType::isSVEBool(), clang::BuiltinType::isSVECount(), clang::BuiltinType::isUnsignedInteger(), MatchTwoAttributeLists(), clang::CodeGen::EHScopeStack::iterator::operator++(), clang::Parser::ParseTopLevelDecl(), clang::ento::PathDiagnosticPiece::Profile(), and clang::DependentTypeOfExprType::Profile().

getKind() [2/2]

getNonClosureContext()

template

static Decl * getNonClosureContext ( T * D) static

getRealizedPlatform()

static StringRef getRealizedPlatform ( const AvailabilityAttr * A, const ASTContext & Context ) static

isLinkageSpecContext()

shouldBeHidden()