From 54dcace42120e471cdbef9300f7089b84a568d77 Mon Sep 17 00:00:00 2001 From: Robert Wright Date: Wed, 14 Apr 2021 15:12:31 +0100 Subject: [PATCH] Rename RefC.CC file name variables The previous names were a holdover from when these functions were a part of `RefC.compileExpr`. The new names more accurately reflect their usage in this context. --- src/Compiler/RefC/CC.idr | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/Compiler/RefC/CC.idr b/src/Compiler/RefC/CC.idr index 5172b4b38..3a0d24ff3 100644 --- a/src/Compiler/RefC/CC.idr +++ b/src/Compiler/RefC/CC.idr @@ -23,17 +23,17 @@ fullprefix_dir dirs sub export compileCObjectFile : {auto c : Ref Ctxt Defs} -> {default False asLibrary : Bool} - -> (outn : String) - -> (outobj : String) + -> (sourceFile : String) + -> (objectFile : String) -> Core (Maybe String) -compileCObjectFile {asLibrary} outn outobj = +compileCObjectFile {asLibrary} sourceFile objectFile = do cc <- coreLift findCC dirs <- getDirs let libraryFlag = if asLibrary then "-fpic " else "" - let runccobj = cc ++ " -c " ++ libraryFlag ++ outn ++ - " -o " ++ outobj ++ " " ++ + let runccobj = cc ++ " -c " ++ libraryFlag ++ sourceFile ++ + " -o " ++ objectFile ++ " " ++ "-I" ++ fullprefix_dir dirs "refc " ++ "-I" ++ fullprefix_dir dirs "include" @@ -41,22 +41,22 @@ compileCObjectFile {asLibrary} outn outobj = 0 <- coreLift $ system runccobj | _ => pure Nothing - pure (Just outobj) + pure (Just objectFile) export compileCFile : {auto c : Ref Ctxt Defs} -> {default False asShared : Bool} - -> (outobj : String) - -> (outexec : String) + -> (objectFile : String) + -> (outFile : String) -> Core (Maybe String) -compileCFile {asShared} outobj outexec = +compileCFile {asShared} objectFile outFile = do cc <- coreLift findCC dirs <- getDirs let sharedFlag = if asShared then "-shared " else "" - let runcc = cc ++ " " ++ sharedFlag ++ outobj ++ - " -o " ++ outexec ++ " " ++ + let runcc = cc ++ " " ++ sharedFlag ++ objectFile ++ + " -o " ++ outFile ++ " " ++ fullprefix_dir dirs "lib" "libidris2_support.a" ++ " " ++ "-lidris2_refc " ++ "-L" ++ fullprefix_dir dirs "refc " ++ @@ -66,7 +66,7 @@ compileCFile {asShared} outobj outexec = 0 <- coreLift $ system runcc | _ => pure Nothing - pure (Just outexec) + pure (Just outFile) where clibdirs : List String -> String