Match the style in D104667.
This commit is for non-LTO diagnostics, while D104667 is for LTO and llc diagnostics.
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">,
+def warn_fe_frame_larger_than : Warning<"stack frame size (%0) exceeds limit (%1) in %q2">,
BackendInfo, InGroup<BackendFrameLargerThan>;
def warn_fe_backend_frame_larger_than: Warning<"%0">,
BackendInfo, InGroup<BackendFrameLargerThan>;
// FIXME: Shouldn't need to truncate to uint32_t
Diags.Report(ND->getASTContext().getFullLoc(ND->getLocation()),
diag::warn_fe_frame_larger_than)
- << static_cast<uint32_t>(D.getStackSize()) << Decl::castToDeclContext(ND);
+ << static_cast<uint32_t>(D.getStackSize())
+ << static_cast<uint32_t>(D.getStackLimit())
+ << Decl::castToDeclContext(ND);
return true;
}
extern void doIt(char *);
-// REGULAR: warning: stack frame size of {{[0-9]+}} bytes in function 'stackSizeWarning'
-// PROMOTE: error: stack frame size of {{[0-9]+}} bytes in function 'stackSizeWarning'
-// IGNORE-NOT: stack frame size of {{[0-9]+}} bytes in function 'stackSizeWarning'
+// REGULAR: warning: stack frame size ([[#]]) exceeds limit ([[#]]) in function 'stackSizeWarning'
+// PROMOTE: error: stack frame size ([[#]]) exceeds limit ([[#]]) in function 'stackSizeWarning'
+// IGNORE-NOT: stack frame size ([[#]]) exceeds limit ([[#]]) in function 'stackSizeWarning'
void stackSizeWarning() {
char buffer[80];
doIt(buffer);
virtual void f();
};
- // CHECK: warning: stack frame size of {{[0-9]+}} bytes in function 'frameSizeThunkWarning::B::f'
+ // CHECK: warning: stack frame size ([[#]]) exceeds limit ([[#]]) in function 'frameSizeThunkWarning::B::f'
// CHECK: warning: stack frame size ([[#]]) exceeds limit in function '_ZTv0_n12_N21frameSizeThunkWarning1B1fEv'
void B::f() {
volatile int x = 0; // Ensure there is stack usage.
void frameSizeWarning();
-void frameSizeWarning() { // expected-warning-re {{stack frame size of {{[0-9]+}} bytes in function 'frameSizeWarning'}}
+void frameSizeWarning() { // expected-warning-re {{stack frame size ({{[0-9]+}}) exceeds limit ({{[0-9]+}}) in function 'frameSizeWarning'}}
char buffer[80];
doIt(buffer);
}
void frameSizeLocalClassWarning() {
struct S {
- S() { // expected-warning-re {{stack frame size of {{[0-9]+}} bytes in function 'frameSizeLocalClassWarning()::S::S'}}
+ S() { // expected-warning-re {{stack frame size ({{[0-9]+}}) exceeds limit ({{[0-9]+}}) in function 'frameSizeLocalClassWarning()::S::S'}}
char buffer[80];
doIt(buffer);
}
void frameSizeLambdaWarning() {
auto fn =
- []() { // expected-warning-re {{stack frame size of {{[0-9]+}} bytes in lambda expression}}
+ []() { // expected-warning-re {{stack frame size ({{[0-9]+}}) exceeds limit ({{[0-9]+}}) in lambda expression}}
char buffer[80];
doIt(buffer);
};
void frameSizeBlocksWarning() {
auto fn =
- ^() { // expected-warning-re {{stack frame size of {{[0-9]+}} bytes in block literal}}
+ ^() { // expected-warning-re {{stack frame size ({{[0-9]+}}) exceeds limit ({{[0-9]+}}) in block literal}}
char buffer[80];
doIt(buffer);
};