diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2014-05-16 13:34:04 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2014-05-16 13:34:04 +0000 |
commit | 4fe0094fd15c9b94e4940994cced3e23baafdb9b (patch) | |
tree | 3a8e76199bad6971294da68811ba0d0edb19678b /llvm/lib/IR/Globals.cpp | |
parent | 95442c445fa2b5f5b43100ca049dcc6e3b01c0f8 (diff) | |
download | bcm5719-llvm-4fe0094fd15c9b94e4940994cced3e23baafdb9b.tar.gz bcm5719-llvm-4fe0094fd15c9b94e4940994cced3e23baafdb9b.zip |
Change the GlobalAlias constructor to look a bit more like GlobalVariable.
This is part of the fix for pr10367. A GlobalAlias always has a pointer type,
so just have the constructor build the type.
llvm-svn: 208983
Diffstat (limited to 'llvm/lib/IR/Globals.cpp')
-rw-r--r-- | llvm/lib/IR/Globals.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/llvm/lib/IR/Globals.cpp b/llvm/lib/IR/Globals.cpp index 0ec54fe3c08..8e7478496f0 100644 --- a/llvm/lib/IR/Globals.cpp +++ b/llvm/lib/IR/Globals.cpp @@ -213,15 +213,17 @@ void GlobalVariable::copyAttributesFrom(const GlobalValue *Src) { // GlobalAlias Implementation //===----------------------------------------------------------------------===// -GlobalAlias::GlobalAlias(Type *Ty, LinkageTypes Link, - const Twine &Name, Constant* aliasee, - Module *ParentModule) - : GlobalValue(Ty, Value::GlobalAliasVal, &Op<0>(), 1, Link, Name) { +GlobalAlias::GlobalAlias(Type *Ty, LinkageTypes Link, const Twine &Name, + Constant *Aliasee, Module *ParentModule, + unsigned AddressSpace) + : GlobalValue(PointerType::get(Ty, AddressSpace), Value::GlobalAliasVal, + &Op<0>(), 1, Link, Name) { LeakDetector::addGarbageObject(this); - if (aliasee) - assert(aliasee->getType() == Ty && "Alias and aliasee types should match!"); - Op<0>() = aliasee; + if (Aliasee) + assert(Aliasee->getType() == getType() && + "Alias and aliasee types should match!"); + Op<0>() = Aliasee; if (ParentModule) ParentModule->getAliasList().push_back(this); |