quakeforge/tools/qfcc/include/target.h
Bill Currie a22d2a9526 [qfcc] Move guts of emit_function to per-target code
Ruamoko and v6(p) have their own copies despite being (currently) the
same, and spir-v's is currently empty, but now targeting spir-v doesn't
try to emit ruamoko code.
2024-10-26 23:30:37 +09:00

50 lines
1.3 KiB
C

/*
target.h
Shared data stuctures for backend targets.
Copyright (C) 2024 Bill Currie <bill@taniwha.org>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to:
Free Software Foundation, Inc.
59 Temple Place - Suite 330
Boston, MA 02111-1307, USA
*/
#ifndef __target_h
#define __target_h
typedef struct symbol_s symbol_t;
typedef struct type_s type_t;
typedef struct function_s function_t;
typedef struct expr_s expr_t;
typedef struct {
bool (*value_too_large) (const type_t *val_type);
void (*build_scope) (symbol_t *fsym);
void (*emit_function) (function_t *f, const expr_t *e);
} target_t;
extern target_t current_target;
extern target_t v6_target;
extern target_t v6p_target;
extern target_t ruamoko_target;
extern target_t spirv_target;
bool target_set_backend (const char *tgt);
#endif//__target_h