@@ -41,10 +41,13 @@ data Options = Options
4141 , optHelpLog :: Bool -- ^ Print log option help and exit
4242 , optHelpOpt :: Bool -- ^ Print optiisation option help and exit
4343 , optLibDirs :: [String ] -- ^ Directories where library files live
44+ , optLogFile :: Maybe String
45+ -- ^ Path where to dump logs
4446 , optLogAspects :: Set LogSelection
4547 -- ^ Which aspects to log
4648 , optOptimisations :: Set OptFlag
4749 -- ^ Enabled optimisations
50+ , optLlcBin :: String -- ^ LLVM 'llc' binary path
4851 , optLLVMOptLevel :: Word -- ^ LLVM optimisation level
4952 , optDumpLib :: Bool -- ^ Also dump wybe.* modules when dumping
5053 , optVerbose :: Bool -- ^ Be verbose in compiler output
@@ -66,7 +69,9 @@ defaultOptions = Options
6669 , optHelpOpt = False
6770 , optLibDirs = []
6871 , optLogAspects = Set. empty
72+ , optLogFile = Nothing
6973 , optOptimisations = defaultOptFlags
74+ , optLlcBin = " llc"
7075 , optLLVMOptLevel = 3
7176 , optDumpLib = False
7277 , optVerbose = False
@@ -222,8 +227,11 @@ options =
222227 (ReqArg (\ d opts -> opts { optLibDirs = optLibDirs opts ++ [d] }) " DIR" )
223228 (" specify a library directory [default $WYBELIBS or " ++ libDir ++ " ]" )
224229 , Option [' l' ] [" log" ]
225- (ReqArg addLogAspects " ASPECT" )
226- " add comma-separated aspects to log, or 'all'"
230+ (ReqArg addLogAspects " ASPECT" )
231+ " add comma-separated aspects to log, or 'all'"
232+ , Option [] [" log-file" ]
233+ (ReqArg (\ f opts -> opts { optLogFile = Just f }) " FILE" )
234+ " File to write logs to"
227235 , Option [' h' ] [" help" ]
228236 (NoArg (\ opts -> opts { optShowHelp = True }))
229237 " display this help text and exit"
@@ -239,6 +247,9 @@ options =
239247 , Option [' x' ] [" opt" ]
240248 (ReqArg addOptFlags " FLAGS" )
241249 " add comma-separated optimisation flags"
250+ , Option [] [" llc-path" ]
251+ (ReqArg (\ llc opts -> opts { optLlcBin = llc }) " PATH" )
252+ " specify the path of the 'llc' used"
242253 , Option [' O' ] [" llvm-opt-level" ]
243254 (ReqArg setLLVMOptLevel " LEVEL" )
244255 " specify the LLVM compiler optimisation level"
0 commit comments