diff options
author | Marek Sokolowski <mnbvmar@gmail.com> | 2017-09-29 00:14:18 +0000 |
---|---|---|
committer | Marek Sokolowski <mnbvmar@gmail.com> | 2017-09-29 00:14:18 +0000 |
commit | b5f39a05a329534979572781b10326c60b0bdc9e (patch) | |
tree | 2aa8ae30a9e0fd36c1c4bcf0fa044298abeefd8a /llvm/tools/llvm-rc/ResourceScriptStmt.h | |
parent | 7e89ee7fdc428900dd362703e80d4644b28058f7 (diff) | |
download | bcm5719-llvm-b5f39a05a329534979572781b10326c60b0bdc9e.tar.gz bcm5719-llvm-b5f39a05a329534979572781b10326c60b0bdc9e.zip |
[llvm-rc] Add user-defined resources parsing ability. [8/8]
This allows llvm-rc to parse user-defined resources (ref:
msdn.microsoft.com/en-us/library/windows/desktop/aa381054.aspx).
These statements either import files, or put the specified raw data in
the resulting resource file.
Thanks to Nico Weber for his original work in this area.
Differential Revision: https://reviews.llvm.org/D37033
llvm-svn: 314478
Diffstat (limited to 'llvm/tools/llvm-rc/ResourceScriptStmt.h')
-rw-r--r-- | llvm/tools/llvm-rc/ResourceScriptStmt.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/llvm/tools/llvm-rc/ResourceScriptStmt.h b/llvm/tools/llvm-rc/ResourceScriptStmt.h index b090be4b700..95890fe6669 100644 --- a/llvm/tools/llvm-rc/ResourceScriptStmt.h +++ b/llvm/tools/llvm-rc/ResourceScriptStmt.h @@ -319,6 +319,24 @@ public: raw_ostream &log(raw_ostream &) const override; }; +// User-defined resource. It is either: +// * a link to the file, e.g. NAME TYPE "filename", +// * or contains a list of integers and strings, e.g. NAME TYPE {1, "a", 2}. +class UserDefinedResource : public RCResource { + IntOrString Type; + StringRef FileLoc; + std::vector<IntOrString> Contents; + bool IsFileResource; + +public: + UserDefinedResource(IntOrString ResourceType, StringRef FileLocation) + : Type(ResourceType), FileLoc(FileLocation), IsFileResource(true) {} + UserDefinedResource(IntOrString ResourceType, std::vector<IntOrString> &&Data) + : Type(ResourceType), Contents(std::move(Data)), IsFileResource(false) {} + + raw_ostream &log(raw_ostream &) const override; +}; + // -- VERSIONINFO resource and its helper classes -- // // This resource lists the version information on the executable/library. |