CompilationDatabase

A compilation database contains necessary information about the include paths and possible compiler flags that should be used for an individual source file. It follows the JSON Compilation Database Format Specification (see https://clang.llvm.org/docs/JSONCompilationDatabase.html).

It is basically a list of CompilationDatabaseEntry entries. For now, we are primarily interested in the include paths, but in the future, we might extend this to other compiler flags.

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion
Link copied to clipboard
data class CompilationDatabaseEntry(val directory: String?, val command: String? = null, val arguments: List<String>? = null, val file: String, val output: String?)

This is the structure of how each object inside compile_commands.json looks like.

Link copied to clipboard
data class ParsedCompilationDatabaseEntry(val includes: MutableList<String> = mutableListOf(), var component: String = DEFAULT_COMPONENT, var arch: String? = null)

This represents a parsed CompilationDatabaseEntry with all necessary information extracted.

Properties

Link copied to clipboard

Returns the include paths for all files in compilation database.

Link copied to clipboard

This computed property returns the common type in a Collection of Type objects. For example, if two types A and B both derive from the interface C`` then C` would be returned.

Link copied to clipboard

A cached list of components and their files. Can be used to supply TranslationConfiguration.softwareComponents with the necessary files to parse for each component.

Link copied to clipboard
open override val size: Int
Link copied to clipboard

Functions

Link copied to clipboard
Link copied to clipboard
fun <EdgeType : Edge<Node>> MutableList<Node>.add(target: Node, builder: EdgeType.() -> Unit): Boolean
Link copied to clipboard
Link copied to clipboard
fun addIncludePath(srcFile: File, paths: List<String>)
Link copied to clipboard

Wraps the given Type into a chain of PointerTypes and ReferenceTypes, given the operations in TypeOperations.

Link copied to clipboard
fun <T : Node> Collection<T>?.byNameOrNull(lookup: String, modifier: SearchModifier): T?

This function returns the first node that matches the name on the supplied list of nodes.

Link copied to clipboard
open override fun clear()
Link copied to clipboard
open override fun clone(): Any
Link copied to clipboard
open operator override fun contains(element: CompilationDatabase.CompilationDatabaseEntry): Boolean
Link copied to clipboard
Link copied to clipboard
open fun ensureCapacity(p0: Int)
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
Link copied to clipboard
open operator override fun get(index: Int): CompilationDatabase.CompilationDatabaseEntry
Link copied to clipboard
operator fun <T : Node> Collection<T>?.get(predicate: (T) -> Boolean, modifier: SearchModifier = SearchModifier.NONE): T?

A shortcut to call firstOrNull using the [] syntax.

operator fun <T : Node> Collection<T>?.get(lookup: String, modifier: SearchModifier = SearchModifier.NONE): T?

A shortcut to call byNameOrNull using the [] syntax.

Link copied to clipboard

Returns all defined symbols for the specified component.

Link copied to clipboard

Returns the include paths for the specified file.

Link copied to clipboard

Returns defined symbols for the specified file and component.

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
Link copied to clipboard
operator fun <T : Node> Collection<T>.invoke(predicate: (T) -> Boolean): List<T>

A shortcut invoke filter on a list of nodes.

operator fun <T : Node> Collection<T>.invoke(lookup: String): List<T>

A shortcut to filter a list of nodes by their name.

inline operator fun <T> List<Node>.invoke(i: Int = 0): T?

Returns the i-th item in this list (or null) and casts it to T.

Link copied to clipboard
open override fun isEmpty(): Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun subList(fromIndex: Int, toIndex: Int): MutableList<CompilationDatabase.CompilationDatabaseEntry>
Link copied to clipboard
open override fun toArray(): Array<Any>
open override fun <T : Any> toArray(p0: Array<T>): Array<T>
open fun <T : Any> toArray(p0: IntFunction<Array<T>>): Array<T>
Link copied to clipboard
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
open fun trimToSize()