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.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: He Kuang <hekuang@huawei.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: https://lkml.kernel.org/n/tip-1r5tvfnwiydjxhukgqs6bi11@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 2da39f1c
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include "probe-finder.h" // for MAX_PROBES #include "probe-finder.h" // for MAX_PROBES
#include "parse-events.h" #include "parse-events.h"
#include "strfilter.h" #include "strfilter.h"
#include "util.h"
#include "llvm-utils.h" #include "llvm-utils.h"
#include "c++/clang-c.h" #include "c++/clang-c.h"
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
#define PERF_UTIL_CLANG_C_H #define PERF_UTIL_CLANG_C_H
#include <stddef.h> /* for size_t */ #include <stddef.h> /* for size_t */
#include <util-cxx.h> /* for __maybe_unused */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
...@@ -22,6 +21,7 @@ extern int perf_clang__compile_bpf(const char *filename, ...@@ -22,6 +21,7 @@ extern int perf_clang__compile_bpf(const char *filename,
#else #else
#include <errno.h> #include <errno.h>
#include <linux/compiler.h> /* for __maybe_unused */
static inline void perf_clang__init(void) { } static inline void perf_clang__init(void) { }
static inline void perf_clang__cleanup(void) { } static inline void perf_clang__cleanup(void) { }
......
// SPDX-License-Identifier: GPL-2.0 // SPDX-License-Identifier: GPL-2.0
#include "clang.h" #include "clang.h"
#include "clang-c.h" #include "clang-c.h"
extern "C" {
#include "../util.h"
}
#include "llvm/IR/Function.h" #include "llvm/IR/Function.h"
#include "llvm/IR/LLVMContext.h" #include "llvm/IR/LLVMContext.h"
#include <util-cxx.h>
#include <tests/llvm.h> #include <tests/llvm.h>
#include <string> #include <string>
......
/* 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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment