[llvm-commits] ObjectFile RelocationRef

Benjamin Kramer benny.kra at googlemail.com
Wed Sep 7 10:14:09 PDT 2011


On Wed, Sep 7, 2011 at 06:09, Danil Malyshev <dmalyshev at accesssoftek.com> wrote:
> Hello everyone,
> Please find attached the patch for review. It adds relocations to the
> ObjectFile.

Can you make the macros (ELF_REL_GET_VALUE etc.) static functions?
Macros with side effects like that one make the code much harder to
follow. Looks good otherwise.

> By the way, ObjectFile as it is now implements only a reader. If it is not
> intended to modify MemoryBuffer content then how about using const
> MemoryBuffer instead?

MemoryBuffers are meant to be immutable and have only const methods,
so making the MemoryBuffer itself const doesn't make a difference.
Some code in LLVM cheats and uses const_cast to write to the
underlying memory, but that's another issue.

- Ben



More information about the llvm-commits mailing list