From: Douglas Gregor Date: Fri, 5 Mar 2010 21:48:53 +0000 (+0000) Subject: Switch from NDEBUG to _DEBUG, since our Windows build is funny X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=12312b807e7c00504c2e5b3b5e2d11bfbca4b8d8;p=clang Switch from NDEBUG to _DEBUG, since our Windows build is funny git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97835 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Frontend/ASTUnit.h b/include/clang/Frontend/ASTUnit.h index dca71cffec..70a1b2bb16 100644 --- a/include/clang/Frontend/ASTUnit.h +++ b/include/clang/Frontend/ASTUnit.h @@ -89,7 +89,7 @@ class ASTUnit { /// destroyed. llvm::SmallVector TemporaryFiles; -#ifndef NDEBUG +#ifdef _DEBUG /// \brief Simple hack to allow us to assert that ASTUnit is not being /// used concurrently, which is not supported. /// @@ -106,24 +106,24 @@ class ASTUnit { public: class ConcurrencyCheck { -#ifndef NDEBUG +#ifdef _DEBUG volatile ASTUnit &Self; #endif public: explicit ConcurrencyCheck(ASTUnit &Self) -#ifndef NDEBUG +#ifdef _DEBUG : Self(Self) #endif { -#ifndef NDEBUG +#ifdef _DEBUG assert(Self.ConcurrencyCheckValue == CheckUnlocked && "Concurrent access to ASTUnit!"); Self.ConcurrencyCheckValue = CheckLocked; #endif } -#ifndef NDEBUG +#ifdef _DEBUG ~ConcurrencyCheck() { Self.ConcurrencyCheckValue = CheckUnlocked; } diff --git a/lib/Frontend/ASTUnit.cpp b/lib/Frontend/ASTUnit.cpp index 4ea1ccc943..3bf5f796c4 100644 --- a/lib/Frontend/ASTUnit.cpp +++ b/lib/Frontend/ASTUnit.cpp @@ -39,7 +39,7 @@ ASTUnit::ASTUnit(bool _MainFileIsAST) : MainFileIsAST(_MainFileIsAST), ConcurrencyCheckValue(CheckUnlocked) { } ASTUnit::~ASTUnit() { -#ifndef NDEBUG +#ifdef _DEBUG ConcurrencyCheckValue = CheckLocked; #endif for (unsigned I = 0, N = TemporaryFiles.size(); I != N; ++I)