Skip to content

Commit cf93075

Browse files
committed
needs_autoref -> is_index_base
1 parent 9e39c35 commit cf93075

11 files changed

Lines changed: 13 additions & 13 deletions

File tree

cpp2rust/converter/converter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3702,7 +3702,7 @@ std::string Converter::ConvertPlaceholder(clang::Expr *expr, clang::Expr *arg,
37023702
Buffer buf(*this);
37033703
PushExplicitAutoref autoref(
37043704
*this,
3705-
ph_ctx.needs_autoref
3705+
ph_ctx.is_index_base
37063706
? std::optional(ph_ctx.access == TranslationRule::Access::kWrite)
37073707
: std::nullopt);
37083708
ConvertDeref(arg);
@@ -3779,7 +3779,7 @@ std::string Converter::ConvertIRFragment(
37793779
.maps_to_rust_ptr = Mapper::MapsToPointer(arg->getType()),
37803780
.declared_in_rule_as_rust_ptr =
37813781
Mapper::ParamIsPointer(GetCalleeOrExpr(expr), arg_idx),
3782-
.needs_autoref = ph->needs_autoref,
3782+
.is_index_base = ph->is_index_base,
37833783
};
37843784
result += ConvertPlaceholder(expr, arg, ph_ctx);
37853785
} else if (auto *mc =

cpp2rust/converter/converter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ class Converter : public clang::RecursiveASTVisitor<Converter> {
185185
bool is_cpp_ptr;
186186
bool maps_to_rust_ptr;
187187
bool declared_in_rule_as_rust_ptr;
188-
bool needs_autoref;
188+
bool is_index_base;
189189

190190
bool needs_materialization() const {
191191
return materialize_ctx && materialize_idx >= 0 &&

cpp2rust/converter/translation_rule.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ ParsePlaceholderFragmentJSON(const llvm::json::Object &obj) {
4848
return {
4949
(unsigned)*obj.getInteger("arg"),
5050
ParseAccessJSON(*access),
51-
obj.getBoolean("needs_autoref").value_or(false),
51+
obj.getBoolean("is_index_base").value_or(false),
5252
};
5353
}
5454

cpp2rust/converter/translation_rule.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ enum class Access { kRead, kWrite, kMove };
2626
struct PlaceholderFragment {
2727
unsigned n; // "a0", "a1", ...
2828
Access access;
29-
bool needs_autoref = false;
29+
bool is_index_base = false;
3030

3131
void dump() const;
3232
};

rule-preprocessor/src/ir.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ pub struct PlaceholderInner {
140140
pub arg: i32,
141141
pub access: Access,
142142
#[serde(default, skip_serializing_if = "std::ops::Not::not")]
143-
pub needs_autoref: bool,
143+
pub is_index_base: bool,
144144
}
145145

146146
#[derive(Debug, Clone, Serialize, Deserialize)]

rule-preprocessor/src/semantic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ impl<'a, 'tcx> AstVisitor<'a, 'tcx> {
220220
if p.access == Access::Unknown {
221221
p.access = context;
222222
}
223-
p.needs_autoref = true;
223+
p.is_index_base = true;
224224
});
225225
return;
226226
}

rule-preprocessor/src/syntactic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ impl<'a> FragmentCtx<'a> {
190190
placeholder: PlaceholderInner {
191191
arg: token.text()[1..].parse().unwrap_or(0),
192192
access,
193-
needs_autoref: false,
193+
is_index_base: false,
194194
},
195195
});
196196
return;

rules/string/ir_refcount.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"placeholder": {
1212
"arg": 0,
1313
"access": "read",
14-
"needs_autoref": true
14+
"is_index_base": true
1515
}
1616
},
1717
{

rules/string/ir_unsafe.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"placeholder": {
1212
"arg": 0,
1313
"access": "read",
14-
"needs_autoref": true
14+
"is_index_base": true
1515
}
1616
},
1717
{
@@ -1196,7 +1196,7 @@
11961196
"placeholder": {
11971197
"arg": 0,
11981198
"access": "write",
1199-
"needs_autoref": true
1199+
"is_index_base": true
12001200
}
12011201
},
12021202
{

rules/vector/ir_refcount.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2099,7 +2099,7 @@
20992099
"placeholder": {
21002100
"arg": 0,
21012101
"access": "read",
2102-
"needs_autoref": true
2102+
"is_index_base": true
21032103
}
21042104
},
21052105
{

0 commit comments

Comments
 (0)