summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2017-03-13 19:47:53 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2017-03-13 19:47:53 +0000
commitbf5e3e4391077fbb44867d8e5adfa123a828a19d (patch)
treeca527954300d7b47224403046d09bba5458a5470 /clang/lib/Basic
parent971c85ebb4416b5bf8c5c878ff49fc773f04c664 (diff)
downloadbcm5719-llvm-bf5e3e4391077fbb44867d8e5adfa123a828a19d.tar.gz
bcm5719-llvm-bf5e3e4391077fbb44867d8e5adfa123a828a19d.zip
AMDGPU: Make 0 the private nullptr value
We can't actually pretend that 0 is valid for address space 0. r295877 added a workaround to stop allocating user objects there, so we can use 0 as the invalid pointer. Some of the tests seemed to be using private as the non-0 null test address space, so add copies using local to make sure this is still stressed. llvm-svn: 297659
Diffstat (limited to 'clang/lib/Basic')
-rw-r--r--clang/lib/Basic/Targets.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp
index e23ff3cc380..21d9ea13ea9 100644
--- a/clang/lib/Basic/Targets.cpp
+++ b/clang/lib/Basic/Targets.cpp
@@ -2298,7 +2298,7 @@ public:
// address space has value 0 but in private and local address space has
// value ~0.
uint64_t getNullPointerValue(unsigned AS) const override {
- return AS != LangAS::opencl_local && AS != 0 ? 0 : ~0;
+ return AS == LangAS::opencl_local ? ~0 : 0;
}
};
OpenPOWER on IntegriCloud