summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGException.cpp20
-rw-r--r--clang/lib/CodeGen/CGExprScalar.cpp7
-rw-r--r--clang/lib/CodeGen/CMakeLists.txt1
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.h2
4 files changed, 29 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGException.cpp b/clang/lib/CodeGen/CGException.cpp
new file mode 100644
index 00000000000..fe62fa78677
--- /dev/null
+++ b/clang/lib/CodeGen/CGException.cpp
@@ -0,0 +1,20 @@
+//===--- CGException.cpp - Emit LLVM Code for C++ exceptions --------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This contains code dealing with C++ exception related code generation.
+//
+//===----------------------------------------------------------------------===//
+
+#include "CodeGenFunction.h"
+using namespace clang;
+using namespace CodeGen;
+
+void CodeGenFunction::EmitCXXThrowExpr(const CXXThrowExpr *E) {
+ ErrorUnsupported(E, "throw expression");
+}
diff --git a/clang/lib/CodeGen/CGExprScalar.cpp b/clang/lib/CodeGen/CGExprScalar.cpp
index a42de7d14d8..4bff8c44b31 100644
--- a/clang/lib/CodeGen/CGExprScalar.cpp
+++ b/clang/lib/CodeGen/CGExprScalar.cpp
@@ -277,7 +277,12 @@ public:
Value *VisitCXXNullPtrLiteralExpr(const CXXNullPtrLiteralExpr *E) {
return llvm::Constant::getNullValue(ConvertType(E->getType()));
}
-
+
+ Value *VisitCXXThrowExpr(const CXXThrowExpr *E) {
+ CGF.EmitCXXThrowExpr(E);
+ return 0;
+ }
+
// Binary Operators.
Value *EmitMul(const BinOpInfo &Ops) {
if (CGF.getContext().getLangOptions().OverflowChecking
diff --git a/clang/lib/CodeGen/CMakeLists.txt b/clang/lib/CodeGen/CMakeLists.txt
index 2f46313c9c2..10884a7560f 100644
--- a/clang/lib/CodeGen/CMakeLists.txt
+++ b/clang/lib/CodeGen/CMakeLists.txt
@@ -10,6 +10,7 @@ add_clang_library(clangCodeGen
CGCall.cpp
CGDebugInfo.cpp
CGDecl.cpp
+ CGException.cpp
CGExpr.cpp
CGExprAgg.cpp
CGExprComplex.cpp
diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h
index e4ae77e35bc..c4b8945ce3e 100644
--- a/clang/lib/CodeGen/CodeGenFunction.h
+++ b/clang/lib/CodeGen/CodeGenFunction.h
@@ -1014,6 +1014,8 @@ public:
bool IsAggLocVolatile = false,
bool IsInitializer = false);
+ void EmitCXXThrowExpr(const CXXThrowExpr *E);
+
//===--------------------------------------------------------------------===//
// Internal Helpers
//===--------------------------------------------------------------------===//
OpenPOWER on IntegriCloud