[PATCH] D39015: [Analyzer] Always use non-reference types when creating expressions in BodyFarm, removes std::call_once crash

George Karpenkov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 24 17:00:24 PDT 2017


george.karpenkov added inline comments.


================
Comment at: cfe/trunk/lib/Analysis/BodyFarm.cpp:139
 
-DeclRefExpr *ASTMaker::makeDeclRefExpr(const VarDecl *D,
-                                       bool RefersToEnclosingVariableOrCapture,
-                                       bool GetNonReferenceType) {
-  auto Type = D->getType();
-  if (GetNonReferenceType)
-    Type = Type.getNonReferenceType();
+DeclRefExpr *ASTMaker::makeDeclRefExpr(
+    const VarDecl *D,
----------------
danielmarjamaki wrote:
> this looks strange, did clang-format do this?
yes i believe so.


================
Comment at: cfe/trunk/lib/Analysis/BodyFarm.cpp:366
+        M.makeLvalueToRvalue(D->getParamDecl(i),
+                             /* RefersToEnclosingVariableOrCapture= */ false));
 
----------------
alexfh wrote:
> Remove the spaces inside the comment. `/*ParamName=*/value` is the format that is understood by clang-format and the https://clang.llvm.org/extra/clang-tidy/checks/misc-argument-comment.html clang-tidy check. Same elsewhere in this patch.
yeah, i can do that.
can we also consider changing `clang-tidy` to ignore those spaces?


Repository:
  rL LLVM

https://reviews.llvm.org/D39015





More information about the cfe-commits mailing list