diff options
| author | Daniel Dunbar <daniel@zuster.org> | 2012-03-08 01:43:06 +0000 |
|---|---|---|
| committer | Daniel Dunbar <daniel@zuster.org> | 2012-03-08 01:43:06 +0000 |
| commit | 9e19f134160a29430576c267a1b60bece658e544 (patch) | |
| tree | fc0dbd1334b7be051f676b0b3cf8b44e0027462c | |
| parent | 02a80da33129b45d0170b143208041689ae2ce3c (diff) | |
| download | bcm5719-llvm-9e19f134160a29430576c267a1b60bece658e544.tar.gz bcm5719-llvm-9e19f134160a29430576c267a1b60bece658e544.zip | |
Sema: Don't emit a gajillion calls to sanity() -- an empty function -- in NDEBUG
builds. Sheesh.
llvm-svn: 152279
| -rw-r--r-- | clang/include/clang/Sema/Lookup.h | 8 | ||||
| -rw-r--r-- | clang/lib/Sema/SemaLookup.cpp | 4 |
2 files changed, 10 insertions, 2 deletions
diff --git a/clang/include/clang/Sema/Lookup.h b/clang/include/clang/Sema/Lookup.h index 1c24d20ee83..e7a6f15c0e7 100644 --- a/clang/include/clang/Sema/Lookup.h +++ b/clang/include/clang/Sema/Lookup.h @@ -600,7 +600,13 @@ private: void configure(); // Sanity checks. - void sanity() const; + void sanityImpl() const; + + void sanity() const { +#ifndef NDEBUG + sanityImpl(); +#endif + } bool sanityCheckUnresolved() const { for (iterator I = begin(), E = end(); I != E; ++I) diff --git a/clang/lib/Sema/SemaLookup.cpp b/clang/lib/Sema/SemaLookup.cpp index b8901e20637..40774e135c9 100644 --- a/clang/lib/Sema/SemaLookup.cpp +++ b/clang/lib/Sema/SemaLookup.cpp @@ -302,7 +302,9 @@ void LookupResult::configure() { } } -void LookupResult::sanity() const { +void LookupResult::sanityImpl() const { + // Note that this function is never called by NDEBUG builds. See + // LookupResult::sanity(). assert(ResultKind != NotFound || Decls.size() == 0); assert(ResultKind != Found || Decls.size() == 1); assert(ResultKind != FoundOverloaded || Decls.size() > 1 || |

