symbol.c (b22364c8eec89e6b0c081a237f3b6348df87796f) | symbol.c (5447d34b080a1e3e312b05a91e87eff4710a1152) |
---|---|
1/* 2 * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org> 3 * Released under the terms of the GNU GPL v2.0. 4 */ 5 6#include <ctype.h> 7#include <stdlib.h> 8#include <string.h> --- 772 unchanged lines hidden (view full) --- 781 return sym_check_deps(e->left.sym); 782 default: 783 break; 784 } 785 printf("Oops! How to check %d?\n", e->type); 786 return NULL; 787} 788 | 1/* 2 * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org> 3 * Released under the terms of the GNU GPL v2.0. 4 */ 5 6#include <ctype.h> 7#include <stdlib.h> 8#include <string.h> --- 772 unchanged lines hidden (view full) --- 781 return sym_check_deps(e->left.sym); 782 default: 783 break; 784 } 785 printf("Oops! How to check %d?\n", e->type); 786 return NULL; 787} 788 |
789/* return NULL when dependencies are OK */ |
|
789struct symbol *sym_check_deps(struct symbol *sym) 790{ 791 struct symbol *sym2; 792 struct property *prop; 793 794 if (sym->flags & SYMBOL_CHECK) { | 790struct symbol *sym_check_deps(struct symbol *sym) 791{ 792 struct symbol *sym2; 793 struct property *prop; 794 795 if (sym->flags & SYMBOL_CHECK) { |
795 printf("Warning! Found recursive dependency: %s", sym->name); | 796 fprintf(stderr, "%s:%d:error: found recursive dependency: %s", 797 sym->prop->file->name, sym->prop->lineno, sym->name); |
796 return sym; 797 } 798 if (sym->flags & SYMBOL_CHECKED) 799 return NULL; 800 801 sym->flags |= (SYMBOL_CHECK | SYMBOL_CHECKED); 802 sym2 = sym_check_expr_deps(sym->rev_dep.expr); 803 if (sym2) --- 7 unchanged lines hidden (view full) --- 811 goto out; 812 if (prop->type != P_DEFAULT || sym_is_choice(sym)) 813 continue; 814 sym2 = sym_check_expr_deps(prop->expr); 815 if (sym2) 816 goto out; 817 } 818out: | 798 return sym; 799 } 800 if (sym->flags & SYMBOL_CHECKED) 801 return NULL; 802 803 sym->flags |= (SYMBOL_CHECK | SYMBOL_CHECKED); 804 sym2 = sym_check_expr_deps(sym->rev_dep.expr); 805 if (sym2) --- 7 unchanged lines hidden (view full) --- 813 goto out; 814 if (prop->type != P_DEFAULT || sym_is_choice(sym)) 815 continue; 816 sym2 = sym_check_expr_deps(prop->expr); 817 if (sym2) 818 goto out; 819 } 820out: |
819 if (sym2) { 820 printf(" %s", sym->name); 821 if (sym2 == sym) { 822 printf("\n"); 823 sym2 = NULL; 824 } 825 } | 821 if (sym2) 822 fprintf(stderr, " -> %s%s", sym->name, sym2 == sym? "\n": ""); |
826 sym->flags &= ~SYMBOL_CHECK; 827 return sym2; 828} 829 830struct property *prop_alloc(enum prop_type type, struct symbol *sym) 831{ 832 struct property *prop; 833 struct property **propp; --- 48 unchanged lines hidden --- | 823 sym->flags &= ~SYMBOL_CHECK; 824 return sym2; 825} 826 827struct property *prop_alloc(enum prop_type type, struct symbol *sym) 828{ 829 struct property *prop; 830 struct property **propp; --- 48 unchanged lines hidden --- |