aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-rc/ResourceScriptParser.cpp
AgeCommit message (Collapse)AuthorFilesLines
2020-02-10Revert "Remove redundant "std::move"s in return statements"Bill Wendling1-9/+9
The build failed with error: call to deleted constructor of 'llvm::Error' errors. This reverts commit 1c2241a7936bf85aa68aef94bd40c3ba77d8ddf2.
2020-02-10Remove redundant "std::move"s in return statementsBill Wendling1-9/+9
2019-08-15[llvm] Migrate llvm::make_unique to std::make_uniqueJonas Devlieghere1-24/+24
Now that we've moved to C++14, we no longer need the llvm::make_unique implementation from STLExtras.h. This patch is a mechanical replacement of (hopefully) all the llvm::make_unique instances across the monorepo. llvm-svn: 369013
2019-01-19Update the file headers across all of the LLVM projects in the monorepoChandler Carruth1-4/+3
to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
2018-12-05[llvm-rc] Support not expressions.Martin Storsjo1-12/+29
Patch by Jacek Caban! Differential Revision: https://reviews.llvm.org/D55242 llvm-svn: 348363
2018-11-29[llvm-rc] Support EXSTYLE statement.Martin Storsjo1-0/+7
Patch by Jacek Caban! Differential Revision: https://reviews.llvm.org/D55020 llvm-svn: 347858
2018-05-15[llvm-rc] Add support for the optional CLASS statement for dialogsMartin Storsjo1-0/+7
Differential Revision: https://reviews.llvm.org/D46875 llvm-svn: 332386
2018-05-15[llvm-rc] Add support for parsing memory flagsMartin Storsjo1-14/+67
Most of the handling is pretty straightforward; fetch the default memory flags for the specific resource type before parsing the flags and apply them on top of that, except that some flags imply others and some flags clear more than one flag. For icons and cursors, the flags set get passed on to all individual single icon/cursor resources, while only some flags affect the icon/cursor group resource. For stringtables, the behaviour is pretty simple; the first stringtable resource of a bundle sets the flags for the whole bundle. The output of these tests match rc.exe byte for byte. The actual use of these memory flags is deprecated and they have no effect since Win16, but some resource script files may still happen to have them in place. Differential Revision: https://reviews.llvm.org/D46818 llvm-svn: 332329
2018-05-09[llvm-rc] Add support for the RCDATA resource typeMartin Storsjo1-0/+2
This is the same as any other user defined resource, but with a specific allocated resource type number. Differential Revision: https://reviews.llvm.org/D46636 llvm-svn: 331902
2018-05-08[llvm-rc] Add support for all missing dialog controlsMartin Storsjo1-7/+38
Differential Revision: https://reviews.llvm.org/D46507 llvm-svn: 331808
2018-05-08[llvm-rc] Don't strictly require quotes around external file namesMartin Storsjo1-5/+16
Regardless of what docs may say, existing resource files in the wild can use this syntax. Rename a file used in an existing test, to make it usable for unquoted paths. Differential Revision: https://reviews.llvm.org/D46511 llvm-svn: 331747
2018-05-07[llvm-rc] Implement the BITMAP resource typeMartin Storsjo1-0/+7
Differential Revision: https://reviews.llvm.org/D46509 llvm-svn: 331670
2018-05-07[llvm-rc] Allow optional commas between the string table index and valueMartin Storsjo1-0/+1
This form is even used in one of the examples at https://msdn.microsoft.com/en-us/library/windows/desktop/aa381050(v=vs.85).aspx. Differential Revision: https://reviews.llvm.org/D46508 llvm-svn: 331669
2018-05-07[llvm-rc] Fix alphabetical order of cases. NFC.Martin Storsjo1-2/+2
llvm-svn: 331667
2017-11-21llvm-rc/ResourceScriptTokenList.h: Turns this into a .def file to imply that ↵David Blaikie1-3/+1
it's non-modular Also undef the macros at the end of the file to make it easier to use. llvm-svn: 318714
2017-10-11[llvm-rc] Use proper search algorithm for finding resources.Zachary Turner1-0/+4
Previously we would only look in the current directory for a resource, which might not be the same as the directory of the rc file. Furthermore, MSVC rc supports a /I option, and can also look in the system environment. This patch adds support for this search algorithm. Differential Revision: https://reviews.llvm.org/D38740 llvm-svn: 315499
2017-10-09Fix some C++ value / reference semantics issues.Zachary Turner1-6/+3
Some functions were taking Twine's not by const&, these are all fixed to take by const&. We also had a case where some functions were overloaded to accept by const& and &&. Now there is only one version which accepts by value and move's the value. llvm-svn: 315229
2017-10-06[llvm-rc] Serialize VERSIONINFO resources to .res files.Zachary Turner1-16/+24
This is now able to dump VERSIONINFO resources. Ref: msdn.microsoft.com/en-us/library/windows/desktop/aa381058.aspx Differential Revision: https://reviews.llvm.org/D38410 Patch by: Marek Sokolowski llvm-svn: 315110
2017-10-06[llvm-rc] Add optional serialization support for DIALOG(EX) resources.Zachary Turner1-10/+30
This is part 5 of llvm-rc serialization support. This allows DIALOG and DIALOGEX to serialize if dialog-specific optional statements are provided. These are (as of now): CAPTION, FONT, and STYLE. Notably, FONT statement can take more than two arguments when describing DIALOGEX resources (as in msdn.microsoft.com/en-us/library/windows/desktop/aa381013.aspx). I made some changes to the parser to reflect this fact. Patch by Marek Sokolowski Differential Revision: https://reviews.llvm.org/D37864 llvm-svn: 315104
2017-09-30[llvm-rc] Serialize DIALOG(EX) to .res files (serialization, pt 4).Marek Sokolowski1-4/+6
This is now able to serialize DIALOG and DIALOGEX resources to .res files. It still can't parse dialog-specific CAPTION, FONT, and STYLE optional statement - these will be added in the following patch. A limited set of controls is included. However, more can be easily added by extending SupportedCtls map defined in ResourceScriptStmt.cpp. Differential Revision: https://reviews.llvm.org/D37862 llvm-svn: 314578
2017-09-29[llvm-rc] Refactoring needed for ACCELERATORS and MENU resources.Marek Sokolowski1-6/+10
This is a part of llvm-rc serialization patch set (serialization, pt 1.5). This: * Unifies the internal representation of flags in ACCELERATORS and MENU with the corresponding representation in .res files (noticed in https://reviews.llvm.org/D37828#inline-329828). * Creates an RCResource subclass, OptStatementsRCResource, describing resource statements that can declare resource-local optional statements (proposed in https://reviews.llvm.org/D37824#inline-329775). These modifications don't fit to any of the current patches, so I'm submitting them as a separate patch. Differential Revision: https://reviews.llvm.org/D37841 llvm-svn: 314541
2017-09-29[llvm-rc] Import all make_unique invocations from llvm namespace.Marek Sokolowski1-20/+22
Previous patch fixed one of LLVM buildbots (lld-x86_64-win7). However, some others have already been failing because of make_unique compilation error (llvm-clang-x86_64-expensive-checks-win). llvm-svn: 314480
2017-09-29[llvm-rc] Add user-defined resources parsing ability. [8/8]Marek Sokolowski1-1/+26
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
2017-09-28[llvm-rc] Add integer expressions parsing ability. [7/8]Marek Sokolowski1-4/+96
This allows the ints to be written as integer expressions evaluating to unsigned 16-bit/32-bit integers. All the expressions may use the following operators: + - & | ~, and parentheses. Minus token - can be also unary. There is no precedence of the operators other than the unary operators binding stronger than their binary counterparts. Differential Revision: https://reviews.llvm.org/D37022 llvm-svn: 314477
2017-09-28[llvm-rc] Fix-up for r314468 (argument-dependent lookup in make_unique).Marek Sokolowski1-4/+4
llvm-svn: 314472
2017-09-28[llvm-rc] Add VERSIONINFO parsing ability. [6/8]Marek Sokolowski1-0/+75
This extends the set of llvm-rc parser's available resources by another one, VERSIONINFO. Ref: msdn.microsoft.com/en-us/library/windows/desktop/aa381058.aspx Thanks to Nico Weber for his original work in this area. Differential Revision: https://reviews.llvm.org/D37021 llvm-svn: 314468
2017-08-29[llvm-rc] Fix DIALOG(EX) parsing ability (parser, pt 5/8).Marek Sokolowski1-1/+1
This fixes a use-after-free bug that was noticed by a sanitizer buildbot (http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/7502). Differential Revision: https://reviews.llvm.org/D37271 llvm-svn: 312028
2017-08-29[llvm-rc] Add DIALOG(EX) parsing ability (parser, pt 5/8).Marek Sokolowski1-6/+98
This extends the set of resources parsed by llvm-rc by DIALOG and DIALOGEX. Additionally, three optional resource statements specific to these two resources are added: CAPTION, FONT, and STYLE. Thanks for Nico Weber for his original work in this area. Differential Revision: https://reviews.llvm.org/D36905 llvm-svn: 312009
2017-08-28[llvm-rc] Add MENU parsing ability (parser, pt 4/8).Marek Sokolowski1-0/+67
This extends llvm-rc parsing tool by MENU resource (msdn.microsoft.com/en-us/library/windows/desktop/aa381025(v=vs.85).aspx). As for now, MENUEX (msdn.microsoft.com/en-us/library/windows/desktop/aa381023(v=vs.85).aspx) seems unnecessary. Thanks for Nico Weber for his original work in this area. Differential Revision: https://reviews.llvm.org/D36898 llvm-svn: 311956
2017-08-28[llvm-rc] Add ACCELERATORS parsing ability. (parser, pt 3/8).Marek Sokolowski1-7/+54
This improves the current llvm-rc parser by the ability of parsing ACCELERATORS statement. Moreover, some small improvements to the original parsing commit were made. Thanks for Nico Weber for his original work in this area. Differential Revision: https://reviews.llvm.org/D36894 llvm-svn: 311946
2017-08-28[llvm-rc] Add ICON and HTML parsing ability (parser, pt 2/8).Marek Sokolowski1-1/+15
This extends the current llvm-rc parser by ICON and HTML resources. Moreover, some tests have been slightly rewritten. Thanks for Nico Weber for his original work in this area. Differential Revision: https://reviews.llvm.org/D36891 llvm-svn: 311939
2017-08-18Reapply: [llvm-rc] Add basic RC scripts parsing ability.Marek Sokolowski1-0/+267
As for now, the parser supports a limited set of statements and resources. This will be extended in the following patches. Thanks to Nico Weber (thakis) for his original work in this area. This patch was originally submitted as r311175 and got reverted in r311177 because of the problems with compilation under gcc. Differential Revision: https://reviews.llvm.org/D36340 llvm-svn: 311184
2017-08-18Revert "[llvm-rc] Add basic RC scripts parsing ability."Marek Sokolowski1-265/+0
This reverts commit r311175. This failed some buildbots compilation. llvm-svn: 311177
2017-08-18[llvm-rc] Add basic RC scripts parsing ability.Marek Sokolowski1-0/+265
As for now, the parser supports a limited set of statements and resources. This will be extended in the following patches. Thanks to Nico Weber (thakis) for his original work in this area. Differential Revision: https://reviews.llvm.org/D36340 llvm-svn: 311175