[clang] b02f689 - [clang][Interp][NFC] InterpFrame::getParam can be const
Timm Bäder via cfe-commits
cfe-commits at lists.llvm.org
Tue Sep 13 01:42:00 PDT 2022
Author: Timm Bäder
Date: 2022-09-13T10:41:28+02:00
New Revision: b02f6890f52a48de6fc3a1d977a6ae50bc8fa984
URL: https://github.com/llvm/llvm-project/commit/b02f6890f52a48de6fc3a1d977a6ae50bc8fa984
DIFF: https://github.com/llvm/llvm-project/commit/b02f6890f52a48de6fc3a1d977a6ae50bc8fa984.diff
LOG: [clang][Interp][NFC] InterpFrame::getParam can be const
Make stackRef() const as well and use that.
Added:
Modified:
clang/lib/AST/Interp/InterpFrame.h
Removed:
################################################################################
diff --git a/clang/lib/AST/Interp/InterpFrame.h b/clang/lib/AST/Interp/InterpFrame.h
index 88b4a5af8e5a..16d073c8c3a0 100644
--- a/clang/lib/AST/Interp/InterpFrame.h
+++ b/clang/lib/AST/Interp/InterpFrame.h
@@ -76,7 +76,7 @@ class InterpFrame final : public Frame {
Pointer getLocalPointer(unsigned Offset);
/// Returns the value of an argument.
- template <typename T> const T &getParam(unsigned Offset) {
+ template <typename T> const T &getParam(unsigned Offset) const {
auto Pt = Params.find(Offset);
if (Pt == Params.end()) {
return stackRef<T>(Offset);
@@ -112,7 +112,7 @@ class InterpFrame final : public Frame {
private:
/// Returns an original argument from the stack.
- template <typename T> const T &stackRef(unsigned Offset) {
+ template <typename T> const T &stackRef(unsigned Offset) const {
assert(Args);
return *reinterpret_cast<const T *>(Args - ArgSize + Offset);
}
More information about the cfe-commits
mailing list