mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-29 13:24:25 +00:00
Use address-taken to disambiguate global variable and indirect memops.
Major steps include: 1). introduces a not-addr-taken bit-field in GlobalVariable 2). GlobalOpt pass sets "not-address-taken" if it proves a global varirable dosen't have its address taken. 3). AA use this info for disambiguation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193251 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -704,7 +704,7 @@ bool LLParser::ParseGlobal(const std::string &Name, LocTy NameLoc,
|
||||
unsigned Linkage, bool HasLinkage,
|
||||
unsigned Visibility) {
|
||||
unsigned AddrSpace;
|
||||
bool IsConstant, UnnamedAddr, IsExternallyInitialized;
|
||||
bool IsConstant, UnnamedAddr, IsExternallyInitialized, notAddrTaken;
|
||||
GlobalVariable::ThreadLocalMode TLM;
|
||||
LocTy UnnamedAddrLoc;
|
||||
LocTy IsExternallyInitializedLoc;
|
||||
@ -719,6 +719,7 @@ bool LLParser::ParseGlobal(const std::string &Name, LocTy NameLoc,
|
||||
IsExternallyInitialized,
|
||||
&IsExternallyInitializedLoc) ||
|
||||
ParseGlobalType(IsConstant) ||
|
||||
ParseOptionalToken(lltok::kw_notaddrtaken, notAddrTaken) ||
|
||||
ParseType(Ty, TyLoc))
|
||||
return true;
|
||||
|
||||
@ -776,6 +777,7 @@ bool LLParser::ParseGlobal(const std::string &Name, LocTy NameLoc,
|
||||
GV->setLinkage((GlobalValue::LinkageTypes)Linkage);
|
||||
GV->setVisibility((GlobalValue::VisibilityTypes)Visibility);
|
||||
GV->setExternallyInitialized(IsExternallyInitialized);
|
||||
GV->setAddressMaybeTaken(!notAddrTaken);
|
||||
GV->setThreadLocalMode(TLM);
|
||||
GV->setUnnamedAddr(UnnamedAddr);
|
||||
|
||||
|
Reference in New Issue
Block a user