diff options
author | Björn Gustavsson <[email protected]> | 2017-11-13 12:56:31 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2017-11-13 12:56:31 +0100 |
commit | cde4ddc0494c9cdc8169dbc552e0e9b91c3a1b30 (patch) | |
tree | a074da76c9a829a488d5abb65aef0e63e36d2739 /lib/compiler/src/beam_asm.erl | |
parent | 32460151e9f4361425bae669cb1d58c8074a39b6 (diff) | |
parent | 9fc2d48a6de8b95b0d36c4439bff8e59710f4360 (diff) | |
download | otp-cde4ddc0494c9cdc8169dbc552e0e9b91c3a1b30.tar.gz otp-cde4ddc0494c9cdc8169dbc552e0e9b91c3a1b30.tar.bz2 otp-cde4ddc0494c9cdc8169dbc552e0e9b91c3a1b30.zip |
Merge branch 'bjorn/compiler/fix-deterministic-attribute/ERL-498' into maint
* bjorn/compiler/fix-deterministic-attribute/ERL-498:
Recognize 'deterministic' when given in a -compile() attribute
OTP-14773
Diffstat (limited to 'lib/compiler/src/beam_asm.erl')
-rw-r--r-- | lib/compiler/src/beam_asm.erl | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/compiler/src/beam_asm.erl b/lib/compiler/src/beam_asm.erl index c35efdfc9d..f7c838e392 100644 --- a/lib/compiler/src/beam_asm.erl +++ b/lib/compiler/src/beam_asm.erl @@ -182,7 +182,8 @@ build_file(Code, Attr, Dict, NumLabels, NumFuncs, ExtraChunks, SourceFile, Opts, Essentials1 = [iolist_to_binary(C) || C <- Essentials0], MD5 = module_md5(Essentials1), Essentials = finalize_fun_table(Essentials1, MD5), - {Attributes,Compile} = build_attributes(Opts, SourceFile, Attr, MD5), + {Attributes,Compile} = build_attributes(Opts, CompilerOpts, SourceFile, + Attr, MD5), AttrChunk = chunk(<<"Attr">>, Attributes), CompileChunk = chunk(<<"CInf">>, Compile), @@ -264,16 +265,16 @@ flatten_exports(Exps) -> flatten_imports(Imps) -> list_to_binary(map(fun({M,F,A}) -> <<M:32,F:32,A:32>> end, Imps)). -build_attributes(Opts, SourceFile, Attr, MD5) -> +build_attributes(Opts, CompilerOpts, SourceFile, Attr, MD5) -> Misc0 = case SourceFile of [] -> []; [_|_] -> [{source,SourceFile}] end, - Misc = case member(slim, Opts) of + Misc = case member(slim, CompilerOpts) of false -> Misc0; true -> [] end, - Compile = case member(deterministic, Opts) of + Compile = case member(deterministic, CompilerOpts) of false -> [{options,Opts},{version,?COMPILER_VSN}|Misc]; true -> |