mirror of
https://github.com/torvalds/linux.git
synced 2026-11-26 16:33:17 +00:00
getBPFObjectFromModule() is introduced to compile LLVM IR(Module) to BPF object. Add new testcase for it. Test result: $ ./buildperf/perf test -v clang 51: builtin clang support : 51.1: builtin clang compile C source to IR : --- start --- test child forked, pid 21822 test child finished with 0 ---- end ---- builtin clang support subtest 0: Ok 51.2: builtin clang compile C source to ELF object : --- start --- test child forked, pid 21823 test child finished with 0 ---- end ---- builtin clang support subtest 1: Ok Signed-off-by: Wang Nan <[email protected]> Cc: Alexei Starovoitov <[email protected]> Cc: He Kuang <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Joe Stringer <[email protected]> Cc: Zefan Li <[email protected]> Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] [ Remove redundant "Test" from entry descriptions ] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
27 lines
548 B
C++
27 lines
548 B
C++
#ifndef PERF_UTIL_CLANG_H
|
|
#define PERF_UTIL_CLANG_H
|
|
|
|
#include "llvm/ADT/StringRef.h"
|
|
#include "llvm/IR/LLVMContext.h"
|
|
#include "llvm/IR/Module.h"
|
|
#include "llvm/Option/Option.h"
|
|
#include <memory>
|
|
|
|
namespace perf {
|
|
|
|
using namespace llvm;
|
|
|
|
std::unique_ptr<Module>
|
|
getModuleFromSource(opt::ArgStringList CFlags,
|
|
StringRef Name, StringRef Content);
|
|
|
|
std::unique_ptr<Module>
|
|
getModuleFromSource(opt::ArgStringList CFlags,
|
|
StringRef Path);
|
|
|
|
std::unique_ptr<llvm::SmallVectorImpl<char>>
|
|
getBPFObjectFromModule(llvm::Module *Module);
|
|
|
|
}
|
|
#endif
|