Skip to content

Commit

Permalink
Merge pull request GaloisInc#62 from siddharthist/metadata-namespace
Browse files Browse the repository at this point in the history
Allow null names for DINameSpace
  • Loading branch information
langston-barrett authored Jan 17, 2019
2 parents 4690fa1 + 4bfa3ac commit 41d3850
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Text/LLVM/AST.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1108,7 +1108,7 @@ data DITemplateValueParameter' lab = DITemplateValueParameter

type DINameSpace = DINameSpace' BlockLabel
data DINameSpace' lab = DINameSpace
{ dinsName :: String
{ dinsName :: Maybe String
, dinsScope :: ValMd' lab
, dinsFile :: ValMd' lab
, dinsLine :: Word32
Expand Down
10 changes: 5 additions & 5 deletions src/Text/LLVM/PP.hs
Original file line number Diff line number Diff line change
Expand Up @@ -869,11 +869,11 @@ ppDIImportedEntity = ppDIImportedEntity' ppLabel

ppDINameSpace' :: LLVM => (i -> Doc) -> DINameSpace' i -> Doc
ppDINameSpace' pp ns = "!DINameSpace"
<> parens (commas [ "name:" <+> text (dinsName ns)
, "scope:" <+> ppValMd' pp (dinsScope ns)
, "file:" <+> ppValMd' pp (dinsFile ns)
, "line:" <+> integral (dinsLine ns)
])
<> parens (mcommas [ ("name:" <+>) . text <$> (dinsName ns)
, pure ("scope:" <+> ppValMd' pp (dinsScope ns))
, pure ("file:" <+> ppValMd' pp (dinsFile ns))
, pure ("line:" <+> integral (dinsLine ns))
])

ppDINameSpace :: LLVM => DINameSpace -> Doc
ppDINameSpace = ppDINameSpace' ppLabel
Expand Down

0 comments on commit 41d3850

Please sign in to comment.