Difference: CS255Spring08Discussions (59 vs. 60)

Revision 602008-03-20 - ChenDing

Line: 1 to 1
 
META TOPICPARENT name="CS255Spring08"

CS255/455 Spring 2008 Questions and Answers

This page is intended for anyone to post questions and everyone to answer them. Please insert questions at the beginning and separate each question with a horizontal rule separator. For other formatting instructions read the answer to this question.


Q: How can we identify a node with type casting? e.g. D.1570 = (double) D.1569; or a.1 = (unsigned int) a.0;. I want to identify the rhs is a type casting and want to extract the variables as well.
Added:
>
>
A: I would think you'll see a special node representing the cast. A quick look at tree.def found two suspects, each has a unary child, which should be the variable or expression being converted. ChenDing

/* Represents a conversion of type of a value.
   All conversions, including implicit ones, must be
   represented by CONVERT_EXPR or NOP_EXPR nodes.  */
DEFTREECODE (CONVERT_EXPR, "convert_expr", tcc_unary, 1)

/* Represents a conversion expected to require no code to be generated.  */
DEFTREECODE (NOP_EXPR, "nop_expr", tcc_unary, 1)
 
Q: How can we identify definitions and uses of global variables like "int array[32]" in fibonacci.c?
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding URCS? Send feedback