From ab67b30df6b14e8e90f4778215ed4e1d5939638e Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Fri, 16 May 2014 13:34:04 +0000 Subject: 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208983 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/AsmParser/LLParser.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/AsmParser') diff --git a/lib/AsmParser/LLParser.cpp b/lib/AsmParser/LLParser.cpp index d0b380066c..e5813f0d21 100644 --- a/lib/AsmParser/LLParser.cpp +++ b/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 GA(new GlobalAlias( - Aliasee->getType(), (GlobalValue::LinkageTypes)Linkage, Name, Aliasee)); + PointerType *PTy = cast(Aliasee->getType()); + std::unique_ptr GA( + new GlobalAlias(PTy->getElementType(), (GlobalValue::LinkageTypes)Linkage, + Name, Aliasee, nullptr, PTy->getAddressSpace())); GA->setVisibility((GlobalValue::VisibilityTypes)Visibility); GA->setDLLStorageClass((GlobalValue::DLLStorageClassTypes)DLLStorageClass); -- cgit v1.2.3