summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-rc/ResourceScriptParser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/llvm-rc/ResourceScriptParser.cpp')
-rw-r--r--llvm/tools/llvm-rc/ResourceScriptParser.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/tools/llvm-rc/ResourceScriptParser.cpp b/llvm/tools/llvm-rc/ResourceScriptParser.cpp
index d4aa4b24379..1e32d4d1a9d 100644
--- a/llvm/tools/llvm-rc/ResourceScriptParser.cpp
+++ b/llvm/tools/llvm-rc/ResourceScriptParser.cpp
@@ -458,15 +458,17 @@ Expected<Control> RCParser::parseControl() {
// [class] text, id, x, y, width, height [, style] [, exstyle] [, helpID]
// [class] id, x, y, width, height [, style] [, exstyle] [, helpID]
// Note that control ids must be integers.
+ // Text might be either a string or an integer pointing to resource ID.
ASSIGN_OR_RETURN(ClassResult, readIdentifier());
std::string ClassUpper = ClassResult->upper();
- if (Control::SupportedCtls.find(ClassUpper) == Control::SupportedCtls.end())
+ auto CtlInfo = Control::SupportedCtls.find(ClassUpper);
+ if (CtlInfo == Control::SupportedCtls.end())
return getExpectedError("control type, END or '}'", true);
// Read caption if necessary.
- StringRef Caption;
- if (Control::CtlsWithTitle.find(ClassUpper) != Control::CtlsWithTitle.end()) {
- ASSIGN_OR_RETURN(CaptionResult, readString());
+ IntOrString Caption{StringRef()};
+ if (CtlInfo->getValue().HasTitle) {
+ ASSIGN_OR_RETURN(CaptionResult, readIntOrString());
RETURN_IF_ERROR(consumeType(Kind::Comma));
Caption = *CaptionResult;
}
OpenPOWER on IntegriCloud