Go to the documentation of this file.
9 #ifndef LLVM_LIB_OBJCOPY_COFF_COFFOBJECT_H
10 #define LLVM_LIB_OBJCOPY_COFF_COFFOBJECT_H
44 if (!OwnedContents.empty())
50 OwnedContents.clear();
62 OwnedContents.clear();
67 std::vector<uint8_t> OwnedContents;
114 return make_range(Symbols.begin(), Symbols.end());
130 return make_range(Sections.begin(), Sections.end());
140 std::vector<Symbol> Symbols;
143 size_t NextSymbolUniqueId = 0;
145 std::vector<Section> Sections;
148 ssize_t NextSectionUniqueId = 1;
151 void updateSymbols();
154 void updateSections();
161 template <
class Symbol1Ty,
class Symbol2Ty>
163 static_assert(
sizeof(Dest.Name.ShortName) ==
sizeof(Src.Name.ShortName),
164 "Mismatched name sizes");
165 memcpy(Dest.Name.ShortName, Src.Name.ShortName,
sizeof(Dest.Name.ShortName));
166 Dest.Value = Src.Value;
167 Dest.SectionNumber = Src.SectionNumber;
168 Dest.Type = Src.Type;
169 Dest.StorageClass = Src.StorageClass;
170 Dest.NumberOfAuxSymbols = Src.NumberOfAuxSymbols;
175 template <
class PeHeader1Ty,
class PeHeader2Ty>
177 Dest.Magic = Src.Magic;
178 Dest.MajorLinkerVersion = Src.MajorLinkerVersion;
179 Dest.MinorLinkerVersion = Src.MinorLinkerVersion;
180 Dest.SizeOfCode = Src.SizeOfCode;
181 Dest.SizeOfInitializedData = Src.SizeOfInitializedData;
182 Dest.SizeOfUninitializedData = Src.SizeOfUninitializedData;
183 Dest.AddressOfEntryPoint = Src.AddressOfEntryPoint;
184 Dest.BaseOfCode = Src.BaseOfCode;
185 Dest.ImageBase = Src.ImageBase;
186 Dest.SectionAlignment = Src.SectionAlignment;
187 Dest.FileAlignment = Src.FileAlignment;
188 Dest.MajorOperatingSystemVersion = Src.MajorOperatingSystemVersion;
189 Dest.MinorOperatingSystemVersion = Src.MinorOperatingSystemVersion;
190 Dest.MajorImageVersion = Src.MajorImageVersion;
191 Dest.MinorImageVersion = Src.MinorImageVersion;
192 Dest.MajorSubsystemVersion = Src.MajorSubsystemVersion;
193 Dest.MinorSubsystemVersion = Src.MinorSubsystemVersion;
194 Dest.Win32VersionValue = Src.Win32VersionValue;
195 Dest.SizeOfImage = Src.SizeOfImage;
196 Dest.SizeOfHeaders = Src.SizeOfHeaders;
197 Dest.CheckSum = Src.CheckSum;
198 Dest.Subsystem = Src.Subsystem;
199 Dest.DLLCharacteristics = Src.DLLCharacteristics;
200 Dest.SizeOfStackReserve = Src.SizeOfStackReserve;
201 Dest.SizeOfStackCommit = Src.SizeOfStackCommit;
202 Dest.SizeOfHeapReserve = Src.SizeOfHeapReserve;
203 Dest.SizeOfHeapCommit = Src.SizeOfHeapCommit;
204 Dest.LoaderFlags = Src.LoaderFlags;
205 Dest.NumberOfRvaAndSize = Src.NumberOfRvaAndSize;
212 #endif // LLVM_LIB_OBJCOPY_COFF_COFFOBJECT_H
object::pe32plus_header PeHeader
ArrayRef< Section > getSections() const
This is an optimization pass for GlobalISel generic memory operations.
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
uint8_t Opaque[sizeof(object::coff_symbol16)]
std::vector< object::data_directory > DataDirectories
Target - Wrapper for Target specific information.
object::coff_section Header
ReachingDefAnalysis InstSet & ToRemove
Error removeSymbols(function_ref< Expected< bool >(const Symbol &)> ToRemove)
Optional< size_t > WeakTargetSymbolId
void truncateSections(function_ref< bool(const Section &)> ToTruncate)
void setContentsRef(ArrayRef< uint8_t > Data)
Tagged union holding either a T or a Error.
std::vector< AuxSymbol > AuxData
ArrayRef< uint8_t > DosStub
void removeSections(function_ref< bool(const Section &)> ToRemove)
void addSections(ArrayRef< Section > NewSections)
object::coff_symbol32 Sym
object::dos_header DosHeader
coff_symbol< support::ulittle16_t > coff_symbol16
An efficient, type-erasing, non-owning reference to a callable.
const Section * findSection(ssize_t UniqueId) const
std::vector< Relocation > Relocs
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
object::coff_relocation Reloc
iterator_range< std::vector< Symbol >::iterator > getMutableSymbols()
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
<%struct.s * > cast struct s *S to sbyte *< sbyte * > sbyte uint cast struct s *agg result to sbyte *< sbyte * > sbyte uint cast struct s *memtmp to sbyte *< sbyte * > sbyte uint ret void llc ends up issuing two memcpy or custom lower memcpy(of small size) to be ldmia/stmia. I think option 2 is better but the current register allocator cannot allocate a chunk of registers at a time. A feasible temporary solution is to use specific physical registers at the lowering time for small(<
ArrayRef< uint8_t > getContents() const
ArrayRef< uint8_t > getRef() const
iterator_range< std::vector< Section >::iterator > getMutableSections()
StringRef - Represent a constant reference to a string, i.e.
support::ulittle32_t SizeOfRawData
const Symbol * findSymbol(size_t UniqueId) const
void copyPeHeader(PeHeader1Ty &Dest, const PeHeader2Ty &Src)
ssize_t AssociativeComdatTargetSectionId
Lightweight error class with error context and mandatory checking.
void copySymbol(Symbol1Ty &Dest, const Symbol2Ty &Src)
AuxSymbol(ArrayRef< uint8_t > In)
void addSymbols(ArrayRef< Symbol > NewSymbols)
Relocation(const object::coff_relocation &R)
void setOwnedContents(std::vector< uint8_t > &&Data)
A range adaptor for a pair of iterators.
object::coff_file_header CoffFileHeader
we should consider alternate ways to model stack dependencies Lots of things could be done in WebAssemblyTargetTransformInfo cpp there are numerous optimization related hooks that can be overridden in WebAssemblyTargetLowering Instead of the OptimizeReturned which should consider preserving the returned attribute through to MachineInstrs and extending the MemIntrinsicResults pass to do this optimization on calls too That would also let the WebAssemblyPeephole pass clean up dead defs for such as it does for stores Consider implementing and or getMachineCombinerPatterns Find a clean way to fix the problem which leads to the Shrink Wrapping pass being run after the WebAssembly PEI pass When setting multiple variables to the same we currently get code like const It could be done with a smaller encoding like local tee $pop5 local copy
ArrayRef< Symbol > getSymbols() const