Skip to content

added dead branch analysis to CF and constant value checker#153

Closed
txiang61 wants to merge 16 commits intoopprop:masterfrom
txiang61:dead_branch
Closed

added dead branch analysis to CF and constant value checker#153
txiang61 wants to merge 16 commits intoopprop:masterfrom
txiang61:dead_branch

Conversation

@txiang61
Copy link
Copy Markdown
Member

No description provided.

txiang61 added 4 commits June 18, 2020 11:28
…er (typetools#3396)

This change is need for AnnotatedTypeCopierWithReplacement to behave correctly for primitives.
Similar to visitNull, we want the primitives to have the annotations to be replaced.

This PR also includes a small refactoring of the AnnotatedTypeCopier.
@txiang61 txiang61 requested review from d367wang and wmdietl July 14, 2020 09:26
Copy link
Copy Markdown
Member

@wmdietl wmdietl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments about the rough structure. Let's discuss in detail.


@Override
public ConditionalFlow visitEqualTo(EqualToNode node, TransferInput<CFValue, CFStore> in) {
CFValue leftValue = in.getValueOfSubNode(node.getLeftOperand());
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first five lines of all these methods are the same. Can you extract that logic and pass in a lambda with the body of the then branches?

Map<Node, Constant> contents;

/** Indicate whether this store is in a dead branch or not. */
private boolean deadBranch = false;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why have a field here and in the super class?

@wmdietl wmdietl assigned txiang61 and unassigned wmdietl Jul 20, 2020
@xingweitian xingweitian changed the title added daad branch analysis to CF and constant value checker added dead branch analysis to CF and constant value checker Jul 22, 2020
@txiang61 txiang61 closed this by deleting the head repository Apr 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants