clang
9.0.0
|
#include "clang/AST/DeclBase.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/ASTMutationListener.h"
#include "clang/AST/Attr.h"
#include "clang/AST/AttrIterator.h"
#include "clang/AST/Decl.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/DeclContextInternals.h"
#include "clang/AST/DeclFriend.h"
#include "clang/AST/DeclObjC.h"
#include "clang/AST/DeclOpenMP.h"
#include "clang/AST/DeclTemplate.h"
#include "clang/AST/DependentDiagnostic.h"
#include "clang/AST/ExternalASTSource.h"
#include "clang/AST/Stmt.h"
#include "clang/AST/Type.h"
#include "clang/Basic/IdentifierTable.h"
#include "clang/Basic/LLVM.h"
#include "clang/Basic/LangOptions.h"
#include "clang/Basic/ObjCRuntime.h"
#include "clang/Basic/PartialDiagnostic.h"
#include "clang/Basic/SourceLocation.h"
#include "clang/Basic/TargetInfo.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/PointerIntPair.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Casting.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 #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_CONTEXT_BASE(NAME) |
#define | DECL(NAME, BASE) |
#define | DECL_CONTEXT_BASE(NAME) |
#define | DECL(NAME, BASE) |
#define | DECL_CONTEXT(NAME) |
#define | DECL_CONTEXT_BASE(NAME) |
#define | DECL(NAME, BASE) |
#define | DECL_CONTEXT_BASE(NAME) |
#define | DECL(NAME, BASE) |
#define | DECL_CONTEXT(NAME) case Decl::NAME: |
#define | DECL_CONTEXT_BASE(NAME) |
#define | DECL(NAME, BASE) |
#define | DECL_CONTEXT_BASE(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. More... | |
static Decl::Kind | getKind (const Decl *D) |
static Decl::Kind | getKind (const DeclContext *DC) |
template<class T > | |
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.). More... | |
static bool | isLinkageSpecContext (const DeclContext *DC, LinkageSpecDecl::LanguageIDs ID) |
static bool | shouldBeHidden (NamedDecl *D) |
shouldBeHidden - Determine whether a declaration which was declared within its semantic context should be invisible to qualified name lookup. More... | |
#define ABSTRACT_DECL | ( | DECL | ) |
Definition at line 69 of file DeclBase.cpp.
#define ABSTRACT_DECL | ( | DECL | ) |
Definition at line 69 of file DeclBase.cpp.
#define ABSTRACT_DECL | ( | DECL | ) |
Definition at line 69 of file DeclBase.cpp.
#define ABSTRACT_DECL | ( | DECL | ) |
Definition at line 69 of file DeclBase.cpp.
#define ABSTRACT_DECL | ( | DECL | ) |
Definition at line 69 of file DeclBase.cpp.
#define ABSTRACT_DECL | ( | DECL | ) |
Definition at line 69 of file DeclBase.cpp.
#define ABSTRACT_DECL | ( | DECL | ) |
Definition at line 69 of file DeclBase.cpp.
#define DECL | ( | DERIVED, | |
BASE | |||
) | static int n##DERIVED##s = 0; |
Definition at line 66 of file DeclBase.cpp.
#define DECL | ( | DERIVED, | |
BASE | |||
) |
Definition at line 66 of file DeclBase.cpp.
#define DECL | ( | DERIVED, | |
BASE | |||
) | case DERIVED: return #DERIVED; |
Definition at line 66 of file DeclBase.cpp.
#define DECL | ( | DERIVED, | |
BASE | |||
) | case Decl::DERIVED: return #DERIVED; |
Definition at line 66 of file DeclBase.cpp.
#define DECL | ( | DERIVED, | |
BASE | |||
) | totalDecls += n##DERIVED##s; |
Definition at line 66 of file DeclBase.cpp.
#define DECL | ( | DERIVED, | |
BASE | |||
) |
Definition at line 66 of file DeclBase.cpp.
#define DECL | ( | DERIVED, | |
BASE | |||
) | case DERIVED: ++n##DERIVED##s; break; |
Definition at line 66 of file DeclBase.cpp.
#define DECL | ( | NAME, | |
BASE | |||
) |
Definition at line 66 of file DeclBase.cpp.
#define DECL | ( | NAME, | |
BASE | |||
) |
Definition at line 66 of file DeclBase.cpp.
#define DECL | ( | NAME, | |
BASE | |||
) |
Definition at line 66 of file DeclBase.cpp.
#define DECL | ( | NAME, | |
BASE | |||
) |
Definition at line 66 of file DeclBase.cpp.
#define DECL | ( | NAME, | |
BASE | |||
) |
Definition at line 66 of file DeclBase.cpp.
#define DECL | ( | NAME, | |
BASE | |||
) |
Definition at line 66 of file DeclBase.cpp.
#define DECL_CONTEXT | ( | NAME | ) |
#define DECL_CONTEXT | ( | NAME | ) |
#define DECL_CONTEXT | ( | NAME | ) | case Decl::NAME: |
#define DECL_CONTEXT_BASE | ( | NAME | ) |
#define DECL_CONTEXT_BASE | ( | NAME | ) |
#define DECL_CONTEXT_BASE | ( | NAME | ) |
#define DECL_CONTEXT_BASE | ( | NAME | ) |
#define DECL_CONTEXT_BASE | ( | NAME | ) |
#define DECL_CONTEXT_BASE | ( | NAME | ) |
|
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 489 of file DeclBase.cpp.
Referenced by clang::Decl::getAvailability(), and clang::Decl::isWeakImported().
|
static |
Definition at line 944 of file DeclBase.cpp.
References clang::Decl::getKind().
Referenced by clang::InitializedEntity::allowsNRVO(), clang::ParsedAttr::asOpenCLLangAS(), clang::Type::canHaveNullability(), CheckNonTypeTemplatePartialSpecializationArgs(), clang::ento::CallEvent::cloneWithState(), clang::CodeGen::CodeGenTypes::ConvertType(), clang::NamedDecl::declarationReplaces(), clang::MacroDirective::dump(), clang::ento::CoreEngine::enqueueStmtNode(), clang::OffsetOfNode::getArrayExprIndex(), clang::TemplateArgument::getAsDecl(), clang::TemplateArgument::getAsExpr(), clang::TemplateArgument::getAsIntegral(), clang::TemplateArgument::getAsTemplate(), clang::TemplateArgument::getAsTemplateOrTemplatePattern(), clang::TemplateArgument::getAsType(), clang::ParsedAttr::getAvailabilityDeprecated(), clang::ParsedAttr::getAvailabilityIntroduced(), clang::ParsedAttr::getAvailabilityObsoleted(), clang::OffsetOfNode::getBase(), clang::driver::Action::getClassName(), clang::InitializedEntity::getDecl(), clang::CFGImplicitDtor::getDestructorDecl(), clang::ento::CallEvent::getExtraInvalidatedValues(), clang::OffsetOfNode::getField(), clang::OffsetOfNode::getFieldName(), clang::CodeCompleteConsumer::OverloadCandidate::getFunction(), clang::TemplateArgument::getIntegralType(), clang::ParsedAttr::getKind(), clang::ImplicitConversionSequence::getKindRank(), clang::ParsedAttr::getLayoutCompatible(), clang::StringLiteral::getLocationOfByte(), clang::ParsedAttr::getMatchingCType(), getMaxAtomicAccessSize(), clang::ParsedAttr::getMessageExpr(), clang::ParsedAttr::getMustBeNull(), clang::InitializedEntity::getName(), clang::BuiltinType::getName(), clang::TemplateArgument::getNullPtrType(), clang::TemplateArgument::getPackAsArray(), clang::TemplateArgument::getParamTypeForDecl(), clang::ParsedAttr::getReplacementExpr(), clang::analyze_format_string::ConversionSpecifier::getStandardSpecifier(), clang::ParsedAttr::getStrictLoc(), clang::ASTContext::getTypeInfo(), clang::ParsedAttr::getUnavailableLoc(), clang::NamedDecl::getUnderlyingDecl(), clang::TemplateSpecializationTypeLoc::initializeArgLocs(), clang::ParsedAttr::isAlignasAttribute(), clang::ImplicitConversionSequence::isAmbiguous(), clang::StringLiteral::isAscii(), clang::ImplicitConversionSequence::isBad(), clang::DeclGroupRef::isDeclGroup(), clang::ImplicitConversionSequence::isEllipsis(), clang::VarDecl::isFileVarDecl(), clang::BuiltinType::isFloatingPoint(), clang::VarDecl::isFunctionOrMethodVarDecl(), clang::BuiltinType::isInteger(), clang::VarDecl::isLocalVarDecl(), clang::VarDecl::isLocalVarDeclOrParm(), clang::BuiltinType::isNonOverloadPlaceholderType(), clang::TemplateArgument::isNull(), clang::BuiltinType::isPlaceholderType(), clang::ProgramPoint::isPurgeKind(), clang::BuiltinType::isSignedInteger(), clang::DeclGroupRef::isSingleDecl(), clang::ImplicitConversionSequence::isStandard(), clang::VarDecl::isStaticDataMember(), isTypeSubstitutable(), clang::BuiltinType::isUnsignedInteger(), clang::ImplicitConversionSequence::isUserDefined(), clang::StringLiteral::isUTF16(), clang::StringLiteral::isUTF32(), clang::StringLiteral::isUTF8(), isValidAfterIdentifierInDeclarator(), clang::StringLiteral::isWide(), clang::ast_matchers::dynamic::internal::makeMatcherAutoMarshall(), MatchTwoAttributeLists(), clang::CodeGen::EHScopeStack::iterator::operator++(), clang::StringLiteral::outputString(), clang::PrecompiledPreamble::OverridePreamble(), clang::TemplateArgument::pack_begin(), clang::TemplateArgument::pack_end(), clang::TemplateArgument::pack_size(), clang::Parser::ParseTopLevelDecl(), clang::ento::retaincountchecker::RefVal::print(), printExprAsWritten(), PrintFloatingLiteral(), clang::ProgramPoint::Profile(), clang::ento::MemSpaceRegion::Profile(), clang::ento::StaticGlobalSpaceRegion::Profile(), clang::ento::StackSpaceRegion::Profile(), clang::ento::DeclRegion::Profile(), clang::ProgramPoint::ProgramPoint(), clang::TemplateArgument::setIntegralType(), sumOffsets(), clang::ast_matchers::dynamic::internal::variadicMatcherDescriptor(), and clang::ProgramPoint::withTag().
|
static |
Definition at line 945 of file DeclBase.cpp.
References clang::DeclContext::getDeclKind().
|
static |
Starting at a given context (a Decl or DeclContext), look for a code context that is not a closure (a lambda, block, etc.).
Definition at line 972 of file DeclBase.cpp.
References clang::Decl::getKind(), and clang::Decl::getNonClosureContext().
Referenced by clang::DeclContext::getNonClosureAncestor(), and clang::Decl::getNonClosureContext().
|
static |
Definition at line 467 of file DeclBase.cpp.
|
static |
Definition at line 1123 of file DeclBase.cpp.
References clang::DeclContext::getDeclKind(), and clang::DeclContext::getLexicalParent().
Referenced by clang::DeclContext::isExternCContext(), and clang::DeclContext::isExternCXXContext().
shouldBeHidden - Determine whether a declaration which was declared within its semantic context should be invisible to qualified name lookup.
Definition at line 1404 of file DeclBase.cpp.
References clang::Decl::getCanonicalDecl(), clang::NamedDecl::getDeclName(), clang::Decl::getFriendObjectKind(), clang::Decl::getIdentifierNamespace(), clang::Decl::isLocalExternDecl(), and clang::Decl::isTemplateParameter().
Referenced by clang::DeclContext::makeDeclVisibleInContext(), and clang::DeclContext::removeDecl().