[llvm] 2fa656c - [Debugify] Do not require named metadata to be present when stripping

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 27 21:15:38 PDT 2020


Should/could this have a test case?

On Wed, Apr 22, 2020 at 5:05 PM Vedant Kumar via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

>
> Author: Vedant Kumar
> Date: 2020-04-22T17:03:39-07:00
> New Revision: 2fa656cdfd836d5d3959466f05e44ae51bcded4e
>
> URL:
> https://github.com/llvm/llvm-project/commit/2fa656cdfd836d5d3959466f05e44ae51bcded4e
> DIFF:
> https://github.com/llvm/llvm-project/commit/2fa656cdfd836d5d3959466f05e44ae51bcded4e.diff
>
> LOG: [Debugify] Do not require named metadata to be present when stripping
>
> This allows -mir-strip-debug to be run without -debugify having run
> before.
>
> Added:
>
>
> Modified:
>     llvm/lib/Transforms/Utils/Debugify.cpp
>
> Removed:
>
>
>
>
> ################################################################################
> diff  --git a/llvm/lib/Transforms/Utils/Debugify.cpp
> b/llvm/lib/Transforms/Utils/Debugify.cpp
> index f2739a8257a2..19c73f3840fc 100644
> --- a/llvm/lib/Transforms/Utils/Debugify.cpp
> +++ b/llvm/lib/Transforms/Utils/Debugify.cpp
> @@ -224,7 +224,8 @@ bool llvm::stripDebugifyMetadata(Module &M) {
>    // Strip out the module-level Debug Info Version metadata.
>    // FIXME: There must be an easier way to remove an operand from a
> NamedMDNode.
>    NamedMDNode *NMD = M.getModuleFlagsMetadata();
> -  assert(NMD && "debugify metadata present without Debug Info Version
> set?");
> +  if (!NMD)
> +    return Changed;
>    SmallVector<MDNode *, 4> Flags;
>    for (MDNode *Flag : NMD->operands())
>      Flags.push_back(Flag);
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> https://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/20200427/16f59173/attachment.html>


More information about the llvm-commits mailing list