bevarargs.h 1.2 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14
/*
 * This file is part of libFirm.
 * Copyright (C) 2015 University of Karlsruhe.
 */

/**
 * @file
 * @brief   Default (pointer-based) implementation of variadic functions
 * @author  Andreas Fried
 */

#ifndef FIRM_BE_BEVARARGS_H
#define FIRM_BE_BEVARARGS_H

15
#include "be.h"
16
#include "firm_types.h"
Matthias Braun's avatar
Matthias Braun committed
17
#include <stdbool.h>
18

19 20 21
/**
 * Default implementation to lower a va_arg node.
 *
Matthias Braun's avatar
Matthias Braun committed
22 23 24 25
 * If \p compound_is_ptr is true, then this implementation assumes that all
 * arguments except compound types are stored on the stack and that the va_list
 * value points to the next variadic argument.  For compound types a pointer to
 * the object is stored on the stack.
26
 *
Matthias Braun's avatar
Matthias Braun committed
27 28 29
 * If \p compound_is_ptr is false, then this implementation assumes that all
 * arguments are stored on the stack and that the va_list value points to the
 * next variadic argument.
30 31 32
 *
 * @param node A Builtin node with kind ir_bk_va_arg to be lowered
 */
Matthias Braun's avatar
Matthias Braun committed
33 34
void be_default_lower_va_arg(ir_node *node, bool compound_is_ptr,
                             unsigned stack_param_align);
35

36 37
void be_set_va_list_type_pointer(backend_params *p);

38 39
ir_entity *be_make_va_start_entity(ir_type *frame_type, int offset);

40 41
void be_set_va_list_type_pointer(backend_params *p);

42
#endif