Alien-LibJIT
view release on metacpan or search on metacpan
libjit/jit/jit-dump.c view on Meta::CPAN
/*
* jit-dump.c - Functions for dumping JIT structures, for debugging.
*
* Copyright (C) 2004 Southern Storm Software, Pty Ltd.
*
* This file is part of the libjit library.
*
* The libjit library is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation, either version 2.1 of
* the License, or (at your option) any later version.
*
* The libjit library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with the libjit library. If not, see
* <http://www.gnu.org/licenses/>.
*/
#include "jit-internal.h"
#include "jit-rules.h"
#include <jit/jit-dump.h>
#ifdef HAVE_STDLIB_H
# include <stdlib.h>
#endif
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#if defined(JIT_BACKEND_INTERP)
# include "jit-interp.h"
#endif
/*@
@cindex jit-dump.h
@*/
/*@
* @deftypefun void jit_dump_type (FILE *@var{stream}, jit_type_t @var{type})
* Dump the name of a type to a stdio stream.
* @end deftypefun
@*/
void jit_dump_type(FILE *stream, jit_type_t type)
{
const char *name;
type = jit_type_remove_tags(type);
if(!type || !stream)
{
return;
}
switch(type->kind)
{
case JIT_TYPE_VOID: name = "void"; break;
case JIT_TYPE_SBYTE: name = "sbyte"; break;
case JIT_TYPE_UBYTE: name = "ubyte"; break;
case JIT_TYPE_SHORT: name = "short"; break;
case JIT_TYPE_USHORT: name = "ushort"; break;
( run in 0.633 second using v1.01-cache-2.11-cpan-02777c243ea )