blob: 1310103ab761dc27f3ae85becde30bf55ea610ed [file] [log] [blame]
Igor Murashkin311fdf52016-07-22 15:59:16 -07001/*
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)
Igor Murashkin311fdf52016-07-22 15:59:16 -070018#include "base/bit_utils.h" // MostSignificantBit
David Sehr8c0961f2018-01-23 16:11:38 -080019#include "dex/modifiers.h" // kAccClassIsFinalizable
Igor Murashkin311fdf52016-07-22 15:59:16 -070020#endif
21
22#define DEFINE_FLAG_OFFSET(type_name, field_name, expr) \
23 DEFINE_EXPR(type_name ## _ ## field_name, uint32_t, (expr))
24
Igor Murashkin311fdf52016-07-22 15:59:16 -070025DEFINE_FLAG_OFFSET(ACCESS_FLAGS, CLASS_IS_FINALIZABLE, art::kAccClassIsFinalizable)
Mathieu Chartier2ecfd272016-11-01 10:10:05 -070026DEFINE_FLAG_OFFSET(ACCESS_FLAGS, CLASS_IS_INTERFACE, art::kAccInterface)
Igor Murashkin311fdf52016-07-22 15:59:16 -070027// 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