mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-29 02:56:06 +00:00

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
12 lines
344 B
C
12 lines
344 B
C
// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s
|
|
__attribute__((error("oh no"))) void foo(void);
|
|
|
|
void bar(void) {
|
|
foo();
|
|
}
|
|
|
|
// CHECK: call void @foo(), !srcloc [[SRCLOC:![0-9]+]]
|
|
// CHECK: declare{{.*}} void @foo() [[ATTR:#[0-9]+]]
|
|
// CHECK: attributes [[ATTR]] = {{{.*}}"dontcall-error"="oh no"
|
|
// CHECK: [[SRCLOC]] = !{i32 {{[0-9]+}}}
|