Lines Matching full:sec
22 using SectionPred = std::function<bool(const Section &Sec)>;
24 static bool isDebugSection(const Section &Sec) { in isDebugSection() argument
25 return Sec.Name.starts_with(".debug"); in isDebugSection()
28 static bool isLinkerSection(const Section &Sec) { in isLinkerSection() argument
29 return Sec.Name.starts_with("reloc.") || Sec.Name == "linking"; in isLinkerSection()
32 static bool isNameSection(const Section &Sec) { return Sec.Name == "name"; } in isNameSection() argument
36 static bool isCommentSection(const Section &Sec) { in isCommentSection() argument
37 return Sec.Name == "producers"; in isCommentSection()
42 for (const Section &Sec : Obj.Sections) { in dumpSectionToFile() local
43 if (Sec.Name == SecName) { in dumpSectionToFile()
44 ArrayRef<uint8_t> Contents = Sec.Contents; in dumpSectionToFile()
65 RemovePred = [&Config](const Section &Sec) { in removeSections() argument
66 return Config.ToRemove.matches(Sec.Name); in removeSections()
71 RemovePred = [RemovePred](const Section &Sec) { in removeSections() argument
72 return RemovePred(Sec) || isDebugSection(Sec); in removeSections()
77 RemovePred = [RemovePred](const Section &Sec) { in removeSections() argument
78 return RemovePred(Sec) || isDebugSection(Sec) || isLinkerSection(Sec) || in removeSections()
79 isNameSection(Sec) || isCommentSection(Sec); in removeSections()
84 RemovePred = [&Config](const Section &Sec) { in removeSections() argument
87 return Config.ToRemove.matches(Sec.Name) || !isDebugSection(Sec); in removeSections()
92 RemovePred = [&Config](const Section &Sec) { in removeSections() argument
95 return !Config.OnlySection.matches(Sec.Name); in removeSections()
100 RemovePred = [&Config, RemovePred](const Section &Sec) { in removeSections() argument
102 if (Config.KeepSection.matches(Sec.Name)) in removeSections()
105 return RemovePred(Sec); in removeSections()
125 Section Sec; in handleArgs() local
126 Sec.SectionType = llvm::wasm::WASM_SEC_CUSTOM; in handleArgs()
127 Sec.Name = NewSection.SectionName; in handleArgs()
134 Sec.Contents = ArrayRef<uint8_t>( in handleArgs()
138 Obj.addSectionWithOwnedContents(Sec, std::move(BufferCopy)); in handleArgs()