Skip to content

Commit

Permalink
isGlobalField
Browse files Browse the repository at this point in the history
  • Loading branch information
KuechA authored and oxisto committed Nov 24, 2023
1 parent 3451a84 commit a14211a
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
package de.fraunhofer.aisec.cpg.graph.declarations

import de.fraunhofer.aisec.cpg.graph.*
import de.fraunhofer.aisec.cpg.graph.scopes.GlobalScope
import de.fraunhofer.aisec.cpg.graph.statements.expressions.ConstructExpression
import de.fraunhofer.aisec.cpg.graph.statements.expressions.Expression
import de.fraunhofer.aisec.cpg.graph.statements.expressions.Reference
Expand All @@ -50,6 +51,10 @@ open class VariableDeclaration : ValueDeclaration(), HasInitializer, HasType.Typ
@AST
var templateParameters: List<Node>? = null

/** Determines if this is a global variable. */
val isGlobal: Boolean
get() = this.scope is GlobalScope

/**
* C++ uses implicit constructor calls for statements like `A a;` but this only applies to types
* that are actually classes and not just primitive types or typedef aliases of primitives.
Expand Down

0 comments on commit a14211a

Please sign in to comment.