Commit 22e759d4 authored by Seth Brenith's avatar Seth Brenith Committed by Commit Bot

[torque] Don't include builtins headers in non-builtins files

The generated Torque files class-verifiers.cc and class-debug-readers.cc
currently include files which are part of v8_initializers, despite being
used in unrelated build targets. This change removes the unnecessary
inclusions. There is still a lot of code included via all-objects-inl.h,
but that's because these files require full class definitions for every
object type.

Bug: v8:11528
Change-Id: Ib26496f2a30ef576f1101636e0aca2cafbfd1f37
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2743087
Commit-Queue: Seth Brenith <seth.brenith@microsoft.com>
Reviewed-by: 's avatarNico Hartmann <nicohartmann@chromium.org>
Cr-Commit-Position: refs/heads/master@{#73301}
parent 86c5ea9d
......@@ -545,19 +545,18 @@ void ImplementationVisitor::GenerateClassDebugReaders(
h_contents
<< "\n#include \"tools/debug_helper/debug-helper-internal.h\"\n\n";
h_contents << "// Unset a windgi.h macro that causes conflicts.\n";
h_contents << "#ifdef GetBValue\n";
h_contents << "#undef GetBValue\n";
h_contents << "#endif\n\n";
for (const std::string& include_path : GlobalContext::CppIncludes()) {
cc_contents << "#include " << StringLiteralQuote(include_path) << "\n";
}
cc_contents << "#include \"torque-generated/" << file_name << ".h\"\n";
cc_contents << "#include \"torque-generated/"
<< "debug-macros"
<< ".h\"\n";
cc_contents << "#include \"include/v8-internal.h\"\n\n";
const char* kWingdiWorkaround =
"// Unset a wingdi.h macro that causes conflicts.\n"
"#ifdef GetBValue\n"
"#undef GetBValue\n"
"#endif\n\n";
h_contents << kWingdiWorkaround;
cc_contents << "#include \"torque-generated/" << file_name << ".h\"\n\n";
cc_contents << "#include \"src/objects/all-objects-inl.h\"\n";
cc_contents << "#include \"torque-generated/debug-macros.h\"\n\n";
cc_contents << kWingdiWorkaround;
cc_contents << "namespace i = v8::internal;\n\n";
NamespaceScope h_namespaces(h_contents,
......
......@@ -4968,14 +4968,10 @@ void ImplementationVisitor::GenerateClassVerifiers(
IfDefScope verify_heap_h(h_contents, "VERIFY_HEAP");
IfDefScope verify_heap_cc(cc_contents, "VERIFY_HEAP");
cc_contents << "\n#include \"src/objects/objects.h\"\n";
h_contents << "#include \"src/base/macros.h\"\n\n";
for (const std::string& include_path : GlobalContext::CppIncludes()) {
cc_contents << "#include " << StringLiteralQuote(include_path) << "\n";
}
cc_contents << "#include \"torque-generated/" << file_name << ".h\"\n";
cc_contents << "#include "
"\"src/objects/all-objects-inl.h\"\n";
cc_contents << "#include \"torque-generated/" << file_name << ".h\"\n\n";
cc_contents << "#include \"src/objects/all-objects-inl.h\"\n";
IncludeObjectMacrosScope object_macros(cc_contents);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment