Permalink
Browse files

Add 'inbounds' as default in getelementptr and fix whitespace/comments

  • Loading branch information...
1 parent e0f2ee1 commit 82e25395c473dcac776dd421c3913c2451bff240 @yiannist committed Mar 26, 2012
Showing with 103 additions and 97 deletions.
  1. +4 −4 lib/hipe/llvm/hipe_llvm.erl
  2. +13 −11 lib/hipe/llvm/hipe_llvm.hrl
  3. +86 −82 lib/hipe/llvm/hipe_rtl2llvm.erl
@@ -381,8 +381,8 @@ store_volatile(#llvm_store{volatile=Volatile}) -> Volatile.
%% getelementptr
%%
mk_getelementptr(Dst, P_Type, Value, Typed_Idxs, Inbounds) ->
- #llvm_getelementptr{dst=Dst,p_type=P_Type, value=Value, typed_idxs=Typed_Idxs,
- inbounds=Inbounds}.
+ #llvm_getelementptr{dst=Dst,p_type=P_Type, value=Value,
+ typed_idxs=Typed_Idxs, inbounds=Inbounds}.
getelementptr_dst(#llvm_getelementptr{dst=Dst}) -> Dst.
getelementptr_p_type(#llvm_getelementptr{p_type=P_Type}) -> P_Type.
getelementptr_value(#llvm_getelementptr{value=Value}) -> Value.
@@ -493,7 +493,7 @@ call_fn_attrs(#llvm_call{fn_attrs=Fn_attrs}) -> Fn_attrs.
%% fun_def
%%
mk_fun_def(Linkage, Visibility, Cconv, Ret_attrs, Type, Name, Arglist,
- Fn_attrs, Align, Body) ->
+ Fn_attrs, Align, Body) ->
#llvm_fun_def{
linkage=Linkage,
visibility=Visibility,
@@ -654,7 +654,7 @@ pp_ins(Dev, I) ->
invoke_unwind_label(I), " \n"]);
#llvm_br_cond{} ->
write(Dev, ["br i1 ", br_cond_cond(I), ", label ", br_cond_true_label(I),
- ", label ", br_cond_false_label(I)]),
+ ", label ", br_cond_false_label(I)]),
case br_cond_meta(I) of
[] -> ok;
Metadata ->
@@ -1,12 +1,10 @@
%% -*- erlang-indent-level: 2 -*-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% Provides abstract datatypes for LLVM Assembly.
%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-%%---------------------------------------------------------------------
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Terminator Instructions
-record(llvm_ret, {ret_list=[]}).
@@ -15,19 +13,23 @@
-record(llvm_indirectbr, {type, address, label_list}).
-record(llvm_switch, {type, value, default_label, value_label_list=[]}).
-record(llvm_invoke, {dst, cconv=[], ret_attrs=[], type, fnptrval, arglist=[],
- fn_attrs=[], to_label, unwind_label}).
+ fn_attrs=[], to_label, unwind_label}).
+
%% Binary Operations
-record(llvm_operation, {dst, op, type, src1, src2, options=[]}).
+
%% Aggregate Operations
-record(llvm_extractvalue, {dst, type, val, idx, idxs=[]}).
-record(llvm_insertvalue, {dst, val_type, val, elem_type, elem, idx, idxs=[]}).
+
%% Memory Access And Addressing Operations
--record(llvm_alloca, {dst, type, num = [], align = []}).
--record(llvm_load, {dst, p_type, pointer, alignment = [], nontemporal = [],
- volatile = false}).
--record(llvm_store, {type, value, p_type, pointer, alignment = [], nontemporal = [],
- volatile = false}).
--record(llvm_getelementptr, {dst, p_type, value, typed_idxs = [], inbounds = false}).
+-record(llvm_alloca, {dst, type, num=[], align=[]}).
+-record(llvm_load, {dst, p_type, pointer, alignment=[], nontemporal=[],
+ volatile=false}).
+-record(llvm_store, {type, value, p_type, pointer, alignment=[],
+ nontemporal=[], volatile=false}).
+-record(llvm_getelementptr, {dst, p_type, value, typed_idxs, inbounds}).
+
%% Conversion Operations
-record(llvm_conversion, {dst, op, src_type, src, dst_type}).
-record(llvm_sitofp, {dst, src_type, src, dst_type}).
Oops, something went wrong.

0 comments on commit 82e2539

Please sign in to comment.