[llvm-commits] [llvm] r149832 - /llvm/trunk/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp

Duncan Sands baldrick at free.fr
Sun Feb 5 10:14:09 PST 2012


Hi David,

On 05/02/12 18:46, David Blaikie wrote:
> On Sun, Feb 5, 2012 at 6:14 AM, Duncan Sands<baldrick at free.fr>  wrote:
>> Author: baldrick
>> Date: Sun Feb  5 08:14:35 2012
>> New Revision: 149832
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=149832&view=rev
>> Log:
>> Explain to the compiler why TargetAddr is not used uninitialized later.
> ...
>>    } else {
>>      // FIXME: Get the address of the target section and add that to RE.Offset
>> -    assert(0&&  ("Non-function relocation not implemented yet!"));
>> +    llvm_unreachable("Non-function relocation not implemented yet!");
>>    }
>
> Does this satisfy GCC as well as Clang? (I assume you probably build
> with DragonEgg so you know that it does - I'm just curious)

it satisfies GCC, and it should satisfy Clang but I didn't test.

...

> In any case - might this be better expressed with a single assert at
> the start of the function (still with the comment that the negative
> case should be handled at some point) rather than a conditional with
> an unreachable inside?

Simpler would be to initialize TargetAddr to null.

Ciao, Duncan.



More information about the llvm-commits mailing list