[llvm] r215191 - AArch64: stop trying to take control of all UnknownArch triples.
Tim Northover
tnorthover at apple.com
Fri Aug 8 01:27:44 PDT 2014
Author: tnorthover
Date: Fri Aug 8 03:27:44 2014
New Revision: 215191
URL: http://llvm.org/viewvc/llvm-project?rev=215191&view=rev
Log:
AArch64: stop trying to take control of all UnknownArch triples.
This short-circuited our error reporting for incorrectly specified
target triples (you'd get AArch64 code instead).
Should fix PR20567.
Added:
llvm/trunk/test/CodeGen/AArch64/dont-take-over-the-world.ll
Modified:
llvm/trunk/lib/Target/AArch64/TargetInfo/AArch64TargetInfo.cpp
Modified: llvm/trunk/lib/Target/AArch64/TargetInfo/AArch64TargetInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/TargetInfo/AArch64TargetInfo.cpp?rev=215191&r1=215190&r2=215191&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/TargetInfo/AArch64TargetInfo.cpp (original)
+++ llvm/trunk/lib/Target/AArch64/TargetInfo/AArch64TargetInfo.cpp Fri Aug 8 03:27:44 2014
@@ -20,8 +20,9 @@ Target TheARM64Target;
extern "C" void LLVMInitializeAArch64TargetInfo() {
// Now register the "arm64" name for use with "-march". We don't want it to
// take possession of the Triple::aarch64 tag though.
- RegisterTarget<Triple::UnknownArch, /*HasJIT=*/true> X(
- TheARM64Target, "arm64", "ARM64 (little endian)");
+ TargetRegistry::RegisterTarget(TheARM64Target, "arm64",
+ "ARM64 (little endian)",
+ [](Triple::ArchType) { return false; }, true);
RegisterTarget<Triple::aarch64, /*HasJIT=*/true> Z(
TheAArch64leTarget, "aarch64", "AArch64 (little endian)");
Added: llvm/trunk/test/CodeGen/AArch64/dont-take-over-the-world.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/dont-take-over-the-world.ll?rev=215191&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/AArch64/dont-take-over-the-world.ll (added)
+++ llvm/trunk/test/CodeGen/AArch64/dont-take-over-the-world.ll Fri Aug 8 03:27:44 2014
@@ -0,0 +1,7 @@
+; RUN: not llc -mtriple=x86-64 2>&1 | FileCheck %s
+
+; To support "arm64" as a -march option, we need to register a second AArch64
+; target, but we have to be careful how we do that so that it doesn't become the
+; target of last resort when the specified triple is completely wrong.
+
+; CHECK: unable to get target for 'x86-64', see --version and --triple.
More information about the llvm-commits
mailing list