aaron.ballman added inline comments.

================
Comment at: clang/lib/AST/Interp/ByteCodeEmitter.cpp:100-103
+  bool IsEligibleForCompilation =
+      FuncDecl->isConstexpr() ||
+      (isa<CXXMethodDecl>(FuncDecl) &&
+       cast<CXXMethodDecl>(FuncDecl)->isLambdaStaticInvoker());
----------------
I don't like the `isa` followed by a `cast` code smell, but rewriting it to use 
`dyn_cast` is perhaps kind of ugly:
```
bool IsEligibleForCompilation = false;
if (const auto *MD = dyn_cast<CXXMethodDecl>())
  IsEligibleForCompilation = MD->isLambdaStaticInvoker();
if (!IsEligibleForCompilation)
  IsEligibleForCompilation = FuncDecl->isConstexpr();
```
WDYT?


================
Comment at: clang/lib/AST/Interp/ByteCodeStmtGen.cpp:125-126
+
+    // We do the lvalue-to-rvalue conversion manually here, so no need
+    // to care about references.
+    PrimType ParamType = this->classify(PVD->getType()).value_or(PT_Ptr);
----------------
Why do we need to do lvalue-to-rvalue conversion at all? The caller of the 
lambda function call operator would have already performed that conversion, 
right?


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

https://reviews.llvm.org/D150111

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to