未验证 提交 ebc8e7d6 编写于 作者: J Janusz Wrobel 提交者: GitHub

Add activity for file parsing in a lower-level method executed in all workflows. (#14928)

* Move activity for file parsing to a method used by all workflows.

* Tiny refactor

* Fantomas
上级 f2400de9
......@@ -415,8 +415,19 @@ let ParseInput
defaultNamespace,
fileName,
isLastCompiland,
identCapture
identCapture,
userOpName
) =
use _ =
Activity.start
"ParseAndCheckFile.parseFile"
[|
Activity.Tags.fileName, fileName
Activity.Tags.buildPhase, BuildPhase.Parse.ToString()
Activity.Tags.userOpName, userOpName |> Option.defaultValue ""
|]
// The assert below is almost ok, but it fires in two cases:
// - fsi.exe sometimes passes "stdin" as a dummy file name
// - if you have a #line directive, e.g.
......@@ -647,7 +658,8 @@ let ParseOneInputLexbuf (tcConfig: TcConfig, lexResourceManager, lexbuf, fileNam
None,
fileName,
isLastCompiland,
tcConfig.captureIdentifiersWhenParsing
tcConfig.captureIdentifiersWhenParsing,
None
)
// Report the statistics for testing purposes
......
......@@ -40,7 +40,8 @@ val ParseInput:
defaultNamespace: string option *
fileName: string *
isLastCompiland: (bool * bool) *
identCapture: bool ->
identCapture: bool *
userOpName: string option ->
ParsedInput
/// A general routine to process hash directives
......
......@@ -2392,7 +2392,8 @@ module internal ParseAndCheckFile =
None,
fileName,
(isLastCompiland, isExe),
identCapture
identCapture,
Some userOpName
)
with e ->
errHandler.DiagnosticsLogger.StopProcessingRecovery e range0 // don't re-raise any exceptions, we must return None.
......
......@@ -168,7 +168,7 @@ module IncrementalBuildSyntaxTree =
Activity.start "IncrementalBuildSyntaxTree.parseOrSkip"
[|
Activity.Tags.fileName, fileName
"buildPhase", BuildPhase.Parse.ToString()
Activity.Tags.buildPhase, BuildPhase.Parse.ToString()
"canSkip", (isImplFile && sigNameOpt |> Option.isSome).ToString()
|]
......
......@@ -25,6 +25,7 @@ module internal Activity =
let gc1 = "gc1"
let gc2 = "gc2"
let outputDllFile = "outputDllFile"
let buildPhase = "buildPhase"
let AllKnownTags =
[|
......@@ -40,6 +41,7 @@ module internal Activity =
gc1
gc2
outputDllFile
buildPhase
|]
module Events =
......
......@@ -18,6 +18,7 @@ module internal Activity =
val userOpName: string
val length: string
val cache: string
val buildPhase: string
module Events =
val cacheHit: string
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册