Add some missing static and const qualifiers, reg_names only used if NDEBUG set

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5421 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
blueswir1 2008-10-05 09:59:14 +00:00
parent d9b630fdb0
commit d4a9eb1fc6
7 changed files with 32 additions and 15 deletions

View File

@ -21,7 +21,9 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
const char *tcg_target_reg_names[TCG_TARGET_NB_REGS] = {
#ifndef NDEBUG
static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = {
"%r0",
"%r1",
"%r2",
@ -38,8 +40,9 @@ const char *tcg_target_reg_names[TCG_TARGET_NB_REGS] = {
"%r13",
"%r14",
};
#endif
int tcg_target_reg_alloc_order[] = {
static const int tcg_target_reg_alloc_order[] = {
TCG_REG_R0,
TCG_REG_R1,
TCG_REG_R2,
@ -57,10 +60,10 @@ int tcg_target_reg_alloc_order[] = {
TCG_REG_R14,
};
const int tcg_target_call_iarg_regs[4] = {
static const int tcg_target_call_iarg_regs[4] = {
TCG_REG_R0, TCG_REG_R1, TCG_REG_R2, TCG_REG_R3
};
const int tcg_target_call_oarg_regs[2] = {
static const int tcg_target_call_oarg_regs[2] = {
TCG_REG_R0, TCG_REG_R1
};
@ -91,7 +94,7 @@ static inline int tcg_target_get_call_iarg_regs_count(int flags)
}
/* parse target specific constraints */
int target_parse_constraint(TCGArgConstraint *ct, const char **pct_str)
static int target_parse_constraint(TCGArgConstraint *ct, const char **pct_str)
{
const char *ct_str;

View File

@ -22,6 +22,7 @@
* THE SOFTWARE.
*/
#ifndef NDEBUG
static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = {
"%r0",
"%r1",
@ -56,6 +57,7 @@ static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = {
"%sp",
"%r31",
};
#endif
static const int tcg_target_reg_alloc_order[] = {
TCG_REG_R4,
@ -106,7 +108,7 @@ static inline int tcg_target_get_call_iarg_regs_count(int flags)
}
/* parse target specific constraints */
int target_parse_constraint(TCGArgConstraint *ct, const char **pct_str)
static int target_parse_constraint(TCGArgConstraint *ct, const char **pct_str)
{
const char *ct_str;

View File

@ -21,7 +21,9 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
const char *tcg_target_reg_names[TCG_TARGET_NB_REGS] = {
#ifndef NDEBUG
static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = {
"%eax",
"%ecx",
"%edx",
@ -31,8 +33,9 @@ const char *tcg_target_reg_names[TCG_TARGET_NB_REGS] = {
"%esi",
"%edi",
};
#endif
int tcg_target_reg_alloc_order[] = {
static const int tcg_target_reg_alloc_order[] = {
TCG_REG_EAX,
TCG_REG_EDX,
TCG_REG_ECX,
@ -42,8 +45,8 @@ int tcg_target_reg_alloc_order[] = {
TCG_REG_EBP,
};
const int tcg_target_call_iarg_regs[3] = { TCG_REG_EAX, TCG_REG_EDX, TCG_REG_ECX };
const int tcg_target_call_oarg_regs[2] = { TCG_REG_EAX, TCG_REG_EDX };
static const int tcg_target_call_iarg_regs[3] = { TCG_REG_EAX, TCG_REG_EDX, TCG_REG_ECX };
static const int tcg_target_call_oarg_regs[2] = { TCG_REG_EAX, TCG_REG_EDX };
static uint8_t *tb_ret_addr;
@ -80,7 +83,7 @@ static inline int tcg_target_get_call_iarg_regs_count(int flags)
}
/* parse target specific constraints */
int target_parse_constraint(TCGArgConstraint *ct, const char **pct_str)
static int target_parse_constraint(TCGArgConstraint *ct, const char **pct_str)
{
const char *ct_str;

View File

@ -39,6 +39,7 @@ static uint8_t *tb_ret_addr;
#define ADDEND_OFFSET 4
#endif
#ifndef NDEBUG
static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = {
"r0",
"r1",
@ -73,6 +74,7 @@ static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = {
"r30",
"r31"
};
#endif
static const int tcg_target_reg_alloc_order[] = {
TCG_REG_R14,

View File

@ -42,6 +42,7 @@ static uint8_t *tb_ret_addr;
#define CMP_L (1<<21)
#endif
#ifndef NDEBUG
static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = {
"r0",
"r1",
@ -76,6 +77,7 @@ static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = {
"r30",
"r31"
};
#endif
static const int tcg_target_reg_alloc_order[] = {
TCG_REG_R14,

View File

@ -22,6 +22,7 @@
* THE SOFTWARE.
*/
#ifndef NDEBUG
static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = {
"%g0",
"%g1",
@ -56,6 +57,7 @@ static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = {
"%i6",
"%i7",
};
#endif
static const int tcg_target_reg_alloc_order[] = {
TCG_REG_L0,

View File

@ -21,7 +21,9 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
const char *tcg_target_reg_names[TCG_TARGET_NB_REGS] = {
#ifndef NDEBUG
static const char * const tcg_target_reg_names[TCG_TARGET_NB_REGS] = {
"%rax",
"%rcx",
"%rdx",
@ -39,8 +41,9 @@ const char *tcg_target_reg_names[TCG_TARGET_NB_REGS] = {
"%r14",
"%r15",
};
#endif
int tcg_target_reg_alloc_order[] = {
static const int tcg_target_reg_alloc_order[] = {
TCG_REG_RDI,
TCG_REG_RSI,
TCG_REG_RDX,
@ -59,7 +62,7 @@ int tcg_target_reg_alloc_order[] = {
TCG_REG_R15,
};
const int tcg_target_call_iarg_regs[6] = {
static const int tcg_target_call_iarg_regs[6] = {
TCG_REG_RDI,
TCG_REG_RSI,
TCG_REG_RDX,
@ -68,7 +71,7 @@ const int tcg_target_call_iarg_regs[6] = {
TCG_REG_R9,
};
const int tcg_target_call_oarg_regs[2] = {
static const int tcg_target_call_oarg_regs[2] = {
TCG_REG_RAX,
TCG_REG_RDX
};