aboutsummaryrefslogtreecommitdiffstats
path: root/lib/asn1/src/asn1ct_gen.erl
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2011-07-05 11:21:21 +0200
committerLukas Larsson <[email protected]>2011-08-01 16:37:59 +0200
commit3788f9e739b8468e35a772c501f990f7d8309adb (patch)
treeacee1460bd7fcc00bba24288a62428afc3d8d65d /lib/asn1/src/asn1ct_gen.erl
parent43cb29816f5b4d3b67ef83644f2ea30fa5cadac5 (diff)
downloadotp-3788f9e739b8468e35a772c501f990f7d8309adb.tar.gz
otp-3788f9e739b8468e35a772c501f990f7d8309adb.tar.bz2
otp-3788f9e739b8468e35a772c501f990f7d8309adb.zip
Add support for nif option to optimized PER asn1 compilation
Diffstat (limited to 'lib/asn1/src/asn1ct_gen.erl')
-rw-r--r--lib/asn1/src/asn1ct_gen.erl8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/asn1/src/asn1ct_gen.erl b/lib/asn1/src/asn1ct_gen.erl
index e49829d82f..e7f59c3d3c 100644
--- a/lib/asn1/src/asn1ct_gen.erl
+++ b/lib/asn1/src/asn1ct_gen.erl
@@ -936,15 +936,19 @@ pgen_dispatcher(Erules,_Module,{Types,_Values,_,_,_Objects,_ObjectSets}) ->
emit(["encoding_rule() ->",nl]),
emit([" ",{asis,Erules},".",nl,nl]),
NoFinalPadding = lists:member(no_final_padding,get(encoding_options)),
+ Nif = lists:member(nif,get(encoding_options)) andalso
+ lists:member(optimize,get(encoding_options)),
Call = case Erules of
per -> "?RT_PER:complete(encode_disp(Type,Data))";
- per_bin -> "?RT_PER:complete(encode_disp(Type,Data))";
+ per_bin -> ["?RT_PER:complete(encode_disp(Type,Data)",
+ [",nif" || Nif == true],")"];
ber -> "encode_disp(Type,Data)";
ber_bin -> "encode_disp(Type,Data)";
ber_bin_v2 -> "encode_disp(Type,Data)";
uper_bin when NoFinalPadding == true ->
"?RT_PER:complete_NFP(encode_disp(Type,Data))";
- uper_bin -> "?RT_PER:complete(encode_disp(Type,Data))"
+ uper_bin -> ["?RT_PER:complete(encode_disp(Type,Data)",
+ [",nif" || Nif == true],")"]
end,
EncWrap = case Erules of
ber -> "wrap_encode(Bytes)";