[K/N] Avoid string copying when setting up bridge debug info.
The name of the function was copied at least 4 times. This reduces a 56 seconds codegen phase in a non-optimized build by 2 seconds.
This commit is contained in:
+3
-6
@@ -275,20 +275,17 @@ internal fun setupBridgeDebugInfo(generationState: NativeGenerationState, functi
|
||||
val file = debugInfo.compilerGeneratedFile
|
||||
|
||||
// TODO: can we share the scope among all bridges?
|
||||
val scope: DIScopeOpaqueRef = DICreateFunction(
|
||||
val scope: DIScopeOpaqueRef = DICreateBridgeFunction(
|
||||
builder = debugInfo.builder,
|
||||
scope = file.reinterpret(),
|
||||
name = function.name,
|
||||
linkageName = function.name,
|
||||
function = function,
|
||||
file = file,
|
||||
lineNo = 0,
|
||||
type = debugInfo.subroutineType(generationState.runtime.targetData, emptyList()), // TODO: use proper type.
|
||||
isLocal = 0,
|
||||
isDefinition = 1,
|
||||
scopeLine = 0
|
||||
)!!.also {
|
||||
DIFunctionAddSubprogram(function, it)
|
||||
}.reinterpret()
|
||||
)!!.reinterpret()
|
||||
|
||||
return LocationInfo(scope, 1, 0)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user