aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/c++/clang.cpp
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2018-07-06 06:35:56 -0400
committerThomas Gleixner <tglx@linutronix.de>2018-07-06 06:35:56 -0400
commit8f63e9230decb06ea9068feaf0845c0eb39ab890 (patch)
treea45cee821404ab0c7f7164e20c2f40f5e34ac16b /tools/perf/util/c++/clang.cpp
parent58ec5e9c9044bd7e1c0bcc6ad822b2e909f49732 (diff)
parent1268ed0c474a5c8f165ef386f3310521b5e00e27 (diff)
Merge branch 'x86/urgent' into x86/hyperv
Integrate the upstream bug fix to resolve the resulting conflict in __send_ipi_mask(). Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'tools/perf/util/c++/clang.cpp')
-rw-r--r--tools/perf/util/c++/clang.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/tools/perf/util/c++/clang.cpp b/tools/perf/util/c++/clang.cpp
index bf31ceab33bd..89512504551b 100644
--- a/tools/perf/util/c++/clang.cpp
+++ b/tools/perf/util/c++/clang.cpp
@@ -146,8 +146,15 @@ getBPFObjectFromModule(llvm::Module *Module)
146 raw_svector_ostream ostream(*Buffer); 146 raw_svector_ostream ostream(*Buffer);
147 147
148 legacy::PassManager PM; 148 legacy::PassManager PM;
149 if (TargetMachine->addPassesToEmitFile(PM, ostream, 149 bool NotAdded;
150 TargetMachine::CGFT_ObjectFile)) { 150#if CLANG_VERSION_MAJOR < 7
151 NotAdded = TargetMachine->addPassesToEmitFile(PM, ostream,
152 TargetMachine::CGFT_ObjectFile);
153#else
154 NotAdded = TargetMachine->addPassesToEmitFile(PM, ostream, nullptr,
155 TargetMachine::CGFT_ObjectFile);
156#endif
157 if (NotAdded) {
151 llvm::errs() << "TargetMachine can't emit a file of this type\n"; 158 llvm::errs() << "TargetMachine can't emit a file of this type\n";
152 return std::unique_ptr<llvm::SmallVectorImpl<char>>(nullptr);; 159 return std::unique_ptr<llvm::SmallVectorImpl<char>>(nullptr);;
153 } 160 }