diff options
author | Eric Beckmann <ecbeckmann@google.com> | 2017-07-05 18:59:01 +0000 |
---|---|---|
committer | Eric Beckmann <ecbeckmann@google.com> | 2017-07-05 18:59:01 +0000 |
commit | 8cc9fd31e64981d2c1aaf71d7b05ea928ef499f6 (patch) | |
tree | a9d93e77c93db71722fed0ba09b1bd745e1fa702 /llvm/include | |
parent | eae44dfee97ef224da14ec77527f3a102d31d654 (diff) | |
download | bcm5719-llvm-8cc9fd31e64981d2c1aaf71d7b05ea928ef499f6.tar.gz bcm5719-llvm-8cc9fd31e64981d2c1aaf71d7b05ea928ef499f6.zip |
Revert "Replace trivial use of external rc.exe by writing our own .res file."
This patch still seems to break CrWinClangLLD, reverting this once more
until I can discover root problem.
This reverts commit 3dbbc8ce43be50ffde2b1c655c6d3a25796fe78b.
llvm-svn: 307188
Diffstat (limited to 'llvm/include')
-rw-r--r-- | llvm/include/llvm/BinaryFormat/COFF.h | 6 | ||||
-rw-r--r-- | llvm/include/llvm/Object/WindowsResource.h | 48 |
2 files changed, 9 insertions, 45 deletions
diff --git a/llvm/include/llvm/BinaryFormat/COFF.h b/llvm/include/llvm/BinaryFormat/COFF.h index b395db6eaa8..138e44bfec2 100644 --- a/llvm/include/llvm/BinaryFormat/COFF.h +++ b/llvm/include/llvm/BinaryFormat/COFF.h @@ -46,12 +46,6 @@ static const char ClGlObjMagic[] = { '\xac', '\x9b', '\xd6', '\xb6', '\x22', '\x26', '\x53', '\xc2', }; -// The signature bytes that start a .res file. -static const char WinResMagic[] = { - '\x00', '\x00', '\x00', '\x00', '\x20', '\x00', '\x00', '\x00', - '\xff', '\xff', '\x00', '\x00', '\xff', '\xff', '\x00', '\x00', -}; - // Sizes in bytes of various things in the COFF format. enum { Header16Size = 20, diff --git a/llvm/include/llvm/Object/WindowsResource.h b/llvm/include/llvm/Object/WindowsResource.h index 3d32409fd4a..844256478cf 100644 --- a/llvm/include/llvm/Object/WindowsResource.h +++ b/llvm/include/llvm/Object/WindowsResource.h @@ -47,44 +47,6 @@ namespace object { class WindowsResource; -const size_t WIN_RES_MAGIC_SIZE = 16; -const size_t WIN_RES_NULL_ENTRY_SIZE = 16; -const uint32_t WIN_RES_HEADER_ALIGNMENT = 4; -const uint32_t WIN_RES_DATA_ALIGNMENT = 4; -const uint16_t WIN_RES_PURE_MOVEABLE = 0x0030; - -struct WinResHeaderPrefix { - support::ulittle32_t DataSize; - support::ulittle32_t HeaderSize; -}; - -// Type and Name may each either be an integer ID or a string. This struct is -// only used in the case where they are both IDs. -struct WinResIDs { - uint16_t TypeFlag; - support::ulittle16_t TypeID; - uint16_t NameFlag; - support::ulittle16_t NameID; - - void setType(uint16_t ID) { - TypeFlag = 0xffff; - TypeID = ID; - } - - void setName(uint16_t ID) { - NameFlag = 0xffff; - NameID = ID; - } -}; - -struct WinResHeaderSuffix { - support::ulittle32_t DataVersion; - support::ulittle16_t MemoryFlags; - support::ulittle16_t Language; - support::ulittle32_t Version; - support::ulittle32_t Characteristics; -}; - class ResourceEntryRef { public: Error moveNext(bool &End); @@ -108,6 +70,14 @@ private: Error loadNext(); + struct HeaderSuffix { + support::ulittle32_t DataVersion; + support::ulittle16_t MemoryFlags; + support::ulittle16_t Language; + support::ulittle32_t Version; + support::ulittle32_t Characteristics; + }; + BinaryStreamReader Reader; bool IsStringType; ArrayRef<UTF16> Type; @@ -115,7 +85,7 @@ private: bool IsStringName; ArrayRef<UTF16> Name; uint16_t NameID; - const WinResHeaderSuffix *Suffix = nullptr; + const HeaderSuffix *Suffix = nullptr; ArrayRef<uint8_t> Data; const WindowsResource *OwningRes = nullptr; }; |