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 | 2ec5dd71607ab5dd4f32059c6c8d5648cad0d3ee (patch) | |
| tree | 701b97ad4fed11831f3f61be9b65baa6cf61f28d | |
| parent | 6b7233afc6b7828043d9d63e2dfb8126af71b3cf (diff) | |
| download | bcm5719-llvm-2ec5dd71607ab5dd4f32059c6c8d5648cad0d3ee.tar.gz bcm5719-llvm-2ec5dd71607ab5dd4f32059c6c8d5648cad0d3ee.zip | |
Mangling support for typeinfo names.
llvm-svn: 88726
| -rw-r--r-- | clang/lib/CodeGen/Mangle.cpp | 16 | ||||
| -rw-r--r-- | clang/lib/CodeGen/Mangle.h | 2 |
2 files changed, 18 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/Mangle.cpp b/clang/lib/CodeGen/Mangle.cpp index 0b00c17330b..e644ff3e4ea 100644 --- a/clang/lib/CodeGen/Mangle.cpp +++ b/clang/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/clang/lib/CodeGen/Mangle.h b/clang/lib/CodeGen/Mangle.h index df50afa6e93..458708fca6a 100644 --- a/clang/lib/CodeGen/Mangle.h +++ b/clang/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, |

