[lld] r310965 - Fix warning about unused variable.

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 28 18:07:48 PDT 2017


Perhaps the API could be refactored to return Expected<pair<DebugInfo*,
StringRef>> ?

On Tue, Aug 15, 2017 at 2:47 PM Zachary Turner via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Author: zturner
> Date: Tue Aug 15 14:46:51 2017
> New Revision: 310965
>
> URL: http://llvm.org/viewvc/llvm-project?rev=310965&view=rev
> Log:
> Fix warning about unused variable.
>
> I'm explicitly ignoring the warning by casting to void instead of
> deleting the local assignment, because it's confusing to see a
> function that fails when its return value evaluates to true.
> But when you see that it's a std::error_code, it makes more sense.
>
> Modified:
>     lld/trunk/COFF/Writer.cpp
>
> Modified: lld/trunk/COFF/Writer.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/Writer.cpp?rev=310965&r1=310964&r2=310965&view=diff
>
> ==============================================================================
> --- lld/trunk/COFF/Writer.cpp (original)
> +++ lld/trunk/COFF/Writer.cpp Tue Aug 15 14:46:51 2017
> @@ -268,8 +268,10 @@ static Optional<codeview::DebugInfo> loa
>
>      const codeview::DebugInfo *ExistingDI = nullptr;
>      StringRef PDBFileName;
> -    if (auto EC = File.getDebugPDBInfo(ExistingDI, PDBFileName))
> +    if (auto EC = File.getDebugPDBInfo(ExistingDI, PDBFileName)) {
> +      (void)EC;
>        return None;
> +    }
>      // We only support writing PDBs in v70 format.  So if this is not a
> build
>      // id that we recognize / support, ignore it.
>      if (ExistingDI->Signature.CVSignature != OMF::Signature::PDB70)
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170829/41994e1a/attachment.html>


More information about the llvm-commits mailing list