Bitcode: Use std::stable_partition for reproducible builds

Caught by inspection while working on partitioning metadata.  It's nice
to produce the same bitcode if you run the compiler twice.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264381 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan P. N. Exon Smith 2016-03-25 02:20:28 +00:00
parent f206a2c034
commit 93e5944cd8

View File

@ -472,8 +472,8 @@ void ValueEnumerator::OptimizeConstants(unsigned CstStart, unsigned CstEnd) {
// Ensure that integer and vector of integer constants are at the start of the
// constant pool. This is important so that GEP structure indices come before
// gep constant exprs.
std::partition(Values.begin()+CstStart, Values.begin()+CstEnd,
isIntOrIntVectorValue);
std::stable_partition(Values.begin() + CstStart, Values.begin() + CstEnd,
isIntOrIntVectorValue);
// Rebuild the modified portion of ValueMap.
for (; CstStart != CstEnd; ++CstStart)