GObject introspection patches
Hello,
For GObject introspection c2xml has to be extended to output information about custom attributes like this:
GList* create_list() __attribute__((element_type(char*)))
Attached patch set adds support for custom attributes to c2xml. It also changes c2xml to provide command line options and to output initializer expressions. The patchset also is available via git:
http://taschenorakel.de/gitweb/?p=sparse;a=shortlog;h=gobject-introspection
Ciao,
Mathias
Signature · 2 lines
Mathias Hasselmann <[email protected]> http://taschenorakel.de/
From 98fae4f8d2d1f375a18aeaf1e0a0c71107fbeba8 Mon Sep 17 00:00:00 2001
From: Mathias Hasselmann <[email protected]>
Date: Tue, 4 Sep 2007 22:26:47 +0200
Subject: [PATCH] Introduce attribute structure for storing custom attributes in symbol nodes.
--- allocate.c | 1 + allocate.h | 1 + lib.h | 7 +++++++ parse.c | 4 ++++ symbol.c | 9 +++++++++ symbol.h | 22 ++++++++++++++++++++++ 6 files changed, 44 insertions(+), 0 deletions(-)
allocate.c +1 -0
@@ -114,6 +114,7 @@ void show_allocations(struct allocator_struct *x)ALLOCATOR (ident,"identifiers" );ALLOCATOR (token,"tokens" );ALLOCATOR (context,"contexts" ); +ALLOCATOR (attribute,"attribute" );ALLOCATOR (symbol,"symbols" );ALLOCATOR (expression,"expressions" );ALLOCATOR (statement,"statements" );
allocate.h +1 -0
@@ -65,6 +65,7 @@ extern void show_allocations(struct allocator_struct *);DECLARE_ALLOCATOR (ident);DECLARE_ALLOCATOR (token);DECLARE_ALLOCATOR (context); +DECLARE_ALLOCATOR (attribute);DECLARE_ALLOCATOR (symbol);DECLARE_ALLOCATOR (expression);DECLARE_ALLOCATOR (statement);
lib.h +7 -0
@@ -45,6 +45,7 @@ extern int cmdline_include_nr;struct ident ;struct token ; +struct attribute ;struct symbol ;struct statement ;struct expression ;
@@ -54,6 +55,7 @@ struct instruction;struct multijmp ;struct pseudo ; +DECLARE_PTR_LIST(attribute_list, struct attribute); DECLARE_PTR_LIST(symbol_list, struct symbol); DECLARE_PTR_LIST(statement_list, struct statement); DECLARE_PTR_LIST(expression_list, struct expression);
@@ -198,6 +200,11 @@ static inline void concat_instruction_list(struct instruction_list *from, structconcat_ptr_list ((struct ptr_list *)from, (struct ptr_list **)to); } +static inline void add_attribute (struct attribute_list **list,struct attribute *attr) +{ +add_ptr_list (list, attr); +} +static inline void add_symbol (struct symbol_list **list,struct symbol *sym) {add_ptr_list (list, sym);
parse.c +4 -0
@@ -1026,6 +1026,10 @@ static void apply_ctype(struct position pos, struct ctype *thistype, struct ctypconcat_ptr_list ((struct ptr_list *)thistype->contexts, (struct ptr_list **)&ctype->contexts); +/* Atrributes */ +concat_ptr_list ((struct ptr_list *)thistype->attributes, + (struct ptr_list **)&ctype->attributes); +/* Alignment */ if (thistype->alignment & (thistype->alignment-1 )) {warning (pos,"I don't like non-power-of-2 alignments" );
symbol.c +9 -0
@@ -57,6 +57,15 @@ struct context *alloc_context(void)return __alloc_context (0 ); } +struct attribute *alloc_attribute (struct position pos,enum attribute_type type,struct symbol *symbol) +{ +struct attribute *attr =__alloc_attribute (0 ); + attr->type = type; + attr->pos = pos; + attr->symbol = symbol; +return attr; +} +struct symbol *alloc_symbol (struct position pos,int type) {struct symbol *sym =__alloc_symbol (0 );
symbol.h +22 -0
@@ -78,10 +78,32 @@ extern struct context *alloc_context(void); DECLARE_PTR_LIST(context_list, struct context); +enum attribute_type { +AT_EXPRESSION , +AT_TYPEREF +}; + +struct attribute { +enum attribute_type type:8 ; + +struct position pos; +struct position endpos; +struct symbol *symbol; + +union { +struct expression *expr; +struct symbol *typeref; + }; +}; + +extern struct attribute *alloc_attribute (struct position pos, +enum attribute_type type,struct symbol *symbol); +struct ctype {unsigned long modifiers;unsigned long alignment;struct context_list *contexts; +struct attribute_list *attributes;unsigned int as;struct symbol *base_type; };
Signature · 1 line
1.5.2.3
From 124215ffb5ba8ae28028588e1f12d2a586d21e20 Mon Sep 17 00:00:00 2001
From: Mathias Hasselmann <[email protected]>
Date: Tue, 4 Sep 2007 22:30:14 +0200
Subject: [PATCH] Extract init_keyword_table from init_parser for usage in c2xml.
--- parse.c | 20 +++++++++++--------- parse.h | 8 ++++++++ 2 files changed, 19 insertions(+), 9 deletions(-)
parse.c +11 -9
@@ -196,12 +196,7 @@ static struct symbol_op mode_spec_op = { .type = KW_MODE, }; -static struct init_keyword { -const char *name; -enum namespace ns; -unsigned long modifiers; -struct symbol_op *op; -} keyword_table[] = { +static struct init_keyword keyword_table[] = {/* Type qualifiers */ {"const" ,NS_TYPEDEF ,MOD_CONST , .op = &qualifier_op }, {"__const" ,NS_TYPEDEF ,MOD_CONST , .op = &qualifier_op },
@@ -344,18 +339,25 @@ static struct init_keyword { { "__destructor__", NS_KEYWORD, .op = &ignore_attr_op }, }; -void init_parser (int stream) +void init_keyword_table (int stream,struct init_keyword *table,size_t length) {int i; -for (i =0 ; i <sizeof keyword_table/sizeof keyword_table[0 ]; i++) { -struct init_keyword *ptr = keyword_table + i; + +for (i =0 ; i < length; i++) { +struct init_keyword *ptr = table + i;struct symbol *sym =create_symbol (stream, ptr->name,SYM_KEYWORD , ptr->ns); + sym->ident->keyword =1 ; sym->ctype.modifiers = ptr->modifiers; sym->op = ptr->op; } } +void init_parser (int stream) +{ +init_keyword_table (stream, keyword_table,sizeof keyword_table/sizeof keyword_table[0 ]); +} +// Add a symbol to the list of function-local symbols static void fn_local_symbol (struct symbol *sym) {
parse.h +8 -0
@@ -115,6 +115,13 @@ struct statement { }; }; +struct init_keyword { +const char *name; +enum namespace ns; +unsigned long modifiers; +struct symbol_op *op; +}; +extern struct symbol_list *function_computed_target_list;extern struct statement_list *function_computed_goto_list;
@@ -133,6 +140,7 @@ extern struct symbol *ctype_fp(unsigned long spec);extern void copy_statement (struct statement *src,struct statement *dst);extern int inline_function (struct expression *expr,struct symbol *sym);extern void uninline (struct symbol *sym); +extern void init_keyword_table (int stream,struct init_keyword *table,size_t length);extern void init_parser (int );#endif /* PARSE_H */
Signature · 1 line
1.5.2.3
From 42a4d680b17d6ed4d0cc1108cef5d1b299495f01 Mon Sep 17 00:00:00 2001
From: Mathias Hasselmann <[email protected]>
Date: Tue, 4 Sep 2007 22:34:15 +0200
Subject: [PATCH] c2xml: Add support for custom attributes and omit end position information when equal to start position. Custom attributes are needed for GObject introspection to express details like this:
GList* create_list() __attribute__((element_type(char*)))
--- c2xml.c | 222 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--------- 1 files changed, 192 insertions(+), 30 deletions(-)
c2xml.c +192 -30
271 lines not on this page · raw message
Signature · 1 line
1.5.2.3
From be96d3c60e9e52e6448bf90444eb1e8bb3a48d5c Mon Sep 17 00:00:00 2001
From: Mathias Hasselmann <[email protected]>
Date: Tue, 4 Sep 2007 22:44:58 +0200
Subject: [PATCH] c2xml: Implement command line options:
-d include document type declaration
-p output position information for symbols
-o FILENAME write the document to FILENAME
-h display usage information - this page--- c2xml.c | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 71 insertions(+), 8 deletions(-)
c2xml.c +71 -8
124 lines not on this page · raw message
Signature · 1 line
1.5.2.3
From 1605b862637aecd54cfd5b159c96415bdddf46c3 Mon Sep 17 00:00:00 2001
From: Mathias Hasselmann <[email protected]>
Date: Tue, 4 Sep 2007 22:47:50 +0200
Subject: [PATCH] c2xml: Output initializer expressions, needed for instance for enum values.
--- c2xml.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
c2xml.c +4 -1
@@ -304,6 +304,9 @@ static void examine_symbol(struct symbol *sym, xmlNodePtr node)newProp (child,"base-type-builtin" ,builtin_typename (sym));break ; } + +examine_expression (sym->initializer, child); +return ; }
@@ -458,9 +461,9 @@ static void print_usage(char *arg0)"Parses C code and outputs the results as XML document.\n" "\n" "Options:\n" +" -o FILENAME write the document to FILENAME\n" " -d include document type declaration\n" " -p output position information for symbols\n" -" -o FILENAME write the document to FILENAME\n" " -h display usage information - this page\n" "\n" "Report bugs to <[email protected]>\n",
Signature · 1 line
1.5.2.3
Quoted 16 lines · Mathias Hasselmann
Hello,
For GObject introspection c2xml has to be extended to output information about custom attributes like this:
GList* create_list() __attribute__((element_type(char*)))Attached patch set adds support for custom attributes to c2xml. It also changes c2xml to provide command line options and to output initializer expressions. The patchset also is available via git:
http://taschenorakel.de/gitweb/?p=sparse;a=shortlog;h=gobject-introspection
Ciao,
Mathias
Quoted 6 lines
From
98fae4f8d2d1f375a18aeaf1e0a0c71107fbeba8Mon Sep 17 00:00:00 2001
From: Mathias Hasselmann <[email protected]>
Date: Tue, 4 Sep 2007 22:26:47 +0200
Subject: [PATCH] Introduce attribute structure for storing custom attributes in symbol nodes.Signed-off-by Mathias Hasselmann <[email protected]>
This patch looks good to me, from my (albeit limited) knowledge of sparse internals. It would be good to have someone with deeper understanding comment.
From 124215ffb5ba8ae28028588e1f12d2a586d21e20 Mon Sep 17 00:00:00 2001
From: Mathias Hasselmann <[email protected]>
Date: Tue, 4 Sep 2007 22:30:14 +0200
Subject: [PATCH] Extract init_keyword_table from init_parser for usage in c2xml.
Again, this looks fine to me.
Quoted 10 lines
From
42a4d680b17d6ed4d0cc1108cef5d1b299495f01Mon Sep 17 00:00:00 2001
From: Mathias Hasselmann <[email protected]>
Date: Tue, 4 Sep 2007 22:34:15 +0200
Subject: [PATCH] c2xml: Add support for custom attributes and omit end position information when equal to start position. Custom attributes are needed for GObject introspection to express details like this:GList* create_list() __attribute__((element_type(char*)))Signed-off-by Mathias Hasselmann <[email protected]>
This looks mostly fine, though I'm not sure about defining attribute_table inside c2xml. Either these are generally useful and so should be in (say) sparse.c, or they're specific to Gobject-introspection, and so there should be a way of providing them as input to c2xml, perhaps defined in an input xml document, and namespacing them in the output appropriately?
Quoted 11 lines
From
be96d3c60e9e52e6448bf90444eb1e8bb3a48d5cMon Sep 17 00:00:00 2001
From: Mathias Hasselmann <[email protected]>
Date: Tue, 4 Sep 2007 22:44:58 +0200
Subject: [PATCH] c2xml: Implement command line options:-d include document type declaration -p output position information for symbols -o FILENAME write the document to FILENAME -h display usage information - this pageSigned-off-by Mathias Hasselmann <[email protected]>
This looks like it breaks commandline parsing, Mathias has already told me on irc it needs fixing :) The options it gives could be useful though, if refactored to work correctly with the sparse commandline parsing.
Quoted 6 lines
From
1605b862637aecd54cfd5b159c96415bdddf46c3Mon Sep 17 00:00:00 2001
From: Mathias Hasselmann <[email protected]>
Date: Tue, 4 Sep 2007 22:47:50 +0200
Subject: [PATCH] c2xml: Output initializer expressions, needed for instance for enum values.Signed-off-by Mathias Hasselmann <[email protected]>
The second hunk of this patch looks unnecessary, and I think the first hunk should be included in 42a4d680.
Thanks,
Rob Taylor
Signature · 1 line
Rob Taylor, Codethink Ltd. - http://codethink.co.uk
Thanks for reviewing these, Rob. Further comments below.
Quoted 22 lines · Rob Taylor
Quoted 21 lines · Mathias Hasselmann
Hello,
For GObject introspection c2xml has to be extended to output information about custom attributes like this:
GList* create_list() __attribute__((element_type(char*)))Attached patch set adds support for custom attributes to c2xml. It also changes c2xml to provide command line options and to output initializer expressions. The patchset also is available via git:
http://taschenorakel.de/gitweb/?p=sparse;a=shortlog;h=gobject-introspection
Ciao,
MathiasFrom
98fae4f8d2d1f375a18aeaf1e0a0c71107fbeba8Mon Sep 17 00:00:00 2001
From: Mathias Hasselmann <[email protected]>
Date: Tue, 4 Sep 2007 22:26:47 +0200
Subject: [PATCH] Introduce attribute structure for storing custom attributes in symbol nodes.
Quoted 5 lines
Quoted 1 line
Signed-off-by Mathias Hasselmann <[email protected]>This patch looks good to me, from my (albeit limited) knowledge of sparse internals. It would be good to have someone with deeper understanding comment.
Looks reasonable to me too; I wonder if this generalization could cover some other things like contexts, particularly with appropriate factored-out functions to combine attributes from symbols.
I'd like to hear any comments from others as well.
Quoted 9 lines
From
124215ffb5ba8ae28028588e1f12d2a586d21e20Mon Sep 17 00:00:00 2001
From: Mathias Hasselmann <[email protected]>
Date: Tue, 4 Sep 2007 22:30:14 +0200
Subject: [PATCH] Extractinit_keyword_tablefrominit_parserfor usage in c2xml.Signed-off-by Mathias Hasselmann <[email protected]>Again, this looks fine to me.
Goes with the next change; seems OK, though I'd also like to hear further comments from other people.
Quoted 9 lines
Quoted 9 lines
From
42a4d680b17d6ed4d0cc1108cef5d1b299495f01Mon Sep 17 00:00:00 2001
From: Mathias Hasselmann <[email protected]>
Date: Tue, 4 Sep 2007 22:34:15 +0200
Subject: [PATCH] c2xml: Add support for custom attributes and omit end position information when equal to start position. Custom attributes are needed for GObject introspection to express details like this:GList* create_list() __attribute__((element_type(char*)))
Quoted 8 lines
Quoted 1 line
Signed-off-by Mathias Hasselmann <[email protected]>This looks mostly fine, though I'm not sure about defining
attribute_tableinside c2xml. Either these are generally useful and so should be in (say)sparse.c, or they're specific to Gobject-introspection, and so there should be a way of providing them as input to c2xml, perhaps defined in an input xml document, and namespacing them in the output appropriately?
At a minimum, Sparse should know about these attributes in order to ignore them. In theory, Sparse should ignore any attributes it doesn't know about, like GCC's -Wno-attributes, but that seems error-prone. Alternatively, we could introduce some new builtin for testing for available attributes; feature testing seems better than version testing, and Sparse does develop new features over time, so that might help for new Sparse features as well. That would allow something like conditional compilation based on individual attributes:
#if defined(__CHECKER__) && __attribute_exists__(element_type) #define element_type(x) __attribute__((element_type(x))) #endif
Quoted 10 lines
Quoted 10 lines
From
be96d3c60e9e52e6448bf90444eb1e8bb3a48d5cMon Sep 17 00:00:00 2001
From: Mathias Hasselmann <[email protected]>
Date: Tue, 4 Sep 2007 22:44:58 +0200
Subject: [PATCH] c2xml: Implement command line options:-d include document type declaration -p output position information for symbols -o FILENAME write the document to FILENAME -h display usage information - this page
Quoted 5 lines
Quoted 1 line
Signed-off-by Mathias Hasselmann <[email protected]>This looks like it breaks commandline parsing, Mathias has already told me on irc it needs fixing :) The options it gives could be useful though, if refactored to work correctly with the sparse commandline parsing.
Just to clarify something: feel free to refactor Sparse's command-line handling itself, which I think needs some work to make it usable by anything other than the sparse backend.
- Josh Triplett
Rob and Josh, thank you for review. Attaching more patches.
Am Mittwoch, den 05.09.2007, 13:36 -0700 schrieb Josh Triplett:
Quoted 10 lines
Thanks for reviewing these, Rob. Further comments below.
Quoted 4 lines
Quoted 4 lines
From
98fae4f8d2d1f375a18aeaf1e0a0c71107fbeba8Mon Sep 17 00:00:00 2001
From: Mathias Hasselmann <[email protected]>
Date: Tue, 4 Sep 2007 22:26:47 +0200
Subject: [PATCH] Introduce attribute structure for storing custom attributes in symbol nodes.Looks reasonable to me too; I wonder if this generalization could cover some other things like contexts, particularly with appropriate factored-out functions to combine attributes from symbols.
Seems that I do not know Sparse well enough yet to understand which chance for refactoring you see.
Quoted 10 lines
Quoted 10 lines
Quoted 4 lines
Subject: [PATCH] c2xml: Add support for custom attributes and omit end position information when equal to start position. Custom attributes are needed for GObject introspection to express details like this:
This looks mostly fine, though I'm not sure about defining
attribute_tableinside c2xml. Either these are generally useful and so should be in (say)sparse.c, or they're specific to Gobject-introspection, and so there should be a way of providing them as input to c2xml, perhaps defined in an input xml document, and namespacing them in the output appropriately?
Having definitions for GObject specific attributes within an external file seems reasonable for me: No need to patch sparse everytime we GNOME guys invent a new attribute for our code. But instead of using XML for that external definition I feel like using Sparse's builtin tokenizer.
Quoted 11 lines
At a minimum, Sparse should know about these attributes in order to ignore them. In theory, Sparse should ignore any attributes it doesn't know about, like GCC's -Wno-attributes, but that seems error-prone. Alternatively, we could introduce some new builtin for testing for available attributes; feature testing seems better than version testing, and Sparse does develop new features over time, so that might help for new Sparse features as well. That would allow something like conditional compilation based on individual attributes:
#ifdefined(__CHECKER__)&&__attribute_exists__(element_type)#defineelement_type(x)__attribute__((element_type(x))) #endif
Agreed. This __attribute_exists__ builtin looks like a pretty idea. Guess we also should convince the gcc hackers to introduce it.
Quoted 5 lines
Quoted 1 line
Quoted 1 line
Subject: [PATCH] c2xml: Implement command line options:
Just to clarify something: feel free to refactor Sparse's command-line handling itself, which I think needs some work to make it usable by anything other than the sparse backend.
Attached there is a new variant of the patch, playing nice with Sparse's command-line parse. Concept is borrowed from glib's GOptionContext. Upon approval I'll modify Sparse's command line parser to use this extensible infrastructure.
Ciao,
Mathias
Signature · 2 lines
Mathias Hasselmann <[email protected]> http://taschenorakel.de/
From 3a05dff32f6cf12b66496c225f063ad156a18b3b Mon Sep 17 00:00:00 2001
From: Mathias Hasselmann <[email protected]>
Date: Wed, 5 Sep 2007 21:38:47 +0200
Subject: [PATCH] parse.dtd: Fix errors in definition of the symbol element. Describe expression and type-reference elements.
--- parse.dtd | 22 +++++++++++++++++----- 1 files changed, 17 insertions(+), 5 deletions(-)
parse.dtd +17 -5
@@ -1,9 +1,9 @@ <!ELEMENT parse (symbol+) > -<!ELEMENT symbol (symbol*) > +<!ELEMENT symbol ((symbol|expression)*) > -<!ATTLIST symbol type (uninitialized|preprocessor|basetype|node|pointer|function|array|struct|union|enum|typedef|typeof|member|bitfield|label|restrict|fouled|keyword|bad) #REQUIRED - id ID #REQUIRED +<!ATTLIST symbol type (uninitialized|preprocessor|basetype|node|pointer|function|array|struct|union|enum|typedef|typeof|member|bitfield|label|restrict|fouled|keyword|bad|macro) #REQUIRED + id ID #REQUIRED file CDATA #REQUIRED start-line CDATA #REQUIRED start-col CDATA #REQUIRED
@@ -13,7 +13,7 @@ ident CDATA #IMPLIED base-type IDREF #IMPLIED - base-type-builtin (char|signed char|unsigned char|short|signed short|unsigned short|int|signed int|unsigned int|signed long|long|unsigned long|long long|signed long long|unsigned long long|void|bool|string|float|double|long double|incomplete type|abstract int|abstract fp|label type|bad type) #IMPLIED + base-type-builtin CDATA #IMPLIED array-size CDATA #IMPLIED
@@ -48,4 +48,16 @@ usertype (0|1) #IMPLIED force (0|1) #IMPLIED explicitly-signed (0|1) #IMPLIED - bitwise (0|1) #IMPLIED > + bitwise (0|1) #IMPLIED + user-type (0|1) #IMPLIED> + +<!ELEMENT expression EMPTY > +<!ATTLIST expression type (value|string) #REQUIRED + value CDATA #REQUIRED + file CDATA #REQUIRED + start-line CDATA #REQUIRED + start-col CDATA #REQUIRED + end-line CDATA #IMPLIED + end-col CDATA #IMPLIED + end-file CDATA #IMPLIED> +
Signature · 1 line
1.5.2.3
From d1f768fba349e00af1d30f4b6362f6e641ca2fe1 Mon Sep 17 00:00:00 2001
From: Mathias Hasselmann <[email protected]>
Date: Wed, 5 Sep 2007 21:42:38 +0200
Subject: [PATCH] c2xml: Output argument and expansion nodes for macros.
--- c2xml.c | 42 ++++++++++++++++++++++++++++++------------ parse.dtd | 11 ++++++++--- 2 files changed, 38 insertions(+), 15 deletions(-)
c2xml.c +30 -12
88 lines not on this page · raw message
parse.dtd +8 -3
@@ -1,6 +1,6 @@ <!ELEMENT parse (symbol+) > -<!ELEMENT symbol ((symbol|expression)*) > +<!ELEMENT symbol ((symbol|expression|type-reference)*) > <!ATTLIST symbol type (uninitialized|preprocessor|basetype|node|pointer|function|array|struct|union|enum|typedef|typeof|member|bitfield|label|restrict|fouled|keyword|bad|macro) #REQUIRED id ID #REQUIRED
@@ -49,9 +49,10 @@ force (0|1) #IMPLIED explicitly-signed (0|1) #IMPLIED bitwise (0|1) #IMPLIED - user-type (0|1) #IMPLIED> + user-type (0|1) #IMPLIED + has-arguments (0|1) #IMPLIED> -<!ELEMENT expression EMPTY > +<!ELEMENT expression EMPTY> <!ATTLIST expression type (value|string) #REQUIRED value CDATA #REQUIRED file CDATA #REQUIRED
@@ -61,3 +62,7 @@ end-col CDATA #IMPLIED end-file CDATA #IMPLIED> +<!ELEMENT type-reference EMPTY> +<!ATTLIST type-reference type CDATA #IMPLIED + type-builtin CDATA #IMPLIED> +
Signature · 1 line
1.5.2.3
From 3f1bae2aa3d7ac6129e03fec9b983fe228427b7d Mon Sep 17 00:00:00 2001
From: Mathias Hasselmann <[email protected]>
Date: Wed, 5 Sep 2007 23:59:40 +0200
Subject: [PATCH] c2xml: Implement support for command line options, but this time
without conflicting with the builtin options of sparse.
--- c2xml.c | 186 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++------- 1 files changed, 166 insertions(+), 20 deletions(-)
c2xml.c +166 -20
227 lines not on this page · raw message
Signature · 1 line
1.5.2.3
Quoted 10 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Subject: [PATCH] Introduce attribute structure for storing custom
attributes in symbol nodes.
Quoted 4 lines
Looks reasonable to me too; I wonder if this generalization could cover some other things like contexts, particularly with appropriate factored-out functions to combine attributes from symbols.
Seems that I do not know Sparse well enough yet to understand which chance for refactoring you see.
After some grepping (and googling) I see that sparse supports some context attribute for spin-lock tracking, and that the contexts list of struct ctype is for storing this attributes. So I agree, definitly a field for refactoring and unification. Started to work on that.
Signature · 5 lines
Mathias Hasselmann http://taschenorakel.de/mathias/ Psssst! Schon vom neuen GMX MultiMessenger gehört? Der kanns mit allen: http://www.gmx.net/de/go/multimessenger