[clang] b0befe3 - [clang][dataflow] Mark `getDeclCtx` function in dataflow `Environment` `const`.

Wei Yi Tee via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 19 13:07:47 PDT 2022


Author: Wei Yi Tee
Date: 2022-08-19T20:07:21Z
New Revision: b0befe3ac1baf5734a975d0bdbdb941d1c3b8364

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

LOG: [clang][dataflow] Mark `getDeclCtx` function in dataflow `Environment` `const`.

Differential Revision: https://reviews.llvm.org/D132229

Added: 
    

Modified: 
    clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h b/clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h
index 6955bcf2fb4c..541b9132ebf5 100644
--- a/clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h
+++ b/clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h
@@ -348,7 +348,7 @@ class Environment {
 
   /// Returns the `DeclContext` of the block being analysed, if any. Otherwise,
   /// returns null.
-  const DeclContext *getDeclCtx() { return CallStack.back(); }
+  const DeclContext *getDeclCtx() const { return CallStack.back(); }
 
   /// Returns whether this `Environment` can be extended to analyze the given
   /// `Callee` (i.e. if `pushCall` can be used), with recursion disallowed and a


        


More information about the cfe-commits mailing list