diff options
author | Andreas Sandberg <andreas.sandberg@arm.com> | 2017-05-18 15:11:23 +0100 |
---|---|---|
committer | Andreas Sandberg <andreas.sandberg@arm.com> | 2017-05-19 08:00:45 +0000 |
commit | c4b85d5f9854abeee6d1dbe15ae65a7a1aada6b2 (patch) | |
tree | 521b54e172ab547cd2147502bdb0015be924bb73 /src/arch/hsail | |
parent | 41ab3e6e7e9b5a5f4427949f9a981cdf2186c88a (diff) | |
download | gem5-c4b85d5f9854abeee6d1dbe15ae65a7a1aada6b2.tar.xz |
base, sim, arch: Fix clang 5.0 warnings
Compiling gem5 with recent version of clang (4 and 5) triggers
warnings that are treated as errors:
* Global templatized static functions result in a warning if they
are not used. These should either be declared as static inline or
without the static identifier to avoid the warning.
* Some templatized classes contain static variables. The
instantiated versions of these variables / templates need to be
explicitly declared to avoid a compiler warning.
Change-Id: Ie8261144836e94ebab7ea04ccccb90927672c257
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/3420
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Diffstat (limited to 'src/arch/hsail')
-rw-r--r-- | src/arch/hsail/insts/decl.hh | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/arch/hsail/insts/decl.hh b/src/arch/hsail/insts/decl.hh index f84cb61e9..3132a425a 100644 --- a/src/arch/hsail/insts/decl.hh +++ b/src/arch/hsail/insts/decl.hh @@ -1272,6 +1272,27 @@ namespace HsailISA template<typename T> T heynot(T arg) { return ~arg; } template<> inline bool heynot<bool>(bool arg) { return !arg; } + + + /* Explicitly declare template static member variables to avoid + * warnings in some clang versions + */ + template<> const char *B1::label; + template<> const char *B8::label; + template<> const char *B16::label; + template<> const char *B32::label; + template<> const char *B64::label; + template<> const char *S8::label; + template<> const char *S16::label; + template<> const char *S32::label; + template<> const char *S64::label; + template<> const char *U8::label; + template<> const char *U16::label; + template<> const char *U32::label; + template<> const char *U64::label; + template<> const char *F32::label; + template<> const char *F64::label; + } // namespace HsailISA #endif // __ARCH_HSAIL_INSTS_DECL_HH__ |