Remove unnecessary use of boost::make_optional

Closes #119.
This commit is contained in:
MerryMage 2017-11-28 20:56:49 +00:00
parent d00ce34432
commit 80c56aa89d
6 changed files with 6 additions and 6 deletions

View file

@ -124,7 +124,7 @@ boost::optional<EmitX64::BlockDescriptor> EmitX64::GetBasicBlock(IR::LocationDes
auto iter = block_descriptors.find(descriptor.UniqueHash()); auto iter = block_descriptors.find(descriptor.UniqueHash());
if (iter == block_descriptors.end()) if (iter == block_descriptors.end())
return boost::none; return boost::none;
return boost::make_optional<BlockDescriptor>(iter->second); return iter->second;
} }
void EmitX64::EmitVoid(RegAlloc&, IR::Block&, IR::Inst*) { void EmitX64::EmitVoid(RegAlloc&, IR::Block&, IR::Inst*) {

View file

@ -388,7 +388,7 @@ HostLoc RegAlloc::SelectARegister(HostLocList desired_locations) const {
boost::optional<HostLoc> RegAlloc::ValueLocation(const IR::Inst* value) const { boost::optional<HostLoc> RegAlloc::ValueLocation(const IR::Inst* value) const {
for (size_t i = 0; i < HostLocCount; i++) for (size_t i = 0; i < HostLocCount; i++)
if (hostloc_info[i].ContainsValue(value)) if (hostloc_info[i].ContainsValue(value))
return boost::make_optional<HostLoc>(static_cast<HostLoc>(i)); return static_cast<HostLoc>(i);
return boost::none; return boost::none;
} }

View file

@ -327,7 +327,7 @@ boost::optional<const ArmMatcher<V>&> DecodeArm(u32 instruction) {
const auto matches_instruction = [instruction](const auto& matcher) { return matcher.Matches(instruction); }; const auto matches_instruction = [instruction](const auto& matcher) { return matcher.Matches(instruction); };
auto iter = std::find_if(table.begin(), table.end(), matches_instruction); auto iter = std::find_if(table.begin(), table.end(), matches_instruction);
return iter != table.end() ? boost::make_optional<const ArmMatcher<V>&>(*iter) : boost::none; return iter != table.end() ? boost::optional<const ArmMatcher<V>&>(*iter) : boost::none;
} }
} // namespace Arm } // namespace Arm

View file

@ -120,7 +120,7 @@ boost::optional<const Thumb16Matcher<V>&> DecodeThumb16(u16 instruction) {
const auto matches_instruction = [instruction](const auto& matcher){ return matcher.Matches(instruction); }; const auto matches_instruction = [instruction](const auto& matcher){ return matcher.Matches(instruction); };
auto iter = std::find_if(table.begin(), table.end(), matches_instruction); auto iter = std::find_if(table.begin(), table.end(), matches_instruction);
return iter != table.end() ? boost::make_optional<const Thumb16Matcher<V>&>(*iter) : boost::none; return iter != table.end() ? boost::optional<const Thumb16Matcher<V>&>(*iter) : boost::none;
} }
} // namespace Arm } // namespace Arm

View file

@ -40,7 +40,7 @@ boost::optional<const Thumb32Matcher<V>&> DecodeThumb32(u32 instruction) {
const auto matches_instruction = [instruction](const auto& matcher){ return matcher.Matches(instruction); }; const auto matches_instruction = [instruction](const auto& matcher){ return matcher.Matches(instruction); };
auto iter = std::find_if(table.begin(), table.end(), matches_instruction); auto iter = std::find_if(table.begin(), table.end(), matches_instruction);
return iter != table.end() ? boost::make_optional<const Thumb32Matcher<V>&>(*iter) : boost::none; return iter != table.end() ? boost::optional<const Thumb32Matcher<V>&>(*iter) : boost::none;
} }
} // namespace Arm } // namespace Arm

View file

@ -85,7 +85,7 @@ boost::optional<const VFP2Matcher<V>&> DecodeVFP2(u32 instruction) {
const auto matches_instruction = [instruction](const auto& matcher){ return matcher.Matches(instruction); }; const auto matches_instruction = [instruction](const auto& matcher){ return matcher.Matches(instruction); };
auto iter = std::find_if(table.begin(), table.end(), matches_instruction); auto iter = std::find_if(table.begin(), table.end(), matches_instruction);
return iter != table.end() ? boost::make_optional<const VFP2Matcher<V>&>(*iter) : boost::none; return iter != table.end() ? boost::optional<const VFP2Matcher<V>&>(*iter) : boost::none;
} }
} // namespace Arm } // namespace Arm