Lines Matching defs:Sec

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