diff options
author | David Blaikie <dblaikie@gmail.com> | 2013-02-11 01:16:51 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2013-02-11 01:16:51 +0000 |
commit | b78e9e59ca9cf03ed024d43d6eb7bc92b7d995ff (patch) | |
tree | 6370c9f59fb098e597f7fa0eb042940d5f1c2d21 /llvm/lib/IR/AsmWriter.cpp | |
parent | 440d8e48ae7afe1231e93c0ac7dc67f328f3a1c1 (diff) | |
download | bcm5719-llvm-b78e9e59ca9cf03ed024d43d6eb7bc92b7d995ff.tar.gz bcm5719-llvm-b78e9e59ca9cf03ed024d43d6eb7bc92b7d995ff.zip |
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.
llvm-svn: 174853
Diffstat (limited to 'llvm/lib/IR/AsmWriter.cpp')
-rw-r--r-- | llvm/lib/IR/AsmWriter.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/IR/AsmWriter.cpp b/llvm/lib/IR/AsmWriter.cpp index efa59788aa5..d3736a1bb4b 100644 --- a/llvm/lib/IR/AsmWriter.cpp +++ b/llvm/lib/IR/AsmWriter.cpp @@ -1758,7 +1758,7 @@ void AssemblyWriter::printInstruction(const Instruction &I) { // Special case conditional branches to swizzle the condition out to the front if (isa<BranchInst>(I) && cast<BranchInst>(I).isConditional()) { - BranchInst &BI(cast<BranchInst>(I)); + const BranchInst &BI(cast<BranchInst>(I)); Out << ' '; writeOperand(BI.getCondition(), true); Out << ", "; @@ -1767,14 +1767,14 @@ void AssemblyWriter::printInstruction(const Instruction &I) { writeOperand(BI.getSuccessor(1), true); } else if (isa<SwitchInst>(I)) { - SwitchInst& SI(cast<SwitchInst>(I)); + const SwitchInst& SI(cast<SwitchInst>(I)); // Special case switch instruction to get formatting nice and correct. Out << ' '; writeOperand(SI.getCondition(), true); Out << ", "; writeOperand(SI.getDefaultDest(), true); Out << " ["; - 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) { Out << "\n "; writeOperand(i.getCaseValue(), true); |