Skip to content

Commit b95e77a

Browse files
committed
ternary operator, update comment
1 parent 5c5e13e commit b95e77a

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

clang/lib/CodeGen/Targets/SPIR.cpp

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff 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 targets 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.
252252
llvm::Constant *
253253
CommonSPIRTargetCodeGenInfo::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

0 commit comments

Comments
 (0)