[llvm] r265570 - [AArch64] Change the CMake to avoid to build GlobalISel related APIs
Quentin Colombet via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 6 10:38:14 PDT 2016
Author: qcolombet
Date: Wed Apr 6 12:38:12 2016
New Revision: 265570
URL: http://llvm.org/viewvc/llvm-project?rev=265570&view=rev
Log:
[AArch64] Change the CMake to avoid to build GlobalISel related APIs
when GISel is not built.
The positive side effects are:
- We do not have to define dummy implementation
- We do not have to do weird gymnastic to avoid like issues (like
missing constructor or vtable for the base classes)
Modified:
llvm/trunk/lib/Target/AArch64/AArch64RegisterBankInfo.cpp
llvm/trunk/lib/Target/AArch64/CMakeLists.txt
Modified: llvm/trunk/lib/Target/AArch64/AArch64RegisterBankInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64RegisterBankInfo.cpp?rev=265570&r1=265569&r2=265570&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/AArch64RegisterBankInfo.cpp (original)
+++ llvm/trunk/lib/Target/AArch64/AArch64RegisterBankInfo.cpp Wed Apr 6 12:38:12 2016
@@ -21,16 +21,9 @@
using namespace llvm;
#ifndef LLVM_BUILD_GLOBAL_ISEL
-AArch64RegisterBankInfo::AArch64RegisterBankInfo(const TargetRegisterInfo &TRI)
- : RegisterBankInfo() {
- llvm_unreachable("This API shouldn't be useful outside of GlobalISel");
-}
+#error You shouldn't build this
+#endif
-unsigned AArch64RegisterBankInfo::copyCost(const RegisterBank &A,
- const RegisterBank &B) const {
- return 0;
-}
-#else
AArch64RegisterBankInfo::AArch64RegisterBankInfo(const TargetRegisterInfo &TRI)
: RegisterBankInfo(AArch64::NumRegisterBanks) {
// Initialize the GPR bank.
@@ -70,4 +63,3 @@ unsigned AArch64RegisterBankInfo::copyCo
// * build_sequence cost.
return 0;
}
-#endif
Modified: llvm/trunk/lib/Target/AArch64/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/CMakeLists.txt?rev=265570&r1=265569&r2=265570&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/CMakeLists.txt (original)
+++ llvm/trunk/lib/Target/AArch64/CMakeLists.txt Wed Apr 6 12:38:12 2016
@@ -14,18 +14,20 @@ tablegen(LLVM AArch64GenSubtargetInfo.in
tablegen(LLVM AArch64GenDisassemblerTables.inc -gen-disassembler)
add_public_tablegen_target(AArch64CommonTableGen)
+# List of all GlobalISel files.
set(GLOBAL_ISEL_FILES
- AArch64RegisterBankInfo.cpp
- )
+ AArch64RegisterBankInfo.cpp
+ )
-if(NOT LLVM_BUILD_GLOBAL_ISEL)
- set(LLVM_OPTIONAL_SOURCES ${GLOBAL_ISEL_FILES})
- set(GLOBAL_ISEL_FILES)
+# Add GlobalISel files to the dependencies if the user wants to build it.
+if(LLVM_BUILD_GLOBAL_ISEL)
+ set(GLOBAL_ISEL_BUILD_FILES ${GLOBAL_ISEL_FILES})
+else()
+ set(GLOBAL_ISEL_BUILD_FILES"")
+ set(LLVM_OPTIONAL_SOURCES LLVMGlobalISel ${GLOBAL_ISEL_FILES})
endif()
-set(LLVM_OPTIONAL_SOURCES AArch64RegisterBankInfo.cpp)
-
add_llvm_target(AArch64CodeGen
AArch64A57FPLoadBalancing.cpp
AArch64AddressTypePromotion.cpp
@@ -57,7 +59,7 @@ add_llvm_target(AArch64CodeGen
AArch64TargetMachine.cpp
AArch64TargetObjectFile.cpp
AArch64TargetTransformInfo.cpp
- ${GLOBAL_ISEL_FILES}
+ ${GLOBAL_ISEL_BUILD_FILES}
)
add_dependencies(LLVMAArch64CodeGen intrinsics_gen)
More information about the llvm-commits
mailing list