This is an archive of the discontinued LLVM Phabricator instance.

[clang] Rework dontcall attributes
ClosedPublic

Authored by aeubanks on Sep 23 2021, 2:04 PM.

Details

Summary

To avoid using the AST when emitting diagnostics, split the "dontcall"
attribute into "dontcall-warn" and "dontcall-error", and also add the
frontend attribute value as the LLVM attribute value. This gives us all
the information to report diagnostics we need from within the IR (aside
from access to the original source).

One downside is we directly use LLVM's demangler rather than using the
existing Clang diagnostic pretty printing of symbols.

Diff Detail

Event Timeline

aeubanks created this revision.Sep 23 2021, 2:04 PM
aeubanks published this revision for review.Sep 28 2021, 11:30 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptSep 28 2021, 11:30 AM
nickdesaulniers accepted this revision.Sep 28 2021, 11:54 AM

thanks for the patch!

llvm/lib/IR/DiagnosticInfo.cpp
408–427

Any way to DRY up this code?

This revision is now accepted and ready to land.Sep 28 2021, 11:54 AM
This revision was landed with ongoing or failed builds.Sep 28 2021, 2:21 PM
This revision was automatically updated to reflect the committed changes.
thakis added a subscriber: thakis.Sep 28 2021, 4:50 PM

Looks like this breaks tests on windows: http://45.33.8.238/win/46089/step_7.txt

Please take a look, and revert for now if it takes a while to fix.

Looks like this breaks tests on windows: http://45.33.8.238/win/46089/step_7.txt

Please take a look, and revert for now if it takes a while to fix.

Should be fixed with 2d56fbf6cd16bb.