- Change "ExternalSymbolSDNode" to "SymbolSDNode".
- Add linkage to SymbolSDNode (default to external).
- Change ISD::ExternalSymbol to ISD::Symbol.
- Change ISD::TargetExternalSymbol to ISD::TargetSymbol

These changes pave the way to allowing SymbolSDNodes with non-external linkage.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56249 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/PowerPC/PPCISelLowering.cpp b/lib/Target/PowerPC/PPCISelLowering.cpp
index 1a891d9..6de90d9 100644
--- a/lib/Target/PowerPC/PPCISelLowering.cpp
+++ b/lib/Target/PowerPC/PPCISelLowering.cpp
@@ -2462,13 +2462,14 @@
   SmallVector<SDValue, 8> Ops;
   unsigned CallOpc = isMachoABI? PPCISD::CALL_Macho : PPCISD::CALL_ELF;
   
-  // If the callee is a GlobalAddress/ExternalSymbol node (quite common, every
-  // direct call is) turn it into a TargetGlobalAddress/TargetExternalSymbol
-  // node so that legalize doesn't hack it.
+  // If the callee is a GlobalAddress/Symbol node (quite common, every direct
+  // call is) turn it into a TargetGlobalAddress/TargetSymbol node so that
+  // legalize doesn't hack it.
   if (GlobalAddressSDNode *G = dyn_cast<GlobalAddressSDNode>(Callee))
     Callee = DAG.getTargetGlobalAddress(G->getGlobal(), Callee.getValueType());
-  else if (ExternalSymbolSDNode *S = dyn_cast<ExternalSymbolSDNode>(Callee))
-    Callee = DAG.getTargetExternalSymbol(S->getSymbol(), Callee.getValueType());
+  else if (SymbolSDNode *S = dyn_cast<SymbolSDNode>(Callee))
+    Callee = DAG.getTargetSymbol(S->getSymbol(), Callee.getValueType(),
+                                 S->getLinkage());
   else if (SDNode *Dest = isBLACompatibleAddress(Callee, DAG))
     // If this is an absolute destination address, use the munged value.
     Callee = SDValue(Dest, 0);
@@ -2593,7 +2594,7 @@
 
     assert(((TargetAddress.getOpcode() == ISD::Register &&
              cast<RegisterSDNode>(TargetAddress)->getReg() == PPC::CTR) ||
-            TargetAddress.getOpcode() == ISD::TargetExternalSymbol ||
+            TargetAddress.getOpcode() == ISD::TargetSymbol ||
             TargetAddress.getOpcode() == ISD::TargetGlobalAddress ||
             isa<ConstantSDNode>(TargetAddress)) &&
     "Expecting an global address, external symbol, absolute value or register");
@@ -3414,7 +3415,7 @@
 static SDValue GeneratePerfectShuffle(unsigned PFEntry, SDValue LHS,
                                         SDValue RHS, SelectionDAG &DAG) {
   unsigned OpNum = (PFEntry >> 26) & 0x0F;
-  unsigned LHSID  = (PFEntry >> 13) & ((1 << 13)-1);
+  unsigned LHSID = (PFEntry >> 13) & ((1 << 13)-1);
   unsigned RHSID = (PFEntry >>  0) & ((1 << 13)-1);
   
   enum {