Skip to content

Commit 9e6ffc2

Browse files
committed
cc: Add option to print vast pipeline.
1 parent 471effa commit 9e6ffc2

File tree

4 files changed

+49
-14
lines changed

4 files changed

+49
-14
lines changed

include/vast/Frontend/Consumer.hpp

-2
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@ namespace vast::cc {
6161

6262
protected:
6363

64-
void execute_pipeline(vast_module mod, mcontext_t *mctx);
65-
6664
virtual void anchor() {}
6765

6866
action_options opts;

include/vast/Frontend/Options.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,15 @@ namespace vast::cc
7272
constexpr string_ref emit_asm = "emit-asm";
7373
constexpr string_ref emit_mlir = "emit-mlir";
7474

75+
constexpr string_ref print_pipeline = "print-pipeline";
76+
7577
constexpr string_ref debug = "debug";
7678

7779
constexpr string_ref simplify = "simplify";
7880

7981
constexpr string_ref show_locs = "show-locs";
8082
constexpr string_ref locs_as_meta_ids = "locs-as-meta-ids";
8183

82-
constexpr string_ref opt_pipeline = "pipeline";
83-
8484
constexpr string_ref disable_vast_verifier = "disable-vast-verifier";
8585
constexpr string_ref vast_verify_diags = "verify-diags";
8686
constexpr string_ref disable_emit_cxx_default = "disable-emit-cxx-default";

lib/vast/Frontend/Consumer.cpp

+13-10
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,19 @@ namespace vast::cc {
207207
llvm::DebugFlag = true;
208208
}
209209

210-
execute_pipeline(mod.get(), mctx);
210+
// Setup and execute vast pipeline
211+
auto pipeline = setup_pipeline(
212+
pipeline_source::ast, output_type::emit_mlir, *mctx, vargs,
213+
default_pipelines_config()
214+
);
215+
VAST_CHECK(pipeline, "failed to setup pipeline");
216+
217+
if (vargs.has_option(opt::print_pipeline)) {
218+
pipeline->dump();
219+
}
220+
221+
auto result = pipeline->run(mod.get());
222+
VAST_CHECK(mlir::succeeded(result), "MLIR pass manager failed when running vast passes");
211223

212224
// Verify the diagnostic handler to make sure that each of the
213225
// diagnostics matched.
@@ -228,15 +240,6 @@ namespace vast::cc {
228240
mod->print(*output_stream, flags);
229241
}
230242

231-
void vast_consumer::execute_pipeline(vast_module mod, mcontext_t *mctx) {
232-
auto pipeline = setup_pipeline(
233-
pipeline_source::ast, output_type::emit_mlir, *mctx, vargs, default_pipelines_config()
234-
);
235-
236-
auto result = pipeline->run(mod);
237-
VAST_CHECK(mlir::succeeded(result), "MLIR pass manager failed when running vast passes");
238-
}
239-
240243
source_language get_source_language(const cc::language_options &opts) {
241244
using ClangStd = clang::LangStandard;
242245

todo.txt

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
Failed Tests (27):
2+
VAST :: vast/Compile/ObjectFiles/identity-a.c
3+
VAST :: vast/Compile/ObjectFiles/struct-a.c
4+
VAST :: vast/Compile/ObjectFiles/struct-b.c
5+
VAST :: vast/Compile/ObjectFiles/void-return-a.c
6+
VAST :: vast/Compile/SingleSource/argc.c
7+
VAST :: vast/Compile/SingleSource/argv-a.c
8+
VAST :: vast/Compile/SingleSource/fib-a.c
9+
VAST :: vast/Compile/SingleSource/global-a.c
10+
VAST :: vast/Compile/SingleSource/putchar-a.c
11+
VAST :: vast/Compile/SingleSource/puts-a.c
12+
VAST :: vast/Compile/SingleSource/strlit-a.c
13+
VAST :: vast/Conversion/Common/IRsToLLVM/bin_chain-a.c
14+
VAST :: vast/Conversion/Common/IRsToLLVM/cast-a.c
15+
VAST :: vast/Conversion/Common/IRsToLLVM/cast-b.cpp
16+
VAST :: vast/Conversion/Common/IRsToLLVM/cast-c.c
17+
VAST :: vast/Conversion/Common/IRsToLLVM/cast-d.c
18+
VAST :: vast/Conversion/Common/IRsToLLVM/cast-e.cpp
19+
VAST :: vast/Conversion/Common/IRsToLLVM/cast-f.c
20+
VAST :: vast/Conversion/Common/IRsToLLVM/cast-g.c
21+
VAST :: vast/Conversion/Common/IRsToLLVM/cast-h.c
22+
VAST :: vast/Conversion/Common/IRsToLLVM/cast-i.c
23+
VAST :: vast/Conversion/Common/IRsToLLVM/cast-j.c
24+
VAST :: vast/Conversion/Common/IRsToLLVM/signs.c
25+
VAST :: vast/Dialect/HighLevel/asm-c.c
26+
VAST :: vast/Dialect/HighLevel/attr-c.c
27+
VAST :: vast/Dialect/HighLevel/vararg-a.c
28+
VAST :: vast/Transform/HL/LowerTypes/vars-b.cpp
29+
30+
31+
Testing Time: 1.96s
32+
Unsupported: 14
33+
Passed : 219
34+
Failed : 27

0 commit comments

Comments
 (0)