From 67795980157a48b51a59737a9478470eb0871dbb Mon Sep 17 00:00:00 2001 From: Mike Stump Date: Sat, 14 Nov 2009 00:14:13 +0000 Subject: [PATCH] Mangling support for typeinfo names. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88726 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/Mangle.cpp | 16 ++++++++++++++++ lib/CodeGen/Mangle.h | 2 ++ 2 files changed, 18 insertions(+) diff --git a/lib/CodeGen/Mangle.cpp b/lib/CodeGen/Mangle.cpp index 0b00c17330..e644ff3e4e 100644 --- a/lib/CodeGen/Mangle.cpp +++ b/lib/CodeGen/Mangle.cpp @@ -56,6 +56,7 @@ namespace { void mangleCXXCtorVtable(const CXXRecordDecl *RD, int64_t Offset, const CXXRecordDecl *Type); void mangleCXXRtti(QualType Ty); + void mangleCXXRttiName(QualType Ty); void mangleCXXCtor(const CXXConstructorDecl *D, CXXCtorType Type); void mangleCXXDtor(const CXXDestructorDecl *D, CXXDtorType Type); @@ -236,6 +237,13 @@ void CXXNameMangler::mangleCXXRtti(QualType Ty) { mangleType(Ty); } +void CXXNameMangler::mangleCXXRttiName(QualType Ty) { + // ::= TS # typeinfo name (null terminated byte string) + Out << "_ZTS"; + + mangleType(Ty); +} + void CXXNameMangler::mangleGuardVariable(const VarDecl *D) { // ::= GV # Guard variable for one-time // # initialization @@ -1480,4 +1488,12 @@ namespace clang { os.flush(); } + + void mangleCXXRttiName(MangleContext &Context, QualType Ty, + llvm::raw_ostream &os) { + CXXNameMangler Mangler(Context, os); + Mangler.mangleCXXRttiName(Ty); + + os.flush(); + } } diff --git a/lib/CodeGen/Mangle.h b/lib/CodeGen/Mangle.h index df50afa6e9..458708fca6 100644 --- a/lib/CodeGen/Mangle.h +++ b/lib/CodeGen/Mangle.h @@ -72,6 +72,8 @@ namespace clang { llvm::raw_ostream &os); void mangleCXXRtti(MangleContext &Context, QualType T, llvm::raw_ostream &os); + void mangleCXXRttiName(MangleContext &Context, QualType T, + llvm::raw_ostream &os); void mangleCXXCtor(MangleContext &Context, const CXXConstructorDecl *D, CXXCtorType Type, llvm::raw_ostream &os); void mangleCXXDtor(MangleContext &Context, const CXXDestructorDecl *D, -- 2.40.0