summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvmc/example/Simple
diff options
context:
space:
mode:
authorMikhail Glushenkov <foldr@codedgers.com>2009-03-03 10:02:53 +0000
committerMikhail Glushenkov <foldr@codedgers.com>2009-03-03 10:02:53 +0000
commitb00b964697515e10a4f19c87f4bb6fdb0b41419b (patch)
treeabdaab2b53a4afe1b487cdfac95a482cc59fa1c8 /llvm/tools/llvmc/example/Simple
parent9e26e6d3cb8ca24058f2c0f6ba9cb7191857c8a1 (diff)
downloadbcm5719-llvm-b00b964697515e10a4f19c87f4bb6fdb0b41419b.tar.gz
bcm5719-llvm-b00b964697515e10a4f19c87f4bb6fdb0b41419b.zip
Move example plugins to the example/ directory.
llvm-svn: 65939
Diffstat (limited to 'llvm/tools/llvmc/example/Simple')
-rw-r--r--llvm/tools/llvmc/example/Simple/Makefile15
-rw-r--r--llvm/tools/llvmc/example/Simple/PluginMain.cpp1
-rw-r--r--llvm/tools/llvmc/example/Simple/Simple.td30
3 files changed, 46 insertions, 0 deletions
diff --git a/llvm/tools/llvmc/example/Simple/Makefile b/llvm/tools/llvmc/example/Simple/Makefile
new file mode 100644
index 00000000000..d7adb5d851e
--- /dev/null
+++ b/llvm/tools/llvmc/example/Simple/Makefile
@@ -0,0 +1,15 @@
+##===- tools/llvmc/plugins/Simple/Makefile -----------------*- Makefile -*-===##
+#
+# The LLVM Compiler Infrastructure
+#
+# This file is distributed under the University of Illinois Open Source
+# License. See LICENSE.TXT for details.
+#
+##===----------------------------------------------------------------------===##
+
+LEVEL = ../../../..
+
+LLVMC_PLUGIN = Simple
+BUILT_SOURCES = AutoGenerated.inc
+
+include $(LEVEL)/Makefile.common
diff --git a/llvm/tools/llvmc/example/Simple/PluginMain.cpp b/llvm/tools/llvmc/example/Simple/PluginMain.cpp
new file mode 100644
index 00000000000..add8acb4a57
--- /dev/null
+++ b/llvm/tools/llvmc/example/Simple/PluginMain.cpp
@@ -0,0 +1 @@
+#include "AutoGenerated.inc"
diff --git a/llvm/tools/llvmc/example/Simple/Simple.td b/llvm/tools/llvmc/example/Simple/Simple.td
new file mode 100644
index 00000000000..b974cbc95eb
--- /dev/null
+++ b/llvm/tools/llvmc/example/Simple/Simple.td
@@ -0,0 +1,30 @@
+// A simple wrapper for gcc.
+// To compile, use this command:
+//
+// $ cd $LLVMC2_DIR
+// $ make DRIVER_NAME=mygcc BUILTIN_PLUGINS=Simple
+//
+// To build this plugin as a dynamic library:
+//
+// $ cd $LLVMC2_DIR
+// $ make BUILTIN_PLUGINS=""
+// $ cd plugins/Simple
+// $ make
+//
+// Run as:
+//
+// $ llvmc2 -load $LLVM_DIR/Release/lib/LLVMCSimple.so
+
+include "llvm/CompilerDriver/Common.td"
+
+def gcc : Tool<
+[(in_language "c"),
+ (out_language "executable"),
+ (output_suffix "out"),
+ (cmd_line "gcc $INFILE -o $OUTFILE"),
+ (sink)
+]>;
+
+def LanguageMap : LanguageMap<[LangToSuffixes<"c", ["c"]>]>;
+
+def CompilationGraph : CompilationGraph<[Edge<"root", "gcc">]>;
OpenPOWER on IntegriCloud