static bool isEqual(const NamingCheckId &LHS, const NamingCheckId &RHS) {
   if (RHS == getEmptyKey())
     return LHS == getEmptyKey();
   if (RHS == getTombstoneKey())
     return LHS == getTombstoneKey();
   return LHS == RHS;
 }
 static bool isEqual(NamingCheckId LHS, NamingCheckId RHS) {
   if (RHS == getEmptyKey())
     return LHS == getEmptyKey();
   if (RHS == getTombstoneKey())
     return LHS == getTombstoneKey();
   return LHS == RHS;
 }
Exemplo n.º 3
0
bool SymbolTable::AtomMappingInfo::isEqual(const DefinedAtom * const l,
                                           const DefinedAtom * const r) {
  if (l == r)
    return true;
  if (l == getEmptyKey())
    return false;
  if (r == getEmptyKey())
    return false;
  if (l == getTombstoneKey())
    return false;
  if (r == getTombstoneKey())
    return false;
  if (l->contentType() != r->contentType())
    return false;
  if (l->size() != r->size())
    return false;
  if (l->sectionChoice() != r->sectionChoice())
    return false;
  if (l->sectionChoice() == DefinedAtom::sectionCustomRequired) {
    if (!l->customSectionName().equals(r->customSectionName()))
      return false;
  }
  ArrayRef<uint8_t> lc = l->rawContent();
  ArrayRef<uint8_t> rc = r->rawContent();
  return memcmp(lc.data(), rc.data(), lc.size()) == 0;
}
  static unsigned getHashValue(NamingCheckId Val) {
    assert(Val != getEmptyKey() && "Cannot hash the empty key!");
    assert(Val != getTombstoneKey() && "Cannot hash the tombstone key!");

    std::hash<NamingCheckId::second_type> SecondHash;
    return Val.first.getRawEncoding() + SecondHash(Val.second);
  }
Exemplo n.º 5
0
bool SymbolTable::AtomMappingInfo::isEqual(const DefinedAtom * const l,
                                           const DefinedAtom * const r) {
  if (l == r)
    return true;
  if (l == getEmptyKey())
    return false;
  if (r == getEmptyKey())
    return false;
  if (l == getTombstoneKey())
    return false;
  if (r == getTombstoneKey())
    return false;
  if (l->contentType() != r->contentType())
    return false;
  if (l->size() != r->size())
    return false;
  ArrayRef<uint8_t> lc = l->rawContent();
  ArrayRef<uint8_t> rc = r->rawContent();
  return memcmp(lc.data(), rc.data(), lc.size()) == 0;
}
Exemplo n.º 6
0
 static unsigned getHashValue(CachedHashString Val) {
   assert(!isEqual(Val, getEmptyKey()) && "Cannot hash the empty key!");
   assert(!isEqual(Val, getTombstoneKey()) &&
          "Cannot hash the tombstone key!");
   return Val.hash();
 }
Exemplo n.º 7
0
 static bool isSpecial(pyston::BoxedString* v) { return v == getEmptyKey() || v == getTombstoneKey(); }