diff options
author | Bill Wendling <isanbard@gmail.com> | 2008-09-16 21:12:30 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2008-09-16 21:12:30 +0000 |
commit | 9468a9b6beed640eca64274c8dcc5aed3b94450b (patch) | |
tree | a78896d298334b38e78ac91f76d4174d14dba3a0 /include/llvm | |
parent | 05ae98346a190d74c2c8799c3af2f8ca23e47c27 (diff) | |
download | llvm-9468a9b6beed640eca64274c8dcc5aed3b94450b.tar.gz llvm-9468a9b6beed640eca64274c8dcc5aed3b94450b.tar.bz2 llvm-9468a9b6beed640eca64274c8dcc5aed3b94450b.tar.xz |
- 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
Diffstat (limited to 'include/llvm')
-rw-r--r-- | include/llvm/CodeGen/ScheduleDAG.h | 2 | ||||
-rw-r--r-- | include/llvm/CodeGen/SelectionDAG.h | 11 | ||||
-rw-r--r-- | include/llvm/CodeGen/SelectionDAGNodes.h | 26 |
3 files changed, 22 insertions, 17 deletions
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<FrameIndexSDNode>(Node)) return true; if (isa<ConstantPoolSDNode>(Node)) return true; if (isa<JumpTableSDNode>(Node)) return true; - if (isa<ExternalSymbolSDNode>(Node)) return true; + if (isa<SymbolSDNode>(Node)) return true; if (isa<MemOperandSDNode>(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<SDNode*> ValueTypeNodes; std::map<MVT, SDNode*, MVT::compareRawBits> ExtendedValueTypeNodes; - StringMap<SDNode*> ExternalSymbols; - StringMap<SDNode*> TargetExternalSymbols; + StringMap<SDNode*> Symbols; + StringMap<SDNode*> TargetSymbols; }; template <> struct GraphTraits<SelectionDAG*> : public GraphTraits<SDNode*> { 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; } }; |