[cfe-commits] r120708 - in /cfe/trunk: include/clang/Sema/Lookup.h lib/Sema/SemaLookup.cpp
Douglas Gregor
dgregor at apple.com
Thu Dec 2 08:19:31 PST 2010
Author: dgregor
Date: Thu Dec 2 10:19:31 2010
New Revision: 120708
URL: http://llvm.org/viewvc/llvm-project?rev=120708&view=rev
Log:
Do not change the size of LookupResult::Filter based on the NDEBUG
macri; the extra bool fits into padding anyway.
Modified:
cfe/trunk/include/clang/Sema/Lookup.h
cfe/trunk/lib/Sema/SemaLookup.cpp
Modified: cfe/trunk/include/clang/Sema/Lookup.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Lookup.h?rev=120708&r1=120707&r2=120708&view=diff
==============================================================================
--- cfe/trunk/include/clang/Sema/Lookup.h (original)
+++ cfe/trunk/include/clang/Sema/Lookup.h Thu Dec 2 10:19:31 2010
@@ -497,25 +497,18 @@
LookupResult &Results;
LookupResult::iterator I;
bool Changed;
-#ifndef NDEBUG
bool CalledDone;
-#endif
friend class LookupResult;
Filter(LookupResult &Results)
- : Results(Results), I(Results.begin()), Changed(false)
-#ifndef NDEBUG
- , CalledDone(false)
-#endif
+ : Results(Results), I(Results.begin()), Changed(false), CalledDone(false)
{}
public:
-#ifndef NDEBUG
~Filter() {
assert(CalledDone &&
"LookupResult::Filter destroyed without done() call");
}
-#endif
bool hasNext() const {
return I != Results.end();
@@ -546,10 +539,8 @@
}
void done() {
-#ifndef NDEBUG
assert(!CalledDone && "done() called twice");
CalledDone = true;
-#endif
if (Changed)
Results.resolveKindAfterFilter();
@@ -578,11 +569,7 @@
void configure();
// Sanity checks.
-#ifndef NDEBUG
void sanity() const;
-#else
- void sanity() const {}
-#endif
bool sanityCheckUnresolved() const {
for (iterator I = begin(), E = end(); I != E; ++I)
Modified: cfe/trunk/lib/Sema/SemaLookup.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaLookup.cpp?rev=120708&r1=120707&r2=120708&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaLookup.cpp (original)
+++ cfe/trunk/lib/Sema/SemaLookup.cpp Thu Dec 2 10:19:31 2010
@@ -292,7 +292,6 @@
}
}
-#ifndef NDEBUG
void LookupResult::sanity() const {
assert(ResultKind != NotFound || Decls.size() == 0);
assert(ResultKind != Found || Decls.size() == 1);
@@ -307,7 +306,6 @@
(Ambiguity == AmbiguousBaseSubobjectTypes ||
Ambiguity == AmbiguousBaseSubobjects)));
}
-#endif
// Necessary because CXXBasePaths is not complete in Sema.h
void LookupResult::deletePaths(CXXBasePaths *Paths) {
More information about the cfe-commits
mailing list