aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Bitcode
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2013-02-11 01:16:51 +0000
committerDavid Blaikie <dblaikie@gmail.com>2013-02-11 01:16:51 +0000
commitf12b379448a9f2131feba15c01714e44bedda120 (patch)
tree04edc550bcb649ae1e77430e3ddc01c4c1b118a3 /lib/Bitcode
parent612779eb83a98cec1e11dc823ba2e6420edbce54 (diff)
downloadexternal_llvm-f12b379448a9f2131feba15c01714e44bedda120.zip
external_llvm-f12b379448a9f2131feba15c01714e44bedda120.tar.gz
external_llvm-f12b379448a9f2131feba15c01714e44bedda120.tar.bz2
Fix unnecessary removal of const through cast machinery
I have some uncommitted changes to the cast code that catch this sort of thing at compile-time but I still need to do some other cleanup before I can enable it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174853 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bitcode')
-rw-r--r--lib/Bitcode/Writer/BitcodeWriter.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Bitcode/Writer/BitcodeWriter.cpp b/lib/Bitcode/Writer/BitcodeWriter.cpp
index 8d43099..37dcb46 100644
--- a/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -1249,7 +1249,7 @@ static void WriteInstruction(const Instruction &I, unsigned InstID,
case Instruction::Br:
{
Code = bitc::FUNC_CODE_INST_BR;
- BranchInst &II = cast<BranchInst>(I);
+ const BranchInst &II = cast<BranchInst>(I);
Vals.push_back(VE.getValueID(II.getSuccessor(0)));
if (II.isConditional()) {
Vals.push_back(VE.getValueID(II.getSuccessor(1)));
@@ -1264,7 +1264,7 @@ static void WriteInstruction(const Instruction &I, unsigned InstID,
SmallVector<uint64_t, 128> Vals64;
Code = bitc::FUNC_CODE_INST_SWITCH;
- SwitchInst &SI = cast<SwitchInst>(I);
+ const SwitchInst &SI = cast<SwitchInst>(I);
uint32_t SwitchRecordHeader = SI.hash() | (SWITCH_INST_MAGIC << 16);
Vals64.push_back(SwitchRecordHeader);
@@ -1273,9 +1273,9 @@ static void WriteInstruction(const Instruction &I, unsigned InstID,
pushValue64(SI.getCondition(), InstID, Vals64, VE);
Vals64.push_back(VE.getValueID(SI.getDefaultDest()));
Vals64.push_back(SI.getNumCases());
- for (SwitchInst::CaseIt i = SI.case_begin(), e = SI.case_end();
+ for (SwitchInst::ConstCaseIt i = SI.case_begin(), e = SI.case_end();
i != e; ++i) {
- IntegersSubset& CaseRanges = i.getCaseValueEx();
+ const IntegersSubset& CaseRanges = i.getCaseValueEx();
unsigned Code, Abbrev; // will unused.
if (CaseRanges.isSingleNumber()) {