[PATCH] D48778: [llvm-exegesis] Change how the native architecture is determined
John Brawn via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 29 10:43:55 PDT 2018
john.brawn created this revision.
john.brawn added reviewers: courbet, gchatelet.
Herald added subscribers: tschuett, mgorny.
Currently the llvm-exegesis native architecture is determined by comparing the llvm native architecture with X86, so to add a new target would mean adding a new check. Change this to building up a list of the targets llvm-exegesis supports then using that, as this means that when adding a new target you just add the target to the list of supported targets.
Repository:
rL LLVM
https://reviews.llvm.org/D48778
Files:
tools/llvm-exegesis/CMakeLists.txt
tools/llvm-exegesis/lib/CMakeLists.txt
Index: tools/llvm-exegesis/lib/CMakeLists.txt
===================================================================
--- tools/llvm-exegesis/lib/CMakeLists.txt
+++ tools/llvm-exegesis/lib/CMakeLists.txt
@@ -1,5 +1,6 @@
if (LLVM_TARGETS_TO_BUILD MATCHES "X86")
add_subdirectory(X86)
+ set(LLVM_EXEGESIS_TARGETS "${LLVM_EXEGESIS_TARGETS} X86" PARENT_SCOPE)
endif()
add_library(LLVMExegesis
Index: tools/llvm-exegesis/CMakeLists.txt
===================================================================
--- tools/llvm-exegesis/CMakeLists.txt
+++ tools/llvm-exegesis/CMakeLists.txt
@@ -11,8 +11,8 @@
add_subdirectory(lib)
# Link the native exegesis target if compiled and on the right host.
-if ((LLVM_TARGETS_TO_BUILD MATCHES "X86") AND ("${LLVM_NATIVE_ARCH}" STREQUAL "X86"))
- set(LLVM_EXEGESIS_NATIVE_ARCH "X86")
+if ((LLVM_TARGETS_TO_BUILD MATCHES "${LLVM_NATIVE_ARCH}") AND (LLVM_EXEGESIS_TARGETS MATCHES "${LLVM_NATIVE_ARCH}"))
+ set(LLVM_EXEGESIS_NATIVE_ARCH "${LLVM_NATIVE_ARCH}")
endif()
if (LLVM_EXEGESIS_NATIVE_ARCH)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48778.153531.patch
Type: text/x-patch
Size: 1039 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180629/0c1e9c8d/attachment.bin>
More information about the llvm-commits
mailing list