No functional change, this is just easier to read and debug.
authorReid Spencer <rspencer@reidspencer.com>
Sun, 8 Apr 2007 23:58:41 +0000 (23:58 +0000)
committerReid Spencer <rspencer@reidspencer.com>
Sun, 8 Apr 2007 23:58:41 +0000 (23:58 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35782 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Bytecode/Reader/Reader.cpp

index f0f6597d8528b7030e18d7ed74ade03b9ef5d2b6..82b1888e6aa390b3c626248458f690be98f1a892 100644 (file)
@@ -276,16 +276,17 @@ Value * BytecodeReader::getValue(unsigned type, unsigned oNum, bool Create) {
     }
   }
 
-  if (GlobalTyID < ModuleValues.size() && ModuleValues[GlobalTyID]) {
-    if (Num < ModuleValues[GlobalTyID]->size())
-      return ModuleValues[GlobalTyID]->getOperand(Num);
-    Num -= ModuleValues[GlobalTyID]->size();
-  }
+  if (GlobalTyID < ModuleValues.size()) 
+    if (ValueList *Globals = ModuleValues[GlobalTyID]) {
+      if (Num < Globals->size())
+        return Globals->getOperand(Num);
+      Num -= Globals->size();
+    }
 
-  if (FunctionValues.size() > type &&
-      FunctionValues[type] &&
-      Num < FunctionValues[type]->size())
-    return FunctionValues[type]->getOperand(Num);
+  if (type < FunctionValues.size())
+    if (ValueList *Locals = FunctionValues[type])
+      if (Num < Locals->size())
+        return Locals->getOperand(Num);
 
   if (!Create) return 0;  // Do not create a placeholder?