summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGBlocks.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2017-08-15 21:42:52 +0000
committerJohn McCall <rjmccall@apple.com>2017-08-15 21:42:52 +0000
commitde0fe07eef6419bfa253b47e594f070c31cdbff2 (patch)
tree5db007777d03ef6217118aaac1fd2c4336c8c3e1 /clang/lib/CodeGen/CGBlocks.cpp
parentf1ef796fd9f1fb4412698acffb649d5fa1d55b18 (diff)
downloadbcm5719-llvm-de0fe07eef6419bfa253b47e594f070c31cdbff2.tar.gz
bcm5719-llvm-de0fe07eef6419bfa253b47e594f070c31cdbff2.zip
Extract IRGen's constant-emitter into its own helper class and clean up
the interface. The ultimate goal here is to make it easier to do some more interesting things in constant emission, like emit constant initializers that have ignorable side-effects, or doing the majority of an initialization in-place and then patching up the last few things with calls. But for now this is mostly just a refactoring. llvm-svn: 310964
Diffstat (limited to 'clang/lib/CodeGen/CGBlocks.cpp')
-rw-r--r--clang/lib/CodeGen/CGBlocks.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGBlocks.cpp b/clang/lib/CodeGen/CGBlocks.cpp
index 18104895787..8d82898fda9 100644
--- a/clang/lib/CodeGen/CGBlocks.cpp
+++ b/clang/lib/CodeGen/CGBlocks.cpp
@@ -16,6 +16,7 @@
#include "CGObjCRuntime.h"
#include "CodeGenFunction.h"
#include "CodeGenModule.h"
+#include "ConstantEmitter.h"
#include "clang/CodeGen/ConstantInitBuilder.h"
#include "clang/AST/DeclObjC.h"
#include "llvm/ADT/SmallSet.h"
@@ -290,7 +291,7 @@ static llvm::Constant *tryCaptureAsConstant(CodeGenModule &CGM,
const Expr *init = var->getInit();
if (!init) return nullptr;
- return CGM.EmitConstantInit(*var, CGF);
+ return ConstantEmitter(CGM, CGF).tryEmitAbstractForInitializer(*var);
}
/// Get the low bit of a nonzero character count. This is the
OpenPOWER on IntegriCloud