This is an archive of the discontinued LLVM Phabricator instance.

Move the DebugEmissionKind enum from DIBuilder into DICompileUnit and add a Verifier check for it.
ClosedPublic

Authored by aprantl on Mar 30 2016, 11:44 AM.

Details

Summary

This mostly cosmetic patch moves the DebugEmissionKind enum from DIBuilder into DICompileUnit.
DIBuilder is not the right place for this enum to live in — a metadata consumer should not have to include DIBuilder.h.
I also added a Verifier check that checks that the emission kind of a DICompileUnit is actually legal.

Note:
In case anyone is wondering why the Verifier also accepts 0 as a valid emission kind: In a subsequent review I will propose a new "NoDebug = 0" emission kind that will prevent the backend from emitting any Dwarf. Sample-based profiling currently deletes the !llvm.dbg.cu node to suppress Dwarf output, but this is not valid IR and I would like to get rid of this hack.

Diff Detail

Event Timeline

aprantl updated this revision to Diff 52093.Mar 30 2016, 11:44 AM
aprantl retitled this revision from to Move the DebugEmissionKind enum from DIBuilder into DICompileUnit and add a Verifier check for it. .
aprantl updated this object.
aprantl added reviewers: dexonsmith, dblaikie, echristo.
aprantl added a subscriber: llvm-commits.
aprantl updated this revision to Diff 52293.Mar 31 2016, 2:55 PM

As suggested by Duncan, this provides textual alternatives to the numeric emissionKind values in LLVM IR.

aprantl accepted this revision.Mar 31 2016, 5:11 PM
aprantl added a reviewer: aprantl.
This revision is now accepted and ready to land.Mar 31 2016, 5:11 PM
aprantl closed this revision.Mar 31 2016, 5:13 PM

r265077-r265080.