-
Notifications
You must be signed in to change notification settings - Fork 15
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
Fix issue #113 and #114 #121
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hooray!
src/Text/LLVM/PP.hs
Outdated
++ if llvmVer < 11 then [] else | ||
[ pure ("rangesBaseAddress:" <+> ppBool (dicuRangesBaseAddress cu)) | ||
, (("sysroot:" <+>) . doubleQuotes . text) | ||
<$> (dicuSysRoot cu) | ||
, (("sdk:" <+>) . doubleQuotes . text) | ||
<$> (dicuSDK cu) | ||
]) | ||
] | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer llvmVer >= 11
. Something like this, perhaps:
[ pure ("rangesBaseAddress:" <+> ppBool (dicuRangesBaseAddress cu))
, (("sysroot:" <+>) . doubleQuotes . text)
<$> (dicuSysRoot cu)
, (("sdk:" <+>) . doubleQuotes . text)
<$> (dicuSDK cu)
| llvmVer >= 11
]
src/Text/LLVM/PP.hs
Outdated
@@ -1046,12 +1043,15 @@ ppDICompileUnit' pp cu = "!DICompileUnit" | |||
, pure ("splitDebugInlining:" <+> ppBool (dicuSplitDebugInlining cu)) | |||
, pure ("debugInfoForProfiling:" <+> ppBool (dicuDebugInfoForProf cu)) | |||
, pure ("nameTableKind:" <+> integral (dicuNameTableKind cu)) | |||
, pure ("rangesBaseAddress:" <+> ppBool (dicuRangesBaseAddress cu)) | |||
] | |||
++ if llvmVer < 11 then [] else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps worth adding a Haddock comment to dicuRangesBaseAddress
(here) that it is only pretty-printed with LLVM 11 or later, the version that it was added.
src/Text/LLVM/PP.hs
Outdated
@@ -971,7 +968,7 @@ ppDIImportedEntity = ppDIImportedEntity' ppLabel | |||
ppDILabel' :: Fmt i -> Fmt (DILabel' i) | |||
ppDILabel' pp ie = "!DILabel" | |||
<> parens (mcommas [ (("scope:" <+>) . ppValMd' pp) <$> dilScope ie | |||
, pure ("name:" <+> text (dilName ie)) | |||
, pure ("name:" <+> doubleQuotes (text (dilName ie))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this would be preferable:
, pure ("name:" <+> doubleQuotes (text (dilName ie))) | |
, pure ("name:" <+> ppStringLiteral (dilName ie)) |
As ppStringLiteral
performs escaping of certain characters.
Contains a fix for the quoting of the
DILabel
name
field bug identified in Issue #114 .Contains a fix for the
DICompileUnit
rangesBaseAddress
(and subsequent) fields which was added in LLVM 11 as noted in Issue #113. The fix does not switch the field type as proposed in the issue, but does update the pretty-printing.