assert that mangleName is not called for C++ ctors/dtors.

llvm-svn: 70783
This commit is contained in:
Anders Carlsson 2009-05-03 16:51:04 +00:00
parent 4ff60e0cc2
commit 4c78596182
1 changed files with 5 additions and 0 deletions

View File

@ -657,6 +657,11 @@ namespace clang {
/// (\c D->getIdentifier()) as its name.
bool mangleName(const NamedDecl *D, ASTContext &Context,
llvm::raw_ostream &os) {
assert(!isa<CXXConstructorDecl>(D) &&
"Use mangleCXXCtor for constructor decls!");
assert(!isa<CXXDestructorDecl>(D) &&
"Use mangleCXXDtor for destructor decls!");
CXXNameMangler Mangler(Context, os);
if (!Mangler.mangle(D))
return false;