[PATCH] D149144: [clang][dataflow] Eliminate intermediate `ReferenceValue`s from `Environment::DeclToLoc`.

Yitzhak Mandelbaum via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 2 08:07:42 PDT 2023


ymandel accepted this revision.
ymandel added inline comments.


================
Comment at: clang/lib/Analysis/FlowSensitive/Transfer.cpp:329
+          // against this above.
+          ProcessVarDecl(*VD);
+          auto *VDLoc = Env.getStorageLocation(*VD);
----------------
mboehme wrote:
> ymandel wrote:
> > why the recursive call rather than relying on what we know about their structure?
> Not sure exactly what you're asking?
> 
> If we don't want to make a recursive call here, we'd need to duplicate behavior that `ProcessVarDecl()` already contains and inline that code here. It seems preferable to just call `ProcessVarDecl()` instead? (Or to put it differently, what is a reason against making this call?)
At least previously, given what we know of their structure, the inlining was trivial. But, I think your second point is key -- why not recursively call -- it's a clean solution. I'm fine with that, thx.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D149144/new/

https://reviews.llvm.org/D149144



More information about the cfe-commits mailing list