mirror of
				https://github.com/c64scene-ar/llvm-6502.git
				synced 2025-11-04 05:17:07 +00:00 
			
		
		
		
	Implement a really simple DwarfSjLjException.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130947 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
		@@ -193,6 +193,8 @@ bool AsmPrinter::doInitialization(Module &M) {
 | 
				
			|||||||
  case ExceptionHandling::None:
 | 
					  case ExceptionHandling::None:
 | 
				
			||||||
    return false;
 | 
					    return false;
 | 
				
			||||||
  case ExceptionHandling::SjLj:
 | 
					  case ExceptionHandling::SjLj:
 | 
				
			||||||
 | 
					    DE = new DwarfSjLjException(this);
 | 
				
			||||||
 | 
					    return false;
 | 
				
			||||||
  case ExceptionHandling::DwarfTable:
 | 
					  case ExceptionHandling::DwarfTable:
 | 
				
			||||||
    DE = new DwarfTableException(this);
 | 
					    DE = new DwarfTableException(this);
 | 
				
			||||||
    return false;
 | 
					    return false;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -8,6 +8,7 @@ add_llvm_library(LLVMAsmPrinter
 | 
				
			|||||||
  DwarfCompileUnit.cpp
 | 
					  DwarfCompileUnit.cpp
 | 
				
			||||||
  DwarfDebug.cpp
 | 
					  DwarfDebug.cpp
 | 
				
			||||||
  DwarfException.cpp
 | 
					  DwarfException.cpp
 | 
				
			||||||
 | 
					  DwarfSjLjException.cpp
 | 
				
			||||||
  DwarfTableException.cpp
 | 
					  DwarfTableException.cpp
 | 
				
			||||||
  OcamlGCPrinter.cpp
 | 
					  OcamlGCPrinter.cpp
 | 
				
			||||||
  )
 | 
					  )
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -238,6 +238,25 @@ public:
 | 
				
			|||||||
  virtual void EndFunction();
 | 
					  virtual void EndFunction();
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class DwarfSjLjException : public DwarfException {
 | 
				
			||||||
 | 
					public:
 | 
				
			||||||
 | 
					  //===--------------------------------------------------------------------===//
 | 
				
			||||||
 | 
					  // Main entry points.
 | 
				
			||||||
 | 
					  //
 | 
				
			||||||
 | 
					  DwarfSjLjException(AsmPrinter *A);
 | 
				
			||||||
 | 
					  virtual ~DwarfSjLjException();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  /// EndModule - Emit all exception information that should come after the
 | 
				
			||||||
 | 
					  /// content.
 | 
				
			||||||
 | 
					  virtual void EndModule();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  /// BeginFunction - Gather pre-function exception information.  Assumes being
 | 
				
			||||||
 | 
					  /// emitted immediately after the function entry point.
 | 
				
			||||||
 | 
					  virtual void BeginFunction(const MachineFunction *MF);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  /// EndFunction - Gather and emit post-function exception information.
 | 
				
			||||||
 | 
					  virtual void EndFunction();
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class ARMException : public DwarfException {
 | 
					class ARMException : public DwarfException {
 | 
				
			||||||
  /// shouldEmitTable - Per-function flag to indicate if EH tables should
 | 
					  /// shouldEmitTable - Per-function flag to indicate if EH tables should
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										46
									
								
								lib/CodeGen/AsmPrinter/DwarfSjLjException.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										46
									
								
								lib/CodeGen/AsmPrinter/DwarfSjLjException.cpp
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,46 @@
 | 
				
			|||||||
 | 
					//===-- CodeGen/AsmPrinter/DwarfTableException.cpp - Dwarf Exception Impl --==//
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					//                     The LLVM Compiler Infrastructure
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					// This file is distributed under the University of Illinois Open Source
 | 
				
			||||||
 | 
					// License. See LICENSE.TXT for details.
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					//===----------------------------------------------------------------------===//
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					// This file is a simple implementation of DwarfException that just produces
 | 
				
			||||||
 | 
					// the exception table for use with SjLj.
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					//===----------------------------------------------------------------------===//
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include "DwarfException.h"
 | 
				
			||||||
 | 
					#include "llvm/CodeGen/MachineLocation.h"
 | 
				
			||||||
 | 
					#include "llvm/CodeGen/MachineModuleInfo.h"
 | 
				
			||||||
 | 
					using namespace llvm;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					DwarfSjLjException::DwarfSjLjException(AsmPrinter *A) : DwarfException(A) {
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					DwarfSjLjException::~DwarfSjLjException() {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/// EndModule - Emit all exception information that should come after the
 | 
				
			||||||
 | 
					/// content.
 | 
				
			||||||
 | 
					void DwarfSjLjException::EndModule() {
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/// BeginFunction - Gather pre-function exception information. Assumes it's
 | 
				
			||||||
 | 
					/// being emitted immediately after the function entry point.
 | 
				
			||||||
 | 
					void DwarfSjLjException::BeginFunction(const MachineFunction *MF) {
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/// EndFunction - Gather and emit post-function exception information.
 | 
				
			||||||
 | 
					///
 | 
				
			||||||
 | 
					void DwarfSjLjException::EndFunction() {
 | 
				
			||||||
 | 
					  // Record if this personality index uses a landing pad.
 | 
				
			||||||
 | 
					  bool HasLandingPad = !MMI->getLandingPads().empty();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // Map all labels and get rid of any dead landing pads.
 | 
				
			||||||
 | 
					  MMI->TidyLandingPads();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  if (HasLandingPad)
 | 
				
			||||||
 | 
					    EmitExceptionTable();
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
		Reference in New Issue
	
	Block a user