summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
diff options
context:
space:
mode:
authorStepan Dyatkovskiy <stpworld@narod.ru>2012-06-02 09:42:43 +0000
committerStepan Dyatkovskiy <stpworld@narod.ru>2012-06-02 09:42:43 +0000
commit0e46d8a08c4c50519bd3c5688d0bb21f57edb075 (patch)
treedfbc28d82597dd7cccac348c8c637d424adad38f /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
parent539df9ef0a208802ebff95db0c87f574e806848a (diff)
downloadbcm5719-llvm-0e46d8a08c4c50519bd3c5688d0bb21f57edb075.tar.gz
bcm5719-llvm-0e46d8a08c4c50519bd3c5688d0bb21f57edb075.zip
PR1255: case ranges.
IntRange converted from struct to class. So main change everywhere is replacement of ".Low/High" with ".getLow/getHigh()" llvm-svn: 157884
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
-rw-r--r--llvm/lib/Bitcode/Writer/BitcodeWriter.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
index 7dd18c87ffe..6526b012d81 100644
--- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -1161,16 +1161,15 @@ static void WriteInstruction(const Instruction &I, unsigned InstID,
Vals64.push_back(CaseRanges.getNumItems());
for (unsigned ri = 0, rn = CaseRanges.getNumItems(); ri != rn; ++ri) {
IntegersSubset::Range r = CaseRanges.getItem(ri);
+ bool IsSingleNumber = r.isSingleNumber();
- Vals64.push_back(CaseRanges.isSingleNumber(ri));
+ Vals64.push_back(IsSingleNumber);
- const APInt &Low = r.Low;
- const APInt &High = r.High;
unsigned Code, Abbrev; // will unused.
- EmitAPInt(Vals64, Code, Abbrev, Low, true);
- if (r.Low != r.High)
- EmitAPInt(Vals64, Code, Abbrev, High, true);
+ EmitAPInt(Vals64, Code, Abbrev, r.getLow(), true);
+ if (!IsSingleNumber)
+ EmitAPInt(Vals64, Code, Abbrev, r.getHigh(), true);
}
Vals64.push_back(VE.getValueID(i.getCaseSuccessor()));
}
OpenPOWER on IntegriCloud