[llvm-commits] CVS: llvm-gcc/gcc/cp/typeck.c
Chris Lattner
lattner at cs.uiuc.edu
Mon Feb 14 13:25:19 PST 2005
Changes in directory llvm-gcc/gcc/cp:
typeck.c updated: 1.6 -> 1.7
---
Log message:
Simplify code based on transformations the middle-end is doing.
---
Diffs of the changes: (+5 -10)
typeck.c | 15 +++++----------
1 files changed, 5 insertions(+), 10 deletions(-)
Index: llvm-gcc/gcc/cp/typeck.c
diff -u llvm-gcc/gcc/cp/typeck.c:1.6 llvm-gcc/gcc/cp/typeck.c:1.7
--- llvm-gcc/gcc/cp/typeck.c:1.6 Sun Feb 13 21:21:43 2005
+++ llvm-gcc/gcc/cp/typeck.c Mon Feb 14 15:25:06 2005
@@ -1342,16 +1342,10 @@
if (TREE_CODE (exp) == VAR_DECL)
{
- /* ??? This is not really quite correct
- in that the type of the operand of ADDR_EXPR
- is not the target type of the type of the ADDR_EXPR itself.
- Question is, can this lossage be avoided? */
- adr = build1 (ADDR_EXPR, ptrtype, exp);
- if (!cxx_mark_addressable (exp))
- return error_mark_node;
- TREE_CONSTANT (adr) = staticp (exp);
- TREE_SIDE_EFFECTS (adr) = 0; /* Default would be, same as EXP. */
- return adr;
+ if (!cxx_mark_addressable (exp))
+ return error_mark_node;
+ adr = build_nop (ptrtype, build_address (exp));
+ return adr;
}
/* This way is better for a COMPONENT_REF since it can
simplify the offset for a component. */
@@ -3596,6 +3590,7 @@
return error_mark_node;
addr = build1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (t)), t);
+
if (staticp (t))
TREE_CONSTANT (addr) = 1;
More information about the llvm-commits
mailing list