Delete getAliasedGlobal.
authorRafael Espindola <rafael.espindola@gmail.com>
Fri, 16 May 2014 22:37:03 +0000 (22:37 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Fri, 16 May 2014 22:37:03 +0000 (22:37 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209040 91177308-0d34-0410-b5e6-96231b3b80d8

17 files changed:
include/llvm/IR/GlobalAlias.h
lib/CodeGen/AsmPrinter/AsmPrinter.cpp
lib/CodeGen/SelectionDAG/SelectionDAG.cpp
lib/ExecutionEngine/JIT/JITEmitter.cpp
lib/IR/Globals.cpp
lib/LTO/LTOModule.cpp
lib/Target/ARM64/ARM64FastISel.cpp
lib/Target/PowerPC/PPCAsmPrinter.cpp
lib/Target/PowerPC/PPCFastISel.cpp
lib/Target/PowerPC/PPCISelDAGToDAG.cpp
lib/Target/TargetMachine.cpp
lib/Target/X86/X86AsmPrinter.cpp
lib/Target/X86/X86FastISel.cpp
lib/Target/X86/X86ISelLowering.cpp
lib/Target/XCore/XCoreISelLowering.cpp
lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
tools/llvm-nm/llvm-nm.cpp

index 4059891b96f8300ee265cf40634dd5d1795d09a3..38d3cdf9d7bdf7873800985cf2dfcc0bf13169cc 100644 (file)
@@ -67,14 +67,6 @@ public:
     return cast_or_null<GlobalObject>(getOperand(0));
   }
 
-  GlobalObject *getAliasedGlobal() {
-    return getAliasee();
-  }
-
-  const GlobalObject *getAliasedGlobal() const {
-    return const_cast<GlobalAlias *>(this)->getAliasedGlobal();
-  }
-
   static bool isValidLinkage(LinkageTypes L) {
     return isExternalLinkage(L) || isLocalLinkage(L) ||
       isWeakLinkage(L) || isLinkOnceLinkage(L);
index b68438d8425a3275766fcb131d7aa63f72852904..7de9c6d616c872b57e3d38874f433b7cdcb82a3f 100644 (file)
@@ -932,7 +932,7 @@ bool AsmPrinter::doFinalization(Module &M) {
     for (const auto &Alias : M.aliases()) {
       MCSymbol *Name = getSymbol(&Alias);
 
-      const GlobalValue *GV = Alias.getAliasedGlobal();
+      const GlobalValue *GV = Alias.getAliasee();
       assert(!GV->isDeclaration());
       MCSymbol *Target = getSymbol(GV);
 
index 6caabcbc044994faa075061a8f4c85e5afdd9a5a..ef8f13701df527e75b1e0563ca6eca6c5598400a 100644 (file)
@@ -1194,7 +1194,7 @@ SDValue SelectionDAG::getGlobalAddress(const GlobalValue *GV, SDLoc DL,
   if (!GVar) {
     // If GV is an alias then use the aliasee for determining thread-localness.
     if (const GlobalAlias *GA = dyn_cast<GlobalAlias>(GV))
-      GVar = dyn_cast_or_null<GlobalVariable>(GA->getAliasedGlobal());
+      GVar = dyn_cast_or_null<GlobalVariable>(GA->getAliasee());
   }
 
   unsigned Opc;
index 3ac6ca08784496c71d8c191cda7598ccd9f2e3a8..cd7a500f511573451b458fd77d5a6097496d12d7 100644 (file)
@@ -690,7 +690,7 @@ void *JITEmitter::getPointerToGlobal(GlobalValue *V, void *Reference,
     return TheJIT->getOrEmitGlobalVariable(GV);
 
   if (GlobalAlias *GA = dyn_cast<GlobalAlias>(V))
-    return TheJIT->getPointerToGlobal(GA->getAliasedGlobal());
+    return TheJIT->getPointerToGlobal(GA->getAliasee());
 
   // If we have already compiled the function, return a pointer to its body.
   Function *F = cast<Function>(V);
index d4fcf58e98b959782ab5a41abc00d4bbbf5c893c..dd2a4e435ec2a6f378e7aaefbf346372eb69111b 100644 (file)
@@ -60,7 +60,7 @@ void GlobalValue::copyAttributesFrom(const GlobalValue *Src) {
 
 unsigned GlobalValue::getAlignment() const {
   if (auto *GA = dyn_cast<GlobalAlias>(this))
-    return GA->getAliasedGlobal()->getAlignment();
+    return GA->getAliasee()->getAlignment();
 
   return cast<GlobalObject>(this)->getAlignment();
 }
@@ -82,7 +82,7 @@ void GlobalObject::copyAttributesFrom(const GlobalValue *Src) {
 
 const std::string &GlobalValue::getSection() const {
   if (auto *GA = dyn_cast<GlobalAlias>(this))
-    return GA->getAliasedGlobal()->getSection();
+    return GA->getAliasee()->getSection();
   return cast<GlobalObject>(this)->getSection();
 }
 
index e9efba7e09a5d4655c61775c4e889f63e1675066..d73a7e342ae75831707d0eba88632920f669c5ed 100644 (file)
@@ -802,7 +802,7 @@ bool LTOModule::parseSymbols(std::string &errMsg) {
   // add aliases
   for (Module::alias_iterator a = _module->alias_begin(),
          e = _module->alias_end(); a != e; ++a) {
-    if (isDeclaration(*a->getAliasedGlobal()))
+    if (isDeclaration(*a->getAliasee()))
       // Is an alias to a declaration.
       addPotentialUndefinedSymbol(a, false);
     else
index f8b54d033f7d2fc621b1acca0ee2283116ca5a5f..f4bf616559a8d03425b44236bd9bf32779c2f095 100644 (file)
@@ -245,7 +245,7 @@ unsigned ARM64FastISel::ARM64MaterializeGV(const GlobalValue *GV) {
   // to peer through any aliases to find out if that rule applies.
   const GlobalValue *TLSGV = GV;
   if (const GlobalAlias *GA = dyn_cast<GlobalAlias>(GV))
-    TLSGV = GA->getAliasedGlobal();
+    TLSGV = GA->getAliasee();
 
   if (const GlobalVariable *GVar = dyn_cast<GlobalVariable>(TLSGV))
     if (GVar->isThreadLocal())
index 688ca1c5eecf43a58e0a6df413c843e3771bd38f..ac5c7f0c9bb84daedc8a94ceed66646b30e29e2f 100644 (file)
@@ -382,8 +382,7 @@ void PPCAsmPrinter::EmitInstruction(const MachineInstr *MI) {
     if (MO.isGlobal()) {
       const GlobalValue *GValue = MO.getGlobal();
       const GlobalAlias *GAlias = dyn_cast<GlobalAlias>(GValue);
-      const GlobalValue *RealGValue =
-          GAlias ? GAlias->getAliasedGlobal() : GValue;
+      const GlobalValue *RealGValue = GAlias ? GAlias->getAliasee() : GValue;
       MOSymbol = getSymbol(RealGValue);
       const GlobalVariable *GVar = dyn_cast<GlobalVariable>(RealGValue);
       IsExternal = GVar && !GVar->hasInitializer();
@@ -429,8 +428,7 @@ void PPCAsmPrinter::EmitInstruction(const MachineInstr *MI) {
     else if (MO.isGlobal()) {
       const GlobalValue *GValue = MO.getGlobal();
       const GlobalAlias *GAlias = dyn_cast<GlobalAlias>(GValue);
-      const GlobalValue *RealGValue =
-          GAlias ? GAlias->getAliasedGlobal() : GValue;
+      const GlobalValue *RealGValue = GAlias ? GAlias->getAliasee() : GValue;
       MOSymbol = getSymbol(RealGValue);
       const GlobalVariable *GVar = dyn_cast<GlobalVariable>(RealGValue);
     
@@ -464,8 +462,7 @@ void PPCAsmPrinter::EmitInstruction(const MachineInstr *MI) {
     if (MO.isGlobal()) {
       const GlobalValue *GValue = MO.getGlobal();
       const GlobalAlias *GAlias = dyn_cast<GlobalAlias>(GValue);
-      const GlobalValue *RealGValue =
-          GAlias ? GAlias->getAliasedGlobal() : GValue;
+      const GlobalValue *RealGValue = GAlias ? GAlias->getAliasee() : GValue;
       MOSymbol = getSymbol(RealGValue);
       const GlobalVariable *GVar = dyn_cast<GlobalVariable>(RealGValue);
       IsExternal = GVar && !GVar->hasInitializer();
index 266ca421362a4b33e9064a3d798cf28f25c48281..c0c495fa9aec10ca6da514bfb3e4d6d7caa39631 100644 (file)
@@ -1864,7 +1864,7 @@ unsigned PPCFastISel::PPCMaterializeGV(const GlobalValue *GV, MVT VT) {
   if (!GVar) {
     // If GV is an alias, use the aliasee for determining thread-locality.
     if (const GlobalAlias *GA = dyn_cast<GlobalAlias>(GV))
-      GVar = dyn_cast_or_null<GlobalVariable>(GA->getAliasedGlobal());
+      GVar = dyn_cast_or_null<GlobalVariable>(GA->getAliasee());
   }
 
   // FIXME: We don't yet handle the complexity of TLS.
index 22c835f90b08eface902f749bd1c9633f2baed51..63dac61f4cdc1fe23dff3bbdd2317342b93102a0 100644 (file)
@@ -1471,8 +1471,7 @@ SDNode *PPCDAGToDAGISel::Select(SDNode *N) {
     if (GlobalAddressSDNode *G = dyn_cast<GlobalAddressSDNode>(GA)) {
       const GlobalValue *GValue = G->getGlobal();
       const GlobalAlias *GAlias = dyn_cast<GlobalAlias>(GValue);
-      const GlobalValue *RealGValue =
-          GAlias ? GAlias->getAliasedGlobal() : GValue;
+      const GlobalValue *RealGValue = GAlias ? GAlias->getAliasee() : GValue;
       const GlobalVariable *GVar = dyn_cast<GlobalVariable>(RealGValue);
       assert((GVar || isa<Function>(RealGValue)) &&
              "Unexpected global value subclass!");
index 14281ab3b243139de88980cd5df2e008ef7cedf1..f79cdfd0a79171ef4856119ad959653b9593a45b 100644 (file)
@@ -126,7 +126,7 @@ TLSModel::Model TargetMachine::getTLSModel(const GlobalValue *GV) const {
   // If GV is an alias then use the aliasee for determining
   // thread-localness.
   if (const GlobalAlias *GA = dyn_cast<GlobalAlias>(GV))
-    GV = GA->getAliasedGlobal();
+    GV = GA->getAliasee();
   const GlobalVariable *Var = cast<GlobalVariable>(GV);
 
   bool isLocal = Var->hasLocalLinkage();
index 6ed2c9cfac549dc47011c2f9774ac9b705ff9c11..68e136bd776c9abb5e674fcba547f49e5a095c1b 100644 (file)
@@ -675,7 +675,7 @@ void X86AsmPrinter::EmitEndOfAsmFile(Module &M) {
         continue;
 
       while (const GlobalAlias *A = dyn_cast<GlobalAlias>(GV))
-        GV = A->getAliasedGlobal();
+        GV = A->getAliasee();
 
       if (isa<Function>(GV))
         DLLExportedFns.push_back(getSymbol(&Alias));
index 571ecc2b415648a28d6780bfcf3c1ee10ffd4141..56bcfa30ff90722b81ba4d7c9894995872f78ace 100644 (file)
@@ -363,7 +363,7 @@ bool X86FastISel::handleConstantAddresses(const Value *V, X86AddressMode &AM) {
     // it works...).
     if (const GlobalAlias *GA = dyn_cast<GlobalAlias>(GV))
       if (const GlobalVariable *GVar =
-              dyn_cast_or_null<GlobalVariable>(GA->getAliasedGlobal()))
+              dyn_cast_or_null<GlobalVariable>(GA->getAliasee()))
         if (GVar->isThreadLocal())
           return false;
 
index 8c9cc60f0f0d38c3c4fb7bb712447454455164c3..df8413e9fe035cfaeb21407be5bc1ec992c7dd72 100644 (file)
@@ -8824,7 +8824,7 @@ X86TargetLowering::LowerGlobalTLSAddress(SDValue Op, SelectionDAG &DAG) const {
     // If GV is an alias then use the aliasee for determining
     // thread-localness.
     if (const GlobalAlias *GA = dyn_cast<GlobalAlias>(GV))
-      GV = GA->getAliasedGlobal();
+      GV = GA->getAliasee();
     SDLoc dl(GA);
     SDValue Chain = DAG.getEntryNode();
 
index 3cd1b91ae4c4fb1be1c15b322672832f6c0ae1e8..a3c786117b09b5cf2c2e46caf98e7e34b28beebd 100644 (file)
@@ -277,7 +277,7 @@ getGlobalAddressWrapper(SDValue GA, const GlobalValue *GV,
   const GlobalValue *UnderlyingGV = GV;
   // If GV is an alias then use the aliasee to determine the wrapper type
   if (const GlobalAlias *GA = dyn_cast<GlobalAlias>(GV))
-    UnderlyingGV = GA->getAliasedGlobal();
+    UnderlyingGV = GA->getAliasee();
   if (const GlobalVariable *GVar = dyn_cast<GlobalVariable>(UnderlyingGV)) {
     if (  ( GVar->isConstant() &&
             UnderlyingGV->isLocalLinkage(GV->getLinkage()) )
index 5094771450f454dbfb3c8707720713c0298cf4bf..7f468f79e22d61d0db715e8d75bd211360b5036c 100644 (file)
@@ -557,7 +557,7 @@ bool DataFlowSanitizer::runOnModule(Module &M) {
     ++i;
     // Don't stop on weak.  We assume people aren't playing games with the
     // instrumentedness of overridden weak aliases.
-    if (Function *F = dyn_cast<Function>(GA->getAliasedGlobal())) {
+    if (Function *F = dyn_cast<Function>(GA->getAliasee())) {
       bool GAInst = isInstrumented(GA), FInst = isInstrumented(F);
       if (GAInst && FInst) {
         addGlobalNamePrefix(GA);
index 57e9d55c866e2b7c89557835229455db58d3f9be..3be9247c5a55d827bf40428f101ffff471a173e0 100644 (file)
@@ -420,7 +420,7 @@ static char getSymbolNMTypeChar(const GlobalValue &GV) {
   if (isa<GlobalVariable>(GV))
     return 'd';
   const GlobalAlias *GA = cast<GlobalAlias>(&GV);
-  const GlobalValue *AliasedGV = GA->getAliasedGlobal();
+  const GlobalValue *AliasedGV = GA->getAliasee();
   return getSymbolNMTypeChar(*AliasedGV);
 }