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/AsmParser | |
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/AsmParser')
-rw-r--r-- | llvm/lib/AsmParser/LLParser.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp index d0b380066c5..e5813f0d210 100644 --- a/llvm/lib/AsmParser/LLParser.cpp +++ b/llvm/lib/AsmParser/LLParser.cpp @@ -673,8 +673,10 @@ bool LLParser::ParseAlias(const std::string &Name, LocTy NameLoc, return Error(AliaseeLoc, "alias must have pointer type"); // Okay, create the alias but do not insert it into the module yet. - std::unique_ptr<GlobalAlias> GA(new GlobalAlias( - Aliasee->getType(), (GlobalValue::LinkageTypes)Linkage, Name, Aliasee)); + PointerType *PTy = cast<PointerType>(Aliasee->getType()); + std::unique_ptr<GlobalAlias> GA( + new GlobalAlias(PTy->getElementType(), (GlobalValue::LinkageTypes)Linkage, + Name, Aliasee, nullptr, PTy->getAddressSpace())); GA->setVisibility((GlobalValue::VisibilityTypes)Visibility); GA->setDLLStorageClass((GlobalValue::DLLStorageClassTypes)DLLStorageClass); |