aboutsummaryrefslogtreecommitdiffstats
path: root/projects
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-11-23 17:53:46 +0000
committerChris Lattner <sabre@nondot.org>2003-11-23 17:53:46 +0000
commit302810dbad9136bf12ce1a0baab7880918b4a1bb (patch)
tree35738c93edc020dcf2bf5bbb000e2ccae453646b /projects
parentf608e853232b324ed4d3de238e47c9999504585b (diff)
downloadexternal_llvm-302810dbad9136bf12ce1a0baab7880918b4a1bb.zip
external_llvm-302810dbad9136bf12ce1a0baab7880918b4a1bb.tar.gz
external_llvm-302810dbad9136bf12ce1a0baab7880918b4a1bb.tar.bz2
Initial checkin of stacker runtime
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10179 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'projects')
-rw-r--r--projects/Stacker/lib/runtime/Makefile17
-rw-r--r--projects/Stacker/lib/runtime/stacker_rt.c34
2 files changed, 51 insertions, 0 deletions
diff --git a/projects/Stacker/lib/runtime/Makefile b/projects/Stacker/lib/runtime/Makefile
new file mode 100644
index 0000000..eaf1b48
--- /dev/null
+++ b/projects/Stacker/lib/runtime/Makefile
@@ -0,0 +1,17 @@
+##===- projects/sample/lib/sample/Makefile -----------------*- Makefile -*-===##
+
+#
+# Indicate where we are relative to the top of the source tree.
+#
+LEVEL=../../../..
+
+#
+# Give the name of a library. This will build a dynamic version.
+#
+SHARED_LIBRARY=1
+LIBRARYNAME=stkr_runtime
+
+#
+# Include Makefile.common so we know what to do.
+#
+include $(LEVEL)/Makefile.common
diff --git a/projects/Stacker/lib/runtime/stacker_rt.c b/projects/Stacker/lib/runtime/stacker_rt.c
new file mode 100644
index 0000000..c6cabdf
--- /dev/null
+++ b/projects/Stacker/lib/runtime/stacker_rt.c
@@ -0,0 +1,34 @@
+//===-- stacker_rt.c - Runtime Suppor For Stacker Compiler ------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file was developed by Reid Spencer and donated to the LLVM research
+// group and is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file defines a stack dumping function that can be used for debugging.
+// It is called whenever the DUMP built-in word is used in the Stacker source.
+// It has no effect on the stack (other than to print it).
+//
+// The real reason this is here is to test LLVM's ability to link with
+// separately compiled software.
+//
+//===----------------------------------------------------------------------===//
+
+#include "stdio.h"
+
+extern long _index_;
+extern int _stack_[1024];
+
+void
+_stacker_dump_stack_()
+{
+ int i;
+ printf("Stack Dump:\n");
+ for (i = _index_; i > 0; i-- )
+ {
+ printf("#%03d: %d\n", i, _stack_[i] );
+ }
+}