Skip to contentSkip to conversation

perf clang: Delete needless util-cxx.h header

tip: perf/core tip-bot2 for Arnaldo Carvalho de Melo 1 participant 1 message Aug 29, 2019 1 message not in the archive perf events

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

tip-bot2 for Arnaldo Carvalho de Melo

author merge bot Applied
#1 lore raw

The following commit has been merged into the perf/core branch of tip:

Commit-ID:     630aec1a7fd60ac355d5f2d67b5454912c5971a6
Gitweb:        https://git.kernel.org/tip/630aec1a7fd60ac355d5f2d67b5454912c5971a6
Author:        Arnaldo Carvalho de Melo <[email protected]>
AuthorDate:    Wed, 28 Aug 2019 09:59:10 -03:00
Committer:     Arnaldo Carvalho de Melo <[email protected]>
CommitterDate: Wed, 28 Aug 2019 18:14:57 -03:00

perf clang: Delete needless util-cxx.h header

It was put in place just to make sure the 'new' C++ operator wouldn't clash with some argument name in util.h, but there is not anymore any such argument and also the reason stated for util.h to be included there was to get the __maybe_unused definition, that is in linux/compiler.h, so use that instead and nuke util-cxx.h.

---
 tools/perf/util/bpf-loader.c       |  1 +
 tools/perf/util/c++/clang-c.h      |  2 +-
 tools/perf/util/c++/clang-test.cpp |  4 +++-
 tools/perf/util/util-cxx.h         | 27 ---------------------------
 4 files changed, 5 insertions(+), 29 deletions(-)
 delete mode 100644 tools/perf/util/util-cxx.h
tools/perf/util/bpf-loader.c +1 -0
index e20d7c5..80a828e 100644
@@ -23,6 +23,7 @@
 #include "probe-finder.h" // for MAX_PROBES
 #include "parse-events.h"
 #include "strfilter.h"
+#include "util.h"
 #include "llvm-utils.h"
 #include "c++/clang-c.h"
 
tools/perf/util/c++/clang-c.h +1 -1
index e513366..2df8a45 100644
@@ -3,7 +3,6 @@
 #define PERF_UTIL_CLANG_C_H
 
 #include <stddef.h>	/* for size_t */
-#include <util-cxx.h>	/* for __maybe_unused */
 
 #ifdef __cplusplus
 extern "C" {
@@ -22,6 +21,7 @@ extern int perf_clang__compile_bpf(const char *filename,
 #else
 
 #include <errno.h>
+#include <linux/compiler.h>	/* for __maybe_unused */
 
 static inline void perf_clang__init(void) { }
 static inline void perf_clang__cleanup(void) { }
tools/perf/util/c++/clang-test.cpp +3 -1
index 7b042a5..21b2360 100644
@@ -1,10 +1,12 @@
 // SPDX-License-Identifier: GPL-2.0
 #include "clang.h"
 #include "clang-c.h"
+extern "C" {
+#include "../util.h"
+}
 #include "llvm/IR/Function.h"
 #include "llvm/IR/LLVMContext.h"
 
-#include <util-cxx.h>
 #include <tests/llvm.h>
 #include <string>
 
tools/perf/util/util-cxx.h deleted +0 -27
deleted file mode 100644
index 80a99e4..0000000
@@ -1,27 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/*
- * Support C++ source use utilities defined in util.h
- */
-
-#ifndef PERF_UTIL_UTIL_CXX_H
-#define PERF_UTIL_UTIL_CXX_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Now 'new' is the only C++ keyword found in util.h:
- * in tools/include/linux/rbtree.h
- *
- * Other keywords, like class and delete, should be
- * redefined if necessary.
- */
-#define new _new
-#include "util.h"
-#undef new
-
-#ifdef __cplusplus
-}
-#endif
-#endif