diff options
author | George Burgess IV <george.burgess.iv@gmail.com> | 2016-06-24 01:00:03 +0000 |
---|---|---|
committer | George Burgess IV <george.burgess.iv@gmail.com> | 2016-06-24 01:00:03 +0000 |
commit | a3d62be73331b62329594c0f8cbdd171b40bacb7 (patch) | |
tree | 593f505be38766861804670d7cd289baa4259475 /llvm/lib/Analysis/StratifiedSets.h | |
parent | 1c4f588df7c6d32f2b223d37d5424a290cdc62ee (diff) | |
download | bcm5719-llvm-a3d62be73331b62329594c0f8cbdd171b40bacb7.tar.gz bcm5719-llvm-a3d62be73331b62329594c0f8cbdd171b40bacb7.zip |
[CFLAA] Propagate StratifiedAttrs in interproc. analysis.
This patch also has a refactor that kills StratifiedAttr, and leaves us
with StratifiedAttrs, because having both was mildly redundant.
This patch makes us correctly handle stratified attributes when doing
interprocedural analysis. It also adds another attribute, AttrCaller,
which acts like AttrUnknown. We can filter out AttrCaller values when
during interprocedural analysis, since the caller should have
information about what arguments it's passing to its callee.
Patch by Jia Chen.
Differential Revision: http://reviews.llvm.org/D21645
llvm-svn: 273636
Diffstat (limited to 'llvm/lib/Analysis/StratifiedSets.h')
-rw-r--r-- | llvm/lib/Analysis/StratifiedSets.h | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/llvm/lib/Analysis/StratifiedSets.h b/llvm/lib/Analysis/StratifiedSets.h index d86e18805e9..45c317d4a82 100644 --- a/llvm/lib/Analysis/StratifiedSets.h +++ b/llvm/lib/Analysis/StratifiedSets.h @@ -395,15 +395,18 @@ public: return addAtMerging(ToAdd, Below); } - /// \brief Set the StratifiedAttrs of the set below "Main". If there is no set - /// below "Main", create one for it. - void addAttributesBelow(const T &Main, StratifiedAttrs Attr) { + /// \brief Set the StratifiedAttrs of the set "Level"-levels below "Main". If + /// there is no set below "Main", create one for it. + void addAttributesBelow(const T &Main, unsigned Level, StratifiedAttrs Attr) { assert(has(Main)); auto Index = *indexOf(Main); - auto Link = linksAt(Index); + auto *Link = &linksAt(Index); - auto BelowIndex = Link.hasBelow() ? Link.getBelow() : addLinkBelow(Index); - linksAt(BelowIndex).setAttrs(Attr); + for (unsigned I = 0; I < Level; ++I) { + Index = Link->hasBelow() ? Link->getBelow() : addLinkBelow(Index); + Link = &linksAt(Index); + } + Link->setAttrs(Attr); } bool addWith(const T &Main, const T &ToAdd) { |