summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bytecode
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2007-04-08 23:58:41 +0000
committerReid Spencer <rspencer@reidspencer.com>2007-04-08 23:58:41 +0000
commit8b73a719cf90df79bf4fd2ce79ced83dfe5fce2a (patch)
tree208c21e41ec94c36f347cbba2be37d69917eea88 /llvm/lib/Bytecode
parentdb77ca7cc1b72efde81eba3886bc2b371255a0b2 (diff)
downloadbcm5719-llvm-8b73a719cf90df79bf4fd2ce79ced83dfe5fce2a.tar.gz
bcm5719-llvm-8b73a719cf90df79bf4fd2ce79ced83dfe5fce2a.zip
No functional change, this is just easier to read and debug.
llvm-svn: 35782
Diffstat (limited to 'llvm/lib/Bytecode')
-rw-r--r--llvm/lib/Bytecode/Reader/Reader.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/llvm/lib/Bytecode/Reader/Reader.cpp b/llvm/lib/Bytecode/Reader/Reader.cpp
index f0f6597d852..82b1888e6aa 100644
--- a/llvm/lib/Bytecode/Reader/Reader.cpp
+++ b/llvm/lib/Bytecode/Reader/Reader.cpp
@@ -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?
OpenPOWER on IntegriCloud