}
llvm::Constant *CodeGenModule::EmitNullConstant(QualType T) {
- if (auto PT = T->getAs<PointerType>())
- return getNullPointer(cast<llvm::PointerType>(getTypes().ConvertTypeForMem(T)),
- T);
+ if (T->getAs<PointerType>())
+ return getNullPointer(
+ cast<llvm::PointerType>(getTypes().ConvertTypeForMem(T)), T);
if (getTypes().isZeroInitializable(T))
return llvm::Constant::getNullValue(getTypes().ConvertTypeForMem(T));
}
bool CodeGenTypes::isZeroInitializable(QualType T) {
- if (auto PT = T->getAs<PointerType>())
+ if (T->getAs<PointerType>())
return Context.getTargetNullPointerValue(T) == 0;
if (const auto *AT = Context.getAsArrayType(T)) {