aboutsummaryrefslogtreecommitdiff
path: root/lib/Bytecode/Reader/Reader.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-07-27 02:34:49 +0000
committerChris Lattner <sabre@nondot.org>2004-07-27 02:34:49 +0000
commitbcb11cf13209d5aa32cbbf82cc266d202163739e (patch)
tree22c5f7c5cb9ea374a71817bd52064b865dec0466 /lib/Bytecode/Reader/Reader.cpp
parentefe30ef790ecec920b48aeacfb98ea4fe5516f01 (diff)
Simplify code and silence warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15255 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bytecode/Reader/Reader.cpp')
-rw-r--r--lib/Bytecode/Reader/Reader.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/Bytecode/Reader/Reader.cpp b/lib/Bytecode/Reader/Reader.cpp
index 6da38dd6c7..3ebd7c88f4 100644
--- a/lib/Bytecode/Reader/Reader.cpp
+++ b/lib/Bytecode/Reader/Reader.cpp
@@ -1401,16 +1401,14 @@ Constant *BytecodeReader::ParseConstantValue(unsigned TypeID) {
// 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: