From 9468a9b6beed640eca64274c8dcc5aed3b94450b Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Tue, 16 Sep 2008 21:12:30 +0000 Subject: - 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 --- include/llvm/CodeGen/ScheduleDAG.h | 2 +- include/llvm/CodeGen/SelectionDAG.h | 11 +++++++---- include/llvm/CodeGen/SelectionDAGNodes.h | 26 ++++++++++++++------------ 3 files changed, 22 insertions(+), 17 deletions(-) (limited to 'include/llvm') diff --git a/include/llvm/CodeGen/ScheduleDAG.h b/include/llvm/CodeGen/ScheduleDAG.h index 67f3dbb69f..bca5712737 100644 --- a/include/llvm/CodeGen/ScheduleDAG.h +++ b/include/llvm/CodeGen/ScheduleDAG.h @@ -278,7 +278,7 @@ namespace llvm { if (isa(Node)) return true; if (isa(Node)) return true; if (isa(Node)) return true; - if (isa(Node)) return true; + if (isa(Node)) return true; if (isa(Node)) return true; if (Node->getOpcode() == ISD::EntryToken) return true; return false; diff --git a/include/llvm/CodeGen/SelectionDAG.h b/include/llvm/CodeGen/SelectionDAG.h index 15d0edc3d8..b2611dfa79 100644 --- a/include/llvm/CodeGen/SelectionDAG.h +++ b/include/llvm/CodeGen/SelectionDAG.h @@ -282,8 +282,11 @@ public: return getConstantPool(C, VT, Align, Offset, true); } SDValue getBasicBlock(MachineBasicBlock *MBB); - SDValue getExternalSymbol(const char *Sym, MVT VT); - SDValue getTargetExternalSymbol(const char *Sym, MVT VT); + SDValue getSymbol(const char *Sym, MVT VT, + GlobalValue::LinkageTypes LT = GlobalValue::ExternalLinkage); + SDValue getTargetSymbol(const char *Sym, MVT VT, + GlobalValue::LinkageTypes LT = + GlobalValue::ExternalLinkage); SDValue getArgFlags(ISD::ArgFlagsTy Flags); SDValue getValueType(MVT); SDValue getRegister(unsigned Reg, MVT VT); @@ -758,8 +761,8 @@ private: std::vector ValueTypeNodes; std::map ExtendedValueTypeNodes; - StringMap ExternalSymbols; - StringMap TargetExternalSymbols; + StringMap Symbols; + StringMap TargetSymbols; }; template <> struct GraphTraits : public GraphTraits { diff --git a/include/llvm/CodeGen/SelectionDAGNodes.h b/include/llvm/CodeGen/SelectionDAGNodes.h index 7cd9eef2ab..4ba5603fab 100644 --- a/include/llvm/CodeGen/SelectionDAGNodes.h +++ b/include/llvm/CodeGen/SelectionDAGNodes.h @@ -21,6 +21,7 @@ #include "llvm/Value.h" #include "llvm/Constants.h" +#include "llvm/GlobalValue.h" #include "llvm/ADT/FoldingSet.h" #include "llvm/ADT/GraphTraits.h" #include "llvm/ADT/iterator.h" @@ -89,7 +90,7 @@ namespace ISD { BasicBlock, VALUETYPE, ARG_FLAGS, CONDCODE, Register, Constant, ConstantFP, GlobalAddress, GlobalTLSAddress, FrameIndex, - JumpTable, ConstantPool, ExternalSymbol, + JumpTable, ConstantPool, Symbol, // The address of the GOT GLOBAL_OFFSET_TABLE, @@ -133,7 +134,7 @@ namespace ISD { TargetFrameIndex, TargetJumpTable, TargetConstantPool, - TargetExternalSymbol, + TargetSymbol, /// RESULT = INTRINSIC_WO_CHAIN(INTRINSICID, arg1, arg2, ...) /// This node represents a target intrinsic function with no side effects. @@ -487,7 +488,7 @@ namespace ISD { // INLINEASM - Represents an inline asm block. This node always has two // return values: a chain and a flag result. The inputs are as follows: // Operand #0 : Input chain. - // Operand #1 : a ExternalSymbolSDNode with a pointer to the asm string. + // Operand #1 : A SymbolSDNode with a pointer to the asm string. // Operand #2n+2: A RegisterNode. // Operand #2n+3: A TargetConstant, indicating if the reg is a use/def // Operand #last: Optional, an incoming flag. @@ -2045,23 +2046,24 @@ public: } }; -class ExternalSymbolSDNode : public SDNode { +class SymbolSDNode : public SDNode { const char *Symbol; + GlobalValue::LinkageTypes Linkage; virtual void ANCHOR(); // Out-of-line virtual method to give class a home. protected: friend class SelectionDAG; - ExternalSymbolSDNode(bool isTarget, const char *Sym, MVT VT) - : SDNode(isTarget ? ISD::TargetExternalSymbol : ISD::ExternalSymbol, - getSDVTList(VT)), Symbol(Sym) { - } + SymbolSDNode(bool isTarget, const char *Sym, MVT VT, + GlobalValue::LinkageTypes L) + : SDNode(isTarget ? ISD::TargetSymbol : ISD::Symbol, + getSDVTList(VT)), Symbol(Sym), Linkage(L) {} public: - const char *getSymbol() const { return Symbol; } + GlobalValue::LinkageTypes getLinkage() const { return Linkage; } - static bool classof(const ExternalSymbolSDNode *) { return true; } + static bool classof(const SymbolSDNode *) { return true; } static bool classof(const SDNode *N) { - return N->getOpcode() == ISD::ExternalSymbol || - N->getOpcode() == ISD::TargetExternalSymbol; + return N->getOpcode() == ISD::Symbol || + N->getOpcode() == ISD::TargetSymbol; } }; -- cgit v1.2.3