зеркало из https://github.com/microsoft/clang-1.git
Do not change the size of LookupResult::Filter based on the NDEBUG
macri; the extra bool fits into padding anyway. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120708 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
6939fff69a
Коммит
fce5656f75
|
@ -497,25 +497,18 @@ public:
|
|||
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 @@ public:
|
|||
}
|
||||
|
||||
void done() {
|
||||
#ifndef NDEBUG
|
||||
assert(!CalledDone && "done() called twice");
|
||||
CalledDone = true;
|
||||
#endif
|
||||
|
||||
if (Changed)
|
||||
Results.resolveKindAfterFilter();
|
||||
|
@ -578,11 +569,7 @@ private:
|
|||
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)
|
||||
|
|
|
@ -292,7 +292,6 @@ void LookupResult::configure() {
|
|||
}
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
void LookupResult::sanity() const {
|
||||
assert(ResultKind != NotFound || Decls.size() == 0);
|
||||
assert(ResultKind != Found || Decls.size() == 1);
|
||||
|
@ -307,7 +306,6 @@ void LookupResult::sanity() const {
|
|||
(Ambiguity == AmbiguousBaseSubobjectTypes ||
|
||||
Ambiguity == AmbiguousBaseSubobjects)));
|
||||
}
|
||||
#endif
|
||||
|
||||
// Necessary because CXXBasePaths is not complete in Sema.h
|
||||
void LookupResult::deletePaths(CXXBasePaths *Paths) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче