This is an archive of the discontinued LLVM Phabricator instance.

Add more detailed comment for ORC stub code
Needs RevisionPublic

Authored by dongAxis on Jan 19 2020, 9:02 PM.

Details

Reviewers
MaskRay
lhames
Summary

0xF1C40000000025ff means
stub1:

jmpq    *ptr1(%rip)
.byte   0xC4         ; <- Invalid opcode padding.
.byte   0xF1

But 0xF1C40000000025ff is hard to understand what is means. So i use this patch to make code more readable.

Diff Detail

Repository
rL LLVM

Event Timeline

dongAxis created this revision.Jan 19 2020, 9:02 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 19 2020, 9:02 PM

I guess the code does not need to care about endianness because it is guaranteed to run on x86-64(?) static const or static constexpr should be better.

This comment was removed by dongAxis.

I think this would be better explained through comments. There is a comment regarding this code sequence at the top of the function, but it would make sense to add a second one directly above where we use the constant.

dongAxis updated this revision to Diff 239727.Jan 22 2020, 4:07 PM

use static constexpr variable instead of local variable

lhames requested changes to this revision.Jan 23 2020, 1:52 PM

Hi Axis,

If you would like to add a comment explaining the constant (with reference to the comment at the top of the function) I would be happy to land that, but I don't see any value to changing the code itself.

This revision now requires changes to proceed.Jan 23 2020, 1:52 PM