mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Move the injection of the prelude compile to the driver. (#3877)
The `file_test` layer still adds it to the VFS and filters it from the dump output, but the driver now injects it into the compilation unites depending on the `--import-prelude` file (enabled by default). This doesn't address improvements to how we find the prelude code, just sinking the needed logic into the driver itself.
This commit is contained in:
@@ -52,11 +52,14 @@ class ToolchainFileTest : public FileTestBase {
|
||||
llvm::SmallVector<std::string> args = {"compile",
|
||||
"--phase=" + component_.str()};
|
||||
|
||||
// For `lex` and `parse`, we don't need to import the prelude. Suppress it
|
||||
// to improve the dump output for the tests.
|
||||
if (component_ == "lex") {
|
||||
args.insert(args.end(), {"--dump-tokens", "%s"});
|
||||
args.insert(args.end(), {"--no-prelude-import", "--dump-tokens", "%s"});
|
||||
return args;
|
||||
} else if (component_ == "parse") {
|
||||
args.insert(args.end(), {"--dump-parse-tree", "%s"});
|
||||
args.insert(args.end(),
|
||||
{"--no-prelude-import", "--dump-parse-tree", "%s"});
|
||||
return args;
|
||||
}
|
||||
|
||||
@@ -69,8 +72,7 @@ class ToolchainFileTest : public FileTestBase {
|
||||
<< test_name();
|
||||
}
|
||||
|
||||
args.insert(args.end(), {"--exclude-dump-file-prefix=core/",
|
||||
"core/prelude.carbon", "%s"});
|
||||
args.insert(args.end(), {"--exclude-dump-file-prefix=core/", "%s"});
|
||||
return args;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user