Make it possible to change the output file suffix based on command-line options.

For instance, the following command:

    llvmc2 -E hello.c

now generates a file with the correct suffix (hello.i).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51733 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Mikhail Glushenkov
2008-05-30 06:13:02 +00:00
parent 08bd2e74dc
commit 5c7578de08
2 changed files with 34 additions and 8 deletions

View File

@@ -30,10 +30,7 @@ def llvm_gcc_c : Tool<
"llvm-g++ -E -x c $INFILE -o $OUTFILE -emit-llvm",
(default),
"llvm-g++ -c -x c $INFILE -o $OUTFILE -emit-llvm")),
// TOFIX: Preprocessed files currently have suffix ".bc".
(switch_option "E", (stop_compilation),
// Make this possible:
// (output_suffix "i"),
(switch_option "E", (stop_compilation),(output_suffix "i"),
(help "Stop after the preprocessing stage, do not run the compiler")),
(sink)
]>;
@@ -47,7 +44,7 @@ def llvm_gcc_cpp : Tool<
"llvm-g++ -E -x c++ $INFILE -o $OUTFILE -emit-llvm",
(default),
"llvm-g++ -c -x c++ $INFILE -o $OUTFILE -emit-llvm")),
(switch_option "E", (stop_compilation)),
(switch_option "E", (stop_compilation), (output_suffix "i")),
(sink)
]>;