diff options
author | Ian Lynagh <ian@well-typed.com> | 2012-12-12 17:16:53 +0000 |
---|---|---|
committer | Ian Lynagh <ian@well-typed.com> | 2012-12-12 17:16:53 +0000 |
commit | 750a34b3315495c0d3af6905fbf57e842cb6d56f (patch) | |
tree | a0e92722ad2c1c47e1e6f60d7adcb5de61329ced /compiler/nativeGen/AsmCodeGen.lhs | |
parent | 5d0d1d9cbe2fd0c0a5e4f4a979c8e46ff51ea6fa (diff) | |
download | haskell-750a34b3315495c0d3af6905fbf57e842cb6d56f.tar.gz |
Small code tidy-up
Diffstat (limited to 'compiler/nativeGen/AsmCodeGen.lhs')
-rw-r--r-- | compiler/nativeGen/AsmCodeGen.lhs | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/compiler/nativeGen/AsmCodeGen.lhs b/compiler/nativeGen/AsmCodeGen.lhs index 1c0b0a11c9..59f4b43a87 100644 --- a/compiler/nativeGen/AsmCodeGen.lhs +++ b/compiler/nativeGen/AsmCodeGen.lhs @@ -588,7 +588,7 @@ makeImportsDoc dflags imports -- On recent versions of Darwin, the linker supports -- dead-stripping of code and data on a per-symbol basis. -- There's a hack to make this work in PprMach.pprNatCmmDecl. - (if platformHasSubsectionsViaSymbols (targetPlatform dflags) + (if platformHasSubsectionsViaSymbols platform then text ".subsections_via_symbols" else empty) $$ @@ -598,28 +598,27 @@ makeImportsDoc dflags imports -- will not use an executable stack, which is good for -- security. GHC generated code does not need an executable -- stack so add the note in: - (if platformHasGnuNonexecStack (targetPlatform dflags) + (if platformHasGnuNonexecStack platform then text ".section .note.GNU-stack,\"\",@progbits" else empty) $$ -- And just because every other compiler does, lets stick in -- an identifier directive: .ident "GHC x.y.z" - (if platformHasIdentDirective (targetPlatform dflags) + (if platformHasIdentDirective platform then let compilerIdent = text "GHC" <+> text cProjectVersion in text ".ident" <+> doubleQuotes compilerIdent else empty) where + platform = targetPlatform dflags + arch = platformArch platform + os = platformOS platform + -- Generate "symbol stubs" for all external symbols that might -- come from a dynamic library. dyld_stubs :: [CLabel] -> SDoc {- dyld_stubs imps = vcat $ map pprDyldSymbolStub $ map head $ group $ sort imps-} - - platform = targetPlatform dflags - arch = platformArch platform - os = platformOS platform - -- (Hack) sometimes two Labels pretty-print the same, but have -- different uniques; so we compare their text versions... dyld_stubs imps |