[torque] Don't generate field lists for classes with undefined layout

Minor cleanup: some classes in Torque don't yet have any definitions for
their fields, so it doesn't make sense to emit field layout macros for
those classes.

Bug: v8:7793
Change-Id: Iee38aa3cbe684f4a63329a676e2e94944dc05de1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1925010
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Seth Brenith <seth.brenith@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#65054}
This commit is contained in:
Seth Brenith 2019-11-19 10:05:41 -08:00 committed by Commit Bot
parent f2a74165bf
commit c5f1012322

View File

@ -3037,7 +3037,7 @@ void ImplementationVisitor::GenerateClassFieldOffsets(
// TODO(danno): Remove this once all classes use ClassFieldOffsetGenerator
// to generate field offsets without the use of macros.
if (!type->GenerateCppClassDefinitions()) {
if (!type->GenerateCppClassDefinitions() && !type->HasUndefinedLayout()) {
MacroFieldOffsetsGenerator g(header, type);
for (auto f : type->fields()) {
CurrentSourcePosition::Scope scope(f.pos);