<commit_before>/**
 * Copyright (c) 2016-present, Facebook, Inc.
 * All rights reserved.
 *
 * This source code is licensed under the BSD-style license found in the
 * LICENSE file in the root directory of this source tree. An additional grant
 * of patent rights can be found in the PATENTS file in the same directory.
 */

#pragma once

#include "Pass.h"
#include "DexClass.h"
#include "DexUtil.h"
#include "Timer.h"
#include <vector>
#include <map>
#include <set>


using TypeSet = std::set<const DexType*>;

/**
 * DexType parent to children relationship
 * (child to parent is in DexClass)
 */
using ClassHierarchy = std::map<const DexType*, TypeSet>;

/**
 * Flags to mark virtual method state.
 * A combination of DexMethod::get_access(), those flags
 * and a SignatureMap should have a lot of what you need to
 * make decisions on how to operate on a method.
 * Ex:
 * VirtualFlags flags = ...;
 * flags == (see below)
 * TOP_DEF: first definition in the hierarchy, so where the
 *    method (virtual scope) was introduced
 * OVERRIDE: a child of a TOP_DEF
 * OVERRIDE | FINAL: a leaf method
 * TOP_DEF | FINAL: a method that is virtual only because
 *    of visibility but could be made static
 * IMPL | <one of the above>: the method contributes (lexically) to
 *    interface resolution
 * MIRANDA | <above>: the method is an implementation of an interface at the
 *    class with "implements". MIRANDA are created if they are not there and so
 *    they may or may not be concrete (is_concrete()). A class is
 *    guaranteed to have every 'implemented interface scope' rooted
 *    to a MIRANDA
 * ESCAPED | <above>: bad luck. Somewhere an interface could not be resolved
 *    and so we cannot tell anything about all methods in the branch where that
 *    happened. The method is effectively unknown
 */
enum VirtualFlags : uint16_t {
  // the top method definition (DexMehthod) in a VirtualScope.
  // This is where the method was first introduced for the virtual scope.
  TOP_DEF =         0x0,
  // the method is an override, it has a parent<commit_msg>fix non-determinism<commit_after>/**
 * Copyright (c) 2016-present, Facebook, Inc.
 * All rights reserved.
 *
 * This source code is licensed under the BSD-style license found in the
 * LICENSE file in the root directory of this source tree. An additional grant
 * of patent rights can be found in the PATENTS file in the same directory.
 */

#pragma once

#include "Pass.h"
#include "DexClass.h"
#include "DexUtil.h"
#include "Timer.h"
#include <vector>
#include <map>
#include <set>


using TypeSet = std::set<const DexType*>;

/**
 * DexType parent to children relationship
 * (child to parent is in DexClass)
 */
using ClassHierarchy = std::map<const DexType*, TypeSet, dextypes_comparator>;

/**
 * Flags to mark virtual method state.
 * A combination of DexMethod::get_access(), those flags
 * and a SignatureMap should have a lot of what you need to
 * make decisions on how to operate on a method.
 * Ex:
 * VirtualFlags flags = ...;
 * flags == (see below)
 * TOP_DEF: first definition in the hierarchy, so where the
 *    method (virtual scope) was introduced
 * OVERRIDE: a child of a TOP_DEF
 * OVERRIDE | FINAL: a leaf method
 * TOP_DEF | FINAL: a method that is virtual only because
 *    of visibility but could be made static
 * IMPL | <one of the above>: the method contributes (lexically) to
 *    interface resolution
 * MIRANDA | <above>: the method is an implementation of an interface at the
 *    class with "implements". MIRANDA are created if they are not there and so
 *    they may or may not be concrete (is_concrete()). A class is
 *    guaranteed to have every 'implemented interface scope' rooted
 *    to a MIRANDA
 * ESCAPED | <above>: bad luck. Somewhere an interface could not be resolved
 *    and so we cannot tell anything about all methods in the branch where that
 *    happened. The method is effectively unknown
 */
enum VirtualFlags : uint16_t {
  // the top method definition (DexMehthod) in a VirtualScope.
  // This is where the method was first introduced for the virtual scope.
  TOP_DEF =         0x0,
  // the method is an override, it has a parent
{'fraction_non_alphanumeric': 0.08155432957543776, 'fraction_numerical': 0.003837850803550012, 'mean_word_length': 3.562363238512035, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1169441', 'n_tokens_mistral': 1224, 'n_tokens_neox': 1170, 'n_words': 579}