aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2015-05-11 14:45:12 +0200
committerBjörn Gustavsson <[email protected]>2015-05-21 15:15:23 +0200
commit242d0430103259398f87b088d8c3b0c8ba30124b (patch)
tree39b340537fb5e67626621907235772cacbc742e4 /lib/compiler
parentdd270f166ca6a9af0ec1705888a1a14355be1aa0 (diff)
downloadotp-242d0430103259398f87b088d8c3b0c8ba30124b.tar.gz
otp-242d0430103259398f87b088d8c3b0c8ba30124b.tar.bz2
otp-242d0430103259398f87b088d8c3b0c8ba30124b.zip
Don't make 'compiler' dependent on 'tools'
In a5d724cf240a, a debug option for running eprof on a specific compiler pass was added. That commit added a direct call to the eprof module in the tools application, and therefore the test case otp_SUITE:runtime_dependencies/1 would fail because xref would find a call to the tools application, but tools is not listed as a runtime dependency in compiler.app. Since the 'eprof' option is only likely to be used by compiler maintainers, we don't want a real dependency to the tools application. Therefore, use c:appcall/4 to hide the call to the eprof module (and to report the error nicely if the tools application is missing).
Diffstat (limited to 'lib/compiler')
-rw-r--r--lib/compiler/src/compile.erl6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/compiler/src/compile.erl b/lib/compiler/src/compile.erl
index 22810c910c..0158cf64db 100644
--- a/lib/compiler/src/compile.erl
+++ b/lib/compiler/src/compile.erl
@@ -342,10 +342,10 @@ run_tc({Name,Fun}, St) ->
run_eprof({Name,Fun}, Name, St) ->
io:format("~p: Running eprof\n", [Name]),
- eprof:start_profiling([self()]),
+ c:appcall(tools, eprof, start_profiling, [[self()]]),
Val = (catch Fun(St)),
- eprof:stop_profiling(),
- eprof:analyze(),
+ c:appcall(tools, eprof, stop_profiling, []),
+ c:appcall(tools, eprof, analyze, []),
Val;
run_eprof({_,Fun}, _, St) ->
catch Fun(St).