[PATCH] D80286: [Analyzer] Allow creation of stack frame for functions without definition

Gabor Marton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 20 08:10:59 PDT 2020


martong added inline comments.


================
Comment at: clang/unittests/StaticAnalyzer/ParamRegionTest.cpp:22
+                                const ParmVarDecl *PVD) {
+    for (const auto *D2: PVD->redecls()) {
+      const auto *PVD2 = cast<ParmVarDecl>(D2);
----------------
I am concerned about the redeclaration chain of ParmVarDecls. In the following example:
```
void foo(int a);
void foo(int a);
```
we have the prev decl set only for the FunctionDecls and not for the ParmVarDecl (please double check).
So in the test we should go through the redecls() of the FunctionDecl of the ParmVarDecl. And we should get a PVD from each redeclaration by the index. 


================
Comment at: clang/unittests/StaticAnalyzer/ParamRegionTest.cpp:87
                   std::make_unique<ParamRegionTestAction>(),
+                  "void foo(int n); "
+                  "void bar(int l); "
----------------
I think a raw string literal with clang-formatted code in it would make the test more valuable.


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

https://reviews.llvm.org/D80286





More information about the cfe-commits mailing list