Reland [clang] Rework dontcall attributes
authorArthur Eubanks <aeubanks@google.com>
Thu, 23 Sep 2021 20:54:24 +0000 (13:54 -0700)
committerArthur Eubanks <aeubanks@google.com>
Tue, 28 Sep 2021 22:31:30 +0000 (15:31 -0700)
commitaa53785f23b2b89a9a423af131697b1f7c92869f
tree08af7e6edb39c4f79c4f495a791545514d392df9
parent4f38f0640dd727740cd027f9b178fb9f5ca0406f
Reland [clang] Rework dontcall attributes

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.

Previous revisions didn't properly declare the new dependencies.

Reviewed By: nickdesaulniers

Differential Revision: https://reviews.llvm.org/D110364
17 files changed:
clang/lib/CodeGen/CMakeLists.txt
clang/lib/CodeGen/CodeGenAction.cpp
clang/lib/CodeGen/CodeGenModule.cpp
clang/test/CodeGen/attr-error.c
clang/test/CodeGen/attr-warning.c
clang/test/Frontend/backend-attribute-error-warning-optimize.c
clang/test/Frontend/backend-attribute-error-warning.c
clang/test/Frontend/backend-attribute-error-warning.cpp [new file with mode: 0644]
llvm/docs/LangRef.rst
llvm/include/llvm/IR/DiagnosticInfo.h
llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
llvm/lib/IR/DiagnosticInfo.cpp
llvm/test/CodeGen/X86/attr-dontcall.ll
llvm/test/ThinLTO/X86/dontcall.ll
llvm/utils/gn/secondary/clang/lib/CodeGen/BUILD.gn