ychen added a comment.

In D103495#2794684 <https://reviews.llvm.org/D103495#2794684>, @rnk wrote:

> In D103495#2794667 <https://reviews.llvm.org/D103495#2794667>, @ychen wrote:
>
>> Is there anything preventing us from using the existing priority field to 
>> define the order instead of introducing the order among initializers with 
>> the same priority? If we go with 1., there would be no way to say that "the 
>> order does not matter" right?
>
> The priority is used mainly for inter-object initialization order. It moves 
> the initializer into a `.init_array.N` section, for some number `N`. The 
> programmer may be using existing numbers via 
> `__attribute__((init_priority(N)))`, so it isn't safe for the compiler to use 
> anything other than the default initialization priority.

I see. It makes sense to define the order at IR level then since the order is 
there in `.init_array.N`/`.ctors` section nevertheless.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D103495/new/

https://reviews.llvm.org/D103495

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to