[PATCH] Bitcode: Collect all MDString records into a single blob

Duncan P. N. Exon Smith via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 25 01:37:52 PDT 2016


> On 2016-Mar-24, at 19:40, Mehdi Amini <mehdi.amini at apple.com> wrote:
> 
>>> 
>>> +  // Put the strings first.
>>> +  std::stable_partition(MDs.begin(), MDs.end(),
>>> +                        [](const Metadata *MD) { return isa<MDString>(MD); });
>>> 
>>> I assume the use of std::stable_partition instead of std::partition is on the same level as "-preserve-bc-uselistorder", i.e. paranoid reproducibility but not required for correctness?
>> 
>> Not paranoid at all.  This is reproducibility at different levels.
>> 
>> This makes it so that clang will produce the same output when run
>> twice on the same input.
>> 
>> Preserving use-list order let's you re-enter the compiler and get
>> the same result as if you hadn't left in the first place.
> 
> 
> But MDString don't have use list right?

Right.  Use-lists are unrelated to using stable_partition here.



More information about the llvm-commits mailing list