X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2FcoreSyn%2FMkExternalCore.lhs;h=244144c22d51baadd325c04540024a0682033fa4;hp=1dc3b7e929b43d88710440ed8fd8314ce7113d05;hb=81e51a265d315609cb28e190fc59ca690f5f5d6e;hpb=d74b100eaa9e782710b752805ac148e91e5c6850 diff --git a/compiler/coreSyn/MkExternalCore.lhs b/compiler/coreSyn/MkExternalCore.lhs index 1dc3b7e..244144c 100644 --- a/compiler/coreSyn/MkExternalCore.lhs +++ b/compiler/coreSyn/MkExternalCore.lhs @@ -25,6 +25,7 @@ import Name import NameSet import UniqSet import Outputable +import Encoding import ForeignCall import DynFlags import StaticFlags @@ -219,13 +220,16 @@ make_var_id = make_id True -- *do* want to keep the package name (we don't want baseZCGHCziBase, -- because that would just be ugly.) -- SIGH. +-- We encode the package name as well. make_mid :: Module -> C.Id -- Super ugly code, but I can't find anything else that does quite what I -- want (encodes the hierarchical module name without encoding the colon -- that separates the package name from it.) -make_mid m = (packageIdString (modulePackageId m)) ++ - ":" ++ - showSDoc (pprCode CStyle (pprModuleName (moduleName m))) +make_mid m = showSDoc $ + (text $ zEncodeString $ packageIdString $ modulePackageId m) + <> text ":" + <> (pprEncoded $ pprModuleName $ moduleName m) + where pprEncoded = pprCode CStyle make_qid :: Bool -> Name -> C.Qual C.Id make_qid is_var n = (mname,make_id is_var n)