diff options
Diffstat (limited to 'llvm/lib/AsmParser')
-rw-r--r-- | llvm/lib/AsmParser/LLParser.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp index 3949c67f16d..b2f7af61743 100644 --- a/llvm/lib/AsmParser/LLParser.cpp +++ b/llvm/lib/AsmParser/LLParser.cpp @@ -706,6 +706,7 @@ bool LLParser::ParseAlias(const std::string &Name, LocTy NameLoc, unsigned L, auto *PTy = dyn_cast<PointerType>(AliaseeType); if (!PTy) return Error(AliaseeLoc, "An alias must have pointer type"); + unsigned AddrSpace = PTy->getAddressSpace(); if (Ty != PTy->getElementType()) return Error( @@ -714,8 +715,8 @@ bool LLParser::ParseAlias(const std::string &Name, LocTy NameLoc, unsigned L, // Okay, create the alias but do not insert it into the module yet. std::unique_ptr<GlobalAlias> GA( - GlobalAlias::create(PTy, (GlobalValue::LinkageTypes)Linkage, Name, - Aliasee, /*Parent*/ nullptr)); + GlobalAlias::create(Ty, AddrSpace, (GlobalValue::LinkageTypes)Linkage, + Name, Aliasee, /*Parent*/ nullptr)); GA->setThreadLocalMode(TLM); GA->setVisibility((GlobalValue::VisibilityTypes)Visibility); GA->setDLLStorageClass((GlobalValue::DLLStorageClassTypes)DLLStorageClass); |