diff options
Diffstat (limited to 'src/passes/Strip.cpp')
-rw-r--r-- | src/passes/Strip.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/passes/Strip.cpp b/src/passes/Strip.cpp index fe3476202..19bc099de 100644 --- a/src/passes/Strip.cpp +++ b/src/passes/Strip.cpp @@ -31,19 +31,19 @@ struct Strip : public Pass { bool requiresNonNullableLocalFixups() override { return false; } // A function that returns true if the method should be removed. - using Decider = std::function<bool(UserSection&)>; + using Decider = std::function<bool(CustomSection&)>; Decider decider; Strip(Decider decider) : decider(decider) {} void run(Module* module) override { // Remove name and debug sections. - auto& sections = module->userSections; + auto& sections = module->customSections; sections.erase(std::remove_if(sections.begin(), sections.end(), decider), sections.end()); // If we're cleaning up debug info, clear on the function and module too. - UserSection temp; - temp.name = BinaryConsts::UserSections::Name; + CustomSection temp; + temp.name = BinaryConsts::CustomSections::Name; if (decider(temp)) { module->clearDebugInfo(); for (auto& func : module->functions) { @@ -55,22 +55,22 @@ struct Strip : public Pass { }; Pass* createStripDebugPass() { - return new Strip([&](const UserSection& curr) { - return curr.name == BinaryConsts::UserSections::Name || - curr.name == BinaryConsts::UserSections::SourceMapUrl || + return new Strip([&](const CustomSection& curr) { + return curr.name == BinaryConsts::CustomSections::Name || + curr.name == BinaryConsts::CustomSections::SourceMapUrl || curr.name.find(".debug") == 0 || curr.name.find("reloc..debug") == 0; }); } Pass* createStripDWARFPass() { - return new Strip([&](const UserSection& curr) { + return new Strip([&](const CustomSection& curr) { return curr.name.find(".debug") == 0 || curr.name.find("reloc..debug") == 0; }); } Pass* createStripProducersPass() { - return new Strip([&](const UserSection& curr) { - return curr.name == BinaryConsts::UserSections::Producers; + return new Strip([&](const CustomSection& curr) { + return curr.name == BinaryConsts::CustomSections::Producers; }); } |