summaryrefslogtreecommitdiff
path: root/unittests
diff options
context:
space:
mode:
authorManoj Gupta <manojgupta@google.com>2018-07-09 22:27:23 +0000
committerManoj Gupta <manojgupta@google.com>2018-07-09 22:27:23 +0000
commitc6da6867a1d033384367983944f7c1ad103e9559 (patch)
treeb76ce831d5d762480d5ea2d46e7ce2f821642568 /unittests
parent1897a62c2efa7867857d280a77444ef8f421c37e (diff)
llvm: Add support for "-fno-delete-null-pointer-checks"
Summary: Support for this option is needed for building Linux kernel. This is a very frequently requested feature by kernel developers. More details : https://lkml.org/lkml/2018/4/4/601 GCC option description for -fdelete-null-pointer-checks: This Assume that programs cannot safely dereference null pointers, and that no code or data element resides at address zero. -fno-delete-null-pointer-checks is the inverse of this implying that null pointer dereferencing is not undefined. This feature is implemented in LLVM IR in this CL as the function attribute "null-pointer-is-valid"="true" in IR (Under review at D47894). The CL updates several passes that assumed null pointer dereferencing is undefined to not optimize when the "null-pointer-is-valid"="true" attribute is present. Reviewers: t.p.northover, efriedma, jyknight, chandlerc, rnk, srhines, void, george.burgess.iv Reviewed By: efriedma, george.burgess.iv Subscribers: eraman, haicheng, george.burgess.iv, drinkcat, theraven, reames, sanjoy, xbolva00, llvm-commits Differential Revision: https://reviews.llvm.org/D47895 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336613 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r--unittests/Analysis/AliasAnalysisTest.cpp2
-rw-r--r--unittests/Analysis/MemorySSA.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/unittests/Analysis/AliasAnalysisTest.cpp b/unittests/Analysis/AliasAnalysisTest.cpp
index f1294eb5b7e..0f0d44f6c78 100644
--- a/unittests/Analysis/AliasAnalysisTest.cpp
+++ b/unittests/Analysis/AliasAnalysisTest.cpp
@@ -156,7 +156,7 @@ protected:
// Build the various AA results and register them.
AC.reset(new AssumptionCache(F));
- BAR.reset(new BasicAAResult(M.getDataLayout(), TLI, *AC));
+ BAR.reset(new BasicAAResult(M.getDataLayout(), F, TLI, *AC));
AAR->addAAResult(*BAR);
return *AAR;
diff --git a/unittests/Analysis/MemorySSA.cpp b/unittests/Analysis/MemorySSA.cpp
index c93c0d34307..1a1675faca1 100644
--- a/unittests/Analysis/MemorySSA.cpp
+++ b/unittests/Analysis/MemorySSA.cpp
@@ -50,7 +50,7 @@ protected:
TestAnalyses(MemorySSATest &Test)
: DT(*Test.F), AC(*Test.F), AA(Test.TLI),
- BAA(Test.DL, Test.TLI, AC, &DT) {
+ BAA(Test.DL, *Test.F, Test.TLI, AC, &DT) {
AA.addAAResult(BAA);
MSSA = make_unique<MemorySSA>(*Test.F, &AA, &DT);
Walker = MSSA->getWalker();