[cfe-commits] r97840 - in /cfe/trunk: include/clang/Frontend/ASTUnit.h lib/Frontend/ASTUnit.cpp
Douglas Gregor
dgregor at apple.com
Fri Mar 5 14:19:41 PST 2010
Author: dgregor
Date: Fri Mar 5 16:19:41 2010
New Revision: 97840
URL: http://llvm.org/viewvc/llvm-project?rev=97840&view=rev
Log:
The Windows build is just too weird; there's no real cost to doing the concurrency checks for ASTUnit in all builds
Modified:
cfe/trunk/include/clang/Frontend/ASTUnit.h
cfe/trunk/lib/Frontend/ASTUnit.cpp
Modified: cfe/trunk/include/clang/Frontend/ASTUnit.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/ASTUnit.h?rev=97840&r1=97839&r2=97840&view=diff
==============================================================================
--- cfe/trunk/include/clang/Frontend/ASTUnit.h (original)
+++ cfe/trunk/include/clang/Frontend/ASTUnit.h Fri Mar 5 16:19:41 2010
@@ -89,7 +89,6 @@
/// destroyed.
llvm::SmallVector<llvm::sys::Path, 4> TemporaryFiles;
-#ifdef _DEBUG
/// \brief Simple hack to allow us to assert that ASTUnit is not being
/// used concurrently, which is not supported.
///
@@ -99,35 +98,26 @@
unsigned int ConcurrencyCheckValue;
static const unsigned int CheckLocked = 28573289;
static const unsigned int CheckUnlocked = 9803453;
-#endif
ASTUnit(const ASTUnit&); // DO NOT IMPLEMENT
ASTUnit &operator=(const ASTUnit &); // DO NOT IMPLEMENT
public:
class ConcurrencyCheck {
-#ifdef _DEBUG
volatile ASTUnit &Self;
-#endif
public:
explicit ConcurrencyCheck(ASTUnit &Self)
-#ifdef _DEBUG
: Self(Self)
-#endif
{
-#ifdef _DEBUG
assert(Self.ConcurrencyCheckValue == CheckUnlocked &&
"Concurrent access to ASTUnit!");
Self.ConcurrencyCheckValue = CheckLocked;
-#endif
}
-#ifdef _DEBUG
~ConcurrencyCheck() {
Self.ConcurrencyCheckValue = CheckUnlocked;
}
-#endif
};
friend class ConcurrencyCheck;
Modified: cfe/trunk/lib/Frontend/ASTUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/ASTUnit.cpp?rev=97840&r1=97839&r2=97840&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/ASTUnit.cpp (original)
+++ cfe/trunk/lib/Frontend/ASTUnit.cpp Fri Mar 5 16:19:41 2010
@@ -39,9 +39,7 @@
: MainFileIsAST(_MainFileIsAST), ConcurrencyCheckValue(CheckUnlocked) {
}
ASTUnit::~ASTUnit() {
-#ifdef _DEBUG
ConcurrencyCheckValue = CheckLocked;
-#endif
for (unsigned I = 0, N = TemporaryFiles.size(); I != N; ++I)
TemporaryFiles[I].eraseFromDisk();
}
More information about the cfe-commits
mailing list