Skip to content

Commit 12984c6

Browse files
authored
Use clang-tidy 7 [skip appveyor]
1 parent 51de9e1 commit 12984c6

8 files changed

Lines changed: 18 additions & 22 deletions

File tree

.clang-tidy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
Checks: '*,-*braces-around-statements,-cppcoreguidelines-pro-type-union-access,-llvm-header-guard,-cert-err58-cpp,-fuchsia-default-arguments,-fuchsia-overloaded-operator'
2+
Checks: '*,-*braces-around-statements,-cppcoreguidelines-pro-type-union-access,-llvm-header-guard,-cert-err58-cpp,-fuchsia-default-arguments,-fuchsia-overloaded-operator,-fuchsia-statically-constructed-objects'

.travis.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,11 @@ addons:
2929
apt:
3030
sources:
3131
- ubuntu-toolchain-r-test
32-
- llvm-toolchain-trusty-6.0
32+
- sourceline: deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-7 main
3333
- sourceline: deb http://www.emdebian.org/debian/ squeeze main
3434
update: true
3535
packages:
36-
- lcov
3736
- g++-7
38-
- clang-tidy-6.0
3937
- libboost-program-options1.54-dev
4038

4139
install:
@@ -66,7 +64,8 @@ after_success:
6664
- ./mipt-mips -b $TRAVIS_BUILD_DIR/traces/fib.out -n 1000000 # Run a trace to see simulation frequency
6765
- |
6866
if [ $CXX == clang++ ] && [ "$TRAVIS_OS_NAME" == "linux" ]; then
69-
run-clang-tidy-6.0.py -header-filter='.*'
67+
sudo apt-get install clang-tidy-7 --allow-unauthenticated
68+
run-clang-tidy-7.py -header-filter='.*'
7069
fi
7170
- |
7271
if [ $CXX == g++-7 ] && [ "$TRAVIS_OS_NAME" == "linux" ]; then

simulator/infra/config/config.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class BaseTValue : public BaseValue
4444
friend std::ostream& operator<<( std::ostream& out, const BaseTValue& rhs)
4545
{
4646
if constexpr (std::is_same_v<T, bool>)
47-
return out << std::boolalpha << rhs.value << std::noboolalpha; // NOLINT(misc-suspicious-semicolon)
47+
return out << std::boolalpha << rhs.value << std::noboolalpha; // NOLINT(bugprone-suspicious-semicolon)
4848

4949
return out << std::dec << rhs.value;
5050
}
@@ -53,7 +53,7 @@ class BaseTValue : public BaseValue
5353
template<typename T>
5454
struct AliasedRequiredValue : BaseTValue<T>
5555
{
56-
AliasedRequiredValue<T>( const std::string& alias, const std::string& name, const std::string& desc) noexcept
56+
AliasedRequiredValue<T>( const std::string& alias, const std::string& name, const std::string& desc)
5757
: BaseTValue<T>( )
5858
{
5959
this->options().template add<popl::Value<T>, popl::Attribute::required>(alias, name, desc, T(), &this->value);
@@ -63,7 +63,7 @@ struct AliasedRequiredValue : BaseTValue<T>
6363
template<typename T>
6464
struct AliasedValue : BaseTValue<T>
6565
{
66-
AliasedValue<T>( const std::string& alias, const std::string& name, const T& val, const std::string& desc) noexcept
66+
AliasedValue<T>( const std::string& alias, const std::string& name, const T& val, const std::string& desc)
6767
: BaseTValue<T>( val)
6868
{
6969
this->options().template add<popl::Value<T>>(alias, name, desc, val, &this->value);
@@ -72,7 +72,7 @@ struct AliasedValue : BaseTValue<T>
7272

7373
struct AliasedSwitch : BaseTValue<bool>
7474
{
75-
AliasedSwitch( const std::string& alias, const std::string& name, const std::string& desc) noexcept
75+
AliasedSwitch( const std::string& alias, const std::string& name, const std::string& desc)
7676
: BaseTValue<bool>( false)
7777
{
7878
options().add<popl::Switch>(alias, name, desc, &this->value);
@@ -82,22 +82,22 @@ struct AliasedSwitch : BaseTValue<bool>
8282
template<typename T>
8383
struct Value : AliasedValue<T>
8484
{
85-
Value( const std::string& name, const T& val, const std::string& desc) noexcept
85+
Value( const std::string& name, const T& val, const std::string& desc)
8686
: AliasedValue<T>( "", name, val, desc)
8787
{ }
8888
};
8989

9090
template<typename T>
9191
struct RequiredValue : AliasedRequiredValue<T>
9292
{
93-
RequiredValue( const std::string& name, const std::string& desc) noexcept
93+
RequiredValue( const std::string& name, const std::string& desc)
9494
: AliasedRequiredValue<T>( "", name, desc)
9595
{ }
9696
};
9797

9898
struct Switch : AliasedSwitch
9999
{
100-
Switch( const std::string& name, const std::string& desc) noexcept
100+
Switch( const std::string& name, const std::string& desc)
101101
: AliasedSwitch( "", name, desc)
102102
{ }
103103
};

simulator/infra/macro.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ static constexpr T arithmetic_rs(const T& value, size_t shamt)
135135
if constexpr ((static_cast<ST>(-2) >> 1u) == static_cast<ST>(-1))
136136
// Compiler does arithmetic shift for signed values, trust it
137137
// Clang warns about implementation defined code, but we ignore that
138-
// NOLINTNEXTLINE(hicpp-signed-bitwise, misc-suspicious-semicolon)
138+
// NOLINTNEXTLINE(hicpp-signed-bitwise, bugprone-suspicious-semicolon)
139139
return static_cast<ST>(value) >> shamt;
140140

141141
return (value & msb_set<T>()) == 0 // check MSB

simulator/infra/memory/memory.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ T FuncMemory::read( Addr addr, T mask) const
8989
if (( mask & 0xFFu) == 0xFFu)
9090
value |= static_cast<T>(static_cast<T>(check_and_read_byte( addr + i)) << (i * 8));
9191
if constexpr ( bitwidth<T> > 8)
92-
mask >>= 8u; // NOLINT(misc-suspicious-semicolon)
92+
mask >>= 8u; // NOLINT(bugprone-suspicious-semicolon)
9393
}
9494

9595
return value;
@@ -113,9 +113,9 @@ void FuncMemory::write( T value, Addr addr, T mask)
113113
for ( size_t i = 0; i < bitwidth<T> / 8; ++i) {
114114
if ((mask & 0xFFu) == 0xFFu)
115115
alloc_and_write_byte( addr + i, static_cast<Byte>( static_cast<uint8>( value & 0xFFu)));
116-
if constexpr ( bitwidth<T> > 8) { // NOLINT(misc-suspicious-semicolon)
117-
mask >>= 8;
118-
value >>= 8;
116+
if constexpr ( bitwidth<T> > 8) { // NOLINT(bugprone-suspicious-semicolon)
117+
mask >>= 8u;
118+
value >>= 8u;
119119
}
120120
}
121121
}

simulator/infra/ports/t/unit_test.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,6 @@ namespace ports {
106106
void process_data ( int data, Cycle cycle);
107107
};
108108

109-
110-
111-
112109
static Logic logic{};
113110
} // namespace testing
114111
} // namespace ports

simulator/mips/mips_instr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ auto mips_division(T x, T y) {
3939
if ( y == 0)
4040
return ReturnType();
4141

42-
if constexpr( !std::is_same_v<T, unsign_t<T>>) // signed type NOLINTNEXTLINE(misc-suspicious-semicolon)
42+
if constexpr( !std::is_same_v<T, unsign_t<T>>) // signed type NOLINTNEXTLINE(bugprone-suspicious-semicolon)
4343
if ( y == -1 && x == static_cast<T>(msb_set<unsign_t<T>>())) // x86 has an exception here
4444
return ReturnType();
4545

simulator/modules/fetch/bpu/bpentry.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ class BPEntryAdaptive final : public BPEntry
198198
void update( bool is_taken)
199199
{
200200
/* updating pattern, simulating shift register */
201-
value <<= 1;
201+
value <<= 1u;
202202
value += static_cast<uint32>( is_taken);
203203
value &= pattern_mask;
204204
}

0 commit comments

Comments
 (0)