summaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2016-03-25 02:20:28 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2016-03-25 02:20:28 +0000
commitbdde9e1f218d89ab68ad91c137c63c23ad450575 (patch)
tree23b0cf3a07033e947295213b3edfd2083f6f4839 /llvm/lib/Bitcode/Writer/ValueEnumerator.cpp
parentaef8452729e914897c5ed69c48472f3841f6515f (diff)
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. llvm-svn: 264381
Diffstat (limited to 'llvm/lib/Bitcode/Writer/ValueEnumerator.cpp')
-rw-r--r--llvm/lib/Bitcode/Writer/ValueEnumerator.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp b/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp
index b6e8e57577c4..08b5e45703ab 100644
--- a/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp
+++ b/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp
@@ -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)