[llvm-commits] [llvm-gcc-4.2] r57316 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp

Duncan Sands baldrick at free.fr
Thu Oct 9 01:38:51 PDT 2008


Hi Dale,

> Accept INIT_EXPR here.  These are built by the C++ FE on
> occasion with semantics not quite the same as MODIFY_EXPR
> (initialization vs assignment in C++).  Here we can
> handle them identically to MODIFY_EXPR.
> Fixes g++.apple/block-global-block.C etc.

you seemed to have missed one place: line 882 (don't create a temp
to hold the value - this is the reason for the test at the start of
TreeToLLVM::Emit, which you did change):

      // If this stmt returns an aggregate value (e.g. a call whose result is
      // ignored), create a temporary to receive the value.  Note that we don't
      // do this for MODIFY_EXPRs as an efficiency hack.
      if (isAggregateTreeType(TREE_TYPE(stmt)) && TREE_CODE(stmt)!= MODIFY_EXPR)
        DestLoc = CreateTempLoc(ConvertType(TREE_TYPE(stmt)));

Otherwise looks good!

Ciao,

Duncan.



More information about the llvm-commits mailing list