0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-25 16:22:35 +01:00

ircd::log: Fixes for clang DCE.

This commit is contained in:
Jason Volk 2019-07-19 17:03:58 -07:00
parent 431eff54d9
commit 064f0b712c
2 changed files with 110 additions and 4 deletions

View file

@ -35,10 +35,15 @@ struct ircd::ctx::this_ctx::slice_usage_warning
#else
struct ircd::ctx::this_ctx::slice_usage_warning
{
#if defined(__clang__)
template<class... args>
slice_usage_warning(const string_view &fmt, args&&...)
{}
#else
// In at least gcc 6.3.0 20170519, template param packs are not DCE'ed
// so legacy varargs are used here.
slice_usage_warning(const string_view &fmt, ...)
{
// In at least gcc 6.3.0 20170519, template param packs are not DCE'ed
// so legacy varargs are used here.
}
{}
#endif
};
#endif

View file

@ -196,6 +196,19 @@ struct ircd::log::debug
vlog(general, level::DEBUG, fmt, va_rtti{std::forward<args>(a)...});
}
};
#elif defined(__clang__)
struct ircd::log::debug
{
template<class... args>
debug(const log &log, const string_view &fmt, args&&... a)
{
}
template<class... args>
debug(const string_view &fmt, args&&... a)
{
}
};
#else
struct ircd::log::debug
{
@ -226,6 +239,19 @@ struct ircd::log::dwarning
vlog(general, level::DWARNING, fmt, va_rtti{std::forward<args>(a)...});
}
};
#elif defined(__clang__)
struct ircd::log::dwarning
{
template<class... args>
dwarning(const log &log, const string_view &fmt, args&&... a)
{
}
template<class... args>
dwarning(const string_view &fmt, args&&... a)
{
}
};
#else
struct ircd::log::dwarning
{
@ -256,6 +282,19 @@ struct ircd::log::derror
vlog(general, level::DERROR, fmt, va_rtti{std::forward<args>(a)...});
}
};
#elif defined(__clang__)
struct ircd::log::derror
{
template<class... args>
derror(const log &log, const string_view &fmt, args&&... a)
{
}
template<class... args>
derror(const string_view &fmt, args&&... a)
{
}
};
#else
struct ircd::log::derror
{
@ -286,6 +325,19 @@ struct ircd::log::info
vlog(general, level::INFO, fmt, va_rtti{std::forward<args>(a)...});
}
};
#elif defined(__clang__)
struct ircd::log::info
{
template<class... args>
info(const log &log, const string_view &fmt, args&&... a)
{
}
template<class... args>
info(const string_view &fmt, args&&... a)
{
}
};
#else
struct ircd::log::info
{
@ -316,6 +368,16 @@ struct ircd::log::notice
vlog(general, level::NOTICE, fmt, va_rtti{std::forward<args>(a)...});
}
};
#elif defined(__clang__)
template<class... args>
notice(const log &log, const string_view &fmt, args&&... a)
{
}
template<class... args>
notice(const string_view &fmt, args&&... a)
{
}
#else
struct ircd::log::notice
{
@ -346,6 +408,19 @@ struct ircd::log::warning
vlog(general, level::WARNING, fmt, va_rtti{std::forward<args>(a)...});
}
};
#elif defined(__clang__)
struct ircd::log::warning
{
template<class... args>
warning(const log &log, const string_view &fmt, args&&... a)
{
}
template<class... args>
warning(const string_view &fmt, args&&... a)
{
}
};
#else
struct ircd::log::warning
{
@ -376,6 +451,19 @@ struct ircd::log::error
vlog(general, level::ERROR, fmt, va_rtti{std::forward<args>(a)...});
}
};
#elif defined(__clang__)
struct ircd::log::error
{
template<class... args>
error(const log &log, const string_view &fmt, args&&... a)
{
}
template<class... args>
error(const string_view &fmt, args&&... a)
{
}
};
#else
struct ircd::log::error
{
@ -435,6 +523,19 @@ struct ircd::log::critical
vlog(general, level::CRITICAL, fmt, va_rtti{std::forward<args>(a)...});
}
};
#elif defined(__clang__)
struct ircd::log::critical
{
template<class... args>
critical(const log &log, const string_view &fmt, args&&... a)
{
}
template<class... args>
critical(const string_view &fmt, args&&... a)
{
}
};
#else
struct ircd::log::critical
{