diff options
author | Mikhail Glushenkov <foldr@codedgers.com> | 2008-05-30 06:16:32 +0000 |
---|---|---|
committer | Mikhail Glushenkov <foldr@codedgers.com> | 2008-05-30 06:16:32 +0000 |
commit | 163dc1eaa834c64dd9ae899ccaacac0a61cd8fe6 (patch) | |
tree | acf3fcd8b7afd5d542bb664892f80f301de52a8e /tools/llvmc2/examples | |
parent | cb64f4be3abdf0f49e61cc5d6145c9712fe9b070 (diff) | |
download | external_llvm-163dc1eaa834c64dd9ae899ccaacac0a61cd8fe6.zip external_llvm-163dc1eaa834c64dd9ae899ccaacac0a61cd8fe6.tar.gz external_llvm-163dc1eaa834c64dd9ae899ccaacac0a61cd8fe6.tar.bz2 |
Documentation and examples improvements
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51739 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvmc2/examples')
-rw-r--r-- | tools/llvmc2/examples/Clang.td | 48 | ||||
-rw-r--r-- | tools/llvmc2/examples/Simple.td | 2 |
2 files changed, 50 insertions, 0 deletions
diff --git a/tools/llvmc2/examples/Clang.td b/tools/llvmc2/examples/Clang.td index e69de29..45ee638 100644 --- a/tools/llvmc2/examples/Clang.td +++ b/tools/llvmc2/examples/Clang.td @@ -0,0 +1,48 @@ +// A (first stab at a) replacement for the Clang's ccc script. +// To compile, use this command: +// make TOOLNAME=ccc GRAPH=examples/Clang.td + +include "Common.td" + +// TOFIX: It should be possible to use a string list in the 'in_language' +// tool property. There should be also an 'in_language' test in the +// 'case' construct. + +def clang : Tool< +[(in_language "c"), + (out_language "llvm-bitcode"), + (output_suffix "bc"), + (cmd_line (case (switch_on "E"), "clang -E $INFILE -o $OUTFILE", + (default), "clang -emit-llvm-bc $INFILE -o $OUTFILE")), + (switch_option "E", (stop_compilation), (output_suffix "i"), + (help "Stop after the preprocessing stage, do not run the compiler")), + (sink) +]>; + +// Default linker +def llvm_ld : Tool< +[(in_language "llvm-bitcode"), + (out_language "executable"), + (output_suffix "out"), + (cmd_line "llvm-ld -native -disable-internalize $INFILE -o $OUTFILE"), + (prefix_list_option "L", (forward), (help "Specify a library search path")), + (join) +]>; + +// Language map + +def LanguageMap : LanguageMap< + [LangToSuffixes<"c++", ["cc", "cp", "cxx", "cpp", "CPP", "c++", "C"]>, + LangToSuffixes<"c", ["c"]>, + LangToSuffixes<"objective-c", ["m"]>, + LangToSuffixes<"c-cpp-output", ["i"]>, + LangToSuffixes<"objective-c-cpp-output", ["mi"]> + ]>; + +// Compilation graph + +def CompilationGraph : CompilationGraph<[ + Edge<root, clang>, + Edge<clang, llvm_ld> + ]>; + diff --git a/tools/llvmc2/examples/Simple.td b/tools/llvmc2/examples/Simple.td index d00132a..88d4f0e 100644 --- a/tools/llvmc2/examples/Simple.td +++ b/tools/llvmc2/examples/Simple.td @@ -1,4 +1,6 @@ // A simple wrapper for gcc. +// To compile, use this command: +// make TOOLNAME=llvmc_simple GRAPH=examples/Simple.td include "Common.td" |