[BOLT] Fix Windows build

Summary:
Make BOLT build in VisualStudio compiler and run without
crashing on a simple test. Other tests are not running.

(cherry picked from FBD32378736)
This commit is contained in:
Rafael Auler
2021-11-11 18:14:53 -08:00
committed by Maksim Panchenko
parent 0e7dd1aad1
commit ae585be11c
11 changed files with 104 additions and 125 deletions

View File

@@ -81,8 +81,9 @@ bool BinaryBasicBlock::validateSuccessorInvariants() {
// any overlapping jump tables. We only look at the entries for the jump
// table that is referenced at the last instruction.
const auto Range = JT->getEntriesForAddress(BC.MIB->getJumpTable(*Inst));
const std::vector<const MCSymbol *> Entries(&JT->Entries[Range.first],
&JT->Entries[Range.second]);
const std::vector<const MCSymbol *> Entries(
std::next(JT->Entries.begin(), Range.first),
std::next(JT->Entries.begin(), Range.second));
std::set<const MCSymbol *> UniqueSyms(Entries.begin(), Entries.end());
for (BinaryBasicBlock *Succ : Successors) {
auto Itr = UniqueSyms.find(Succ->getLabel());