From 1b340dc8e20dc1ce204ebdcc2ff11c3dd36888f1 Mon Sep 17 00:00:00 2001 From: Jim Laskey Date: Mon, 29 Jan 2007 20:48:32 +0000 Subject: [PATCH] Flag to control exception handling. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33628 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Target/TargetOptions.h | 5 +++++ lib/CodeGen/DwarfWriter.cpp | 5 +++-- lib/Target/TargetMachine.cpp | 6 ++++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/include/llvm/Target/TargetOptions.h b/include/llvm/Target/TargetOptions.h index 6bfe005c156..fcf2aa15bb1 100644 --- a/include/llvm/Target/TargetOptions.h +++ b/include/llvm/Target/TargetOptions.h @@ -59,6 +59,11 @@ namespace llvm { /// .bss section. This flag disables such behaviour (necessary, e.g. for /// crt*.o compiling). extern bool NoZerosInBSS; + + /// ExceptionHandling - This flag indicates that exception information should + /// be emitted. + extern bool ExceptionHandling; + } // End llvm namespace #endif diff --git a/lib/CodeGen/DwarfWriter.cpp b/lib/CodeGen/DwarfWriter.cpp index 62d9f7c74f2..2b9cf74f88a 100644 --- a/lib/CodeGen/DwarfWriter.cpp +++ b/lib/CodeGen/DwarfWriter.cpp @@ -29,8 +29,9 @@ #include "llvm/Target/TargetAsmInfo.h" #include "llvm/Target/MRegisterInfo.h" #include "llvm/Target/TargetData.h" -#include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetFrameInfo.h" +#include "llvm/Target/TargetMachine.h" +#include "llvm/Target/TargetOptions.h" #include #include using namespace llvm; @@ -2675,7 +2676,7 @@ public: /// manager has created it. Set by the target AsmPrinter. void SetModuleInfo(MachineModuleInfo *mmi) { // Make sure initial declarations are made. - if (!MMI && TAI->getSupportsExceptionHandling()) { + if (!MMI && ExceptionHandling && TAI->getSupportsExceptionHandling()) { MMI = mmi; shouldEmit = true; } diff --git a/lib/Target/TargetMachine.cpp b/lib/Target/TargetMachine.cpp index f6b3fd09f0b..842865391dd 100644 --- a/lib/Target/TargetMachine.cpp +++ b/lib/Target/TargetMachine.cpp @@ -29,6 +29,7 @@ namespace llvm { bool FiniteOnlyFPMathOption; bool UseSoftFloat; bool NoZerosInBSS; + bool ExceptionHandling; Reloc::Model RelocationModel; CodeModel::Model CMModel; } @@ -67,6 +68,11 @@ namespace { cl::desc("Don't place zero-initialized symbols into bss section"), cl::location(NoZerosInBSS), cl::init(false)); + cl::opt + EnableExceptionHandling("exception-handling", + cl::desc("Exception handling should be emitted."), + cl::location(ExceptionHandling), + cl::init(false)); cl::opt DefRelocationModel( -- 2.34.1