This extends the set of parser's available resources by another one, VERSIONINFO (msdn.microsoft.com/en-us/library/windows/desktop/aa381058(v=vs.85).aspx).
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
llvm/tools/llvm-rc/ResourceScriptParser.cpp | ||
---|---|---|
509–510 | Can you make a RetType::isTypeSupported() function and just call it? |
llvm/tools/llvm-rc/ResourceScriptStmt.cpp | ||
---|---|---|
169 | Just .count(Type.upper()) seems more idiomatic. | |
173 | ditto | |
llvm/tools/llvm-rc/ResourceScriptStmt.h | ||
387–388 | Generally, you don't need to template over the size of a SmallVector. You can simply take a SmallVectorImpl<T> &, which is the base SmallVectors of any size. However, for a const reference, it's usually better to accept an ArrayRef<T> Value. That is implicitly constructible from any SmallVector, and passes a pointer and size by value. | |
389 | Does this need Name.upper()? I'm concerned about things like: VERSIONINFO FileVersion 1, 2, 3 FILEVERSION 4, 5, 6 BEGIN END Should that be an error? Maybe the best way to handle this is to have an enumeration, map from string to enum, maintain an array of all possible fields, and on set, check if the field is already set and report an error if so. |
llvm/tools/llvm-rc/ResourceScriptStmt.h | ||
---|---|---|
389 | The original tool seems not to care about this one and just take the last occurrence of FILEVERSION. Of course, what you suggest is way better, and I think I'm going to do it your way. |
Rewritten fixed fields implementation a little bit. Now, we have an enumeration describing fixed field types, a list of field names, and a mapping from names to their types.
Also, added a sanity check determining if the user provided multiple occurrences of the same fixed field.
No else after return.