mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-29 10:25:12 +00:00
Reduce abuse of default values in the GlobalAlias constructor.
This is in preparation for adding an optional offset. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209073 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -213,9 +213,9 @@ void GlobalVariable::copyAttributesFrom(const GlobalValue *Src) {
|
||||
// GlobalAlias Implementation
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
GlobalAlias::GlobalAlias(Type *Ty, LinkageTypes Link, const Twine &Name,
|
||||
GlobalObject *Aliasee, Module *ParentModule,
|
||||
unsigned AddressSpace)
|
||||
GlobalAlias::GlobalAlias(Type *Ty, unsigned AddressSpace, LinkageTypes Link,
|
||||
const Twine &Name, GlobalObject *Aliasee,
|
||||
Module *ParentModule)
|
||||
: GlobalValue(PointerType::get(Ty, AddressSpace), Value::GlobalAliasVal,
|
||||
&Op<0>(), 1, Link, Name) {
|
||||
LeakDetector::addGarbageObject(this);
|
||||
@@ -225,6 +225,23 @@ GlobalAlias::GlobalAlias(Type *Ty, LinkageTypes Link, const Twine &Name,
|
||||
ParentModule->getAliasList().push_back(this);
|
||||
}
|
||||
|
||||
GlobalAlias::GlobalAlias(Type *Ty, unsigned AddressSpace, LinkageTypes Linkage,
|
||||
const Twine &Name, Module *Parent)
|
||||
: GlobalAlias(Ty, AddressSpace, Linkage, Name, nullptr, Parent) {}
|
||||
|
||||
GlobalAlias::GlobalAlias(Type *Ty, unsigned AddressSpace, LinkageTypes Linkage,
|
||||
const Twine &Name, GlobalObject *Aliasee)
|
||||
: GlobalAlias(Ty, AddressSpace, Linkage, Name, Aliasee,
|
||||
Aliasee->getParent()) {}
|
||||
|
||||
GlobalAlias::GlobalAlias(LinkageTypes Link, const Twine &Name,
|
||||
GlobalObject *Aliasee)
|
||||
: GlobalAlias(Aliasee->getType()->getElementType(),
|
||||
Aliasee->getType()->getAddressSpace(), Link, Name, Aliasee) {}
|
||||
|
||||
GlobalAlias::GlobalAlias(const Twine &Name, GlobalObject *Aliasee)
|
||||
: GlobalAlias(Aliasee->getLinkage(), Name, Aliasee) {}
|
||||
|
||||
void GlobalAlias::setParent(Module *parent) {
|
||||
if (getParent())
|
||||
LeakDetector::addGarbageObject(this);
|
||||
|
Reference in New Issue
Block a user