Skip to content

Commit ef4f252

Browse files
tromeynikic
authored andcommitted
Fix field names when emitting a C structure
Prepend an underscore to field names when emitting a C structure, to ensure that tuple fields have valid names.
1 parent 5c9a56f commit ef4f252

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lldb/source/Symbol/RustASTContext.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ class RustAggregateBase : public RustType {
454454
if (f.m_name.IsEmpty()) {
455455
name = "__" + std::to_string(argno++);
456456
} else {
457-
name = f.m_name.AsCString();
457+
name = std::string("_") + f.m_name.AsCString();
458458
}
459459
result += rtype->GetCABITypeDeclaration(name_map, name) + "; ";
460460
}

0 commit comments

Comments
 (0)