CodeGen: Add comments explaining the order of passes

This commit is contained in:
Alastair Robertson 2023-07-18 07:52:54 -07:00 committed by Alastair Robertson
parent b4b3e86c47
commit 3b6b739d55

View File

@ -783,6 +783,8 @@ void CodeGen::addDrgnRoot(struct drgn_type* drgnType,
void CodeGen::transform(type_graph::TypeGraph& typeGraph) {
type_graph::PassManager pm;
// 1. Transformation passes
pm.addPass(type_graph::Flattener::createPass());
pm.addPass(type_graph::TypeIdentifier::createPass(config_.passThroughTypes));
if (config_.features[Feature::PolymorphicInheritance]) {
@ -796,11 +798,16 @@ void CodeGen::transform(type_graph::TypeGraph& typeGraph) {
type_graph::TypeIdentifier::createPass(config_.passThroughTypes));
}
pm.addPass(type_graph::RemoveIgnored::createPass(config_.membersToStub));
pm.addPass(type_graph::RemoveTopLevelPointer::createPass());
// 2. Fixup passes to repair type graph after partial transformations
pm.addPass(type_graph::AddPadding::createPass(config_.features));
// 3. Annotation passes
pm.addPass(type_graph::NameGen::createPass());
pm.addPass(type_graph::AlignmentCalc::createPass());
pm.addPass(type_graph::RemoveTopLevelPointer::createPass());
pm.addPass(type_graph::TopoSorter::createPass());
pm.run(typeGraph);
LOG(INFO) << "Sorted types:\n";