clang  10.0.0svn
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 #include "llvm/Support/raw_ostream.h"
18 
19 namespace clang {
20 class FunctionDecl;
21 
22 namespace interp {
23 
24 /// Base class for stack frames, shared between VM and walker.
25 class Frame {
26 public:
27  virtual ~Frame();
28 
29  /// Generates a human-readable description of the call site.
30  virtual void describe(llvm::raw_ostream &OS) = 0;
31 
32  /// Returns a pointer to the caller frame.
33  virtual Frame *getCaller() const = 0;
34 
35  /// Returns the location of the call site.
36  virtual SourceLocation getCallLocation() const = 0;
37 
38  /// Returns the called function's declaration.
39  virtual const FunctionDecl *getCallee() const = 0;
40 };
41 
42 } // namespace interp
43 } // namespace clang
44 
45 #endif
Represents a function declaration or definition.
Definition: Decl.h:1784
virtual ~Frame()
Definition: Frame.cpp:14
virtual Frame * getCaller() const =0
Returns a pointer to the caller frame.
virtual const FunctionDecl * getCallee() const =0
Returns the called function's declaration.
virtual SourceLocation getCallLocation() const =0
Returns the location of the call site.
virtual void describe(llvm::raw_ostream &OS)=0
Generates a human-readable description of the call site.
Base class for stack frames, shared between VM and walker.
Definition: Frame.h:25
Encodes a location in the source.
Dataflow Directional Tag Classes.
Defines the clang::SourceLocation class and associated facilities.