[llvm-commits] [llvm] r130544 - /llvm/trunk/lib/MC/MCDwarf.cpp

Rafael Ávila de Espíndola rafael.espindola at gmail.com
Sat Apr 30 08:10:46 PDT 2011


On 11-04-30 2:28 AM, Anton Korobeynikov wrote:
> Hi Rafael,
>
>> more importantly lets this code be used when producing assembly code for old assemblers without
>> uleb support.
> I don't think it's a good idea in general. In such a way we can not
> emit .cfi stuff at all, because "old assemblers don't support it".
> The change definitely makes the code less readable, because it emits
> some magic constants instead of direct label difference.
>
> Maybe the stuff can be conditionalized? E.g. via "HasUleb" option or
> something like this?
>

It is a maintenance problem in this particular code, but I think it is 
the best global solution. Consider the alternatives:

* have llvm-gcc use llvm-mc. We would need a ppc parser and it is not 
clear that dragonegg could do the same trick (it would have to patch 
gcc's spec at runtime)

* Have a table emission code in Codegen. This would be a lot of 
duplicated code.

* Have this conditionalized. The code would still be there, just not 
executed as often and it would be more likely to catch bugs. As it is 
now, it is well tested. When I added the cfi.s test, I added it with all 
the personality and lsda combinations that gas supported.

Cheers,
Rafael



More information about the llvm-commits mailing list