summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-05-16 22:37:03 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-05-16 22:37:03 +0000
commitad6d7f58c7d66c8caa6be712d4e68ea5841c6045 (patch)
treeda8256dfc4af02a312c94eb36260ad5e7339adbb
parentb3e18972ef3b8c408269c785438c66b8c6771fbf (diff)
downloadllvm-ad6d7f58c7d66c8caa6be712d4e68ea5841c6045.tar.gz
llvm-ad6d7f58c7d66c8caa6be712d4e68ea5841c6045.tar.bz2
llvm-ad6d7f58c7d66c8caa6be712d4e68ea5841c6045.tar.xz
Delete getAliasedGlobal.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209040 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/IR/GlobalAlias.h8
-rw-r--r--lib/CodeGen/AsmPrinter/AsmPrinter.cpp2
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAG.cpp2
-rw-r--r--lib/ExecutionEngine/JIT/JITEmitter.cpp2
-rw-r--r--lib/IR/Globals.cpp4
-rw-r--r--lib/LTO/LTOModule.cpp2
-rw-r--r--lib/Target/ARM64/ARM64FastISel.cpp2
-rw-r--r--lib/Target/PowerPC/PPCAsmPrinter.cpp9
-rw-r--r--lib/Target/PowerPC/PPCFastISel.cpp2
-rw-r--r--lib/Target/PowerPC/PPCISelDAGToDAG.cpp3
-rw-r--r--lib/Target/TargetMachine.cpp2
-rw-r--r--lib/Target/X86/X86AsmPrinter.cpp2
-rw-r--r--lib/Target/X86/X86FastISel.cpp2
-rw-r--r--lib/Target/X86/X86ISelLowering.cpp2
-rw-r--r--lib/Target/XCore/XCoreISelLowering.cpp2
-rw-r--r--lib/Transforms/Instrumentation/DataFlowSanitizer.cpp2
-rw-r--r--tools/llvm-nm/llvm-nm.cpp2
17 files changed, 19 insertions, 31 deletions
diff --git a/include/llvm/IR/GlobalAlias.h b/include/llvm/IR/GlobalAlias.h
index 4059891b96..38d3cdf9d7 100644
--- a/include/llvm/IR/GlobalAlias.h
+++ b/include/llvm/IR/GlobalAlias.h
@@ -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);
diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index b68438d842..7de9c6d616 100644
--- a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -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);
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 6caabcbc04..ef8f13701d 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -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;
diff --git a/lib/ExecutionEngine/JIT/JITEmitter.cpp b/lib/ExecutionEngine/JIT/JITEmitter.cpp
index 3ac6ca0878..cd7a500f51 100644
--- a/lib/ExecutionEngine/JIT/JITEmitter.cpp
+++ b/lib/ExecutionEngine/JIT/JITEmitter.cpp
@@ -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);
diff --git a/lib/IR/Globals.cpp b/lib/IR/Globals.cpp
index d4fcf58e98..dd2a4e435e 100644
--- a/lib/IR/Globals.cpp
+++ b/lib/IR/Globals.cpp
@@ -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();
}
diff --git a/lib/LTO/LTOModule.cpp b/lib/LTO/LTOModule.cpp
index e9efba7e09..d73a7e342a 100644
--- a/lib/LTO/LTOModule.cpp
+++ b/lib/LTO/LTOModule.cpp
@@ -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
diff --git a/lib/Target/ARM64/ARM64FastISel.cpp b/lib/Target/ARM64/ARM64FastISel.cpp
index f8b54d033f..f4bf616559 100644
--- a/lib/Target/ARM64/ARM64FastISel.cpp
+++ b/lib/Target/ARM64/ARM64FastISel.cpp
@@ -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())
diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp
index 688ca1c5ee..ac5c7f0c9b 100644
--- a/lib/Target/PowerPC/PPCAsmPrinter.cpp
+++ b/lib/Target/PowerPC/PPCAsmPrinter.cpp
@@ -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();
diff --git a/lib/Target/PowerPC/PPCFastISel.cpp b/lib/Target/PowerPC/PPCFastISel.cpp
index 266ca42136..c0c495fa9a 100644
--- a/lib/Target/PowerPC/PPCFastISel.cpp
+++ b/lib/Target/PowerPC/PPCFastISel.cpp
@@ -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.
diff --git a/lib/Target/PowerPC/PPCISelDAGToDAG.cpp b/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
index 22c835f90b..63dac61f4c 100644
--- a/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
+++ b/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
@@ -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!");
diff --git a/lib/Target/TargetMachine.cpp b/lib/Target/TargetMachine.cpp
index 14281ab3b2..f79cdfd0a7 100644
--- a/lib/Target/TargetMachine.cpp
+++ b/lib/Target/TargetMachine.cpp
@@ -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();
diff --git a/lib/Target/X86/X86AsmPrinter.cpp b/lib/Target/X86/X86AsmPrinter.cpp
index 6ed2c9cfac..68e136bd77 100644
--- a/lib/Target/X86/X86AsmPrinter.cpp
+++ b/lib/Target/X86/X86AsmPrinter.cpp
@@ -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));
diff --git a/lib/Target/X86/X86FastISel.cpp b/lib/Target/X86/X86FastISel.cpp
index 571ecc2b41..56bcfa30ff 100644
--- a/lib/Target/X86/X86FastISel.cpp
+++ b/lib/Target/X86/X86FastISel.cpp
@@ -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;
diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp
index 8c9cc60f0f..df8413e9fe 100644
--- a/lib/Target/X86/X86ISelLowering.cpp
+++ b/lib/Target/X86/X86ISelLowering.cpp
@@ -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();
diff --git a/lib/Target/XCore/XCoreISelLowering.cpp b/lib/Target/XCore/XCoreISelLowering.cpp
index 3cd1b91ae4..a3c786117b 100644
--- a/lib/Target/XCore/XCoreISelLowering.cpp
+++ b/lib/Target/XCore/XCoreISelLowering.cpp
@@ -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()) )
diff --git a/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp b/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
index 5094771450..7f468f79e2 100644
--- a/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
+++ b/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
@@ -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);
diff --git a/tools/llvm-nm/llvm-nm.cpp b/tools/llvm-nm/llvm-nm.cpp
index 57e9d55c86..3be9247c5a 100644
--- a/tools/llvm-nm/llvm-nm.cpp
+++ b/tools/llvm-nm/llvm-nm.cpp
@@ -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);
}