Skip to content
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

Enable DDR to work with VS2017 #2944

Merged
merged 6 commits into from
Sep 10, 2018
Merged

Conversation

keithc-ca
Copy link
Contributor

@keithc-ca keithc-ca commented Sep 7, 2018

Only add enum literals to enum types

  • Consider the source pattern typedef enum E { Ea, Eb } E;: With Visual Studio 2017, the PDB description for the typedef may precede that of the enum. Thus _typeMap["E"] will refer to a TypedefUDT object which is not safe to cast to an EnumUDT.

Minor cleanup

  • Be careful capturing the size of a typedef: The call to setType() isn't guaranteed to set _aliasedType immediately so it's not safe to dereference it. Typedef types are omitted from the generated blob and superset files so we don't really need to capture the size of typedef types.

  • Explicitly construct base types and initialize all fields. The compiler ought to do the same implicitly, but there's no cost to being explicit.

  • Use Modifiers::addArrayDimension. This is preferable to accessing the field _arrayLengths directly.

  • Explicitly mark virtual destructors. If a class has a virtual destructor, then destructors of derived classes should be implicitly virtual as well. Being explicit makes the code easier to understand.

  • Add Type::getTypeNameKey(). Refactor the static function from Symbol_IR.cpp; it's still only used by Symbol_IR at this time. Type::getFullName() was made a 'const' method so getTypeNameKey() can be const.

The call to setType() isn't guaranteed to set _aliasedType immediately
so it's not safe to dereference it. Typedef types are omitted from
the generated blob and superset files so we don't really need to
capture the size of typedef types.

Signed-off-by: Keith W. Campbell <keithc@ca.ibm.com>
The compiler ought to do the same implicitly, but there's no
cost to being explicit.

Signed-off-by: Keith W. Campbell <keithc@ca.ibm.com>
This is preferable to accessing the field _arrayLengths directly.

Signed-off-by: Keith W. Campbell <keithc@ca.ibm.com>
If a class has a virtual destructor, then destructors of derived
classes should be implicitly virtual as well. Being explicit makes
the code easier to understand.

Signed-off-by: Keith W. Campbell <keithc@ca.ibm.com>
Refactor the static function from Symbol_IR.cpp; it's still
only used by Symbol_IR at this time. Type::getFullName() was
made a 'const' method so getTypeNameKey() can be const.

Signed-off-by: Keith W. Campbell <keithc@ca.ibm.com>
Consider the source pattern
  typedef enum E { Ea, Eb } E;
With Visual Studio 2017, the PDB description for the typedef
may precede that of the enum. Thus `_typeMap["E"]` will refer
to a TypedefUDT object which is not safe to cast to an EnumUDT.

Signed-off-by: Keith W. Campbell <keithc@ca.ibm.com>
@keithc-ca
Copy link
Contributor Author

This fixes #2885.

@charliegracie
Copy link
Contributor

@genie-omr build all

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