]> granicus.if.org Git - clang/commit
Only mark dump() function definitions 'used' in debug builds
authorAlp Toker <alp@nuanti.com>
Sat, 4 Jan 2014 13:47:14 +0000 (13:47 +0000)
committerAlp Toker <alp@nuanti.com>
Sat, 4 Jan 2014 13:47:14 +0000 (13:47 +0000)
commit759afce785b0c84f33746cae0ef8a748ef93ead0
tree9f9aa0bfcd519fb195ef87f200e0680708e752a8
parentf984df7942dad333789dbb81214a332ce506e533
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198489 91177308-0d34-0410-b5e6-96231b3b80d8
17 files changed:
include/clang/AST/Comment.h
include/clang/AST/DeclBase.h
include/clang/AST/Stmt.h
include/clang/AST/Type.h
include/clang/Analysis/AnalysisContext.h
include/clang/Basic/SourceLocation.h
include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h
include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h
lib/AST/ASTDumper.cpp
lib/AST/DeclPrinter.cpp
lib/AST/TypePrinter.cpp
lib/Analysis/AnalysisDeclContext.cpp
lib/Basic/SourceLocation.cpp
lib/StaticAnalyzer/Checkers/MallocChecker.cpp
lib/StaticAnalyzer/Core/BugReporter.cpp
lib/StaticAnalyzer/Core/CallEvent.cpp
lib/StaticAnalyzer/Core/RegionStore.cpp