1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00

[Debugify] Do not require named metadata to be present when stripping

This allows -mir-strip-debug to be run without -debugify having run
before.
This commit is contained in:
Vedant Kumar 2020-04-17 17:53:14 -07:00
parent 5430d2dee2
commit f74f9f2af9

View File

@ -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);