From 656ab16c56187efd58fd378fd4e556f61d4c97bf Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Sun, 16 Sep 2007 10:36:17 +0000 Subject: [PATCH] Only emit the personality function as a global value if the backend actually supports it. This solves this error on the Darwin x86-64 platform: $ cat testcase.ii struct A { A(); }; A *bork() { return new A; } $ llvm-g++ -arch x86_64 -c testcase.ii /var/tmp//cc3U8fd8.s:52:unknown section type: non_lazy_symbol_pointers /var/tmp//cc3U8fd8.s:52:Rest of line ignored. 1st junk character valued 76 (L). /var/tmp//cc3U8fd8.s:53:Unknown pseudo-op: .indirect_symbol /var/tmp//cc3U8fd8.s:53:Rest of line ignored. 1st junk character valued 95 (_). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41999 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/X86AsmPrinter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Target/X86/X86AsmPrinter.cpp b/lib/Target/X86/X86AsmPrinter.cpp index b7de8f002db..7049cf190ba 100644 --- a/lib/Target/X86/X86AsmPrinter.cpp +++ b/lib/Target/X86/X86AsmPrinter.cpp @@ -352,7 +352,7 @@ bool X86SharedAsmPrinter::doFinalization(Module &M) { O << "\n"; - if (MMI) { + if (TAI->doesSupportExceptionHandling() && MMI) { // Add the (possibly multiple) personalities to the set of global values. const std::vector& Personalities = MMI->getPersonalities();