PR c++/63925
[official-gcc.git] / gcc / resource.h
blob2865283c66f93a0886af7c4450240429a8f85435
1 /* Definitions for computing resource usage of specific insns.
2 Copyright (C) 1999-2014 Free Software Foundation, Inc.
4 This file is part of GCC.
6 GCC is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free
8 Software Foundation; either version 3, or (at your option) any later
9 version.
11 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 for more details.
16 You should have received a copy of the GNU General Public License
17 along with GCC; see the file COPYING3. If not see
18 <http://www.gnu.org/licenses/>. */
20 #ifndef GCC_RESOURCE_H
21 #define GCC_RESOURCE_H
23 #include "hard-reg-set.h"
24 #include "df.h"
26 /* Macro to clear all resources. */
27 #define CLEAR_RESOURCE(RES) \
28 do { (RES)->memory = (RES)->volatil = (RES)->cc = 0; \
29 CLEAR_HARD_REG_SET ((RES)->regs); } while (0)
31 /* The resources used by a given insn. */
32 struct resources
34 char memory; /* Insn sets or needs a memory location. */
35 char volatil; /* Insn sets or needs a volatile memory loc. */
36 char cc; /* Insn sets or needs the condition codes. */
37 HARD_REG_SET regs; /* Which registers are set or needed. */
40 /* The kinds of rtl mark_*_resources will consider */
41 enum mark_resource_type
43 MARK_SRC_DEST = 0,
44 MARK_SRC_DEST_CALL = 1
47 extern void mark_target_live_regs (rtx_insn *, rtx, struct resources *);
48 extern void mark_set_resources (rtx, struct resources *, int,
49 enum mark_resource_type);
50 extern void mark_referenced_resources (rtx, struct resources *, bool);
51 extern void clear_hashed_info_for_insn (rtx_insn *);
52 extern void incr_ticks_for_insn (rtx_insn *);
53 extern void mark_end_of_function_resources (rtx, bool);
54 extern void init_resource_info (rtx_insn *);
55 extern void free_resource_info (void);
57 #endif /* GCC_RESOURCE_H */