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

Implement flags to expose calling conventions, storage classes, ptr64, etc #2

Open
mstange opened this issue Apr 18, 2018 · 1 comment

Comments

@mstange
Copy link
Owner

mstange commented Apr 18, 2018

We may want to support all flags from https://msdn.microsoft.com/en-us/library/ms681400(VS.85).aspx .

@mstange
Copy link
Owner Author

mstange commented Nov 29, 2018

I've added some of these:

pub struct DemangleFlags: u32 {
/// Undecorate 32-bit decorated names.
const DECODE_32_BIT = 0x0800;
/// Enable full undecoration.
const COMPLETE = 0x0000;
/// Undecorate only the name for primary declaration. Returns [scope::]name. Does expand template parameters.
const NAME_ONLY = 0x1000;
/// Disable expansion of access specifiers for members.
const NO_ACCESS_SPECIFIERS = 0x0080;
// /// Disable expansion of the declaration language specifier.
// const NO_ALLOCATION_LANGUAGE = 0x0010;
// /// Disable expansion of the declaration model.
// const NO_ALLOCATION_MODEL = 0x0008;
// /// Do not undecorate function arguments.
// const NO_ARGUMENTS = 0x2000;
/// Disable expansion of CodeView modifiers on the this type for primary declaration.
const NO_CV_THISTYPE = 0x0040;
/// Disable expansion of return types for primary declarations.
const NO_FUNCTION_RETURNS = 0x0004;
// /// Remove leading underscores from Microsoft keywords.
// const NO_LEADING_UNDERSCORES = 0x0001;
/// Disable expansion of the static or virtual attribute of members.
const NO_MEMBER_TYPE = 0x0200;
/// Disable expansion of Microsoft keywords.
const NO_MS_KEYWORDS = 0x0002;
/// Disable expansion of Microsoft keywords on the this type for primary declaration.
const NO_MS_THISTYPE = 0x0020;
// /// Disable expansion of the Microsoft model for user-defined type returns.
// const NO_RETURN_UDT_MODEL = 0x0400;
// /// Do not undecorate special names, such as vtable, vcall, vector, metatype, and so on.
// const NO_SPECIAL_SYMS = 0x4000;
/// Disable all modifiers on the this type.
const NO_THISTYPE = Self::NO_MS_THISTYPE.bits | Self::NO_CV_THISTYPE.bits;
// /// Disable expansion of throw-signatures for functions and pointers to functions.
// const NO_THROW_SIGNATURES = 0x0100;
/// Disable output of struct/union/class/enum specifiers.
// (Not sure if this duplicates an existing flag)
const NO_CLASS_TYPE = 0x100000;
/// Insert a space after each comma.
const SPACE_AFTER_COMMA = 0x200000;
/// Make * and & hug the type name.
const HUG_TYPE = 0x400000;
}

Not sure if they're all implemented correctly.

I also added a few flags that I made up myself: NO_CLASS_TYPE, SPACE_AFTER_COMMA and HUG_TYPE.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant