Merge "Move cpp-define related static_assert to runtime."
diff --git a/runtime/Android.bp b/runtime/Android.bp
index 33ad987..bedeaf7 100644
--- a/runtime/Android.bp
+++ b/runtime/Android.bp
@@ -379,6 +379,7 @@
],
header_libs: [
"art_cmdlineparser_headers",
+ "cpp-define-generator-definitions",
"libnativehelper_header_only",
"jni_platform_headers",
],
@@ -639,7 +640,6 @@
],
header_libs: [
"art_cmdlineparser_headers", // For parsed_options_test.
- "cpp-define-generator-definitions",
],
include_dirs: [
"external/zlib",
diff --git a/runtime/arch/arch_test.cc b/runtime/arch/arch_test.cc
index dcc3aff..12ad84b 100644
--- a/runtime/arch/arch_test.cc
+++ b/runtime/arch/arch_test.cc
@@ -17,17 +17,11 @@
#include <stdint.h>
#include "art_method-inl.h"
-#include "asm_defines.h"
#include "base/callee_save_type.h"
#include "entrypoints/quick/callee_save_frame.h"
#include "common_runtime_test.h"
#include "quick/quick_method_frame_info.h"
-// Static asserts to check the values of generated #defines for assembly.
-#define ASM_DEFINE(NAME, EXPR) static_assert((NAME) == (EXPR), "Unexpected value of " #NAME);
-#include "asm_defines.def"
-#undef ASM_DEFINE
-
namespace art {
class ArchTest : public CommonRuntimeTest {
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index b3a2bdd..4d77b9d 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -165,6 +165,11 @@
#include <android/set_abort_message.h>
#endif
+// Static asserts to check the values of generated assembly-support macros.
+#define ASM_DEFINE(NAME, EXPR) static_assert((NAME) == (EXPR), "Unexpected value of " #NAME);
+#include "asm_defines.def"
+#undef ASM_DEFINE
+
namespace art {
// If a signal isn't handled properly, enable a handler that attempts to dump the Java stack.
diff --git a/tools/cpp-define-generator/asm_defines.cc b/tools/cpp-define-generator/asm_defines.cc
index c105c1a..b79e1ae 100644
--- a/tools/cpp-define-generator/asm_defines.cc
+++ b/tools/cpp-define-generator/asm_defines.cc
@@ -31,6 +31,6 @@
#define ASM_DEFINE(NAME, EXPR) \
void AsmDefineHelperFor_##NAME() { \
asm volatile("\n.ascii \">>" #NAME " %0 %1<<\"" \
- :: "i" (static_cast<int64_t>(EXPR)), "i" (EXPR < 0 ? 1 : 0)); \
+ :: "i" (static_cast<int64_t>(EXPR)), "i" ((EXPR) < 0 ? 1 : 0)); \
}
#include "asm_defines.def"