summaryrefslogtreecommitdiffstats
path: root/libacc
diff options
context:
space:
mode:
authorJack Palevich <jackpal@google.com>2009-08-17 16:54:56 -0700
committerJack Palevich <jackpal@google.com>2009-08-17 16:54:56 -0700
commit7f5b1a2b317874a9009d20ed4d3789a7cb508ca4 (patch)
tree345c9c0a235b2d2121070768fd4781bbfed4522f /libacc
parent818806ad59ac09d5ee7de52891fa113ef614dbe0 (diff)
downloadsystem_core-7f5b1a2b317874a9009d20ed4d3789a7cb508ca4.zip
system_core-7f5b1a2b317874a9009d20ed4d3789a7cb508ca4.tar.gz
system_core-7f5b1a2b317874a9009d20ed4d3789a7cb508ca4.tar.bz2
do not merge: cherry-picked ecd23c09e87d7088285f8b7c2eeb98815c2e69e0 from master branch
Diffstat (limited to 'libacc')
-rw-r--r--libacc/acc.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/libacc/acc.cpp b/libacc/acc.cpp
index b06ad53..684d807 100644
--- a/libacc/acc.cpp
+++ b/libacc/acc.cpp
@@ -8,6 +8,9 @@
*
*/
+#define LOG_TAG "acc"
+#include <cutils/log.h>
+
#include <ctype.h>
#include <errno.h>
#include <stdarg.h>
@@ -51,6 +54,8 @@
#define ENABLE_ARM_DISASSEMBLY
// #define PROVIDE_TRACE_CODEGEN
+#define assert(b) assertImpl(b, __LINE__)
+
namespace acc {
// Subset of STL vector.
@@ -562,10 +567,11 @@ class Compiler : public ErrorSink {
va_end(ap);
}
- void assert(bool test) {
+ void assertImpl(bool test, int line) {
if (!test) {
+ error("code generator assertion failed at line %s:%d.", __FILE__, line);
+ LOGD("code generator assertion failed at line %s:%d.", __FILE__, line);
* (char*) 0 = 0;
- error("code generator assertion failed.");
}
}
@@ -3436,8 +3442,9 @@ class Compiler : public ErrorSink {
* (char*) 0 = 0;
}
- void assert(bool isTrue) {
+ void assertImpl(bool isTrue, int line) {
if (!isTrue) {
+ LOGD("assertion failed at line %s:%d.", __FILE__, line);
internalError();
}
}