on master help sign in
Fix call graph generation
commit2616a69ceda8a9353a28f68f8d8621bfc5417912 authorEdwin Brady <ecb10@st-andrews.ac.uk> dateThu 15 Nov 2012, 11:53 (14 years ago) parent48d58e6
2 files changed+7
CHANGELOG+2 src/Core/CaseTree.hs+5
CHANGELOG+2
@@ -1,4 +1,5 @@
11New in 0.9.6:
2+-------------
23
34User visible changes:
45
@@ -16,6 +17,7 @@ Internal changes:
1617
1718* Separate inlining methods at compile-time and run-time
1819* Fixed nested parameters blocks
20+* Improve efficiency of elaborator by only normalising when necessary
1921
2022New in 0.9.5:
2123-------------
src/Core/CaseTree.hs+5
@@ -79,6 +79,8 @@ small n t = termsize n t < 50
7979namesUsed :: SC -> [Name]
8080namesUsed sc = nub $ nu' [] sc where
8181 nu' ps (Case n alts) = nub (concatMap (nua ps) alts) \\ [n]
82+ nu' ps (ProjCase t alts) = nub $ (nut ps t ++
83+ (concatMap (nua ps) alts))
8284 nu' ps (STerm t) = nub $ nut ps t
8385 nu' ps _ = []
8486
@@ -89,6 +91,7 @@ namesUsed sc = nub $ nu' [] sc where
8991 nut ps (P _ n _) | n `elem` ps = []
9092 | otherwise = [n]
9193 nut ps (App f a) = nut ps f ++ nut ps a
94+ nut ps (Proj t _) = nut ps t
9295 nut ps (Bind n (Let t v) sc) = nut ps v ++ nut (n:ps) sc
9396 nut ps (Bind n b sc) = nut (n:ps) sc
9497 nut ps _ = []
@@ -100,6 +103,7 @@ namesUsed sc = nub $ nu' [] sc where
100103findCalls :: SC -> [Name] -> [(Name, [[Name]])]
101104findCalls sc topargs = nub $ nu' topargs sc where
102105 nu' ps (Case n alts) = nub (concatMap (nua (n : ps)) alts)
106+ nu' ps (ProjCase t alts) = nub (nut ps t ++ concatMap (nua ps) alts)
103107 nu' ps (STerm t) = nub $ nut ps t
104108 nu' ps _ = []
105109
@@ -115,6 +119,7 @@ findCalls sc topargs = nub $ nu' topargs sc where
115119 else [(n, map argNames args)] ++ concatMap (nut ps) args
116120 | otherwise = nut ps f ++ nut ps a
117121 nut ps (Bind n (Let t v) sc) = nut ps v ++ nut (n:ps) sc
122+ nut ps (Proj t _) = nut ps t
118123 nut ps (Bind n b sc) = nut (n:ps) sc
119124 nut ps _ = []
120125