LLVM backend for 6502
Go to file
Bill Wendling c3d505c3c2 Recommit r74952 with a bug fix:
DWARF requires frame moves be specified at specific times. If you have a
prologue like this:

__Z3fooi:
Leh_func_begin1:
LBB1_0: ## entry
       pushl   %ebp
Llabel1:
       movl    %esp, %ebp
Llabel2:
       pushl   %esi
Llabel3:
       subl    $20, %esp
       call    "L1$pb"
"L1$pb":
       popl    %esi

The "pushl %ebp" needs a table entry specifying the offset. The "movl %esp,
%ebp" makes %ebp the new stack frame register, so that needs to be specified in
DWARF. And "pushl %esi" saves the callee-saved %esi register, which also needs
to be specified in DWARF.

Before, all of this logic was in one method. This didn't work too well, because
as you can see there are multiple FDE line entries that need to be created.

This fix creates the "MachineMove" objects directly when they're needed; instead
of waiting until the end, and losing information.

There is some ugliness where we generate code like this:


LBB22_0:	## entry
	pushl	%ebp
Llabel280:
	movl	%esp, %ebp
Llabel281:
Llabel284:
	pushl	%ebp  <----------
	pushl	%ebx
	pushl	%edi
	pushl	%esi
Llabel282:
	subl	$328, %esp

Notice the extra "pushl %ebp". If we generate a "machine move" instruction in
the FDE for that pushl, the linker may get very confused about what value %ebp
should have when exitting the function. I.e., it'll give it the value %esp
instead of the %ebp value from the first "pushl". Not to mention that, in this
case, %ebp isn't modified in the function (that's a separate bug). I put a small
hack in to get it to work. It might be the only solution, but should be
revisited once the above case is fixed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75047 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-08 21:02:53 +00:00
autoconf LLVMC can be now compiled w/o dynamic plugin support. 2009-07-04 03:55:25 +00:00
bindings Fix the Ocaml bindings for the ExecutionEngine: with the change to build 2009-06-24 21:09:18 +00:00
cmake Add a portable strerror*() wrapper, llvm::sys::StrError(). This includes the 2009-07-01 18:11:20 +00:00
docs Push LLVMContext _back_ through IRBuilder. 2009-07-08 20:50:47 +00:00
examples Push LLVMContext _back_ through IRBuilder. 2009-07-08 20:50:47 +00:00
include Implement changes from Chris's feedback. 2009-07-08 20:53:28 +00:00
lib Recommit r74952 with a bug fix: 2009-07-08 21:02:53 +00:00
projects remove dead makefile flags. 2009-06-24 05:29:56 +00:00
runtime Drop toy GC runtime. 2009-03-02 03:46:48 +00:00
test Switch all the MC tests to use FileCheck. 2009-07-08 20:50:34 +00:00
tools Switch GlobalVariable ctors to a sane API, where *either* a context or a module is required. 2009-07-08 19:03:57 +00:00
unittests Hold the LLVMContext by reference rather than by pointer. 2009-07-01 21:22:36 +00:00
utils Convert more abort() calls to llvm_report_error(). 2009-07-08 19:04:27 +00:00
website
win32 Add a new codegen pass that normalizes dwarf exception handling 2009-05-22 20:36:31 +00:00
Xcode
build-for-llvm-top.sh Patch to build llvm with srcdir != objdir from 2009-01-23 08:42:38 +00:00
CMakeLists.txt CMake: Fixes previous change: CMAKE_BUILD_TYPE is unknown when 2009-07-05 23:58:20 +00:00
configure Regenerate. 2009-07-04 14:23:08 +00:00
CREDITS.TXT Conform... 2009-07-08 17:55:48 +00:00
LICENSE.TXT Now that we have atomics support properly detected by configure, 2009-05-19 00:08:29 +00:00
llvm.spec.in
Makefile Introduce new headers whose inclusion forces linking and 2009-06-16 20:12:29 +00:00
Makefile.common
Makefile.config.in LLVMC can be now compiled w/o dynamic plugin support. 2009-07-04 03:55:25 +00:00
Makefile.rules Add --enable-llvmc-dynamic configure option. 2009-07-03 03:52:47 +00:00
ModuleInfo.txt Patch to build llvm with srcdir != objdir from 2009-01-23 08:42:38 +00:00
README.txt README.txt: test commit w/blank line appended 2009-03-23 21:00:45 +00:00

Low Level Virtual Machine (LLVM)
================================

This directory and its subdirectories contain source code for the Low Level 
Virtual Machine, a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments. 

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the HTML documentation provided in docs/index.html for further
assistance with LLVM.