Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
test/tools/llvm-objdump/disassemble-demangle.test | ||
---|---|---|
2 | please use yaml2obj instead of checking in a binary. | |
tools/llvm-objdump/llvm-objdump.cpp | ||
94β97 | This syntax breaks the GNU one. |
tools/llvm-objdump/llvm-objdump.cpp | ||
---|---|---|
1533 | This comment is probably too trivial to be useful. | |
1538β1539 | Why not freeing always on success? Do you really need to look at the size? |
tools/llvm-objdump/llvm-objdump.cpp | ||
---|---|---|
1532 | just in case - why does it always use itaniumDemanlge / what about other ABIs ? |
Added @davide suggestions
tools/llvm-objdump/llvm-objdump.cpp | ||
---|---|---|
1532 | This is related to @davide remark. As he pointed, for now, we will only handle this ABI :) | |
1538β1539 | Because not having success doesn't mean there was no allocation ? |
test/tools/llvm-objdump/disassemble-demangle.test | ||
---|---|---|
4 | Since you've added support for the string parameter for -C, please add tests cases for that style too, e.g. --demangle=none and --demangle=itanium. Also, please add long-name versions of this switch in the test (i.e. have both -C and --demangle). | |
tools/llvm-objdump/llvm-objdump.cpp | ||
1527 | Would it perhaps make sense to reject/warn for styles that don't make sense? | |
1536 | To avoid us duplicating the printing code (which could lead to divergence, if we decide the format needs to be slightly different at some point), how would you feel about putting this into a small lambda, which can then be called with the corresponding name? Something like: auto PrintSymbol = [](StringRef Name){ outs() << '\n' << Name << ":\n"; }; |
Warn for bad demangling styles.
Added tests for different styles.
tools/llvm-objdump/llvm-objdump.cpp | ||
---|---|---|
1527 | Maybe we should just warn, as we still want the disassembling happen right ? |
tools/llvm-objdump/llvm-objdump.cpp | ||
---|---|---|
1239 | I think this should be at command-line processing time, not here, since we should warn for bad patterns, even if no disassembling is required. Additionally, this will warn every time this function is called, which if llvm-objdump were to accept multiple objects or presumably parse objects in an archive, would be bad. What do other LLVM tools do when they get warnings? I'd sort of expect this to be prefixed with "warning:" or similar. It might be worth adding a helper, alongside error(), for this use case. You should also make sure that the style of message matches that of errors in the tool (i.e. first letter capitalization and trailing full stop - should they be exist or not?). | |
1527 | Warning is fine for me. |
LGTM, with a few minor points.
You should get @davide to confirm he's happy though before submission, since he previously requested changes.
test/tools/llvm-objdump/disassemble-demangle.test | ||
---|---|---|
46 | I'd add "warning:" to the front of this check. And maybe rename the check "BAD-STYLE". | |
tools/llvm-objdump/llvm-objdump.cpp | ||
336 | Do you need to do errs().flush() like in the other error methods? Also, I'd move this to be before or after the two error() functions rather than in between them. |
Added Jame's suggestions
tools/llvm-objdump/llvm-objdump.cpp | ||
---|---|---|
336 | I can add errs().flush(), but with the \n, it should be flushed ! |
tools/llvm-objdump/llvm-objdump.cpp | ||
---|---|---|
336 | Actually, I don't think that's the case! See https://stackoverflow.com/a/213977. |
tools/llvm-objdump/llvm-objdump.cpp | ||
---|---|---|
336 | hmm alright, sound weird to me, doesn't make really sense.. but thanks for the link π |
The buildbots were not passing. Again it seemed to be because of the disassembling option on other architectures (arm etc..).
If someone have any insight about what to do to test this disassembling option, I'll be glad :)
Is the problem as simple as adding a "REQUIRES: x86" to the test? Do the arm build bots etc have x86 target support?
Take a look at the documentation for it here:
https://llvm.org/docs/TestingGuide.html#constraining-test-execution
LGTM, with the caveat that I don't know for certain if that was the original issue, without looking at the failing job and what was going on.
If you need to make minor changes to get the build bots working, no need for further review from my point of view.
I just asked @echristo if he could give this patch a try on non-x86 architecture, to be sure it was the problem ! :)
Haven't been able to without setting up an all new dev machine so... give it a shot and we can try again and see where we end up on the bots. Just stick around a little after to see if everything is ok.
Ok, I think I actually have to move this test to the X86 folder, but I don't need this REQUIRES thing.
Concerned about why... but let's just do it for now and figure out the test problem later. It's not a problem with the code as far as I can tell.
please use yaml2obj instead of checking in a binary.