]> granicus.if.org Git - clang/commitdiff
[Test][Time profiler] Fix test for python3
authorAnton Afanasyev <anton.a.afanasyev@gmail.com>
Thu, 29 Aug 2019 06:49:05 +0000 (06:49 +0000)
committerAnton Afanasyev <anton.a.afanasyev@gmail.com>
Thu, 29 Aug 2019 06:49:05 +0000 (06:49 +0000)
Summary:
Fix test checking time profiler generates correct tracing json-file.
`filter` works differently for python2 and python3, so unifying this.

Reviewers: mgehre, nathanchance

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D66873

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@370300 91177308-0d34-0410-b5e6-96231b3b80d8

test/Driver/check-time-trace-sections.py

index e807dae24a8589908769be9d7b2ba593f4878702..7b598537a5b01247e9c3d64e0a8cd69bd295a656 100644 (file)
@@ -12,9 +12,9 @@ def is_before(range1, range2):
     return b <= c
 
 events = json.loads(sys.stdin.read())["traceEvents"]
-codegens = filter(lambda x: x["name"] == "CodeGen Function", events)
-frontends = filter(lambda x: x["name"] == "Frontend", events)
-backends = filter(lambda x: x["name"] == "Backend", events)
+codegens = [event for event in events if event["name"] == "CodeGen Function"]
+frontends = [event for event in events if event["name"] == "Frontend"]
+backends = [event for event in events if event["name"] == "Backend"]
 
 if not all([any([is_inside(codegen, frontend) for frontend in frontends])
                         for codegen in codegens]):