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