[clang] 868aa93 - [clang][Interp][NFC] Take a const Function pointer in Context::Run()

Timm Bäder via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 6 05:52:33 PDT 2023


Author: Timm Bäder
Date: 2023-07-06T14:52:05+02:00
New Revision: 868aa9360587945146c86449cbd6c5170e1c9e2b

URL: https://github.com/llvm/llvm-project/commit/868aa9360587945146c86449cbd6c5170e1c9e2b
DIFF: https://github.com/llvm/llvm-project/commit/868aa9360587945146c86449cbd6c5170e1c9e2b.diff

LOG: [clang][Interp][NFC] Take  a const Function pointer in Context::Run()

Added: 
    

Modified: 
    clang/lib/AST/Interp/Context.cpp
    clang/lib/AST/Interp/Context.h

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/Interp/Context.cpp b/clang/lib/AST/Interp/Context.cpp
index 67fb69e6633823..9d093ba1ad65b0 100644
--- a/clang/lib/AST/Interp/Context.cpp
+++ b/clang/lib/AST/Interp/Context.cpp
@@ -139,7 +139,7 @@ const llvm::fltSemantics &Context::getFloatSemantics(QualType T) const {
   return Ctx.getFloatTypeSemantics(T);
 }
 
-bool Context::Run(State &Parent, Function *Func, APValue &Result) {
+bool Context::Run(State &Parent, const Function *Func, APValue &Result) {
   InterpState State(Parent, *P, Stk, *this);
   State.Current = new InterpFrame(State, Func, /*Caller=*/nullptr, {});
   if (Interpret(State, Result))

diff  --git a/clang/lib/AST/Interp/Context.h b/clang/lib/AST/Interp/Context.h
index 107bb75a46247e..8879186f7072ec 100644
--- a/clang/lib/AST/Interp/Context.h
+++ b/clang/lib/AST/Interp/Context.h
@@ -70,7 +70,7 @@ class Context final {
 
 private:
   /// Runs a function.
-  bool Run(State &Parent, Function *Func, APValue &Result);
+  bool Run(State &Parent, const Function *Func, APValue &Result);
 
   /// Checks a result from the interpreter.
   bool Check(State &Parent, llvm::Expected<bool> &&R);


        


More information about the cfe-commits mailing list