summaryrefslogtreecommitdiffstats
path: root/llvm/include
diff options
context:
space:
mode:
authorEric Beckmann <ecbeckmann@google.com>2017-07-05 23:45:50 +0000
committerEric Beckmann <ecbeckmann@google.com>2017-07-05 23:45:50 +0000
commit81979b038f540eed8766ddfc42dd15cdb8b6a72b (patch)
treedfc931282824e3241b86595fff6b3ad269fa28f1 /llvm/include
parent2126334e08bc0f0ec3b99147067d4d110be688d6 (diff)
downloadbcm5719-llvm-81979b038f540eed8766ddfc42dd15cdb8b6a72b.tar.gz
bcm5719-llvm-81979b038f540eed8766ddfc42dd15cdb8b6a72b.zip
Revert "Revert "Revert "Replace trivial use of external rc.exe by writing our own .res file."""
This reverts commit 5fecbbbe5049665d86834cf69d8f75db4f392308. The initial revert was done in order to prevent ongoing errors on chromium bots such as CrWinClangLLD. However, this was done haphazardly and I didn't realize there were test and compilation failures, so this revert was reverted. Now that those have been fixed, we can revert the revert of the revert. llvm-svn: 307226
Diffstat (limited to 'llvm/include')
-rw-r--r--llvm/include/llvm/BinaryFormat/COFF.h6
-rw-r--r--llvm/include/llvm/Object/WindowsResource.h48
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;
};
OpenPOWER on IntegriCloud