summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorCharles Davis <cdavis@mines.edu>2010-05-25 19:52:27 +0000
committerCharles Davis <cdavis@mines.edu>2010-05-25 19:52:27 +0000
commit4e786ddccbb1321d0cccac57da2e887dd5fd83cb (patch)
treef92981c1fb0c5050c473e1e33bb3b7e6db0b9ddd /clang/lib/CodeGen/CodeGenModule.cpp
parent3311eb50d7a94debbe41f5abcbaab8fbc522fcad (diff)
downloadbcm5719-llvm-4e786ddccbb1321d0cccac57da2e887dd5fd83cb.tar.gz
bcm5719-llvm-4e786ddccbb1321d0cccac57da2e887dd5fd83cb.zip
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. llvm-svn: 104630
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index 2f8404e251e..1b89d622420 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -48,7 +48,7 @@ CodeGenModule::CodeGenModule(ASTContext &C, const CodeGenOptions &CGO,
Features(C.getLangOptions()), CodeGenOpts(CGO), TheModule(M),
TheTargetData(TD), TheTargetCodeGenInfo(0), Diags(diags),
Types(C, M, TD, getTargetCodeGenInfo().getABIInfo()),
- MangleCtx(C, diags), VTables(*this), Runtime(0),
+ VTables(*this), Runtime(0), ABI(0),
CFConstantStringClassRef(0),
NSConstantStringClassRef(0),
VMContext(M.getContext()) {
@@ -62,12 +62,17 @@ CodeGenModule::CodeGenModule(ASTContext &C, const CodeGenOptions &CGO,
else
Runtime = CreateMacObjCRuntime(*this);
+ if (!Features.CPlusPlus)
+ ABI = 0;
+ else createCXXABI();
+
// If debug info generation is enabled, create the CGDebugInfo object.
DebugInfo = CodeGenOpts.DebugInfo ? new CGDebugInfo(*this) : 0;
}
CodeGenModule::~CodeGenModule() {
delete Runtime;
+ delete ABI;
delete DebugInfo;
}
@@ -80,6 +85,11 @@ void CodeGenModule::createObjCRuntime() {
Runtime = CreateMacObjCRuntime(*this);
}
+void CodeGenModule::createCXXABI() {
+ // For now, just create an Itanium ABI.
+ ABI = CreateItaniumCXXABI(*this);
+}
+
void CodeGenModule::Release() {
EmitDeferred();
EmitCXXGlobalInitFunc();
OpenPOWER on IntegriCloud