================
@@ -589,9 +589,10 @@ void FactsGenerator::handleUse(const DeclRefExpr *DRE) {
   OriginList *List = getOriginsList(*DRE);
   if (!List)
     return;
-  // Remove the outer layer of origin which borrows from the decl directly. 
This
-  // is a use of the underlying decl.
-  List = getRValueOrigins(DRE, List);
+  // Remove the outer layer of origin which borrows from the decl directly
+  // (e.g., when this is not a reference). This is a use of the underlying 
decl.
+  if (!DRE->getDecl()->getType()->isReferenceType())
----------------
Xazax-hun wrote:

I think my intuition here is whether we want to do `getRValueOrigins` might be 
context dependent.
So in case of `&var` we do not want to peel but in case of `T* copy = var` we 
do. So I'd expect that we do the peeling later, when we process an lvalue to 
rvalue conversion or something similar. Admittedly, I'd expect that most 
DeclRefExprs are used in a context where we need the rvalue. 

https://github.com/llvm/llvm-project/pull/176728
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to