diff options
author | George Burgess IV <george.burgess.iv@gmail.com> | 2016-07-29 01:23:45 +0000 |
---|---|---|
committer | George Burgess IV <george.burgess.iv@gmail.com> | 2016-07-29 01:23:45 +0000 |
commit | 0a9cbd47430a95710bc3a7a41c128d3b4c51cd2c (patch) | |
tree | 09ca94c30cb388516be21b94a6df86f3e6f52fed /llvm/lib/Analysis | |
parent | 4c922aba3f75f04ab51ebd9623b89963c2f5dbd2 (diff) | |
download | bcm5719-llvm-0a9cbd47430a95710bc3a7a41c128d3b4c51cd2c.tar.gz bcm5719-llvm-0a9cbd47430a95710bc3a7a41c128d3b4c51cd2c.zip |
[CFLAA] Check for pointer types in more places.
This patch fixes an assertion that fires when we try to add non-pointer
Values to the CFLGraph. Centralizing the check for whether something
is/isn't a pointer type isn't completely trivial (and, in some cases,
would end up being entirely redundant), but it may be beneficial to do
so if this trips us up more in the future.
Patch by Jia Chen.
Differential Revision: https://reviews.llvm.org/D22947
llvm-svn: 277096
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r-- | llvm/lib/Analysis/CFLGraph.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/CFLGraph.h b/llvm/lib/Analysis/CFLGraph.h index 43e622016ca..e526e0e16aa 100644 --- a/llvm/lib/Analysis/CFLGraph.h +++ b/llvm/lib/Analysis/CFLGraph.h @@ -334,7 +334,8 @@ template <typename CFLAA> class CFLGraphBuilder { // For now, we'll handle this like a landingpad instruction (by placing // the // result in its own group, and having that group alias externals). - addNode(&Inst, getAttrUnknown()); + if (Inst.getType()->isPointerTy()) + addNode(&Inst, getAttrUnknown()); } static bool isFunctionExternal(Function *Fn) { @@ -457,7 +458,8 @@ template <typename CFLAA> class CFLGraphBuilder { // Exceptions come from "nowhere", from our analysis' perspective. // So we place the instruction its own group, noting that said group may // alias externals - addNode(&Inst, getAttrUnknown()); + if (Inst.getType()->isPointerTy()) + addNode(&Inst, getAttrUnknown()); } void visitInsertValueInst(InsertValueInst &Inst) { |