Label.xcc

Benoit Dupont de Dinechin (Benoit.Dupont-de-Dinechin@st.com).

Copyright 2002 - 2007 STMicroelectronics. Copyright 1995 - 1998 Commissariat a l'Energie Atomique.

This program is free software; you can redistribute it and/or modify it under the terms of either (at your option): the GNU General Public License (GPL) version 2; the GNU Lesser General Public License (LGPL) version 2.1; any later version of these licences as published by the Free Software Foundation.

Label_Factory— IndexedFactory for Label(s).
extern IndexedFactory_ Label_Factory[1];
Label_NameCounter— Counter for the generated label names.
extern uint32_t Label_NameCounter;
Label— Implement a code label.
struct Label_ {
  //@args       uint32_t index, String name
  Indexed_ __;          // A Label_ ISA Indexed_.
  //@access IDENTITY    Indexed_IDENTITY(Label____(this))
  //@access INDEX       Indexed_INDEX(Label____(this))
  //@mutate INDEX       Indexed__INDEX(Label____(this))
  ImmediateValue VALUE;                 // The resolved value of this Label.
  String NAME;                          // This Label name.
};
Label_value— This Label value.
static inline ImmediateValue
Label_value(const_Label this)
{
  return Label_VALUE(this);
}
Label_setValue— Set this Label value.
static inline void
Label_setValue(Label this, ImmediateValue value)
{
  *Label__VALUE(this) = value;
}
Label_identity— This label identity.
static inline uint32_t
Label_identity(const_Label this)
{
  return Label_IDENTITY(this);
}
Label_name— This Label name.
static inline const char *
Label_name(const_Label this)
{
  return Label_NAME(this);
}
LabelTable— Symbol table for Label(s).
struct LabelTable_ {
  //@args       Memory memory, int32_t estimate
  StringStore_ STRINGS_;
  //@access STRINGS     LabelTable__STRINGS_(this)
  HTable_ HTABLE_;
  //@access HTABLE      LabelTable__HTABLE_(this)
  //@access MEMORY      HTable_memory(LabelTable_HTABLE(this))
  uint32_t INDEXGEN;    // The number used for generated Label keys.
};
LabelTable_htable— For use by LabelTable_FOREACH_Label.
static inline HTable
LabelTable_htable(LabelTable this)
{
  return LabelTable_HTABLE(this);
}
LabelTable_FOREACH_Label— Iterate this LabelTable.
#define LabelTable_FOREACH_Label(this, label) { \
  HTable LabelTable_HTABLE = LabelTable_htable(this); \
  HTable_FOREACH(LabelTable_HTABLE, LabelTable_KEY, Label_, label) {
#define LabelTable_ENDEACH_Label \
  } HTable_ENDEACH \
}
LabelTable_search— Search this LabelTable by index.
Label
LabelTable_search(LabelTable this, uint32_t index);
LabelTable_lookup— Lookup a new label into this LabelTable.
Label
LabelTable_lookup(LabelTable this, uint32_t index, const char *name);
LabelTable_insert— Insert a new label into this LabelTable.
Return
NULL if a label with this index already exists.
Label
LabelTable_insert(LabelTable this, uint32_t index, const char *name);
LabelTable_makeLabel— Make a new anonymous label.

The index generated for the new label has the 8 low bits cleared, to ensure they will not collide with any cgir_lab passed in.

Label
LabelTable_makeLabel(LabelTable this);
LabelVariant_— Label(s) for BasicBlock (95% of BasicBlock(s) have 0 or 1 Label).
union LabelVariant_ {
  Label LABEL;                          // Case of zero or one Label.
  Label *LABELS;                        // Points to array of Label(s).
};
typedef union LabelVariant_ LabelVariant_, *LabelVariant;