r289285 - Fix unused variable warnings. NFCI.
David Blaikie via cfe-commits
cfe-commits at lists.llvm.org
Mon Dec 12 10:26:41 PST 2016
On Fri, Dec 9, 2016 at 2:55 PM Simon Pilgrim via cfe-commits <
cfe-commits at lists.llvm.org> wrote:
> Author: rksimon
> Date: Fri Dec 9 16:45:21 2016
> New Revision: 289285
>
> URL: http://llvm.org/viewvc/llvm-project?rev=289285&view=rev
> Log:
> Fix unused variable warnings. NFCI.
>
> Modified:
> cfe/trunk/lib/CodeGen/CGExprConstant.cpp
> cfe/trunk/lib/CodeGen/CodeGenTypes.cpp
>
> Modified: cfe/trunk/lib/CodeGen/CGExprConstant.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprConstant.cpp?rev=289285&r1=289284&r2=289285&view=diff
>
> ==============================================================================
> --- cfe/trunk/lib/CodeGen/CGExprConstant.cpp (original)
> +++ cfe/trunk/lib/CodeGen/CGExprConstant.cpp Fri Dec 9 16:45:21 2016
> @@ -1617,9 +1617,9 @@ static llvm::Constant *EmitNullConstantF
> }
>
> 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>())
>
isa<PointerType>(*T) ?
> + return getNullPointer(
> + cast<llvm::PointerType>(getTypes().ConvertTypeForMem(T)), T);
>
> if (getTypes().isZeroInitializable(T))
> return llvm::Constant::getNullValue(getTypes().ConvertTypeForMem(T));
>
> Modified: cfe/trunk/lib/CodeGen/CodeGenTypes.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenTypes.cpp?rev=289285&r1=289284&r2=289285&view=diff
>
> ==============================================================================
> --- cfe/trunk/lib/CodeGen/CodeGenTypes.cpp (original)
> +++ cfe/trunk/lib/CodeGen/CodeGenTypes.cpp Fri Dec 9 16:45:21 2016
> @@ -742,7 +742,7 @@ bool CodeGenTypes::isPointerZeroInitiali
> }
>
> bool CodeGenTypes::isZeroInitializable(QualType T) {
> - if (auto PT = T->getAs<PointerType>())
> + if (T->getAs<PointerType>())
>
Similarly here.
> return Context.getTargetNullPointerValue(T) == 0;
>
> if (const auto *AT = Context.getAsArrayType(T)) {
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161212/305154a7/attachment.html>
More information about the cfe-commits
mailing list