Lines Matching refs:Decl

10 //  This file defines the Decl and DeclContext interfaces.
70 /// Decl - This represents one declaration (or definition), e.g. a variable,
73 /// Note: There are objects tacked on before the *beginning* of Decl
74 /// (and its subclasses) in its Decl::operator new(). Proper alignment
77 class Decl {
79 /// \brief Alignment guaranteed when allocating Decl and any subtypes.
82 /// \brief Lists the kind of concrete classes of Decl.
108 /// Decl currently provides 15 bits of IDNS bits.
220 llvm::PointerIntPair<Decl *, 2, unsigned> NextInContextAndBits;
233 /// the DeclContext where the Decl was declared.
333 Decl(Kind DK, DeclContext *DC, SourceLocation L)
337 Access(AS_none), FromASTFile(0), Hidden(DC && cast<Decl>(DC)->Hidden),
344 Decl(Kind DK, EmptyShell Empty)
354 virtual ~Decl();
390 Decl *getNextDeclInContext() { return NextInContextAndBits.getPointer(); }
391 const Decl *getNextDeclInContext() const {return NextInContextAndBits.getPointer();}
399 return const_cast<Decl*>(this)->getDeclContext();
407 Decl *getNonClosureContext();
408 const Decl *getNonClosureContext() const {
409 return const_cast<Decl*>(this)->getNonClosureContext();
414 return const_cast<Decl*>(this)->getTranslationUnitDecl();
444 return const_cast<AttrVec&>(const_cast<const Decl*>(this)->getAttrs());
506 /// setInvalidDecl - Indicates the Decl had a semantic error. This
698 /// getLexicalDeclContext - The declaration context where this Decl was
714 return const_cast<Decl*>(this)->getLexicalDeclContext();
749 const_cast<const Decl*>(this)->getParentFunctionOrMethod());
753 virtual Decl *getCanonicalDecl() { return this; }
754 const Decl *getCanonicalDecl() const {
755 return const_cast<Decl*>(this)->getCanonicalDecl();
758 /// \brief Whether this particular Decl is a canonical one.
764 /// Decl subclasses that can be redeclared should override this method so that
765 /// Decl::redecl_iterator can iterate over them.
766 virtual Decl *getNextRedeclarationImpl() { return this; }
770 virtual Decl *getPreviousDeclImpl() { return nullptr; }
774 virtual Decl *getMostRecentDeclImpl() { return this; }
780 Decl *Current;
781 Decl *Starter;
784 typedef Decl *value_type;
791 explicit redecl_iterator(Decl *C) : Current(C), Starter(C) { }
799 Decl *Next = Current->getNextRedeclarationImpl();
828 return redecl_iterator(const_cast<Decl *>(this));
834 Decl *getPreviousDecl() { return getPreviousDeclImpl(); }
838 const Decl *getPreviousDecl() const {
839 return const_cast<Decl *>(this)->getPreviousDeclImpl();
849 Decl *getMostRecentDecl() { return getMostRecentDeclImpl(); }
853 const Decl *getMostRecentDecl() const {
854 return const_cast<Decl *>(this)->getMostRecentDeclImpl();
857 /// getBody - If this Decl represents a declaration for a body of code,
862 /// \brief Returns true if this \c Decl represents a declaration for a body of
865 /// \c Decl represents a declaration for a body of code.
893 return (DeclKind >= Decl::firstFunction &&
894 DeclKind <= Decl::lastFunction) ||
903 return const_cast<Decl *>(this)->getAsFunction();
917 Decl *Prev = getPreviousDecl();
950 Decl *Prev = getPreviousDecl();
995 static DeclContext *castToDeclContext(const Decl *);
996 static Decl *castFromDeclContext(const DeclContext *);
1002 static void printGroup(Decl** Begin, unsigned NumDecls,
1011 /// \brief Looks through the Decl's underlying type to extract a FunctionType
1012 /// when possible. Will return null if the type underlying the Decl does not
1026 inline bool declaresSameEntity(const Decl *D1, const Decl *D2) {
1039 const Decl *TheDecl;
1044 PrettyStackTraceDecl(const Decl *theDecl, SourceLocation L,
1165 mutable Decl *FirstDecl;
1171 mutable Decl *LastDecl;
1180 static std::pair<Decl *, Decl *>
1181 BuildDeclChain(ArrayRef<Decl*> Decls, bool FieldsAlreadyLoaded);
1183 DeclContext(Decl::Kind K)
1194 Decl::Kind getDeclKind() const {
1195 return static_cast<Decl::Kind>(DeclKind);
1201 return cast<Decl>(this)->getDeclContext();
1217 return cast<Decl>(this)->getLexicalDeclContext();
1230 return cast<Decl>(this)->getASTContext();
1234 return DeclKind == Decl::Block;
1239 case Decl::ObjCCategory:
1240 case Decl::ObjCCategoryImpl:
1241 case Decl::ObjCImplementation:
1242 case Decl::ObjCInterface:
1243 case Decl::ObjCProtocol:
1251 case Decl::Block:
1252 case Decl::Captured:
1253 case Decl::ObjCMethod:
1256 return DeclKind >= Decl::firstFunction && DeclKind <= Decl::lastFunction;
1262 return !isFunctionOrMethod() && DeclKind != Decl::LinkageSpec;
1266 return DeclKind == Decl::TranslationUnit || DeclKind == Decl::Namespace;
1270 return DeclKind == Decl::TranslationUnit;
1274 return DeclKind >= Decl::firstRecord && DeclKind <= Decl::lastRecord;
1278 return DeclKind == Decl::Namespace;
1327 Decl *getNonClosureAncestor();
1328 const Decl *getNonClosureAncestor() const {
1400 Decl *Current;
1403 typedef Decl *value_type;
1410 explicit decl_iterator(Decl *C) : Current(C) { }
1612 void addDecl(Decl *D);
1618 /// important check. This is only useful if the Decl is being
1622 void addDeclInternal(Decl *D);
1630 void addHiddenDecl(Decl *D);
1633 void removeDecl(Decl *D);
1636 bool containsDecl(Decl *D) const;
1764 bool isDeclInLexicalTraversal(const Decl *D) const {
1779 static bool classof(const Decl *D);
1807 inline bool Decl::isTemplateParameter() const {
1817 return static_cast<const ToTy*>(Decl::castFromDeclContext(Val));
1821 return static_cast<ToTy*>(Decl::castFromDeclContext(Val));
1878 /// Implement cast_convert_val for Decl -> DeclContext conversions.