diff --git a/cpg-language-llvm/src/main/kotlin/de/fraunhofer/aisec/cpg/frontends/llvm/ExpressionHandler.kt b/cpg-language-llvm/src/main/kotlin/de/fraunhofer/aisec/cpg/frontends/llvm/ExpressionHandler.kt index 6376fc98ab..3c7763836c 100644 --- a/cpg-language-llvm/src/main/kotlin/de/fraunhofer/aisec/cpg/frontends/llvm/ExpressionHandler.kt +++ b/cpg-language-llvm/src/main/kotlin/de/fraunhofer/aisec/cpg/frontends/llvm/ExpressionHandler.kt @@ -81,7 +81,6 @@ class ExpressionHandler(lang: LLVMIRLanguageFrontend) : } LLVMMetadataAsValueValueKind, LLVMInlineAsmValueKind -> { - // TODO return newProblemExpression( "Metadata or ASM value kind not supported yet", ProblemNode.ProblemType.TRANSLATION, diff --git a/cpg-language-llvm/src/main/kotlin/de/fraunhofer/aisec/cpg/frontends/llvm/LLVMIRLanguage.kt b/cpg-language-llvm/src/main/kotlin/de/fraunhofer/aisec/cpg/frontends/llvm/LLVMIRLanguage.kt index 4f74abc63c..c1e84c625b 100644 --- a/cpg-language-llvm/src/main/kotlin/de/fraunhofer/aisec/cpg/frontends/llvm/LLVMIRLanguage.kt +++ b/cpg-language-llvm/src/main/kotlin/de/fraunhofer/aisec/cpg/frontends/llvm/LLVMIRLanguage.kt @@ -40,7 +40,7 @@ class LLVMIRLanguage : Language() { override val frontend: KClass = LLVMIRLanguageFrontend::class override val compoundAssignmentOperators = setOf() - // TODO: In theory, the integers can have any bitwidth from 1 to 1^32 bits. It's not known if + // TODO: In theory, the integers can have any bit-width from 1 to 1^32 bits. It's not known if // they are interpreted as signed or unsigned. @Transient override val builtInTypes = diff --git a/cpg-language-llvm/src/main/kotlin/de/fraunhofer/aisec/cpg/frontends/llvm/StatementHandler.kt b/cpg-language-llvm/src/main/kotlin/de/fraunhofer/aisec/cpg/frontends/llvm/StatementHandler.kt index 0d9007933d..f9d8e8c7a1 100644 --- a/cpg-language-llvm/src/main/kotlin/de/fraunhofer/aisec/cpg/frontends/llvm/StatementHandler.kt +++ b/cpg-language-llvm/src/main/kotlin/de/fraunhofer/aisec/cpg/frontends/llvm/StatementHandler.kt @@ -28,7 +28,6 @@ package de.fraunhofer.aisec.cpg.frontends.llvm import de.fraunhofer.aisec.cpg.frontends.Handler import de.fraunhofer.aisec.cpg.frontends.TranslationException import de.fraunhofer.aisec.cpg.graph.* -import de.fraunhofer.aisec.cpg.graph.declarations.FunctionDeclaration import de.fraunhofer.aisec.cpg.graph.declarations.TranslationUnitDeclaration import de.fraunhofer.aisec.cpg.graph.declarations.VariableDeclaration import de.fraunhofer.aisec.cpg.graph.statements.* @@ -1396,11 +1395,7 @@ class StatementHandler(lang: LLVMIRLanguageFrontend) : // We have multiple pairs, so we insert a declaration at the beginning of the function and // make an assignment in each BB. val functionName = LLVMGetValueName(bbsFunction).string - val functions = - tu.declarations.filter { d -> - (d as? FunctionDeclaration)?.name != null && - (d as? FunctionDeclaration)?.name.toString() == functionName - } + val functions = tu.functions(functionName) if (functions.size != 1) { log.error( "${functions.size} functions match the name of the one where the phi instruction is inserted. Can't handle this case." @@ -1408,7 +1403,7 @@ class StatementHandler(lang: LLVMIRLanguageFrontend) : throw TranslationException("Wrong number of functions for phi statement.") } // Create the dummy declaration at the beginning of the function body - val firstBB = (functions[0] as FunctionDeclaration).body as Block + val firstBB = functions[0].body as Block val varName = instr.name val type = frontend.typeOf(instr) val declaration = newVariableDeclaration(varName, type, false, rawNode = instr)