Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CloudPG v8 Upgrade #63

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions cloudpg/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ repositories {
}

ivy {
setUrl("https://download.eclipse.org/tools/cdt/releases/11.0/cdt-11.0.0/plugins")
setUrl("https://download.eclipse.org/tools/cdt/releases/11.3/cdt-11.3.1/plugins")
metadataSources {
artifact()
}
Expand All @@ -70,7 +70,10 @@ repositories {

dependencies {
implementation("org.junit.jupiter:junit-jupiter:5.7.0")
val version = "7.1.2"

// Move to JitPack dependency for newer versions
// implementation("com.github.Fraunhofer-AISEC.cpg:cpg:v8.1.2")
val version = "8.1.2"

implementation("de.fraunhofer.aisec:cpg-core:$version")
implementation("de.fraunhofer.aisec:cpg-analysis:$version")
Expand Down
2 changes: 0 additions & 2 deletions cloudpg/src/main/java/io/clouditor/graph/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import de.fraunhofer.aisec.cpg.graph.Node
import de.fraunhofer.aisec.cpg.graph.allChildren
import de.fraunhofer.aisec.cpg.graph.declarations.TranslationUnitDeclaration
import de.fraunhofer.aisec.cpg.helpers.Benchmark
import io.clouditor.graph.frontends.ruby.RubyLanguage
import io.clouditor.graph.nodes.Builder
import io.clouditor.graph.passes.*
import io.clouditor.graph.passes.golang.*
Expand Down Expand Up @@ -121,7 +120,6 @@ object App : Callable<Int> {
TranslationConfiguration.builder()
.topLevel(rootPath.toFile())
.sourceLocations(paths.map { rootPath.resolve(it).toFile() })
.registerLanguage(RubyLanguage())
.registerLanguage(JavaLanguage())
.registerLanguage(CPPLanguage())
.registerLanguage(CLanguage())
Expand Down
12 changes: 5 additions & 7 deletions cloudpg/src/main/java/io/clouditor/graph/ValueResolver.kt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ open class ValueResolver(
when (expr) {
is KeyValueExpression -> return resolve(expr.value)
is Literal<*> -> return expr.value?.toString() ?: ""
is DeclaredReferenceExpression -> return resolveDeclaration(expr.refersTo)
is Reference -> return resolveDeclaration(expr.refersTo)
is BinaryOperator -> {
// resolve lhs
val lhsValue = resolve(expr.lhs)
Expand Down Expand Up @@ -119,10 +119,8 @@ open class ValueResolver(
is CastExpression -> {
return this.resolve(expr.expression)
}
is ArraySubscriptionExpression -> {
val array =
(expr.arrayExpression as? DeclaredReferenceExpression)?.refersTo as?
VariableDeclaration
is SubscriptExpression -> {
val array = (expr.arrayExpression as? Reference)?.refersTo as? VariableDeclaration
val ile = array?.initializer as? InitializerListExpression

ile?.let {
Expand All @@ -146,9 +144,9 @@ open class ValueResolver(
val rhs = resolve((expr.condition as? BinaryOperator)?.rhs)

return if (lhs == rhs) {
resolve(expr.thenExpr)
resolve(expr.thenExpression)
} else {
resolve(expr.elseExpr)
resolve(expr.elseExpression)
}
}

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading