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>
This commit is contained in:
@@ -567,7 +567,8 @@ class IllegalInstSetStateFault : public ArmFaultVals<IllegalInstSetStateFault>
|
||||
};
|
||||
|
||||
/*
|
||||
* Explicitly declare template static member variables avoid warnings in some clang versions
|
||||
* Explicitly declare template static member variables to avoid warnings
|
||||
* in some clang versions
|
||||
*/
|
||||
template<> ArmFault::FaultVals ArmFaultVals<Reset>::vals;
|
||||
template<> ArmFault::FaultVals ArmFaultVals<UndefinedInstruction>::vals;
|
||||
|
||||
@@ -201,7 +201,7 @@ bitsToFp(uint64_t bits, double junk)
|
||||
}
|
||||
|
||||
template <class fpType>
|
||||
static bool
|
||||
static inline bool
|
||||
isSnan(fpType val)
|
||||
{
|
||||
const bool single = (sizeof(fpType) == sizeof(float));
|
||||
|
||||
@@ -65,7 +65,7 @@ class VfpMacroRegRegOp : public VfpMacroOp
|
||||
};
|
||||
|
||||
template <class VfpOp>
|
||||
static StaticInstPtr
|
||||
StaticInstPtr
|
||||
decodeVfpRegRegOp(ExtMachInst machInst,
|
||||
IntRegIndex dest, IntRegIndex op1, bool wide)
|
||||
{
|
||||
@@ -101,7 +101,7 @@ class VfpMacroRegImmOp : public VfpMacroOp
|
||||
};
|
||||
|
||||
template <class VfpOp>
|
||||
static StaticInstPtr
|
||||
StaticInstPtr
|
||||
decodeVfpRegImmOp(ExtMachInst machInst,
|
||||
IntRegIndex dest, uint64_t imm, bool wide)
|
||||
{
|
||||
@@ -137,7 +137,7 @@ class VfpMacroRegRegImmOp : public VfpMacroOp
|
||||
};
|
||||
|
||||
template <class VfpOp>
|
||||
static StaticInstPtr
|
||||
StaticInstPtr
|
||||
decodeVfpRegRegImmOp(ExtMachInst machInst, IntRegIndex dest,
|
||||
IntRegIndex op1, uint64_t imm, bool wide)
|
||||
{
|
||||
@@ -173,7 +173,7 @@ class VfpMacroRegRegRegOp : public VfpMacroOp
|
||||
};
|
||||
|
||||
template <class VfpOp>
|
||||
static StaticInstPtr
|
||||
StaticInstPtr
|
||||
decodeVfpRegRegRegOp(ExtMachInst machInst, IntRegIndex dest,
|
||||
IntRegIndex op1, IntRegIndex op2, bool wide)
|
||||
{
|
||||
|
||||
@@ -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__
|
||||
|
||||
@@ -303,6 +303,30 @@ class TlbModifiedFault : public TlbFault<TlbModifiedFault>
|
||||
ExcCode code() const { return MipsFault<TlbModifiedFault>::code(); }
|
||||
};
|
||||
|
||||
/*
|
||||
* Explicitly declare template static member variables to avoid warnings
|
||||
* in some clang versions
|
||||
*/
|
||||
template<> MipsFaultBase::FaultVals MipsFault<SystemCallFault>::vals;
|
||||
template<> MipsFaultBase::FaultVals MipsFault<ReservedInstructionFault>::vals;
|
||||
template<> MipsFaultBase::FaultVals MipsFault<ThreadFault>::vals;
|
||||
template<> MipsFaultBase::FaultVals MipsFault<IntegerOverflowFault>::vals;
|
||||
template<> MipsFaultBase::FaultVals MipsFault<TrapFault>::vals;
|
||||
template<> MipsFaultBase::FaultVals MipsFault<BreakpointFault>::vals;
|
||||
template<> MipsFaultBase::FaultVals MipsFault<DspStateDisabledFault>::vals;
|
||||
template<> MipsFaultBase::FaultVals MipsFault<MachineCheckFault>::vals;
|
||||
template<> MipsFaultBase::FaultVals MipsFault<ResetFault>::vals;
|
||||
template<> MipsFaultBase::FaultVals MipsFault<SoftResetFault>::vals;
|
||||
template<> MipsFaultBase::FaultVals MipsFault<NonMaskableInterrupt>::vals;
|
||||
template<> MipsFaultBase::FaultVals MipsFault<CoprocessorUnusableFault>::vals;
|
||||
template<> MipsFaultBase::FaultVals MipsFault<InterruptFault>::vals;
|
||||
template<> MipsFaultBase::FaultVals MipsFault<AddressErrorFault>::vals;
|
||||
template<> MipsFaultBase::FaultVals MipsFault<TlbInvalidFault>::vals;
|
||||
template<> MipsFaultBase::FaultVals MipsFault<TlbRefillFault>::vals;
|
||||
template<> MipsFaultBase::FaultVals MipsFault<TlbModifiedFault>::vals;
|
||||
|
||||
|
||||
|
||||
} // namespace MipsISA
|
||||
|
||||
#endif // __MIPS_FAULTS_HH__
|
||||
|
||||
@@ -276,6 +276,70 @@ class TrapInstruction : public EnumeratedFault<TrapInstruction>
|
||||
StaticInst::nullStaticInstPtr);
|
||||
};
|
||||
|
||||
/*
|
||||
* Explicitly declare template static member variables to avoid warnings
|
||||
* in some clang versions
|
||||
*/
|
||||
template<> SparcFaultBase::FaultVals SparcFault<PowerOnReset>::vals;
|
||||
template<> SparcFaultBase::FaultVals SparcFault<WatchDogReset>::vals;
|
||||
template<> SparcFaultBase::FaultVals
|
||||
SparcFault<ExternallyInitiatedReset>::vals;
|
||||
template<> SparcFaultBase::FaultVals SparcFault<SoftwareInitiatedReset>::vals;
|
||||
template<> SparcFaultBase::FaultVals SparcFault<REDStateException>::vals;
|
||||
template<> SparcFaultBase::FaultVals SparcFault<StoreError>::vals;
|
||||
template<> SparcFaultBase::FaultVals
|
||||
SparcFault<InstructionAccessException>::vals;
|
||||
template<> SparcFaultBase::FaultVals SparcFault<InstructionAccessError>::vals;
|
||||
template<> SparcFaultBase::FaultVals SparcFault<IllegalInstruction>::vals;
|
||||
template<> SparcFaultBase::FaultVals SparcFault<PrivilegedOpcode>::vals;
|
||||
template<> SparcFaultBase::FaultVals SparcFault<FpDisabled>::vals;
|
||||
template<> SparcFaultBase::FaultVals SparcFault<FpExceptionIEEE754>::vals;
|
||||
template<> SparcFaultBase::FaultVals SparcFault<FpExceptionOther>::vals;
|
||||
template<> SparcFaultBase::FaultVals SparcFault<TagOverflow>::vals;
|
||||
template<> SparcFaultBase::FaultVals SparcFault<CleanWindow>::vals;
|
||||
template<> SparcFaultBase::FaultVals SparcFault<DivisionByZero>::vals;
|
||||
template<> SparcFaultBase::FaultVals SparcFault<InternalProcessorError>::vals;
|
||||
template<> SparcFaultBase::FaultVals
|
||||
SparcFault<InstructionInvalidTSBEntry>::vals;
|
||||
template<> SparcFaultBase::FaultVals SparcFault<DataInvalidTSBEntry>::vals;
|
||||
template<> SparcFaultBase::FaultVals SparcFault<DataAccessException>::vals;
|
||||
template<> SparcFaultBase::FaultVals SparcFault<DataAccessError>::vals;
|
||||
template<> SparcFaultBase::FaultVals SparcFault<DataAccessProtection>::vals;
|
||||
template<> SparcFaultBase::FaultVals SparcFault<MemAddressNotAligned>::vals;
|
||||
template<> SparcFaultBase::FaultVals
|
||||
SparcFault<LDDFMemAddressNotAligned>::vals;
|
||||
template<> SparcFaultBase::FaultVals
|
||||
SparcFault<STDFMemAddressNotAligned>::vals;
|
||||
template<> SparcFaultBase::FaultVals SparcFault<PrivilegedAction>::vals;
|
||||
template<> SparcFaultBase::FaultVals
|
||||
SparcFault<LDQFMemAddressNotAligned>::vals;
|
||||
template<> SparcFaultBase::FaultVals
|
||||
SparcFault<STQFMemAddressNotAligned>::vals;
|
||||
template<> SparcFaultBase::FaultVals
|
||||
SparcFault<InstructionRealTranslationMiss>::vals;
|
||||
template<> SparcFaultBase::FaultVals SparcFault<DataRealTranslationMiss>::vals;
|
||||
template<> SparcFaultBase::FaultVals SparcFault<InterruptLevelN>::vals;
|
||||
template<> SparcFaultBase::FaultVals SparcFault<HstickMatch>::vals;
|
||||
template<> SparcFaultBase::FaultVals SparcFault<TrapLevelZero>::vals;
|
||||
template<> SparcFaultBase::FaultVals SparcFault<InterruptVector>::vals;
|
||||
template<> SparcFaultBase::FaultVals SparcFault<PAWatchpoint>::vals;
|
||||
template<> SparcFaultBase::FaultVals SparcFault<VAWatchpoint>::vals;
|
||||
template<> SparcFaultBase::FaultVals
|
||||
SparcFault<FastInstructionAccessMMUMiss>::vals;
|
||||
template<> SparcFaultBase::FaultVals SparcFault<FastDataAccessMMUMiss>::vals;
|
||||
template<>
|
||||
SparcFaultBase::FaultVals SparcFault<FastDataAccessProtection>::vals;
|
||||
template<> SparcFaultBase::FaultVals SparcFault<InstructionBreakpoint>::vals;
|
||||
template<> SparcFaultBase::FaultVals SparcFault<CpuMondo>::vals;
|
||||
template<> SparcFaultBase::FaultVals SparcFault<DevMondo>::vals;
|
||||
template<> SparcFaultBase::FaultVals SparcFault<ResumableError>::vals;
|
||||
template<> SparcFaultBase::FaultVals SparcFault<SpillNNormal>::vals;
|
||||
template<> SparcFaultBase::FaultVals SparcFault<SpillNOther>::vals;
|
||||
template<> SparcFaultBase::FaultVals SparcFault<FillNNormal>::vals;
|
||||
template<> SparcFaultBase::FaultVals SparcFault<FillNOther>::vals;
|
||||
template<> SparcFaultBase::FaultVals SparcFault<TrapInstruction>::vals;
|
||||
|
||||
|
||||
void enterREDState(ThreadContext *tc);
|
||||
|
||||
void doREDFault(ThreadContext *tc, TrapType tt);
|
||||
|
||||
@@ -247,7 +247,7 @@ class Fifo
|
||||
|
||||
|
||||
template <typename T>
|
||||
static void
|
||||
void
|
||||
arrayParamOut(CheckpointOut &cp, const std::string &name,
|
||||
const CircleBuf<T> ¶m)
|
||||
{
|
||||
@@ -257,7 +257,7 @@ arrayParamOut(CheckpointOut &cp, const std::string &name,
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
static void
|
||||
void
|
||||
arrayParamIn(CheckpointIn &cp, const std::string &name,
|
||||
CircleBuf<T> ¶m)
|
||||
{
|
||||
@@ -269,7 +269,7 @@ arrayParamIn(CheckpointIn &cp, const std::string &name,
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
static void
|
||||
void
|
||||
arrayParamOut(CheckpointOut &cp, const std::string &name,
|
||||
const Fifo<T> ¶m)
|
||||
{
|
||||
@@ -279,7 +279,7 @@ arrayParamOut(CheckpointOut &cp, const std::string &name,
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
static void
|
||||
void
|
||||
arrayParamIn(CheckpointIn &cp, const std::string &name,
|
||||
Fifo<T> ¶m)
|
||||
{
|
||||
|
||||
@@ -429,7 +429,7 @@ getElapsedTimeNano(T1 &sec, T2 &nsec)
|
||||
//// memory space. Used by stat(), fstat(), and lstat().
|
||||
|
||||
template <typename target_stat, typename host_stat>
|
||||
static void
|
||||
void
|
||||
convertStatBuf(target_stat &tgt, host_stat *host, bool fakeTTY = false)
|
||||
{
|
||||
using namespace TheISA;
|
||||
@@ -478,7 +478,7 @@ convertStatBuf(target_stat &tgt, host_stat *host, bool fakeTTY = false)
|
||||
// Same for stat64
|
||||
|
||||
template <typename target_stat, typename host_stat64>
|
||||
static void
|
||||
void
|
||||
convertStat64Buf(target_stat &tgt, host_stat64 *host, bool fakeTTY = false)
|
||||
{
|
||||
using namespace TheISA;
|
||||
@@ -500,7 +500,7 @@ convertStat64Buf(target_stat &tgt, host_stat64 *host, bool fakeTTY = false)
|
||||
|
||||
// Here are a couple of convenience functions
|
||||
template<class OS>
|
||||
static void
|
||||
void
|
||||
copyOutStatBuf(SETranslatingPortProxy &mem, Addr addr,
|
||||
hst_stat *host, bool fakeTTY = false)
|
||||
{
|
||||
@@ -511,7 +511,7 @@ copyOutStatBuf(SETranslatingPortProxy &mem, Addr addr,
|
||||
}
|
||||
|
||||
template<class OS>
|
||||
static void
|
||||
void
|
||||
copyOutStat64Buf(SETranslatingPortProxy &mem, Addr addr,
|
||||
hst_stat64 *host, bool fakeTTY = false)
|
||||
{
|
||||
@@ -522,7 +522,7 @@ copyOutStat64Buf(SETranslatingPortProxy &mem, Addr addr,
|
||||
}
|
||||
|
||||
template <class OS>
|
||||
static void
|
||||
void
|
||||
copyOutStatfsBuf(SETranslatingPortProxy &mem, Addr addr,
|
||||
hst_statfs *host)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user