Skip to content

Fix multiple issues with ddrgen #2271

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 12, 2018
Merged

Conversation

keithc-ca
Copy link
Contributor

This is in support of eclipse-openj9/openj9#378.

Fixes & improvements

  • blacklist pattern matching
  • close list files
  • avoid typedef cycles
  • write proper enum size to blob
  • handle CR/LF line-ends reading a list files
  • pass const references
  • favour constructor use over assignment
  • formatting
  • improve safety
  • mark constructors explicit as appropriate
  • improve DEBUGPRINTF and ERRMSG macros and use consistent format
  • remove redundant or unnecessary #includes
  • add constructor for Dwarf_Attribute_s
  • add Dwarf_Attribute_s._flag
  • add dwarf_formflag() for OSX
  • omit static fields from expected superset.out
  • improve handling of vtable pointers
  • improve 'getmacros' script (and don't let it change timestamps)
  • use 'find' to avoid scanning unintersting files
  • pull regex definitions out of the inner loop
  • fix references to ddr/tools/getmacros
  • improve test code
  • add an example of map_to_type= without following whitespace
  • improve namespace handling
  • improve getmacros script
  • replace use of 'awk' with 'sed'
  • fix @macro emissions
  • tighten API of ddrgen
  • fix validation that macro values are constant
  • streamline MacroTool
  • fix constant evaluation (including numeric prefixes like '0x')
  • fix problem reading macrolist
  • use const types where appropriate
  • use canonical type expressions
  • make as many *.i files as possible
  • be careful constructing name to type map for macros
  • implicitly blacklist illegal type names
  • remove overloading in TypeVisitor
  • allow writing of blob and superset independently
  • simplify blacklist handling
  • make reading blacklist more robust
  • fix override support
  • fix handling of #undef by getmacros
  • ignore linkage_name DWARF attribute
  • add ClassType::_isComplete
  • construct all fields explicitly
  • relocate constants to J9HashtableConstants
  • repeat structure for typedef with distinct name

ddrgen

  • consider macros in ClassType
  • fix Type::renameFieldsAndMacros
  • don't require values for enum literals
  • don't trim trailing *[] from override value
  • generalize support for opaque types
  • include typedef with distinct name
  • new strategy for eliminating duplicate types
  • remove special handling for CLimits
  • remove unused _offset field in Modifiers
  • reset modifiers with field type override

Blob generation

  • don't duplicate fields in blob
  • extract common code
  • propagate failure to parent process

getmacros

  • fix handling of ddr_options: valuesandbuildflags
  • improve include guard detection
  • fix constant handling

would previously map to the following
(independent of whether A was defined or not)

@MACRO_A_DEFINED A_DEFINED 1
@MACRO_A_DEFINED A_DEFINED 0

Fixes & improvements
* blacklist pattern matching
* close list files
* avoid typedef cycles
* write proper enum size to blob
* handle CR/LF line-ends reading a list files
* pass const references
* favour constructor use over assignment
* formatting
* improve safety
* mark constructors explicit as appropriate
* improve DEBUGPRINTF and ERRMSG macros and use consistent format
* remove redundant or unnecessary #includes
* add constructor for Dwarf_Attribute_s
* add Dwarf_Attribute_s._flag
* add dwarf_formflag() for OSX
* omit static fields from expected superset.out
* improve handling of vtable pointers
* improve 'getmacros' script (and don't let it change timestamps)
* use 'find' to avoid scanning unintersting files
* pull regex definitions out of the inner loop
* fix references to ddr/tools/getmacros
* improve test code
* add an example of map_to_type= without following whitespace
* improve namespace handling
* improve getmacros script
* replace use of 'awk' with 'sed'
* fix @macro emissions
* tighten API of ddrgen
* fix validation that macro values are constant
* streamline MacroTool
* fix constant evaluation (including numeric prefixes like '0x')
* fix problem reading macrolist
* use const types where appropriate
* use canonical type expressions
* make as many *.i files as possible
* be careful constructing name to type map for macros
* implicitly blacklist illegal type names
* remove overloading in TypeVisitor
* allow writing of blob and superset independently
* simplify blacklist handling
* make reading blacklist more robust
* fix override support
* fix handling of #undef by getmacros
* ignore linkage_name DWARF attribute
* add ClassType::_isComplete
* construct all fields explicitly
* relocate constants to J9HashtableConstants
* repeat structure for typedef with distinct name

ddrgen
* consider macros in ClassType
* fix Type::renameFieldsAndMacros
* don't require values for enum literals
* don't trim trailing *[] from override value
* generalize support for opaque types
* include typedef with distinct name
* new strategy for eliminating duplicate types
* remove special handling for CLimits
* remove unused _offset field in Modifiers
* reset modifiers with field type override

Blob generation
* don't duplicate fields in blob
* extract common code
* propagate failure to parent process

getmacros
* fix handling of ddr_options: valuesandbuildflags
* improve include guard detection
* fix constant handling

would previously map to the following
(independent of whether A was defined or not)
```
@MACRO_A_DEFINED A_DEFINED 1
@MACRO_A_DEFINED A_DEFINED 0
```

Signed-off-by: Keith W. Campbell <[email protected]>
@charliegracie
Copy link
Contributor

@genie-omr build zos zlinux plinux

for (size_t i = 0; i < getArrayDimensions(); i++) {
s += "[]";
}
for (size_t i = getArrayDimensions(); i != 0; i -= 1) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess getArrayDimensions() returns 0 if isArray() returns false?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.

{
bool match = false; // patterns.find(candidate) != patterns.end();

if (!match) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we get rid of match?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do.

@keithc-ca
Copy link
Contributor Author

@charliegracie Any more feedback or questions?

@charliegracie charliegracie self-assigned this Feb 12, 2018
@charliegracie charliegracie merged commit 2b5d8e1 into eclipse-omr:master Feb 12, 2018
@keithc-ca keithc-ca deleted the ddr branch February 12, 2018 14:12
keithc-ca added a commit to keithc-ca/omr that referenced this pull request Feb 12, 2018
* remove redundant local variable

Signed-off-by: Keith W. Campbell <[email protected]>
charliegracie added a commit that referenced this pull request Feb 13, 2018
Changes requested during review of #2271
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants