Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
category: breaking
---
* Removed the deprecated `getImmediateBaseType`, `getBaseType`, and `getBaseTypeDecl` predicates on type declarations, `hasVarDecl` on named patterns, and `immediatelyControls` and `controls` on basic blocks. Use `getImmediateInheritedType`, `getInheritedType`, `getABaseTypeDecl`, `getVarDecl`, and `edgeDominates`, respectively, instead.
26 changes: 1 addition & 25 deletions swift/ql/lib/codeql/swift/controlflow/BasicBlocks.qll
Original file line number Diff line number Diff line change
Expand Up @@ -87,31 +87,7 @@ final class JoinBlock extends BasicBlock, BasicBlocksImpl::JoinBasicBlock {
class JoinBlockPredecessor extends BasicBlock, BasicBlocksImpl::JoinPredecessorBasicBlock { }

/** A basic block that terminates in a condition, splitting the subsequent control flow. */
final class ConditionBlock extends BasicBlock, BasicBlocksImpl::ConditionBasicBlock {
/**
* DEPRECATED: Use `edgeDominates` instead.
*
* Holds if basic block `succ` is immediately controlled by this basic
* block with conditional value `s`. That is, `succ` is an immediate
* successor of this block, and `succ` can only be reached from
* the callable entry point by going via the `s` edge out of this basic block.
*/
deprecated predicate immediatelyControls(BasicBlock succ, ConditionalSuccessor s) {
this.getASuccessor(s) = succ and
BasicBlocksImpl::dominatingEdge(this, succ)
}

/**
* DEPRECATED: Use `edgeDominates` instead.
*
* Holds if basic block `controlled` is controlled by this basic block with
* conditional value `s`. That is, `controlled` can only be reached from
* the callable entry point by going via the `s` edge out of this basic block.
*/
deprecated predicate controls(BasicBlock controlled, ConditionalSuccessor s) {
super.edgeDominates(controlled, s)
}
}
final class ConditionBlock extends BasicBlock, BasicBlocksImpl::ConditionBasicBlock { }

private class BasicBlockAlias = BasicBlock;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,6 @@ module Impl {
class TypeDecl extends Generated::TypeDecl {
override string toStringImpl() { result = this.getName() }

/**
* Gets the `index`th base type of this type declaration (0-based).
*
* This is the same as `getImmediateInheritedType`.
* DEPRECATED: either use `getImmediateInheritedType` or unindexed `getABaseType`.
*/
deprecated Type getImmediateBaseType(int index) {
result = this.getImmediateInheritedType(index)
}

/**
* Gets the `index`th base type of this type declaration (0-based).
* This is the same as `getInheritedType`.
* DEPRECATED: use `getInheritedType` or unindexed `getABaseType`.
*/
deprecated Type getBaseType(int index) { result = this.getInheritedType(index) }

/**
* Gets any of the base types of this type declaration. Expands protocols added in
* extensions and expands type aliases. For example in the following code, `B` has
Expand All @@ -58,14 +41,6 @@ module Impl {
)
}

/**
* Gets the declaration of the `index`th base type of this type declaration (0-based).
* DEPRECATED: The index is not very meaningful here. Use `getABaseTypeDecl`.
*/
deprecated TypeDecl getBaseTypeDecl(int i) {
result = this.getBaseType(i).(AnyGenericType).getDeclaration()
}

/**
* Gets the declaration of any of the base types of this type declaration. Expands
* protocols added in extensions and expands type aliases. For example in the following
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,6 @@ module Impl {
* whereas `y` as in `if case .some(y) = ...` is instead an `ExprPattern`.
*/
class NamedPattern extends Generated::NamedPattern {
/**
* Holds if this named pattern has a corresponding `VarDecl`, which is currently always true.
*
* DEPRECATED: unless there was a compilation error, this will always hold.
*/
deprecated predicate hasVarDecl() { exists(this.getVarDecl()) }

/**
* Gets the name of the variable bound by this pattern.
*/
Expand Down
Loading