15#define GEN_PASS_DEF_STRIPDEBUGINFO
16#include "mlir/Transforms/Passes.h.inc"
23 void runOnOperation()
override;
27void StripDebugInfo::runOnOperation() {
28 auto unknownLoc = UnknownLoc::get(&
getContext());
31 getOperation()->walk([&](Operation *op) {
35 for (
Block &block : region.getBlocks()) {
36 for (BlockArgument &arg : block.getArguments()) {
37 arg.setLoc(unknownLoc);
46 return std::make_unique<StripDebugInfo>();
void setLoc(Location loc)
Set the source location the operation was defined or derived from.
MutableArrayRef< Region > getRegions()
Returns the regions held by this operation.
Include the generated interface declarations.
std::unique_ptr< Pass > createStripDebugInfoPass()
Creates a pass to strip debug information from a function.