]> granicus.if.org Git - clang/commitdiff
Make ASTUnit structure stable with NDEBUG
authorAlp Toker <alp@nuanti.com>
Fri, 22 Nov 2013 07:49:39 +0000 (07:49 +0000)
committerAlp Toker <alp@nuanti.com>
Fri, 22 Nov 2013 07:49:39 +0000 (07:49 +0000)
ASTUnit instances are allocated infrequently so it's fine to keep this field
around in all build configurations.

Assigns null to silence -Wunused-private-field in Release.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195419 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Frontend/ASTUnit.h
lib/Frontend/ASTUnit.cpp

index 43d77f0171e96b2a4e5575398bd06fe1e6c0bfdd..1b54fdf0a9e3b0200a03488d02410e3ca00a7b37 100644 (file)
@@ -406,9 +406,7 @@ private:
   /// just about any usage.
   /// Becomes a noop in release mode; only useful for debug mode checking.
   class ConcurrencyState {
-#ifndef NDEBUG
     void *Mutex; // a llvm::sys::MutexImpl in debug;
-#endif
 
   public:
     ConcurrencyState();
index a8c587638a286c19b4a7c0f7fbf6d09d8947bf04..cbdfab561f7f791dd9c1a42f03ce39b3eaa280b4 100644 (file)
@@ -2953,7 +2953,7 @@ void ASTUnit::ConcurrencyState::finish() {
 
 #else // NDEBUG
 
-ASTUnit::ConcurrencyState::ConcurrencyState() {}
+ASTUnit::ConcurrencyState::ConcurrencyState() { Mutex = 0; }
 ASTUnit::ConcurrencyState::~ConcurrencyState() {}
 void ASTUnit::ConcurrencyState::start() {}
 void ASTUnit::ConcurrencyState::finish() {}