summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2018-11-01 18:02:27 +0000
committerReid Kleckner <rnk@google.com>2018-11-01 18:02:27 +0000
commiteb56894a4befd0cf6c182af2a8542fe00f73c52c (patch)
tree451e03359b0bf54dc8e9a50007124ae220f409fb /llvm/lib
parentb0cdf56dd72b2d03e203a0c328618a7da15ebf5b (diff)
downloadbcm5719-llvm-eb56894a4befd0cf6c182af2a8542fe00f73c52c.tar.gz
bcm5719-llvm-eb56894a4befd0cf6c182af2a8542fe00f73c52c.zip
[AArch64] Fix unintended fallthrough and strengthen cast
This was added in r330630. GCC's -Wimplicit-fallthrough seems to not fire when the previous case contains a switch itself. This fallthrough was bening because the helper function implementing the case used dyn_cast to re-check the type of the node in question. After fixing the fallthrough, we can strengthen the cast. llvm-svn: 345864
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/AArch64/AArch64ISelLowering.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
index 3c107016c8b..e6a036e64d8 100644
--- a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+++ b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
@@ -11036,9 +11036,9 @@ static SDValue performNVCASTCombine(SDNode *N) {
static SDValue performGlobalAddressCombine(SDNode *N, SelectionDAG &DAG,
const AArch64Subtarget *Subtarget,
const TargetMachine &TM) {
- auto *GN = dyn_cast<GlobalAddressSDNode>(N);
- if (!GN || Subtarget->ClassifyGlobalReference(GN->getGlobal(), TM) !=
- AArch64II::MO_NO_FLAG)
+ auto *GN = cast<GlobalAddressSDNode>(N);
+ if (Subtarget->ClassifyGlobalReference(GN->getGlobal(), TM) !=
+ AArch64II::MO_NO_FLAG)
return SDValue();
uint64_t MinOffset = -1ull;
@@ -11170,6 +11170,7 @@ SDValue AArch64TargetLowering::PerformDAGCombine(SDNode *N,
default:
break;
}
+ break;
case ISD::GlobalAddress:
return performGlobalAddressCombine(N, DAG, Subtarget, getTargetMachine());
}
OpenPOWER on IntegriCloud