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
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user