Commit ea025306 authored by duncan.coutts@worc.ox.ac.uk's avatar duncan.coutts@worc.ox.ac.uk
Browse files

Add ghc and version number in .ident directive in NCG

Just because we can and because every other compiler does,
lets stick in an identifier directive: .ident "GHC x.y.z"
into the assembly output of the NCG.
parent c4597dfe
...@@ -39,6 +39,7 @@ import CLabel ( pprCLabel ) ...@@ -39,6 +39,7 @@ import CLabel ( pprCLabel )
import ErrUtils ( dumpIfSet_dyn ) import ErrUtils ( dumpIfSet_dyn )
import DynFlags ( DynFlags, DynFlag(..), dopt ) import DynFlags ( DynFlags, DynFlag(..), dopt )
import StaticFlags ( opt_Static, opt_PIC ) import StaticFlags ( opt_Static, opt_PIC )
import Config ( cProjectVersion )
import Digraph import Digraph
import qualified Pretty import qualified Pretty
...@@ -140,6 +141,12 @@ nativeCodeGen dflags cmms us ...@@ -140,6 +141,12 @@ nativeCodeGen dflags cmms us
-- stack so add the note in: -- stack so add the note in:
Pretty.$$ Pretty.text ".section .note.GNU-stack,\"\",@progbits" Pretty.$$ Pretty.text ".section .note.GNU-stack,\"\",@progbits"
#endif #endif
-- And just because every other compiler does, lets stick in
-- an identifier directive: .ident "GHC x.y.z"
Pretty.$$ let compilerIdent = Pretty.text "GHC" Pretty.<+>
Pretty.text cProjectVersion
in Pretty.text ".ident" Pretty.<+>
Pretty.doubleQuotes compilerIdent
) )
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment