Commit 98091a84 authored by dterei's avatar dterei
Browse files

Add '-dno-llvm-mangler' flag for debugging purposes

parent af2b9ab5
...@@ -1338,7 +1338,13 @@ runPhase LlvmLlc input_fn dflags ...@@ -1338,7 +1338,13 @@ runPhase LlvmLlc input_fn dflags
| not opt_Static = "dynamic-no-pic" | not opt_Static = "dynamic-no-pic"
| otherwise = "static" | otherwise = "static"
output_fn <- phaseOutputFilename LlvmMangle -- hidden debugging flag '-dno-llvm-mangler' to skip mangling
let next_phase = case dopt Opt_NoLlvmMangler dflags of
False -> LlvmMangle
True | dopt Opt_SplitObjs dflags -> Splitter
True -> As
output_fn <- phaseOutputFilename next_phase
io $ SysTools.runLlvmLlc dflags io $ SysTools.runLlvmLlc dflags
([ SysTools.Option (llvmOpts !! opt_lvl), ([ SysTools.Option (llvmOpts !! opt_lvl),
...@@ -1348,7 +1354,7 @@ runPhase LlvmLlc input_fn dflags ...@@ -1348,7 +1354,7 @@ runPhase LlvmLlc input_fn dflags
++ map SysTools.Option lc_opts ++ map SysTools.Option lc_opts
++ map SysTools.Option fpOpts) ++ map SysTools.Option fpOpts)
return (LlvmMangle, output_fn) return (next_phase, output_fn)
where where
-- Bug in LLVM at O3 on OSX. -- Bug in LLVM at O3 on OSX.
llvmOpts = if platformOS (targetPlatform dflags) == OSDarwin llvmOpts = if platformOS (targetPlatform dflags) == OSDarwin
......
...@@ -220,6 +220,7 @@ data DynFlag ...@@ -220,6 +220,7 @@ data DynFlag
| Opt_DoStgLinting | Opt_DoStgLinting
| Opt_DoCmmLinting | Opt_DoCmmLinting
| Opt_DoAsmLinting | Opt_DoAsmLinting
| Opt_NoLlvmMangler
| Opt_WarnIsError -- -Werror; makes warnings fatal | Opt_WarnIsError -- -Werror; makes warnings fatal
...@@ -1573,6 +1574,7 @@ dynamic_flags = [ ...@@ -1573,6 +1574,7 @@ dynamic_flags = [
, Flag "dshow-passes" (NoArg (do forceRecompile , Flag "dshow-passes" (NoArg (do forceRecompile
setVerbosity $ Just 2)) setVerbosity $ Just 2))
, Flag "dfaststring-stats" (NoArg (setDynFlag Opt_D_faststring_stats)) , Flag "dfaststring-stats" (NoArg (setDynFlag Opt_D_faststring_stats))
, Flag "dno-llvm-mangler" (NoArg (setDynFlag Opt_NoLlvmMangler))
------ Machine dependant (-m<blah>) stuff --------------------------- ------ Machine dependant (-m<blah>) stuff ---------------------------
......
Markdown is supported
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