Skip to content

Commit 274b885

Browse files
committed
[TSAR, APC] Do not search for arrays in library functions.
1 parent c7130d3 commit 274b885

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/APC/ArrayInfo.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
#include "AstWrapperImpl.h"
2828
#include "tsar/Analysis/AnalysisServer.h"
29+
#include "tsar/Analysis/Attributes.h"
2930
#include "tsar/Analysis/Clang/DIMemoryMatcher.h"
3031
#include "tsar/Analysis/Memory/ClonedDIMemoryMatcher.h"
3132
#include "tsar/Analysis/Memory/Delinearization.h"
@@ -106,6 +107,8 @@ void APCArrayInfoPass::getAnalysisUsage(AnalysisUsage &AU) const {
106107

107108
bool APCArrayInfoPass::runOnFunction(Function &Func) {
108109
releaseMemory();
110+
if (hasFnAttr(Func, AttrKind::LibFunc))
111+
return false;
109112
auto *F = &Func;
110113
auto *DI = &getAnalysis<DelinearizationPass>().getDelinearizeInfo();
111114
auto *DT = &getAnalysis<DominatorTreeWrapperPass>().getDomTree();
@@ -149,6 +152,8 @@ bool APCArrayInfoPass::runOnFunction(Function &Func) {
149152
}
150153
}
151154
}
155+
if (hasFnAttr(*F, AttrKind::LibFunc))
156+
return false;
152157
auto &DL = F->getParent()->getDataLayout();
153158
auto &APCCtx = getAnalysis<APCContextWrapper>().get();
154159
for (auto *A: DI->getArrays()) {

0 commit comments

Comments
 (0)