Now that FOR_EACH_PTR() doesn't strip the tag anymore, there is no more needs for FOR_EACH_PTR_NOTAG() as both do the same. So convert the few uses to FOR_EACH_PTR() and remove its definition. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx> --- README | 4 ++-- c2xml.c | 4 ++-- compile.c | 4 ++-- ctags.c | 4 ++-- example.c | 4 ++-- graph.c | 8 ++++---- obfuscate.c | 4 ++-- ptrlist.h | 10 ---------- sparse-llvm.c | 4 ++-- sparse.c | 4 ++-- test-dissect.c | 4 ++-- test-inspect.c | 4 ++-- test-lexing.c | 4 ++-- test-linearize.c | 4 ++-- test-parsing.c | 4 ++-- test-unssa.c | 4 ++-- 16 files changed, 32 insertions(+), 42 deletions(-) diff --git a/README b/README index 033ae15d5..c787e6443 100644 --- a/README +++ b/README @@ -52,9 +52,9 @@ This means that a user of the library will literally just need to do action(sparse_initialize(argc, argv, filelist)); - FOR_EACH_PTR_NOTAG(filelist, file) { + FOR_EACH_PTR(filelist, file) { action(sparse(file)); - } END_FOR_EACH_PTR_NOTAG(file); + } END_FOR_EACH_PTR(file); and he is now done - having a full C parse of the file he opened. The library doesn't need any more setup, and once done does not impose any diff --git a/c2xml.c b/c2xml.c index c45d5818a..1a24c3a81 100644 --- a/c2xml.c +++ b/c2xml.c @@ -318,12 +318,12 @@ int main(int argc, char **argv) */ symlist = sparse_initialize(argc, argv, &filelist); - FOR_EACH_PTR_NOTAG(filelist, file) { + FOR_EACH_PTR(filelist, file) { examine_symbol_list(file, symlist); sparse_keep_tokens(file); examine_symbol_list(file, file_scope->symbols); examine_symbol_list(file, global_scope->symbols); - } END_FOR_EACH_PTR_NOTAG(file); + } END_FOR_EACH_PTR(file); xmlSaveFormatFileEnc("-", doc, "UTF-8", 1); diff --git a/compile.c b/compile.c index eeb996abd..7c16d5b55 100644 --- a/compile.c +++ b/compile.c @@ -59,7 +59,7 @@ int main(int argc, char **argv) bits_in_bool = 8; clean_up_symbols(sparse_initialize(argc, argv, &filelist)); - FOR_EACH_PTR_NOTAG(filelist, file) { + FOR_EACH_PTR(filelist, file) { struct symbol_list *list; const char *basename = strrchr(file, '/'); basename = basename ? basename+1 : file; @@ -70,7 +70,7 @@ int main(int argc, char **argv) emit_unit_begin(basename); clean_up_symbols(list); emit_unit_end(); - } END_FOR_EACH_PTR_NOTAG(file); + } END_FOR_EACH_PTR(file); #if 0 // And show the allocation statistics diff --git a/ctags.c b/ctags.c index 30976542d..aa5f9718d 100644 --- a/ctags.c +++ b/ctags.c @@ -216,10 +216,10 @@ int main(int argc, char **argv) char *file; examine_symbol_list(sparse_initialize(argc, argv, &filelist)); - FOR_EACH_PTR_NOTAG(filelist, file) { + FOR_EACH_PTR(filelist, file) { sparse(file); examine_symbol_list(file_scope->symbols); - } END_FOR_EACH_PTR_NOTAG(file); + } END_FOR_EACH_PTR(file); examine_symbol_list(global_scope->symbols); sort_list((struct ptr_list **)&taglist, cmp_sym); show_tags(taglist); diff --git a/example.c b/example.c index aff613b69..00f20eb9a 100644 --- a/example.c +++ b/example.c @@ -1938,9 +1938,9 @@ int main(int argc, char **argv) compile(sparse_initialize(argc, argv, &filelist)); dbg_dead = 1; - FOR_EACH_PTR_NOTAG(filelist, file) { + FOR_EACH_PTR(filelist, file) { compile(sparse(file)); - } END_FOR_EACH_PTR_NOTAG(file); + } END_FOR_EACH_PTR(file); return 0; } diff --git a/graph.c b/graph.c index d598a18a5..be4cf282c 100644 --- a/graph.c +++ b/graph.c @@ -176,7 +176,7 @@ int main(int argc, char **argv) /* Linearize all symbols, graph internal basic block * structures and intra-file calls */ - FOR_EACH_PTR_NOTAG(filelist, file) { + FOR_EACH_PTR(filelist, file) { fsyms = sparse(file); concat_symbol_list(fsyms, &all_syms); @@ -191,15 +191,15 @@ int main(int argc, char **argv) graph_ep(sym->ep); graph_calls(sym->ep, 1); } - } END_FOR_EACH_PTR_NOTAG(sym); + } END_FOR_EACH_PTR(sym); - } END_FOR_EACH_PTR_NOTAG(file); + } END_FOR_EACH_PTR(file); /* Graph inter-file calls */ FOR_EACH_PTR(all_syms, sym) { if (sym->ep) graph_calls(sym->ep, 0); - } END_FOR_EACH_PTR_NOTAG(sym); + } END_FOR_EACH_PTR(sym); printf("}\n"); return 0; diff --git a/obfuscate.c b/obfuscate.c index 18cbd0eef..998eda643 100644 --- a/obfuscate.c +++ b/obfuscate.c @@ -69,8 +69,8 @@ int main(int argc, char **argv) char *file; emit_symbol_list(sparse_initialize(argc, argv, &filelist)); - FOR_EACH_PTR_NOTAG(filelist, file) { + FOR_EACH_PTR(filelist, file) { emit_symbol_list(sparse(file)); - } END_FOR_EACH_PTR_NOTAG(file); + } END_FOR_EACH_PTR(file); return 0; } diff --git a/ptrlist.h b/ptrlist.h index 7ab5ffe46..a737d421b 100644 --- a/ptrlist.h +++ b/ptrlist.h @@ -230,11 +230,6 @@ static inline void *last_ptr_list(struct ptr_list *list) #define END_FOR_EACH_PTR(ptr) \ DO_END_FOR_EACH(ptr, __head##ptr, __list##ptr, __nr##ptr) -#define FOR_EACH_PTR_NOTAG(head, ptr) \ - DO_FOR_EACH(head, ptr, __head##ptr, __list##ptr, __nr##ptr, PTR_ENTRY_NOTAG) - -#define END_FOR_EACH_PTR_NOTAG(ptr) END_FOR_EACH_PTR(ptr) - #define FOR_EACH_PTR_REVERSE(head, ptr) \ DO_FOR_EACH_REVERSE(head, ptr, __head##ptr, __list##ptr, __nr##ptr, PTR_ENTRY_NOTAG) @@ -244,11 +239,6 @@ static inline void *last_ptr_list(struct ptr_list *list) #define END_FOR_EACH_PTR_REVERSE(ptr) \ DO_END_FOR_EACH_REVERSE(ptr, __head##ptr, __list##ptr, __nr##ptr) -#define FOR_EACH_PTR_REVERSE_NOTAG(head, ptr) \ - DO_FOR_EACH_REVERSE(head, ptr, __head##ptr, __list##ptr, __nr##ptr, PTR_ENTRY_NOTAG) - -#define END_FOR_EACH_PTR_REVERSE_NOTAG(ptr) END_FOR_EACH_PTR_REVERSE(ptr) - #define THIS_ADDRESS(ptr) \ DO_THIS_ADDRESS(ptr, __head##ptr, __list##ptr, __nr##ptr) diff --git a/sparse-llvm.c b/sparse-llvm.c index b22d2f67b..eaecb4cda 100644 --- a/sparse-llvm.c +++ b/sparse-llvm.c @@ -1336,12 +1336,12 @@ int main(int argc, char **argv) /* need ->phi_users */ dbg_dead = 1; - FOR_EACH_PTR_NOTAG(filelist, file) { + FOR_EACH_PTR(filelist, file) { symlist = sparse(file); if (die_if_error) return 1; compile(module, symlist); - } END_FOR_EACH_PTR_NOTAG(file); + } END_FOR_EACH_PTR(file); LLVMVerifyModule(module, LLVMPrintMessageAction, NULL); diff --git a/sparse.c b/sparse.c index 056d14ff6..afdc314e6 100644 --- a/sparse.c +++ b/sparse.c @@ -335,9 +335,9 @@ int main(int argc, char **argv) // Expand, linearize and show it. check_symbols(sparse_initialize(argc, argv, &filelist)); - FOR_EACH_PTR_NOTAG(filelist, file) { + FOR_EACH_PTR(filelist, file) { check_symbols(sparse(file)); - } END_FOR_EACH_PTR_NOTAG(file); + } END_FOR_EACH_PTR(file); report_stats(); return 0; diff --git a/test-dissect.c b/test-dissect.c index 862318f81..266148be0 100644 --- a/test-dissect.c +++ b/test-dissect.c @@ -88,10 +88,10 @@ int main(int argc, char **argv) sparse_initialize(argc, argv, &filelist); - FOR_EACH_PTR_NOTAG(filelist, file) { + FOR_EACH_PTR(filelist, file) { dotc_stream = input_stream_nr; dissect(__sparse(file), &reporter); - } END_FOR_EACH_PTR_NOTAG(file); + } END_FOR_EACH_PTR(file); return 0; } diff --git a/test-inspect.c b/test-inspect.c index e437e1124..63754cb3c 100644 --- a/test-inspect.c +++ b/test-inspect.c @@ -32,11 +32,11 @@ int main(int argc, char **argv) gtk_init(&argc,&argv); expand_symbols(sparse_initialize(argc, argv, &filelist)); - FOR_EACH_PTR_NOTAG(filelist, file) { + FOR_EACH_PTR(filelist, file) { struct symbol_list *syms = sparse(file); expand_symbols(syms); concat_symbol_list(syms, &view_syms); - } END_FOR_EACH_PTR_NOTAG(file); + } END_FOR_EACH_PTR(file); treeview_main(view_syms); return 0; } diff --git a/test-lexing.c b/test-lexing.c index 5c7ab2adf..a26398635 100644 --- a/test-lexing.c +++ b/test-lexing.c @@ -41,9 +41,9 @@ int main(int argc, char **argv) preprocess_only = 1; sparse_initialize(argc, argv, &filelist); - FOR_EACH_PTR_NOTAG(filelist, file) { + FOR_EACH_PTR(filelist, file) { sparse(file); - } END_FOR_EACH_PTR_NOTAG(file); + } END_FOR_EACH_PTR(file); show_identifier_stats(); return 0; } diff --git a/test-linearize.c b/test-linearize.c index e6d1ee3cd..17ad5d508 100644 --- a/test-linearize.c +++ b/test-linearize.c @@ -60,9 +60,9 @@ int main(int argc, char **argv) char *file; clean_up_symbols(sparse_initialize(argc, argv, &filelist)); - FOR_EACH_PTR_NOTAG(filelist, file) { + FOR_EACH_PTR(filelist, file) { clean_up_symbols(sparse(file)); - } END_FOR_EACH_PTR_NOTAG(file); + } END_FOR_EACH_PTR(file); report_stats(); return 0; diff --git a/test-parsing.c b/test-parsing.c index 7642205af..c5bc42e19 100644 --- a/test-parsing.c +++ b/test-parsing.c @@ -64,7 +64,7 @@ int main(int argc, char **argv) printf("\n\n"); #endif - FOR_EACH_PTR_NOTAG(filelist, file) { + FOR_EACH_PTR(filelist, file) { list = sparse(file); // Simplification @@ -75,7 +75,7 @@ int main(int argc, char **argv) show_symbol_list(list, "\n\n"); printf("\n\n"); #endif - } END_FOR_EACH_PTR_NOTAG(file); + } END_FOR_EACH_PTR(file); #if 0 // And show the allocation statistics diff --git a/test-unssa.c b/test-unssa.c index 57959be2b..b81dc47bc 100644 --- a/test-unssa.c +++ b/test-unssa.c @@ -80,9 +80,9 @@ int main(int argc, char **argv) char *file; compile(sparse_initialize(argc, argv, &filelist)); - FOR_EACH_PTR_NOTAG(filelist, file) { + FOR_EACH_PTR(filelist, file) { compile(sparse(file)); - } END_FOR_EACH_PTR_NOTAG(file); + } END_FOR_EACH_PTR(file); report_stats(); return 0; -- 2.17.1 -- To unsubscribe from this list: send the line "unsubscribe linux-sparse" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html