[llvm] r336007 - Pass DWARFUnit to verifier by reference not by value. I am moderately

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 2 09:24:15 PDT 2018


Should that be by const ref? It doesn't seem like a "verify" option should
be mutating anything?

On Fri, Jun 29, 2018 at 12:22 PM Paul Robinson via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Author: probinson
> Date: Fri Jun 29 12:17:44 2018
> New Revision: 336007
>
> URL: http://llvm.org/viewvc/llvm-project?rev=336007&view=rev
> Log:
> Pass DWARFUnit to verifier by reference not by value.  I am moderately
> sure this should not cause a memory leak.
>
> Modified:
>     llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFVerifier.h
>     llvm/trunk/lib/DebugInfo/DWARF/DWARFVerifier.cpp
>
> Modified: llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFVerifier.h
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFVerifier.h?rev=336007&r1=336006&r2=336007&view=diff
>
> ==============================================================================
> --- llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFVerifier.h (original)
> +++ llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFVerifier.h Fri Jun 29
> 12:17:44 2018
> @@ -152,7 +152,7 @@ private:
>    ///                  type of the unit DIE.
>    ///
>    /// \returns true if the content is verified successfully, false
> otherwise.
> -  bool verifyUnitContents(DWARFUnit Unit, uint8_t UnitType = 0);
> +  bool verifyUnitContents(DWARFUnit &Unit, uint8_t UnitType = 0);
>
>    /// Verify that all Die ranges are valid.
>    ///
>
> Modified: llvm/trunk/lib/DebugInfo/DWARF/DWARFVerifier.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARF/DWARFVerifier.cpp?rev=336007&r1=336006&r2=336007&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/DebugInfo/DWARF/DWARFVerifier.cpp (original)
> +++ llvm/trunk/lib/DebugInfo/DWARF/DWARFVerifier.cpp Fri Jun 29 12:17:44
> 2018
> @@ -171,7 +171,7 @@ bool DWARFVerifier::verifyUnitHeader(con
>    return Success;
>  }
>
> -bool DWARFVerifier::verifyUnitContents(DWARFUnit Unit, uint8_t UnitType) {
> +bool DWARFVerifier::verifyUnitContents(DWARFUnit &Unit, uint8_t UnitType)
> {
>    uint32_t NumUnitErrors = 0;
>    unsigned NumDies = Unit.getNumDIEs();
>    for (unsigned I = 0; I < NumDies; ++I) {
>
>
> _______________________________________________
> 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/20180702/74bead21/attachment.html>


More information about the llvm-commits mailing list