mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-15 02:59:33 +07:00
[js] refactor JSControlFlowBuilder
GitOrigin-RevId: 6952a2e305a41810c391eb705e52249d746ab59e
This commit is contained in:
committed by
intellij-monorepo-bot
parent
315b54f08b
commit
5369b73943
@@ -10,6 +10,7 @@ import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiElementVisitor;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -61,10 +62,12 @@ public class ControlFlowBuilder {
|
||||
}
|
||||
|
||||
/**
|
||||
* Mutates instructions in place.
|
||||
*
|
||||
* @return control flow without transparent instructions
|
||||
*/
|
||||
@NotNull
|
||||
public final ControlFlow getCompleteControlFlow() {
|
||||
public final ControlFlow completeControlFlow() {
|
||||
if (transparentInstructionCount == 0) return getControlFlow();
|
||||
|
||||
ArrayList<Instruction> result = new ArrayList<>(instructionCount);
|
||||
@@ -101,6 +104,20 @@ public class ControlFlowBuilder {
|
||||
return new ControlFlowImpl(result.toArray(Instruction.EMPTY_ARRAY));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Mutates instructions in place.
|
||||
*
|
||||
* @return control flow without transparent instructions
|
||||
* @deprecated use {@link #completeControlFlow}
|
||||
*/
|
||||
@NotNull
|
||||
@Deprecated
|
||||
@ApiStatus.ScheduledForRemoval
|
||||
public final ControlFlow getCompleteControlFlow() {
|
||||
return completeControlFlow();
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds edge between 2 edges
|
||||
*
|
||||
@@ -257,7 +274,7 @@ public class ControlFlowBuilder {
|
||||
@NotNull
|
||||
public final ControlFlow build(@NotNull PsiElementVisitor visitor, @NotNull PsiElement element) {
|
||||
visitFor(visitor, element);
|
||||
return getCompleteControlFlow();
|
||||
return completeControlFlow();
|
||||
}
|
||||
|
||||
public final void visitFor(@NotNull PsiElementVisitor visitor, @NotNull PsiElement element) {
|
||||
|
||||
Reference in New Issue
Block a user