[ddc] Removing some references to "legacy" DDC modules.

"DDC" is now the accepted name for the module system.

Change-Id: I655219ccc7cff7ff99b1311518ef6ed6e7d1b2a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348085
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
diff --git a/pkg/dev_compiler/lib/src/compiler/module_builder.dart b/pkg/dev_compiler/lib/src/compiler/module_builder.dart
index 5ad6ef8..d9d4252 100644
--- a/pkg/dev_compiler/lib/src/compiler/module_builder.dart
+++ b/pkg/dev_compiler/lib/src/compiler/module_builder.dart
@@ -82,7 +82,6 @@
 Program transformModuleFormat(ModuleFormat format, Program module) {
   switch (format) {
     case ModuleFormat.ddc:
-      // Legacy format always generates output compatible with single file mode.
       return DdcModuleBuilder().build(module);
     case ModuleFormat.common:
       return CommonJSModuleBuilder().build(module);
@@ -108,7 +107,6 @@
     List<ModuleItem> items, Fun function, ModuleFormat format) {
   switch (format) {
     case ModuleFormat.ddc:
-      // Legacy format always generates output compatible with single file mode.
       return DdcModuleBuilder().buildFunctionWithImports(items, function);
     case ModuleFormat.amd:
       return AmdModuleBuilder().buildFunctionWithImports(items, function);
diff --git a/pkg/dev_compiler/lib/src/compiler/shared_command.dart b/pkg/dev_compiler/lib/src/compiler/shared_command.dart
index 4b29188..ef3f2df 100644
--- a/pkg/dev_compiler/lib/src/compiler/shared_command.dart
+++ b/pkg/dev_compiler/lib/src/compiler/shared_command.dart
@@ -304,7 +304,7 @@
       modulePath = summaryPath.substring(equalSign + 1);
       summaryPath = summaryPath.substring(0, equalSign);
     } else if (moduleRoot != null && p.isWithin(moduleRoot, summaryPath)) {
-      // TODO(jmesserly): remove this, it's legacy --module-root support.
+      // TODO: Determine if this logic is still needed.
       modulePath = p.url.joinAll(
           p.split(p.relative(summaryPathWithoutExt, from: moduleRoot)));
     } else {
diff --git a/pkg/dev_compiler/test/worker/worker_test.dart b/pkg/dev_compiler/test/worker/worker_test.dart
index c415e45..b6652aa 100644
--- a/pkg/dev_compiler/test/worker/worker_test.dart
+++ b/pkg/dev_compiler/test/worker/worker_test.dart
@@ -144,10 +144,10 @@
       expect(outputJsFile.existsSync(), isTrue);
     });
 
-    test('can compile in basic mode with "legacy" modules', () async {
+    test('can compile in basic mode with DDC modules', () async {
       var args = List<String>.from(executableArgs)
         ..add('--modules')
-        ..add('legacy')
+        ..add('ddc')
         ..addAll(compilerArgs);
       var result = Process.runSync(Platform.executable, args);
 
diff --git a/pkg/dev_compiler/tool/ddb b/pkg/dev_compiler/tool/ddb
index b72a75c..189a0f2 100755
--- a/pkg/dev_compiler/tool/ddb
+++ b/pkg/dev_compiler/tool/ddb
@@ -219,7 +219,7 @@
       break;
     case 'd8':
       d8 = true;
-      mod = 'legacy';
+      mod = 'ddc';
       break;
     case 'chrome':
       chrome = true;
diff --git a/pkg/test_runner/lib/src/compiler_configuration.dart b/pkg/test_runner/lib/src/compiler_configuration.dart
index f626405..968959f 100644
--- a/pkg/test_runner/lib/src/compiler_configuration.dart
+++ b/pkg/test_runner/lib/src/compiler_configuration.dart
@@ -698,14 +698,14 @@
     args.addAll([
       "--ignore-unrecognized-flags",
       "--no-summarize",
-      if (d8Runtime) "--modules=legacy",
+      if (d8Runtime) "--modules=ddc",
       "-o",
       outputFile,
       inputFile,
     ]);
 
     if (!d8Runtime) {
-      // TODO(sigmund): allow caching of shared packages in legacy mode too.
+      // TODO(sigmund): allow caching of shared packages for DDC modules too.
       // Link to the summaries for the available packages, so that they don't
       // get recompiled into the test's own module.
       for (var package in testPackages) {
diff --git a/tests/dartdevc/debugger/debugger_test.dart b/tests/dartdevc/debugger/debugger_test.dart
index a490fec..4cb4629 100644
--- a/tests/dartdevc/debugger/debugger_test.dart
+++ b/tests/dartdevc/debugger/debugger_test.dart
@@ -57,7 +57,7 @@
 @JS('JSON.stringify')
 external stringify(value, [Function replacer, int space]);
 
-// TODO(jacobr): this is only valid if the legacy library loader is used.
+// TODO(jacobr): this is only valid if the DDC library loader is used.
 // We need a solution that works with all library loaders.
 @JS('dart_library.import')
 external importDartLibrary(String path);
diff --git a/utils/ddc/BUILD.gn b/utils/ddc/BUILD.gn
index 1ef0216..faed4e8 100644
--- a/utils/ddc/BUILD.gn
+++ b/utils/ddc/BUILD.gn
@@ -440,8 +440,8 @@
       "$js_gen_dir/common/dart_sdk.js.map",
       "$js_gen_dir/es6/dart_sdk.js",
       "$js_gen_dir/es6/dart_sdk.js.map",
-      "$js_gen_dir/legacy/dart_sdk.js",
-      "$js_gen_dir/legacy/dart_sdk.js.map",
+      "$js_gen_dir/ddc/dart_sdk.js",
+      "$js_gen_dir/ddc/dart_sdk.js.map",
     ]
 
     vm_args = [ "-Dsdk_hash=$sdk_hash" ]
@@ -473,9 +473,9 @@
       "-o",
       rebase_path("$js_gen_dir/es6/dart_sdk.js"),
       "--modules",
-      "legacy",
+      "ddc",
       "-o",
-      rebase_path("$js_gen_dir/legacy/dart_sdk.js"),
+      rebase_path("$js_gen_dir/ddc/dart_sdk.js"),
       rebase_path("$platform_input"),
     ]