]> granicus.if.org Git - clang/commitdiff
Add CGException.cpp, to be used for exception related code generation.
authorAnders Carlsson <andersca@mac.com>
Fri, 30 Oct 2009 01:42:31 +0000 (01:42 +0000)
committerAnders Carlsson <andersca@mac.com>
Fri, 30 Oct 2009 01:42:31 +0000 (01:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85560 91177308-0d34-0410-b5e6-96231b3b80d8

clang.xcodeproj/project.pbxproj
lib/CodeGen/CGException.cpp [new file with mode: 0644]
lib/CodeGen/CGExprScalar.cpp
lib/CodeGen/CMakeLists.txt
lib/CodeGen/CodeGenFunction.h

index 1c6907197584de0c4a17209c58f755360dcce4b2..2b4aa04ca33c81e6d9e22195b5ee13ab37d0ffcb 100644 (file)
@@ -49,6 +49,7 @@
                1ADF47AF0F782C3200E48A8A /* SemaTemplateInstantiateDecl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1ADF47AE0F782C3200E48A8A /* SemaTemplateInstantiateDecl.cpp */; };
                1AE4EE3E103B89ED00888A23 /* StmtProfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AE4EE3D103B89ED00888A23 /* StmtProfile.cpp */; };
                1AE4EE40103B8A0A00888A23 /* TargetABIInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AE4EE3F103B8A0A00888A23 /* TargetABIInfo.cpp */; };
+               1AF1B50F109A4FB800AFAFAC /* CGException.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AF1B50E109A4FB800AFAFAC /* CGException.cpp */; };
                1AFEF4070F8A6B2300476F2B /* clang-cc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AFEF4050F8A6B2300476F2B /* clang-cc.cpp */; };
                1AFF8AE31012BFC900D248DA /* CGRecordLayoutBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AFF8AE11012BFC900D248DA /* CGRecordLayoutBuilder.cpp */; };
                3507E4C20E27FE2D00FB7B57 /* CheckObjCInstMethSignature.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3507E4C10E27FE2D00FB7B57 /* CheckObjCInstMethSignature.cpp */; };
                1AE4EE3B103B89CA00888A23 /* TreeTransform.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = TreeTransform.h; path = lib/Sema/TreeTransform.h; sourceTree = "<group>"; tabWidth = 2; };
                1AE4EE3D103B89ED00888A23 /* StmtProfile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = StmtProfile.cpp; path = lib/AST/StmtProfile.cpp; sourceTree = "<group>"; tabWidth = 2; };
                1AE4EE3F103B8A0A00888A23 /* TargetABIInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = TargetABIInfo.cpp; path = lib/CodeGen/TargetABIInfo.cpp; sourceTree = "<group>"; tabWidth = 2; };
+               1AF1B50E109A4FB800AFAFAC /* CGException.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGException.cpp; path = lib/CodeGen/CGException.cpp; sourceTree = "<group>"; tabWidth = 2; };
                1AFEF4050F8A6B2300476F2B /* clang-cc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = "clang-cc.cpp"; path = "tools/clang-cc/clang-cc.cpp"; sourceTree = "<group>"; tabWidth = 2; };
                1AFF8AE11012BFC900D248DA /* CGRecordLayoutBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; name = CGRecordLayoutBuilder.cpp; path = lib/CodeGen/CGRecordLayoutBuilder.cpp; sourceTree = "<group>"; tabWidth = 2; };
                1AFF8AE21012BFC900D248DA /* CGRecordLayoutBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.h; name = CGRecordLayoutBuilder.h; path = lib/CodeGen/CGRecordLayoutBuilder.h; sourceTree = "<group>"; tabWidth = 2; };
                                35A3E7000DD3874400757F74 /* CGDebugInfo.cpp */,
                                35A3E7010DD3874400757F74 /* CGDebugInfo.h */,
                                DE4264FB0C113592005A861D /* CGDecl.cpp */,
+                               1AF1B50E109A4FB800AFAFAC /* CGException.cpp */,
                                DE4772FB0C10EAEC002239E8 /* CGExpr.cpp */,
                                DEF2EFF20C6CDD74000C4259 /* CGExprAgg.cpp */,
                                DE224FF70C7AA98800D370A5 /* CGExprComplex.cpp */,
                                1A535ED9107BC45E000C3AE7 /* CXXInheritance.cpp in Sources */,
                                1A6C01F7108128710072DEE4 /* CGRtti.cpp in Sources */,
                                1A81AA19108144F40094E50B /* CGVtable.cpp in Sources */,
+                               1AF1B50F109A4FB800AFAFAC /* CGException.cpp in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
diff --git a/lib/CodeGen/CGException.cpp b/lib/CodeGen/CGException.cpp
new file mode 100644 (file)
index 0000000..fe62fa7
--- /dev/null
@@ -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");
+}
index a42de7d14d83cb7d4c9f4160f04428acffbe91be..4bff8c44b315e254fe5b84ae61abcd72d899624e 100644 (file)
@@ -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
index 2f46313c9c207684112bd5cba0b66a69fe6c949a..10884a7560f567bae32281eb02557a59b3ec85b5 100644 (file)
@@ -10,6 +10,7 @@ add_clang_library(clangCodeGen
   CGCall.cpp
   CGDebugInfo.cpp
   CGDecl.cpp
+  CGException.cpp
   CGExpr.cpp
   CGExprAgg.cpp
   CGExprComplex.cpp
index e4ae77e35bc4f6104960cac361d834d23e9aef28..c4b8945ce3eafa223331616115a35e8f5c35584c 100644 (file)
@@ -1014,6 +1014,8 @@ public:
                                     bool IsAggLocVolatile = false,
                                     bool IsInitializer = false);
 
+  void EmitCXXThrowExpr(const CXXThrowExpr *E);
+  
   //===--------------------------------------------------------------------===//
   //                             Internal Helpers
   //===--------------------------------------------------------------------===//