Skip to content
Snippets Groups Projects
Commit 2bc3be72 authored by Sergei Trofimovich's avatar Sergei Trofimovich Committed by Ben Gamari
Browse files

x86 codegen: don't generate location comments


The following source snippet 'module A where x */* y = 42'
when being compiled with '-g' option emits syntactically
invalid comment for GNU as:

    .text
        .align 8
        .loc 1 3 1 /* */* */

Fixed by not emitting comments at all. We already suppress
all asm comments in 'X86/Ppr.hs'.

Signed-off-by: default avatarSergei Trofimovich <siarheit@google.com>

Test Plan: added test and check it works

Reviewers: scpmw, simonmar, austin, bgamari

Reviewed By: simonmar

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D1386

GHC Trac Issues: #10667
parent 86318ff9
No related branches found
Tags ghc-7.10.3-rc3
No related merge requests found
......@@ -506,9 +506,8 @@ pprInstr (COMMENT _) = empty -- nuke 'em
pprInstr (COMMENT s) = ptext (sLit "# ") <> ftext s
-}
pprInstr (LOCATION file line col name)
= ptext (sLit "\t.loc ") <> ppr file <+> ppr line <+> ppr col <>
ptext (sLit " /* ") <> text name <> ptext (sLit " */")
pprInstr (LOCATION file line col _name)
= ptext (sLit "\t.loc ") <> ppr file <+> ppr line <+> ppr col
pprInstr (DELTA d)
= pprInstr (COMMENT (mkFastString ("\tdelta = " ++ show d)))
......
module A where
-- when used with '-g' debug generation option
-- '*/*' leaked into a /* comment */ and broke
-- GNU as.
x */* y = 42
......@@ -31,3 +31,4 @@ test('debug', extra_clean(['debug.cmm']),
['$MAKE -s --no-print-directory debug'])
test('T9964', normal, compile, ['-O'])
test('T10518', [cmm_src], compile, [''])
test('T10667', normal, compile, ['-g'])
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment