================
@@ -388,7 +395,7 @@ class SExprBuilder {
   til::LiteralPtr *createVariable(const VarDecl *VD);
 
   // Create placeholder for this: we don't know the VarDecl on construction 
yet.
-  std::pair<til::LiteralPtr *, StringRef>
+  std::pair<til::LiteralPtr *, CapabilityExpr>
----------------
melver wrote:

I think this code is just more complex than it needs to be. I do not understand 
the need for createThisPlaceholder(): 

- Placeholder.second is only used if there's a ScopedLockableAttr;
- Placeholder.first is equivalent to a createVariable(nullptr);

Therefore, we can just defer the second step (getting the string+bool out) for 
when we determine it's a ScopedLockableAttr, and use createVariable(nullptr) 
instead of createThisPlaceholder(). The main problem was that the function that 
extracts the string (and now also the reentrant bool) wasn't available here.

So it'll just be much clearer if we have a constructor that does that for us, 
and just use that rather than through this complex indirection of "prefetching" 
the string+bool.

Also saves a few cycles if we simplify it. Let me try that.

https://github.com/llvm/llvm-project/pull/137133
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to