Sync pybind with upstream Semi-Sparse refactor + LLVM 21.1.0#48
Merged
bjjwwang merged 1 commit intoSVF-tools:mainfrom Apr 30, 2026
Merged
Sync pybind with upstream Semi-Sparse refactor + LLVM 21.1.0#48bjjwwang merged 1 commit intoSVF-tools:mainfrom
bjjwwang merged 1 commit intoSVF-tools:mainfrom
Conversation
Upstream commit 0aa951d (Semi-Sparse infrastructure) moved a group of methods off AbstractState onto the new AbstractStateManager. The pybind bindings still pointed at the deleted methods, so the wheel no longer compiled against current SVF. pybind/AE.cpp: - Drop 9 stale AbstractState bindings: getByteOffset, getElementIndex, loadValue, storeValue, getPointeeElement, getGepObjAddrs (twice), getAllocaInstByteSize. - Add py::class_<AbstractStateManager> with 18 methods: getAbstractValue, hasAbstractValue, updateAbstractValue (each with ValVar/ObjVar/SVFVar overloads), getAbstractState, hasAbstractState, updateAbstractState, getGepElementIndex, getGepByteOffset, getGepObjAddrs, loadValue, storeValue, getPointeeElement, getAllocaInstByteSize, getTrace, __getitem__, getUseSitesOfObjVar / ValVar, getDefSiteOfObjVar / ValVar. Constructor takes (SVFIR*, std::shared_ptr<AndersenWaveDiff>). - Add minimal py::class_<AbstractInterpretation> exposing getStateMgr() so Python users can grab a stateMgr from a running analysis. - Add py::class_<Options> with the max_field_limit() static (used by downstream Assignment-3 helpers when porting getByteOffset). pybind/SVFIR.cpp: - Add GepStmt::getStructFieldOffset(idx_var, struct_type) lambda binding, needed to faithfully port AbstractStateManager::getGepByteOffset to Python without losing the struct-field path. pysvf/__init__.py: re-export AbstractStateManager, AbstractInterpretation, Options from .pysvf so they show up at the package top level. setup.py + workflows: bump LLVM 18.1.0 -> 21.1.0 paths everywhere (setup.py also had stale llvm-16.0.0.obj remnants; consolidated to llvm-21.1.0.obj). The npm svf-lib URL must point at LLVM 21 too -- SVF-npm sync-llvm-21 covers that. BREAKING (release notes worthy): callers of pysvf.AbstractState that relied on as.loadValue / as.storeValue / as.getByteOffset / etc. must migrate to a stateMgr. New signatures take ValVar*/ObjVar* + ICFGNode* instead of NodeID. See SSA Assignment-3 sync-llvm-21 for an example migration that reproduces the dense-mode behavior locally. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Upstream commit 0aa951d (Semi-Sparse infrastructure) moved a group of methods off AbstractState onto the new AbstractStateManager. The pybind bindings still pointed at the deleted methods, so the wheel no longer compiled against current SVF.
pybind/AE.cpp:
pybind/SVFIR.cpp:
pysvf/init.py: re-export AbstractStateManager, AbstractInterpretation, Options from .pysvf so they show up at the package top level.
setup.py + workflows: bump LLVM 18.1.0 -> 21.1.0 paths everywhere (setup.py also had stale llvm-16.0.0.obj remnants; consolidated to llvm-21.1.0.obj). The npm svf-lib URL must point at LLVM 21 too -- SVF-npm sync-llvm-21 covers that.
BREAKING (release notes worthy): callers of pysvf.AbstractState that relied on as.loadValue / as.storeValue / as.getByteOffset / etc. must migrate to a stateMgr. New signatures take ValVar*/ObjVar* + ICFGNode* instead of NodeID. See SSA Assignment-3 sync-llvm-21 for an example migration that reproduces the dense-mode behavior locally.