Skip to content

Commit 9e95988

Browse files
nshahanathomas
authored andcommitted
[stable][ddc] Add new name for ddc compiler
* The new compiler name "ddc" will be used for all configurations in an upcoming change. * Aliases "dartdevc" and "dartdevk" will be removed in the future. Issue: #51481 Cherry-pick: https://dart-review.googlesource.com/c/sdk/+/280862 Change-Id: Icd81c63bff57911816a4e187a40e4a4012eead85 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284543 Reviewed-by: Alexander Thomas <[email protected]>
1 parent 0ec8740 commit 9e95988

24 files changed

+83
-54
lines changed

pkg/expect/lib/config.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ bool get isDart2WasmConfiguration =>
2626

2727
bool get isDdcConfiguration =>
2828
_configuration.compiler == Compiler.dartdevk ||
29-
_configuration.compiler == Compiler.dartdevc;
29+
_configuration.compiler == Compiler.dartdevc ||
30+
_configuration.compiler == Compiler.ddc;
3031

3132
bool get isVmJitConfiguration => _configuration.compiler == Compiler.dartk;
3233

pkg/smith/lib/configuration.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,7 @@ class Compiler extends NamedEnum {
639639
static const dart2wasm = Compiler._('dart2wasm');
640640
static const dartdevc = Compiler._('dartdevc');
641641
static const dartdevk = Compiler._('dartdevk');
642+
static const ddc = Compiler._('ddc');
642643
static const appJitk = Compiler._('app_jitk');
643644
static const dartk = Compiler._('dartk');
644645
static const dartkp = Compiler._('dartkp');
@@ -653,6 +654,7 @@ class Compiler extends NamedEnum {
653654
dart2wasm,
654655
dartdevc,
655656
dartdevk,
657+
ddc,
656658
appJitk,
657659
dartk,
658660
dartkp,
@@ -693,6 +695,7 @@ class Compiler extends NamedEnum {
693695

694696
case Compiler.dartdevc:
695697
case Compiler.dartdevk:
698+
case Compiler.ddc:
696699
return const [
697700
Runtime.none,
698701
Runtime.d8,
@@ -734,6 +737,7 @@ class Compiler extends NamedEnum {
734737
return Runtime.d8;
735738
case Compiler.dartdevc:
736739
case Compiler.dartdevk:
740+
case Compiler.ddc:
737741
return Runtime.chrome;
738742
case Compiler.dart2analyzer:
739743
return Runtime.none;
@@ -757,6 +761,7 @@ class Compiler extends NamedEnum {
757761
case Compiler.dart2wasm:
758762
case Compiler.dartdevc:
759763
case Compiler.dartdevk:
764+
case Compiler.ddc:
760765
case Compiler.fasta:
761766
return Mode.release;
762767

pkg/smith/test/configuration_test.dart

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -354,8 +354,8 @@ void main() {
354354
});
355355

356356
group("visualCompare()", () {
357-
var a = Configuration("dartdevc", Architecture.ia32, Compiler.dartdevc,
358-
Mode.debug, Runtime.chrome, System.android,
357+
var a = Configuration("ddc", Architecture.ia32, Compiler.ddc, Mode.debug,
358+
Runtime.chrome, System.android,
359359
builderTag: "a tag",
360360
vmOptions: ["vm a1", "vm a2"],
361361
dart2jsOptions: ["dart2js a1", "dart2js a2"],
@@ -392,10 +392,10 @@ void main() {
392392

393393
test("everything different", () {
394394
expect(a.visualCompare(b), equals("""
395-
dartdevc
395+
ddc
396396
dart2js
397397
architecture: ia32 x64
398-
compiler: dartdevc dart2js
398+
compiler: ddc dart2js
399399
mode: debug release
400400
runtime: chrome d8
401401
system: android fuchsia
@@ -423,10 +423,10 @@ architecture: ia32 x64
423423

424424
test("everything the same", () {
425425
expect(a.visualCompare(a), equals("""
426-
dartdevc
427-
dartdevc
426+
ddc
427+
ddc
428428
architecture: ia32 ia32
429-
compiler: dartdevc dartdevc
429+
compiler: ddc ddc
430430
mode: debug debug
431431
runtime: chrome chrome
432432
system: android android

pkg/test_runner/lib/src/browser.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,18 +129,18 @@ bool _invalidVariableName(String keyword, {bool strictMode = true}) {
129129
return false;
130130
}
131131

132-
/// Generates the HTML template file needed to load and run a dartdevc test in
132+
/// Generates the HTML template file needed to load and run a ddc test in
133133
/// the browser.
134134
///
135135
/// [testName] is the short name of the test without any subdirectory path
136136
/// or extension, like "math_test". [testNameAlias] is the alias of the
137137
/// test variable used for import/export (usually relative to its module root).
138138
/// [testJSDir] is the relative path to the build directory where the
139-
/// dartdevc-generated JS file is stored. [nonNullAsserts] enables non-null
139+
/// ddc-generated JS file is stored. [nonNullAsserts] enables non-null
140140
/// assertions for non-nullable method parameters when running with weak null
141141
/// safety. [weakNullSafetyErrors] enables null safety type violations to throw
142142
/// when running in weak mode.
143-
String dartdevcHtml(
143+
String ddcHtml(
144144
String testName,
145145
String testNameAlias,
146146
String testJSDir,

pkg/test_runner/lib/src/build_configurations.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ List<String> _selectBuildTargets(Configuration inner) {
8484
Compiler.appJitk: ['runtime'],
8585
Compiler.fasta: ['create_sdk', 'dartdevc_test', 'kernel_platform_files'],
8686
Compiler.dartdevk: ['dartdevc_test'],
87+
Compiler.ddc: ['dartdevc_test'],
8788
Compiler.dart2js: ['create_sdk'],
8889
Compiler.dart2analyzer: ['create_sdk', 'utils/dartanalyzer'],
8990
Compiler.specParser: <String>[],
@@ -96,7 +97,8 @@ List<String> _selectBuildTargets(Configuration inner) {
9697
result.add('gen_snapshot');
9798
}
9899

99-
if (compiler == Compiler.dartdevk && !inner.useSdk) {
100+
if ((compiler == Compiler.dartdevk || compiler == Compiler.ddc) &&
101+
!inner.useSdk) {
100102
result
101103
..remove('dartdevc_test')
102104
..add('dartdevc_test_local');

pkg/test_runner/lib/src/command_output.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1576,6 +1576,7 @@ mixin _StaticErrorOutput on CommandOutput {
15761576
Compiler.dart2wasm: ErrorSource.web,
15771577
Compiler.dartdevc: ErrorSource.web,
15781578
Compiler.dartdevk: ErrorSource.web,
1579+
Compiler.ddc: ErrorSource.web,
15791580
Compiler.fasta: ErrorSource.cfe
15801581
}[testCase.configuration.compiler]!;
15811582

pkg/test_runner/lib/src/compiler_configuration.dart

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,8 @@ abstract class CompilerConfiguration {
8787
return Dart2WasmCompilerConfiguration(configuration);
8888

8989
case Compiler.dartdevc:
90-
return DevCompilerConfiguration(configuration);
91-
9290
case Compiler.dartdevk:
91+
case Compiler.ddc:
9392
return DevCompilerConfiguration(configuration);
9493

9594
case Compiler.appJitk:
@@ -583,16 +582,17 @@ class Dart2WasmCompilerConfiguration extends CompilerConfiguration {
583582
}
584583
}
585584

586-
/// Configuration for `dartdevc` and `dartdevk` (DDC with Kernel)
585+
/// Configuration for "dartdevc", "dartdevk", and "ddc".
586+
// TODO(nshahan): Cleanup mulitple aliases for the compiler.
587587
class DevCompilerConfiguration extends CompilerConfiguration {
588588
DevCompilerConfiguration(TestConfiguration configuration)
589589
: super._subclass(configuration);
590590

591591
String computeCompilerPath() {
592-
// The compiler is a Dart program and not an executable itself, so the
593-
// command to spawn as a subprocess is a Dart VM. Internally the
594-
// [DevCompilerCompilationCommand] will prepend the snapshot or Dart library
595-
// entrypoint that is executed by the VM.
592+
// DDC is a Dart program and not an executable itself, so the command to
593+
// spawn as a subprocess is a Dart VM.
594+
// Internally the [DevCompilerCompilationCommand] will prepend the snapshot
595+
// or Dart library entrypoint that is executed by the VM.
596596
// This will change once we update the DDC to use AOT instead of a snapshot.
597597
var dir = _useSdk ? '${_configuration.buildDirectory}/dart-sdk' : 'sdk';
598598
return '$dir/bin/dart$executableExtension';

pkg/test_runner/lib/src/configuration.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ class TestConfiguration {
197197
Compiler.appJitk,
198198
Compiler.dartdevc,
199199
Compiler.dartdevk,
200+
Compiler.ddc,
200201
Compiler.dartk,
201202
Compiler.dartkp,
202203
Compiler.fasta,

pkg/test_runner/lib/src/options.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,9 @@ class OptionsParser {
7676
dart2js: Compile to JavaScript using dart2js.
7777
dart2analyzer: Perform static analysis on Dart code using the analyzer.
7878
compare_analyzer_cfe: Compare analyzer and common front end representations.
79-
dartdevc: Compile to JavaScript using dartdevc.
80-
dartdevk: Compile to JavaScript using dartdevc (same as dartdevc).
79+
ddc: Compile to JavaScript using dartdevc.
80+
dartdevc: Compile to JavaScript using dartdevc (same as ddc).
81+
dartdevk: Compile to JavaScript using dartdevc (same as ddc).
8182
app_jitk: Compile the Dart code into Kernel and then into an app
8283
snapshot.
8384
dartk: Compile the Dart code into Kernel before running test.

pkg/test_runner/lib/src/process_queue.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,7 @@ class CommandExecutorImpl implements CommandExecutor {
571571
(command.displayName == 'dart2js' ||
572572
command.displayName == 'dartdevc' ||
573573
command.displayName == 'dartdevk' ||
574+
command.displayName == 'ddc' ||
574575
command.displayName == 'fasta') &&
575576
globalConfiguration.batch) {
576577
return _getBatchRunner(command.displayName)

0 commit comments

Comments
 (0)