Example #1
0
  bool
is_index_scale_disp(Opnd opnd)
{
  return get_kind(opnd) == opnd::INDEX_SCALE_DISP;
}
Example #2
0
  bool
is_base_index(Opnd opnd)
{
  return get_kind(opnd) == opnd::BASE_INDEX;
}
Example #3
0
  bool
is_base_index_disp(Opnd opnd)
{
  return get_kind(opnd) == opnd::BASE_INDEX_DISP;
}
Example #4
0
  bool
is_index_sym_disp(Opnd opnd)
{
  return get_kind(opnd) == opnd::INDEX_SYM_DISP;
}
Example #5
0
  bool
is_base_disp(Opnd opnd)
{
  return get_kind(opnd) == opnd::BASE_DISP;
}
Example #6
0
  bool
is_virtual_reg(Opnd opnd)
{
  return get_kind(opnd) == opnd::REG_VIRTUAL;
}
Example #7
0
  bool
is_sym_disp(Opnd opnd)
{
  return get_kind(opnd) == opnd::SYM_DISP;
}
Example #8
0
param_kind param_descrs::get_kind(char const * name) const {
    return get_kind(symbol(name));
}
Example #9
0
  bool
is_hard_reg(Opnd opnd)
{
  return get_kind(opnd) == opnd::REG_HARD;
}
Example #10
0
static void findAsciidocTags(void)
{
	vString *name = vStringNew();
	const unsigned char *line;
	unsigned char in_block = '\0';  /* holds the block marking char or \0 if not in block */

	nestingLevels = nestingLevelsNew();

	while ((line = readLineFromInputFile()) != NULL)
	{
		int line_len = strlen((const char*) line);
		int name_len_bytes = vStringLength(name);
		int name_len = utf8_strlen(vStringValue(name), name_len_bytes);

		/* if the name doesn't look like UTF-8, assume one-byte charset */
		if (name_len < 0) name_len = name_len_bytes;
		
		/* if its a title underline, or a delimited block marking character */
		if (line[0] == '=' || line[0] == '-' || line[0] == '~' ||
			line[0] == '^' || line[0] == '+' || line[0] == '.' ||
			line[0] == '*' || line[0] == '_' || line[0] == '/')
		{
			int n_same;
			for (n_same = 1; line[n_same] == line[0]; ++n_same);
			
			/* is it a two line title or a delimited block */
			if (n_same == line_len)
			{
				/* if in a block, can't be block start or title, look for block end */
				if (in_block)
				{
					if (line[0] == in_block) in_block = '\0';
				}
				
				/* if its a =_~^+ and the same length +-2 as the line before then its a title */
				/* (except in the special case its a -- open block start line) */
				else if ((line[0] == '=' || line[0] == '-' || line[0] == '~' ||
							line[0] == '^' || line[0] == '+') &&
						line_len <= name_len + 2 && line_len >= name_len - 2 &&
						!(line_len == 2 && line[0] == '-'))
				{
					int kind = get_kind((char)(line[0]));
					if (kind >= 0)
					{
						makeAsciidocTag(name, kind);
						continue;
					}
				}
				
				/* else if its 4 or more /+-.*_= (plus the -- special case) its a block start */
				else if (((line[0] == '/' || line[0] == '+' || line[0] == '-' ||
						   line[0] == '.' || line[0] == '*' || line[0] == '_' ||
						   line[0] == '=') && line_len >= 4 )
						 || (line[0] == '-' && line_len == 2))
				{
					in_block = line[0];
				}
			}
			
			/* otherwise is it a one line title */
			else if (line[0] == '=' && n_same <= 5 && isspace(line[n_same]) &&
					!in_block)
			{
				int kind = n_same - 1;
				int start = n_same;
				int end = line_len - 1;
				while (line[end] == line[0])--end;
				while (isspace(line[start]))++start;
				while (isspace(line[end]))--end;
				vStringClear(name);
				vStringNCatS(name, (const char*)(&(line[start])), end - start + 1);
				vStringTerminate(name);
				makeAsciidocTag(name, kind);
				continue;
			}
		}
		vStringClear(name);
		if (! isspace(*line))
			vStringCatS(name, (const char*) line);
		vStringTerminate(name);
	}
	vStringDelete(name);
	nestingLevelsFree(nestingLevels);
}
bool VariableType::operator<(const Type& other) {
	Type& o = (Type&) other;
	if(o.get_kind() != get_kind()) return get_kind() < o.get_kind();
	VariableType& ct = static_cast<VariableType&>(o);
	return name < ct.name;
}
Example #12
0
void sexpr::display_atom(std::ostream & out) const {
    switch (get_kind()) {
    case sexpr::COMPOSITE:
        UNREACHABLE();
    case sexpr::NUMERAL:
        out << static_cast<sexpr_numeral const *>(this)->m_val;
        break;
    case sexpr::BV_NUMERAL: {
        out << '#';
        unsigned bv_size = static_cast<sexpr_bv const *>(this)->m_size;
        rational val  = static_cast<sexpr_bv const *>(this)->m_val;
        sbuffer<char> buf;
        unsigned sz = 0;
        if (bv_size % 4 == 0) {
            out << 'x';
            while (val.is_pos()) {
                rational c = val % rational(16);
                val = div(val, rational(16));
                SASSERT(rational(0) <= c && c < rational(16));
                if (c <= rational(9))
                    buf.push_back('0' + c.get_unsigned());
                else
                    buf.push_back('a' + (c.get_unsigned() - 10));
                sz+=4;
            }
            while (sz < bv_size) {
                buf.push_back('0');
                sz+=4;
            }
        }
        else {
            out << 'b';
            while (val.is_pos()) {
                rational c = val % rational(2);
                val = div(val, rational(2));
                SASSERT(rational(0) <= c && c < rational(2));
                if (c.is_zero())
                    buf.push_back('0');
                else
                    buf.push_back('1');
                sz += 1;
            }
            while (sz < bv_size) {
                buf.push_back('0');
                sz += 1;
            }
        }
        std::reverse(buf.begin(), buf.end());
        buf.push_back(0);
        out << buf.c_ptr();
        break;
    }
    case sexpr::STRING:
        out << "\"" << escaped(static_cast<sexpr_string const *>(this)->m_val.c_str()) << "\"";
        break;
    case sexpr::SYMBOL:
    case sexpr::KEYWORD:
        out << static_cast<sexpr_symbol const *>(this)->m_val;
        break;
    default:
        UNREACHABLE();
    }
}
Example #13
0
int is_mode(const void *thing)
{
    return get_kind(thing) == k_ir_mode;
}
Example #14
0
 void product_relation_plugin::initialize(family_id fid) { 
     relation_plugin::initialize(fid);
     m_spec_store.add_available_kind(get_kind());
 }