//===--- Function.h - Bytecode function for the VM --------------*- 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 // //===----------------------------------------------------------------------===// // // Defines the Function class which holds all bytecode function-specific data. // // The scope class which describes local variables is also defined here. // //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_AST_INTERP_FUNCTION_H #define LLVM_CLANG_AST_INTERP_FUNCTION_H #include "Descriptor.h" #include "Source.h" #include "clang/AST/ASTLambda.h" #include "clang/AST/Attr.h" #include "clang/AST/Decl.h" #include "llvm/ADT/PointerUnion.h" #include "llvm/Support/raw_ostream.h" namespace clang { namespace interp { class Program; class ByteCodeEmitter; class Pointer; enum PrimType : uint32_t; /// Describes a scope block. /// /// The block gathers all the descriptors of the locals defined in this block. class Scope final { … }; FunctionDeclTy; /// Bytecode function. /// /// Contains links to the bytecode of the function, as well as metadata /// describing all arguments and stack-local variables. /// /// # Calling Convention /// /// When calling a function, all argument values must be on the stack. /// /// If the function has a This pointer (i.e. hasThisPointer() returns true, /// the argument values need to be preceeded by a Pointer for the This object. /// /// If the function uses Return Value Optimization, the arguments (and /// potentially the This pointer) need to be preceeded by a Pointer pointing /// to the location to construct the returned value. /// /// After the function has been called, it will remove all arguments, /// including RVO and This pointer, from the stack. /// class Function final { … }; } // namespace interp } // namespace clang #endif