@@ -46,26 +46,38 @@ abbrev pkg (self : Module) : Package :=
46
46
@[inline] def rootDir (self : Module) : FilePath :=
47
47
self.lib.rootDir
48
48
49
+ @[inline] def filePath (dir : FilePath) (ext : String) (self : Module) : FilePath :=
50
+ Lean.modToFilePath dir self.name ext
51
+
52
+ @[inline] def srcPath (ext : String) (self : Module) : FilePath :=
53
+ self.filePath self.lib.srcDir ext
54
+
49
55
@[inline] def leanFile (self : Module) : FilePath :=
50
- Lean.modToFilePath self.lib.srcDir self.name "lean"
56
+ self.srcPath "lean"
57
+
58
+ @[inline] def leanLibPath (ext : String) (self : Module) : FilePath :=
59
+ self.filePath self.pkg.oleanDir ext
51
60
52
61
@[inline] def oleanFile (self : Module) : FilePath :=
53
- Lean.modToFilePath self.pkg.oleanDir self.name "olean"
62
+ self.leanLibPath "olean"
54
63
55
64
@[inline] def ileanFile (self : Module) : FilePath :=
56
- Lean.modToFilePath self.pkg.oleanDir self.name "ilean"
65
+ self.leanLibPath "ilean"
57
66
58
67
@[inline] def traceFile (self : Module) : FilePath :=
59
- Lean.modToFilePath self.pkg.oleanDir self.name "trace"
68
+ self.leanLibPath "trace"
69
+
70
+ @[inline] def irPath (ext : String) (self : Module) : FilePath :=
71
+ self.filePath self.pkg.irDir ext
60
72
61
73
@[inline] def cFile (self : Module) : FilePath :=
62
- Lean.modToFilePath self.pkg.irDir self.name "c"
74
+ self.irPath "c"
63
75
64
76
@[inline] def cTraceFile (self : Module) : FilePath :=
65
- Lean.modToFilePath self.pkg.irDir self.name "c.trace"
77
+ self.irPath "c.trace"
66
78
67
79
@[inline] def oFile (self : Module) : FilePath :=
68
- Lean.modToFilePath self.pkg.irDir self.name "o"
80
+ self.irPath "o"
69
81
70
82
@[inline] def dynlibName (self : Module) : String :=
71
83
-- NOTE: file name MUST be unique on Windows
0 commit comments