Skip to content

Commit 2e4b905

Browse files
committed
[TSAR, Analysis, Server] Fix, ensure that alias tree exists.
For instance, if memory environment isn't initialized, alias tree doesn't exist, while DIEstimateMemoryPass may be available.
1 parent 41c796a commit 2e4b905

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lib/Analysis/Memory/DIClientServerInfo.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,10 @@ DIClientServerInfo::DIClientServerInfo(llvm::Pass &P, llvm::Function &F) {
7474
if (!DIAT || !DIDepInfo) {
7575
LLVM_DEBUG(dbgs() << "[SERVER INFO]: analysis server is not available\n");
7676
if (auto *DIATP = P.getAnalysisIfAvailable<DIEstimateMemoryPass>())
77-
DIAT = &DIATP->getAliasTree();
77+
if (DIATP->isConstructed())
78+
DIAT = &DIATP->getAliasTree();
79+
else
80+
return;
7881
else
7982
return;
8083
if (auto *DIDepP = P.getAnalysisIfAvailable<DIDependencyAnalysisPass>())
@@ -89,7 +92,10 @@ DIClientServerInfo::DIClientServerInfo(llvm::Pass &P, llvm::Function &F) {
8992
DIMemoryClientServerInfo::DIMemoryClientServerInfo(
9093
llvm::Pass &P, llvm::Function &F) : DIClientServerInfo(P, F) {
9194
if (auto *DIATP = P.getAnalysisIfAvailable<DIEstimateMemoryPass>())
92-
ClientDIAT = &DIATP->getAliasTree();
95+
if (DIATP->isConstructed())
96+
ClientDIAT = &DIATP->getAliasTree();
97+
else
98+
return;
9399
else
94100
return;
95101
}

0 commit comments

Comments
 (0)