//===- GlobalDecl.h - Global declaration holder -----------------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // A GlobalDecl can hold either a regular variable/function or a C++ ctor/dtor // together with its type. // //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_AST_GLOBALDECL_H #define LLVM_CLANG_AST_GLOBALDECL_H #include "clang/AST/Attr.h" #include "clang/AST/DeclCXX.h" #include "clang/AST/DeclObjC.h" #include "clang/AST/DeclOpenMP.h" #include "clang/AST/DeclTemplate.h" #include "clang/Basic/ABI.h" #include "clang/Basic/LLVM.h" #include "llvm/ADT/DenseMapInfo.h" #include "llvm/ADT/PointerIntPair.h" #include "llvm/Support/Casting.h" #include "llvm/Support/type_traits.h" #include <cassert> namespace clang { enum class DynamicInitKind : unsigned { … }; enum class KernelReferenceKind : unsigned { … }; /// GlobalDecl - represents a global declaration. This can either be a /// CXXConstructorDecl and the constructor type (Base, Complete). /// a CXXDestructorDecl and the destructor type (Base, Complete), /// a FunctionDecl and the kernel reference type (Kernel, Stub), or /// a VarDecl, a FunctionDecl or a BlockDecl. /// /// When a new type of GlobalDecl is added, the following places should /// be updated to convert a Decl* to a GlobalDecl: /// PredefinedExpr::ComputeName() in lib/AST/Expr.cpp. /// getParentOfLocalEntity() in lib/AST/ItaniumMangle.cpp /// ASTNameGenerator::Implementation::writeFuncOrVarName in lib/AST/Mangle.cpp /// class GlobalDecl { … }; } // namespace clang namespace llvm { template<> struct DenseMapInfo<clang::GlobalDecl> { … }; } // namespace llvm #endif // LLVM_CLANG_AST_GLOBALDECL_H