[llvm] r286648 - FunctionComparator: don't rely on argument evaluation order.

Erik Eckstein via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 11 14:21:39 PST 2016


Author: eeckstein
Date: Fri Nov 11 16:21:39 2016
New Revision: 286648

URL: http://llvm.org/viewvc/llvm-project?rev=286648&view=rev
Log:
FunctionComparator: don't rely on argument evaluation order.

This is a follow-up on the recent refactoring of the FunctionMerge pass.
It should fix a fail of the new FunctionComparator unittest whe compiling with MSVC.


Modified:
    llvm/trunk/lib/Transforms/Utils/FunctionComparator.cpp

Modified: llvm/trunk/lib/Transforms/Utils/FunctionComparator.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/FunctionComparator.cpp?rev=286648&r1=286647&r2=286648&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/FunctionComparator.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/FunctionComparator.cpp Fri Nov 11 16:21:39 2016
@@ -355,7 +355,9 @@ int FunctionComparator::cmpConstants(con
 }
 
 int FunctionComparator::cmpGlobalValues(GlobalValue *L, GlobalValue *R) const {
-  return cmpNumbers(GlobalNumbers->getNumber(L), GlobalNumbers->getNumber(R));
+  uint64_t LNumber = GlobalNumbers->getNumber(L);
+  uint64_t RNumber = GlobalNumbers->getNumber(R);
+  return cmpNumbers(LNumber, RNumber);
 }
 
 /// cmpType - compares two types,




More information about the llvm-commits mailing list