Lines Matching defs:Decl

10 //  This file defines the Decl and DeclContext interfaces.
68 /// Decl - This represents one declaration (or definition), e.g. a variable,
71 class Decl {
73 /// \brief Lists the kind of concrete classes of Decl.
99 /// Decl currently provides 15 bits of IDNS bits.
201 llvm::PointerIntPair<Decl *, 2, unsigned> NextInContextAndBits;
214 /// the DeclContext where the Decl was declared.
314 Decl(Kind DK, DeclContext *DC, SourceLocation L)
325 Decl(Kind DK, EmptyShell Empty)
335 virtual ~Decl();
371 Decl *getNextDeclInContext() { return NextInContextAndBits.getPointer(); }
372 const Decl *getNextDeclInContext() const {return NextInContextAndBits.getPointer();}
380 return const_cast<Decl*>(this)->getDeclContext();
388 Decl *getNonClosureContext();
389 const Decl *getNonClosureContext() const {
390 return const_cast<Decl*>(this)->getNonClosureContext();
395 return const_cast<Decl*>(this)->getTranslationUnitDecl();
425 return const_cast<AttrVec&>(const_cast<const Decl*>(this)->getAttrs());
488 /// setInvalidDecl - Indicates the Decl had a semantic error. This
659 /// getLexicalDeclContext - The declaration context where this Decl was
675 return const_cast<Decl*>(this)->getLexicalDeclContext();
701 const_cast<const Decl*>(this)->getParentFunctionOrMethod());
705 virtual Decl *getCanonicalDecl() { return this; }
706 const Decl *getCanonicalDecl() const {
707 return const_cast<Decl*>(this)->getCanonicalDecl();
710 /// \brief Whether this particular Decl is a canonical one.
716 /// Decl subclasses that can be redeclared should override this method so that
717 /// Decl::redecl_iterator can iterate over them.
718 virtual Decl *getNextRedeclarationImpl() { return this; }
722 virtual Decl *getPreviousDeclImpl() { return nullptr; }
726 virtual Decl *getMostRecentDeclImpl() { return this; }
732 Decl *Current;
733 Decl *Starter;
736 typedef Decl *value_type;
743 explicit redecl_iterator(Decl *C) : Current(C), Starter(C) { }
751 Decl *Next = Current->getNextRedeclarationImpl();
780 return redecl_iterator(const_cast<Decl *>(this));
786 Decl *getPreviousDecl() { return getPreviousDeclImpl(); }
790 const Decl *getPreviousDecl() const {
791 return const_cast<Decl *>(this)->getPreviousDeclImpl();
801 Decl *getMostRecentDecl() { return getMostRecentDeclImpl(); }
805 const Decl *getMostRecentDecl() const {
806 return const_cast<Decl *>(this)->getMostRecentDeclImpl();
809 /// getBody - If this Decl represents a declaration for a body of code,
814 /// \brief Returns true if this \c Decl represents a declaration for a body of
817 /// \c Decl represents a declaration for a body of code.
845 return (DeclKind >= Decl::firstFunction &&
846 DeclKind <= Decl::lastFunction) ||
855 return const_cast<Decl *>(this)->getAsFunction();
869 Decl *Prev = getPreviousDecl();
902 Decl *Prev = getPreviousDecl();
947 static DeclContext *castToDeclContext(const Decl *);
948 static Decl *castFromDeclContext(const DeclContext *);
954 static void printGroup(Decl** Begin, unsigned NumDecls,
963 /// \brief Looks through the Decl's underlying type to extract a FunctionType
964 /// when possible. Will return null if the type underlying the Decl does not
978 inline bool declaresSameEntity(const Decl *D1, const Decl *D2) {
991 const Decl *TheDecl;
996 PrettyStackTraceDecl(const Decl *theDecl, SourceLocation L,
1052 mutable Decl *FirstDecl;
1058 mutable Decl *LastDecl;
1067 static std::pair<Decl *, Decl *>
1068 BuildDeclChain(ArrayRef<Decl*> Decls, bool FieldsAlreadyLoaded);
1070 DeclContext(Decl::Kind K)
1079 Decl::Kind getDeclKind() const {
1080 return static_cast<Decl::Kind>(DeclKind);
1086 return cast<Decl>(this)->getDeclContext();
1102 return cast<Decl>(this)->getLexicalDeclContext();
1115 return cast<Decl>(this)->getASTContext();
1119 return DeclKind == Decl::Block;
1124 case Decl::ObjCCategory:
1125 case Decl::ObjCCategoryImpl:
1126 case Decl::ObjCImplementation:
1127 case Decl::ObjCInterface:
1128 case Decl::ObjCProtocol:
1136 case Decl::Block:
1137 case Decl::Captured:
1138 case Decl::ObjCMethod:
1141 return DeclKind >= Decl::firstFunction && DeclKind <= Decl::lastFunction;
1146 return DeclKind == Decl::TranslationUnit || DeclKind == Decl::Namespace;
1150 return DeclKind == Decl::TranslationUnit;
1154 return DeclKind >= Decl::firstRecord && DeclKind <= Decl::lastRecord;
1158 return DeclKind == Decl::Namespace;
1207 Decl *getNonClosureAncestor();
1208 const Decl *getNonClosureAncestor() const {
1274 Decl *Current;
1277 typedef Decl *value_type;
1284 explicit decl_iterator(Decl *C) : Current(C) { }
1486 void addDecl(Decl *D);
1492 /// important check. This is only useful if the Decl is being
1496 void addDeclInternal(Decl *D);
1504 void addHiddenDecl(Decl *D);
1507 void removeDecl(Decl *D);
1510 bool containsDecl(Decl *D) const;
1635 bool isDeclInLexicalTraversal(const Decl *D) const {
1640 static bool classof(const Decl *D);
1670 inline bool Decl::isTemplateParameter() const {
1680 return static_cast<const ToTy*>(Decl::castFromDeclContext(Val));
1684 return static_cast<ToTy*>(Decl::castFromDeclContext(Val));
1741 /// Implement cast_convert_val for Decl -> DeclContext conversions.