summaryrefslogtreecommitdiff
path: root/compiler/codeGen
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2011-11-04 16:02:17 +0000
committerSimon Marlow <marlowsd@gmail.com>2011-11-07 09:17:33 +0000
commit630b89551b14324fb1bfea853be700d8f32106c2 (patch)
treeeda0cecc7062ce3ff12905099d12920c3eeb8257 /compiler/codeGen
parent1ece7b27a11c6947f0ae3a11703e22b7065a6b6c (diff)
downloadhaskell-630b89551b14324fb1bfea853be700d8f32106c2.tar.gz
Cost centre names are now in UTF-8 (#5559)
So the .prof file will be UTF-8. This is mostly ok, except that the RTS doesn't calculate the column widths correctly (it assumes bytes = chars). hp2ps doesn't do anything sensible with Unicode strings, it just dumps the bytes into the .ps file.
Diffstat (limited to 'compiler/codeGen')
-rw-r--r--compiler/codeGen/CgProf.hs8
-rw-r--r--compiler/codeGen/StgCmmProf.hs8
2 files changed, 10 insertions, 6 deletions
diff --git a/compiler/codeGen/CgProf.hs b/compiler/codeGen/CgProf.hs
index 23a602c174..c961e24147 100644
--- a/compiler/codeGen/CgProf.hs
+++ b/compiler/codeGen/CgProf.hs
@@ -162,9 +162,11 @@ emitCostCentreDecl
:: CostCentre
-> Code
emitCostCentreDecl cc = do
- { label <- newStringCLit (costCentreUserName cc)
- ; modl <- newStringCLit (Module.moduleNameString
- (Module.moduleName (cc_mod cc)))
+ -- NB. bytesFS: we want the UTF-8 bytes here (#5559)
+ { label <- newByteStringCLit (bytesFS $ costCentreUserNameFS cc)
+ ; modl <- newByteStringCLit (bytesFS $ Module.moduleNameFS
+ $ Module.moduleName
+ $ cc_mod cc)
-- All cost centres will be in the main package, since we
-- don't normally use -auto-all or add SCCs to other packages.
-- Hence don't emit the package name in the module here.
diff --git a/compiler/codeGen/StgCmmProf.hs b/compiler/codeGen/StgCmmProf.hs
index 338e10428b..13c1be7f42 100644
--- a/compiler/codeGen/StgCmmProf.hs
+++ b/compiler/codeGen/StgCmmProf.hs
@@ -213,9 +213,11 @@ initCostCentres (local_CCs, ___extern_CCs, singleton_CCSs)
emitCostCentreDecl :: CostCentre -> FCode ()
emitCostCentreDecl cc = do
- { label <- newStringCLit (costCentreUserName cc)
- ; modl <- newStringCLit (Module.moduleNameString
- (Module.moduleName (cc_mod cc)))
+ -- NB. bytesFS: we want the UTF-8 bytes here (#5559)
+ { label <- newByteStringCLit (bytesFS $ costCentreUserNameFS cc)
+ ; modl <- newByteStringCLit (bytesFS $ Module.moduleNameFS
+ $ Module.moduleName
+ $ cc_mod cc)
-- All cost centres will be in the main package, since we
-- don't normally use -auto-all or add SCCs to other packages.
-- Hence don't emit the package name in the module here.