diff options
author | Andreas Gampe <agampe@google.com> | 2016-12-12 14:28:21 -0800 |
---|---|---|
committer | Andreas Gampe <agampe@google.com> | 2016-12-13 11:43:48 -0800 |
commit | 9186ced255f2e7402646b5b286deebb540640734 (patch) | |
tree | 833c25fd3bbb47749265947705b4fc0f0c1ba796 /compiler/optimizing/code_generator_utils.h | |
parent | aa2657d6d9dda2e44c6452e5f5901db78ef9b3cc (diff) |
ART: Clean up utils.h
Remove functionality provided by libbase. Move some single-use
functions to their respective users.
Test: m test-art-host
Change-Id: I75594035fa975200d638cc29bb9f31bc6e6cb29f
Diffstat (limited to 'compiler/optimizing/code_generator_utils.h')
-rw-r--r-- | compiler/optimizing/code_generator_utils.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/optimizing/code_generator_utils.h b/compiler/optimizing/code_generator_utils.h index 7efed8c9ec..a6b41c0588 100644 --- a/compiler/optimizing/code_generator_utils.h +++ b/compiler/optimizing/code_generator_utils.h @@ -18,6 +18,8 @@ #define ART_COMPILER_OPTIMIZING_CODE_GENERATOR_UTILS_H_ #include <cstdint> +#include <cstdlib> +#include <limits> namespace art { @@ -32,6 +34,12 @@ void CalculateMagicAndShiftForDivRem(int64_t divisor, bool is_long, int64_t* mag // that it has been previously visited by the InstructionCodeGenerator. bool IsBooleanValueOrMaterializedCondition(HInstruction* cond_input); +template <typename T> T AbsOrMin(T value) { + return (value == std::numeric_limits<T>::min()) + ? value + : std::abs(value); +} + } // namespace art #endif // ART_COMPILER_OPTIMIZING_CODE_GENERATOR_UTILS_H_ |