summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
diff options
context:
space:
mode:
authorAlp Toker <alp@nuanti.com>2014-01-04 13:47:14 +0000
committerAlp Toker <alp@nuanti.com>2014-01-04 13:47:14 +0000
commitef6b007dc5ff1290d48d71736fc5dc0f4c154331 (patch)
tree026adff363cfa2db801c13f8e6eb62bbe7141ab8 /clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
parentc2dee7dc742f518fdd57d3c357cb28b2d2ffe79f (diff)
downloadbcm5719-llvm-ef6b007dc5ff1290d48d71736fc5dc0f4c154331.tar.gz
bcm5719-llvm-ef6b007dc5ff1290d48d71736fc5dc0f4c154331.zip
Only mark dump() function definitions 'used' in debug builds
This has the dual effect of (1) enabling more dead-stripping in release builds and (2) ensuring that debug helper functions aren't stripped away in debug builds, as they're intended to be called from the debugger. Note that the attribute is applied to definitions rather than declarations in headers going forward because it's now conditional on NDEBUG: /// \brief Mark debug helper function definitions like dump() that should not be /// stripped from debug builds. Requires corresponding macro added in LLVM r198456. llvm-svn: 198489
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
index 8697badcf97..82a1aa22579 100644
--- a/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
@@ -108,9 +108,7 @@ public:
OS << Table[(unsigned) K];
}
- LLVM_ATTRIBUTE_USED void dump() const {
- dump(llvm::errs());
- }
+ LLVM_DUMP_METHOD void dump() const { dump(llvm::errs()); }
};
enum ReallocPairKind {
OpenPOWER on IntegriCloud