Charles Davis | 3a811f1 | 2010-05-25 19:52:27 +0000 | [diff] [blame^] | 1 | //===------- ItaniumCXXABI.cpp - Emit LLVM Code from ASTs for a Module ----===// |
| 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 | // This provides C++ code generation targetting the Itanium C++ ABI. The class |
| 11 | // in this file generates structures that follow the Itanium C++ ABI, which is |
| 12 | // documented at: |
| 13 | // http://www.codesourcery.com/public/cxx-abi/abi.html |
| 14 | // http://www.codesourcery.com/public/cxx-abi/abi-eh.html |
| 15 | //===----------------------------------------------------------------------===// |
| 16 | |
| 17 | #include "CGCXXABI.h" |
| 18 | #include "CodeGenModule.h" |
| 19 | #include "Mangle.h" |
| 20 | |
| 21 | using namespace clang; |
| 22 | |
| 23 | namespace { |
| 24 | class ItaniumCXXABI : public CodeGen::CXXABI { |
| 25 | CodeGen::MangleContext MangleCtx; |
| 26 | public: |
| 27 | ItaniumCXXABI(CodeGen::CodeGenModule &CGM) : |
| 28 | MangleCtx(CGM.getContext(), CGM.getDiags()) { } |
| 29 | |
| 30 | CodeGen::MangleContext &getMangleContext() { |
| 31 | return MangleCtx; |
| 32 | } |
| 33 | }; |
| 34 | } |
| 35 | |
| 36 | CodeGen::CXXABI *CodeGen::CreateItaniumCXXABI(CodeGenModule &CGM) { |
| 37 | return new ItaniumCXXABI(CGM); |
| 38 | } |
| 39 | |