//===- TemplateBase.h - Core classes for C++ templates ----------*- 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 // //===----------------------------------------------------------------------===// // // This file provides definitions which are common for all kinds of // template representation. // //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_AST_TEMPLATEBASE_H #define LLVM_CLANG_AST_TEMPLATEBASE_H #include "clang/AST/DependenceFlags.h" #include "clang/AST/NestedNameSpecifier.h" #include "clang/AST/TemplateName.h" #include "clang/AST/Type.h" #include "clang/Basic/LLVM.h" #include "clang/Basic/SourceLocation.h" #include "llvm/ADT/APInt.h" #include "llvm/ADT/APSInt.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/SmallVector.h" #include "llvm/Support/Compiler.h" #include "llvm/Support/TrailingObjects.h" #include <cassert> #include <cstddef> #include <cstdint> #include <optional> namespace llvm { class FoldingSetNodeID; // Provide PointerLikeTypeTraits for clang::Expr*, this default one requires a // full definition of Expr, but this file only sees a forward del because of // the dependency. template <> struct PointerLikeTypeTraits<clang::Expr *> { … }; } // namespace llvm namespace clang { class APValue; class ASTContext; class Expr; struct PrintingPolicy; class TypeSourceInfo; class ValueDecl; /// Represents a template argument. class TemplateArgument { … }; /// Location information for a TemplateArgument. struct TemplateArgumentLocInfo { … }; /// Location wrapper for a TemplateArgument. TemplateArgument is to /// TemplateArgumentLoc as Type is to TypeLoc. class TemplateArgumentLoc { … }; /// A convenient class for passing around template argument /// information. Designed to be passed by reference. class TemplateArgumentListInfo { … }; /// Represents an explicit template argument list in C++, e.g., /// the "<int>" in "sort<int>". /// This is safe to be used inside an AST node, in contrast with /// TemplateArgumentListInfo. struct ASTTemplateArgumentListInfo final : private llvm::TrailingObjects<ASTTemplateArgumentListInfo, TemplateArgumentLoc> { … }; /// Represents an explicit template argument list in C++, e.g., /// the "<int>" in "sort<int>". /// /// It is intended to be used as a trailing object on AST nodes, and /// as such, doesn't contain the array of TemplateArgumentLoc itself, /// but expects the containing object to also provide storage for /// that. struct alignas(void *) ASTTemplateKWAndArgsInfo { … }; const StreamingDiagnostic &operator<<(const StreamingDiagnostic &DB, const TemplateArgument &Arg); } // namespace clang #endif // LLVM_CLANG_AST_TEMPLATEBASE_H