1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef PERF_UTIL_CLANG_H
3 #define PERF_UTIL_CLANG_H
4 
5 #include "llvm/ADT/StringRef.h"
6 #include "llvm/IR/LLVMContext.h"
7 #include "llvm/IR/Module.h"
8 #include "llvm/Option/Option.h"
9 #include <memory>
10 
11 namespace perf {
12 
13 using namespace llvm;
14 
15 std::unique_ptr<Module>
16 getModuleFromSource(opt::ArgStringList CFlags,
17 		    StringRef Name, StringRef Content);
18 
19 std::unique_ptr<Module>
20 getModuleFromSource(opt::ArgStringList CFlags,
21 		    StringRef Path);
22 
23 std::unique_ptr<llvm::SmallVectorImpl<char>>
24 getBPFObjectFromModule(llvm::Module *Module);
25 
26 }
27 #endif
28