Change CodeGenModule to only create ObjC runtime for ObjC files
- Changed CodeGenModule::getObjCRuntime to return reference.
- Added CodeGenModule::hasObjCRuntime predicate.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54645 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGExprScalar.cpp b/lib/CodeGen/CGExprScalar.cpp
index 63b8efc..2bd39c1 100644
--- a/lib/CodeGen/CGExprScalar.cpp
+++ b/lib/CodeGen/CGExprScalar.cpp
@@ -49,7 +49,9 @@
ScalarExprEmitter(CodeGenFunction &cgf) : CGF(cgf),
Builder(CGF.Builder),
- Runtime(CGF.CGM.getObjCRuntime()) {
+ Runtime(0) {
+ if (CGF.CGM.hasObjCRuntime())
+ Runtime = &CGF.CGM.getObjCRuntime();
}
//===--------------------------------------------------------------------===//