aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Bitcode/Writer
diff options
context:
space:
mode:
authorGabor Greif <ggreif@gmail.com>2009-01-30 18:27:21 +0000
committerGabor Greif <ggreif@gmail.com>2009-01-30 18:27:21 +0000
commitae6ab1e95022244129b262251c9fac821a5efa4d (patch)
treed708ee557066bce17fea08288412c4689e8f42cb /lib/Bitcode/Writer
parentc1bb13f1b8794aa6f3219b3ac567f569ad78a6d1 (diff)
downloadexternal_llvm-ae6ab1e95022244129b262251c9fac821a5efa4d.zip
external_llvm-ae6ab1e95022244129b262251c9fac821a5efa4d.tar.gz
external_llvm-ae6ab1e95022244129b262251c9fac821a5efa4d.tar.bz2
use precise getters
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63403 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bitcode/Writer')
-rw-r--r--lib/Bitcode/Writer/BitcodeWriter.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/Bitcode/Writer/BitcodeWriter.cpp b/lib/Bitcode/Writer/BitcodeWriter.cpp
index 0cb476e..e37c439 100644
--- a/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -811,11 +811,14 @@ static void WriteInstruction(const Instruction &I, unsigned InstID,
}
break;
case Instruction::Br:
- Code = bitc::FUNC_CODE_INST_BR;
- Vals.push_back(VE.getValueID(I.getOperand(0)));
- if (cast<BranchInst>(I).isConditional()) {
- Vals.push_back(VE.getValueID(I.getOperand(1)));
- Vals.push_back(VE.getValueID(I.getOperand(2)));
+ {
+ Code = bitc::FUNC_CODE_INST_BR;
+ BranchInst &II(cast<BranchInst>(I));
+ Vals.push_back(VE.getValueID(II.getSuccessor(0)));
+ if (II.isConditional()) {
+ Vals.push_back(VE.getValueID(II.getSuccessor(1)));
+ Vals.push_back(VE.getValueID(II.getCondition()));
+ }
}
break;
case Instruction::Switch: