IRgen: Add a stub class for generating ABI-specific C++ code.

This class only supports name mangling (which is apparently used during C/ObjC
codegen). For now only the Itanium C++ ABI is supported. Patches to add a
second C++ ABI are forthcoming.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104630 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/ItaniumCXXABI.cpp b/lib/CodeGen/ItaniumCXXABI.cpp
new file mode 100644
index 0000000..98db75e
--- /dev/null
+++ b/lib/CodeGen/ItaniumCXXABI.cpp
@@ -0,0 +1,39 @@
+//===------- ItaniumCXXABI.cpp - Emit LLVM Code from ASTs for a Module ----===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This provides C++ code generation targetting the Itanium C++ ABI.  The class
+// in this file generates structures that follow the Itanium C++ ABI, which is
+// documented at:
+//  http://www.codesourcery.com/public/cxx-abi/abi.html
+//  http://www.codesourcery.com/public/cxx-abi/abi-eh.html
+//===----------------------------------------------------------------------===//
+
+#include "CGCXXABI.h"
+#include "CodeGenModule.h"
+#include "Mangle.h"
+
+using namespace clang;
+
+namespace {
+class ItaniumCXXABI : public CodeGen::CXXABI {
+  CodeGen::MangleContext MangleCtx;
+public:
+  ItaniumCXXABI(CodeGen::CodeGenModule &CGM) :
+    MangleCtx(CGM.getContext(), CGM.getDiags()) { }
+
+  CodeGen::MangleContext &getMangleContext() {
+    return MangleCtx;
+  }
+};
+}
+
+CodeGen::CXXABI *CodeGen::CreateItaniumCXXABI(CodeGenModule &CGM) {
+  return new ItaniumCXXABI(CGM);
+}
+