Skip to content

Commit 3fa66fb

Browse files
Include OMR build flags in DDR macros
Change DDR getmacros script to pick up undef'd flags commented out by configure. Treat omrcfg.h as containing both values and flags so unset flags show up. Signed-off-by: mikezhang <[email protected]>
1 parent 9d3b07f commit 3fa66fb

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

ddr/tools/getmacros

+3-1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ default_regex="@ddr_namespace: *default"
3030
map_to_type_regex="@ddr_namespace: *map_to_type="
3131
flag_define_regex="^ *# *define +(${id}) *($|//|/\*)"
3232
flag_undef_regex="^ *# *undef +(${id}) *($|//|/\*)"
33+
flag_undef_regex_comment="^/\* #undef (${id}) \*/"
3334
value_define_regex="^ *# *define +(${id}) +[^ /].*($|//|/\*)"
3435
include_guard_regex=".*_[Hh]([Pp][Pp])?_? *($|//|/\*)"
3536

@@ -162,6 +163,7 @@ process_one_policy_file() {
162163
-e '/@ddr_namespace:/p' \
163164
-e '/^ *# *define /p' \
164165
-e '/^ *# *undef /p' \
166+
-e '/^\/\* #undef /p' \
165167
| while read -r line; do
166168
if [[ ${line} =~ ${default_regex} ]]; then
167169
set_default_namespaces
@@ -173,7 +175,7 @@ process_one_policy_file() {
173175
elif [[ ${addFlags} -ne 0 && ${line} =~ ${flag_define_regex} ]]; then
174176
# Print a define flag as a constant of 1.
175177
define_flag_macro "${BASH_REMATCH[1]}"
176-
elif [[ ${addFlags} -ne 0 && ${line} =~ ${flag_undef_regex} ]]; then
178+
elif [[ ${addFlags} -ne 0 && ${line} =~ ${flag_undef_regex} || ${line} =~ ${flag_undef_regex_comment} ]]; then
177179
# Print an undef flag as a constant of 0.
178180
undef_flag_macro "${BASH_REMATCH[1]}"
179181
fi

include_core/omrcfg.h.in

+4-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@
2929
#if !defined(OMRCFG_H_)
3030
#define OMRCFG_H_
3131

32-
/* @ddr_namespace: map_to_type=OmrBuildFlags */
32+
/**
33+
* @ddr_namespace: map_to_type=OmrBuildFlags
34+
* @ddr_options: valuesandbuildflags
35+
*/
3336

3437
#undef OMR_GC
3538
#undef OMR_JIT

omrcfg.CMakeTemplate.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@
2828
#if !defined(OMRCFG_H_)
2929
#define OMRCFG_H_
3030

31-
/* @ddr_namespace: map_to_type=OmrBuildFlags */
31+
/**
32+
* @ddr_namespace: map_to_type=OmrBuildFlags
33+
* @ddr_options: valuesandbuildflags
34+
*/
3235

3336
#cmakedefine OMR_GC
3437
#cmakedefine OMR_JIT

0 commit comments

Comments
 (0)