From 075dc1c34ead2d947269b0158171316866ff0ebc Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Thu, 5 Apr 2018 08:35:28 +0200 Subject: [PATCH] Fix non-hierarchical module names --- CleanPrettyPrint | 2 +- CleanTypeUnifier | 2 +- CloogleDB.dcl | 1 + CloogleDB.icl | 4 ++++ CloogleDBFactory.icl | 10 +++++++--- libcloogle | 2 +- 6 files changed, 15 insertions(+), 6 deletions(-) diff --git a/CleanPrettyPrint b/CleanPrettyPrint index eb0b7bc..37fe62d 160000 --- a/CleanPrettyPrint +++ b/CleanPrettyPrint @@ -1 +1 @@ -Subproject commit eb0b7bc7e1c32f30dcf42481cfbc15833062cbdd +Subproject commit 37fe62dd59f1435a3fbfbfb97218ef40f6af3f8c diff --git a/CleanTypeUnifier b/CleanTypeUnifier index f25abe3..aa42e46 160000 --- a/CleanTypeUnifier +++ b/CleanTypeUnifier @@ -1 +1 @@ -Subproject commit f25abe3fd7651ee65406a3bbaf9a97e28a800744 +Subproject commit aa42e46ff43f8c4202569ac4778ea2164da72b4e diff --git a/CloogleDB.dcl b/CloogleDB.dcl index 7015111..3a26168 100644 --- a/CloogleDB.dcl +++ b/CloogleDB.dcl @@ -211,6 +211,7 @@ instance getLocation CloogleEntry getLibrary :: !Location -> Maybe Name getModule :: !Location -> Maybe Name +setModule :: !Name !Location -> Location getFilename :: !Location -> Maybe String getDclLine :: !Location -> Maybe Int getIclLine :: !Location -> Maybe Int diff --git a/CloogleDB.icl b/CloogleDB.icl index acd3e11..6ac6ea0 100644 --- a/CloogleDB.icl +++ b/CloogleDB.icl @@ -170,6 +170,10 @@ getModule :: !Location -> Maybe Name getModule (Location _ mod _ _ _ _) = Just mod getModule _ = Nothing +setModule :: !Name !Location -> Location +setModule m (Location lib _ fname dcl icl n) = Location lib m fname dcl icl n +setModule _ l = l + getFilename :: !Location -> Maybe String getFilename (Location _ _ fn _ _ _) = Just fn getFilename _ = Nothing diff --git a/CloogleDBFactory.icl b/CloogleDBFactory.icl index a80d2fa..6e92c53 100644 --- a/CloogleDBFactory.icl +++ b/CloogleDBFactory.icl @@ -143,6 +143,10 @@ where < _ _ = False +import StdDebug +trace_id x = trace_n x x +instance toString (String,String) where toString (x,y) = "Trace: " +++ x +++ ": " +++ y + class match a :: !a !FilePath -> Bool instance match PathPattern @@ -342,7 +346,7 @@ where (Just l, Just m) -> isMember (l,m) appmods _ -> False where - appmods = [(fromJust $ 'CDB'.getLibrary me.me_loc, fromJust $ 'CDB'.getModule me.me_loc) \\ (me,_) <- tdb.temp_modules | me.me_is_app] + appmods = [trace_id (fromJust $ 'CDB'.getLibrary me.me_loc, fromJust $ 'CDB'.getModule me.me_loc) \\ (me,_) <- tdb.temp_modules | me.me_is_app] libmap = 'M'.fromList [(l,idxfilter \e -> case 'CDB'.getLocation e >>= 'CDB'.getLibrary of @@ -413,7 +417,7 @@ where indexModule :: !Bool !String !'CDB'.ModuleEntry !TemporaryDB !*World -> *(!TemporaryDB, !*World) indexModule include_locals root mod db w -#! (functions,macros,generics,typedefs,clss,insts,derivs,clsderivs,(modname,_,imports),w) +#! (functions,macros,generics,typedefs,clss,insts,derivs,clsderivs,(modname,mod`,imports),w) = findModuleContents include_locals (root lib mkdir ('CDB'.getName mod.me_loc)) w #! typedefs = [{td & tde_loc=castLoc modname loc} \\ (loc,td) <- typedefs] #! lib = lib % (0, size lib - size modname + size ('CDB'.getName mod.me_loc) - 1) @@ -429,7 +433,7 @@ indexModule include_locals root mod db w , temp_instances = [castLocThd3 modname insts:db.temp_instances] , temp_derivations = [map (appSnd (castLocThd3 modname)) derivs:db.temp_derivations] , temp_class_derivations = [castLocFrth modname clsderivs:db.temp_class_derivations] - , temp_modules = [(mod,imports):db.temp_modules] + , temp_modules = [({mod & me_loc='CDB'.setModule modname ('CDB'.setName modname mod.me_loc), me_documentation=mod`.me_documentation},imports):db.temp_modules] } = (db,w) where diff --git a/libcloogle b/libcloogle index fd55013..1a13b24 160000 --- a/libcloogle +++ b/libcloogle @@ -1 +1 @@ -Subproject commit fd55013666160619318dcabbf562ae4aa09a529d +Subproject commit 1a13b24887c4289f33b4c9d644aa99ee3bad337a -- GitLab