Skip to content
  1. Jul 29, 2004
  2. Jul 27, 2004
    • Robert Bocchino's avatar
      · 7b5b86cd
      Robert Bocchino authored
      This change fixed a bug in the function visitMul.  The prior version
      assumed that a constant on the RHS of a multiplication was either an
      IntConstant or an FPConstant.  It checked for an IntConstant and then,
      if it did not find one, did a hard cast to an FPConstant.  That code
      would crash if the RHS were a ConstantExpr that was neither an
      IntConstant nor an FPConstant.  This version replaces the hard cast
      with a dyn_cast.  It performs the same way for IntConstants and
      FPConstants but does nothing, instead of crashing, for constant
      expressions.
      
      The regression test for this change is 2004-07-27-ConstantExprMul.ll.
      
      llvm-svn: 15291
      7b5b86cd
    • Brian Gaeke's avatar
    • Chris Lattner's avatar
      Fix hoisting of void typed values, e.g. calls · 50eb771d
      Chris Lattner authored
      llvm-svn: 15263
      50eb771d
  3. Jul 26, 2004
  4. Jul 25, 2004
  5. Jul 24, 2004
  6. Jul 22, 2004
  7. Jul 21, 2004
  8. Jul 20, 2004
  9. Jul 18, 2004
  10. Jul 16, 2004
  11. Jul 15, 2004
  12. Jul 13, 2004
    • Chris Lattner's avatar
      Factor some code to handle "load (constantexpr cast foo)" just like · 35e24774
      Chris Lattner authored
      "load (cast foo)".  This allows us to compile C++ code like this:
      
      class Bclass {
        public: virtual int operator()() { return 666; }
      };
      
      class Dclass: public Bclass {
        public: virtual int operator()() { return 667; }
      } ;
      
      int main(int argc, char** argv) {
        Dclass x;
        return x();
      }
      
      Into this:
      
      int %main(int %argc, sbyte** %argv) {
      entry:
              call void %__main( )
              ret int 667
      }
      
      Instead of this:
      
      int %main(int %argc, sbyte** %argv) {
      entry:
              %x = alloca "struct.std::bad_typeid"            ; <"struct.std::bad_typeid"*> [#uses=3]
              call void %__main( )
              %tmp.1.i.i = getelementptr "struct.std::bad_typeid"* %x, uint 0, uint 0, uint 0         ; <int (...)***> [#uses=1]
              store int (...)** getelementptr ([3 x int (...)*]*  %vtable for Bclass, int 0, long 2), int (...)*** %tmp.1.i.i
              %tmp.3.i = getelementptr "struct.std::bad_typeid"* %x, int 0, uint 0, uint 0            ; <int (...)***> [#uses=1]
              store int (...)** getelementptr ([3 x int (...)*]*  %vtable for Dclass, int 0, long 2), int (...)*** %tmp.3.i
              %tmp.5 = load int ("struct.std::bad_typeid"*)** cast (int (...)** getelementptr ([3 x int (...)*]*  %vtable for Dclass, int 0, long 2) to int
      ("struct.std::bad_typeid"*)**)          ; <int ("struct.std::bad_typeid"*)*> [#uses=1]
              %tmp.6 = call int %tmp.5( "struct.std::bad_typeid"* %x )                ; <int> [#uses=1]
      	ret int %tmp.6
              ret int 0
      }
      
      In order words, we now resolve the virtual function call.
      
      llvm-svn: 14783
      35e24774
  13. Jul 06, 2004
Loading