[PATCH] [PECOFF][Writer] Emit .reloc section.

Rui Ueyama ruiu at google.com
Mon Jul 15 14:06:45 PDT 2013


On Mon, Jul 15, 2013 at 1:58 PM, Chandler Carruth <chandlerc at google.com>wrote:

>
> On Mon, Jul 15, 2013 at 1:54 PM, Rui Ueyama <ruiu at google.com> wrote:
>
>> ================
>> Comment at: lld/trunk/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp:319
>> @@ +318,3 @@
>> +    for (const auto *layout : _atomLayouts) {
>> +      const DefinedAtom *atom = dyn_cast<const
>> DefinedAtom>(layout->_atom);
>> +      for (const Reference *ref : *atom)
>> ----------------
>> Sean Silva wrote:
>> > Richard wrote:
>> > > Can dyn_cast<T> return nullptr?
>> > Good catch. If you know it is a DefinedAtom, then just use cast<>.
>> Also, you should be able to just do dyn_cast<DefinedAtom> since I believe
>> returned result is always const.
>> We are sure that all the atoms are defined atoms here. I'd like to
>> continue using dyn_cast with null-checking assert() for safety.
>
>
> FYI, cast<> really is the right tool. It has internal asserts that check
> the cast in debug builds, so it should givey ou exactly what you want there.
>

Good to know. I can now use cast<> without any worries =D
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130715/5db19390/attachment.html>


More information about the llvm-commits mailing list