File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed
clang/lib/CodeGen/Targets Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -245,19 +245,17 @@ void CommonSPIRTargetCodeGenInfo::setOCLKernelStubCallingConvention(
245245
246246// LLVM currently assumes a null pointer has the bit pattern 0, but some GPU
247247// targets use a non-zero encoding for null in certain address spaces.
248- // Because SPIR(-V) is a virtual target and the bit pattern of a non-generic
249- // null is unspecified, materialize non-generic null via an addrspacecast from
250- // the generic null.
251- // This allows later lowering to substitute the target’ s real sentinel value.
248+ // Because SPIR(-V) is a generic target and the bit pattern of null in
249+ // non-generic AS is unspecified, materialize null in non-generic AS via an
250+ // addrspacecast from null in generic AS. This allows later lowering to
251+ // substitute the target' s real sentinel value.
252252llvm::Constant *
253253CommonSPIRTargetCodeGenInfo::getNullPointer (const CodeGen::CodeGenModule &CGM,
254254 llvm::PointerType *PT,
255255 QualType QT) const {
256- LangAS AS;
257- if (QT->getUnqualifiedDesugaredType ()->isNullPtrType ())
258- AS = LangAS::Default;
259- else
260- AS = QT->getPointeeType ().getAddressSpace ();
256+ LangAS AS = QT->getUnqualifiedDesugaredType ()->isNullPtrType ()
257+ ? LangAS::Default
258+ : QT->getPointeeType ().getAddressSpace ();
261259 if (AS == LangAS::Default || AS == LangAS::opencl_generic)
262260 return llvm::ConstantPointerNull::get (PT);
263261
You can’t perform that action at this time.
0 commit comments