diff options
| author | Mikhail Glushenkov <foldr@codedgers.com> | 2010-08-19 20:04:19 +0000 |
|---|---|---|
| committer | Mikhail Glushenkov <foldr@codedgers.com> | 2010-08-19 20:04:19 +0000 |
| commit | b2ca0d19f2d43b2b64eb5a6f3c5edbe1532757db (patch) | |
| tree | b5f517f9a28145dab82a7f2ec667dda37d60ebb4 /llvm/tools/llvmc/examples/Simple | |
| parent | 34c5f1be0d84001c9fbebe694102c1154e060583 (diff) | |
| download | bcm5719-llvm-b2ca0d19f2d43b2b64eb5a6f3c5edbe1532757db.tar.gz bcm5719-llvm-b2ca0d19f2d43b2b64eb5a6f3c5edbe1532757db.zip | |
llvmc: Update examples.
llvm-svn: 111553
Diffstat (limited to 'llvm/tools/llvmc/examples/Simple')
| -rw-r--r-- | llvm/tools/llvmc/examples/Simple/Makefile | 15 | ||||
| -rw-r--r-- | llvm/tools/llvmc/examples/Simple/Simple.cpp | 2 | ||||
| -rw-r--r-- | llvm/tools/llvmc/examples/Simple/Simple.td | 41 |
3 files changed, 58 insertions, 0 deletions
diff --git a/llvm/tools/llvmc/examples/Simple/Makefile b/llvm/tools/llvmc/examples/Simple/Makefile new file mode 100644 index 00000000000..c10387c4f55 --- /dev/null +++ b/llvm/tools/llvmc/examples/Simple/Makefile @@ -0,0 +1,15 @@ +##===- llvmc/examples/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_BASED_DRIVER = Simple +BUILT_SOURCES = Simple.inc + +include $(LEVEL)/Makefile.common diff --git a/llvm/tools/llvmc/examples/Simple/Simple.cpp b/llvm/tools/llvmc/examples/Simple/Simple.cpp new file mode 100644 index 00000000000..8ac73130f9e --- /dev/null +++ b/llvm/tools/llvmc/examples/Simple/Simple.cpp @@ -0,0 +1,2 @@ +#include "llvm/CompilerDriver/Main.inc" +#include "Simple.inc" diff --git a/llvm/tools/llvmc/examples/Simple/Simple.td b/llvm/tools/llvmc/examples/Simple/Simple.td new file mode 100644 index 00000000000..7ceee93d7cd --- /dev/null +++ b/llvm/tools/llvmc/examples/Simple/Simple.td @@ -0,0 +1,41 @@ +//===- Simple.td - A simple LLVMC-based driver ----------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// A simple LLVMC-based gcc wrapper. +// +// To compile, use this command: +// +// $ cd $LLVM_OBJ_DIR/tools/llvmc +// $ make BUILD_EXAMPLES=1 +// +// Run as: +// +// $ $LLVM_OBJ_DIR/$(BuildMode)/bin/Simple +// +// For instructions on how to build your own LLVMC-based driver, see +// the 'examples/Skeleton' directory. +//===----------------------------------------------------------------------===// + +include "llvm/CompilerDriver/Common.td" + +def gcc : Tool< +[(in_language "c"), + (out_language "executable"), + (output_suffix "out"), + (command "gcc"), + (sink), + + // -o is what is used by default, out_file_option here is included for + // instructive purposes. + (out_file_option "-o") +]>; + +def LanguageMap : LanguageMap<[LangToSuffixes<"c", ["c"]>]>; + +def CompilationGraph : CompilationGraph<[Edge<"root", "gcc">]>; |

