Closed Bug 429446 Opened 18 years ago Closed 18 years ago

dehydra could handle constant nodes better

Categories

(Developer Infrastructure :: Source Code Analysis, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: vladimir.sukhoy, Assigned: vladimir.sukhoy)

Details

Attachments

(1 file, 1 obsolete file)

Currently dehydra uses gcc's pretty-printer to produce JS objects for tree nodes corresponding to constants. It turned out that gcc's pretty printer behavior is quite weird (if not buggy) in certain circumstances: see bug 429362. Besides pretty printer issues it may be beneficial for certain JS analyses which may have to deal with constants to be able to access the information about the type of the constant in a way that is consistent with the rest of dehydra (i.e. via .type property on the JS object corresponding to the constant). Currently, such analyses would have to extract this type information from the output of the pretty printer (e.g. the value of the constant "123ull" implies that this is the unsigned long long constant with numeric value 123). If dehydra could provide .type property for constants then there would be no need for pretty printer's representation, moreover, the appropriate JS type could be used for .value property of a constant object where feasible (i.e. for a zero constant the .value would be 0 versus "0" or "0u" or other variants which may be produced by pretty printer).
After brief discussion we decided that .type is a good idea, but messing with .value is not.
Assignee: nobody → vladimir.sukhoy
Status: NEW → ASSIGNED
Attached patch wip (obsolete) — Splinter Review
work in progress on .type prop on constants, seems not to work on linux when dehydra bootstraps treehydra.
Fixed remaining issues: constants of some unique types may be seen during bootstrap of treehydra.
Attachment #319730 - Attachment is obsolete: true
Attachment #319794 - Flags: review?(tglek)
Comment on attachment 319794 [details] [diff] [review] setup .type on constant objects Looks good, but please get rid of nested ternaries
Attachment #319794 - Flags: review?(tglek) → review+
did so and pushed.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Product: Core → Firefox Build System
Product: Firefox Build System → Developer Infrastructure
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: