diff options
author | Joshua Haberman <jhaberman@gmail.com> | 2016-05-12 11:54:34 -0700 |
---|---|---|
committer | Joshua Haberman <jhaberman@gmail.com> | 2016-05-12 11:54:34 -0700 |
commit | fa338b70a602d9f5657528d0322535959a92d4b0 (patch) | |
tree | a7ec8b8d61a1ff3657aff99316ec51a8b81726ad /tools/dump_cinit.lua | |
parent | e16ed470be7d0d459e85e1d7b43893358a625d34 (diff) |
Added UPB_ASSERT() that helps avoid unused var warnings.
* Added UPB_ASSERT() that helps avoid unused var warnings.
* Addressed PR comments.
* Fixed assert in the JIT.
Diffstat (limited to 'tools/dump_cinit.lua')
-rw-r--r-- | tools/dump_cinit.lua | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/tools/dump_cinit.lua b/tools/dump_cinit.lua index e01e150..6135b03 100644 --- a/tools/dump_cinit.lua +++ b/tools/dump_cinit.lua @@ -407,7 +407,6 @@ local function dump_defs_c(filedef, append) -- Emit forward declarations. emit_file_warning(filedef, append) - append('#include <assert.h>\n\n') append('#include "upb/def.h"\n') append('#include "upb/structdefs.int.h"\n\n') append("static const upb_msgdef %s;\n", linktab:cdecl(upb.DEF_MSG)) @@ -639,7 +638,7 @@ local function print_message(def, map, indent, append) append("%s %s(const ::upb::MessageDef* m, const void *ref_donor = NULL)\n", indent, def:name()) append("%s : reffed_ptr(m, ref_donor) {\n", indent) - append("%s assert(upbdefs_%s_is(m));\n", indent, to_cident(def:full_name())) + append("%s UPB_ASSERT(upbdefs_%s_is(m));\n", indent, to_cident(def:full_name())) append("%s }\n", indent) append("\n") append("%s static %s get() {\n", indent, def:name()) @@ -659,7 +658,7 @@ local function print_enum(def, indent, append) append("%s %s(const ::upb::EnumDef* e, const void *ref_donor = NULL)\n", indent, def:name()) append("%s : reffed_ptr(e, ref_donor) {\n", indent) - append("%s assert(upbdefs_%s_is(e));\n", indent, to_cident(def:full_name())) + append("%s UPB_ASSERT(upbdefs_%s_is(e));\n", indent, to_cident(def:full_name())) append("%s }\n", indent) append("%s static %s get() {\n", indent, def:name()) append("%s const ::upb::EnumDef* e = upbdefs_%s_get(&e);\n", indent, to_cident(def:full_name())) @@ -748,7 +747,7 @@ local function dump_defs_h(file, append, linktab) local msg_cident = to_cident(f:containing_type():full_name()) local field_cident = to_cident(f:name()) append("UPB_INLINE const upb_fielddef *upbdefs_%s_f_%s(const upb_msgdef *m) {" .. - " assert(upbdefs_%s_is(m));" .. + " UPB_ASSERT(upbdefs_%s_is(m));" .. " return upb_msgdef_itof(m, %d); }\n", msg_cident, field_cident, msg_cident, f:number()) end |