aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2023-04-17 09:57:53 -0700
committerFangrui Song <i@maskray.me>2023-04-17 09:57:53 -0700
commit676a96f768e1101ed5187c7751e56e1e11ebe593 (patch)
treeadd440881ac4df8f49decd129623123b44e8d089 /llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
parent65aaabc8d1079a3ada643350842336dac39126db (diff)
downloadllvm-676a96f768e1101ed5187c7751e56e1e11ebe593.zip
llvm-676a96f768e1101ed5187c7751e56e1e11ebe593.tar.gz
llvm-676a96f768e1101ed5187c7751e56e1e11ebe593.tar.bz2
[Parse] Remove TimeTraceScope for "ParseTemplate"
Fix https://github.com/llvm/llvm-project/issues/56554 ``` #include "1.h" #include "2.h" int foo(); ``` Suppose that 1.h ends with a template function. When parsing the function, the `ParseFunctionDefinition` call after the TimeTraceScope object may consume a `r_brace` token and lex the end of file (1.h), resulting in an ExitFile event in SemaPPCallbacks::FileChanged. This event will call `llvm::timeTraceProfilerEnd();`, which incorrectly ends "ParseTemplate" instead of "Source" (1.h). Once 2.h has been fully parsed, the destructor of 1.h's TimeTraceScope object will end "Source" (1.h). This behavior erroneously extends the end of "Source" (1.h), which makes "Source" (2.h) appear to be nested inside "Source" (1.h). This bug is difficult to fix correctly in an elegant way, and we have two options: either end "ParseTemplate" when ending "Source" (1.h), or delay the ExitFile event. However, both approaches require complex code. For now, we can remove the "ParseTemplate" TimeTraceScope. This can be re-added if properly repaired. Reviewed By: anton-afanasyev Differential Revision: https://reviews.llvm.org/D148410
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp')
0 files changed, 0 insertions, 0 deletions