[PATCH] D130600: [clang][dataflow] Handle return statements
Sam Estep via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Jul 26 18:26:16 PDT 2022
samestep added inline comments.
================
Comment at: clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h:110
+ /// Assigns `Loc` as the storage location of `return`.
+ ///
----------------
gribozavr2 wrote:
>
Done.
================
Comment at: clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h:120-121
+
+ /// Returns the storage location assigned to `return` or null if `return` has
+ /// no assigned storage location.
+ StorageLocation *getReturnStorageLocation() const { return ReturnLoc; }
----------------
gribozavr2 wrote:
>
Done.
================
Comment at: clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h:224-225
+ /// Returns the storage location assigned to `return` in the environment or
+ /// null if `return` has no assigned storage location in the environment.
+ StorageLocation *getReturnStorageLocation() const;
----------------
gribozavr2 wrote:
>
Done.
================
Comment at: clang/lib/Analysis/FlowSensitive/Transfer.cpp:347
+ assert(Val != nullptr);
+ Env.setValue(*Loc, *Val);
+ }
----------------
gribozavr2 wrote:
> Please add a TODO about modeling NRVO.
Added, thanks! I hadn't realized this would be necessary.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D130600/new/
https://reviews.llvm.org/D130600
More information about the cfe-commits
mailing list