[llvm-commits] [llvm] r122595 - /llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp

Duncan Sands baldrick at free.fr
Tue Dec 28 02:07:15 PST 2010


Author: baldrick
Date: Tue Dec 28 04:07:15 2010
New Revision: 122595

URL: http://llvm.org/viewvc/llvm-project?rev=122595&view=rev
Log:
Pacify the compiler.  BestWeight cannot in fact be used uninitialized
in this function, but the compiler was warning that it might be when
doing a release build.

Modified:
    llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp

Modified: llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp?rev=122595&r1=122594&r2=122595&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp (original)
+++ llvm/trunk/lib/CodeGen/RegAllocGreedy.cpp Tue Dec 28 04:07:15 2010
@@ -379,7 +379,7 @@
                                      SmallVectorImpl<LiveInterval*> &NewVRegs) {
   NamedRegionTimer T("Spill Interference", TimerGroupName, TimePassesIsEnabled);
   unsigned BestPhys = 0;
-  float BestWeight;
+  float BestWeight = 0;
 
   Order.rewind();
   while (unsigned PhysReg = Order.next()) {





More information about the llvm-commits mailing list