Skip to content

Propagate constants in useless array assignment and reference #115

Open
@CalebFenton

Description

Here's a short example:

Object[] arrayOfObject = new Object[2];
arrayOfObject[0] = "hello";
arrayOfObject[1] = world";
someMethod(arrayOfObject[0], arrayOfObject[1])

I think this could work by replacing aget on a known array with a constant-izable value with the constant op equivalent. Dead code analysis would then notice arrayOfObject isn't used. For an easy example of this, see #94.

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions