summaryrefslogtreecommitdiff
path: root/src/passes/Strip.cpp
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2022-11-22 13:20:14 -0800
committerGitHub <noreply@github.com>2022-11-22 21:20:14 +0000
commit09ce29d4ab6fd03a9e777f7244154f504a6c0113 (patch)
tree13a4d7b68e9df9d98d08addb8c184a9a3f49d7b2 /src/passes/Strip.cpp
parent776c15a1ae4a6c8b97784bd60c6696fdb4e626ef (diff)
downloadbinaryen-09ce29d4ab6fd03a9e777f7244154f504a6c0113.tar.gz
binaryen-09ce29d4ab6fd03a9e777f7244154f504a6c0113.tar.bz2
binaryen-09ce29d4ab6fd03a9e777f7244154f504a6c0113.zip
Rename UserSection -> CustomSection. NFC (#5288)
This reflects that naming used in the spec.
Diffstat (limited to 'src/passes/Strip.cpp')
-rw-r--r--src/passes/Strip.cpp20
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;
});
}