-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Java: Replace SSA wrapper classes with shared implementation. #20761
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
c4f0868
Java: Move SSA entry defs to index -1.
aschackmull f2181ec
Java: Get rid of untracked SSA definitions.
aschackmull 374c772
Java: Remove getAFirstUse in BaseSSA.
aschackmull 79b2f21
SSA: Fix phi defs.
aschackmull 289d337
SSA: Improve toString.
aschackmull 551944b
Java: Add VariableWrite class.
aschackmull 942dc2b
Java: Replace BaseSSA class wrappers with shared code.
aschackmull d5708fd
Java: Instantiate shared SSA wrappers for main SSA.
aschackmull 154f077
Java: Simplify instantiation of Guards and ControlFlowReachability.
aschackmull 99aa033
Java: Replace usages of isParameterDefinition.
aschackmull 07e6356
Java: Replace getAFirstUse with top-level predicate.
aschackmull 483b2d8
Java: Replace uses of SsaExplicitUpdate.
aschackmull 06df5c0
Java: Introduce SsaCapturedDefinition and replace uses of getAnUltima…
aschackmull 3e43c53
Java: Update some qldoc deprecation notices.
aschackmull 35caede
Java: Replace SsaPhiNode with SsaPhiDefinition.
aschackmull f4b9efc
Java: Replace getAUse with getARead.
aschackmull 8594ae0
Java: Replace remaining SsaImplicitInit.
aschackmull f0bd034
Java: Replace usages of SsaVariable.
aschackmull ee5d65e
Java: Update toString for implicit writes.
aschackmull 5849d85
Java: Deprecate two more SSA classes.
aschackmull 95ac61d
Java: Drop caching of deprecated predicates.
aschackmull e059ded
Java: Accept toString changes in qltest.
aschackmull 109a5eb
Java: Accept qltest changes due to dropped UntrackedDef.
aschackmull 437ca58
Java: Add change note.
aschackmull 4a58a01
Java: Reinstate useless null check results for fields that are no lon…
aschackmull File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -164,7 +164,7 @@ private predicate uncertainVariableUpdateImpl(TrackedVar v, ControlFlowNode n, B | |
| predicate uncertainVariableUpdate(TrackedVar v, ControlFlowNode n, BasicBlock b, int i) = | ||
| forceLocal(uncertainVariableUpdateImpl/4)(v, n, b, i) | ||
|
|
||
| private module SsaInput implements SsaImplCommon::InputSig<Location, BasicBlock> { | ||
| private module SsaImplInput implements SsaImplCommon::InputSig<Location, BasicBlock> { | ||
| class SourceVariable = SsaSourceVariable; | ||
|
|
||
| /** | ||
|
|
@@ -206,7 +206,35 @@ private module SsaInput implements SsaImplCommon::InputSig<Location, BasicBlock> | |
| } | ||
| } | ||
|
|
||
| import SsaImplCommon::Make<Location, Cfg, SsaInput> as Impl | ||
| import SsaImplCommon::Make<Location, Cfg, SsaImplInput> as Impl | ||
|
|
||
| private module SsaInput implements Impl::SsaInputSig { | ||
| private import java as J | ||
|
|
||
| class Expr = J::Expr; | ||
|
|
||
| class Parameter = J::Parameter; | ||
|
|
||
| class VariableWrite = J::VariableWrite; | ||
|
|
||
| predicate explicitWrite(VariableWrite w, BasicBlock bb, int i, SsaSourceVariable v) { | ||
| exists(VariableUpdate upd | | ||
| upd = w.asExpr() and | ||
| certainVariableUpdate(v, upd.getControlFlowNode(), bb, i) and | ||
| getDestVar(upd) = v | ||
| ) | ||
| or | ||
| exists(Parameter p, Callable c | | ||
| c = p.getCallable() and | ||
| v = TLocalVar(c, p) and | ||
| w.isParameterInit(p) and | ||
| c.getBody().getBasicBlock() = bb and | ||
| i = -1 | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| module Ssa = Impl::MakeSsa<SsaInput>; | ||
Check warningCode scanning / CodeQL Names only differing by case Warning
Ssa is only different by casing from SSA that is used elsewhere for modules.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same question: Did you check that the cached stages are collapsed? |
||
|
|
||
| final class Definition = Impl::Definition; | ||
|
|
||
|
|
||
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.
Check warning
Code scanning / CodeQL
Names only differing by case Warning