Skip to content

Commit 55523e5

Browse files
jensjohaCommit Queue
authored andcommitted
[CFE] Fix instrumenter so it works for aot
For a while it's been supported to do `dart compile aot-snapshot <dillfile>` meaning we can make the instrumentation thing run in aot too. Except we couldn't because it crashed if you tried. This CL sets up the dependency to the support library correctly (or at least correctly enough) so that it now works. Verified by doing ``` $ out/ReleaseX64/dart pkg/front_end/tool/flame/instrumenter.dart pkg/front_end/tool/compile.dart --count $ out/ReleaseX64/dart-sdk/bin/dart compile aot-snapshot pkg/front_end/tool/compile.dart.dill.instrumented.dill $ out/ReleaseX64/dart-sdk/bin/dartaotruntime pkg/front_end/tool/compile.dart.dill.instrumented.aot pkg/front_end/tool/compile.dart ``` Change-Id: I1d9b526b6ba2fed1ef81599fc9399041cc8b6522 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/439520 Commit-Queue: Jens Johansen <[email protected]> Reviewed-by: Chloe Stefantsova <[email protected]>
1 parent 97bc401 commit 55523e5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pkg/front_end/tool/flame/instrumenter.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,8 @@ void initializeAndReport(
432432
List<Procedure> procedures,
433433
List<Constructor> constructors,
434434
Procedure instrumenterReport) {
435+
mainProcedure.enclosingLibrary.dependencies
436+
.add(new LibraryDependency.import(initializeProcedure.enclosingLibrary));
435437
Block block = new Block([
436438
new ExpressionStatement(new StaticInvocation(initializeProcedure,
437439
config.createBeforeArguments(procedures, constructors))),

0 commit comments

Comments
 (0)