[llvm-commits] CVS: llvm/lib/Bytecode/Reader/Reader.cpp

Chris Lattner lattner at cs.uiuc.edu
Mon Jul 26 19:34:59 PDT 2004



Changes in directory llvm/lib/Bytecode/Reader:

Reader.cpp updated: 1.119 -> 1.120

---
Log message:

Simplify code and silence warning


---
Diffs of the changes:  (+4 -6)

Index: llvm/lib/Bytecode/Reader/Reader.cpp
diff -u llvm/lib/Bytecode/Reader/Reader.cpp:1.119 llvm/lib/Bytecode/Reader/Reader.cpp:1.120
--- llvm/lib/Bytecode/Reader/Reader.cpp:1.119	Sun Jul 25 18:15:44 2004
+++ llvm/lib/Bytecode/Reader/Reader.cpp	Mon Jul 26 21:34:49 2004
@@ -1401,16 +1401,14 @@
     
     // Check to see if we have already read this global variable...
     Value *Val = getValue(TypeID, Slot, false);
-    GlobalValue *GV;
     if (Val) {
-      if (!(GV = dyn_cast<GlobalValue>(Val))) 
-        error("GlobalValue not in ValueTable!");
+      GlobalValue *GV = dyn_cast<GlobalValue>(Val);
+      if (!GV) error("GlobalValue not in ValueTable!");
+      if (Handler) Handler->handleConstantPointer(PT, Slot, GV);
+      return GV;
     } else {
       error("Forward references are not allowed here.");
     }
-    
-    if (Handler) Handler->handleConstantPointer(PT, Slot, GV );
-    return GV;
   }
 
   default:





More information about the llvm-commits mailing list