Skip to content
Snippets Groups Projects
Commit 5ecb6106 authored by Alp Toker's avatar Alp Toker
Browse files

Make '-Werror=frame-larger-than=' and associated diagnostic pragmas GCC-compatible

It turns out the trailing '=' really is part of the option name spelling and
treating it as such gets us compatible with GCC's -Werror= and pragmas.

(GCC doesn't appear to support any -Wno- form for this diagnostic but we do.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210503 91177308-0d34-0410-b5e6-96231b3b80d8
parent fbd6f315
No related branches found
No related tags found
No related merge requests found
......@@ -23,8 +23,8 @@ def err_fe_cannot_link_module : Error<"cannot link module '%0': %1">,
DefaultFatal;
def warn_fe_frame_larger_than : Warning<"stack frame size of %0 bytes in %q1">,
CatBackend, InGroup<BackendFrameLargerThan>;
def warn_fe_backend_frame_larger_than: Warning<"%0">, CatBackend, InGroup<BackendFrameLargerThan>;
CatBackend, InGroup<BackendFrameLargerThanEQ>;
def warn_fe_backend_frame_larger_than: Warning<"%0">, CatBackend, InGroup<BackendFrameLargerThanEQ>;
def err_fe_backend_frame_larger_than: Error<"%0">, CatBackend;
def note_fe_backend_frame_larger_than: Note<"%0">, CatBackend;
......
......@@ -686,7 +686,7 @@ def OpenMPLoopForm : DiagGroup<"openmp-loop-form">;
// Backend warnings.
def BackendInlineAsm : DiagGroup<"inline-asm">;
def BackendFrameLargerThan : DiagGroup<"frame-larger-than">;
def BackendFrameLargerThanEQ : DiagGroup<"frame-larger-than=">;
def BackendPlugin : DiagGroup<"backend-plugin">;
def RemarkBackendPlugin : DiagGroup<"remark-backend-plugin">;
def BackendOptimizationRemark : DiagGroup<"pass">;
......
......@@ -6,9 +6,9 @@
//
// RUN: not %clang_cc1 %s -mllvm -warn-stack-size=0 -no-integrated-as -S -o - -triple=i386-apple-darwin 2> %t.err
// RUN: FileCheck < %t.err %s --check-prefix=REGULAR --check-prefix=ASM
// RUN: not %clang_cc1 %s -mllvm -warn-stack-size=0 -no-integrated-as -S -o - -triple=i386-apple-darwin -Werror=frame-larger-than 2> %t.err
// RUN: not %clang_cc1 %s -mllvm -warn-stack-size=0 -no-integrated-as -S -o - -triple=i386-apple-darwin -Werror=frame-larger-than= 2> %t.err
// RUN: FileCheck < %t.err %s --check-prefix=PROMOTE --check-prefix=ASM
// RUN: not %clang_cc1 %s -mllvm -warn-stack-size=0 -no-integrated-as -S -o - -triple=i386-apple-darwin -Wno-frame-larger-than 2> %t.err
// RUN: not %clang_cc1 %s -mllvm -warn-stack-size=0 -no-integrated-as -S -o - -triple=i386-apple-darwin -Wno-frame-larger-than= 2> %t.err
// RUN: FileCheck < %t.err %s --check-prefix=IGNORE --check-prefix=ASM
//
// RUN: %clang_cc1 %s -S -o - -triple=i386-apple-darwin -verify -no-integrated-as
......
......@@ -22,6 +22,16 @@ void frameSizeWarning();
void frameSizeWarning(int) {}
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wframe-larger-than="
// expected-warning@+1 {{unknown warning group '-Wframe-larger-than'}}
#pragma GCC diagnostic ignored "-Wframe-larger-than"
void frameSizeWarningIgnored() {
char buffer[80];
doIt(buffer);
}
#pragma GCC diagnostic pop
void frameSizeLocalClassWarning() {
struct S {
S() { // expected-warning-re {{stack frame size of {{[0-9]+}} bytes in function 'frameSizeLocalClassWarning()::S::S'}}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment