summaryrefslogtreecommitdiffstats
path: root/tools/llvmc/examples/Skeleton
diff options
context:
space:
mode:
Diffstat (limited to 'tools/llvmc/examples/Skeleton')
-rw-r--r--tools/llvmc/examples/Skeleton/AutoGenerated.td7
-rw-r--r--tools/llvmc/examples/Skeleton/Hooks.cpp12
-rw-r--r--tools/llvmc/examples/Skeleton/Main.cpp15
-rw-r--r--tools/llvmc/examples/Skeleton/Makefile20
-rw-r--r--tools/llvmc/examples/Skeleton/README6
5 files changed, 60 insertions, 0 deletions
diff --git a/tools/llvmc/examples/Skeleton/AutoGenerated.td b/tools/llvmc/examples/Skeleton/AutoGenerated.td
new file mode 100644
index 0000000..97483ce
--- /dev/null
+++ b/tools/llvmc/examples/Skeleton/AutoGenerated.td
@@ -0,0 +1,7 @@
+//===- AutoGenerated.td ------------------------------------*- tablegen -*-===//
+//
+// Write the TableGen description of your llvmc-based driver here.
+//
+//===----------------------------------------------------------------------===//
+
+include "llvm/CompilerDriver/Common.td"
diff --git a/tools/llvmc/examples/Skeleton/Hooks.cpp b/tools/llvmc/examples/Skeleton/Hooks.cpp
new file mode 100644
index 0000000..ddd38f6
--- /dev/null
+++ b/tools/llvmc/examples/Skeleton/Hooks.cpp
@@ -0,0 +1,12 @@
+//===--- Hooks.cpp - The LLVM Compiler Driver -------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open
+// Source License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// Hook definitions should go here.
+//
+//===----------------------------------------------------------------------===//
diff --git a/tools/llvmc/examples/Skeleton/Main.cpp b/tools/llvmc/examples/Skeleton/Main.cpp
new file mode 100644
index 0000000..24c7768
--- /dev/null
+++ b/tools/llvmc/examples/Skeleton/Main.cpp
@@ -0,0 +1,15 @@
+//===--- Main.cpp - The LLVM Compiler Driver -------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open
+// Source License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// Just include CompilerDriver/Main.inc and AutoGenerated.inc.
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/CompilerDriver/Main.inc"
+#include "AutoGenerated.inc"
diff --git a/tools/llvmc/examples/Skeleton/Makefile b/tools/llvmc/examples/Skeleton/Makefile
new file mode 100644
index 0000000..41ca823
--- /dev/null
+++ b/tools/llvmc/examples/Skeleton/Makefile
@@ -0,0 +1,20 @@
+##===- llvmc/examples/Skeleton/Makefile --------------------*- Makefile -*-===##
+#
+# The LLVM Compiler Infrastructure
+#
+# This file is distributed under the University of Illinois Open
+# Source License. See LICENSE.TXT for details.
+#
+##===----------------------------------------------------------------------===##
+
+# Change this so that $(LEVEL)/Makefile.common refers to
+# $LLVM_OBJ_DIR/Makefile.common or $YOUR_LLVM_BASED_PROJECT/Makefile.common.
+export LEVEL = ../../../..
+
+# Change this to the name of your LLVMC-based driver.
+LLVMC_BASED_DRIVER = llvmc-skeleton
+
+# Change this to the name of .inc file built from your .td file.
+BUILT_SOURCES = AutoGenerated.inc
+
+include $(LEVEL)/Makefile.common
diff --git a/tools/llvmc/examples/Skeleton/README b/tools/llvmc/examples/Skeleton/README
new file mode 100644
index 0000000..61ff6fb
--- /dev/null
+++ b/tools/llvmc/examples/Skeleton/README
@@ -0,0 +1,6 @@
+
+This is a template that can be used to create your own LLVMC-based drivers. Just
+copy the `Skeleton` directory to the location of your preference and edit
+`Skeleton/Makefile` and `Skeleton/AutoGenerated.inc`.
+
+The build system assumes that your project is based on LLVM.
OpenPOWER on IntegriCloud