OSDN Git Service

simplify some code
authorChris Lattner <sabre@nondot.org>
Thu, 23 Mar 2006 05:29:04 +0000 (05:29 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 23 Mar 2006 05:29:04 +0000 (05:29 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26972 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/LegalizeDAG.cpp

index e6a9b89..0300d33 100644 (file)
@@ -3435,14 +3435,11 @@ SDOperand SelectionDAGLegalize::ExpandLegalINT_TO_FP(bool isSigned,
     // word offset constant for Hi/Lo address computation
     SDOperand WordOff = DAG.getConstant(sizeof(int), TLI.getPointerTy());
     // set up Hi and Lo (into buffer) address based on endian
-    SDOperand Hi, Lo;
-    if (TLI.isLittleEndian()) {
-      Hi = DAG.getNode(ISD::ADD, TLI.getPointerTy(), StackSlot, WordOff);
-      Lo = StackSlot;
-    } else {
-      Hi = StackSlot;
-      Lo = DAG.getNode(ISD::ADD, TLI.getPointerTy(), StackSlot, WordOff);
-    }
+    SDOperand Hi = StackSlot;
+    SDOperand Lo = DAG.getNode(ISD::ADD, TLI.getPointerTy(), StackSlot,WordOff);
+    if (TLI.isLittleEndian())
+      std::swap(Hi, Lo);
+    
     // if signed map to unsigned space
     SDOperand Op0Mapped;
     if (isSigned) {