aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/SemaCodeComplete.cpp
diff options
context:
space:
mode:
authorChristian Bruel <christian.bruel@st.com>2019-05-23 05:53:10 +0000
committerChristian Bruel <christian.bruel@st.com>2019-05-23 05:53:10 +0000
commit4a7da98bd9283e2e6aa635031d2f131493c8ad1a (patch)
tree2ff08590e70f08fc03533a362a29a80e2ea624e1 /clang/lib/Sema/SemaCodeComplete.cpp
parent202dc1291eae2add93207cbf788a64f4341b1c59 (diff)
downloadllvm-4a7da98bd9283e2e6aa635031d2f131493c8ad1a.zip
llvm-4a7da98bd9283e2e6aa635031d2f131493c8ad1a.tar.gz
llvm-4a7da98bd9283e2e6aa635031d2f131493c8ad1a.tar.bz2
[GlobalOpt] recognize dead struct fields and propagate values
Summary: Allow struct fields SRA and dead stores. This works by considering fields accesses from getElementPtr to be considered as a possible pointer root that can be cleaned up. We check that the variable can be SRA by recursively checking the sub expressions with the new isSafeSubSROAGEP function. basically this allows the array in following C code to be optimized out struct Expr { int a[2]; int b; }; static struct Expr e; int foo (int i) { e.b = 2; e.a[i] = 1; return e.b; } Reviewers: greened, bkramer, nicholas, jmolloy Reviewed By: jmolloy Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D61911 llvm-svn: 361460
Diffstat (limited to 'clang/lib/Sema/SemaCodeComplete.cpp')
0 files changed, 0 insertions, 0 deletions