LLVM backend for 6502
Go to file
Chris Lattner b89e071aea Factor some code to handle "load (constantexpr cast foo)" just like
"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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14783 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-13 01:49:43 +00:00
autoconf Call custom check (AC_FUNC_ISNAN) instead of using the generic function check. 2004-06-22 23:43:04 +00:00
docs New open proj: C/C++ compiler in C++, with link to Ed Willink's C++ yacc grammar 2004-07-12 21:10:47 +00:00
examples/ModuleMaker Add #include <iostream> since Value.h doesn't include it any more. 2004-07-04 12:22:14 +00:00
include Add a helper method. The StructType element is completely redundant in most 2004-07-12 20:36:08 +00:00
lib Factor some code to handle "load (constantexpr cast foo)" just like 2004-07-13 01:49:43 +00:00
projects Group the hidden command line arguments. 2004-07-10 23:35:46 +00:00
runtime Continue the implementation 2004-05-27 05:51:31 +00:00
test Add a test that I have had in my tree for several months now, but apparently forgot to commit 2004-07-08 15:41:08 +00:00
tools * Tabs to spaces 2004-07-12 22:58:07 +00:00
utils Fix some thinkos in the script (error handling, proper argument handling). 2004-07-07 21:19:01 +00:00
.cvsignore Ok, try #2, this time I'll not be stupid 2003-08-03 18:33:24 +00:00
configure Regenerated. 2004-06-22 23:47:13 +00:00
CREDITS.TXT Add credits entry 2004-06-25 21:00:10 +00:00
LICENSE.TXT Add spiff 2004-06-01 20:37:41 +00:00
llvm.spec RPM spec file for LLVM tools and libraries. 2004-02-10 03:57:51 +00:00
llvm.spec.in RPM spec file for LLVM tools and libraries. 2004-02-10 03:57:51 +00:00
Makefile etags isn't portable at all. Make it not run by default. If you still 2004-06-24 18:19:42 +00:00
Makefile.common Standardize header comments of top-level Makefiles. 2004-04-24 00:10:56 +00:00
Makefile.config.in Since the Great LLVM Tool Renaming(tm), we no longer have collisions between our 2004-06-17 15:39:58 +00:00
Makefile.rules Really, it is not necessary to recompile all files in a profile build every 2004-07-08 03:42:20 +00:00
README.txt This file has been superseded by docs/index.html . 2004-05-12 02:48:30 +00:00

This file is a placeholder; see docs/index.html for documentation.