aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Schmidt <wschmidt@linux.vnet.ibm.com>2013-02-21 14:35:42 +0000
committerBill Schmidt <wschmidt@linux.vnet.ibm.com>2013-02-21 14:35:42 +0000
commit0514595b9b20c9d807a3e31ba6bc270fb6c3f9e7 (patch)
treebd9b1f8262231275262ba86967b086d3754b2307
parent74bf7a8467262ad60c8b13582bd6b07fd30b5550 (diff)
Code review cleanup for r175697
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175739 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/PowerPC/PPCISelDAGToDAG.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/lib/Target/PowerPC/PPCISelDAGToDAG.cpp b/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
index 8663dd41e5..561099b24b 100644
--- a/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
+++ b/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
@@ -1524,20 +1524,16 @@ void PPCDAGToDAGISel::PostprocessISelDAG() {
// If the relocation information isn't already present on the
// immediate operand, add it now.
if (ReplaceFlags) {
- GlobalAddressSDNode *GA = dyn_cast<GlobalAddressSDNode>(ImmOpnd);
-
- if (GA) {
+ if (GlobalAddressSDNode *GA = dyn_cast<GlobalAddressSDNode>(ImmOpnd)) {
DebugLoc dl = GA->getDebugLoc();
const GlobalValue *GV = GA->getGlobal();
ImmOpnd = CurDAG->getTargetGlobalAddress(GV, dl, MVT::i64, 0, Flags);
- } else {
- ConstantPoolSDNode *CP = dyn_cast<ConstantPoolSDNode>(ImmOpnd);
- if (CP) {
- const Constant *C = CP->getConstVal();
- ImmOpnd = CurDAG->getTargetConstantPool(C, MVT::i64,
- CP->getAlignment(),
- 0, Flags);
- }
+ }
+ else if (ConstantPoolSDNode *CP = dyn_cast<ConstantPoolSDNode>(ImmOpnd)) {
+ const Constant *C = CP->getConstVal();
+ ImmOpnd = CurDAG->getTargetConstantPool(C, MVT::i64,
+ CP->getAlignment(),
+ 0, Flags);
}
}