History

perf clang: Fix header include for LLVM >= 14

The header TargetRegistry.h has moved in LLVM/clang 14. Committer notes: The problem as noticed when building in ubuntu:22.04: 90 98.61 ubuntu:22.04 : FAIL gcc version 11.2.0 (Ubuntu 11.2.0-19ubuntu1) util/c++/clang.cpp:23:10: fatal error: llvm/Support/TargetRegistry.h: No such file or directory 23 | #include "llvm/Support/TargetRegistry.h" | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated. Fixed after applying this patch.

Guilherme Amadio committed 4 years ago

Commit d22588d1 parent 06fb4ec1 file · +4 −0Browse files

Unified · Split

tools/perf/util/c++/clang.cpp+4−0
@@ -20,7 +20,11 @@ · 19 unmodified lines
2020 #include "llvm/Option/Option.h"
2121 #include "llvm/Support/FileSystem.h"
2222 #include "llvm/Support/ManagedStatic.h"
23+#if CLANG_VERSION_MAJOR >= 14
24+#include "llvm/MC/TargetRegistry.h"
25+#else
2326 #include "llvm/Support/TargetRegistry.h"
27+#endif
2428 #include "llvm/Support/TargetSelect.h"
2529 #include "llvm/Target/TargetMachine.h"
2630 #include "llvm/Target/TargetOptions.h"

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t