From 5d2451468c5f105bd7837f57c5e385fbbbdb65a4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Timm=20B=C3=A4der?= Date: Sat, 10 Sep 2022 12:51:50 +0200 Subject: [PATCH] [clang][Interp][NFC] InterpFrame::getLocal() can be const Make localRef() const and use that. --- clang/lib/AST/Interp/InterpFrame.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clang/lib/AST/Interp/InterpFrame.h b/clang/lib/AST/Interp/InterpFrame.h index ca9803d..88b4a5a 100644 --- a/clang/lib/AST/Interp/InterpFrame.h +++ b/clang/lib/AST/Interp/InterpFrame.h @@ -63,7 +63,7 @@ public: size_t getFrameOffset() const { return FrameOffset; } /// Returns the value of a local variable. - template const T &getLocal(unsigned Offset) { + template const T &getLocal(unsigned Offset) const { return localRef(Offset); } @@ -118,7 +118,7 @@ private: } /// Returns an offset to a local. - template T &localRef(unsigned Offset) { + template T &localRef(unsigned Offset) const { return *reinterpret_cast(Locals.get() + Offset); } -- 2.7.4