From 4c78596182f50b693cb3fff80a42deab7a46ba9e Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Sun, 3 May 2009 16:51:04 +0000 Subject: [PATCH] assert that mangleName is not called for C++ ctors/dtors. llvm-svn: 70783 --- clang/lib/CodeGen/Mangle.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/clang/lib/CodeGen/Mangle.cpp b/clang/lib/CodeGen/Mangle.cpp index e6d643f7ca8b..b61acbbe5191 100644 --- a/clang/lib/CodeGen/Mangle.cpp +++ b/clang/lib/CodeGen/Mangle.cpp @@ -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(D) && + "Use mangleCXXCtor for constructor decls!"); + assert(!isa(D) && + "Use mangleCXXDtor for destructor decls!"); + CXXNameMangler Mangler(Context, os); if (!Mangler.mangle(D)) return false;