summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/AsmWriter.cpp
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
commitb78e9e59ca9cf03ed024d43d6eb7bc92b7d995ff (patch)
tree6370c9f59fb098e597f7fa0eb042940d5f1c2d21 /llvm/lib/IR/AsmWriter.cpp
parent440d8e48ae7afe1231e93c0ac7dc67f328f3a1c1 (diff)
downloadbcm5719-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.cpp6
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);
OpenPOWER on IntegriCloud