summaryrefslogtreecommitdiffstats
path: root/clang/test/Frontend/backend-diagnostic.c
diff options
context:
space:
mode:
authorAlp Toker <alp@nuanti.com>2014-06-05 22:10:59 +0000
committerAlp Toker <alp@nuanti.com>2014-06-05 22:10:59 +0000
commitfb8d02b179732b17897f1d4024583949a56b0bb5 (patch)
tree9773c072cdc1e0f4a6ccfba97f3ed6cda7f2d958 /clang/test/Frontend/backend-diagnostic.c
parent66f676e9e53aaaba12fd9848a94915346ab76b87 (diff)
downloadbcm5719-llvm-fb8d02b179732b17897f1d4024583949a56b0bb5.tar.gz
bcm5719-llvm-fb8d02b179732b17897f1d4024583949a56b0bb5.zip
Implement -Wframe-larger-than backend diagnostic
Add driver and frontend support for the GCC -Wframe-larger-than=bytes warning. This is the first GCC-compatible backend diagnostic built around LLVM's reporting feature. This commit adds infrastructure to perform reverse lookup from mangled names emitted after LLVM IR generation. We use that to resolve precise locations and originating AST functions, lambdas or block declarations to produce seamless codegen-guided diagnostics. An associated change, StringMap now maintains unique mangled name strings instead of allocating copies. This is a net memory saving in C++ and a small hit for C where we no longer reuse IdentifierInfo storage, pending further optimisation. llvm-svn: 210293
Diffstat (limited to 'clang/test/Frontend/backend-diagnostic.c')
-rw-r--r--clang/test/Frontend/backend-diagnostic.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/clang/test/Frontend/backend-diagnostic.c b/clang/test/Frontend/backend-diagnostic.c
index 8b61c0350ec..d6fe48bc9c5 100644
--- a/clang/test/Frontend/backend-diagnostic.c
+++ b/clang/test/Frontend/backend-diagnostic.c
@@ -11,16 +11,13 @@
// 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
//
-// Currently the stack size reporting cannot be checked with -verify because
-// no source location is attached to the diagnostic. Therefore do not emit
-// them for the -verify test for now.
// RUN: %clang_cc1 %s -S -o - -triple=i386-apple-darwin -verify -no-integrated-as
extern void doIt(char *);
-// REGULAR: warning: stack size exceeded ({{[0-9]+}}) in stackSizeWarning
-// PROMOTE: error: stack size exceeded ({{[0-9]+}}) in stackSizeWarning
-// IGNORE-NOT: stack size exceeded ({{[0-9]+}}) in stackSizeWarning
+// 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'
void stackSizeWarning() {
char buffer[80];
doIt(buffer);
OpenPOWER on IntegriCloud