Mikhail Glushenkov | 03c050f | 2009-03-03 10:04:57 +0000 | [diff] [blame] | 1 | //===- Simple.td - A simple plugin for LLVMC ------------------------------===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // A simple LLVMC-based gcc wrapper that shows how to write LLVMC plugins. |
| 11 | // |
Mikhail Glushenkov | cc30d9c | 2008-10-16 14:02:29 +0000 | [diff] [blame] | 12 | // To compile, use this command: |
| 13 | // |
Mikhail Glushenkov | 03c050f | 2009-03-03 10:04:57 +0000 | [diff] [blame] | 14 | // $ cd $LLVMC_DIR/example/Simple |
Mikhail Glushenkov | cc30d9c | 2008-10-16 14:02:29 +0000 | [diff] [blame] | 15 | // $ make |
| 16 | // |
| 17 | // Run as: |
| 18 | // |
Mikhail Glushenkov | 03c050f | 2009-03-03 10:04:57 +0000 | [diff] [blame] | 19 | // $ llvmc -load $LLVM_DIR/Release/lib/plugin_llvmc_Simple.so |
| 20 | // |
| 21 | // For instructions on how to build your own LLVMC-based driver, see |
| 22 | // the 'example/Skeleton' directory. |
| 23 | //===----------------------------------------------------------------------===// |
Mikhail Glushenkov | cc30d9c | 2008-10-16 14:02:29 +0000 | [diff] [blame] | 24 | |
| 25 | include "llvm/CompilerDriver/Common.td" |
| 26 | |
| 27 | def gcc : Tool< |
| 28 | [(in_language "c"), |
| 29 | (out_language "executable"), |
| 30 | (output_suffix "out"), |
| 31 | (cmd_line "gcc $INFILE -o $OUTFILE"), |
| 32 | (sink) |
| 33 | ]>; |
| 34 | |
| 35 | def LanguageMap : LanguageMap<[LangToSuffixes<"c", ["c"]>]>; |
| 36 | |
Mikhail Glushenkov | 0108877 | 2008-11-17 17:29:18 +0000 | [diff] [blame] | 37 | def CompilationGraph : CompilationGraph<[Edge<"root", "gcc">]>; |