Depends on D80854.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
The logic looks good; putting back in your queue for the comment about the test. (Please request review again if I'm just misunderstanding the test.)
lld/MachO/InputFiles.cpp | ||
---|---|---|
196 | Super nit: even though it's not technically needed, for instances like this where there's a comment within an if (even though there's only a single actual statement), I prefer putting braces around it (and the else), to prevent any possible confusion. | |
lld/test/MachO/relocations.s | ||
60 | Are you missing the corresponding CHECK for this? It would also be nice to add a test with a non-zero offset. |
address comments
lld/MachO/InputFiles.cpp | ||
---|---|---|
196 | I prefer that too, just wasn't sure what the prevailing style was supposed to be :) | |
lld/test/MachO/relocations.s | ||
60 |
oh yeah good catch
L._str is at a non-zero offset in its section, which I think is the important case to test, but yeah I guess it wouldn't hurt to add another reloc whose source is also at a non-zero offset |
LGTM
lld/test/MachO/relocations.s | ||
---|---|---|
60 | Ah, I'd missed that, but yeah, the second reloc doesn't hurt. |
Thanks!
lld/test/MachO/relocations.s | ||
---|---|---|
32 | Rather than saying "This generates a pcrel symbol relocation", |
If I want to check whether lld-macho supports one particular relocation type, I'll grep the source. If the relocation type is literally mentioned in the test, it can help locate the test cases.
lld/test/MachO/relocations.s | ||
---|---|---|
32 | The type doesn't indicate whether it's pcrel or symbol vs section, though, so those bits of info are still necessary. But good point about greppability, I'll add in the type |
Super nit: even though it's not technically needed, for instances like this where there's a comment within an if (even though there's only a single actual statement), I prefer putting braces around it (and the else), to prevent any possible confusion.