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

Switch from itanium-abi package to demangler package. #1235

Open
kquick opened this issue Aug 7, 2024 · 1 comment
Open

Switch from itanium-abi package to demangler package. #1235

kquick opened this issue Aug 7, 2024 · 1 comment
Labels
crucible dependencies Pull requests that update a dependency file enhancement llvm

Comments

@kquick
Copy link
Member

kquick commented Aug 7, 2024

See https://github.com/GaloisInc/demangler. The demangler package is both faster and also more complete with regards to demangling coverage (although still not 100%).

@RyanGlScott
Copy link
Contributor

One challenge here is that some parts of crucible-llvm define C++ overrides that match on parts of the itanium-abi type-related AST to determine if the override should apply or not:

-- | An override of the @bool@ operator (cast) on the @sentry@ class,
--
-- @sentry::operator bool()@
sentryBoolOverride :: (IsSymInterface sym, HasPtrWidth wptr, wptr ~ ArchWidth arch)
=> SomeCPPOverride p sym arch
sentryBoolOverride =
trueOverride ["basic_ostream", "sentry"] $ \_nm decodedName ->
case decodedName of
ABI.Function
(ABI.NestedName
[ABI.Const]
[ ABI.SubstitutionPrefix ABI.SubStdNamespace
, _
, ABI.UnqualifiedPrefix (ABI.SourceName "basic_ostream")
, _
, ABI.UnqualifiedPrefix (ABI.SourceName "sentry")
]
(ABI.OperatorName (ABI.OpCast ABI.BoolType)))
[ABI.VoidType] -> True
_ -> False

The demangler package intentionally does not export its demangled AST data types as part of its API, however. As such, it's not obvious to me how to reimplement this code using demangler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crucible dependencies Pull requests that update a dependency file enhancement llvm
Projects
None yet
Development

No branches or pull requests

2 participants