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
137 stars 14 forks source link

dl: Adapt to opaque pointers #113

Open langston-barrett opened 2 years ago

langston-barrett commented 2 years ago

LLVM is in the process of migrating all of its pointer types from i8*, i32*, etc. to an opaque ptr type, as described here. LLVM 13 takes an important step in that direction, as it is the first LLVM release to include ptr in the LLVM AST. See https://github.com/llvm/llvm-project/commit/2155dc51d700c9fb5f29d79eaacf5e1470e4d8ca. LLVM 15 switches to opaque pointers by default, so this impacts #12.

It's not clear to me what impact this will have on cclyzer++. cclyzer++ creates suballocations based on allocation type, but it seems like alloca still takes the type parameter that cclyzer++ uses to assign types to allocations. Type back-propagation may need minor adjustments to get the type from the load and store instructions themselves, rather than the type of their operand (which will now always be ptr).

Opaque pointers can be disabled through LLVM 15 with -opaque-pointers=1 in opt and -Xclang -no-opaque-pointers for clang.

If there is a big impact, there are at least three ways we could handle this, from trivial to research-grade difficulty: