GaloisInc / cclyzerpp

cclyzer++ is a precise and scalable pointer analysis for LLVM code.
https://galoisinc.github.io/cclyzerpp/
BSD 3-Clause "New" or "Revised" License
134 stars 15 forks source link

fact-gen: make variable_in_func relation consistent wrt function names #150

Closed adrianherrera closed 1 year ago

adrianherrera commented 1 year ago

The variable_in_func_name and constant_in_func_name relations are inconsistent with how they deal with function names. For example, here and here the function name is prepended with an @. However, here this doesn't happen.

I assume this is not intentional, as it appears to break the func_name relation.

langston-barrett commented 1 year ago

I assume this is not intentional, as it appears to break the func_name relation.

I don't think it's intentional, and if it were, there should be a comment explaining it. Can you say more about how func_name is broken? This surprises me, since it is used in several places throughout the analysis, and yet this commit doesn't seem to change the analysis results at all (the golden tests still pass).

In any case, I can see that you're right about the discrepancy and the fix doesn't seem to change/break anything, so I'm optimistically merging this. For other readers, here's the other bit of relevant code:

https://github.com/GaloisInc/cclyzerpp/blob/bb6d8c9abe10520a517068c0c12b3479df29d2f6/FactGenerator/src/Constants.cpp#L33-L34

adrianherrera commented 1 year ago

Thanks (once again!) @langston-barrett

Doh, sorry, I meant variable_in_func. If I use this on a basic block label it returned empty, because variable_in_func_name returned a function name without an @ and all the functions in func_name started with an @.