clang 24.0.0git
Frame.h
Go to the documentation of this file.
1//===--- Frame.h - Call frame for the VM and AST Walker ---------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// Defines the base class of interpreter and evaluator stack frames.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_CLANG_AST_INTERP_FRAME_H
14#define LLVM_CLANG_AST_INTERP_FRAME_H
15
17
18namespace llvm {
19class raw_ostream;
20} // namespace llvm
21
22namespace clang {
23class FunctionDecl;
24
25namespace interp {
26
27/// Base class for stack frames, shared between VM and walker.
28class Frame {
29public:
30 virtual ~Frame() = default;
31
32 /// Generates a human-readable description of the call site.
33 virtual void describe(llvm::raw_ostream &OS) const = 0;
34
35 /// Returns a pointer to the caller frame.
36 virtual Frame *getCaller() const = 0;
37
38 /// Returns the location of the call site.
39 virtual SourceRange getCallRange() const = 0;
40
41 /// Returns the called function's declaration.
42 virtual const FunctionDecl *getCallee() const = 0;
43};
44
45} // namespace interp
46} // namespace clang
47
48#endif
Defines the clang::SourceLocation class and associated facilities.
Represents a function declaration or definition.
Definition Decl.h:2059
A trivial tuple used to represent a source range.
Base class for stack frames, shared between VM and walker.
Definition Frame.h:28
virtual Frame * getCaller() const =0
Returns a pointer to the caller frame.
virtual void describe(llvm::raw_ostream &OS) const =0
Generates a human-readable description of the call site.
virtual const FunctionDecl * getCallee() const =0
Returns the called function's declaration.
virtual SourceRange getCallRange() const =0
Returns the location of the call site.
virtual ~Frame()=default
Top level wrappers for InstallAPI frontend operations.
Diagnostic wrappers for TextAPI types for error reporting.
Definition Dominators.h:30