diff options
author | Mike Stump <mrs@apple.com> | 2009-11-14 00:14:13 +0000 |
---|---|---|
committer | Mike Stump <mrs@apple.com> | 2009-11-14 00:14:13 +0000 |
commit | 67795980157a48b51a59737a9478470eb0871dbb (patch) | |
tree | d0cc6b3eccd87c1f8fee90d72ce80361dc2fc0b9 | |
parent | fd47648b5d351ff6d1a3e886e1c3d10712ba4675 (diff) |
Mangling support for typeinfo names.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88726 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/Mangle.cpp | 16 | ||||
-rw-r--r-- | lib/CodeGen/Mangle.h | 2 |
2 files changed, 18 insertions, 0 deletions
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) { + // <special-name> ::= TS <type> # typeinfo name (null terminated byte string) + Out << "_ZTS"; + + mangleType(Ty); +} + void CXXNameMangler::mangleGuardVariable(const VarDecl *D) { // <special-name> ::= GV <object name> # 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, |