aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/DiagnosticInfo.cpp
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2021-06-22 09:55:20 -0700
committerFangrui Song <i@maskray.me>2021-06-22 09:55:20 -0700
commitf53d791520d85c5404381ff3ad92cb918256029d (patch)
tree385bfc379a8c72a48012e552fc3b06cee0099613 /llvm/lib/IR/DiagnosticInfo.cpp
parent40d6d2c49dd16641a6fd40916e1cc9a58513ed15 (diff)
downloadllvm-f53d791520d85c5404381ff3ad92cb918256029d.zip
llvm-f53d791520d85c5404381ff3ad92cb918256029d.tar.gz
llvm-f53d791520d85c5404381ff3ad92cb918256029d.tar.bz2
Improve the diagnostic of DiagnosticInfoResourceLimit (and warn-stack-size in particular)
Before: `warning: stack size limit exceeded (888) in main` After: `warning: stack frame size (888) exceeds limit (100) in function 'main'` (the -Wframe-larger-than limit will be mentioned) Reviewed By: nickdesaulniers Differential Revision: https://reviews.llvm.org/D104667
Diffstat (limited to 'llvm/lib/IR/DiagnosticInfo.cpp')
-rw-r--r--llvm/lib/IR/DiagnosticInfo.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/llvm/lib/IR/DiagnosticInfo.cpp b/llvm/lib/IR/DiagnosticInfo.cpp
index 5954170..f921382 100644
--- a/llvm/lib/IR/DiagnosticInfo.cpp
+++ b/llvm/lib/IR/DiagnosticInfo.cpp
@@ -70,12 +70,10 @@ void DiagnosticInfoInlineAsm::print(DiagnosticPrinter &DP) const {
}
void DiagnosticInfoResourceLimit::print(DiagnosticPrinter &DP) const {
- DP << getResourceName() << " limit";
-
+ DP << getResourceName() << " (" << getResourceSize() << ") exceeds limit";
if (getResourceLimit() != 0)
- DP << " of " << getResourceLimit();
-
- DP << " exceeded (" << getResourceSize() << ") in " << getFunction();
+ DP << " (" << getResourceLimit() << ')';
+ DP << " in function '" << getFunction() << '\'';
}
void DiagnosticInfoDebugMetadataVersion::print(DiagnosticPrinter &DP) const {