Skip to content

Commit

Permalink
Merge pull request #1432 from Friendseeker/fix-consistent-format-bug
Browse files Browse the repository at this point in the history
[2.x] Handle `DependencyByMacroExpansion` in `ConsistentAnalysisFormat`
  • Loading branch information
eed3si9n authored Oct 6, 2024
2 parents c57ea64 + 5b06a38 commit 2bdc237
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,8 @@ class ConsistentAnalysisFormat(val mappers: ReadWriteMappers, sort: Boolean) {
wrS("inheritance.external", rs.inheritance.external)
wrS("localInheritance.internal", rs.localInheritance.internal)
wrS("localInheritance.external", rs.localInheritance.external)
wrS("macroExpansion.internal", rs.macroExpansion.internal)
wrS("macroExpansion.external", rs.macroExpansion.external)
wrS("productClassNames", rs.productClassName)
}

Expand All @@ -384,23 +386,25 @@ class ConsistentAnalysisFormat(val mappers: ReadWriteMappers, sort: Boolean) {
val bin = rd(mapSource, mapBinary)
val lcn = rd(mapBinary, identity[String])
val cn = rd(mapSource, identity[String])
val mri, mre, ii, ie, lii, lie, bcn = rdS()
val mri, mre, ii, ie, lii, lie, mei, mee, bcn = rdS()
def deps(
m: Relation[String, String],
i: Relation[String, String],
l: Relation[String, String]
l: Relation[String, String],
me: Relation[String, String],
) =
Map(
DependencyContext.DependencyByMemberRef -> m,
DependencyContext.DependencyByInheritance -> i,
DependencyContext.LocalDependencyByInheritance -> l
DependencyContext.LocalDependencyByInheritance -> l,
DependencyContext.DependencyByMacroExpansion -> me,
)
Relations.make(
p,
bin,
lcn,
InternalDependencies(deps(mri, ii, lii)),
ExternalDependencies(deps(mre, ie, lie)),
InternalDependencies(deps(mri, ii, lii, mei)),
ExternalDependencies(deps(mre, ie, lie, mee)),
cn,
un,
bcn
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,18 +206,21 @@ object AnalysisGenerators {
memberRef <- genRClassDependencies(classNames)
inheritance <- genSubRClassDependencies(memberRef)
localInheritance <- genSubRClassDependencies(memberRef)
macroExpansion <- genSubRClassDependencies(memberRef)
internal <- InternalDependencies(
Map(
DependencyByMemberRef -> memberRef.internal,
DependencyByInheritance -> inheritance.internal,
LocalDependencyByInheritance -> localInheritance.internal
LocalDependencyByInheritance -> localInheritance.internal,
DependencyByMacroExpansion -> macroExpansion.internal,
)
)
external <- ExternalDependencies(
Map(
DependencyByMemberRef -> memberRef.external,
DependencyByInheritance -> inheritance.external,
LocalDependencyByInheritance -> localInheritance.external
LocalDependencyByInheritance -> localInheritance.external,
DependencyByMacroExpansion -> macroExpansion.external,
)
)
classes = rel(srcs, classNames)
Expand Down

0 comments on commit 2bdc237

Please sign in to comment.