Files
clang-p2996/clang/test/Driver/check-time-trace-ParseDeclarationOrFunctionDefinition.cpp
Ying Yi 700d93b058 Add two time-trace scope variables.
A time trace scope variable of `ParseDeclarationOrFunctionDefinition`
with the function's source location is added to record the time spent
parsing the function's declaration or definition. Another time trace
scope variable of `ParseFunctionDefinition` is also added to record the
name of the defined function. A release note is added as well.

Reviewed by: Aaron Ballman
Pull request: #65268
2023-11-01 13:37:52 +00:00

16 lines
721 B
C++

// RUN: %clangxx -S -ftime-trace -ftime-trace-granularity=0 -o %T/check-time-trace-ParseDeclarationOrFunctionDefinition %s
// RUN: cat %T/check-time-trace-ParseDeclarationOrFunctionDefinition.json \
// RUN: | %python -c 'import json, sys; json.dump(json.loads(sys.stdin.read()), sys.stdout, sort_keys=True, indent=2)' \
// RUN: | FileCheck %s
// CHECK-DAG: "name": "ParseDeclarationOrFunctionDefinition"
// CHECK-DAG: "detail": "{{.*}}check-time-trace-ParseDeclarationOrFunctionDefinition.cpp:15:1"
// CHECK-DAG: "name": "ParseFunctionDefinition"
// CHECK-DAG: "detail": "foo"
// CHECK-DAG: "name": "ParseFunctionDefinition"
// CHECK-DAG: "detail": "bar"
template <typename T>
void foo(T) {}
void bar() { foo(0); }