mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 08:37:46 +00:00
AK: Move taint_for_optimizer to StdLibExtras.h
Additionally, split it into two versions (for IsIntegral<T> -- asking to place value into register and for !IsIntegral<T> -- asking to place value into memory with memory clobber), so that Clang is no more completely confused about `taint_for_optimizer(AK::StringView&)`.
This commit is contained in:
parent
a9d192e882
commit
3c900765bc
2 changed files with 22 additions and 11 deletions
|
@ -154,17 +154,6 @@ constexpr StaticStorage<false, bit_width<T>> get_storage_of(T value)
|
|||
}
|
||||
|
||||
// ===== Utilities =====
|
||||
template<typename T>
|
||||
ALWAYS_INLINE constexpr void taint_for_optimizer(T& value)
|
||||
{
|
||||
if (!is_constant_evaluated()) {
|
||||
asm volatile(""
|
||||
: "+rm"(value)
|
||||
:
|
||||
: "memory");
|
||||
}
|
||||
}
|
||||
|
||||
ALWAYS_INLINE constexpr NativeWord extend_sign(bool sign)
|
||||
{
|
||||
return sign ? max_word : 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue