From ef6b007dc5ff1290d48d71736fc5dc0f4c154331 Mon Sep 17 00:00:00 2001 From: Alp Toker Date: Sat, 4 Jan 2014 13:47:14 +0000 Subject: 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 --- clang/lib/StaticAnalyzer/Core/CallEvent.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'clang/lib/StaticAnalyzer/Core/CallEvent.cpp') diff --git a/clang/lib/StaticAnalyzer/Core/CallEvent.cpp b/clang/lib/StaticAnalyzer/Core/CallEvent.cpp index a3b34f4790a..e0392bd1473 100644 --- a/clang/lib/StaticAnalyzer/Core/CallEvent.cpp +++ b/clang/lib/StaticAnalyzer/Core/CallEvent.cpp @@ -209,9 +209,7 @@ SVal CallEvent::getReturnValue() const { return getSVal(E); } -void CallEvent::dump() const { - dump(llvm::errs()); -} +LLVM_DUMP_METHOD void CallEvent::dump() const { dump(llvm::errs()); } void CallEvent::dump(raw_ostream &Out) const { ASTContext &Ctx = getState()->getStateManager().getContext(); -- cgit v1.2.3