diff options
author | Takashi Iwai <tiwai@suse.de> | 2018-07-18 17:42:34 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2018-07-18 17:42:40 +0200 |
commit | 67ece13ffe862f9d17a144c6cd3feef88a57db13 (patch) | |
tree | ec2036681d19a9c10b2fad941eb8f58f9eafcfc8 /tools/perf/util/c++/clang.cpp | |
parent | fa84cf094ef9667e2b91c104b0a788fd1896f482 (diff) | |
parent | 4aaf448fa9754e2d5ee188d32327b24ffc15ca4d (diff) | |
download | lwn-67ece13ffe862f9d17a144c6cd3feef88a57db13.tar.gz lwn-67ece13ffe862f9d17a144c6cd3feef88a57db13.zip |
Merge branch 'topic/vga_switcheroo' into for-next
Pull the vga_switcheroo audio client fix.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'tools/perf/util/c++/clang.cpp')
-rw-r--r-- | tools/perf/util/c++/clang.cpp | 11 |
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) raw_svector_ostream ostream(*Buffer); legacy::PassManager PM; - if (TargetMachine->addPassesToEmitFile(PM, ostream, - TargetMachine::CGFT_ObjectFile)) { + bool NotAdded; +#if CLANG_VERSION_MAJOR < 7 + NotAdded = TargetMachine->addPassesToEmitFile(PM, ostream, + TargetMachine::CGFT_ObjectFile); +#else + NotAdded = TargetMachine->addPassesToEmitFile(PM, ostream, nullptr, + TargetMachine::CGFT_ObjectFile); +#endif + if (NotAdded) { llvm::errs() << "TargetMachine can't emit a file of this type\n"; return std::unique_ptr<llvm::SmallVectorImpl<char>>(nullptr);; } |