[llvm-exegesis] Fix compile error on VS.

llvm::BitVector::const_set_bits_iterator is not formally a
ForwardIterator. Using it as such results in compile time errors on some
compilers:

FAILED: unittests/tools/llvm-exegesis/X86/CMakeFiles/LLVMExegesisX86Tests.dir/RegisterAliasingTest.cpp.obj
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xutility(967): error C2794: 'iterator_category': is not a member of any direct or indirect base class of 'std::iterator_traits<_InIt>'
        with
        [
            _InIt=llvm::BitVector::const_set_bits_iterator
        ]

llvm-svn: 332697
This commit is contained in:
Clement Courbet 2018-05-18 07:18:56 +00:00
parent 6e07dfb148
commit da3f49a435
1 changed files with 3 additions and 3 deletions

View File

@ -44,9 +44,9 @@ private:
TEST_F(RegisterAliasingTest, TrackSimpleRegister) {
const auto &RegInfo = getMCRegInfo();
const RegisterAliasingTracker tracker(RegInfo, llvm::X86::EAX);
const std::set<llvm::MCPhysReg> ActualAliasedRegisters(
tracker.aliasedBits().set_bits().begin(),
tracker.aliasedBits().set_bits().end());
std::set<llvm::MCPhysReg> ActualAliasedRegisters;
for (unsigned I : tracker.aliasedBits().set_bits())
ActualAliasedRegisters.insert(static_cast<llvm::MCPhysReg>(I));
const std::set<llvm::MCPhysReg> ExpectedAliasedRegisters = {
llvm::X86::AL, llvm::X86::AH, llvm::X86::AX,
llvm::X86::EAX, llvm::X86::HAX, llvm::X86::RAX};