Home | History | Annotate | Download | only in AST

Lines Matching refs:Decl

10 //  This file defines the Decl and DeclContext interfaces.
71 /// Decl - This represents one declaration (or definition), e.g. a variable,
74 /// Note: There are objects tacked on before the *beginning* of Decl
75 /// (and its subclasses) in its Decl::operator new(). Proper alignment
76 /// of all subclasses (not requiring more than the alignment of Decl) is
78 class LLVM_ALIGNAS(/*alignof(uint64_t)*/ 8) Decl {
80 /// \brief Lists the kind of concrete classes of Decl.
82 #define DECL(DERIVED, BASE) DERIVED,
83 #define ABSTRACT_DECL(DECL)
92 /// decl-derived type that will be filled in later (e.g., by some
106 /// Decl currently provides 15 bits of IDNS bits.
221 llvm::PointerIntPair<Decl *, 2, unsigned> NextInContextAndBits;
234 /// the DeclContext where the Decl was declared.
256 /// Loc - The location of this decl.
265 /// HasAttrs - This indicates whether the decl has attributes or not.
334 Decl(Kind DK, DeclContext *DC, SourceLocation L)
338 Access(AS_none), FromASTFile(0), Hidden(DC && cast<Decl>(DC)->Hidden),
345 Decl(Kind DK, EmptyShell Empty)
355 virtual ~Decl();
391 Decl *getNextDeclInContext() { return NextInContextAndBits.getPointer(); }
392 const Decl *getNextDeclInContext() const {return NextInContextAndBits.getPointer();}
400 return const_cast<Decl*>(this)->getDeclContext();
408 Decl *getNonClosureContext();
409 const Decl *getNonClosureContext() const {
410 return const_cast<Decl*>(this)->getNonClosureContext();
415 return const_cast<Decl*>(this)->getTranslationUnitDecl();
445 return const_cast<AttrVec&>(const_cast<const Decl*>(this)->getAttrs());
504 /// on this decl, 0 if there are none.
507 /// setInvalidDecl - Indicates the Decl had a semantic error. This
669 /// \brief Get the imported owning module, if this decl is from an imported
707 /// getLexicalDeclContext - The declaration context where this Decl was
723 return const_cast<Decl*>(this)->getLexicalDeclContext();
737 /// scoped decl is defined outside the current function or method. This is
753 /// \brief If this decl is defined inside a function/method/block it returns
758 const_cast<const Decl*>(this)->getParentFunctionOrMethod());
762 virtual Decl *getCanonicalDecl() { return this; }
763 const Decl *getCanonicalDecl() const {
764 return const_cast<Decl*>(this)->getCanonicalDecl();
767 /// \brief Whether this particular Decl is a canonical one.
771 /// \brief Returns the next redeclaration or itself if this is the only decl.
773 /// Decl subclasses that can be redeclared should override this method so that
774 /// Decl::redecl_iterator can iterate over them.
775 virtual Decl *getNextRedeclarationImpl() { return this; }
779 virtual Decl *getPreviousDeclImpl() { return nullptr; }
783 virtual Decl *getMostRecentDeclImpl() { return this; }
786 /// \brief Iterates through all the redeclarations of the same decl.
789 Decl *Current;
790 Decl *Starter;
793 typedef Decl *value_type;
800 explicit redecl_iterator(Decl *C) : Current(C), Starter(C) { }
807 // Get either previous decl or latest decl.
808 Decl *Next = Current->getNextRedeclarationImpl();
831 /// decl. It will iterate at least once (when this decl is the only one).
837 return redecl_iterator(const_cast<Decl *>(this));
843 Decl *getPreviousDecl() { return getPreviousDeclImpl(); }
847 const Decl *getPreviousDecl() const {
848 return const_cast<Decl *>(this)->getPreviousDeclImpl();
858 Decl *getMostRecentDecl() { return getMostRecentDeclImpl(); }
862 const Decl *getMostRecentDecl() const {
863 return const_cast<Decl *>(this)->getMostRecentDeclImpl();
866 /// getBody - If this Decl represents a declaration for a body of code,
871 /// \brief Returns true if this \c Decl represents a declaration for a body of
874 /// \c Decl represents a declaration for a body of code.
902 return (DeclKind >= Decl::firstFunction &&
903 DeclKind <= Decl::lastFunction) ||
916 return const_cast<Decl *>(this)->getAsFunction();
930 Decl *Prev = getPreviousDecl();
950 /// applies only to a specific decl object; other redeclarations of the
963 Decl *Prev = getPreviousDecl();
1008 static DeclContext *castToDeclContext(const Decl *);
1009 static Decl *castFromDeclContext(const DeclContext *);
1015 static void printGroup(Decl** Begin, unsigned NumDecls,
1024 /// \brief Looks through the Decl's underlying type to extract a FunctionType
1025 /// when possible. Will return null if the type underlying the Decl does not
1039 inline bool declaresSameEntity(const Decl *D1, const Decl *D2) {
1050 /// doing something to a specific decl.
1052 const Decl *TheDecl;
1057 PrettyStackTraceDecl(const Decl *theDecl, SourceLocation L,
1121 /// DeclContext - This is used only as base class of specific decl types that
1179 mutable Decl *FirstDecl;
1185 mutable Decl *LastDecl;
1194 static std::pair<Decl *, Decl *>
1195 BuildDeclChain(ArrayRef<Decl*> Decls, bool FieldsAlreadyLoaded);
1197 DeclContext(Decl::Kind K)
1208 Decl::Kind getDeclKind() const {
1209 return static_cast<Decl::Kind>(DeclKind);
1215 return cast<Decl>(this)->getDeclContext();
1231 return cast<Decl>(this)->getLexicalDeclContext();
1244 return cast<Decl>(this)->getASTContext();
1248 return DeclKind == Decl::Block;
1253 case Decl::ObjCCategory:
1254 case Decl::ObjCCategoryImpl:
1255 case Decl::ObjCImplementation:
1256 case Decl::ObjCInterface:
1257 case Decl::ObjCProtocol:
1265 case Decl::Block:
1266 case Decl::Captured:
1267 case Decl::ObjCMethod:
1270 return DeclKind >= Decl::firstFunction && DeclKind <= Decl::lastFunction;
1276 return !isFunctionOrMethod() && DeclKind != Decl::LinkageSpec;
1280 return DeclKind == Decl::TranslationUnit || DeclKind == Decl::Namespace;
1284 return DeclKind == Decl::TranslationUnit;
1288 return DeclKind >= Decl::firstRecord && DeclKind <= Decl::lastRecord;
1292 return DeclKind == Decl::Namespace;
1341 Decl *getNonClosureAncestor();
1342 const Decl *getNonClosureAncestor() const {
1414 Decl *Current;
1417 typedef Decl *value_type;
1424 explicit decl_iterator(Decl *C) : Current(C) { }
1626 void addDecl(Decl *D);
1632 /// important check. This is only useful if the Decl is being
1636 void addDeclInternal(Decl *D);
1644 void addHiddenDecl(Decl *D);
1647 void removeDecl(Decl *D);
1650 bool containsDecl(Decl *D) const;
1739 /// setHasExternalLexicalStorage() has been called on any decl context for
1778 bool isDeclInLexicalTraversal(const Decl *D) const {
1793 static bool classof(const Decl *D);
1821 inline bool Decl::isTemplateParameter() const {
1831 return static_cast<const ToTy*>(Decl::castFromDeclContext(Val));
1835 return static_cast<ToTy*>(Decl::castFromDeclContext(Val));
1892 /// Implement cast_convert_val for Decl -> DeclContext conversions.