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);
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);
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;
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);
unsigned GlobalValue::getAlignment() const {
if (auto *GA = dyn_cast<GlobalAlias>(this))
- return GA->getAliasedGlobal()->getAlignment();
+ return GA->getAliasee()->getAlignment();
return cast<GlobalObject>(this)->getAlignment();
}
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();
}
// 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
// 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())
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();
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);
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();
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.
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!");
// 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();
continue;
while (const GlobalAlias *A = dyn_cast<GlobalAlias>(GV))
- GV = A->getAliasedGlobal();
+ GV = A->getAliasee();
if (isa<Function>(GV))
DLLExportedFns.push_back(getSymbol(&Alias));
// 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;
// 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();
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()) )
++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);
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);
}