From 3e8464e691ade3c3318a9e0fb82778bb80fca1da Mon Sep 17 00:00:00 2001 From: Alastair Robertson Date: Tue, 11 Jul 2023 09:21:42 -0700 Subject: [PATCH] RemoveIgnored: Set names for removed members to AddPadding::MemberPrefix This means they will be treated as padding, so CodeGen will not try to store any data for them. --- .circleci/config.yml | 4 ++-- oi/type_graph/RemoveIgnored.cpp | 3 ++- test/test_remove_ignored.cpp | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 72578db..1f2d335 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -20,14 +20,14 @@ workflows: - build-gcc oid_test_args: "-ftype-graph" tests_regex: "OidIntegration\\..*" - exclude_regex: ".*inheritance_polymorphic.*|.*pointers_incomplete_containing_struct|.*ignored_a|.*arrays_member_int0" + exclude_regex: ".*inheritance_polymorphic.*|.*pointers_incomplete_containing_struct|.*arrays_member_int0" - test: name: test-typed-data-segment-gcc requires: - build-gcc oid_test_args: "-ftyped-data-segment" tests_regex: "OidIntegration\\..*" - exclude_regex: ".*inheritance_polymorphic.*|.*pointers.*|.*ignored_a|.*arrays_member_int0|.*cycles_.*" + exclude_regex: ".*inheritance_polymorphic.*|.*pointers.*|.*arrays_member_int0|.*cycles_.*" - coverage: name: coverage requires: diff --git a/oi/type_graph/RemoveIgnored.cpp b/oi/type_graph/RemoveIgnored.cpp index 1b4af93..ef342ea 100644 --- a/oi/type_graph/RemoveIgnored.cpp +++ b/oi/type_graph/RemoveIgnored.cpp @@ -15,6 +15,7 @@ */ #include "RemoveIgnored.h" +#include "AddPadding.h" #include "TypeGraph.h" namespace type_graph { @@ -48,7 +49,7 @@ void RemoveIgnored::visit(Class& c) { auto& paddingArray = typeGraph_.makeType(primitive, c.members[i].type().size()); c.members[i] = - Member{paddingArray, c.members[i].name, c.members[i].bitOffset}; + Member{paddingArray, AddPadding::MemberPrefix, c.members[i].bitOffset}; } } diff --git a/test/test_remove_ignored.cpp b/test/test_remove_ignored.cpp index fd57e74..467ac42 100644 --- a/test/test_remove_ignored.cpp +++ b/test/test_remove_ignored.cpp @@ -31,7 +31,7 @@ TEST(RemoveIgnoredTest, Match) { [0] Class: ClassA (size: 12) Member: a (offset: 0) [1] Class: ClassB (size: 4) - Member: b (offset: 4) + Member: __oi_padding (offset: 4) [2] Array: (length: 4) Primitive: int8_t Member: c (offset: 8)