dehydra: patch to add access data for static member declarations

RESOLVED FIXED

Status

Firefox Build System
Source Code Analysis
--
enhancement
RESOLVED FIXED
9 years ago
4 months ago

People

(Reporter: Daniel Rogers, Unassigned)

Tracking

Trunk
x86
Linux

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

9 years ago
User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1) Gecko/20090615 Firefox/3.5
Build Identifier: HEAD from June 20th, 2009

This patch adds an "access" property for all global declarations, not just
non-static members of classes and structs.  I use this in building C++ ->
Java bindings to identify static methods that should have native lang
accessors.

Reproducible: Always

Steps to Reproduce:
This is a feature enhancement, not a bug.
(Reporter)

Comment 1

9 years ago
Created attachment 384771 [details] [diff] [review]
patch against dehydra.c

The big flaw with this patch is that it copies several static constants from dehyra_types.c that are inaccessible from dehydra.c  I'm willing to adjust the patch if someone tells me what would be best (i.e. should I make the constants non-static and put a declaration into a headerfile somewhere?)
Status: UNCONFIRMED → NEW
Ever confirmed: true

Comment 2

9 years ago
(In reply to comment #1)
> Created an attachment (id=384771) [details]
> patch against dehydra.c
> 
> The big flaw with this patch is that it copies several static constants from
> dehyra_types.c that are inaccessible from dehydra.c  I'm willing to adjust the
> patch if someone tells me what would be best (i.e. should I make the constants
> non-static and put a declaration into a headerfile somewhere?)

Yeah make them non-static and put them into dehydra.h

I don't see how this would affect things outside of class scope. Can you attach
a testcase C++ file that works better with your patch?
(Reporter)

Comment 3

9 years ago
I can attach a testcase, sure (tomorrow)

It is only in class scope.  The "TREE_CODE(decl_context) == RECORD_TYPE" matches only things like structs and classes.  The issue, apparently is that static members of a class or struct appear as top level definitions.  This is why they don't appear in the "members" array of the type for the class and instead appear as a separate top level declaration event.  Someone had already added code to populate the "memberOf" property of static definitions.  I'm adding only the additional property of "access" right at the same place.

Comment 4

9 years ago
Thanks for the bugreport + fix.

cleanedup+testcased+pushed
http://hg.mozilla.org/users/tglek_mozilla.com/dehydra-gcc/rev/e3d49bb8ce4f
Status: NEW → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → FIXED

Updated

4 months ago
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.