From ab0de38f16a9eff13ee5a32a3408b890d87941f6 Mon Sep 17 00:00:00 2001 From: Christian Parpart Date: Wed, 7 Nov 2018 12:04:46 +0100 Subject: Eliminate `byte`-typedef and use `uint8_t` in all their places instead. This change is made to (easily) be forward compatible with future C++ standards, in order to allow compiling the code with newer standards at some point in the future. * Removed the `using byte = uint8_t;` line from Common.h * Mechanically change all uses of `byte` to `uint8_t`. Tested with GCC 7.3 in C++11/14/17 modes :-) --- libyul/optimiser/SimplificationRules.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libyul/optimiser/SimplificationRules.cpp') diff --git a/libyul/optimiser/SimplificationRules.cpp b/libyul/optimiser/SimplificationRules.cpp index aca943b0..8e94fe4d 100644 --- a/libyul/optimiser/SimplificationRules.cpp +++ b/libyul/optimiser/SimplificationRules.cpp @@ -46,7 +46,7 @@ SimplificationRule const* SimplificationRules::findFirstMatch( assertThrow(rules.isInitialized(), OptimizerException, "Rule list not properly initialized."); FunctionalInstruction const& instruction = boost::get(_expr); - for (auto const& rule: rules.m_rules[byte(instruction.instruction)]) + for (auto const& rule: rules.m_rules[uint8_t(instruction.instruction)]) { rules.resetMatchGroups(); if (rule.pattern.matches(_expr, _ssaValues)) @@ -57,7 +57,7 @@ SimplificationRule const* SimplificationRules::findFirstMatch( bool SimplificationRules::isInitialized() const { - return !m_rules[byte(solidity::Instruction::ADD)].empty(); + return !m_rules[uint8_t(solidity::Instruction::ADD)].empty(); } void SimplificationRules::addRules(vector> const& _rules) @@ -68,7 +68,7 @@ void SimplificationRules::addRules(vector> const& _r void SimplificationRules::addRule(SimplificationRule const& _rule) { - m_rules[byte(_rule.pattern.instruction())].push_back(_rule); + m_rules[uint8_t(_rule.pattern.instruction())].push_back(_rule); } SimplificationRules::SimplificationRules() -- cgit