@@ -1601,6 +1601,8 @@ idrisMain opts =
1601 let cgn = case opt getCodegen opts of
1601 let cgn = case opt getCodegen opts of
1602 [] -> Via "c"
1602 [] -> Via "c"
1603 xs -> last xs
1603 xs -> last xs
1604+ let cgFlags = opt getCodegenArgs opts
1604 -- Now set/unset specifically chosen optimisations
1606 -- Now set/unset specifically chosen optimisations
1605 sequence_ (opt getOptimisation opts)
1607 sequence_ (opt getOptimisation opts)
1606 script <- case opt getExecScript opts of
1608 script <- case opt getExecScript opts of
@@ -1625,6 +1627,7 @@ idrisMain opts =
1625 setOutputTy outty
1627 setOutputTy outty
1626 setNoBanner nobanner
1628 setNoBanner nobanner
1627 setCodegen cgn
1629 setCodegen cgn
1630+ mapM_ (addFlag cgn) cgFlags
1628 mapM_ makeOption opts
1631 mapM_ makeOption opts
1629 -- if we have the --bytecode flag, drop into the bytecode assembler
1632 -- if we have the --bytecode flag, drop into the bytecode assembler
1630 case bcs of
1633 case bcs of
@@ -1839,6 +1842,9 @@ getCodegen :: Opt -> Maybe Codegen
1839getCodegen (UseCodegen x) = Just x
1842getCodegen (UseCodegen x) = Just x
1840getCodegen _ = Nothing
1843getCodegen _ = Nothing
1845+getCodegenArgs :: Opt -> Maybe String
1846+getCodegenArgs (CodegenArgs args) = Just args
1847+getCodegenArgs _ = Nothing
1843getConsoleWidth :: Opt -> Maybe ConsoleWidth
1849getConsoleWidth :: Opt -> Maybe ConsoleWidth
1844getConsoleWidth (UseConsoleWidth x) = Just x
1850getConsoleWidth (UseConsoleWidth x) = Just x