diff options
author | John McCall <rjmccall@apple.com> | 2017-08-15 21:42:52 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2017-08-15 21:42:52 +0000 |
commit | de0fe07eef6419bfa253b47e594f070c31cdbff2 (patch) | |
tree | 5db007777d03ef6217118aaac1fd2c4336c8c3e1 /clang/lib/CodeGen/CGException.cpp | |
parent | f1ef796fd9f1fb4412698acffb649d5fa1d55b18 (diff) | |
download | bcm5719-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/CGException.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGException.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGException.cpp b/clang/lib/CodeGen/CGException.cpp index 40ae0921098..709ed002643 100644 --- a/clang/lib/CodeGen/CGException.cpp +++ b/clang/lib/CodeGen/CGException.cpp @@ -15,6 +15,7 @@ #include "CGCXXABI.h" #include "CGCleanup.h" #include "CGObjCRuntime.h" +#include "ConstantEmitter.h" #include "TargetInfo.h" #include "clang/AST/Mangle.h" #include "clang/AST/StmtCXX.h" @@ -1800,7 +1801,8 @@ void CodeGenFunction::EnterSEHTryStmt(const SEHTryStmt &S) { // "catch i8* null". We can't do this on x86 because the filter has to save // the exception code. llvm::Constant *C = - CGM.EmitConstantExpr(Except->getFilterExpr(), getContext().IntTy, this); + ConstantEmitter(*this).tryEmitAbstract(Except->getFilterExpr(), + getContext().IntTy); if (CGM.getTarget().getTriple().getArch() != llvm::Triple::x86 && C && C->isOneValue()) { CatchScope->setCatchAllHandler(0, createBasicBlock("__except")); |