Go back to asking CodeGenTypes whether a type is zero-initializable.
Make CGT defer to the ABI on all member pointer types.
This requires giving CGT a handle to the ABI.
It's way easier to make that work if we avoid lazily creating the ABI.
Make it so.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111786 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CodeGenModule.h b/lib/CodeGen/CodeGenModule.h
index 426499d..f44c823 100644
--- a/lib/CodeGen/CodeGenModule.h
+++ b/lib/CodeGen/CodeGenModule.h
@@ -109,6 +109,7 @@
const llvm::TargetData &TheTargetData;
mutable const TargetCodeGenInfo *TheTargetCodeGenInfo;
Diagnostic &Diags;
+ CGCXXABI &ABI;
CodeGenTypes Types;
/// VTables - Holds information about C++ vtables.
@@ -116,7 +117,6 @@
friend class CodeGenVTables;
CGObjCRuntime* Runtime;
- CGCXXABI* ABI;
CGDebugInfo* DebugInfo;
// WeakRefReferences - A set of references that have only been seen via
@@ -189,8 +189,6 @@
/// Lazily create the Objective-C runtime
void createObjCRuntime();
- /// Lazily create the C++ ABI
- void createCXXABI();
llvm::LLVMContext &VMContext;
@@ -228,15 +226,8 @@
/// been configured.
bool hasObjCRuntime() { return !!Runtime; }
- /// getCXXABI() - Return a reference to the configured
- /// C++ ABI.
- CGCXXABI &getCXXABI() {
- if (!ABI) createCXXABI();
- return *ABI;
- }
-
- /// hasCXXABI() - Return true iff a C++ ABI has been configured.
- bool hasCXXABI() { return !!ABI; }
+ /// getCXXABI() - Return a reference to the configured C++ ABI.
+ CGCXXABI &getCXXABI() { return ABI; }
llvm::Value *getStaticLocalDeclAddress(const VarDecl *VD) {
return StaticLocalDeclMap[VD];
@@ -253,8 +244,7 @@
llvm::Module &getModule() const { return TheModule; }
CodeGenTypes &getTypes() { return Types; }
MangleContext &getMangleContext() {
- if (!ABI) createCXXABI();
- return ABI->getMangleContext();
+ return ABI.getMangleContext();
}
CodeGenVTables &getVTables() { return VTables; }
Diagnostic &getDiags() const { return Diags; }