//===--- Mangle.cpp - Mangle C++ Names --------------------------*- C++ -*-===////// The LLVM Compiler Infrastructure//// This file is distributed under the University of Illinois Open Source// License. See LICENSE.TXT for details.////===----------------------------------------------------------------------===////// Implements C++ name mangling according to the Itanium C++ ABI,// which is used in GCC 3.2 and newer (and many compilers that are// ABI-compatible with GCC)://// http://www.codesourcery.com/public/cxx-abi/abi.html////===----------------------------------------------------------------------===//#include"Mangle.h"#include"clang/AST/ASTContext.h"#include"clang/AST/Decl.h"#include"clang/AST/DeclCXX.h"#include"clang/AST/DeclObjC.h"#include"clang/AST/DeclTemplate.h"#include"clang/AST/ExprCXX.h"#include"clang/Basic/SourceManager.h"#include"llvm/ADT/StringExtras.h"#include"llvm/Support/raw_ostream.h"#include"llvm/Support/ErrorHandling.h"#include"CGVtable.h"usingnamespaceclang;usingnamespaceCodeGen;namespace{staticconstCXXMethodDecl*getStructor(constCXXMethodDecl*MD){assert((isa<CXXConstructorDecl>(MD)||isa<CXXDestructorDecl>(MD))&&"Passed in decl is not a ctor or dtor!");if(constTemplateDecl*TD=MD->getPrimaryTemplate()){MD=cast<CXXMethodDecl>(TD->getTemplatedDecl());assert((isa<CXXConstructorDecl>(MD)||isa<CXXDestructorDecl>(MD))&&"Templated decl is not a c