summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorAlp Toker <alp@nuanti.com>2013-12-07 13:51:35 +0000
committerAlp Toker <alp@nuanti.com>2013-12-07 13:51:35 +0000
commitc108676822ecfe986d5642bbfd59f2dd4d39c9b0 (patch)
treee3b9f6cabdc69f7d085c52ee25b22a4f77252607 /clang/lib
parent3ffab05f542fdee47b4c2bcb8be97f35a7e0ea6c (diff)
downloadbcm5719-llvm-c108676822ecfe986d5642bbfd59f2dd4d39c9b0.tar.gz
bcm5719-llvm-c108676822ecfe986d5642bbfd59f2dd4d39c9b0.zip
Eliminate the last trivial NDEBUG uses in clang headers
assert(sanity()) reads so much better than preprocessor conditional blocks. llvm-svn: 196657
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/AST/DeclBase.cpp5
-rw-r--r--clang/lib/AST/Expr.cpp3
-rw-r--r--clang/lib/Sema/SemaLookup.cpp3
3 files changed, 7 insertions, 4 deletions
diff --git a/clang/lib/AST/DeclBase.cpp b/clang/lib/AST/DeclBase.cpp
index 7dc4493943a..4eceda4fac0 100644
--- a/clang/lib/AST/DeclBase.cpp
+++ b/clang/lib/AST/DeclBase.cpp
@@ -667,7 +667,7 @@ SourceLocation Decl::getBodyRBrace() const {
return SourceLocation();
}
-void Decl::CheckAccessDeclContext() const {
+bool Decl::AccessDeclContextSanity() const {
#ifndef NDEBUG
// Suppress this check if any of the following hold:
// 1. this is the translation unit (and thus has no parent)
@@ -689,11 +689,12 @@ void Decl::CheckAccessDeclContext() const {
// AS_none as access specifier.
isa<CXXRecordDecl>(this) ||
isa<ClassScopeFunctionSpecializationDecl>(this))
- return;
+ return true;
assert(Access != AS_none &&
"Access specifier is AS_none inside a record decl");
#endif
+ return true;
}
static Decl::Kind getKind(const Decl *D) { return D->getKind(); }
diff --git a/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp
index d98d0a537e5..14c8452fb52 100644
--- a/clang/lib/AST/Expr.cpp
+++ b/clang/lib/AST/Expr.cpp
@@ -1421,7 +1421,7 @@ SourceLocation MemberExpr::getLocEnd() const {
return EndLoc;
}
-void CastExpr::CheckCastConsistency() const {
+bool CastExpr::CastConsistency() const {
switch (getCastKind()) {
case CK_DerivedToBase:
case CK_UncheckedDerivedToBase:
@@ -1524,6 +1524,7 @@ void CastExpr::CheckCastConsistency() const {
assert(path_empty() && "Cast kind should not have a base path!");
break;
}
+ return true;
}
const char *CastExpr::getCastKindName() const {
diff --git a/clang/lib/Sema/SemaLookup.cpp b/clang/lib/Sema/SemaLookup.cpp
index 919c6ad61ab..ed2f5e93d35 100644
--- a/clang/lib/Sema/SemaLookup.cpp
+++ b/clang/lib/Sema/SemaLookup.cpp
@@ -315,7 +315,7 @@ void LookupResult::configure() {
}
}
-void LookupResult::sanityImpl() const {
+bool LookupResult::sanity() const {
// Note that this function is never called by NDEBUG builds. See
// LookupResult::sanity().
assert(ResultKind != NotFound || Decls.size() == 0);
@@ -330,6 +330,7 @@ void LookupResult::sanityImpl() const {
assert((Paths != NULL) == (ResultKind == Ambiguous &&
(Ambiguity == AmbiguousBaseSubobjectTypes ||
Ambiguity == AmbiguousBaseSubobjects)));
+ return true;
}
// Necessary because CXXBasePaths is not complete in Sema.h
OpenPOWER on IntegriCloud