Douglas Gregor | 3c3c454 | 2009-02-18 23:53:56 +0000 | [diff] [blame] | 1 | //===--- Mangle.h - Mangle C++ Names ----------------------------*- C++ -*-===// |
Douglas Gregor | 3556bc7 | 2009-02-13 00:10:09 +0000 | [diff] [blame] | 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // Implements C++ name mangling according to the Itanium C++ ABI, |
| 11 | // which is used in GCC 3.2 and newer (and many compilers that are |
| 12 | // ABI-compatible with GCC): |
| 13 | // |
| 14 | // http://www.codesourcery.com/public/cxx-abi/abi.html |
| 15 | // |
| 16 | //===----------------------------------------------------------------------===// |
Chris Lattner | 8af0e26 | 2009-03-21 08:24:40 +0000 | [diff] [blame] | 17 | |
Douglas Gregor | 3556bc7 | 2009-02-13 00:10:09 +0000 | [diff] [blame] | 18 | #ifndef LLVM_CLANG_CODEGEN_MANGLE_H |
| 19 | #define LLVM_CLANG_CODEGEN_MANGLE_H |
| 20 | |
Anders Carlsson | 6b6adf2 | 2009-04-15 05:36:58 +0000 | [diff] [blame] | 21 | #include "CGCXX.h" |
Mike Stump | 7e8c993 | 2009-07-31 18:25:34 +0000 | [diff] [blame] | 22 | #include "clang/AST/Type.h" |
Anders Carlsson | 6b6adf2 | 2009-04-15 05:36:58 +0000 | [diff] [blame] | 23 | |
Douglas Gregor | 3556bc7 | 2009-02-13 00:10:09 +0000 | [diff] [blame] | 24 | namespace llvm { |
| 25 | class raw_ostream; |
| 26 | } |
| 27 | |
| 28 | namespace clang { |
| 29 | class ASTContext; |
Anders Carlsson | 6b6adf2 | 2009-04-15 05:36:58 +0000 | [diff] [blame] | 30 | class CXXConstructorDecl; |
Anders Carlsson | 4811c30 | 2009-04-17 01:58:57 +0000 | [diff] [blame] | 31 | class CXXDestructorDecl; |
Douglas Gregor | 3556bc7 | 2009-02-13 00:10:09 +0000 | [diff] [blame] | 32 | class NamedDecl; |
Anders Carlsson | 53f73bc | 2009-04-13 18:02:10 +0000 | [diff] [blame] | 33 | class VarDecl; |
| 34 | |
Douglas Gregor | 3556bc7 | 2009-02-13 00:10:09 +0000 | [diff] [blame] | 35 | bool mangleName(const NamedDecl *D, ASTContext &Context, |
| 36 | llvm::raw_ostream &os); |
Mike Stump | eeba4ad | 2009-09-02 00:28:47 +0000 | [diff] [blame] | 37 | void mangleThunk(const NamedDecl *D, bool Virtual, int64_t n, int64_t vn, |
| 38 | ASTContext &Context, llvm::raw_ostream &os); |
Mike Stump | 28db39b | 2009-09-02 00:56:18 +0000 | [diff] [blame^] | 39 | void mangleCovariantThunk(const NamedDecl *D, bool VirtualThis, int64_t nv_t, |
| 40 | int64_t v_t, bool VirtualResult, int64_t nv_r, |
| 41 | int64_t v_r, ASTContext &Context, |
| 42 | llvm::raw_ostream &os); |
Anders Carlsson | 53f73bc | 2009-04-13 18:02:10 +0000 | [diff] [blame] | 43 | void mangleGuardVariable(const VarDecl *D, ASTContext &Context, |
| 44 | llvm::raw_ostream &os); |
Mike Stump | 7e8c993 | 2009-07-31 18:25:34 +0000 | [diff] [blame] | 45 | void mangleCXXVtable(QualType T, ASTContext &Context, llvm::raw_ostream &os); |
Mike Stump | 00df7d3 | 2009-07-31 23:15:31 +0000 | [diff] [blame] | 46 | void mangleCXXRtti(QualType T, ASTContext &Context, llvm::raw_ostream &os); |
Anders Carlsson | 6b6adf2 | 2009-04-15 05:36:58 +0000 | [diff] [blame] | 47 | void mangleCXXCtor(const CXXConstructorDecl *D, CXXCtorType Type, |
| 48 | ASTContext &Context, llvm::raw_ostream &os); |
Anders Carlsson | 4811c30 | 2009-04-17 01:58:57 +0000 | [diff] [blame] | 49 | void mangleCXXDtor(const CXXDestructorDecl *D, CXXDtorType Type, |
| 50 | ASTContext &Context, llvm::raw_ostream &os); |
Douglas Gregor | 3556bc7 | 2009-02-13 00:10:09 +0000 | [diff] [blame] | 51 | } |
| 52 | |
| 53 | #endif |