This is an archive of the discontinued LLVM Phabricator instance.

[Assignment Tracking][NFC] Replace LLVM command line option with a new module flag
ClosedPublic

Authored by Orlando on Jan 18 2023, 8:21 AM.

Details

Summary

Remove LLVM flag -experimental-assignment-tracking. Assignment tracking is still enabled from Clang with the command line -Xclang -fexperimental-assignment-tracking which tells Clang to ask LLVM to run the pass declare-to-assign. That pass converts conventional debug intrinsics to assignment tracking metadata. With this patch it now also sets a module flag debug-info-assignment-tracking with the value i1 true (using the flag conflict rule Max since enabling assignment tracking on IR that contains only conventional debug intrinsics should cause no issues).

Update the docs and tests too.

Diff Detail

Event Timeline

Orlando created this revision.Jan 18 2023, 8:21 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 18 2023, 8:21 AM
Orlando requested review of this revision.Jan 18 2023, 8:21 AM
CarlosAlbertoEnciso added inline comments.
llvm/include/llvm/IR/DebugInfo.h
299–301

Any reason for the change to private?

May be add some explanatory notes for the change to 'private'.

This revision is now accepted and ready to land.Jan 20 2023, 5:42 AM
Orlando marked an inline comment as done.Jan 20 2023, 5:44 AM
Orlando added inline comments.
llvm/include/llvm/IR/DebugInfo.h
299–301

runOnFunction doesn't itself set the module flag - the other two run methods call runOnFunction then set the module flag themselves, so that in the case of the Module override it is only set once. I've made runOnFunction private to avoid the pass functionality being used without the module flag being set. IMO it should always have been private anyway.

This revision was landed with ongoing or failed builds.Jan 20 2023, 6:25 AM
This revision was automatically updated to reflect the committed changes.
Orlando marked an inline comment as done.
Herald added a project: Restricted Project. · View Herald TranscriptJan 20 2023, 6:25 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
clang/lib/Driver/ToolChains/Clang.cpp