From b02f6890f52a48de6fc3a1d977a6ae50bc8fa984 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Timm=20B=C3=A4der?= Date: Sat, 10 Sep 2022 12:55:41 +0200 Subject: [PATCH] [clang][Interp][NFC] InterpFrame::getParam can be const Make stackRef() const as well 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 88b4a5a..16d073c 100644 --- a/clang/lib/AST/Interp/InterpFrame.h +++ b/clang/lib/AST/Interp/InterpFrame.h @@ -76,7 +76,7 @@ public: Pointer getLocalPointer(unsigned Offset); /// Returns the value of an argument. - template const T &getParam(unsigned Offset) { + template const T &getParam(unsigned Offset) const { auto Pt = Params.find(Offset); if (Pt == Params.end()) { return stackRef(Offset); @@ -112,7 +112,7 @@ public: private: /// Returns an original argument from the stack. - template const T &stackRef(unsigned Offset) { + template const T &stackRef(unsigned Offset) const { assert(Args); return *reinterpret_cast(Args - ArgSize + Offset); } -- 2.7.4