#include "gallivm/lp_bld.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
struct lp_type;
LLVMValueRef end,
LLVMValueRef step);
+void
+lp_build_loop_force_set_counter(struct lp_build_loop_state *state,
+ LLVMValueRef end);
+
+void
+lp_build_loop_force_reload_counter(struct lp_build_loop_state *state);
void
lp_build_loop_end_cond(struct lp_build_loop_state *state,
LLVMValueRef end,
LLVMIntPredicate cond);
+/**
+ * Implementation of simple C-style for loops
+ */
+struct lp_build_for_loop_state
+{
+ LLVMBasicBlockRef begin;
+ LLVMBasicBlockRef body;
+ LLVMBasicBlockRef exit;
+ LLVMValueRef counter_var;
+ LLVMValueRef counter;
+ LLVMValueRef step;
+ LLVMIntPredicate cond;
+ LLVMValueRef end;
+ struct gallivm_state *gallivm;
+};
+
+void
+lp_build_for_loop_begin(struct lp_build_for_loop_state *state,
+ struct gallivm_state *gallivm,
+ LLVMValueRef start,
+ LLVMIntPredicate llvm_cond,
+ LLVMValueRef end,
+ LLVMValueRef step);
+
+void
+lp_build_for_loop_end(struct lp_build_for_loop_state *state);
+
/**
* if/else/endif.
LLVMTypeRef type,
const char *name);
+LLVMValueRef
+lp_build_alloca_undef(struct gallivm_state *gallivm,
+ LLVMTypeRef type,
+ const char *name);
+
LLVMValueRef
lp_build_array_alloca(struct gallivm_state *gallivm,
LLVMTypeRef type,
LLVMValueRef count,
const char *name);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* !LP_BLD_FLOW_H */