[llvm] [SystemZ][z/OS] yaml2obj GOFF symbols (PR #75971)
James Henderson via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 15 02:06:27 PDT 2024
================
@@ -249,20 +247,16 @@ void GOFFState::writeHeader(GOFFYAML::FileHeader &FileHdr) {
}
void GOFFState::writeSymbol(GOFFYAML::Symbol Sym) {
- if (Sym.ID != SymbolID + 1)
- reportError("symbol IDs not monotonic " + Sym.Name);
- else
- ++SymbolID;
- if (Sym.OwnerID >= SymbolID)
- reportError("owner ID not defined " + Sym.Name);
SmallString<80> SymName;
if (std::error_code EC = ConverterEBCDIC::convertToEBCDIC(Sym.Name, SymName))
reportError("conversion error on " + Sym.Name);
- size_t SymLength = SymName.size();
- if (SymLength > GOFF::MaxDataLength)
- reportError("symbol name is too long: " + Twine(SymLength));
+ size_t SymNameLength = SymName.size();
+ if (SymNameLength > GOFF::MaxDataLength)
+ reportError("symbol name is too long: " + Twine(SymNameLength) +
+ ". Max length is: " + Twine(GOFF::MaxDataLength));
- GW.makeNewRecord(GOFF::RT_ESD, 69 + SymLength);
+ unsigned NameLengthOffset = 69;
----------------
jh7370 wrote:
Mark this as `const` to emphasise that this is a file format constant.
https://github.com/llvm/llvm-project/pull/75971
More information about the llvm-commits
mailing list