From 497b2a2abc7f67f8298b430e2b2d8106d2a768a6 Mon Sep 17 00:00:00 2001 From: Mihail Mihov Date: Thu, 16 May 2024 14:28:20 +0300 Subject: [PATCH] Remove `LIBCLAD_TIMING` environment variable fixes #790 --- test/Performance/Perf1 | 2 +- test/Performance/Perf2 | 2 +- tools/ClangPlugin.cpp | 6 ++---- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/test/Performance/Perf1 b/test/Performance/Perf1 index 47bbe6626..2d8c81cf9 100644 --- a/test/Performance/Perf1 +++ b/test/Performance/Perf1 @@ -1,4 +1,4 @@ -// RUN: time LIBCLAD_TIMING=1 %cladclang %s -O3 -I%S/../../include -std=c++11 -oPerf1.out 2>&1 | FileCheck %s +// RUN: %cladclang %s -O3 -ftime-report -I%S/../../include -std=c++11 -oPerf1.out 2>&1 | FileCheck %s // RUN: ./Perf1.out | FileCheck -check-prefix=CHECK-EXEC %s //#define COMPILER_TEST_ONLY diff --git a/test/Performance/Perf2 b/test/Performance/Perf2 index fced9c919..6cc76ecc3 100644 --- a/test/Performance/Perf2 +++ b/test/Performance/Perf2 @@ -1,4 +1,4 @@ -// RUN: time LIBCLAD_TIMING=1 %cladclang %s -O3 -I%S/../../include -std=c++11 -oPerf1.out 2>&1 | FileCheck %s +// RUN: %cladclang %s -O3 -ftime-report -I%S/../../include -std=c++11 -oPerf1.out 2>&1 | FileCheck %s // RUN: ./Perf1.out | FileCheck -check-prefix=CHECK-EXEC %s //#define COMPILER_TEST_ONLY diff --git a/tools/ClangPlugin.cpp b/tools/ClangPlugin.cpp index 2f4a06fd5..c667ddd2c 100644 --- a/tools/ClangPlugin.cpp +++ b/tools/ClangPlugin.cpp @@ -197,11 +197,9 @@ namespace clad { // derive the collected functions #if CLANG_VERSION_MAJOR > 11 - bool WantTiming = - getenv("LIBCLAD_TIMING") || m_CI.getCodeGenOpts().TimePasses; + bool WantTiming = m_CI.getCodeGenOpts().TimePasses; #else - bool WantTiming = - getenv("LIBCLAD_TIMING") || m_CI.getFrontendOpts().ShowTimers; + bool WantTiming = m_CI.getFrontendOpts().ShowTimers; #endif auto DFI = m_DFC.Find(request);