From 187c0d4dd057f60def8784730b9f12da39118649 Mon Sep 17 00:00:00 2001 From: Stanislav Erokhin Date: Tue, 5 Apr 2016 20:02:29 +0300 Subject: [PATCH] Refactoring. Change Key for TAIL_RECURSION_CALL from ResolvedCall to Call. --- .../org/jetbrains/kotlin/codegen/TailRecursionCodegen.java | 4 ++-- .../jetbrains/kotlin/cfg/ControlFlowInformationProvider.java | 4 ++-- .../src/org/jetbrains/kotlin/resolve/BindingContext.java | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/TailRecursionCodegen.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/TailRecursionCodegen.java index af0916dc09f..02a4e7bc616 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/TailRecursionCodegen.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/TailRecursionCodegen.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2015 JetBrains s.r.o. + * Copyright 2010-2016 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -60,7 +60,7 @@ public class TailRecursionCodegen { } public boolean isTailRecursion(@NotNull ResolvedCall resolvedCall) { - TailRecursionKind status = state.getBindingContext().get(TAIL_RECURSION_CALL, resolvedCall); + TailRecursionKind status = state.getBindingContext().get(TAIL_RECURSION_CALL, resolvedCall.getCall()); return status != null && status.isDoGenerateTailRecursion(); } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/cfg/ControlFlowInformationProvider.java b/compiler/frontend/src/org/jetbrains/kotlin/cfg/ControlFlowInformationProvider.java index 110b74ad7e8..9eb680efdb5 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/cfg/ControlFlowInformationProvider.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/cfg/ControlFlowInformationProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2015 JetBrains s.r.o. + * Copyright 2010-2016 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -1006,7 +1006,7 @@ public class ControlFlowInformationProvider { KindAndCall kindAndCall = entry.getValue(); switch (kindAndCall.kind) { case TAIL_CALL: - trace.record(TAIL_RECURSION_CALL, kindAndCall.call, TailRecursionKind.TAIL_CALL); + trace.record(TAIL_RECURSION_CALL, kindAndCall.call.getCall(), TailRecursionKind.TAIL_CALL); hasTailCalls = true; break; case IN_TRY: diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/BindingContext.java b/compiler/frontend/src/org/jetbrains/kotlin/resolve/BindingContext.java index bb84530891e..40e296f36b9 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/BindingContext.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/BindingContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2015 JetBrains s.r.o. + * Copyright 2010-2016 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -111,7 +111,7 @@ public interface BindingContext { new BasicWritableSlice(DO_NOTHING); WritableSlice> RESOLVED_CALL = new BasicWritableSlice>(DO_NOTHING); - WritableSlice, TailRecursionKind> TAIL_RECURSION_CALL = Slices.createSimpleSlice(); + WritableSlice TAIL_RECURSION_CALL = Slices.createSimpleSlice(); WritableSlice CONSTRAINT_SYSTEM_COMPLETER = new BasicWritableSlice(DO_NOTHING); WritableSlice CALL = new BasicWritableSlice(DO_NOTHING);