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 | f12b379448a9f2131feba15c01714e44bedda120 (patch) | |
tree | 04edc550bcb649ae1e77430e3ddc01c4c1b118a3 /lib/IR/AsmWriter.cpp | |
parent | 612779eb83a98cec1e11dc823ba2e6420edbce54 (diff) | |
download | llvm-f12b379448a9f2131feba15c01714e44bedda120.tar.gz llvm-f12b379448a9f2131feba15c01714e44bedda120.tar.bz2 llvm-f12b379448a9f2131feba15c01714e44bedda120.tar.xz |
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/IR/AsmWriter.cpp')
-rw-r--r-- | lib/IR/AsmWriter.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/IR/AsmWriter.cpp b/lib/IR/AsmWriter.cpp index efa59788aa..d3736a1bb4 100644 --- a/lib/IR/AsmWriter.cpp +++ b/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); |