File tree Expand file tree Collapse file tree 3 files changed +7
-4
lines changed
Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 1616#include " EvaluationResult.h"
1717#include " InterpState.h"
1818#include " PrimType.h"
19+ #include " Record.h"
1920#include " Source.h"
2021
2122namespace clang {
Original file line number Diff line number Diff line change @@ -115,9 +115,10 @@ class Block final {
115115 return reinterpret_cast <const std::byte *>(this ) + sizeof (Block);
116116 }
117117
118- template <typename T> T deref () const {
118+ template <typename T> const T & deref () const {
119119 return *reinterpret_cast <const T *>(data ());
120120 }
121+ template <typename T> T &deref () { return *reinterpret_cast <T *>(data ()); }
121122
122123 // / Invokes the constructor.
123124 void invokeCtor () {
Original file line number Diff line number Diff line change 1414#define LLVM_CLANG_AST_INTERP_INTERPFRAME_H
1515
1616#include " Frame.h"
17- #include " Program.h"
17+ #include " InterpBlock.h"
18+ #include " Pointer.h"
1819
1920namespace clang {
2021namespace interp {
@@ -93,7 +94,7 @@ class InterpFrame final : public Frame {
9394 auto Pt = Params.find (Offset);
9495 if (Pt == Params.end ())
9596 return stackRef<T>(Offset);
96- return Pointer ( reinterpret_cast <Block *>(Pt->second .get ())). deref <T>();
97+ return reinterpret_cast <const Block *>(Pt->second .get ())-> deref <T>();
9798 }
9899
99100 // / Mutates a local copy of a parameter.
@@ -151,7 +152,7 @@ class InterpFrame final : public Frame {
151152
152153 // / Returns an offset to a local.
153154 template <typename T> T &localRef (unsigned Offset) const {
154- return getLocalPointer (Offset). deref <T>();
155+ return localBlock (Offset)-> deref <T>();
155156 }
156157
157158 // / Returns a pointer to a local's block.
You can’t perform that action at this time.
0 commit comments