forked from OSchip/llvm-project
SwitchInst cosmetics: renamed "Hash" method to "hash"
llvm-svn: 156757
This commit is contained in:
parent
c3fd480203
commit
3dea421826
|
@ -2733,7 +2733,7 @@ public:
|
||||||
setOperand(idx*2+1, (Value*)NewSucc);
|
setOperand(idx*2+1, (Value*)NewSucc);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t Hash() const {
|
uint16_t hash() const {
|
||||||
uint32_t NumberOfCases = (uint32_t)getNumCases();
|
uint32_t NumberOfCases = (uint32_t)getNumCases();
|
||||||
uint16_t Hash = (0xFFFF & NumberOfCases) ^ (NumberOfCases >> 16);
|
uint16_t Hash = (0xFFFF & NumberOfCases) ^ (NumberOfCases >> 16);
|
||||||
for (ConstCaseIt i = case_begin(), e = case_end();
|
for (ConstCaseIt i = case_begin(), e = case_end();
|
||||||
|
|
|
@ -2280,7 +2280,7 @@ bool BitcodeReader::ParseFunctionBody(Function *F) {
|
||||||
ConstantRangesSet Case = CaseBuilder.getCase();
|
ConstantRangesSet Case = CaseBuilder.getCase();
|
||||||
SI->addCase(Case, DestBB);
|
SI->addCase(Case, DestBB);
|
||||||
}
|
}
|
||||||
uint16_t Hash = SI->Hash();
|
uint16_t Hash = SI->hash();
|
||||||
if (Hash != (Record[0] & 0xFFFF))
|
if (Hash != (Record[0] & 0xFFFF))
|
||||||
return Error("Invalid SWITCH record");
|
return Error("Invalid SWITCH record");
|
||||||
I = SI;
|
I = SI;
|
||||||
|
|
|
@ -1159,7 +1159,7 @@ static void WriteInstruction(const Instruction &I, unsigned InstID,
|
||||||
Code = bitc::FUNC_CODE_INST_SWITCH;
|
Code = bitc::FUNC_CODE_INST_SWITCH;
|
||||||
SwitchInst &SI = cast<SwitchInst>(I);
|
SwitchInst &SI = cast<SwitchInst>(I);
|
||||||
|
|
||||||
uint32_t SwitchRecordHeader = SI.Hash() | (SWITCH_INST_MAGIC << 16);
|
uint32_t SwitchRecordHeader = SI.hash() | (SWITCH_INST_MAGIC << 16);
|
||||||
Vals64.push_back(SwitchRecordHeader);
|
Vals64.push_back(SwitchRecordHeader);
|
||||||
|
|
||||||
Vals64.push_back(VE.getTypeID(SI.getCondition()->getType()));
|
Vals64.push_back(VE.getTypeID(SI.getCondition()->getType()));
|
||||||
|
|
Loading…
Reference in New Issue