aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/Debugify.cpp
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2020-04-17 17:53:14 -0700
committerVedant Kumar <vsk@apple.com>2020-04-22 17:03:39 -0700
commit2fa656cdfd836d5d3959466f05e44ae51bcded4e (patch)
tree300e7dfbe24ed2f1f85a528ff706d3f095948800 /llvm/lib/Transforms/Utils/Debugify.cpp
parent2a5675f11d3bc803a245c0e2a3b47491c8f8a065 (diff)
downloadllvm-2fa656cdfd836d5d3959466f05e44ae51bcded4e.zip
llvm-2fa656cdfd836d5d3959466f05e44ae51bcded4e.tar.gz
llvm-2fa656cdfd836d5d3959466f05e44ae51bcded4e.tar.bz2
[Debugify] Do not require named metadata to be present when stripping
This allows -mir-strip-debug to be run without -debugify having run before.
Diffstat (limited to 'llvm/lib/Transforms/Utils/Debugify.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/Debugify.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/Debugify.cpp b/llvm/lib/Transforms/Utils/Debugify.cpp
index f2739a8..19c73f3 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);