forked from OSchip/llvm-project
Eliminate two uses of NDEBUG in headers that cause different symbols
to be available in debug vs. release builds. llvm-svn: 120629
This commit is contained in:
parent
451d1b1d27
commit
4b00d3b55a
|
@ -234,11 +234,7 @@ protected:
|
|||
unsigned IdentifierNamespace : 15;
|
||||
|
||||
private:
|
||||
#ifndef NDEBUG
|
||||
void CheckAccessDeclContext() const;
|
||||
#else
|
||||
void CheckAccessDeclContext() const { }
|
||||
#endif
|
||||
|
||||
protected:
|
||||
|
||||
|
@ -299,11 +295,15 @@ public:
|
|||
|
||||
void setAccess(AccessSpecifier AS) {
|
||||
Access = AS;
|
||||
#ifndef NDEBUG
|
||||
CheckAccessDeclContext();
|
||||
#endif
|
||||
}
|
||||
|
||||
AccessSpecifier getAccess() const {
|
||||
#ifndef NDEBUG
|
||||
CheckAccessDeclContext();
|
||||
#endif
|
||||
return AccessSpecifier(Access);
|
||||
}
|
||||
|
||||
|
|
|
@ -410,10 +410,6 @@ class CXXRecordDecl : public RecordDecl {
|
|||
llvm::PointerUnion<ClassTemplateDecl*, MemberSpecializationInfo*>
|
||||
TemplateOrInstantiation;
|
||||
|
||||
#ifndef NDEBUG
|
||||
void CheckConversionFunction(NamedDecl *D);
|
||||
#endif
|
||||
|
||||
friend class DeclContext;
|
||||
|
||||
/// \brief Notify the class that member has been added.
|
||||
|
|
|
@ -424,8 +424,8 @@ SourceLocation Decl::getBodyRBrace() const {
|
|||
return SourceLocation();
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
void Decl::CheckAccessDeclContext() const {
|
||||
#ifndef NDEBUG
|
||||
// Suppress this check if any of the following hold:
|
||||
// 1. this is the translation unit (and thus has no parent)
|
||||
// 2. this is a template parameter (and thus doesn't belong to its context)
|
||||
|
@ -449,9 +449,9 @@ void Decl::CheckAccessDeclContext() const {
|
|||
|
||||
assert(Access != AS_none &&
|
||||
"Access specifier is AS_none inside a record decl");
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// DeclContext Implementation
|
||||
|
|
|
@ -726,20 +726,6 @@ const UnresolvedSetImpl *CXXRecordDecl::getVisibleConversionFunctions() {
|
|||
return &data().VisibleConversions;
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
void CXXRecordDecl::CheckConversionFunction(NamedDecl *ConvDecl) {
|
||||
assert(ConvDecl->getDeclContext() == this &&
|
||||
"conversion function does not belong to this record");
|
||||
|
||||
ConvDecl = ConvDecl->getUnderlyingDecl();
|
||||
if (FunctionTemplateDecl *Temp = dyn_cast<FunctionTemplateDecl>(ConvDecl)) {
|
||||
assert(isa<CXXConversionDecl>(Temp->getTemplatedDecl()));
|
||||
} else {
|
||||
assert(isa<CXXConversionDecl>(ConvDecl));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void CXXRecordDecl::removeConversion(const NamedDecl *ConvDecl) {
|
||||
// This operation is O(N) but extremely rare. Sema only uses it to
|
||||
// remove UsingShadowDecls in a class that were followed by a direct
|
||||
|
|
Loading…
Reference in New Issue