[llvm-rc] Add optional serialization support for DIALOG(EX) resources.

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
diff --git a/llvm/tools/llvm-rc/ResourceScriptParser.h b/llvm/tools/llvm-rc/ResourceScriptParser.h
index b393bbc..85d103d 100644
--- a/llvm/tools/llvm-rc/ResourceScriptParser.h
+++ b/llvm/tools/llvm-rc/ResourceScriptParser.h
@@ -124,12 +124,14 @@
   //
   // Ref (to the list of all optional statements):
   //    msdn.microsoft.com/en-us/library/windows/desktop/aa381002(v=vs.85).aspx
+  enum class OptStmtType { BasicStmt, DialogStmt, DialogExStmt };
+
   Expected<OptionalStmtList>
-  parseOptionalStatements(bool UseExtendedStatements = false);
+  parseOptionalStatements(OptStmtType StmtsType = OptStmtType::BasicStmt);
 
   // Read a single optional statement.
   Expected<std::unique_ptr<OptionalStmt>>
-  parseSingleOptionalStatement(bool UseExtendedStatements = false);
+  parseSingleOptionalStatement(OptStmtType StmtsType = OptStmtType::BasicStmt);
 
   // Top-level resource parsers.
   ParseType parseLanguageResource();
@@ -163,7 +165,7 @@
   ParseOptionType parseCharacteristicsStmt();
   ParseOptionType parseVersionStmt();
   ParseOptionType parseCaptionStmt();
-  ParseOptionType parseFontStmt();
+  ParseOptionType parseFontStmt(OptStmtType DialogType);
   ParseOptionType parseStyleStmt();
 
   // Raises an error. If IsAlreadyRead = false (default), this complains about