================
@@ -248,7 +249,9 @@ class UseFact : public Fact {
const OriginList *getUsedOrigins() const { return OList; }
const Expr *getUseExpr() const { return UseExpr; }
void markAsWritten() { IsWritten = true; }
+ void markAsReferenceWrite() { IsReferenceWrite = true; }
----------------
usx95 wrote:
I would prefer to not have `IsReferenceWrite`and similar C++ language semantics
introduced to liveness/dataflow.
Instead of adding `IsReferenceWrite`, we could generate two separate `UseFact`s
for reference writes.
For `ref = 10` where `ref` is `int&`:
1. Read `UseFact` for the outer origin (reference binding) - keeps it live
2. Write `UseFact` for the full origin list - kills inner origins
We would need to change the `UseFact` to have single origin or a `OriginList`.
Maybe using a variant here.
https://github.com/llvm/llvm-project/pull/184295
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits