Adds the infrastructure to write GOFF object files.
Also adds a GOFF writer which writes only HDR/END records.
Details
Diff Detail
Event Timeline
llvm/lib/MC/GOFFObjectWriter.cpp | ||
---|---|---|
275 | I have found it useful to use the Unix 'dd' command to slide up GOFF files when they cause the Binder to abend. This becomes much harder when this record count field is used. I'm not sure what the upside of this field is. |
llvm/lib/MC/GOFFObjectWriter.cpp | ||
---|---|---|
275 | I need to check if the binder is happy without this field. |
llvm/lib/MC/GOFFObjectWriter.cpp | ||
---|---|---|
275 | We've been putting zero for the record count for nearly 20 years. It's been fine all that time. If it stopped working I'd get a phone call pretty quickly. Last night's builds on V2R4 ran fine, for example. |
llvm/lib/MC/GOFFObjectWriter.cpp | ||
---|---|---|
275 | Updated code to just write out the number of logical records for debug purposes. |
llvm/lib/MC/GOFFObjectWriter.cpp | ||
---|---|---|
275 | Thank you! |
I wouldn't use `flags_t'. Isn't that namespace reserved by the standard?
It would be helpful if you used the 'git clang-format' command to reformat _only_ the parts that you are changing. There seem to be a number of places that aren't GOFF but have changed formatting. See 'clang/tools/clang-format'.
I have no experience in the MC layer so there's not much I can say about those connecting bits.
I wouldn't use `flags_t'. Isn't that namespace reserved by the standard?
My rational is that I mimic a standard type like uint64_t. Well, may be better to change, to avoid fruitless discussions.
It would be helpful if you used the 'git clang-format' command to reformat _only_ the parts that you are changing. There seem to be a number of places that aren't GOFF but have changed formatting. See 'clang/tools/clang-format'.
Thanks! I do not note that, even if it so obvious. I change it.
Please wait a couple of days in case there are any comments from anyone else.
Sure, no problem. Thanks!
Basically stylistic-style comments and questions, as I don't know GOFF at all.
llvm/include/llvm/MC/MCGOFFObjectWriter.h | ||
---|---|---|
35 | ||
llvm/lib/MC/GOFFObjectWriter.cpp | ||
69 | ||
75 | My gut says we should be following standard LLVM naming scheme with this class name. The raw_ostream class uses the different style because it's intended to mirror the standard std::ostream class, but I don't think that's a justification to extend it to classes that make use of the stream. | |
93 | "begin" is a verb. You want "start" or "beginning". | |
114 | Similar to my above comment, unless the function is an implementation of a virtual function in the basis class, I'd use standard LLVM lowerCameCase for the methods throughout this class. | |
139 | ||
142 | I think the general preference within LLVM is to use C++ static_cast and reinterpret_cast as appropriate, rather than the C-style cast. | |
177 | I don't think you need the NDEBUG check here? Isn't that within the assert macro? | |
217–219 | No braces for single line if. | |
252 | clang-format understands this style for labelling arguments. | |
272 | ||
275 | It might be worth a comment explaining why this field is always 0. Otherwirse a future contributor may not be aware of the reasoning and change it to be "correct". | |
llvm/lib/MC/MCGOFFStreamer.cpp | ||
29–30 | This seems like a memory leak? | |
llvm/lib/Target/SystemZ/MCTargetDesc/SystemZELFObjectWriter.cpp | ||
58 | Whilst you're moving this file, I'd consider doing a complete clang-format of it too. | |
llvm/lib/Target/SystemZ/MCTargetDesc/SystemZMCAsmBackend.cpp | ||
84–85 | clang-format the modified code. | |
llvm/test/MC/GOFF/empty-goff.s | ||
2 | I'd find this syntax easier to follow, as it's a more common style among tests I've worked with. | |
3 | Why do you need the --ignore-case option? |
llvm/lib/MC/MCGOFFStreamer.cpp | ||
---|---|---|
29–30 | Spontaneously I cannot say when the object will be released again. The code corresponds to all other Streamer implementations, e.g. MCELFStreamer. IMHO it would be better to return a std::unique_ptr<MCStreamer>, but this also required global changes in the way how the object retrieved from the TargetRegistry is handled. | |
llvm/test/MC/GOFF/empty-goff.s | ||
3 | The case of hexadecimal digits is not defined by the POSIX standard. |
llvm/lib/MC/GOFFObjectWriter.cpp | ||
---|---|---|
83 | It might be worth explaining why this is in an ifdef, in this comment. | |
140 | "BE" being an acronym for "big endian" should be capitalized. | |
llvm/lib/Target/SystemZ/MCTargetDesc/SystemZELFObjectWriter.cpp | ||
58 | Not addressed? | |
llvm/test/MC/GOFF/empty-goff.s | ||
2 | Not addressed? | |
5–9 | For true comments, as opposed to lit or FileCheck directives, I like to use double comment markers, i.e. "** Header record:" etc. Also why "*"? "#" is the more common marker I've seen used (although I admit it doesn't apply everywhere). |