This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Proposed new tree node for gcc


This email proposes the introduction of a new tree node for gcc,
aiming at encapsulating other nodes with file location information. 

The idea is that there are languages like Java that require the entire
source file to be parsed before tree nodes can be built or completed,
which means that as we're encountering identifiers and expressions, we
need hook them to file location information so we can pinpoint errors
during the check of the semantic and generate debug information during
the expansion phase.

We (Per Bothner and myself) propose the definition of a new tree node
called EXPR_WITH_FILE_LOCATION defined as a 'e' node. The struct
tree_exp is big enough to provide us with the appropriate storage
space: `operands[]' can be used to store the encapsulated node,
`complexity' is big enough to store line (20 bit) and column numbers
(12 bit); `common.chain' can provide a hook for filename information.

We started to experiment with an implementation. It turns out that,
besides the definition of the new tree node in tree.def, some macro
definitions in tree.h and a function in tree.c, print-tree.c needs to
be slightly altered; expand_expr need to be modified to apply
expand_expr to the operand node of the encapsulating node, possibly
calling emit_line_note with the relevant file location information.

The file capture the changes
we think are necessary. Let me know what you're thinking about it. So
far, everything, down to the name of the macros and functions is left
open for discussion.


-- Alex

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]