Skip to content

Commit ec5d465

Browse files
committed
ast-exporter: In VisitExpr, handle when Begin and End start off in different macros
1 parent 74ab1d8 commit ec5d465

3 files changed

Lines changed: 196 additions & 227 deletions

File tree

c2rust-ast-exporter/src/AstExporter.cpp

Lines changed: 56 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1426,10 +1426,7 @@ class TranslateASTVisitor final
14261426
LLVM_DEBUG(Range.getBegin().dump(Mgr));
14271427
LLVM_DEBUG(Range.getEnd().dump(Mgr));
14281428

1429-
// Check that we are only expanding a single macro call.
1430-
if (!Range.getBegin().isMacroID() || !Range.getEnd().isMacroID()
1431-
|| Mgr.getImmediateMacroCallerLoc(Range.getBegin())
1432-
!= Mgr.getImmediateMacroCallerLoc(Range.getEnd())) {
1429+
if (!Range.getBegin().isMacroID() || !Range.getEnd().isMacroID()) {
14331430
return true;
14341431
}
14351432

@@ -1452,21 +1449,9 @@ class TranslateASTVisitor final
14521449
return true;
14531450
}
14541451

1455-
auto ReplacementBegin = mac->getReplacementToken(0).getLocation();
1456-
auto ReplacementEnd = mac->getDefinitionEndLoc();
1457-
// Verify that this expansion covers the entire macro replacement
1458-
// definition, i.e. E is not a subexpression of the macro
1459-
// replacement.
1460-
if (Mgr.getSpellingLoc(Range.getBegin()) != ReplacementBegin ||
1461-
Mgr.getSpellingLoc(Range.getEnd()) != ReplacementEnd) {
1462-
return true;
1463-
}
1464-
14651452
if (VisitMacro(name, ExpansionRange.getBegin(), mac, E)) {
14661453
curMacroExpansionStack.push_back(mac);
14671454
}
1468-
1469-
Range = ExpansionRange.getAsRange();
14701455
}
14711456

14721457
return true;
@@ -1476,18 +1461,72 @@ class TranslateASTVisitor final
14761461
auto &Mgr = Context->getSourceManager();
14771462
auto Begin = Range.getBegin();
14781463
auto End = Range.getEnd();
1479-
14801464
std::vector<CharSourceRange> ExpansionStack;
14811465

14821466
do {
1467+
if (!isAtStartOfImmediateMacroExpansion(Begin)) {
1468+
break;
1469+
}
1470+
14831471
auto ExpansionRange = Mgr.getImmediateExpansionRange(Begin);
14841472
ExpansionStack.push_back(ExpansionRange);
14851473
Begin = ExpansionRange.getBegin();
14861474
} while (Begin.isMacroID());
14871475

1476+
// Find the point at which `Begin` and `End` converge on the same expansion range.
1477+
// This is where the expression in `Range` first corresponds to a single macro call.
1478+
auto ConvergencePoint = ExpansionStack.end();
1479+
1480+
do {
1481+
if (!isAtEndOfImmediateMacroExpansion(End)) {
1482+
break;
1483+
}
1484+
1485+
auto ExpansionRange = Mgr.getImmediateExpansionRange(End);
1486+
ConvergencePoint = std::find_if(
1487+
ExpansionStack.begin(),
1488+
ExpansionStack.end(),
1489+
[ExpansionRange](auto &R) {
1490+
return R.getAsRange() == ExpansionRange.getAsRange() &&
1491+
R.isTokenRange() == ExpansionRange.isTokenRange();
1492+
}
1493+
);
1494+
End = ExpansionRange.getEnd();
1495+
} while (End.isMacroID() && ConvergencePoint == ExpansionStack.end());
1496+
1497+
// Remove all elements before the convergence point.
1498+
ExpansionStack.erase(ExpansionStack.begin(), ConvergencePoint);
1499+
1500+
// Ensure the remaining ranges still correspond to the input `Range`.
1501+
auto EraseAfter = std::find_if(
1502+
ExpansionStack.begin(),
1503+
ExpansionStack.end(),
1504+
[this](auto &R) {
1505+
auto End = R.getEnd();
1506+
return End.isMacroID() && !isAtEndOfImmediateMacroExpansion(End);
1507+
}
1508+
);
1509+
auto EraseFrom = EraseAfter + 1;
1510+
1511+
if (EraseFrom < ExpansionStack.end()) {
1512+
ExpansionStack.erase(EraseFrom, ExpansionStack.end());
1513+
}
1514+
14881515
return ExpansionStack;
14891516
}
14901517

1518+
bool isAtStartOfImmediateMacroExpansion(SourceLocation loc) const {
1519+
auto &Mgr = Context->getSourceManager();
1520+
return Mgr.isAtStartOfImmediateMacroExpansion(loc);
1521+
}
1522+
1523+
bool isAtEndOfImmediateMacroExpansion(SourceLocation loc) const {
1524+
auto &Mgr = Context->getSourceManager();
1525+
auto spellingLoc = Mgr.getSpellingLoc(loc);
1526+
auto len = Lexer::MeasureTokenLength(spellingLoc, Mgr, Context->getLangOpts());
1527+
return Mgr.isAtEndOfImmediateMacroExpansion(loc.getLocWithOffset(len));
1528+
}
1529+
14911530
bool VisitVAArgExpr(VAArgExpr *E) {
14921531
std::vector<void *> childIds{E->getSubExpr()};
14931532
encode_entry(E, TagVAArgExpr, childIds);

c2rust-transpile/tests/snapshots/snapshots__transpile@macros.c.2021.clang15.snap

Lines changed: 70 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ pub const NESTED_CHAR: ::core::ffi::c_int = LITERAL_CHAR;
5858
pub const NESTED_STR: [::core::ffi::c_char; 6] = LITERAL_STR;
5959
pub const NESTED_ARRAY: [::core::ffi::c_int; 3] = LITERAL_ARRAY;
6060
pub const NESTED_STRUCT: S = LITERAL_STRUCT;
61+
pub const NEGATIVE_INT: ::core::ffi::c_int = -LITERAL_INT;
62+
pub const INT_ARITHMETIC: ::core::ffi::c_int = NESTED_INT + LITERAL_INT + 1 as ::core::ffi::c_int;
63+
pub const MIXED_ARITHMETIC: ::core::ffi::c_double = LITERAL_INT as ::core::ffi::c_double
64+
+ NESTED_FLOAT * LITERAL_CHAR as ::core::ffi::c_double
65+
- true_0 as ::core::ffi::c_double;
6166
pub const PARENS: ::core::ffi::c_int = NESTED_INT * (LITERAL_CHAR + true_0);
6267
pub const PTR_ARITHMETIC: *const ::core::ffi::c_char = unsafe {
6368
LITERAL_STR
@@ -66,7 +71,24 @@ pub const PTR_ARITHMETIC: *const ::core::ffi::c_char = unsafe {
6671
.offset(-(3 as ::core::ffi::c_int as isize))
6772
};
6873
pub const WIDENING_CAST: ::core::ffi::c_ulonglong = LITERAL_INT as ::core::ffi::c_ulonglong;
74+
pub const NARROWING_CAST: ::core::ffi::c_char = LITERAL_INT as ::core::ffi::c_char;
6975
pub const CONVERSION_CAST: ::core::ffi::c_double = LITERAL_INT as ::core::ffi::c_double;
76+
pub const INDEXING: ::core::ffi::c_char = NESTED_STR[LITERAL_FLOAT as ::core::ffi::c_int as usize];
77+
pub const STR_CONCATENATION: [::core::ffi::c_char; 18] = unsafe {
78+
::core::mem::transmute::<[u8; 18], [::core::ffi::c_char; 18]>(*b"hello hello world\0")
79+
};
80+
pub const REF_MACRO: *const ::core::ffi::c_char = unsafe {
81+
NESTED_STR
82+
.as_ptr()
83+
.offset(LITERAL_FLOAT as ::core::ffi::c_int as isize) as *const ::core::ffi::c_char
84+
};
85+
pub const REF_LITERAL: *mut S = &LITERAL_STRUCT as *const S as *mut S;
86+
pub const TERNARY: ::core::ffi::c_int = if LITERAL_BOOL != 0 {
87+
1 as ::core::ffi::c_int
88+
} else {
89+
2 as ::core::ffi::c_int
90+
};
91+
pub const MEMBER: ::core::ffi::c_int = LITERAL_STRUCT.i;
7092
#[no_mangle]
7193
pub unsafe extern "C" fn local_muts() {
7294
let mut literal_int: ::core::ffi::c_int = LITERAL_INT;
@@ -85,45 +107,28 @@ pub unsafe extern "C" fn local_muts() {
85107
let mut nested_str: [::core::ffi::c_char; 6] = NESTED_STR;
86108
let mut nested_array: [::core::ffi::c_int; 3] = NESTED_ARRAY;
87109
let mut nested_struct: S = NESTED_STRUCT;
88-
let mut negative_int: ::core::ffi::c_int = -LITERAL_INT;
89-
let mut int_arithmetic: ::core::ffi::c_int = NESTED_INT + LITERAL_INT + 1 as ::core::ffi::c_int;
90-
let mut mixed_arithmetic: ::core::ffi::c_float = (LITERAL_INT as ::core::ffi::c_double
91-
+ NESTED_FLOAT * LITERAL_CHAR as ::core::ffi::c_double
92-
- true_0 as ::core::ffi::c_double)
93-
as ::core::ffi::c_float;
110+
let mut negative_int: ::core::ffi::c_int = NEGATIVE_INT;
111+
let mut int_arithmetic: ::core::ffi::c_int = INT_ARITHMETIC;
112+
let mut mixed_arithmetic: ::core::ffi::c_float = MIXED_ARITHMETIC as ::core::ffi::c_float;
94113
let mut parens: ::core::ffi::c_int = PARENS;
95114
let mut ptr_arithmetic: *const ::core::ffi::c_char = PTR_ARITHMETIC;
96115
let mut widening_cast: ::core::ffi::c_ulonglong = WIDENING_CAST;
97-
let mut narrowing_cast: ::core::ffi::c_char = LITERAL_INT as ::core::ffi::c_char;
116+
let mut narrowing_cast: ::core::ffi::c_char = NARROWING_CAST;
98117
let mut conversion_cast: ::core::ffi::c_double = CONVERSION_CAST;
99-
let mut indexing: ::core::ffi::c_char =
100-
NESTED_STR[LITERAL_FLOAT as ::core::ffi::c_int as usize];
101-
let mut str_concatenation_ptr: *const ::core::ffi::c_char =
102-
b"hello hello world\0".as_ptr() as *const ::core::ffi::c_char;
103-
let mut str_concatenation: [::core::ffi::c_char; 18] =
104-
::core::mem::transmute::<[u8; 18], [::core::ffi::c_char; 18]>(*b"hello hello world\0");
118+
let mut indexing: ::core::ffi::c_char = INDEXING;
119+
let mut str_concatenation_ptr: *const ::core::ffi::c_char = STR_CONCATENATION.as_ptr();
120+
let mut str_concatenation: [::core::ffi::c_char; 18] = STR_CONCATENATION;
105121
let mut builtin: ::core::ffi::c_int =
106122
(LITERAL_INT as ::core::ffi::c_uint).leading_zeros() as i32;
107-
let mut ref_indexing: *const ::core::ffi::c_char = NESTED_STR
108-
.as_ptr()
109-
.offset(LITERAL_FLOAT as ::core::ffi::c_int as isize)
110-
as *const ::core::ffi::c_char;
111-
let mut ref_struct: *const S = &mut LITERAL_STRUCT as *mut S;
112-
let mut ternary: ::core::ffi::c_int = if LITERAL_BOOL != 0 {
113-
1 as ::core::ffi::c_int
114-
} else {
115-
2 as ::core::ffi::c_int
116-
};
117-
let mut member: ::core::ffi::c_int = LITERAL_STRUCT.i;
123+
let mut ref_indexing: *const ::core::ffi::c_char = REF_MACRO;
124+
let mut ref_struct: *const S = REF_LITERAL;
125+
let mut ternary: ::core::ffi::c_int = TERNARY;
126+
let mut member: ::core::ffi::c_int = MEMBER;
118127
let mut stmt_expr: ::core::ffi::c_float = ({
119128
let mut builtin_0: ::core::ffi::c_int =
120129
(LITERAL_INT as ::core::ffi::c_uint).leading_zeros() as i32;
121-
let mut indexing_0: ::core::ffi::c_char =
122-
NESTED_STR[LITERAL_FLOAT as ::core::ffi::c_int as usize];
123-
let mut mixed: ::core::ffi::c_float = (LITERAL_INT as ::core::ffi::c_double
124-
+ NESTED_FLOAT * LITERAL_CHAR as ::core::ffi::c_double
125-
- true_0 as ::core::ffi::c_double)
126-
as ::core::ffi::c_float;
130+
let mut indexing_0: ::core::ffi::c_char = INDEXING;
131+
let mut mixed: ::core::ffi::c_float = MIXED_ARITHMETIC as ::core::ffi::c_float;
127132
let mut i: ::core::ffi::c_int = 0 as ::core::ffi::c_int;
128133
while i < builtin_0 {
129134
mixed += indexing_0 as ::core::ffi::c_float;
@@ -150,43 +155,27 @@ pub unsafe extern "C" fn local_consts() {
150155
let nested_str: [::core::ffi::c_char; 6] = NESTED_STR;
151156
let nested_array: [::core::ffi::c_int; 3] = NESTED_ARRAY;
152157
let nested_struct: S = NESTED_STRUCT;
153-
let negative_int: ::core::ffi::c_int = -LITERAL_INT;
154-
let int_arithmetic: ::core::ffi::c_int = NESTED_INT + LITERAL_INT + 1 as ::core::ffi::c_int;
155-
let mixed_arithmetic: ::core::ffi::c_float = (LITERAL_INT as ::core::ffi::c_double
156-
+ NESTED_FLOAT * LITERAL_CHAR as ::core::ffi::c_double
157-
- true_0 as ::core::ffi::c_double)
158-
as ::core::ffi::c_float;
158+
let negative_int: ::core::ffi::c_int = NEGATIVE_INT;
159+
let int_arithmetic: ::core::ffi::c_int = INT_ARITHMETIC;
160+
let mixed_arithmetic: ::core::ffi::c_float = MIXED_ARITHMETIC as ::core::ffi::c_float;
159161
let parens: ::core::ffi::c_int = PARENS;
160162
let ptr_arithmetic: *const ::core::ffi::c_char = PTR_ARITHMETIC;
161163
let widening_cast: ::core::ffi::c_ulonglong = WIDENING_CAST;
162-
let narrowing_cast: ::core::ffi::c_char = LITERAL_INT as ::core::ffi::c_char;
164+
let narrowing_cast: ::core::ffi::c_char = NARROWING_CAST;
163165
let conversion_cast: ::core::ffi::c_double = CONVERSION_CAST;
164-
let indexing: ::core::ffi::c_char = NESTED_STR[LITERAL_FLOAT as ::core::ffi::c_int as usize];
165-
let str_concatenation_ptr: *const ::core::ffi::c_char =
166-
b"hello hello world\0".as_ptr() as *const ::core::ffi::c_char;
167-
let str_concatenation: [::core::ffi::c_char; 18] =
168-
::core::mem::transmute::<[u8; 18], [::core::ffi::c_char; 18]>(*b"hello hello world\0");
166+
let indexing: ::core::ffi::c_char = INDEXING;
167+
let str_concatenation_ptr: *const ::core::ffi::c_char = STR_CONCATENATION.as_ptr();
168+
let str_concatenation: [::core::ffi::c_char; 18] = STR_CONCATENATION;
169169
let builtin: ::core::ffi::c_int = (LITERAL_INT as ::core::ffi::c_uint).leading_zeros() as i32;
170-
let ref_indexing: *const ::core::ffi::c_char = NESTED_STR
171-
.as_ptr()
172-
.offset(LITERAL_FLOAT as ::core::ffi::c_int as isize)
173-
as *const ::core::ffi::c_char;
174-
let ref_struct: *const S = &mut LITERAL_STRUCT as *mut S;
175-
let ternary: ::core::ffi::c_int = if LITERAL_BOOL != 0 {
176-
1 as ::core::ffi::c_int
177-
} else {
178-
2 as ::core::ffi::c_int
179-
};
180-
let member: ::core::ffi::c_int = LITERAL_STRUCT.i;
170+
let ref_indexing: *const ::core::ffi::c_char = REF_MACRO;
171+
let ref_struct: *const S = REF_LITERAL;
172+
let ternary: ::core::ffi::c_int = TERNARY;
173+
let member: ::core::ffi::c_int = MEMBER;
181174
let stmt_expr: ::core::ffi::c_float = ({
182175
let mut builtin_0: ::core::ffi::c_int =
183176
(LITERAL_INT as ::core::ffi::c_uint).leading_zeros() as i32;
184-
let mut indexing_0: ::core::ffi::c_char =
185-
NESTED_STR[LITERAL_FLOAT as ::core::ffi::c_int as usize];
186-
let mut mixed: ::core::ffi::c_float = (LITERAL_INT as ::core::ffi::c_double
187-
+ NESTED_FLOAT * LITERAL_CHAR as ::core::ffi::c_double
188-
- true_0 as ::core::ffi::c_double)
189-
as ::core::ffi::c_float;
177+
let mut indexing_0: ::core::ffi::c_char = INDEXING;
178+
let mut mixed: ::core::ffi::c_float = MIXED_ARITHMETIC as ::core::ffi::c_float;
190179
let mut i: ::core::ffi::c_int = 0 as ::core::ffi::c_int;
191180
while i < builtin_0 {
192181
mixed += indexing_0 as ::core::ffi::c_float;
@@ -215,30 +204,25 @@ static mut global_static_const_nested_str_ptr: *const ::core::ffi::c_char = NEST
215204
static mut global_static_const_nested_str: [::core::ffi::c_char; 6] = NESTED_STR;
216205
static mut global_static_const_nested_array: [::core::ffi::c_int; 3] = NESTED_ARRAY;
217206
static mut global_static_const_nested_struct: S = NESTED_STRUCT;
218-
static mut global_static_const_negative_int: ::core::ffi::c_int = -LITERAL_INT;
219-
static mut global_static_const_int_arithmetic: ::core::ffi::c_int =
220-
NESTED_INT + LITERAL_INT + 1 as ::core::ffi::c_int;
207+
static mut global_static_const_negative_int: ::core::ffi::c_int = NEGATIVE_INT;
208+
static mut global_static_const_int_arithmetic: ::core::ffi::c_int = INT_ARITHMETIC;
221209
static mut global_static_const_mixed_arithmetic: ::core::ffi::c_float =
222-
(LITERAL_INT as ::core::ffi::c_double + NESTED_FLOAT * LITERAL_CHAR as ::core::ffi::c_double
223-
- true_0 as ::core::ffi::c_double) as ::core::ffi::c_float;
210+
MIXED_ARITHMETIC as ::core::ffi::c_float;
224211
static mut global_static_const_parens: ::core::ffi::c_int = PARENS;
225212
static mut global_static_const_ptr_arithmetic: *const ::core::ffi::c_char =
226213
::core::ptr::null::<::core::ffi::c_char>();
227214
static mut global_static_const_widening_cast: ::core::ffi::c_ulonglong = WIDENING_CAST;
228-
static mut global_static_const_narrowing_cast: ::core::ffi::c_char =
229-
LITERAL_INT as ::core::ffi::c_char;
215+
static mut global_static_const_narrowing_cast: ::core::ffi::c_char = NARROWING_CAST;
230216
static mut global_static_const_conversion_cast: ::core::ffi::c_double = CONVERSION_CAST;
231217
static mut global_static_const_indexing: ::core::ffi::c_char = 0;
232218
static mut global_static_const_str_concatenation_ptr: *const ::core::ffi::c_char =
233-
b"hello hello world\0".as_ptr() as *const ::core::ffi::c_char;
234-
static mut global_static_const_str_concatenation: [::core::ffi::c_char; 18] = unsafe {
235-
::core::mem::transmute::<[u8; 18], [::core::ffi::c_char; 18]>(*b"hello hello world\0")
236-
};
219+
STR_CONCATENATION.as_ptr();
220+
static mut global_static_const_str_concatenation: [::core::ffi::c_char; 18] = STR_CONCATENATION;
237221
static mut global_static_const_builtin: ::core::ffi::c_int =
238222
(LITERAL_INT as ::core::ffi::c_uint).leading_zeros() as i32;
239223
static mut global_static_const_ref_indexing: *const ::core::ffi::c_char =
240224
::core::ptr::null::<::core::ffi::c_char>();
241-
static mut global_static_const_ref_struct: *const S = &LITERAL_STRUCT as *const S as *mut S;
225+
static mut global_static_const_ref_struct: *const S = REF_LITERAL;
242226
static mut global_static_const_ternary: ::core::ffi::c_int = 0;
243227
static mut global_static_const_member: ::core::ffi::c_int = 0;
244228
#[no_mangle]
@@ -278,14 +262,12 @@ pub static mut global_const_nested_array: [::core::ffi::c_int; 3] = NESTED_ARRAY
278262
#[no_mangle]
279263
pub static mut global_const_nested_struct: S = NESTED_STRUCT;
280264
#[no_mangle]
281-
pub static mut global_const_negative_int: ::core::ffi::c_int = -LITERAL_INT;
265+
pub static mut global_const_negative_int: ::core::ffi::c_int = NEGATIVE_INT;
282266
#[no_mangle]
283-
pub static mut global_const_int_arithmetic: ::core::ffi::c_int =
284-
NESTED_INT + LITERAL_INT + 1 as ::core::ffi::c_int;
267+
pub static mut global_const_int_arithmetic: ::core::ffi::c_int = INT_ARITHMETIC;
285268
#[no_mangle]
286269
pub static mut global_const_mixed_arithmetic: ::core::ffi::c_float =
287-
(LITERAL_INT as ::core::ffi::c_double + NESTED_FLOAT * LITERAL_CHAR as ::core::ffi::c_double
288-
- true_0 as ::core::ffi::c_double) as ::core::ffi::c_float;
270+
MIXED_ARITHMETIC as ::core::ffi::c_float;
289271
#[no_mangle]
290272
pub static mut global_const_parens: ::core::ffi::c_int = PARENS;
291273
#[no_mangle]
@@ -294,27 +276,24 @@ pub static mut global_const_ptr_arithmetic: *const ::core::ffi::c_char =
294276
#[no_mangle]
295277
pub static mut global_const_widening_cast: ::core::ffi::c_ulonglong = WIDENING_CAST;
296278
#[no_mangle]
297-
pub static mut global_const_narrowing_cast: ::core::ffi::c_char =
298-
LITERAL_INT as ::core::ffi::c_char;
279+
pub static mut global_const_narrowing_cast: ::core::ffi::c_char = NARROWING_CAST;
299280
#[no_mangle]
300281
pub static mut global_const_conversion_cast: ::core::ffi::c_double = CONVERSION_CAST;
301282
#[no_mangle]
302283
pub static mut global_const_indexing: ::core::ffi::c_char = 0;
303284
#[no_mangle]
304285
pub static mut global_const_str_concatenation_ptr: *const ::core::ffi::c_char =
305-
b"hello hello world\0".as_ptr() as *const ::core::ffi::c_char;
286+
STR_CONCATENATION.as_ptr();
306287
#[no_mangle]
307-
pub static mut global_const_str_concatenation: [::core::ffi::c_char; 18] = unsafe {
308-
::core::mem::transmute::<[u8; 18], [::core::ffi::c_char; 18]>(*b"hello hello world\0")
309-
};
288+
pub static mut global_const_str_concatenation: [::core::ffi::c_char; 18] = STR_CONCATENATION;
310289
#[no_mangle]
311290
pub static mut global_const_builtin: ::core::ffi::c_int =
312291
(LITERAL_INT as ::core::ffi::c_uint).leading_zeros() as i32;
313292
#[no_mangle]
314293
pub static mut global_const_ref_indexing: *const ::core::ffi::c_char =
315294
::core::ptr::null::<::core::ffi::c_char>();
316295
#[no_mangle]
317-
pub static mut global_const_ref_struct: *const S = &LITERAL_STRUCT as *const S as *mut S;
296+
pub static mut global_const_ref_struct: *const S = REF_LITERAL;
318297
#[no_mangle]
319298
pub static mut global_const_ternary: ::core::ffi::c_int = 0;
320299
#[no_mangle]
@@ -420,29 +399,15 @@ pub unsafe extern "C" fn late_init_var() -> ::core::ffi::c_int {
420399
}
421400
unsafe extern "C" fn c2rust_run_static_initializers() {
422401
global_static_const_ptr_arithmetic = PTR_ARITHMETIC;
423-
global_static_const_indexing = NESTED_STR[LITERAL_FLOAT as ::core::ffi::c_int as usize];
424-
global_static_const_ref_indexing = NESTED_STR
425-
.as_ptr()
426-
.offset(LITERAL_FLOAT as ::core::ffi::c_int as isize)
427-
as *const ::core::ffi::c_char;
428-
global_static_const_ternary = if LITERAL_BOOL != 0 {
429-
1 as ::core::ffi::c_int
430-
} else {
431-
2 as ::core::ffi::c_int
432-
};
433-
global_static_const_member = LITERAL_STRUCT.i;
402+
global_static_const_indexing = INDEXING;
403+
global_static_const_ref_indexing = REF_MACRO;
404+
global_static_const_ternary = TERNARY;
405+
global_static_const_member = MEMBER;
434406
global_const_ptr_arithmetic = PTR_ARITHMETIC;
435-
global_const_indexing = NESTED_STR[LITERAL_FLOAT as ::core::ffi::c_int as usize];
436-
global_const_ref_indexing = NESTED_STR
437-
.as_ptr()
438-
.offset(LITERAL_FLOAT as ::core::ffi::c_int as isize)
439-
as *const ::core::ffi::c_char;
440-
global_const_ternary = if LITERAL_BOOL != 0 {
441-
1 as ::core::ffi::c_int
442-
} else {
443-
2 as ::core::ffi::c_int
444-
};
445-
global_const_member = LITERAL_STRUCT.i;
407+
global_const_indexing = INDEXING;
408+
global_const_ref_indexing = REF_MACRO;
409+
global_const_ternary = TERNARY;
410+
global_const_member = MEMBER;
446411
}
447412
#[used]
448413
#[cfg_attr(target_os = "linux", link_section = ".init_array")]

0 commit comments

Comments
 (0)