Skip to content

Commit 8b6809b

Browse files
author
git apple-llvm automerger
committed
Merge commit '03ec84a00ba4' from llvm.org/main into next
2 parents 20274d3 + 03ec84a commit 8b6809b

File tree

4 files changed

+19
-62
lines changed

4 files changed

+19
-62
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -427,14 +427,6 @@ Improvements to Clang's diagnostics
427427
(or, more commonly, ``NULL`` when the platform defines it as ``__null``) to be more consistent
428428
with GCC.
429429

430-
Improvements to Clang's time-trace
431-
----------------------------------
432-
- Two time-trace scope variables are added. A time trace scope variable of
433-
``ParseDeclarationOrFunctionDefinition`` with the function's source location
434-
is added to record the time spent parsing the function's declaration or
435-
definition. Another time trace scope variable of ``ParseFunctionDefinition``
436-
is also added to record the name of the defined function.
437-
438430
Bug Fixes in This Version
439431
-------------------------
440432
- Fixed an issue where a class template specialization whose declaration is

clang/lib/Parse/Parser.cpp

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,15 @@
1313
#include "clang/Parse/Parser.h"
1414
#include "clang/AST/ASTConsumer.h"
1515
#include "clang/AST/ASTContext.h"
16-
#include "clang/AST/ASTLambda.h"
1716
#include "clang/AST/DeclTemplate.h"
17+
#include "clang/AST/ASTLambda.h"
1818
#include "clang/Basic/FileManager.h"
1919
#include "clang/Parse/ParseDiagnostic.h"
2020
#include "clang/Parse/RAIIObjectsForParser.h"
2121
#include "clang/Sema/DeclSpec.h"
2222
#include "clang/Sema/ParsedTemplate.h"
2323
#include "clang/Sema/Scope.h"
2424
#include "llvm/Support/Path.h"
25-
#include "llvm/Support/TimeProfiler.h"
2625
using namespace clang;
2726

2827

@@ -1238,13 +1237,6 @@ Parser::DeclGroupPtrTy Parser::ParseDeclOrFunctionDefInternal(
12381237
Parser::DeclGroupPtrTy Parser::ParseDeclarationOrFunctionDefinition(
12391238
ParsedAttributes &Attrs, ParsedAttributes &DeclSpecAttrs,
12401239
ParsingDeclSpec *DS, AccessSpecifier AS) {
1241-
// Add an enclosing time trace scope for a bunch of small scopes with
1242-
// "EvaluateAsConstExpr".
1243-
llvm::TimeTraceScope TimeScope(
1244-
"ParseDeclarationOrFunctionDefinition",
1245-
Tok.getLocation().printToString(
1246-
Actions.getASTContext().getSourceManager()));
1247-
12481240
if (DS) {
12491241
return ParseDeclOrFunctionDefInternal(Attrs, DeclSpecAttrs, *DS, AS);
12501242
} else {
@@ -1275,10 +1267,6 @@ Parser::DeclGroupPtrTy Parser::ParseDeclarationOrFunctionDefinition(
12751267
Decl *Parser::ParseFunctionDefinition(ParsingDeclarator &D,
12761268
const ParsedTemplateInfo &TemplateInfo,
12771269
LateParsedAttrList *LateParsedAttrs) {
1278-
llvm::TimeTraceScope TimeScope(
1279-
"ParseFunctionDefinition",
1280-
Actions.GetNameForDeclarator(D).getName().getAsString());
1281-
12821270
// Poison SEH identifiers so they are flagged as illegal in function bodies.
12831271
PoisonSEHIdentifiersRAIIObject PoisonSEHIdentifiers(*this, true);
12841272
const DeclaratorChunk::FunctionTypeInfo &FTI = D.getFunctionTypeInfo();

clang/test/Driver/check-time-trace-ParseDeclarationOrFunctionDefinition.cpp

Lines changed: 0 additions & 15 deletions
This file was deleted.

clang/unittests/Support/TimeProfilerTest.cpp

Lines changed: 18 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -177,29 +177,22 @@ constexpr int slow_init_list[] = {1, 1, 2, 3, 5, 8, 13, 21}; // 25th line
177177
std::string TraceGraph = buildTraceGraph(Json);
178178
ASSERT_TRUE(TraceGraph == R"(
179179
Frontend
180-
| ParseDeclarationOrFunctionDefinition (test.cc:2:1)
181-
| ParseDeclarationOrFunctionDefinition (test.cc:6:1)
182-
| | ParseFunctionDefinition (slow_func)
183-
| | | EvaluateAsRValue (<test.cc:8:21>)
184-
| | | EvaluateForOverflow (<test.cc:8:21, col:25>)
185-
| | | EvaluateForOverflow (<test.cc:8:30, col:32>)
186-
| | | EvaluateAsRValue (<test.cc:9:14>)
187-
| | | EvaluateForOverflow (<test.cc:9:9, col:14>)
188-
| | | isPotentialConstantExpr (slow_namespace::slow_func)
189-
| | | EvaluateAsBooleanCondition (<test.cc:8:21, col:25>)
190-
| | | | EvaluateAsRValue (<test.cc:8:21, col:25>)
191-
| | | EvaluateAsBooleanCondition (<test.cc:8:21, col:25>)
192-
| | | | EvaluateAsRValue (<test.cc:8:21, col:25>)
193-
| ParseDeclarationOrFunctionDefinition (test.cc:16:1)
194-
| | ParseFunctionDefinition (slow_test)
195-
| | | EvaluateAsInitializer (slow_value)
196-
| | | EvaluateAsConstantExpr (<test.cc:17:33, col:59>)
197-
| | | EvaluateAsConstantExpr (<test.cc:18:11, col:37>)
198-
| ParseDeclarationOrFunctionDefinition (test.cc:22:1)
199-
| | EvaluateAsConstantExpr (<test.cc:23:31, col:57>)
200-
| | EvaluateAsRValue (<test.cc:22:14, line:23:58>)
201-
| ParseDeclarationOrFunctionDefinition (test.cc:25:1)
202-
| | EvaluateAsInitializer (slow_init_list)
180+
| EvaluateAsRValue (<test.cc:8:21>)
181+
| EvaluateForOverflow (<test.cc:8:21, col:25>)
182+
| EvaluateForOverflow (<test.cc:8:30, col:32>)
183+
| EvaluateAsRValue (<test.cc:9:14>)
184+
| EvaluateForOverflow (<test.cc:9:9, col:14>)
185+
| isPotentialConstantExpr (slow_namespace::slow_func)
186+
| EvaluateAsBooleanCondition (<test.cc:8:21, col:25>)
187+
| | EvaluateAsRValue (<test.cc:8:21, col:25>)
188+
| EvaluateAsBooleanCondition (<test.cc:8:21, col:25>)
189+
| | EvaluateAsRValue (<test.cc:8:21, col:25>)
190+
| EvaluateAsInitializer (slow_value)
191+
| EvaluateAsConstantExpr (<test.cc:17:33, col:59>)
192+
| EvaluateAsConstantExpr (<test.cc:18:11, col:37>)
193+
| EvaluateAsConstantExpr (<test.cc:23:31, col:57>)
194+
| EvaluateAsRValue (<test.cc:22:14, line:23:58>)
195+
| EvaluateAsInitializer (slow_init_list)
203196
| PerformPendingInstantiations
204197
)");
205198

@@ -220,9 +213,8 @@ struct {
220213
std::string TraceGraph = buildTraceGraph(Json);
221214
ASSERT_TRUE(TraceGraph == R"(
222215
Frontend
223-
| ParseDeclarationOrFunctionDefinition (test.c:2:1)
224-
| | isIntegerConstantExpr (<test.c:3:18>)
225-
| | EvaluateKnownConstIntCheckOverflow (<test.c:3:18>)
216+
| isIntegerConstantExpr (<test.c:3:18>)
217+
| EvaluateKnownConstIntCheckOverflow (<test.c:3:18>)
226218
| PerformPendingInstantiations
227219
)");
228220

0 commit comments

Comments
 (0)