aboutsummaryrefslogtreecommitdiffstats
path: root/lib/hipe/misc/hipe_consttab.erl
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2016-05-26 14:36:52 +0200
committerSverker Eriksson <[email protected]>2016-05-26 14:36:52 +0200
commit89adc0eec23c1a3ac552650004863de4cf82422e (patch)
tree141a582f3f52290cb07cfd797d8295fc2f094d58 /lib/hipe/misc/hipe_consttab.erl
parent4d7b24dcb8f10ea8ddaa002601916fb389f0e87e (diff)
parent8914b835d26cc3b513eaef0a19cd9b39d1d2ccae (diff)
downloadotp-89adc0eec23c1a3ac552650004863de4cf82422e.tar.gz
otp-89adc0eec23c1a3ac552650004863de4cf82422e.tar.bz2
otp-89adc0eec23c1a3ac552650004863de4cf82422e.zip
Merge branch 'margnus1/llvm-compatibility/PR-1057/OTP-13626'
Diffstat (limited to 'lib/hipe/misc/hipe_consttab.erl')
-rw-r--r--lib/hipe/misc/hipe_consttab.erl13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/hipe/misc/hipe_consttab.erl b/lib/hipe/misc/hipe_consttab.erl
index f361edc79c..226b20fa46 100644
--- a/lib/hipe/misc/hipe_consttab.erl
+++ b/lib/hipe/misc/hipe_consttab.erl
@@ -87,7 +87,8 @@
% {NewTab, Lbl}
insert_sorted_block/4,
insert_block/3,
- %% insert_global_word/2,
+ insert_binary_const/3,
+ %% insert_global_word/2,
%% insert_global_block/4,
%% update_word/3, % update_word(ConstTab, Value) -> {NewTab, Lbl}
%% update_block/5,
@@ -196,6 +197,16 @@ insert_block({ConstTab, RefToLabels, NextLabel}, ElementType, InitList) ->
{ElementType,InitList}),
{insert_backrefs(NewTa, Id, ReferredLabels), Id}.
+%% @doc Inserts a binary constant literal into the const table.
+-spec insert_binary_const(hipe_consttab(), ct_alignment(), binary()) ->
+ {hipe_consttab(), hipe_constlbl()}.
+insert_binary_const(ConstTab, Alignment, Binary)
+ when (Alignment =:= 4 orelse Alignment =:= 8 orelse Alignment =:= 16
+ orelse Alignment =:= 32), is_binary(Binary),
+ size(Binary) rem Alignment =:= 0 ->
+ insert_const(ConstTab, block, Alignment, false,
+ {byte, binary_to_list(Binary)}).
+
%% @spec (ConstTab::hipe_consttab(), ElementType::element_type(),
%% InitList::block(), SortOrder) -> {hipe_consttab(), hipe_constlbl()}