summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Analysis/BasicAliasAnalysis.cpp11
-rw-r--r--llvm/lib/AsmParser/LLLexer.cpp1
-rw-r--r--llvm/lib/AsmParser/LLParser.cpp4
-rw-r--r--llvm/lib/AsmParser/LLToken.h1
-rw-r--r--llvm/lib/Bitcode/Reader/BitcodeReader.cpp3
-rw-r--r--llvm/lib/Bitcode/Writer/BitcodeWriter.cpp4
-rw-r--r--llvm/lib/IR/AsmWriter.cpp1
-rw-r--r--llvm/lib/IR/Globals.cpp3
-rw-r--r--llvm/lib/Transforms/IPO/GlobalOpt.cpp1
9 files changed, 2 insertions, 27 deletions
diff --git a/llvm/lib/Analysis/BasicAliasAnalysis.cpp b/llvm/lib/Analysis/BasicAliasAnalysis.cpp
index 4e423a787c9..bf929690ae7 100644
--- a/llvm/lib/Analysis/BasicAliasAnalysis.cpp
+++ b/llvm/lib/Analysis/BasicAliasAnalysis.cpp
@@ -1238,17 +1238,6 @@ BasicAliasAnalysis::aliasCheck(const Value *V1, uint64_t V1Size,
return NoAlias;
if (isEscapeSource(O2) && isNonEscapingLocalObject(O1))
return NoAlias;
-
- // If one object is a global variable without address taken, the other one
- // is a different object, they will not alias because the global variable
- // in question cannot be indirectly accessed.
- if (const GlobalVariable *GV = dyn_cast<GlobalVariable>(O1))
- if (!GV->AddressMaybeTaken())
- return NoAlias;
-
- if (const GlobalVariable *GV = dyn_cast<GlobalVariable>(O2))
- if (!GV->AddressMaybeTaken())
- return NoAlias;
}
// If the size of one access is larger than the entire object on the other
diff --git a/llvm/lib/AsmParser/LLLexer.cpp b/llvm/lib/AsmParser/LLLexer.cpp
index 6d643b611c3..99bff45792c 100644
--- a/llvm/lib/AsmParser/LLLexer.cpp
+++ b/llvm/lib/AsmParser/LLLexer.cpp
@@ -504,7 +504,6 @@ lltok::Kind LLLexer::LexIdentifier() {
KEYWORD(zeroinitializer);
KEYWORD(undef);
KEYWORD(null);
- KEYWORD(notaddrtaken);
KEYWORD(to);
KEYWORD(tail);
KEYWORD(target);
diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp
index 9b5fb27a056..74c0ea4af52 100644
--- a/llvm/lib/AsmParser/LLParser.cpp
+++ b/llvm/lib/AsmParser/LLParser.cpp
@@ -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, notAddrTaken;
+ bool IsConstant, UnnamedAddr, IsExternallyInitialized;
GlobalVariable::ThreadLocalMode TLM;
LocTy UnnamedAddrLoc;
LocTy IsExternallyInitializedLoc;
@@ -719,7 +719,6 @@ bool LLParser::ParseGlobal(const std::string &Name, LocTy NameLoc,
IsExternallyInitialized,
&IsExternallyInitializedLoc) ||
ParseGlobalType(IsConstant) ||
- ParseOptionalToken(lltok::kw_notaddrtaken, notAddrTaken) ||
ParseType(Ty, TyLoc))
return true;
@@ -777,7 +776,6 @@ 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);
diff --git a/llvm/lib/AsmParser/LLToken.h b/llvm/lib/AsmParser/LLToken.h
index 7832e816aa8..e1382fdb597 100644
--- a/llvm/lib/AsmParser/LLToken.h
+++ b/llvm/lib/AsmParser/LLToken.h
@@ -51,7 +51,6 @@ namespace lltok {
kw_localdynamic, kw_initialexec, kw_localexec,
kw_zeroinitializer,
kw_undef, kw_null,
- kw_notaddrtaken,
kw_to,
kw_tail,
kw_target,
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index 3fca4ab8e0d..e408cd1f981 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -1848,9 +1848,6 @@ bool BitcodeReader::ParseModule(bool Resume) {
new GlobalVariable(*TheModule, Ty, isConstant, Linkage, 0, "", 0,
TLM, AddressSpace, ExternallyInitialized);
NewGV->setAlignment(Alignment);
- if (Record.size() > 10)
- NewGV->setAddressMaybeTaken(Record[10]);
-
if (!Section.empty())
NewGV->setSection(Section);
NewGV->setVisibility(Visibility);
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
index 4f631b98859..b082ba6bfd2 100644
--- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -616,13 +616,11 @@ static void WriteModuleInfo(const Module *M, const ValueEnumerator &VE,
Vals.push_back(GV->hasSection() ? SectionMap[GV->getSection()] : 0);
if (GV->isThreadLocal() ||
GV->getVisibility() != GlobalValue::DefaultVisibility ||
- GV->hasUnnamedAddr() || GV->isExternallyInitialized() ||
- !GV->AddressMaybeTaken()) {
+ GV->hasUnnamedAddr() || GV->isExternallyInitialized()) {
Vals.push_back(getEncodedVisibility(GV));
Vals.push_back(getEncodedThreadLocalMode(GV));
Vals.push_back(GV->hasUnnamedAddr());
Vals.push_back(GV->isExternallyInitialized());
- Vals.push_back(GV->AddressMaybeTaken());
} else {
AbbrevToUse = SimpleGVarAbbrev;
}
diff --git a/llvm/lib/IR/AsmWriter.cpp b/llvm/lib/IR/AsmWriter.cpp
index dc337c16a60..6e3b853b391 100644
--- a/llvm/lib/IR/AsmWriter.cpp
+++ b/llvm/lib/IR/AsmWriter.cpp
@@ -1459,7 +1459,6 @@ void AssemblyWriter::printGlobal(const GlobalVariable *GV) {
if (GV->hasUnnamedAddr()) Out << "unnamed_addr ";
if (GV->isExternallyInitialized()) Out << "externally_initialized ";
Out << (GV->isConstant() ? "constant " : "global ");
- if (!GV->AddressMaybeTaken()) Out << "notaddrtaken ";
TypePrinter.print(GV->getType()->getElementType(), Out);
if (GV->hasInitializer()) {
diff --git a/llvm/lib/IR/Globals.cpp b/llvm/lib/IR/Globals.cpp
index 8c28ec176f6..da3b02a0fa6 100644
--- a/llvm/lib/IR/Globals.cpp
+++ b/llvm/lib/IR/Globals.cpp
@@ -99,7 +99,6 @@ GlobalVariable::GlobalVariable(Type *Ty, bool constant, LinkageTypes Link,
}
LeakDetector::addGarbageObject(this);
- setAddressMaybeTaken(true);
}
GlobalVariable::GlobalVariable(Module &M, Type *Ty, bool constant,
@@ -126,7 +125,6 @@ GlobalVariable::GlobalVariable(Module &M, Type *Ty, bool constant,
Before->getParent()->getGlobalList().insert(Before, this);
else
M.getGlobalList().push_back(this);
- setAddressMaybeTaken(true);
}
void GlobalVariable::setParent(Module *parent) {
@@ -187,7 +185,6 @@ void GlobalVariable::copyAttributesFrom(const GlobalValue *Src) {
GlobalValue::copyAttributesFrom(Src);
const GlobalVariable *SrcVar = cast<GlobalVariable>(Src);
setThreadLocal(SrcVar->isThreadLocal());
- setAddressMaybeTaken(SrcVar->AddressMaybeTaken());
}
diff --git a/llvm/lib/Transforms/IPO/GlobalOpt.cpp b/llvm/lib/Transforms/IPO/GlobalOpt.cpp
index a259b4d3921..82a59ed562d 100644
--- a/llvm/lib/Transforms/IPO/GlobalOpt.cpp
+++ b/llvm/lib/Transforms/IPO/GlobalOpt.cpp
@@ -1723,7 +1723,6 @@ bool GlobalOpt::ProcessGlobal(GlobalVariable *GV,
if (GlobalStatus::analyzeGlobal(GV, GS))
return false;
- GV->setAddressMaybeTaken(false);
if (!GS.IsCompared && !GV->hasUnnamedAddr()) {
GV->setUnnamedAddr(true);
NumUnnamed++;
OpenPOWER on IntegriCloud