1/*
2 * Copyright (C) 2016 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#if defined(DEFINE_INCLUDE_DEPENDENCIES)
18#include "base/bit_utils.h"       // MostSignificantBit
19#include "dex/modifiers.h"        // kAccClassIsFinalizable
20#endif
21
22#define DEFINE_FLAG_OFFSET(type_name, field_name, expr) \
23  DEFINE_EXPR(type_name ## _ ## field_name, uint32_t, (expr))
24
25DEFINE_FLAG_OFFSET(ACCESS_FLAGS, CLASS_IS_FINALIZABLE,     art::kAccClassIsFinalizable)
26DEFINE_FLAG_OFFSET(ACCESS_FLAGS, CLASS_IS_INTERFACE,       art::kAccInterface)
27// TODO: We should really have a BitPosition which also checks it's a power of 2.
28DEFINE_FLAG_OFFSET(ACCESS_FLAGS, CLASS_IS_FINALIZABLE_BIT, art::MostSignificantBit(art::kAccClassIsFinalizable))
29
30#undef DEFINE_FLAG_OFFSET
31