Rename IfLet::else_branch to IfLet::else_

This commit is contained in:
Arthur Baars
2024-09-06 18:40:03 +02:00
parent e8277015ab
commit 406d03edfc
6 changed files with 15 additions and 16 deletions

4
rust/.generated.list generated
View File

@@ -154,7 +154,7 @@ ql/lib/codeql/rust/generated/Field.qll c3249b8dd1aed1978077875fbd6090327d431af8c
ql/lib/codeql/rust/generated/File.qll 2eff5c882d044d2e360fe6382fb55e5a45f6ccb9df323cfa1fae41eae9d2a47f 87e7a906b3a1b4de056952e288ddd7f69fa7cb1bd9dc7dd3972868a9002ac1e4
ql/lib/codeql/rust/generated/Function.qll 8d5607035adebdb5f1a80ac2688b57ca751bfc010295e4982e6a432d402fc523 337d5aebc38e4413b8a87af87ea91219a51a46d1a04dd8f124b6431dba034a67
ql/lib/codeql/rust/generated/If.qll b8040f4bdc6ca2db2cf0435edd9aca432d1ba5f36170f5588a7746f0e4174c51 6033f72ff2d0d3b640b0ef8399d8ef39bc1eec33242a1567cd7dc5ccd2463797
ql/lib/codeql/rust/generated/IfLet.qll 0f51d1f708282a622d075e635698b2020b7d21e77abad6ea12516af13edb5d06 1b9f9c058c888f77a225025b984145a886928caaad26f20e869d9f8a0f5843b4
ql/lib/codeql/rust/generated/IfLet.qll 8a1b4c0d60cd89093c75d97a225691fa6044fdf6828a14fbf9ead7c9d2445f54 b00937d2507e575403074712cd84298b78d0cc0a1dcf7be65e8c893b2b729724
ql/lib/codeql/rust/generated/Index.qll f1b78db475006a0779a079f9600987932e638bcfaf35ce4e9b2b872798e35d50 7fa2b22497c3bd80161f7e3ef5477c82a0d4f961dce557ed3fd1a62d9f9328f7
ql/lib/codeql/rust/generated/InlineAsm.qll 18d8e206d226779d45c27c83e59fdf21ea4fe55969a9d4edf2e91e58877b5d35 723a4d0293a1df9be124b6aae340cb2814e4be0dc01dec95d001e6f986e0e84c
ql/lib/codeql/rust/generated/ItemStmt.qll b4d2a06fdd00ea90eed2742bacf0a5781b8ad69e24df794ec075d7305220afaa b4d2a06fdd00ea90eed2742bacf0a5781b8ad69e24df794ec075d7305220afaa
@@ -180,7 +180,7 @@ ql/lib/codeql/rust/generated/PathPat.qll 5869c513e1d0cb689589e2c72f3feda18b0f246
ql/lib/codeql/rust/generated/PureSynthConstructors.qll 5eb1fc4f6a04172c34ae31e4931e4bf1f8b72fbe414c5f644731a45372d13573 5eb1fc4f6a04172c34ae31e4931e4bf1f8b72fbe414c5f644731a45372d13573
ql/lib/codeql/rust/generated/Range.qll 6278d78c7fba390f51b107892262f9c679c8a31695861a64268e9b74c9575e46 2cb49b0d5d4281c10bdd7ddf187f144cd8490cd792218e977c4108ba98883e06
ql/lib/codeql/rust/generated/RangePat.qll 6ec95f6cb9c4bd93b38990bb1e3b89b526624305ac6ee7b94e6fb0a2f3db28fc 0e193f3816a7587d5103dba421bc2bf22b869522353d4e3f43d49a792eac6cf4
ql/lib/codeql/rust/generated/Raw.qll 0ca064561f7375659dc2b84ca8881d4f39b85880c9efb7802377787fb58e2052 ad925674e73d113b4d33c8b4fd556770bfbcf9d0ab180dbf0253c61c123bfec7
ql/lib/codeql/rust/generated/Raw.qll 621a8078377cf5574a9e32c162b8c33211cc3105767c013f3b9609ef9f97d24a f3cffaf0cccbcbb007e47a2a8c49882b510f99b131f44d029d990a2d11a7f5f3
ql/lib/codeql/rust/generated/RecordLit.qll ae3c644237abab89e0443dfcf584906a9714792be755ce3f9fcdae5958024243 ae3c644237abab89e0443dfcf584906a9714792be755ce3f9fcdae5958024243
ql/lib/codeql/rust/generated/RecordPat.qll 8c206be87b5738c6107db72cbe4d97a67e55060e92c0a3148fad84092d70f5e7 8c206be87b5738c6107db72cbe4d97a67e55060e92c0a3148fad84092d70f5e7
ql/lib/codeql/rust/generated/Ref.qll d26cc357f65fb51a5c07863406f732debe3dc02542b415b281ec582efa08a362 9d62dd9a99e158abc7b42c4e011a5dd0db4dfbce25ab6fe5c600354c18a236bd

View File

@@ -508,7 +508,7 @@ pub struct IfLet {
pub pat: trap::Label,
pub type_ref: Option<trap::Label>,
pub initializer: Option<trap::Label>,
pub else_branch: Option<trap::Label>,
pub else_: Option<trap::Label>,
}
impl TrapEntry for IfLet {
@@ -527,8 +527,8 @@ impl TrapEntry for IfLet {
if let Some(v) = self.initializer {
out.add_tuple("if_let_initializers", vec![trap::Arg::Label(id), v.into()]);
}
if let Some(v) = self.else_branch {
out.add_tuple("if_let_else_branches", vec![trap::Arg::Label(id), v.into()]);
if let Some(v) = self.else_ {
out.add_tuple("if_let_elses", vec![trap::Arg::Label(id), v.into()]);
}
}
}

View File

@@ -57,16 +57,15 @@ module Generated {
final predicate hasInitializer() { exists(this.getInitializer()) }
/**
* Gets the else branch of this if let, if it exists.
* Gets the else of this if let, if it exists.
*/
Expr getElseBranch() {
result =
Synth::convertExprFromRaw(Synth::convertIfLetToRaw(this).(Raw::IfLet).getElseBranch())
Expr getElse() {
result = Synth::convertExprFromRaw(Synth::convertIfLetToRaw(this).(Raw::IfLet).getElse())
}
/**
* Holds if `getElseBranch()` exists.
* Holds if `getElse()` exists.
*/
final predicate hasElseBranch() { exists(this.getElseBranch()) }
final predicate hasElse() { exists(this.getElse()) }
}
}

View File

@@ -461,9 +461,9 @@ module Raw {
Expr getInitializer() { if_let_initializers(this, result) }
/**
* Gets the else branch of this if let, if it exists.
* Gets the else of this if let, if it exists.
*/
Expr getElseBranch() { if_let_else_branches(this, result) }
Expr getElse() { if_let_elses(this, result) }
}
/**

View File

@@ -361,9 +361,9 @@ if_let_initializers(
);
#keyset[id]
if_let_else_branches(
if_let_elses(
int id: @if_let ref,
int else_branch: @expr ref
int else: @expr ref
);
indices(

View File

@@ -472,7 +472,7 @@ class IfLet(Stmt):
pat: Pat
type_ref: optional[TypeRef]
initializer: optional[Expr]
else_branch: optional[Expr]
else_: optional[Expr]
# Expr {
# expr: ExprId,
# has_semi: bool,